aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/BUG-HUNTING24
-rw-r--r--Documentation/CodingStyle49
-rw-r--r--Documentation/DocBook/gadget.tmpl2
-rw-r--r--Documentation/DocBook/usb.tmpl28
-rw-r--r--Documentation/HOWTO20
-rw-r--r--Documentation/SubmitChecklist6
-rw-r--r--Documentation/SubmittingPatches39
-rw-r--r--Documentation/block/capability.txt15
-rw-r--r--Documentation/dontdiff42
-rw-r--r--Documentation/feature-removal-schedule.txt3
-rw-r--r--Documentation/filesystems/directory-locking5
-rw-r--r--Documentation/filesystems/porting8
-rw-r--r--Documentation/hrtimer/timer_stats.txt7
-rw-r--r--Documentation/i386/boot.txt32
-rw-r--r--Documentation/ia64/aliasing-test.c2
-rw-r--r--Documentation/initrd.txt74
-rw-r--r--Documentation/kernel-parameters.txt66
-rw-r--r--Documentation/ldm.txt21
-rw-r--r--Documentation/memory-barriers.txt98
-rw-r--r--Documentation/networking/xfrm_sysctl.txt4
-rw-r--r--Documentation/s390/cds.txt82
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt1
-rw-r--r--Documentation/spi/spi-summary53
-rw-r--r--Documentation/thinkpad-acpi.txt25
-rw-r--r--Documentation/vm/slub.txt135
-rw-r--r--MAINTAINERS65
-rw-r--r--Makefile4
-rw-r--r--arch/alpha/Kconfig42
-rw-r--r--arch/alpha/boot/tools/mkbb.c2
-rw-r--r--arch/alpha/kernel/console.c70
-rw-r--r--arch/alpha/kernel/core_marvel.c43
-rw-r--r--arch/alpha/kernel/core_titan.c70
-rw-r--r--arch/alpha/kernel/core_tsunami.c24
-rw-r--r--arch/alpha/kernel/entry.S7
-rw-r--r--arch/alpha/kernel/pci_iommu.c3
-rw-r--r--arch/alpha/kernel/proto.h9
-rw-r--r--arch/alpha/kernel/setup.c3
-rw-r--r--arch/alpha/kernel/signal.c110
-rw-r--r--arch/alpha/kernel/sys_dp264.c11
-rw-r--r--arch/alpha/kernel/sys_marvel.c4
-rw-r--r--arch/alpha/kernel/sys_titan.c2
-rw-r--r--arch/alpha/kernel/systbls.S32
-rw-r--r--arch/alpha/kernel/vmlinux.lds.S4
-rw-r--r--arch/alpha/lib/Makefile3
-rw-r--r--arch/alpha/lib/fls.c38
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/common/dmabounce.c2
-rw-r--r--arch/arm/common/gic.c22
-rw-r--r--arch/arm/common/sharpsl_param.c2
-rw-r--r--arch/arm/common/sharpsl_pm.c22
-rw-r--r--arch/arm/kernel/armksyms.c2
-rw-r--r--arch/arm/kernel/asm-offsets.c2
-rw-r--r--arch/arm/kernel/calls.S4
-rw-r--r--arch/arm/kernel/setup.c2
-rw-r--r--arch/arm/kernel/stacktrace.c2
-rw-r--r--arch/arm/kernel/sys_arm.c2
-rw-r--r--arch/arm/kernel/vmlinux.lds.S4
-rw-r--r--arch/arm/lib/bitops.h2
-rw-r--r--arch/arm/mach-at91/board-carmeva.c8
-rw-r--r--arch/arm/mach-at91/board-dk.c2
-rw-r--r--arch/arm/mach-at91/board-kb9202.c2
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c2
-rw-r--r--arch/arm/mach-footbridge/cats-pci.c2
-rw-r--r--arch/arm/mach-h720x/cpu-h7202.c4
-rw-r--r--arch/arm/mach-imx/cpufreq.c2
-rw-r--r--arch/arm/mach-imx/dma.c8
-rw-r--r--arch/arm/mach-imx/generic.c1
-rw-r--r--arch/arm/mach-integrator/Makefile1
-rw-r--r--arch/arm/mach-integrator/core.c18
-rw-r--r--arch/arm/mach-integrator/headsmp.S37
-rw-r--r--arch/arm/mach-integrator/pci_v3.c1
-rw-r--r--arch/arm/mach-integrator/platsmp.c204
-rw-r--r--arch/arm/mach-iop13xx/irq.c54
-rw-r--r--arch/arm/mach-iop13xx/msi.c18
-rw-r--r--arch/arm/mach-iop13xx/pci.c13
-rw-r--r--arch/arm/mach-iop32x/glantank.c2
-rw-r--r--arch/arm/mach-iop32x/iq31244.c4
-rw-r--r--arch/arm/mach-iop32x/iq80321.c2
-rw-r--r--arch/arm/mach-iop32x/irq.c4
-rw-r--r--arch/arm/mach-iop32x/n2100.c2
-rw-r--r--arch/arm/mach-iop33x/iq80331.c2
-rw-r--r--arch/arm/mach-iop33x/iq80332.c2
-rw-r--r--arch/arm/mach-iop33x/irq.c12
-rw-r--r--arch/arm/mach-ixp2000/enp2611.c2
-rw-r--r--arch/arm/mach-ixp2000/ixdp2400.c2
-rw-r--r--arch/arm/mach-ixp2000/ixdp2800.c2
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x00.c6
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x01.c6
-rw-r--r--arch/arm/mach-ixp2000/pci.c2
-rw-r--r--arch/arm/mach-ixp23xx/core.c2
-rw-r--r--arch/arm/mach-ixp23xx/ixdp2351.c2
-rw-r--r--arch/arm/mach-ixp23xx/pci.c2
-rw-r--r--arch/arm/mach-ixp23xx/roadrunner.c2
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig3
-rw-r--r--arch/arm/mach-ixp4xx/common.c2
-rw-r--r--arch/arm/mach-ixp4xx/coyote-pci.c4
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-setup.c24
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/ixdpg425-pci.c4
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-setup.c3
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-setup.c37
-rw-r--r--arch/arm/mach-lh7a40x/lcd-panel.h6
-rw-r--r--arch/arm/mach-ns9xxx/time.c2
-rw-r--r--arch/arm/mach-omap1/Kconfig2
-rw-r--r--arch/arm/mach-omap1/board-osk.c2
-rw-r--r--arch/arm/mach-omap1/board-palmte.c2
-rw-r--r--arch/arm/mach-omap1/pm.c2
-rw-r--r--arch/arm/mach-omap2/clock.c2
-rw-r--r--arch/arm/mach-omap2/clock.h4
-rw-r--r--arch/arm/mach-pxa/corgi_lcd.c10
-rw-r--r--arch/arm/mach-pxa/corgi_ssp.c2
-rw-r--r--arch/arm/mach-realview/localtimer.c2
-rw-r--r--arch/arm/mach-s3c2410/bast.h2
-rw-r--r--arch/arm/mach-s3c2410/mach-amlm5900.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c1
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c1
-rw-r--r--arch/arm/mach-s3c2412/dma.c4
-rw-r--r--arch/arm/mach-s3c2412/s3c2412.c33
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c1
-rw-r--r--arch/arm/mach-s3c2443/clock.c23
-rw-r--r--arch/arm/mach-s3c2443/mach-smdk2443.c1
-rw-r--r--arch/arm/mach-s3c2443/s3c2443.c4
-rw-r--r--arch/arm/mach-sa1100/neponset.c4
-rw-r--r--arch/arm/mach-sa1100/time.c2
-rw-r--r--arch/arm/mm/Kconfig13
-rw-r--r--arch/arm/mm/Makefile1
-rw-r--r--arch/arm/mm/alignment.c4
-rw-r--r--arch/arm/mm/ioremap.c2
-rw-r--r--arch/arm/mm/mmap.c2
-rw-r--r--arch/arm/mm/mmu.c2
-rw-r--r--arch/arm/mm/proc-v7.S2
-rw-r--r--arch/arm/mm/tlb-v7.S88
-rw-r--r--arch/arm/nwfpe/softfloat.h3
-rw-r--r--arch/arm/oprofile/op_model_mpcore.c9
-rw-r--r--arch/arm/plat-iop/pci.c7
-rw-r--r--arch/arm/plat-omap/common.c2
-rw-r--r--arch/arm/plat-omap/dma.c2
-rw-r--r--arch/arm/plat-omap/sram.c6
-rw-r--r--arch/arm/plat-omap/usb.c2
-rw-r--r--arch/arm/plat-s3c24xx/common-smdk.c5
-rw-r--r--arch/arm/plat-s3c24xx/devs.c35
-rw-r--r--arch/arm/plat-s3c24xx/dma.c2
-rw-r--r--arch/arm/plat-s3c24xx/pm-simtec.c1
-rw-r--r--arch/arm/plat-s3c24xx/pm.c2
-rw-r--r--arch/arm26/kernel/vmlinux-arm26-xip.lds.in4
-rw-r--r--arch/arm26/kernel/vmlinux-arm26.lds.in4
-rw-r--r--arch/avr32/kernel/vmlinux.lds.c4
-rw-r--r--arch/blackfin/Kconfig12
-rw-r--r--arch/blackfin/Makefile1
-rw-r--r--arch/blackfin/configs/BF533-EZKIT_defconfig1014
-rw-r--r--arch/blackfin/configs/BF533-STAMP_defconfig1296
-rw-r--r--arch/blackfin/configs/BF537-STAMP_defconfig1332
-rw-r--r--arch/blackfin/configs/BF561-EZKIT_defconfig1073
-rw-r--r--arch/blackfin/configs/PNAV-10_defconfig1253
-rw-r--r--arch/blackfin/defconfig43
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c223
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c11
-rw-r--r--arch/blackfin/kernel/setup.c32
-rw-r--r--arch/blackfin/kernel/traps.c18
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S4
-rw-r--r--arch/blackfin/lib/ins.S20
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c47
-rw-r--r--arch/blackfin/mach-bf533/head.S77
-rw-r--r--arch/blackfin/mach-bf537/cpu.c22
-rw-r--r--arch/blackfin/mach-bf537/head.S103
-rw-r--r--arch/blackfin/mach-bf561/boards/Makefile3
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c64
-rw-r--r--arch/blackfin/mach-bf561/boards/tepla.c61
-rw-r--r--arch/blackfin/mach-bf561/head.S79
-rw-r--r--arch/blackfin/mach-common/entry.S11
-rw-r--r--arch/blackfin/mach-common/pm.c12
-rw-r--r--arch/blackfin/mm/init.c3
-rw-r--r--arch/frv/kernel/vmlinux.lds.S6
-rw-r--r--arch/h8300/kernel/sys_h8300.c4
-rw-r--r--arch/h8300/kernel/traps.c2
-rw-r--r--arch/h8300/kernel/vmlinux.lds.S4
-rw-r--r--arch/i386/Kconfig2
-rw-r--r--arch/i386/boot/setup.S2
-rw-r--r--arch/i386/defconfig249
-rw-r--r--arch/i386/kernel/cpu/amd.c4
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-ich.c1
-rw-r--r--arch/i386/kernel/cpu/cyrix.c1
-rw-r--r--arch/i386/kernel/cpu/mcheck/k7.c6
-rw-r--r--arch/i386/kernel/cpu/mtrr/cyrix.c2
-rw-r--r--arch/i386/kernel/cpu/mtrr/state.c2
-rw-r--r--arch/i386/kernel/microcode.c2
-rw-r--r--arch/i386/kernel/reboot.c8
-rw-r--r--arch/i386/kernel/smpboot.c5
-rw-r--r--arch/i386/kernel/verify_cpu.S27
-rw-r--r--arch/i386/kernel/vmi.c1
-rw-r--r--arch/i386/kernel/vmlinux.lds.S4
-rw-r--r--arch/i386/mach-generic/bigsmp.c6
-rw-r--r--arch/i386/mm/mmap.c1
-rw-r--r--arch/i386/oprofile/nmi_int.c17
-rw-r--r--arch/i386/pci/fixup.c11
-rw-r--r--arch/ia64/kernel/acpi-processor.c2
-rw-r--r--arch/ia64/kernel/acpi.c3
-rw-r--r--arch/ia64/kernel/process.c5
-rw-r--r--arch/ia64/kernel/smpboot.c4
-rw-r--r--arch/ia64/kernel/unwind.c21
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S9
-rw-r--r--arch/ia64/pci/pci.c11
-rw-r--r--arch/ia64/sn/kernel/setup.c2
-rw-r--r--arch/m32r/kernel/vmlinux.lds.S4
-rw-r--r--arch/m68k/Kconfig13
-rw-r--r--arch/m68k/Makefile1
-rw-r--r--arch/m68k/kernel/Makefile3
-rw-r--r--arch/m68k/kernel/module.c31
-rw-r--r--arch/m68k/kernel/module.lds7
-rw-r--r--arch/m68k/kernel/setup.c37
-rw-r--r--arch/m68k/kernel/vmlinux-std.lds9
-rw-r--r--arch/m68k/kernel/vmlinux-sun3.lds9
-rw-r--r--arch/m68k/mac/debug.c2
-rw-r--r--arch/m68k/mm/init.c119
-rw-r--r--arch/m68k/mm/memory.c73
-rw-r--r--arch/m68k/mm/motorola.c104
-rw-r--r--arch/m68k/sun3/config.c2
-rw-r--r--arch/m68knommu/kernel/vmlinux.lds.S4
-rw-r--r--arch/mips/jmr3927/rbhma3100/kgdb_io.c2
-rw-r--r--arch/mips/kernel/unaligned.c2
-rw-r--r--arch/mips/kernel/vmlinux.lds.S4
-rw-r--r--arch/mips/mm/ioremap.c2
-rw-r--r--arch/mips/pci/pci-ocelot.c14
-rw-r--r--arch/mips/sgi-ip32/Makefile2
-rw-r--r--arch/mips/sgi-ip32/ip32-platform.c20
-rw-r--r--arch/parisc/kernel/cache.c2
-rw-r--r--arch/parisc/kernel/processor.c2
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S4
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/Makefile1
-rw-r--r--arch/powerpc/boot/Makefile22
-rw-r--r--arch/powerpc/boot/dts/lite5200.dts2
-rw-r--r--arch/powerpc/boot/dts/lite5200b.dts2
-rwxr-xr-xarch/powerpc/boot/wrapper4
-rw-r--r--arch/powerpc/kernel/cputable.c4
-rw-r--r--arch/powerpc/kernel/irq.c6
-rw-r--r--arch/powerpc/kernel/pmc.c6
-rw-r--r--arch/powerpc/kernel/prom.c11
-rw-r--r--arch/powerpc/kernel/ptrace.c2
-rw-r--r--arch/powerpc/kernel/smp.c34
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S4
-rw-r--r--arch/powerpc/mm/mem.c9
-rw-r--r--arch/powerpc/mm/mmap.c1
-rw-r--r--arch/powerpc/mm/pgtable_32.c2
-rw-r--r--arch/powerpc/platforms/chrp/pegasos_eth.c2
-rw-r--r--arch/powerpc/platforms/pasemi/idle.c1
-rw-r--r--arch/powerpc/platforms/powermac/setup.c2
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c1
-rw-r--r--arch/powerpc/platforms/pseries/xics.c10
-rw-r--r--arch/powerpc/sysdev/qe_lib/Kconfig4
-rw-r--r--arch/ppc/kernel/entry.S18
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c2
-rw-r--r--arch/ppc/kernel/vmlinux.lds.S4
-rw-r--r--arch/ppc/mm/hashtable.S20
-rw-r--r--arch/ppc/mm/pgtable.c2
-rw-r--r--arch/ppc/syslib/ibm_ocp.c1
-rw-r--r--arch/s390/hypfs/hypfs_diag.c17
-rw-r--r--arch/s390/kernel/compat_wrapper.S28
-rw-r--r--arch/s390/kernel/debug.c22
-rw-r--r--arch/s390/kernel/kprobes.c2
-rw-r--r--arch/s390/kernel/setup.c4
-rw-r--r--arch/s390/kernel/smp.c6
-rw-r--r--arch/s390/kernel/syscalls.S5
-rw-r--r--arch/s390/kernel/vmlinux.lds.S4
-rw-r--r--arch/s390/mm/init.c38
-rw-r--r--arch/sh/Makefile2
-rw-r--r--arch/sh/boards/landisk/gio.c2
-rw-r--r--arch/sh/boards/landisk/setup.c6
-rw-r--r--arch/sh/boards/renesas/r7780rp/Makefile5
-rw-r--r--arch/sh/boards/snapgear/rtc.c2
-rw-r--r--arch/sh/boards/superh/microdev/io.c6
-rw-r--r--arch/sh/boards/superh/microdev/irq.c6
-rw-r--r--arch/sh/boards/superh/microdev/setup.c2
-rw-r--r--arch/sh/boards/unknown/setup.c2
-rw-r--r--arch/sh/drivers/dma/dma-api.c3
-rw-r--r--arch/sh/drivers/dma/dma-isa.c2
-rw-r--r--arch/sh/drivers/dma/dmabrg.c2
-rw-r--r--arch/sh/drivers/pci/ops-dreamcast.c2
-rw-r--r--arch/sh/drivers/pci/pci-st40.c6
-rw-r--r--arch/sh/drivers/pci/pci-st40.h2
-rw-r--r--arch/sh/drivers/superhyway/ops-sh4-202.c2
-rw-r--r--arch/sh/kernel/cf-enabler.c8
-rw-r--r--arch/sh/kernel/cpu/clock.c7
-rw-r--r--arch/sh/kernel/cpu/irq/maskreg.c2
-rw-r--r--arch/sh/kernel/cpu/sh3/entry.S1
-rw-r--r--arch/sh/kernel/cpu/sh4/fpu.c2
-rw-r--r--arch/sh/kernel/cpu/sh4/probe.c1
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7750.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7722.c34
-rw-r--r--arch/sh/kernel/kgdb_stub.c4
-rw-r--r--arch/sh/kernel/process.c33
-rw-r--r--arch/sh/kernel/smp.c2
-rw-r--r--arch/sh/kernel/syscalls.S3
-rw-r--r--arch/sh/kernel/timers/timer.c5
-rw-r--r--arch/sh/kernel/traps.c13
-rw-r--r--arch/sh/kernel/vmlinux.lds.S4
-rw-r--r--arch/sh/kernel/vsyscall/vsyscall.c1
-rw-r--r--arch/sh/math-emu/math.c2
-rw-r--r--arch/sh/mm/copy_page.S1
-rw-r--r--arch/sh/mm/fault.c39
-rw-r--r--arch/sh/mm/init.c3
-rw-r--r--arch/sh/mm/pmb.c79
-rw-r--r--arch/sh/tools/mach-types5
-rw-r--r--arch/sh64/kernel/vmlinux.lds.S4
-rw-r--r--arch/sparc/Kconfig7
-rw-r--r--arch/sparc/kernel/time.c4
-rw-r--r--arch/sparc/kernel/vmlinux.lds.S4
-rw-r--r--arch/sparc/lib/atomic32.c15
-rw-r--r--arch/sparc64/Kconfig6
-rw-r--r--arch/sparc64/kernel/Makefile4
-rw-r--r--arch/sparc64/kernel/devices.c196
-rw-r--r--arch/sparc64/kernel/entry.S647
-rw-r--r--arch/sparc64/kernel/head.S31
-rw-r--r--arch/sparc64/kernel/hvapi.c5
-rw-r--r--arch/sparc64/kernel/irq.c83
-rw-r--r--arch/sparc64/kernel/itlb_miss.S4
-rw-r--r--arch/sparc64/kernel/mdesc.c619
-rw-r--r--arch/sparc64/kernel/pci.c54
-rw-r--r--arch/sparc64/kernel/pci_sabre.c7
-rw-r--r--arch/sparc64/kernel/pci_sun4v.c54
-rw-r--r--arch/sparc64/kernel/power.c2
-rw-r--r--arch/sparc64/kernel/process.c4
-rw-r--r--arch/sparc64/kernel/prom.c148
-rw-r--r--arch/sparc64/kernel/setup.c18
-rw-r--r--arch/sparc64/kernel/smp.c155
-rw-r--r--arch/sparc64/kernel/sstate.c104
-rw-r--r--arch/sparc64/kernel/sun4v_ivec.S30
-rw-r--r--arch/sparc64/kernel/time.c47
-rw-r--r--arch/sparc64/kernel/traps.c27
-rw-r--r--arch/sparc64/kernel/vmlinux.lds.S15
-rw-r--r--arch/sparc64/mm/init.c90
-rw-r--r--arch/sparc64/prom/misc.c19
-rw-r--r--arch/um/kernel/dyn.lds.S5
-rw-r--r--arch/um/kernel/uml.lds.S4
-rw-r--r--arch/um/os-Linux/start_up.c24
-rw-r--r--arch/v850/kernel/vmlinux.lds.S4
-rw-r--r--arch/x86_64/Kconfig7
-rw-r--r--arch/x86_64/defconfig286
-rw-r--r--arch/x86_64/ia32/mmap32.c1
-rw-r--r--arch/x86_64/kernel/early_printk.c2
-rw-r--r--arch/x86_64/kernel/k8.c7
-rw-r--r--arch/x86_64/kernel/reboot.c1
-rw-r--r--arch/x86_64/kernel/vmlinux.lds.S4
-rw-r--r--arch/x86_64/kernel/vsyscall.c5
-rw-r--r--arch/x86_64/mm/init.c6
-rw-r--r--arch/xtensa/kernel/vmlinux.lds.S6
-rw-r--r--block/genhd.c33
-rw-r--r--crypto/api.c4
-rw-r--r--crypto/cryptd.c4
-rw-r--r--drivers/acpi/asus_acpi.c2
-rw-r--r--drivers/acpi/numa.c2
-rw-r--r--drivers/acpi/osl.c118
-rw-r--r--drivers/acpi/tables/tbinstal.c8
-rw-r--r--drivers/acpi/thermal.c13
-rw-r--r--drivers/acpi/toshiba_acpi.c2
-rw-r--r--drivers/acpi/utilities/utcopy.c120
-rw-r--r--drivers/acpi/utilities/uteval.c28
-rw-r--r--drivers/acpi/utilities/utobject.c42
-rw-r--r--drivers/acpi/utilities/utxface.c4
-rw-r--r--drivers/ata/Kconfig2
-rw-r--r--drivers/ata/ahci.c13
-rw-r--r--drivers/ata/ata_generic.c2
-rw-r--r--drivers/ata/ata_piix.c10
-rw-r--r--drivers/ata/libata-core.c19
-rw-r--r--drivers/ata/libata-eh.c2
-rw-r--r--drivers/ata/libata-scsi.c5
-rw-r--r--drivers/ata/pata_artop.c6
-rw-r--r--drivers/ata/pata_cmd640.c4
-rw-r--r--drivers/ata/pata_cmd64x.c2
-rw-r--r--drivers/ata/pata_cs5520.c2
-rw-r--r--drivers/ata/pata_cs5530.c2
-rw-r--r--drivers/ata/pata_cs5535.c2
-rw-r--r--drivers/ata/pata_cypress.c2
-rw-r--r--drivers/ata/pata_hpt366.c28
-rw-r--r--drivers/ata/pata_hpt37x.c37
-rw-r--r--drivers/ata/pata_hpt3x2n.c4
-rw-r--r--drivers/ata/pata_hpt3x3.c2
-rw-r--r--drivers/ata/pata_isapnp.c2
-rw-r--r--drivers/ata/pata_it8213.c2
-rw-r--r--drivers/ata/pata_it821x.c3
-rw-r--r--drivers/ata/pata_ixp4xx_cf.c2
-rw-r--r--drivers/ata/pata_jmicron.c2
-rw-r--r--drivers/ata/pata_legacy.c2
-rw-r--r--drivers/ata/pata_platform.c2
-rw-r--r--drivers/ata/pata_qdi.c2
-rw-r--r--drivers/ata/pata_rz1000.c2
-rw-r--r--drivers/ata/pata_sc1200.c2
-rw-r--r--drivers/ata/pata_scc.c48
-rw-r--r--drivers/ata/pata_serverworks.c2
-rw-r--r--drivers/ata/pata_sis.c46
-rw-r--r--drivers/ata/pata_sl82c105.c2
-rw-r--r--drivers/ata/pata_via.c38
-rw-r--r--drivers/ata/pata_winbond.c2
-rw-r--r--drivers/ata/pdc_adma.c2
-rw-r--r--drivers/ata/sata_inic162x.c2
-rw-r--r--drivers/ata/sata_mv.c46
-rw-r--r--drivers/ata/sata_nv.c6
-rw-r--r--drivers/ata/sata_promise.c2
-rw-r--r--drivers/ata/sata_qstor.c2
-rw-r--r--drivers/ata/sata_sil.c2
-rw-r--r--drivers/ata/sata_sil24.c2
-rw-r--r--drivers/ata/sata_sis.c4
-rw-r--r--drivers/ata/sata_svw.c2
-rw-r--r--drivers/ata/sata_sx4.c2
-rw-r--r--drivers/ata/sata_uli.c2
-rw-r--r--drivers/ata/sata_via.c5
-rw-r--r--drivers/ata/sata_vsc.c2
-rw-r--r--drivers/atm/idt77252.c27
-rw-r--r--drivers/atm/idt77252.h4
-rw-r--r--drivers/auxdisplay/Kconfig4
-rw-r--r--drivers/auxdisplay/cfag12864bfb.c8
-rw-r--r--drivers/base/dmapool.c1
-rw-r--r--drivers/block/floppy.c2
-rw-r--r--drivers/bluetooth/hci_usb.c16
-rw-r--r--drivers/char/Kconfig2
-rw-r--r--drivers/char/agp/frontend.c1
-rw-r--r--drivers/char/agp/generic.c1
-rw-r--r--drivers/char/cyclades.c1
-rw-r--r--drivers/char/drm/Kconfig2
-rw-r--r--drivers/char/drm/drm_drawable.c41
-rw-r--r--drivers/char/drm/drm_pciids.h7
-rw-r--r--drivers/char/drm/i915_irq.c2
-rw-r--r--drivers/char/hangcheck-timer.c2
-rw-r--r--drivers/char/n_tty.c1
-rw-r--r--drivers/char/random.c67
-rw-r--r--drivers/char/tty_io.c3
-rw-r--r--drivers/char/watchdog/ixp2000_wdt.c2
-rw-r--r--drivers/crypto/geode-aes.c12
-rw-r--r--drivers/crypto/geode-aes.h3
-rw-r--r--drivers/firewire/Kconfig14
-rw-r--r--drivers/firewire/Makefile12
-rw-r--r--drivers/firewire/fw-card.c5
-rw-r--r--drivers/firewire/fw-cdev.c19
-rw-r--r--drivers/firewire/fw-device.h1
-rw-r--r--drivers/firewire/fw-ohci.c188
-rw-r--r--drivers/firewire/fw-sbp2.c53
-rw-r--r--drivers/hwmon/Kconfig2
-rw-r--r--drivers/hwmon/applesmc.c17
-rw-r--r--drivers/hwmon/coretemp.c32
-rw-r--r--drivers/hwmon/ds1621.c8
-rw-r--r--drivers/hwmon/hwmon-vid.c4
-rw-r--r--drivers/hwmon/w83627hf.c4
-rw-r--r--drivers/i2c/busses/i2c-pxa.c23
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c3
-rw-r--r--drivers/i2c/busses/i2c-tiny-usb.c2
-rw-r--r--drivers/i2c/i2c-core.c5
-rw-r--r--drivers/ide/ide-dma.c4
-rw-r--r--drivers/ide/ide-proc.c2
-rw-r--r--drivers/ide/pci/atiixp.c1
-rw-r--r--drivers/ide/pci/serverworks.c14
-rw-r--r--drivers/ieee1394/eth1394.c91
-rw-r--r--drivers/ieee1394/eth1394.h4
-rw-r--r--drivers/ieee1394/nodemgr.c7
-rw-r--r--drivers/ieee1394/nodemgr.h1
-rw-r--r--drivers/ieee1394/raw1394.c8
-rw-r--r--drivers/ieee1394/sbp2.c32
-rw-r--r--drivers/infiniband/core/cache.c1
-rw-r--r--drivers/infiniband/core/cm.c29
-rw-r--r--drivers/infiniband/core/device.c136
-rw-r--r--drivers/infiniband/core/umem.c5
-rw-r--r--drivers/infiniband/hw/ehca/ehca_mrmw.c7
-rw-r--r--drivers/infiniband/hw/ehca/hcp_if.c2
-rw-r--r--drivers/infiniband/hw/ipath/ipath_verbs_mcast.c16
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c236
-rw-r--r--drivers/infiniband/hw/mlx4/srq.c6
-rw-r--r--drivers/infiniband/hw/mlx4/user.h5
-rw-r--r--drivers/infiniband/hw/mthca/mthca_av.c1
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cmd.c1
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cq.c1
-rw-r--r--drivers/infiniband/hw/mthca/mthca_main.c4
-rw-r--r--drivers/infiniband/hw/mthca/mthca_memfree.c1
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c165
-rw-r--r--drivers/infiniband/hw/mthca/mthca_srq.c1
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib.h49
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c206
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c118
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c7
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c2
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_verbs.c40
-rw-r--r--drivers/input/joystick/iforce/iforce-main.c4
-rw-r--r--drivers/input/joystick/iforce/iforce-packets.c10
-rw-r--r--drivers/input/joystick/iforce/iforce-usb.c5
-rw-r--r--drivers/input/misc/input-polldev.c5
-rw-r--r--drivers/input/mouse/alps.c58
-rw-r--r--drivers/input/mouse/logips2pp.c1
-rw-r--r--drivers/input/serio/sa1111ps2.c4
-rw-r--r--drivers/input/touchscreen/Kconfig8
-rw-r--r--drivers/input/touchscreen/ads7846.c3
-rw-r--r--drivers/input/touchscreen/hp680_ts_input.c7
-rw-r--r--drivers/input/touchscreen/ucb1400_ts.c4
-rw-r--r--drivers/isdn/Kconfig9
-rw-r--r--drivers/isdn/hardware/eicon/capifunc.c16
-rw-r--r--drivers/isdn/hardware/eicon/diva_didd.c2
-rw-r--r--drivers/isdn/hardware/eicon/divasfunc.c2
-rw-r--r--drivers/isdn/hardware/eicon/message.c13
-rw-r--r--drivers/isdn/hisax/config.c2
-rw-r--r--drivers/isdn/hisax/hfc_usb.c43
-rw-r--r--drivers/isdn/hisax/hisax_fcpcipnp.c6
-rw-r--r--drivers/isdn/hisax/st5481_init.c7
-rw-r--r--drivers/isdn/hisax/st5481_usb.c1
-rw-r--r--drivers/isdn/i4l/isdn_tty.c3
-rw-r--r--drivers/isdn/icn/icn.c1
-rw-r--r--drivers/isdn/sc/message.c2
-rw-r--r--drivers/kvm/kvm.h1
-rw-r--r--drivers/kvm/kvm_main.c1
-rw-r--r--drivers/kvm/svm.c1
-rw-r--r--drivers/kvm/vmx.c3
-rw-r--r--drivers/macintosh/Kconfig3
-rw-r--r--drivers/macintosh/adbhid.c16
-rw-r--r--drivers/md/bitmap.c17
-rw-r--r--drivers/md/linear.c10
-rw-r--r--drivers/md/md.c20
-rw-r--r--drivers/md/raid0.c3
-rw-r--r--drivers/media/dvb/bt8xx/dst.c3
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c15
-rw-r--r--drivers/media/video/cafe_ccic-regs.h6
-rw-r--r--drivers/media/video/cafe_ccic.c18
-rw-r--r--drivers/media/video/em28xx/Kconfig3
-rw-r--r--drivers/media/video/ivtv/Kconfig2
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.h8
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c12
-rw-r--r--drivers/media/video/ov7670.c21
-rw-r--r--drivers/media/video/tuner-simple.c10
-rw-r--r--drivers/message/fusion/mptbase.h2
-rw-r--r--drivers/message/fusion/mptscsih.c8
-rw-r--r--drivers/message/i2o/driver.c26
-rw-r--r--drivers/mfd/ucb1x00-ts.c11
-rw-r--r--drivers/misc/phantom.c29
-rw-r--r--drivers/misc/thinkpad_acpi.c17
-rw-r--r--drivers/misc/thinkpad_acpi.h6
-rw-r--r--drivers/misc/tifm_7xx1.c2
-rw-r--r--drivers/mmc/card/block.c18
-rw-r--r--drivers/mmc/card/queue.c35
-rw-r--r--drivers/mmc/card/queue.h8
-rw-r--r--drivers/mtd/devices/pmc551.c2
-rw-r--r--drivers/mtd/nand/autcpu12.c2
-rw-r--r--drivers/mtd/nand/ppchameleonevb.c6
-rw-r--r--drivers/net/Kconfig4
-rw-r--r--drivers/net/amd8111e.c2
-rw-r--r--drivers/net/amd8111e.h2
-rw-r--r--drivers/net/arcnet/Kconfig17
-rw-r--r--drivers/net/cassini.c5
-rw-r--r--drivers/net/chelsio/suni1x10gexp_regs.h2
-rw-r--r--drivers/net/declance.c2
-rw-r--r--drivers/net/defxx.c1
-rw-r--r--drivers/net/e1000/e1000_main.c5
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c2
-rw-r--r--drivers/net/fec_8xx/fec_main.c2
-rw-r--r--drivers/net/forcedeth.c2
-rw-r--r--drivers/net/hp100.c2
-rw-r--r--drivers/net/meth.c68
-rw-r--r--drivers/net/mlx4/alloc.c2
-rw-r--r--drivers/net/mlx4/fw.c2
-rw-r--r--drivers/net/phy/fixed.c4
-rw-r--r--drivers/net/skfp/smt.c2
-rw-r--r--drivers/net/sky2.c6
-rw-r--r--drivers/net/sky2.h24
-rw-r--r--drivers/net/spider_net.c6
-rw-r--r--drivers/net/tokenring/Kconfig33
-rw-r--r--drivers/net/ucc_geth.c3
-rw-r--r--drivers/net/ucc_geth_mii.c2
-rw-r--r--drivers/net/usb/asix.c4
-rw-r--r--drivers/net/usb/cdc_ether.c16
-rw-r--r--drivers/net/usb/rndis_host.c1
-rw-r--r--drivers/net/usb/usbnet.c25
-rw-r--r--drivers/net/usb/usbnet.h1
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_tx.c13
-rw-r--r--drivers/net/wireless/libertas/decl.h2
-rw-r--r--drivers/net/wireless/libertas/fw.c14
-rw-r--r--drivers/net/wireless/libertas/rx.c24
-rw-r--r--drivers/net/wireless/prism54/islpci_eth.c5
-rw-r--r--drivers/oprofile/buffer_sync.c1
-rw-r--r--drivers/pci/hotplug/ibmphp_hpc.c1
-rw-r--r--drivers/pci/msi.c12
-rw-r--r--drivers/pci/pcie/aer/aerdrv.h1
-rw-r--r--drivers/pci/quirks.c20
-rw-r--r--drivers/pci/search.c3
-rw-r--r--drivers/pcmcia/at91_cf.c13
-rw-r--r--drivers/rtc/rtc-cmos.c13
-rw-r--r--drivers/s390/block/dasd_eer.c16
-rw-r--r--drivers/s390/char/raw3270.c10
-rw-r--r--drivers/s390/cio/device.c49
-rw-r--r--drivers/s390/cio/device_fsm.c6
-rw-r--r--drivers/s390/scsi/zfcp_aux.c1
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c5
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c40
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c3
-rw-r--r--drivers/sbus/char/flash.c1
-rw-r--r--drivers/scsi/Kconfig14
-rw-r--r--drivers/scsi/Makefile5
-rw-r--r--drivers/scsi/NCR5380.c2
-rw-r--r--drivers/scsi/aacraid/aachba.c15
-rw-r--r--drivers/scsi/aacraid/aacraid.h3
-rw-r--r--drivers/scsi/aacraid/rx.c8
-rw-r--r--drivers/scsi/aacraid/sa.c9
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_core.c2
-rw-r--r--drivers/scsi/aic7xxx/aicasm/aicasm_gram.y1
-rw-r--r--drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y1
-rw-r--r--drivers/scsi/aic94xx/aic94xx_tmf.c14
-rw-r--r--drivers/scsi/ipr.c7
-rw-r--r--drivers/scsi/jazz_esp.c429
-rw-r--r--drivers/scsi/libsrp.c1
-rw-r--r--drivers/scsi/megaraid/megaraid_mm.c2
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.c67
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.h14
-rw-r--r--drivers/scsi/pluto.c18
-rw-r--r--drivers/scsi/scsi_devinfo.c1
-rw-r--r--drivers/scsi/sd.c18
-rw-r--r--drivers/scsi/stex.c90
-rw-r--r--drivers/serial/amba-pl010.c3
-rw-r--r--drivers/serial/amba-pl011.c3
-rw-r--r--drivers/serial/bfin_5xx.c125
-rw-r--r--drivers/serial/serial_ks8695.c6
-rw-r--r--drivers/serial/suncore.c6
-rw-r--r--drivers/serial/sunzilog.c4
-rw-r--r--drivers/spi/atmel_spi.c8
-rw-r--r--drivers/spi/mpc52xx_psc_spi.c25
-rw-r--r--drivers/spi/omap_uwire.c4
-rw-r--r--drivers/spi/spi_bfin5xx.c152
-rw-r--r--drivers/spi/spi_imx.c3
-rw-r--r--drivers/spi/spidev.c13
-rw-r--r--drivers/usb/class/usblp.c2
-rw-r--r--drivers/usb/core/config.c10
-rw-r--r--drivers/usb/core/driver.c18
-rw-r--r--drivers/usb/core/hcd.c8
-rw-r--r--drivers/usb/core/hub.c53
-rw-r--r--drivers/usb/core/message.c9
-rw-r--r--drivers/usb/core/sysfs.c7
-rw-r--r--drivers/usb/core/usb.c10
-rw-r--r--drivers/usb/gadget/fsl_usb2_udc.c8
-rw-r--r--drivers/usb/host/ehci-fsl.c13
-rw-r--r--drivers/usb/host/ehci-fsl.h1
-rw-r--r--drivers/usb/host/ohci-pci.c2
-rw-r--r--drivers/usb/host/pci-quirks.c9
-rw-r--r--drivers/usb/host/u132-hcd.c12
-rw-r--r--drivers/usb/misc/auerswald.c10
-rw-r--r--drivers/usb/misc/ftdi-elan.c12
-rw-r--r--drivers/usb/misc/ldusb.c35
-rw-r--r--drivers/usb/serial/ark3116.c3
-rw-r--r--drivers/usb/serial/ftdi_sio.c40
-rw-r--r--drivers/usb/serial/ftdi_sio.h12
-rw-r--r--drivers/usb/serial/mos7840.c5
-rw-r--r--drivers/usb/serial/omninet.c2
-rw-r--r--drivers/usb/serial/option.c1
-rw-r--r--drivers/usb/serial/sierra.c2
-rw-r--r--drivers/usb/storage/onetouch.c9
-rw-r--r--drivers/usb/storage/unusual_devs.h10
-rw-r--r--drivers/video/Kconfig183
-rw-r--r--drivers/video/arkfb.c3
-rw-r--r--drivers/video/console/fbcon.h1
-rw-r--r--drivers/video/imxfb.c24
-rw-r--r--drivers/video/neofb.c30
-rw-r--r--drivers/video/pm2fb.c17
-rw-r--r--drivers/video/pm3fb.c335
-rw-r--r--drivers/video/ps3fb.c8
-rw-r--r--drivers/video/skeletonfb.c31
-rw-r--r--drivers/video/vt8623fb.c3
-rw-r--r--drivers/video/w100fb.c14
-rw-r--r--fs/9p/vfs_addr.c1
-rw-r--r--fs/9p/vfs_dentry.c1
-rw-r--r--fs/9p/vfs_inode.c1
-rw-r--r--fs/9p/vfs_super.c1
-rw-r--r--fs/Kconfig.binfmt2
-rw-r--r--fs/affs/inode.c2
-rw-r--r--fs/affs/super.c1
-rw-r--r--fs/afs/callback.c1
-rw-r--r--fs/afs/cell.c1
-rw-r--r--fs/afs/dir.c1
-rw-r--r--fs/afs/inode.c1
-rw-r--r--fs/afs/internal.h3
-rw-r--r--fs/afs/main.c1
-rw-r--r--fs/afs/proc.c1
-rw-r--r--fs/afs/security.c1
-rw-r--r--fs/afs/super.c1
-rw-r--r--fs/afs/vlocation.c1
-rw-r--r--fs/afs/vnode.c1
-rw-r--r--fs/afs/volume.c1
-rw-r--r--fs/binfmt_misc.c2
-rw-r--r--fs/buffer.c2
-rw-r--r--fs/coda/cache.c1
-rw-r--r--fs/coda/upcall.c2
-rw-r--r--fs/compat.c17
-rw-r--r--fs/compat_ioctl.c33
-rw-r--r--fs/configfs/inode.c1
-rw-r--r--fs/ecryptfs/file.c59
-rw-r--r--fs/ecryptfs/messaging.c2
-rw-r--r--fs/ecryptfs/mmap.c38
-rw-r--r--fs/exec.c3
-rw-r--r--fs/ext4/balloc.c6
-rw-r--r--fs/ext4/extents.c148
-rw-r--r--fs/ext4/inode.c4
-rw-r--r--fs/ext4/namei.c4
-rw-r--r--fs/ext4/super.c2
-rw-r--r--fs/fifo.c1
-rw-r--r--fs/fuse/dir.c2
-rw-r--r--fs/fuse/file.c5
-rw-r--r--fs/fuse/inode.c2
-rw-r--r--fs/gfs2/glock.h1
-rw-r--r--fs/hfs/inode.c1
-rw-r--r--fs/hfsplus/inode.c1
-rw-r--r--fs/hpfs/buffer.c2
-rw-r--r--fs/hpfs/namei.c2
-rw-r--r--fs/hpfs/super.c1
-rw-r--r--fs/minix/bitmap.c1
-rw-r--r--fs/ncpfs/file.c1
-rw-r--r--fs/ncpfs/ioctl.c1
-rw-r--r--fs/nfs/client.c2
-rw-r--r--fs/nfs/dir.c1
-rw-r--r--fs/nfs/direct.c65
-rw-r--r--fs/nfs/file.c1
-rw-r--r--fs/nfs/inode.c2
-rw-r--r--fs/nfs/pagelist.c21
-rw-r--r--fs/nfs/write.c6
-rw-r--r--fs/nfsd/nfs4callback.c1
-rw-r--r--fs/nfsd/nfs4recover.c2
-rw-r--r--fs/nfsd/nfssvc.c2
-rw-r--r--fs/ntfs/file.c1
-rw-r--r--fs/ntfs/inode.c2
-rw-r--r--fs/ocfs2/aops.c11
-rw-r--r--fs/ocfs2/file.c33
-rw-r--r--fs/ocfs2/localalloc.c7
-rw-r--r--fs/partitions/Kconfig12
-rw-r--r--fs/partitions/ldm.c206
-rw-r--r--fs/partitions/ldm.h6
-rw-r--r--fs/ramfs/file-nommu.c2
-rw-r--r--fs/ramfs/inode.c2
-rw-r--r--fs/reiserfs/dir.c2
-rw-r--r--fs/signalfd.c120
-rw-r--r--fs/smbfs/dir.c1
-rw-r--r--fs/smbfs/file.c1
-rw-r--r--fs/smbfs/inode.c1
-rw-r--r--fs/smbfs/request.c1
-rw-r--r--fs/sysfs/inode.c1
-rw-r--r--fs/udf/file.c1
-rw-r--r--fs/udf/inode.c12
-rw-r--r--fs/udf/namei.c1
-rw-r--r--fs/udf/super.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c26
-rw-r--r--include/acpi/acpi_numa.h2
-rw-r--r--include/acpi/acpiosxf.h3
-rw-r--r--include/acpi/acpixf.h2
-rw-r--r--include/acpi/acutils.h2
-rw-r--r--include/asm-alpha/bitops.h50
-rw-r--r--include/asm-alpha/core_t2.h26
-rw-r--r--include/asm-alpha/core_titan.h7
-rw-r--r--include/asm-alpha/core_tsunami.h15
-rw-r--r--include/asm-alpha/core_wildfire.h2
-rw-r--r--include/asm-alpha/thread_info.h2
-rw-r--r--include/asm-alpha/unistd.h48
-rw-r--r--include/asm-alpha/vga.h31
-rw-r--r--include/asm-arm/arch-at91/at91_adc.h2
-rw-r--r--include/asm-arm/arch-integrator/smp.h18
-rw-r--r--include/asm-arm/arch-ixp4xx/nas100d.h28
-rw-r--r--include/asm-arm/arch-ixp4xx/nslu2.h46
-rw-r--r--include/asm-arm/arch-ixp4xx/platform.h1
-rw-r--r--include/asm-arm/arch-s3c2410/irqs.h2
-rw-r--r--include/asm-arm/arch-s3c2410/map.h4
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpioj.h4
-rw-r--r--include/asm-arm/arch-s3c2410/regs-s3c2412.h21
-rw-r--r--include/asm-arm/arch-s3c2410/regs-spi.h2
-rw-r--r--include/asm-arm/io.h2
-rw-r--r--include/asm-arm/ioctls.h4
-rw-r--r--include/asm-arm/mach/arch.h2
-rw-r--r--include/asm-arm/mmu.h4
-rw-r--r--include/asm-arm/mmu_context.h2
-rw-r--r--include/asm-arm/plat-s3c24xx/devs.h1
-rw-r--r--include/asm-arm/setup.h4
-rw-r--r--include/asm-arm/termbits.h16
-rw-r--r--include/asm-arm/termios.h6
-rw-r--r--include/asm-arm/tlbflush.h15
-rw-r--r--include/asm-arm/unistd.h10
-rw-r--r--include/asm-arm26/setup.h2
-rw-r--r--include/asm-blackfin/bfin-global.h1
-rw-r--r--include/asm-blackfin/gpio.h14
-rw-r--r--include/asm-blackfin/io.h20
-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.h1187
-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.h1089
-rw-r--r--include/asm-blackfin/mach-bf527/defBF52x_base.h2009
-rw-r--r--include/asm-blackfin/mach-bf533/cdefBF532.h36
-rw-r--r--include/asm-blackfin/mach-bf533/defBF532.h207
-rw-r--r--include/asm-blackfin/mach-bf537/cdefBF534.h17
-rw-r--r--include/asm-blackfin/mach-bf537/cdefBF537.h3
-rw-r--r--include/asm-blackfin/mach-bf537/defBF534.h90
-rw-r--r--include/asm-blackfin/mach-bf537/defBF537.h8
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF542.h590
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF544.h978
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF548.h1610
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF549.h1896
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF54x_base.h2722
-rw-r--r--include/asm-blackfin/mach-bf548/defBF542.h1206
-rw-r--r--include/asm-blackfin/mach-bf548/defBF544.h766
-rw-r--r--include/asm-blackfin/mach-bf548/defBF548.h1966
-rw-r--r--include/asm-blackfin/mach-bf548/defBF549.h3472
-rw-r--r--include/asm-blackfin/mach-bf548/defBF54x_base.h4902
-rw-r--r--include/asm-blackfin/mach-bf561/cdefBF561.h6
-rw-r--r--include/asm-blackfin/mach-bf561/defBF561.h105
-rw-r--r--include/asm-blackfin/mach-common/cdef_LPBlackfin.h143
-rw-r--r--include/asm-blackfin/processor.h4
-rw-r--r--include/asm-blackfin/uaccess.h4
-rw-r--r--include/asm-generic/bug.h2
-rw-r--r--include/asm-generic/vmlinux.lds.h22
-rw-r--r--include/asm-h8300/processor.h2
-rw-r--r--include/asm-i386/atomic.h2
-rw-r--r--include/asm-i386/local.h2
-rw-r--r--include/asm-i386/tlbflush.h2
-rw-r--r--include/asm-ia64/acpi.h7
-rw-r--r--include/asm-ia64/unistd.h13
-rw-r--r--include/asm-m68k/mmzone.h9
-rw-r--r--include/asm-m68k/module.h34
-rw-r--r--include/asm-m68k/motorola_pgtable.h10
-rw-r--r--include/asm-m68k/page.h77
-rw-r--r--include/asm-m68k/pgalloc.h3
-rw-r--r--include/asm-m68k/pgtable.h17
-rw-r--r--include/asm-m68k/sun3_pgtable.h4
-rw-r--r--include/asm-m68k/virtconvert.h49
-rw-r--r--include/asm-mips/pgalloc.h1
-rw-r--r--include/asm-parisc/mmu_context.h1
-rw-r--r--include/asm-parisc/tlbflush.h1
-rw-r--r--include/asm-powerpc/mmu_context.h1
-rw-r--r--include/asm-powerpc/pgalloc-64.h3
-rw-r--r--include/asm-powerpc/tlb.h9
-rw-r--r--include/asm-s390/unistd.h21
-rw-r--r--include/asm-sh/cpu-sh4/freq.h3
-rw-r--r--include/asm-sh/dma.h1
-rw-r--r--include/asm-sh/dreamcast/sysasic.h2
-rw-r--r--include/asm-sh/io.h6
-rw-r--r--include/asm-sh/kdebug.h4
-rw-r--r--include/asm-sh/landisk/gio.h10
-rw-r--r--include/asm-sh/landisk/iodata_landisk.h37
-rw-r--r--include/asm-sh/smp.h2
-rw-r--r--include/asm-sh/spinlock.h8
-rw-r--r--include/asm-sh/spinlock_types.h4
-rw-r--r--include/asm-sh/unistd.h5
-rw-r--r--include/asm-sparc/atomic.h38
-rw-r--r--include/asm-sparc64/bugs.h8
-rw-r--r--include/asm-sparc64/cpudata.h24
-rw-r--r--include/asm-sparc64/hypervisor.h811
-rw-r--r--include/asm-sparc64/kdebug.h1
-rw-r--r--include/asm-sparc64/mdesc.h39
-rw-r--r--include/asm-sparc64/oplib.h7
-rw-r--r--include/asm-sparc64/percpu.h4
-rw-r--r--include/asm-sparc64/prom.h1
-rw-r--r--include/asm-sparc64/smp.h4
-rw-r--r--include/asm-sparc64/sstate.h13
-rw-r--r--include/asm-sparc64/thread_info.h8
-rw-r--r--include/asm-sparc64/topology.h3
-rw-r--r--include/asm-sparc64/tsb.h2
-rw-r--r--include/asm-x86_64/calgary.h1
-rw-r--r--include/asm-x86_64/tlbflush.h1
-rw-r--r--include/linux/Kbuild3
-rw-r--r--include/linux/bootmem.h1
-rw-r--r--include/linux/capability.h2
-rw-r--r--include/linux/compiler.h4
-rw-r--r--include/linux/errno.h7
-rw-r--r--include/linux/ext4_fs.h33
-rw-r--r--include/linux/ext4_fs_extents.h5
-rw-r--r--include/linux/ext4_fs_i.h6
-rw-r--r--include/linux/fb.h1
-rw-r--r--include/linux/firewire-cdev.h14
-rw-r--r--include/linux/freezer.h69
-rw-r--r--include/linux/genhd.h5
-rw-r--r--include/linux/if_ether.h1
-rw-r--r--include/linux/init.h13
-rw-r--r--include/linux/ipv6.h3
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/mm.h11
-rw-r--r--include/linux/netdevice.h27
-rw-r--r--include/linux/netfilter/nf_conntrack_ftp.h3
-rw-r--r--include/linux/netfilter/nf_conntrack_h323_types.h23
-rw-r--r--include/linux/nfs_page.h1
-rw-r--r--include/linux/pci_ids.h7
-rw-r--r--include/linux/raid/bitmap.h1
-rw-r--r--include/linux/sched.h13
-rw-r--r--include/linux/serial_core.h1
-rw-r--r--include/linux/smb_fs.h1
-rw-r--r--include/linux/task_io_accounting_ops.h2
-rw-r--r--include/linux/timer.h6
-rw-r--r--include/linux/videodev2.h2
-rw-r--r--include/linux/writeback.h2
-rw-r--r--include/net/bluetooth/l2cap.h8
-rw-r--r--include/net/dst.h7
-rw-r--r--include/net/ipv6.h3
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/tcp.h6
-rw-r--r--include/net/xfrm.h1
-rw-r--r--include/rdma/ib_umem.h1
-rw-r--r--include/rdma/ib_verbs.h8
-rw-r--r--include/sound/version.h4
-rw-r--r--init/main.c2
-rw-r--r--kernel/exit.c7
-rw-r--r--kernel/fork.c3
-rw-r--r--kernel/futex_compat.c9
-rw-r--r--kernel/irq/spurious.c46
-rw-r--r--kernel/kallsyms.c3
-rw-r--r--kernel/kthread.c7
-rw-r--r--kernel/power/process.c57
-rw-r--r--kernel/power/swap.c2
-rw-r--r--kernel/profile.c1
-rw-r--r--kernel/sched.c4
-rw-r--r--kernel/signal.c24
-rw-r--r--kernel/time/ntp.c2
-rw-r--r--kernel/time/tick-broadcast.c17
-rw-r--r--kernel/time/tick-sched.c28
-rw-r--r--kernel/time/timer_stats.c44
-rw-r--r--kernel/timer.c10
-rw-r--r--kernel/workqueue.c84
-rw-r--r--lib/Kconfig.debug8
-rw-r--r--lib/ioremap.c2
-rw-r--r--mm/filemap_xip.c1
-rw-r--r--mm/madvise.c1
-rw-r--r--mm/memory_hotplug.c2
-rw-r--r--mm/mlock.c11
-rw-r--r--mm/msync.c1
-rw-r--r--mm/page_alloc.c51
-rw-r--r--mm/slab.c2
-rw-r--r--mm/slub.c26
-rw-r--r--mm/sparse.c13
-rw-r--r--mm/vmstat.c1
-rw-r--r--net/bluetooth/l2cap.c144
-rw-r--r--net/bridge/br_fdb.c14
-rw-r--r--net/bridge/br_stp.c3
-rw-r--r--net/bridge/br_stp_timer.c2
-rw-r--r--net/core/dev.c10
-rw-r--r--net/core/net-sysfs.c8
-rw-r--r--net/core/rtnetlink.c38
-rw-r--r--net/core/skbuff.c5
-rw-r--r--net/core/sock.c14
-rw-r--r--net/core/sysctl_net_core.c18
-rw-r--r--net/core/utils.c6
-rw-r--r--net/dccp/Kconfig15
-rw-r--r--net/dccp/ccids/ccid3.c3
-rw-r--r--net/dccp/ipv6.c10
-rw-r--r--net/ieee80211/ieee80211_module.c2
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_module.c5
-rw-r--r--net/ipv4/fib_frontend.c11
-rw-r--r--net/ipv4/fib_hash.c6
-rw-r--r--net/ipv4/fib_lookup.h3
-rw-r--r--net/ipv4/fib_semantics.c5
-rw-r--r--net/ipv4/fib_trie.c6
-rw-r--r--net/ipv4/icmp.c5
-rw-r--r--net/ipv4/ipvs/Kconfig30
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c2
-rw-r--r--net/ipv4/netfilter/nf_nat_ftp.c20
-rw-r--r--net/ipv4/netfilter/nf_nat_h323.c6
-rw-r--r--net/ipv4/route.c71
-rw-r--r--net/ipv4/tcp.c5
-rw-r--r--net/ipv4/tcp_input.c3
-rw-r--r--net/ipv4/tcp_probe.c5
-rw-r--r--net/ipv4/tcp_timer.c4
-rw-r--r--net/ipv4/xfrm4_input.c6
-rw-r--r--net/ipv4/xfrm4_mode_tunnel.c2
-rw-r--r--net/ipv6/addrconf.c31
-rw-r--r--net/ipv6/ah6.c2
-rw-r--r--net/ipv6/datagram.c8
-rw-r--r--net/ipv6/ip6_fib.c9
-rw-r--r--net/ipv6/raw.c8
-rw-r--r--net/ipv6/route.c63
-rw-r--r--net/ipv6/tcp_ipv6.c8
-rw-r--r--net/ipv6/udp.c8
-rw-r--r--net/ipv6/xfrm6_input.c6
-rw-r--r--net/ipv6/xfrm6_mode_tunnel.c1
-rw-r--r--net/key/af_key.c2
-rw-r--r--net/mac80211/ieee80211.c6
-rw-r--r--net/mac80211/ieee80211_sta.c4
-rw-r--r--net/netfilter/nf_conntrack_core.c8
-rw-r--r--net/netfilter/nf_conntrack_ftp.c13
-rw-r--r--net/netfilter/nf_conntrack_h323_main.c41
-rw-r--r--net/netfilter/nf_conntrack_h323_types.c31
-rw-r--r--net/packet/af_packet.c56
-rw-r--r--net/rfkill/rfkill.c2
-rw-r--r--net/rxrpc/Kconfig2
-rw-r--r--net/rxrpc/ar-call.c19
-rw-r--r--net/rxrpc/ar-proc.c19
-rw-r--r--net/sched/sch_generic.c2
-rw-r--r--net/sched/sch_htb.c5
-rw-r--r--net/sctp/Kconfig14
-rw-r--r--net/tipc/Kconfig24
-rw-r--r--net/tipc/eth_media.c10
-rw-r--r--net/xfrm/xfrm_algo.c140
-rw-r--r--net/xfrm/xfrm_policy.c29
-rw-r--r--net/xfrm/xfrm_state.c15
-rw-r--r--scripts/Makefile.headersinst2
-rw-r--r--scripts/checkpatch.pl595
-rw-r--r--scripts/kconfig/lxdialog/check-lxdialog.sh24
-rw-r--r--scripts/mod/file2alias.c11
-rw-r--r--scripts/mod/modpost.c90
-rw-r--r--scripts/mod/sumversion.c1
-rw-r--r--scripts/package/buildtar4
-rw-r--r--sound/arm/sa11xx-uda1341.c2
-rw-r--r--sound/pci/ali5451/ali5451.c6
-rw-r--r--sound/pci/hda/hda_codec.c13
-rw-r--r--sound/pci/hda/hda_local.h2
-rw-r--r--sound/pci/hda/patch_conexant.c48
-rw-r--r--sound/pci/hda/patch_realtek.c5
-rw-r--r--sound/pci/hda/patch_si3054.c2
-rw-r--r--sound/pci/hda/patch_sigmatel.c64
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c2
-rw-r--r--sound/sound_firmware.c1
1007 files changed, 44720 insertions, 6619 deletions
diff --git a/Documentation/BUG-HUNTING b/Documentation/BUG-HUNTING
index 65b97e1dbf70..35f5bd243336 100644
--- a/Documentation/BUG-HUNTING
+++ b/Documentation/BUG-HUNTING
@@ -191,6 +191,30 @@ e.g. crash dump output as shown by Dave Miller.
191> mov 0x8(%ebp), %ebx ! %ebx = skb->sk 191> mov 0x8(%ebp), %ebx ! %ebx = skb->sk
192> mov 0x13c(%ebx), %eax ! %eax = inet_sk(sk)->opt 192> mov 0x13c(%ebx), %eax ! %eax = inet_sk(sk)->opt
193 193
194In addition, you can use GDB to figure out the exact file and line
195number of the OOPS from the vmlinux file. If you have
196CONFIG_DEBUG_INFO enabled, you can simply copy the EIP value from the
197OOPS:
198
199 EIP: 0060:[<c021e50e>] Not tainted VLI
200
201And use GDB to translate that to human-readable form:
202
203 gdb vmlinux
204 (gdb) l *0xc021e50e
205
206If you don't have CONFIG_DEBUG_INFO enabled, you use the function
207offset from the OOPS:
208
209 EIP is at vt_ioctl+0xda8/0x1482
210
211And recompile the kernel with CONFIG_DEBUG_INFO enabled:
212
213 make vmlinux
214 gdb vmlinux
215 (gdb) p vt_ioctl
216 (gdb) l *(0x<address of vt_ioctl> + 0xda8)
217
194Another very useful option of the Kernel Hacking section in menuconfig is 218Another very useful option of the Kernel Hacking section in menuconfig is
195Debug memory allocations. This will help you see whether data has been 219Debug memory allocations. This will help you see whether data has been
196initialised and not set before use etc. To see the values that get assigned 220initialised and not set before use etc. To see the values that get assigned
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index afc286775891..b49b92edb396 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -495,29 +495,40 @@ re-formatting you may want to take a look at the man page. But
495remember: "indent" is not a fix for bad programming. 495remember: "indent" is not a fix for bad programming.
496 496
497 497
498 Chapter 10: Configuration-files 498 Chapter 10: Kconfig configuration files
499 499
500For configuration options (arch/xxx/Kconfig, and all the Kconfig files), 500For all of the Kconfig* configuration files throughout the source tree,
501somewhat different indentation is used. 501the indentation is somewhat different. Lines under a "config" definition
502are indented with one tab, while help text is indented an additional two
503spaces. Example:
502 504
503Help text is indented with 2 spaces. 505config AUDIT
504 506 bool "Auditing support"
505if CONFIG_EXPERIMENTAL 507 depends on NET
506 tristate CONFIG_BOOM
507 default n
508 help
509 Apply nitroglycerine inside the keyboard (DANGEROUS)
510 bool CONFIG_CHEER
511 depends on CONFIG_BOOM
512 default y
513 help 508 help
514 Output nice messages when you explode 509 Enable auditing infrastructure that can be used with another
515endif 510 kernel subsystem, such as SELinux (which requires this for
511 logging of avc messages output). Does not do system-call
512 auditing without CONFIG_AUDITSYSCALL.
513
514Features that might still be considered unstable should be defined as
515dependent on "EXPERIMENTAL":
516
517config SLUB
518 depends on EXPERIMENTAL && !ARCH_USES_SLAB_PAGE_STRUCT
519 bool "SLUB (Unqueued Allocator)"
520 ...
521
522while seriously dangerous features (such as write support for certain
523filesystems) should advertise this prominently in their prompt string:
524
525config ADFS_FS_RW
526 bool "ADFS write support (DANGEROUS)"
527 depends on ADFS_FS
528 ...
516 529
517Generally, CONFIG_EXPERIMENTAL should surround all options not considered 530For full documentation on the configuration files, see the file
518stable. All options that are known to trash data (experimental write- 531Documentation/kbuild/kconfig-language.txt.
519support for file-systems, for instance) should be denoted (DANGEROUS), other
520experimental options should be denoted (EXPERIMENTAL).
521 532
522 533
523 Chapter 11: Data structures 534 Chapter 11: Data structures
diff --git a/Documentation/DocBook/gadget.tmpl b/Documentation/DocBook/gadget.tmpl
index e7fc96433408..6996d977bf8f 100644
--- a/Documentation/DocBook/gadget.tmpl
+++ b/Documentation/DocBook/gadget.tmpl
@@ -52,7 +52,7 @@
52 52
53<toc></toc> 53<toc></toc>
54 54
55<chapter><title>Introduction</title> 55<chapter id="intro"><title>Introduction</title>
56 56
57<para>This document presents a Linux-USB "Gadget" 57<para>This document presents a Linux-USB "Gadget"
58kernel mode 58kernel mode
diff --git a/Documentation/DocBook/usb.tmpl b/Documentation/DocBook/usb.tmpl
index a2ebd651b05a..af293606fbe3 100644
--- a/Documentation/DocBook/usb.tmpl
+++ b/Documentation/DocBook/usb.tmpl
@@ -185,7 +185,7 @@
185 185
186 </chapter> 186 </chapter>
187 187
188<chapter><title>USB-Standard Types</title> 188<chapter id="types"><title>USB-Standard Types</title>
189 189
190 <para>In <filename>&lt;linux/usb/ch9.h&gt;</filename> you will find 190 <para>In <filename>&lt;linux/usb/ch9.h&gt;</filename> you will find
191 the USB data types defined in chapter 9 of the USB specification. 191 the USB data types defined in chapter 9 of the USB specification.
@@ -197,7 +197,7 @@
197 197
198 </chapter> 198 </chapter>
199 199
200<chapter><title>Host-Side Data Types and Macros</title> 200<chapter id="hostside"><title>Host-Side Data Types and Macros</title>
201 201
202 <para>The host side API exposes several layers to drivers, some of 202 <para>The host side API exposes several layers to drivers, some of
203 which are more necessary than others. 203 which are more necessary than others.
@@ -211,7 +211,7 @@
211 211
212 </chapter> 212 </chapter>
213 213
214 <chapter><title>USB Core APIs</title> 214 <chapter id="usbcore"><title>USB Core APIs</title>
215 215
216 <para>There are two basic I/O models in the USB API. 216 <para>There are two basic I/O models in the USB API.
217 The most elemental one is asynchronous: drivers submit requests 217 The most elemental one is asynchronous: drivers submit requests
@@ -248,7 +248,7 @@
248!Edrivers/usb/core/hub.c 248!Edrivers/usb/core/hub.c
249 </chapter> 249 </chapter>
250 250
251 <chapter><title>Host Controller APIs</title> 251 <chapter id="hcd"><title>Host Controller APIs</title>
252 252
253 <para>These APIs are only for use by host controller drivers, 253 <para>These APIs are only for use by host controller drivers,
254 most of which implement standard register interfaces such as 254 most of which implement standard register interfaces such as
@@ -285,7 +285,7 @@
285!Idrivers/usb/core/buffer.c 285!Idrivers/usb/core/buffer.c
286 </chapter> 286 </chapter>
287 287
288 <chapter> 288 <chapter id="usbfs">
289 <title>The USB Filesystem (usbfs)</title> 289 <title>The USB Filesystem (usbfs)</title>
290 290
291 <para>This chapter presents the Linux <emphasis>usbfs</emphasis>. 291 <para>This chapter presents the Linux <emphasis>usbfs</emphasis>.
@@ -317,7 +317,7 @@
317 not it has a kernel driver. 317 not it has a kernel driver.
318 </para> 318 </para>
319 319
320 <sect1> 320 <sect1 id="usbfs-files">
321 <title>What files are in "usbfs"?</title> 321 <title>What files are in "usbfs"?</title>
322 322
323 <para>Conventionally mounted at 323 <para>Conventionally mounted at
@@ -356,7 +356,7 @@
356 356
357 </sect1> 357 </sect1>
358 358
359 <sect1> 359 <sect1 id="usbfs-fstab">
360 <title>Mounting and Access Control</title> 360 <title>Mounting and Access Control</title>
361 361
362 <para>There are a number of mount options for usbfs, which will 362 <para>There are a number of mount options for usbfs, which will
@@ -439,7 +439,7 @@
439 439
440 </sect1> 440 </sect1>
441 441
442 <sect1> 442 <sect1 id="usbfs-devices">
443 <title>/proc/bus/usb/devices</title> 443 <title>/proc/bus/usb/devices</title>
444 444
445 <para>This file is handy for status viewing tools in user 445 <para>This file is handy for status viewing tools in user
@@ -473,7 +473,7 @@ for (;;) {
473 </para> 473 </para>
474 </sect1> 474 </sect1>
475 475
476 <sect1> 476 <sect1 id="usbfs-bbbddd">
477 <title>/proc/bus/usb/BBB/DDD</title> 477 <title>/proc/bus/usb/BBB/DDD</title>
478 478
479 <para>Use these files in one of these basic ways: 479 <para>Use these files in one of these basic ways:
@@ -510,7 +510,7 @@ for (;;) {
510 </sect1> 510 </sect1>
511 511
512 512
513 <sect1> 513 <sect1 id="usbfs-lifecycle">
514 <title>Life Cycle of User Mode Drivers</title> 514 <title>Life Cycle of User Mode Drivers</title>
515 515
516 <para>Such a driver first needs to find a device file 516 <para>Such a driver first needs to find a device file
@@ -565,7 +565,7 @@ for (;;) {
565 565
566 </sect1> 566 </sect1>
567 567
568 <sect1><title>The ioctl() Requests</title> 568 <sect1 id="usbfs-ioctl"><title>The ioctl() Requests</title>
569 569
570 <para>To use these ioctls, you need to include the following 570 <para>To use these ioctls, you need to include the following
571 headers in your userspace program: 571 headers in your userspace program:
@@ -604,7 +604,7 @@ for (;;) {
604 </para> 604 </para>
605 605
606 606
607 <sect2> 607 <sect2 id="usbfs-mgmt">
608 <title>Management/Status Requests</title> 608 <title>Management/Status Requests</title>
609 609
610 <para>A number of usbfs requests don't deal very directly 610 <para>A number of usbfs requests don't deal very directly
@@ -736,7 +736,7 @@ usbdev_ioctl (int fd, int ifno, unsigned request, void *param)
736 736
737 </sect2> 737 </sect2>
738 738
739 <sect2> 739 <sect2 id="usbfs-sync">
740 <title>Synchronous I/O Support</title> 740 <title>Synchronous I/O Support</title>
741 741
742 <para>Synchronous requests involve the kernel blocking 742 <para>Synchronous requests involve the kernel blocking
@@ -865,7 +865,7 @@ usbdev_ioctl (int fd, int ifno, unsigned request, void *param)
865 </variablelist> 865 </variablelist>
866 </sect2> 866 </sect2>
867 867
868 <sect2> 868 <sect2 id="usbfs-async">
869 <title>Asynchronous I/O Support</title> 869 <title>Asynchronous I/O Support</title>
870 870
871 <para>As mentioned above, there are situations where it may be 871 <para>As mentioned above, there are situations where it may be
diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index 48123dba5e6a..ced9207bedcf 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -396,26 +396,6 @@ bugme-janitor mailing list (every change in the bugzilla is mailed here)
396 396
397 397
398 398
399Managing bug reports
400--------------------
401
402One of the best ways to put into practice your hacking skills is by fixing
403bugs reported by other people. Not only you will help to make the kernel
404more stable, you'll learn to fix real world problems and you will improve
405your skills, and other developers will be aware of your presence. Fixing
406bugs is one of the best ways to get merits among other developers, because
407not many people like wasting time fixing other people's bugs.
408
409To work in the already reported bug reports, go to http://bugzilla.kernel.org.
410If you want to be advised of the future bug reports, you can subscribe to the
411bugme-new mailing list (only new bug reports are mailed here) or to the
412bugme-janitor mailing list (every change in the bugzilla is mailed here)
413
414 http://lists.osdl.org/mailman/listinfo/bugme-new
415 http://lists.osdl.org/mailman/listinfo/bugme-janitors
416
417
418
419Mailing lists 399Mailing lists
420------------- 400-------------
421 401
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist
index 3af3e65cf43b..6ebffb57e3db 100644
--- a/Documentation/SubmitChecklist
+++ b/Documentation/SubmitChecklist
@@ -84,3 +84,9 @@ kernel patches.
8424: Avoid whitespace damage such as indenting with spaces or whitespace 8424: Avoid whitespace damage such as indenting with spaces or whitespace
85 at the end of lines. You can test this by feeding the patch to 85 at the end of lines. You can test this by feeding the patch to
86 "git apply --check --whitespace=error-all" 86 "git apply --check --whitespace=error-all"
87
8825: Check your patch for general style as detailed in
89 Documentation/CodingStyle. Check for trivial violations with the
90 patch style checker prior to submission (scripts/checkpatch.pl).
91 You should be able to justify all violations that remain in
92 your patch.
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index a417b25fb1aa..d91125ab6f49 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -118,7 +118,20 @@ then only post say 15 or so at a time and wait for review and integration.
118 118
119 119
120 120
1214) Select e-mail destination. 1214) Style check your changes.
122
123Check your patch for basic style violations, details of which can be
124found in Documentation/CodingStyle. Failure to do so simply wastes
125the reviewers time and will get your patch rejected, probabally
126without even being read.
127
128At a minimum you should check your patches with the patch style
129checker prior to submission (scripts/patchcheck.pl). You should
130be able to justify all violations that remain in your patch.
131
132
133
1345) Select e-mail destination.
122 135
123Look through the MAINTAINERS file and the source code, and determine 136Look through the MAINTAINERS file and the source code, and determine
124if your change applies to a specific subsystem of the kernel, with 137if your change applies to a specific subsystem of the kernel, with
@@ -146,7 +159,7 @@ discussed should the patch then be submitted to Linus.
146 159
147 160
148 161
1495) Select your CC (e-mail carbon copy) list. 1626) Select your CC (e-mail carbon copy) list.
150 163
151Unless you have a reason NOT to do so, CC linux-kernel@vger.kernel.org. 164Unless you have a reason NOT to do so, CC linux-kernel@vger.kernel.org.
152 165
@@ -187,8 +200,7 @@ URL: <http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/>
187 200
188 201
189 202
190 2037) No MIME, no links, no compression, no attachments. Just plain text.
1916) No MIME, no links, no compression, no attachments. Just plain text.
192 204
193Linus and other kernel developers need to be able to read and comment 205Linus and other kernel developers need to be able to read and comment
194on the changes you are submitting. It is important for a kernel 206on the changes you are submitting. It is important for a kernel
@@ -223,9 +235,9 @@ pref("mailnews.display.disable_format_flowed_support", true);
223 235
224 236
225 237
2267) E-mail size. 2388) E-mail size.
227 239
228When sending patches to Linus, always follow step #6. 240When sending patches to Linus, always follow step #7.
229 241
230Large changes are not appropriate for mailing lists, and some 242Large changes are not appropriate for mailing lists, and some
231maintainers. If your patch, uncompressed, exceeds 40 kB in size, 243maintainers. If your patch, uncompressed, exceeds 40 kB in size,
@@ -234,7 +246,7 @@ server, and provide instead a URL (link) pointing to your patch.
234 246
235 247
236 248
2378) Name your kernel version. 2499) Name your kernel version.
238 250
239It is important to note, either in the subject line or in the patch 251It is important to note, either in the subject line or in the patch
240description, the kernel version to which this patch applies. 252description, the kernel version to which this patch applies.
@@ -244,7 +256,7 @@ Linus will not apply it.
244 256
245 257
246 258
2479) Don't get discouraged. Re-submit. 25910) Don't get discouraged. Re-submit.
248 260
249After you have submitted your change, be patient and wait. If Linus 261After you have submitted your change, be patient and wait. If Linus
250likes your change and applies it, it will appear in the next version 262likes your change and applies it, it will appear in the next version
@@ -270,7 +282,7 @@ When in doubt, solicit comments on linux-kernel mailing list.
270 282
271 283
272 284
27310) Include PATCH in the subject 28511) Include PATCH in the subject
274 286
275Due to high e-mail traffic to Linus, and to linux-kernel, it is common 287Due to high e-mail traffic to Linus, and to linux-kernel, it is common
276convention to prefix your subject line with [PATCH]. This lets Linus 288convention to prefix your subject line with [PATCH]. This lets Linus
@@ -279,7 +291,7 @@ e-mail discussions.
279 291
280 292
281 293
28211) Sign your work 29412) Sign your work
283 295
284To improve tracking of who did what, especially with patches that can 296To improve tracking of who did what, especially with patches that can
285percolate to their final resting place in the kernel through several 297percolate to their final resting place in the kernel through several
@@ -328,7 +340,8 @@ now, but you can do this to mark internal company procedures or just
328point out some special detail about the sign-off. 340point out some special detail about the sign-off.
329 341
330 342
33112) The canonical patch format 343
34413) The canonical patch format
332 345
333The canonical patch subject line is: 346The canonical patch subject line is:
334 347
@@ -427,6 +440,10 @@ section Linus Computer Science 101.
427Nuff said. If your code deviates too much from this, it is likely 440Nuff said. If your code deviates too much from this, it is likely
428to be rejected without further review, and without comment. 441to be rejected without further review, and without comment.
429 442
443Check your patches with the patch style checker prior to submission
444(scripts/checkpatch.pl). You should be able to justify all
445violations that remain in your patch.
446
430 447
431 448
4322) #ifdefs are ugly 4492) #ifdefs are ugly
diff --git a/Documentation/block/capability.txt b/Documentation/block/capability.txt
new file mode 100644
index 000000000000..2f1729424ef4
--- /dev/null
+++ b/Documentation/block/capability.txt
@@ -0,0 +1,15 @@
1Generic Block Device Capability
2===============================================================================
3This file documents the sysfs file block/<disk>/capability
4
5capability is a hex word indicating which capabilities a specific disk
6supports. For more information on bits not listed here, see
7include/linux/genhd.h
8
9Capability Value
10-------------------------------------------------------------------------------
11GENHD_FL_MEDIA_CHANGE_NOTIFY 4
12 When this bit is set, the disk supports Asynchronous Notification
13 of media change events. These events will be broadcast to user
14 space via kernel uevent.
15
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index 64e9f6c4826b..595a5ea4c690 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -10,10 +10,12 @@
10*.grp 10*.grp
11*.gz 11*.gz
12*.html 12*.html
13*.i
13*.jpeg 14*.jpeg
14*.ko 15*.ko
15*.log 16*.log
16*.lst 17*.lst
18*.moc
17*.mod.c 19*.mod.c
18*.o 20*.o
19*.orig 21*.orig
@@ -25,6 +27,9 @@
25*.s 27*.s
26*.sgml 28*.sgml
27*.so 29*.so
30*.symtypes
31*.tab.c
32*.tab.h
28*.tex 33*.tex
29*.ver 34*.ver
30*.xml 35*.xml
@@ -32,9 +37,13 @@
32*_vga16.c 37*_vga16.c
33*cscope* 38*cscope*
34*~ 39*~
40*.9
41*.9.gz
35.* 42.*
36.cscope 43.cscope
3753c700_d.h 4453c700_d.h
4553c7xx_d.h
4653c7xx_u.h
3853c8xx_d.h* 4753c8xx_d.h*
39BitKeeper 48BitKeeper
40COPYING 49COPYING
@@ -70,9 +79,11 @@ bzImage*
70classlist.h* 79classlist.h*
71comp*.log 80comp*.log
72compile.h* 81compile.h*
82conf
73config 83config
74config-* 84config-*
75config_data.h* 85config_data.h*
86config_data.gz*
76conmakehash 87conmakehash
77consolemap_deftbl.c* 88consolemap_deftbl.c*
78crc32table.h* 89crc32table.h*
@@ -81,18 +92,23 @@ defkeymap.c*
81devlist.h* 92devlist.h*
82docproc 93docproc
83dummy_sym.c* 94dummy_sym.c*
95elf2ecoff
84elfconfig.h* 96elfconfig.h*
85filelist 97filelist
86fixdep 98fixdep
87fore200e_mkfirm 99fore200e_mkfirm
88fore200e_pca_fw.c* 100fore200e_pca_fw.c*
101gconf
89gen-devlist 102gen-devlist
90gen-kdb_cmds.c* 103gen-kdb_cmds.c*
91gen_crc32table 104gen_crc32table
92gen_init_cpio 105gen_init_cpio
93genksyms 106genksyms
94gentbl 107gentbl
108*_gray256.c
95ikconfig.h* 109ikconfig.h*
110initramfs_data.cpio
111initramfs_data.cpio.gz
96initramfs_list 112initramfs_list
97kallsyms 113kallsyms
98kconfig 114kconfig
@@ -100,19 +116,30 @@ kconfig.tk
100keywords.c* 116keywords.c*
101ksym.c* 117ksym.c*
102ksym.h* 118ksym.h*
119kxgettext
120lkc_defs.h
103lex.c* 121lex.c*
122lex.*.c
123lk201-map.c
104logo_*.c 124logo_*.c
105logo_*_clut224.c 125logo_*_clut224.c
106logo_*_mono.c 126logo_*_mono.c
107lxdialog 127lxdialog
108mach-types 128mach-types
109mach-types.h 129mach-types.h
130machtypes.h
110make_times_h 131make_times_h
111map 132map
112maui_boot.h 133maui_boot.h
134mconf
135miboot*
113mk_elfconfig 136mk_elfconfig
137mkboot
138mkbugboot
114mkdep 139mkdep
140mkprep
115mktables 141mktables
142mktree
116modpost 143modpost
117modversions.h* 144modversions.h*
118offset.h 145offset.h
@@ -120,18 +147,28 @@ offsets.h
120oui.c* 147oui.c*
121parse.c* 148parse.c*
122parse.h* 149parse.h*
150patches*
151pca200e.bin
152pca200e_ecd.bin2
153piggy.gz
154piggyback
123pnmtologo 155pnmtologo
124ppc_defs.h* 156ppc_defs.h*
125promcon_tbl.c* 157promcon_tbl.c*
126pss_boot.h 158pss_boot.h
159qconf
127raid6altivec*.c 160raid6altivec*.c
128raid6int*.c 161raid6int*.c
129raid6tables.c 162raid6tables.c
163relocs
164series
130setup 165setup
131sim710_d.h* 166sim710_d.h*
167sImage
132sm_tbl* 168sm_tbl*
133split-include 169split-include
134tags 170tags
171tftpboot.img
135times.h* 172times.h*
136tkparse 173tkparse
137trix_boot.h 174trix_boot.h
@@ -139,8 +176,11 @@ utsrelease.h*
139version.h* 176version.h*
140vmlinux 177vmlinux
141vmlinux-* 178vmlinux-*
179vmlinux.aout
142vmlinux.lds 180vmlinux.lds
143vsyscall.lds 181vsyscall.lds
144wanxlfw.inc 182wanxlfw.inc
145uImage 183uImage
146zImage 184unifdef
185zImage*
186zconf.hash.c
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 5c8695a3d139..49ae1ea9e868 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -62,7 +62,7 @@ Who: Dan Dennedy <dan@dennedy.org>, Stefan Richter <stefanr@s5r6.in-berlin.de>
62What: old NCR53C9x driver 62What: old NCR53C9x driver
63When: October 2007 63When: October 2007
64Why: Replaced by the much better esp_scsi driver. Actual low-level 64Why: Replaced by the much better esp_scsi driver. Actual low-level
65 driver can ported over almost trivially. 65 driver can be ported over almost trivially.
66Who: David Miller <davem@davemloft.net> 66Who: David Miller <davem@davemloft.net>
67 Christoph Hellwig <hch@lst.de> 67 Christoph Hellwig <hch@lst.de>
68 68
@@ -70,6 +70,7 @@ Who: David Miller <davem@davemloft.net>
70 70
71What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. 71What: Video4Linux API 1 ioctls and video_decoder.h from Video devices.
72When: December 2006 72When: December 2006
73Files: include/linux/video_decoder.h
73Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 74Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6
74 series. The old API have lots of drawbacks and don't provide enough 75 series. The old API have lots of drawbacks and don't provide enough
75 means to work with all video and audio standards. The newer API is 76 means to work with all video and audio standards. The newer API is
diff --git a/Documentation/filesystems/directory-locking b/Documentation/filesystems/directory-locking
index d7099a9266fb..ff7b611abf33 100644
--- a/Documentation/filesystems/directory-locking
+++ b/Documentation/filesystems/directory-locking
@@ -1,5 +1,6 @@
1 Locking scheme used for directory operations is based on two 1 Locking scheme used for directory operations is based on two
2kinds of locks - per-inode (->i_sem) and per-filesystem (->s_vfs_rename_sem). 2kinds of locks - per-inode (->i_mutex) and per-filesystem
3(->s_vfs_rename_mutex).
3 4
4 For our purposes all operations fall in 5 classes: 5 For our purposes all operations fall in 5 classes:
5 6
@@ -63,7 +64,7 @@ objects - A < B iff A is an ancestor of B.
63attempt to acquire some lock and already holds at least one lock. Let's 64attempt to acquire some lock and already holds at least one lock. Let's
64consider the set of contended locks. First of all, filesystem lock is 65consider the set of contended locks. First of all, filesystem lock is
65not contended, since any process blocked on it is not holding any locks. 66not contended, since any process blocked on it is not holding any locks.
66Thus all processes are blocked on ->i_sem. 67Thus all processes are blocked on ->i_mutex.
67 68
68 Non-directory objects are not contended due to (3). Thus link 69 Non-directory objects are not contended due to (3). Thus link
69creation can't be a part of deadlock - it can't be blocked on source 70creation can't be a part of deadlock - it can't be blocked on source
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index 5531694059ab..dac45c92d872 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -107,7 +107,7 @@ free to drop it...
107--- 107---
108[informational] 108[informational]
109 109
110->link() callers hold ->i_sem on the object we are linking to. Some of your 110->link() callers hold ->i_mutex on the object we are linking to. Some of your
111problems might be over... 111problems might be over...
112 112
113--- 113---
@@ -130,9 +130,9 @@ went in - and hadn't been documented ;-/). Just remove it from fs_flags
130--- 130---
131[mandatory] 131[mandatory]
132 132
133->setattr() is called without BKL now. Caller _always_ holds ->i_sem, so 133->setattr() is called without BKL now. Caller _always_ holds ->i_mutex, so
134watch for ->i_sem-grabbing code that might be used by your ->setattr(). 134watch for ->i_mutex-grabbing code that might be used by your ->setattr().
135Callers of notify_change() need ->i_sem now. 135Callers of notify_change() need ->i_mutex now.
136 136
137--- 137---
138[recommended] 138[recommended]
diff --git a/Documentation/hrtimer/timer_stats.txt b/Documentation/hrtimer/timer_stats.txt
index 27f782e3593f..22b0814d0ad0 100644
--- a/Documentation/hrtimer/timer_stats.txt
+++ b/Documentation/hrtimer/timer_stats.txt
@@ -2,9 +2,10 @@ timer_stats - timer usage statistics
2------------------------------------ 2------------------------------------
3 3
4timer_stats is a debugging facility to make the timer (ab)usage in a Linux 4timer_stats is a debugging facility to make the timer (ab)usage in a Linux
5system visible to kernel and userspace developers. It is not intended for 5system visible to kernel and userspace developers. If enabled in the config
6production usage as it adds significant overhead to the (hr)timer code and the 6but not used it has almost zero runtime overhead, and a relatively small
7(hr)timer data structures. 7data structure overhead. Even if collection is enabled runtime all the
8locking is per-CPU and lookup is hashed.
8 9
9timer_stats should be used by kernel and userspace developers to verify that 10timer_stats should be used by kernel and userspace developers to verify that
10their code does not make unduly use of timers. This helps to avoid unnecessary 11their code does not make unduly use of timers. This helps to avoid unnecessary
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt
index 66fa67fec2a7..35985b34d5a6 100644
--- a/Documentation/i386/boot.txt
+++ b/Documentation/i386/boot.txt
@@ -2,7 +2,7 @@
2 ---------------------------- 2 ----------------------------
3 3
4 H. Peter Anvin <hpa@zytor.com> 4 H. Peter Anvin <hpa@zytor.com>
5 Last update 2007-05-16 5 Last update 2007-05-23
6 6
7On the i386 platform, the Linux kernel uses a rather complicated boot 7On the i386 platform, the Linux kernel uses a rather complicated boot
8convention. This has evolved partially due to historical aspects, as 8convention. This has evolved partially due to historical aspects, as
@@ -202,6 +202,8 @@ All general purpose boot loaders should write the fields marked
202nonstandard address should fill in the fields marked (reloc); other 202nonstandard address should fill in the fields marked (reloc); other
203boot loaders can ignore those fields. 203boot loaders can ignore those fields.
204 204
205The byte order of all fields is littleendian (this is x86, after all.)
206
205Field name: setup_secs 207Field name: setup_secs
206Type: read 208Type: read
207Offset/size: 0x1f1/1 209Offset/size: 0x1f1/1
@@ -280,14 +282,16 @@ Type: read
280Offset/size: 0x206/2 282Offset/size: 0x206/2
281Protocol: 2.00+ 283Protocol: 2.00+
282 284
283 Contains the boot protocol version, e.g. 0x0204 for version 2.04. 285 Contains the boot protocol version, in (major << 8)+minor format,
286 e.g. 0x0204 for version 2.04, and 0x0a11 for a hypothetical version
287 10.17.
284 288
285Field name: readmode_swtch 289Field name: readmode_swtch
286Type: modify (optional) 290Type: modify (optional)
287Offset/size: 0x208/4 291Offset/size: 0x208/4
288Protocol: 2.00+ 292Protocol: 2.00+
289 293
290 Boot loader hook (see separate chapter.) 294 Boot loader hook (see ADVANCED BOOT LOADER HOOKS below.)
291 295
292Field name: start_sys 296Field name: start_sys
293Type: read 297Type: read
@@ -304,10 +308,17 @@ Protocol: 2.00+
304 If set to a nonzero value, contains a pointer to a NUL-terminated 308 If set to a nonzero value, contains a pointer to a NUL-terminated
305 human-readable kernel version number string, less 0x200. This can 309 human-readable kernel version number string, less 0x200. This can
306 be used to display the kernel version to the user. This value 310 be used to display the kernel version to the user. This value
307 should be less than (0x200*setup_sects). For example, if this value 311 should be less than (0x200*setup_sects).
308 is set to 0x1c00, the kernel version number string can be found at 312
309 offset 0x1e00 in the kernel file. This is a valid value if and only 313 For example, if this value is set to 0x1c00, the kernel version
310 if the "setup_sects" field contains the value 14 or higher. 314 number string can be found at offset 0x1e00 in the kernel file.
315 This is a valid value if and only if the "setup_sects" field
316 contains the value 15 or higher, as:
317
318 0x1c00 < 15*0x200 (= 0x1e00) but
319 0x1c00 >= 14*0x200 (= 0x1c00)
320
321 0x1c00 >> 9 = 14, so the minimum value for setup_secs is 15.
311 322
312Field name: type_of_loader 323Field name: type_of_loader
313Type: write (obligatory) 324Type: write (obligatory)
@@ -377,7 +388,7 @@ Protocol: 2.00+
377 388
378 This field can be modified for two purposes: 389 This field can be modified for two purposes:
379 390
380 1. as a boot loader hook (see separate chapter.) 391 1. as a boot loader hook (see ADVANCED BOOT LOADER HOOKS below.)
381 392
382 2. if a bootloader which does not install a hook loads a 393 2. if a bootloader which does not install a hook loads a
383 relocatable kernel at a nonstandard address it will have to modify 394 relocatable kernel at a nonstandard address it will have to modify
@@ -715,7 +726,7 @@ switched off, especially if the loaded kernel has the floppy driver as
715a demand-loaded module! 726a demand-loaded module!
716 727
717 728
718**** ADVANCED BOOT TIME HOOKS 729**** ADVANCED BOOT LOADER HOOKS
719 730
720If the boot loader runs in a particularly hostile environment (such as 731If the boot loader runs in a particularly hostile environment (such as
721LOADLIN, which runs under DOS) it may be impossible to follow the 732LOADLIN, which runs under DOS) it may be impossible to follow the
@@ -740,4 +751,5 @@ IMPORTANT: All the hooks are required to preserve %esp, %ebp, %esi and
740 set them up to BOOT_DS (0x18) yourself. 751 set them up to BOOT_DS (0x18) yourself.
741 752
742 After completing your hook, you should jump to the address 753 After completing your hook, you should jump to the address
743 that was in this field before your boot loader overwrote it. 754 that was in this field before your boot loader overwrote it
755 (relocated, if appropriate.)
diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/aliasing-test.c
index 3153167b41c3..d485256ee1ce 100644
--- a/Documentation/ia64/aliasing-test.c
+++ b/Documentation/ia64/aliasing-test.c
@@ -197,7 +197,7 @@ skip:
197 return rc; 197 return rc;
198} 198}
199 199
200main() 200int main()
201{ 201{
202 int rc; 202 int rc;
203 203
diff --git a/Documentation/initrd.txt b/Documentation/initrd.txt
index 15f1b35deb34..d3dc505104da 100644
--- a/Documentation/initrd.txt
+++ b/Documentation/initrd.txt
@@ -27,16 +27,20 @@ When using initrd, the system typically boots as follows:
27 1) the boot loader loads the kernel and the initial RAM disk 27 1) the boot loader loads the kernel and the initial RAM disk
28 2) the kernel converts initrd into a "normal" RAM disk and 28 2) the kernel converts initrd into a "normal" RAM disk and
29 frees the memory used by initrd 29 frees the memory used by initrd
30 3) initrd is mounted read-write as root 30 3) if the root device is not /dev/ram0, the old (deprecated)
31 4) /linuxrc is executed (this can be any valid executable, including 31 change_root procedure is followed. see the "Obsolete root change
32 mechanism" section below.
33 4) root device is mounted. if it is /dev/ram0, the initrd image is
34 then mounted as root
35 5) /sbin/init is executed (this can be any valid executable, including
32 shell scripts; it is run with uid 0 and can do basically everything 36 shell scripts; it is run with uid 0 and can do basically everything
33 init can do) 37 init can do).
34 5) linuxrc mounts the "real" root file system 38 6) init mounts the "real" root file system
35 6) linuxrc places the root file system at the root directory using the 39 7) init places the root file system at the root directory using the
36 pivot_root system call 40 pivot_root system call
37 7) the usual boot sequence (e.g. invocation of /sbin/init) is performed 41 8) init execs the /sbin/init on the new root filesystem, performing
38 on the root file system 42 the usual boot sequence
39 8) the initrd file system is removed 43 9) the initrd file system is removed
40 44
41Note that changing the root directory does not involve unmounting it. 45Note that changing the root directory does not involve unmounting it.
42It is therefore possible to leave processes running on initrd during that 46It is therefore possible to leave processes running on initrd during that
@@ -70,7 +74,7 @@ initrd adds the following new options:
70 root=/dev/ram0 74 root=/dev/ram0
71 75
72 initrd is mounted as root, and the normal boot procedure is followed, 76 initrd is mounted as root, and the normal boot procedure is followed,
73 with the RAM disk still mounted as root. 77 with the RAM disk mounted as root.
74 78
75Compressed cpio images 79Compressed cpio images
76---------------------- 80----------------------
@@ -137,11 +141,11 @@ We'll describe the loopback device method:
137 # mkdir /mnt/dev 141 # mkdir /mnt/dev
138 # mknod /mnt/dev/console c 5 1 142 # mknod /mnt/dev/console c 5 1
139 5) copy all the files that are needed to properly use the initrd 143 5) copy all the files that are needed to properly use the initrd
140 environment. Don't forget the most important file, /linuxrc 144 environment. Don't forget the most important file, /sbin/init
141 Note that /linuxrc's permissions must include "x" (execute). 145 Note that /sbin/init's permissions must include "x" (execute).
142 6) correct operation the initrd environment can frequently be tested 146 6) correct operation the initrd environment can frequently be tested
143 even without rebooting with the command 147 even without rebooting with the command
144 # chroot /mnt /linuxrc 148 # chroot /mnt /sbin/init
145 This is of course limited to initrds that do not interfere with the 149 This is of course limited to initrds that do not interfere with the
146 general system state (e.g. by reconfiguring network interfaces, 150 general system state (e.g. by reconfiguring network interfaces,
147 overwriting mounted devices, trying to start already running demons, 151 overwriting mounted devices, trying to start already running demons,
@@ -154,7 +158,7 @@ We'll describe the loopback device method:
154 # gzip -9 initrd 158 # gzip -9 initrd
155 159
156For experimenting with initrd, you may want to take a rescue floppy and 160For experimenting with initrd, you may want to take a rescue floppy and
157only add a symbolic link from /linuxrc to /bin/sh. Alternatively, you 161only add a symbolic link from /sbin/init to /bin/sh. Alternatively, you
158can try the experimental newlib environment [2] to create a small 162can try the experimental newlib environment [2] to create a small
159initrd. 163initrd.
160 164
@@ -163,15 +167,14 @@ boot loaders support initrd. Since the boot process is still compatible
163with an older mechanism, the following boot command line parameters 167with an older mechanism, the following boot command line parameters
164have to be given: 168have to be given:
165 169
166 root=/dev/ram0 init=/linuxrc rw 170 root=/dev/ram0 rw
167 171
168(rw is only necessary if writing to the initrd file system.) 172(rw is only necessary if writing to the initrd file system.)
169 173
170With LOADLIN, you simply execute 174With LOADLIN, you simply execute
171 175
172 LOADLIN <kernel> initrd=<disk_image> 176 LOADLIN <kernel> initrd=<disk_image>
173e.g. LOADLIN C:\LINUX\BZIMAGE initrd=C:\LINUX\INITRD.GZ root=/dev/ram0 177e.g. LOADLIN C:\LINUX\BZIMAGE initrd=C:\LINUX\INITRD.GZ root=/dev/ram0 rw
174 init=/linuxrc rw
175 178
176With LILO, you add the option INITRD=<path> to either the global section 179With LILO, you add the option INITRD=<path> to either the global section
177or to the section of the respective kernel in /etc/lilo.conf, and pass 180or to the section of the respective kernel in /etc/lilo.conf, and pass
@@ -179,7 +182,7 @@ the options using APPEND, e.g.
179 182
180 image = /bzImage 183 image = /bzImage
181 initrd = /boot/initrd.gz 184 initrd = /boot/initrd.gz
182 append = "root=/dev/ram0 init=/linuxrc rw" 185 append = "root=/dev/ram0 rw"
183 186
184and run /sbin/lilo 187and run /sbin/lilo
185 188
@@ -191,7 +194,7 @@ Now you can boot and enjoy using initrd.
191Changing the root device 194Changing the root device
192------------------------ 195------------------------
193 196
194When finished with its duties, linuxrc typically changes the root device 197When finished with its duties, init typically changes the root device
195and proceeds with starting the Linux system on the "real" root device. 198and proceeds with starting the Linux system on the "real" root device.
196 199
197The procedure involves the following steps: 200The procedure involves the following steps:
@@ -217,7 +220,7 @@ must exist before calling pivot_root. Example:
217# mkdir initrd 220# mkdir initrd
218# pivot_root . initrd 221# pivot_root . initrd
219 222
220Now, the linuxrc process may still access the old root via its 223Now, the init process may still access the old root via its
221executable, shared libraries, standard input/output/error, and its 224executable, shared libraries, standard input/output/error, and its
222current root directory. All these references are dropped by the 225current root directory. All these references are dropped by the
223following command: 226following command:
@@ -249,10 +252,6 @@ disk can be freed:
249It is also possible to use initrd with an NFS-mounted root, see the 252It is also possible to use initrd with an NFS-mounted root, see the
250pivot_root(8) man page for details. 253pivot_root(8) man page for details.
251 254
252Note: if linuxrc or any program exec'ed from it terminates for some
253reason, the old change_root mechanism is invoked (see section "Obsolete
254root change mechanism").
255
256 255
257Usage scenarios 256Usage scenarios
258--------------- 257---------------
@@ -264,15 +263,15 @@ as follows:
264 1) system boots from floppy or other media with a minimal kernel 263 1) system boots from floppy or other media with a minimal kernel
265 (e.g. support for RAM disks, initrd, a.out, and the Ext2 FS) and 264 (e.g. support for RAM disks, initrd, a.out, and the Ext2 FS) and
266 loads initrd 265 loads initrd
267 2) /linuxrc determines what is needed to (1) mount the "real" root FS 266 2) /sbin/init determines what is needed to (1) mount the "real" root FS
268 (i.e. device type, device drivers, file system) and (2) the 267 (i.e. device type, device drivers, file system) and (2) the
269 distribution media (e.g. CD-ROM, network, tape, ...). This can be 268 distribution media (e.g. CD-ROM, network, tape, ...). This can be
270 done by asking the user, by auto-probing, or by using a hybrid 269 done by asking the user, by auto-probing, or by using a hybrid
271 approach. 270 approach.
272 3) /linuxrc loads the necessary kernel modules 271 3) /sbin/init loads the necessary kernel modules
273 4) /linuxrc creates and populates the root file system (this doesn't 272 4) /sbin/init creates and populates the root file system (this doesn't
274 have to be a very usable system yet) 273 have to be a very usable system yet)
275 5) /linuxrc invokes pivot_root to change the root file system and 274 5) /sbin/init invokes pivot_root to change the root file system and
276 execs - via chroot - a program that continues the installation 275 execs - via chroot - a program that continues the installation
277 6) the boot loader is installed 276 6) the boot loader is installed
278 7) the boot loader is configured to load an initrd with the set of 277 7) the boot loader is configured to load an initrd with the set of
@@ -291,7 +290,7 @@ different hardware configurations in a single administrative domain. In
291such cases, it is desirable to generate only a small set of kernels 290such cases, it is desirable to generate only a small set of kernels
292(ideally only one) and to keep the system-specific part of configuration 291(ideally only one) and to keep the system-specific part of configuration
293information as small as possible. In this case, a common initrd could be 292information as small as possible. In this case, a common initrd could be
294generated with all the necessary modules. Then, only /linuxrc or a file 293generated with all the necessary modules. Then, only /sbin/init or a file
295read by it would have to be different. 294read by it would have to be different.
296 295
297A third scenario are more convenient recovery disks, because information 296A third scenario are more convenient recovery disks, because information
@@ -337,6 +336,25 @@ This old, deprecated mechanism is commonly called "change_root", while
337the new, supported mechanism is called "pivot_root". 336the new, supported mechanism is called "pivot_root".
338 337
339 338
339Mixed change_root and pivot_root mechanism
340------------------------------------------
341
342In case you did not want to use root=/dev/ram0 to trig the pivot_root mechanism,
343you may create both /linuxrc and /sbin/init in your initrd image.
344
345/linuxrc would contain only the following:
346
347#! /bin/sh
348mount -n -t proc proc /proc
349echo 0x0100 >/proc/sys/kernel/real-root-dev
350umount -n /proc
351
352Once linuxrc exited, the kernel would mount again your initrd as root,
353this time executing /sbin/init. Again, it would be duty of this init
354to build the right environment (maybe using the root= device passed on
355the cmdline) before the final execution of the real /sbin/init.
356
357
340Resources 358Resources
341--------- 359---------
342 360
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 09220a1e22d9..5d0283cd3a81 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -170,7 +170,10 @@ and is between 256 and 4096 characters. It is defined in the file
170 acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS 170 acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS
171 Format: To spoof as Windows 98: ="Microsoft Windows" 171 Format: To spoof as Windows 98: ="Microsoft Windows"
172 172
173 acpi_osi= [HW,ACPI] empty param disables _OSI 173 acpi_osi= [HW,ACPI] Modify list of supported OS interface strings
174 acpi_osi="string1" # add string1 -- only one string
175 acpi_osi="!string2" # remove built-in string2
176 acpi_osi= # disable all strings
174 177
175 acpi_serialize [HW,ACPI] force serialization of AML methods 178 acpi_serialize [HW,ACPI] force serialization of AML methods
176 179
@@ -396,6 +399,26 @@ and is between 256 and 4096 characters. It is defined in the file
396 clocksource is not available, it defaults to PIT. 399 clocksource is not available, it defaults to PIT.
397 Format: { pit | tsc | cyclone | pmtmr } 400 Format: { pit | tsc | cyclone | pmtmr }
398 401
402 clocksource= [GENERIC_TIME] Override the default clocksource
403 Format: <string>
404 Override the default clocksource and use the clocksource
405 with the name specified.
406 Some clocksource names to choose from, depending on
407 the platform:
408 [all] jiffies (this is the base, fallback clocksource)
409 [ACPI] acpi_pm
410 [ARM] imx_timer1,OSTS,netx_timer,mpu_timer2,
411 pxa_timer,timer3,32k_counter,timer0_1
412 [AVR32] avr32
413 [IA-32] pit,hpet,tsc,vmi-timer;
414 scx200_hrt on Geode; cyclone on IBM x440
415 [MIPS] MIPS
416 [PARISC] cr16
417 [S390] tod
418 [SH] SuperH
419 [SPARC64] tick
420 [X86-64] hpet,tsc
421
399 code_bytes [IA32] How many bytes of object code to print in an 422 code_bytes [IA32] How many bytes of object code to print in an
400 oops report. 423 oops report.
401 Range: 0 - 8192 424 Range: 0 - 8192
@@ -1112,9 +1135,9 @@ and is between 256 and 4096 characters. It is defined in the file
1112 when set. 1135 when set.
1113 Format: <int> 1136 Format: <int>
1114 1137
1115 noaliencache [MM, NUMA] Disables the allcoation of alien caches in 1138 noaliencache [MM, NUMA, SLAB] Disables the allocation of alien
1116 the slab allocator. Saves per-node memory, but will 1139 caches in the slab allocator. Saves per-node memory,
1117 impact performance on real NUMA hardware. 1140 but will impact performance.
1118 1141
1119 noalign [KNL,ARM] 1142 noalign [KNL,ARM]
1120 1143
@@ -1593,6 +1616,37 @@ and is between 256 and 4096 characters. It is defined in the file
1593 1616
1594 slram= [HW,MTD] 1617 slram= [HW,MTD]
1595 1618
1619 slub_debug [MM, SLUB]
1620 Enabling slub_debug allows one to determine the culprit
1621 if slab objects become corrupted. Enabling slub_debug
1622 creates guard zones around objects and poisons objects
1623 when not in use. Also tracks the last alloc / free.
1624 For more information see Documentation/vm/slub.txt.
1625
1626 slub_max_order= [MM, SLUB]
1627 Determines the maximum allowed order for slabs. Setting
1628 this too high may cause fragmentation.
1629 For more information see Documentation/vm/slub.txt.
1630
1631 slub_min_objects= [MM, SLUB]
1632 The minimum objects per slab. SLUB will increase the
1633 slab order up to slub_max_order to generate a
1634 sufficiently big slab to satisfy the number of objects.
1635 The higher the number of objects the smaller the overhead
1636 of tracking slabs.
1637 For more information see Documentation/vm/slub.txt.
1638
1639 slub_min_order= [MM, SLUB]
1640 Determines the mininum page order for slabs. Must be
1641 lower than slub_max_order
1642 For more information see Documentation/vm/slub.txt.
1643
1644 slub_nomerge [MM, SLUB]
1645 Disable merging of slabs of similar size. May be
1646 necessary if there is some reason to distinguish
1647 allocs to different slabs.
1648 For more information see Documentation/vm/slub.txt.
1649
1596 smart2= [HW] 1650 smart2= [HW]
1597 Format: <io1>[,<io2>[,...,<io8>]] 1651 Format: <io1>[,<io2>[,...,<io8>]]
1598 1652
@@ -1807,10 +1861,6 @@ and is between 256 and 4096 characters. It is defined in the file
1807 1861
1808 time Show timing data prefixed to each printk message line 1862 time Show timing data prefixed to each printk message line
1809 1863
1810 clocksource= [GENERIC_TIME] Override the default clocksource
1811 Override the default clocksource and use the clocksource
1812 with the name specified.
1813
1814 tipar.timeout= [HW,PPT] 1864 tipar.timeout= [HW,PPT]
1815 Set communications timeout in tenths of a second 1865 Set communications timeout in tenths of a second
1816 (default 15). 1866 (default 15).
diff --git a/Documentation/ldm.txt b/Documentation/ldm.txt
index e266e11c19a3..718085bc9f1a 100644
--- a/Documentation/ldm.txt
+++ b/Documentation/ldm.txt
@@ -2,10 +2,13 @@
2 LDM - Logical Disk Manager (Dynamic Disks) 2 LDM - Logical Disk Manager (Dynamic Disks)
3 ------------------------------------------ 3 ------------------------------------------
4 4
5Originally Written by FlatCap - Richard Russon <ldm@flatcap.org>.
6Last Updated by Anton Altaparmakov on 30 March 2007 for Windows Vista.
7
5Overview 8Overview
6-------- 9--------
7 10
8Windows 2000 and XP use a new partitioning scheme. It is a complete 11Windows 2000, XP, and Vista use a new partitioning scheme. It is a complete
9replacement for the MSDOS style partitions. It stores its information in a 12replacement for the MSDOS style partitions. It stores its information in a
101MiB journalled database at the end of the physical disk. The size of 131MiB journalled database at the end of the physical disk. The size of
11partitions is limited only by disk space. The maximum number of partitions is 14partitions is limited only by disk space. The maximum number of partitions is
@@ -23,7 +26,11 @@ Once the LDM driver has divided up the disk, you can use the MD driver to
23assemble any multi-partition volumes, e.g. Stripes, RAID5. 26assemble any multi-partition volumes, e.g. Stripes, RAID5.
24 27
25To prevent legacy applications from repartitioning the disk, the LDM creates a 28To prevent legacy applications from repartitioning the disk, the LDM creates a
26dummy MSDOS partition containing one disk-sized partition. 29dummy MSDOS partition containing one disk-sized partition. This is what is
30supported with the Linux LDM driver.
31
32A newer approach that has been implemented with Vista is to put LDM on top of a
33GPT label disk. This is not supported by the Linux LDM driver yet.
27 34
28 35
29Example 36Example
@@ -88,13 +95,13 @@ and cannot boot from a Dynamic Disk.
88More Documentation 95More Documentation
89------------------ 96------------------
90 97
91There is an Overview of the LDM online together with complete Technical 98There is an Overview of the LDM together with complete Technical Documentation.
92Documentation. It can also be downloaded in html. 99It is available for download.
93 100
94 http://linux-ntfs.sourceforge.net/ldm/index.html 101 http://www.linux-ntfs.org/content/view/19/37/
95 http://linux-ntfs.sourceforge.net/downloads.html
96 102
97If you have any LDM questions that aren't answered on the website, email me. 103If you have any LDM questions that aren't answered in the documentation, email
104me.
98 105
99Cheers, 106Cheers,
100 FlatCap - Richard Russon 107 FlatCap - Richard Russon
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 58408dd023c7..650657c54733 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -24,7 +24,7 @@ Contents:
24 (*) Explicit kernel barriers. 24 (*) Explicit kernel barriers.
25 25
26 - Compiler barrier. 26 - Compiler barrier.
27 - The CPU memory barriers. 27 - CPU memory barriers.
28 - MMIO write barrier. 28 - MMIO write barrier.
29 29
30 (*) Implicit kernel memory barriers. 30 (*) Implicit kernel memory barriers.
@@ -265,7 +265,7 @@ Memory barriers are such interventions. They impose a perceived partial
265ordering over the memory operations on either side of the barrier. 265ordering over the memory operations on either side of the barrier.
266 266
267Such enforcement is important because the CPUs and other devices in a system 267Such enforcement is important because the CPUs and other devices in a system
268can use a variety of tricks to improve performance - including reordering, 268can use a variety of tricks to improve performance, including reordering,
269deferral and combination of memory operations; speculative loads; speculative 269deferral and combination of memory operations; speculative loads; speculative
270branch prediction and various types of caching. Memory barriers are used to 270branch prediction and various types of caching. Memory barriers are used to
271override or suppress these tricks, allowing the code to sanely control the 271override or suppress these tricks, allowing the code to sanely control the
@@ -457,7 +457,7 @@ sequence, Q must be either &A or &B, and that:
457 (Q == &A) implies (D == 1) 457 (Q == &A) implies (D == 1)
458 (Q == &B) implies (D == 4) 458 (Q == &B) implies (D == 4)
459 459
460But! CPU 2's perception of P may be updated _before_ its perception of B, thus 460But! CPU 2's perception of P may be updated _before_ its perception of B, thus
461leading to the following situation: 461leading to the following situation:
462 462
463 (Q == &B) and (D == 2) ???? 463 (Q == &B) and (D == 2) ????
@@ -573,7 +573,7 @@ Basically, the read barrier always has to be there, even though it can be of
573the "weaker" type. 573the "weaker" type.
574 574
575[!] Note that the stores before the write barrier would normally be expected to 575[!] Note that the stores before the write barrier would normally be expected to
576match the loads after the read barrier or data dependency barrier, and vice 576match the loads after the read barrier or the data dependency barrier, and vice
577versa: 577versa:
578 578
579 CPU 1 CPU 2 579 CPU 1 CPU 2
@@ -588,7 +588,7 @@ versa:
588EXAMPLES OF MEMORY BARRIER SEQUENCES 588EXAMPLES OF MEMORY BARRIER SEQUENCES
589------------------------------------ 589------------------------------------
590 590
591Firstly, write barriers act as a partial orderings on store operations. 591Firstly, write barriers act as partial orderings on store operations.
592Consider the following sequence of events: 592Consider the following sequence of events:
593 593
594 CPU 1 594 CPU 1
@@ -608,15 +608,15 @@ STORE B, STORE C } all occurring before the unordered set of { STORE D, STORE E
608 +-------+ : : 608 +-------+ : :
609 | | +------+ 609 | | +------+
610 | |------>| C=3 | } /\ 610 | |------>| C=3 | } /\
611 | | : +------+ }----- \ -----> Events perceptible 611 | | : +------+ }----- \ -----> Events perceptible to
612 | | : | A=1 | } \/ to rest of system 612 | | : | A=1 | } \/ the rest of the system
613 | | : +------+ } 613 | | : +------+ }
614 | CPU 1 | : | B=2 | } 614 | CPU 1 | : | B=2 | }
615 | | +------+ } 615 | | +------+ }
616 | | wwwwwwwwwwwwwwww } <--- At this point the write barrier 616 | | wwwwwwwwwwwwwwww } <--- At this point the write barrier
617 | | +------+ } requires all stores prior to the 617 | | +------+ } requires all stores prior to the
618 | | : | E=5 | } barrier to be committed before 618 | | : | E=5 | } barrier to be committed before
619 | | : +------+ } further stores may be take place. 619 | | : +------+ } further stores may take place
620 | |------>| D=4 | } 620 | |------>| D=4 | }
621 | | +------+ 621 | | +------+
622 +-------+ : : 622 +-------+ : :
@@ -626,7 +626,7 @@ STORE B, STORE C } all occurring before the unordered set of { STORE D, STORE E
626 V 626 V
627 627
628 628
629Secondly, data dependency barriers act as a partial orderings on data-dependent 629Secondly, data dependency barriers act as partial orderings on data-dependent
630loads. Consider the following sequence of events: 630loads. Consider the following sequence of events:
631 631
632 CPU 1 CPU 2 632 CPU 1 CPU 2
@@ -975,7 +975,7 @@ compiler from moving the memory accesses either side of it to the other side:
975 975
976 barrier(); 976 barrier();
977 977
978This a general barrier - lesser varieties of compiler barrier do not exist. 978This is a general barrier - lesser varieties of compiler barrier do not exist.
979 979
980The compiler barrier has no direct effect on the CPU, which may then reorder 980The compiler barrier has no direct effect on the CPU, which may then reorder
981things however it wishes. 981things however it wishes.
@@ -997,7 +997,7 @@ The Linux kernel has eight basic CPU memory barriers:
997All CPU memory barriers unconditionally imply compiler barriers. 997All CPU memory barriers unconditionally imply compiler barriers.
998 998
999SMP memory barriers are reduced to compiler barriers on uniprocessor compiled 999SMP memory barriers are reduced to compiler barriers on uniprocessor compiled
1000systems because it is assumed that a CPU will be appear to be self-consistent, 1000systems because it is assumed that a CPU will appear to be self-consistent,
1001and will order overlapping accesses correctly with respect to itself. 1001and will order overlapping accesses correctly with respect to itself.
1002 1002
1003[!] Note that SMP memory barriers _must_ be used to control the ordering of 1003[!] Note that SMP memory barriers _must_ be used to control the ordering of
@@ -1146,9 +1146,9 @@ for each construct. These operations all imply certain barriers:
1146Therefore, from (1), (2) and (4) an UNLOCK followed by an unconditional LOCK is 1146Therefore, from (1), (2) and (4) an UNLOCK followed by an unconditional LOCK is
1147equivalent to a full barrier, but a LOCK followed by an UNLOCK is not. 1147equivalent to a full barrier, but a LOCK followed by an UNLOCK is not.
1148 1148
1149[!] Note: one of the consequence of LOCKs and UNLOCKs being only one-way 1149[!] Note: one of the consequences of LOCKs and UNLOCKs being only one-way
1150 barriers is that the effects instructions outside of a critical section may 1150 barriers is that the effects of instructions outside of a critical section
1151 seep into the inside of the critical section. 1151 may seep into the inside of the critical section.
1152 1152
1153A LOCK followed by an UNLOCK may not be assumed to be full memory barrier 1153A LOCK followed by an UNLOCK may not be assumed to be full memory barrier
1154because it is possible for an access preceding the LOCK to happen after the 1154because it is possible for an access preceding the LOCK to happen after the
@@ -1239,7 +1239,7 @@ three CPUs; then should the following sequence of events occur:
1239 UNLOCK M UNLOCK Q 1239 UNLOCK M UNLOCK Q
1240 *D = d; *H = h; 1240 *D = d; *H = h;
1241 1241
1242Then there is no guarantee as to what order CPU #3 will see the accesses to *A 1242Then there is no guarantee as to what order CPU 3 will see the accesses to *A
1243through *H occur in, other than the constraints imposed by the separate locks 1243through *H occur in, other than the constraints imposed by the separate locks
1244on the separate CPUs. It might, for example, see: 1244on the separate CPUs. It might, for example, see:
1245 1245
@@ -1269,12 +1269,12 @@ However, if the following occurs:
1269 UNLOCK M [2] 1269 UNLOCK M [2]
1270 *H = h; 1270 *H = h;
1271 1271
1272CPU #3 might see: 1272CPU 3 might see:
1273 1273
1274 *E, LOCK M [1], *C, *B, *A, UNLOCK M [1], 1274 *E, LOCK M [1], *C, *B, *A, UNLOCK M [1],
1275 LOCK M [2], *H, *F, *G, UNLOCK M [2], *D 1275 LOCK M [2], *H, *F, *G, UNLOCK M [2], *D
1276 1276
1277But assuming CPU #1 gets the lock first, it won't see any of: 1277But assuming CPU 1 gets the lock first, CPU 3 won't see any of:
1278 1278
1279 *B, *C, *D, *F, *G or *H preceding LOCK M [1] 1279 *B, *C, *D, *F, *G or *H preceding LOCK M [1]
1280 *A, *B or *C following UNLOCK M [1] 1280 *A, *B or *C following UNLOCK M [1]
@@ -1327,12 +1327,12 @@ spinlock, for example:
1327 mmiowb(); 1327 mmiowb();
1328 spin_unlock(Q); 1328 spin_unlock(Q);
1329 1329
1330this will ensure that the two stores issued on CPU #1 appear at the PCI bridge 1330this will ensure that the two stores issued on CPU 1 appear at the PCI bridge
1331before either of the stores issued on CPU #2. 1331before either of the stores issued on CPU 2.
1332 1332
1333 1333
1334Furthermore, following a store by a load to the same device obviates the need 1334Furthermore, following a store by a load from the same device obviates the need
1335for an mmiowb(), because the load forces the store to complete before the load 1335for the mmiowb(), because the load forces the store to complete before the load
1336is performed: 1336is performed:
1337 1337
1338 CPU 1 CPU 2 1338 CPU 1 CPU 2
@@ -1363,7 +1363,7 @@ circumstances in which reordering definitely _could_ be a problem:
1363 1363
1364 (*) Atomic operations. 1364 (*) Atomic operations.
1365 1365
1366 (*) Accessing devices (I/O). 1366 (*) Accessing devices.
1367 1367
1368 (*) Interrupts. 1368 (*) Interrupts.
1369 1369
@@ -1399,7 +1399,7 @@ To wake up a particular waiter, the up_read() or up_write() functions have to:
1399 (1) read the next pointer from this waiter's record to know as to where the 1399 (1) read the next pointer from this waiter's record to know as to where the
1400 next waiter record is; 1400 next waiter record is;
1401 1401
1402 (4) read the pointer to the waiter's task structure; 1402 (2) read the pointer to the waiter's task structure;
1403 1403
1404 (3) clear the task pointer to tell the waiter it has been given the semaphore; 1404 (3) clear the task pointer to tell the waiter it has been given the semaphore;
1405 1405
@@ -1407,7 +1407,7 @@ To wake up a particular waiter, the up_read() or up_write() functions have to:
1407 1407
1408 (5) release the reference held on the waiter's task struct. 1408 (5) release the reference held on the waiter's task struct.
1409 1409
1410In otherwords, it has to perform this sequence of events: 1410In other words, it has to perform this sequence of events:
1411 1411
1412 LOAD waiter->list.next; 1412 LOAD waiter->list.next;
1413 LOAD waiter->task; 1413 LOAD waiter->task;
@@ -1502,7 +1502,7 @@ operations and adjusting reference counters towards object destruction, and as
1502such the implicit memory barrier effects are necessary. 1502such the implicit memory barrier effects are necessary.
1503 1503
1504 1504
1505The following operation are potential problems as they do _not_ imply memory 1505The following operations are potential problems as they do _not_ imply memory
1506barriers, but might be used for implementing such things as UNLOCK-class 1506barriers, but might be used for implementing such things as UNLOCK-class
1507operations: 1507operations:
1508 1508
@@ -1517,7 +1517,7 @@ With these the appropriate explicit memory barrier should be used if necessary
1517 1517
1518The following also do _not_ imply memory barriers, and so may require explicit 1518The following also do _not_ imply memory barriers, and so may require explicit
1519memory barriers under some circumstances (smp_mb__before_atomic_dec() for 1519memory barriers under some circumstances (smp_mb__before_atomic_dec() for
1520instance)): 1520instance):
1521 1521
1522 atomic_add(); 1522 atomic_add();
1523 atomic_sub(); 1523 atomic_sub();
@@ -1641,8 +1641,8 @@ functions:
1641 indeed have special I/O space access cycles and instructions, but many 1641 indeed have special I/O space access cycles and instructions, but many
1642 CPUs don't have such a concept. 1642 CPUs don't have such a concept.
1643 1643
1644 The PCI bus, amongst others, defines an I/O space concept - which on such 1644 The PCI bus, amongst others, defines an I/O space concept which - on such
1645 CPUs as i386 and x86_64 cpus readily maps to the CPU's concept of I/O 1645 CPUs as i386 and x86_64 - readily maps to the CPU's concept of I/O
1646 space. However, it may also be mapped as a virtual I/O space in the CPU's 1646 space. However, it may also be mapped as a virtual I/O space in the CPU's
1647 memory map, particularly on those CPUs that don't support alternate I/O 1647 memory map, particularly on those CPUs that don't support alternate I/O
1648 spaces. 1648 spaces.
@@ -1664,7 +1664,7 @@ functions:
1664 i386 architecture machines, for example, this is controlled by way of the 1664 i386 architecture machines, for example, this is controlled by way of the
1665 MTRR registers. 1665 MTRR registers.
1666 1666
1667 Ordinarily, these will be guaranteed to be fully ordered and uncombined,, 1667 Ordinarily, these will be guaranteed to be fully ordered and uncombined,
1668 provided they're not accessing a prefetchable device. 1668 provided they're not accessing a prefetchable device.
1669 1669
1670 However, intermediary hardware (such as a PCI bridge) may indulge in 1670 However, intermediary hardware (such as a PCI bridge) may indulge in
@@ -1689,7 +1689,7 @@ functions:
1689 1689
1690 (*) ioreadX(), iowriteX() 1690 (*) ioreadX(), iowriteX()
1691 1691
1692 These will perform as appropriate for the type of access they're actually 1692 These will perform appropriately for the type of access they're actually
1693 doing, be it inX()/outX() or readX()/writeX(). 1693 doing, be it inX()/outX() or readX()/writeX().
1694 1694
1695 1695
@@ -1705,7 +1705,7 @@ of arch-specific code.
1705 1705
1706This means that it must be considered that the CPU will execute its instruction 1706This means that it must be considered that the CPU will execute its instruction
1707stream in any order it feels like - or even in parallel - provided that if an 1707stream in any order it feels like - or even in parallel - provided that if an
1708instruction in the stream depends on the an earlier instruction, then that 1708instruction in the stream depends on an earlier instruction, then that
1709earlier instruction must be sufficiently complete[*] before the later 1709earlier instruction must be sufficiently complete[*] before the later
1710instruction may proceed; in other words: provided that the appearance of 1710instruction may proceed; in other words: provided that the appearance of
1711causality is maintained. 1711causality is maintained.
@@ -1795,8 +1795,8 @@ eventually become visible on all CPUs, there's no guarantee that they will
1795become apparent in the same order on those other CPUs. 1795become apparent in the same order on those other CPUs.
1796 1796
1797 1797
1798Consider dealing with a system that has pair of CPUs (1 & 2), each of which has 1798Consider dealing with a system that has a pair of CPUs (1 & 2), each of which
1799a pair of parallel data caches (CPU 1 has A/B, and CPU 2 has C/D): 1799has a pair of parallel data caches (CPU 1 has A/B, and CPU 2 has C/D):
1800 1800
1801 : 1801 :
1802 : +--------+ 1802 : +--------+
@@ -1835,7 +1835,7 @@ Imagine the system has the following properties:
1835 1835
1836 (*) the coherency queue is not flushed by normal loads to lines already 1836 (*) the coherency queue is not flushed by normal loads to lines already
1837 present in the cache, even though the contents of the queue may 1837 present in the cache, even though the contents of the queue may
1838 potentially effect those loads. 1838 potentially affect those loads.
1839 1839
1840Imagine, then, that two writes are made on the first CPU, with a write barrier 1840Imagine, then, that two writes are made on the first CPU, with a write barrier
1841between them to guarantee that they will appear to reach that CPU's caches in 1841between them to guarantee that they will appear to reach that CPU's caches in
@@ -1845,7 +1845,7 @@ the requisite order:
1845 =============== =============== ======================================= 1845 =============== =============== =======================================
1846 u == 0, v == 1 and p == &u, q == &u 1846 u == 0, v == 1 and p == &u, q == &u
1847 v = 2; 1847 v = 2;
1848 smp_wmb(); Make sure change to v visible before 1848 smp_wmb(); Make sure change to v is visible before
1849 change to p 1849 change to p
1850 <A:modify v=2> v is now in cache A exclusively 1850 <A:modify v=2> v is now in cache A exclusively
1851 p = &v; 1851 p = &v;
@@ -1853,7 +1853,7 @@ the requisite order:
1853 1853
1854The write memory barrier forces the other CPUs in the system to perceive that 1854The write memory barrier forces the other CPUs in the system to perceive that
1855the local CPU's caches have apparently been updated in the correct order. But 1855the local CPU's caches have apparently been updated in the correct order. But
1856now imagine that the second CPU that wants to read those values: 1856now imagine that the second CPU wants to read those values:
1857 1857
1858 CPU 1 CPU 2 COMMENT 1858 CPU 1 CPU 2 COMMENT
1859 =============== =============== ======================================= 1859 =============== =============== =======================================
@@ -1861,7 +1861,7 @@ now imagine that the second CPU that wants to read those values:
1861 q = p; 1861 q = p;
1862 x = *q; 1862 x = *q;
1863 1863
1864The above pair of reads may then fail to happen in expected order, as the 1864The above pair of reads may then fail to happen in the expected order, as the
1865cacheline holding p may get updated in one of the second CPU's caches whilst 1865cacheline holding p may get updated in one of the second CPU's caches whilst
1866the update to the cacheline holding v is delayed in the other of the second 1866the update to the cacheline holding v is delayed in the other of the second
1867CPU's caches by some other cache event: 1867CPU's caches by some other cache event:
@@ -1916,7 +1916,7 @@ access depends on a read, not all do, so it may not be relied on.
1916 1916
1917Other CPUs may also have split caches, but must coordinate between the various 1917Other CPUs may also have split caches, but must coordinate between the various
1918cachelets for normal memory accesses. The semantics of the Alpha removes the 1918cachelets for normal memory accesses. The semantics of the Alpha removes the
1919need for coordination in absence of memory barriers. 1919need for coordination in the absence of memory barriers.
1920 1920
1921 1921
1922CACHE COHERENCY VS DMA 1922CACHE COHERENCY VS DMA
@@ -1931,10 +1931,10 @@ invalidate them as well).
1931 1931
1932In addition, the data DMA'd to RAM by a device may be overwritten by dirty 1932In addition, the data DMA'd to RAM by a device may be overwritten by dirty
1933cache lines being written back to RAM from a CPU's cache after the device has 1933cache lines being written back to RAM from a CPU's cache after the device has
1934installed its own data, or cache lines simply present in a CPUs cache may 1934installed its own data, or cache lines present in the CPU's cache may simply
1935simply obscure the fact that RAM has been updated, until at such time as the 1935obscure the fact that RAM has been updated, until at such time as the cacheline
1936cacheline is discarded from the CPU's cache and reloaded. To deal with this, 1936is discarded from the CPU's cache and reloaded. To deal with this, the
1937the appropriate part of the kernel must invalidate the overlapping bits of the 1937appropriate part of the kernel must invalidate the overlapping bits of the
1938cache on each CPU. 1938cache on each CPU.
1939 1939
1940See Documentation/cachetlb.txt for more information on cache management. 1940See Documentation/cachetlb.txt for more information on cache management.
@@ -1944,7 +1944,7 @@ CACHE COHERENCY VS MMIO
1944----------------------- 1944-----------------------
1945 1945
1946Memory mapped I/O usually takes place through memory locations that are part of 1946Memory mapped I/O usually takes place through memory locations that are part of
1947a window in the CPU's memory space that have different properties assigned than 1947a window in the CPU's memory space that has different properties assigned than
1948the usual RAM directed window. 1948the usual RAM directed window.
1949 1949
1950Amongst these properties is usually the fact that such accesses bypass the 1950Amongst these properties is usually the fact that such accesses bypass the
@@ -1960,7 +1960,7 @@ THE THINGS CPUS GET UP TO
1960========================= 1960=========================
1961 1961
1962A programmer might take it for granted that the CPU will perform memory 1962A programmer might take it for granted that the CPU will perform memory
1963operations in exactly the order specified, so that if a CPU is, for example, 1963operations in exactly the order specified, so that if the CPU is, for example,
1964given the following piece of code to execute: 1964given the following piece of code to execute:
1965 1965
1966 a = *A; 1966 a = *A;
@@ -1969,7 +1969,7 @@ given the following piece of code to execute:
1969 d = *D; 1969 d = *D;
1970 *E = e; 1970 *E = e;
1971 1971
1972They would then expect that the CPU will complete the memory operation for each 1972they would then expect that the CPU will complete the memory operation for each
1973instruction before moving on to the next one, leading to a definite sequence of 1973instruction before moving on to the next one, leading to a definite sequence of
1974operations as seen by external observers in the system: 1974operations as seen by external observers in the system:
1975 1975
@@ -1986,8 +1986,8 @@ assumption doesn't hold because:
1986 (*) loads may be done speculatively, and the result discarded should it prove 1986 (*) loads may be done speculatively, and the result discarded should it prove
1987 to have been unnecessary; 1987 to have been unnecessary;
1988 1988
1989 (*) loads may be done speculatively, leading to the result having being 1989 (*) loads may be done speculatively, leading to the result having been fetched
1990 fetched at the wrong time in the expected sequence of events; 1990 at the wrong time in the expected sequence of events;
1991 1991
1992 (*) the order of the memory accesses may be rearranged to promote better use 1992 (*) the order of the memory accesses may be rearranged to promote better use
1993 of the CPU buses and caches; 1993 of the CPU buses and caches;
@@ -2069,12 +2069,12 @@ AND THEN THERE'S THE ALPHA
2069 2069
2070The DEC Alpha CPU is one of the most relaxed CPUs there is. Not only that, 2070The DEC Alpha CPU is one of the most relaxed CPUs there is. Not only that,
2071some versions of the Alpha CPU have a split data cache, permitting them to have 2071some versions of the Alpha CPU have a split data cache, permitting them to have
2072two semantically related cache lines updating at separate times. This is where 2072two semantically-related cache lines updated at separate times. This is where
2073the data dependency barrier really becomes necessary as this synchronises both 2073the data dependency barrier really becomes necessary as this synchronises both
2074caches with the memory coherence system, thus making it seem like pointer 2074caches with the memory coherence system, thus making it seem like pointer
2075changes vs new data occur in the right order. 2075changes vs new data occur in the right order.
2076 2076
2077The Alpha defines the Linux's kernel's memory barrier model. 2077The Alpha defines the Linux kernel's memory barrier model.
2078 2078
2079See the subsection on "Cache Coherency" above. 2079See the subsection on "Cache Coherency" above.
2080 2080
diff --git a/Documentation/networking/xfrm_sysctl.txt b/Documentation/networking/xfrm_sysctl.txt
new file mode 100644
index 000000000000..5bbd16792fe1
--- /dev/null
+++ b/Documentation/networking/xfrm_sysctl.txt
@@ -0,0 +1,4 @@
1/proc/sys/net/core/xfrm_* Variables:
2
3xfrm_acq_expires - INTEGER
4 default 30 - hard timeout in seconds for acquire requests
diff --git a/Documentation/s390/cds.txt b/Documentation/s390/cds.txt
index 05a2b4f7e38f..58919d6a593a 100644
--- a/Documentation/s390/cds.txt
+++ b/Documentation/s390/cds.txt
@@ -51,13 +51,8 @@ The major changes are:
51* The interrupt handlers must be adapted to use a ccw_device as argument. 51* The interrupt handlers must be adapted to use a ccw_device as argument.
52 Moreover, they don't return a devstat, but an irb. 52 Moreover, they don't return a devstat, but an irb.
53* Before initiating an io, the options must be set via ccw_device_set_options(). 53* Before initiating an io, the options must be set via ccw_device_set_options().
54 54* Instead of calling read_dev_chars()/read_conf_data(), the driver issues
55read_dev_chars() 55 the channel program and handles the interrupt itself.
56 read device characteristics
57
58read_conf_data()
59read_conf_data_lpm()
60 read configuration data.
61 56
62ccw_device_get_ciw() 57ccw_device_get_ciw()
63 get commands from extended sense data. 58 get commands from extended sense data.
@@ -130,11 +125,6 @@ present their hardware status by the same (shared) IRQ, the operating system
130has to call every single device driver registered on this IRQ in order to 125has to call every single device driver registered on this IRQ in order to
131determine the device driver owning the device that raised the interrupt. 126determine the device driver owning the device that raised the interrupt.
132 127
133In order not to introduce a new I/O concept to the common Linux code,
134Linux/390 preserves the IRQ concept and semantically maps the ESA/390
135subchannels to Linux as IRQs. This allows Linux/390 to support up to 64k
136different IRQs, uniquely representing a single device each.
137
138Up to kernel 2.4, Linux/390 used to provide interfaces via the IRQ (subchannel). 128Up to kernel 2.4, Linux/390 used to provide interfaces via the IRQ (subchannel).
139For internal use of the common I/O layer, these are still there. However, 129For internal use of the common I/O layer, these are still there. However,
140device drivers should use the new calling interface via the ccw_device only. 130device drivers should use the new calling interface via the ccw_device only.
@@ -151,9 +141,8 @@ information during their initialization step to recognize the devices they
151support using the information saved in the struct ccw_device given to them. 141support using the information saved in the struct ccw_device given to them.
152This methods implies that Linux/390 doesn't require to probe for free (not 142This methods implies that Linux/390 doesn't require to probe for free (not
153armed) interrupt request lines (IRQs) to drive its devices with. Where 143armed) interrupt request lines (IRQs) to drive its devices with. Where
154applicable, the device drivers can use the read_dev_chars() to retrieve device 144applicable, the device drivers can use issue the READ DEVICE CHARACTERISTICS
155characteristics. This can be done without having to request device ownership 145ccw to retrieve device characteristics in its online routine.
156previously.
157 146
158In order to allow for easy I/O initiation the CDS layer provides a 147In order to allow for easy I/O initiation the CDS layer provides a
159ccw_device_start() interface that takes a device specific channel program (one 148ccw_device_start() interface that takes a device specific channel program (one
@@ -170,69 +159,6 @@ SUBCHANNEL (HSCH) command without having pending I/O requests. This function is
170also covered by ccw_device_halt(). 159also covered by ccw_device_halt().
171 160
172 161
173read_dev_chars() - Read Device Characteristics
174
175This routine returns the characteristics for the device specified.
176
177The function is meant to be called with the device already enabled; that is,
178at earliest during set_online() processing.
179
180The ccw_device must not be locked prior to calling read_dev_chars().
181
182The function may be called enabled or disabled.
183
184int read_dev_chars(struct ccw_device *cdev, void **buffer, int length );
185
186cdev - the ccw_device the information is requested for.
187buffer - pointer to a buffer pointer. The buffer pointer itself
188 must contain a valid buffer area.
189length - length of the buffer provided.
190
191The read_dev_chars() function returns :
192
193 0 - successful completion
194-ENODEV - cdev invalid
195-EINVAL - an invalid parameter was detected, or the function was called early.
196-EBUSY - an irrecoverable I/O error occurred or the device is not
197 operational.
198
199
200read_conf_data(), read_conf_data_lpm() - Read Configuration Data
201
202Retrieve the device dependent configuration data. Please have a look at your
203device dependent I/O commands for the device specific layout of the node
204descriptor elements. read_conf_data_lpm() will retrieve the configuration data
205for a specific path.
206
207The function is meant to be called with the device already enabled; that is,
208at earliest during set_online() processing.
209
210The function may be called enabled or disabled, but the device must not be
211locked
212
213int read_conf_data(struct ccw_device, void **buffer, int *length);
214int read_conf_data_lpm(struct ccw_device, void **buffer, int *length, __u8 lpm);
215
216cdev - the ccw_device the data is requested for.
217buffer - Pointer to a buffer pointer. The read_conf_data() routine
218 will allocate a buffer and initialize the buffer pointer
219 accordingly. It's the device driver's responsibility to
220 release the kernel memory if no longer needed.
221length - Length of the buffer allocated and retrieved.
222lpm - Logical path mask to be used for retrieving the data. If
223 zero the data is retrieved on the next path available.
224
225The read_conf_data() function returns :
226 0 - Successful completion
227-ENODEV - cdev invalid.
228-EINVAL - An invalid parameter was detected, or the function was called early.
229-EIO - An irrecoverable I/O error occurred or the device is
230 not operational.
231-ENOMEM - The read_conf_data() routine couldn't obtain storage.
232-EOPNOTSUPP - The device doesn't support the read configuration
233 data command.
234
235
236get_ciw() - get command information word 162get_ciw() - get command information word
237 163
238This call enables a device driver to get information about supported commands 164This call enables a device driver to get information about supported commands
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 57b878cc393c..355ff0a2bb7c 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -917,6 +917,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
917 ref Reference board, base config 917 ref Reference board, base config
918 m2-2 Some Gateway MX series laptops 918 m2-2 Some Gateway MX series laptops
919 m6 Some Gateway NX series laptops 919 m6 Some Gateway NX series laptops
920 pa6 Gateway NX860 series
920 921
921 STAC9227/9228/9229/927x 922 STAC9227/9228/9229/927x
922 ref Reference board 923 ref Reference board
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index 795fbb48ffa7..76ea6c837be5 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -1,26 +1,30 @@
1Overview of Linux kernel SPI support 1Overview of Linux kernel SPI support
2==================================== 2====================================
3 3
402-Dec-2005 421-May-2007
5 5
6What is SPI? 6What is SPI?
7------------ 7------------
8The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial 8The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial
9link used to connect microcontrollers to sensors, memory, and peripherals. 9link used to connect microcontrollers to sensors, memory, and peripherals.
10It's a simple "de facto" standard, not complicated enough to acquire a
11standardization body. SPI uses a master/slave configuration.
10 12
11The three signal wires hold a clock (SCK, often on the order of 10 MHz), 13The three signal wires hold a clock (SCK, often on the order of 10 MHz),
12and parallel data lines with "Master Out, Slave In" (MOSI) or "Master In, 14and parallel data lines with "Master Out, Slave In" (MOSI) or "Master In,
13Slave Out" (MISO) signals. (Other names are also used.) There are four 15Slave Out" (MISO) signals. (Other names are also used.) There are four
14clocking modes through which data is exchanged; mode-0 and mode-3 are most 16clocking modes through which data is exchanged; mode-0 and mode-3 are most
15commonly used. Each clock cycle shifts data out and data in; the clock 17commonly used. Each clock cycle shifts data out and data in; the clock
16doesn't cycle except when there is data to shift. 18doesn't cycle except when there is a data bit to shift. Not all data bits
19are used though; not every protocol uses those full duplex capabilities.
17 20
18SPI masters may use a "chip select" line to activate a given SPI slave 21SPI masters use a fourth "chip select" line to activate a given SPI slave
19device, so those three signal wires may be connected to several chips 22device, so those three signal wires may be connected to several chips
20in parallel. All SPI slaves support chipselects. Some devices have 23in parallel. All SPI slaves support chipselects; they are usually active
24low signals, labeled nCSx for slave 'x' (e.g. nCS0). Some devices have
21other signals, often including an interrupt to the master. 25other signals, often including an interrupt to the master.
22 26
23Unlike serial busses like USB or SMBUS, even low level protocols for 27Unlike serial busses like USB or SMBus, even low level protocols for
24SPI slave functions are usually not interoperable between vendors 28SPI slave functions are usually not interoperable between vendors
25(except for commodities like SPI memory chips). 29(except for commodities like SPI memory chips).
26 30
@@ -33,6 +37,11 @@ SPI slave functions are usually not interoperable between vendors
33 - Some devices may use eight bit words. Others may different word 37 - Some devices may use eight bit words. Others may different word
34 lengths, such as streams of 12-bit or 20-bit digital samples. 38 lengths, such as streams of 12-bit or 20-bit digital samples.
35 39
40 - Words are usually sent with their most significant bit (MSB) first,
41 but sometimes the least significant bit (LSB) goes first instead.
42
43 - Sometimes SPI is used to daisy-chain devices, like shift registers.
44
36In the same way, SPI slaves will only rarely support any kind of automatic 45In the same way, SPI slaves will only rarely support any kind of automatic
37discovery/enumeration protocol. The tree of slave devices accessible from 46discovery/enumeration protocol. The tree of slave devices accessible from
38a given SPI master will normally be set up manually, with configuration 47a given SPI master will normally be set up manually, with configuration
@@ -44,6 +53,14 @@ half-duplex SPI, for request/response protocols), SSP ("Synchronous
44Serial Protocol"), PSP ("Programmable Serial Protocol"), and other 53Serial Protocol"), PSP ("Programmable Serial Protocol"), and other
45related protocols. 54related protocols.
46 55
56Some chips eliminate a signal line by combining MOSI and MISO, and
57limiting themselves to half-duplex at the hardware level. In fact
58some SPI chips have this signal mode as a strapping option. These
59can be accessed using the same programming interface as SPI, but of
60course they won't handle full duplex transfers. You may find such
61chips described as using "three wire" signaling: SCK, data, nCSx.
62(That data line is sometimes called MOMI or SISO.)
63
47Microcontrollers often support both master and slave sides of the SPI 64Microcontrollers often support both master and slave sides of the SPI
48protocol. This document (and Linux) currently only supports the master 65protocol. This document (and Linux) currently only supports the master
49side of SPI interactions. 66side of SPI interactions.
@@ -74,6 +91,32 @@ interfaces with SPI modes. Given SPI support, they could use MMC or SD
74cards without needing a special purpose MMC/SD/SDIO controller. 91cards without needing a special purpose MMC/SD/SDIO controller.
75 92
76 93
94I'm confused. What are these four SPI "clock modes"?
95-----------------------------------------------------
96It's easy to be confused here, and the vendor documentation you'll
97find isn't necessarily helpful. The four modes combine two mode bits:
98
99 - CPOL indicates the initial clock polarity. CPOL=0 means the
100 clock starts low, so the first (leading) edge is rising, and
101 the second (trailing) edge is falling. CPOL=1 means the clock
102 starts high, so the first (leading) edge is falling.
103
104 - CPHA indicates the clock phase used to sample data; CPHA=0 says
105 sample on the leading edge, CPHA=1 means the trailing edge.
106
107 Since the signal needs to stablize before it's sampled, CPHA=0
108 implies that its data is written half a clock before the first
109 clock edge. The chipselect may have made it become available.
110
111Chip specs won't always say "uses SPI mode X" in as many words,
112but their timing diagrams will make the CPOL and CPHA modes clear.
113
114In the SPI mode number, CPOL is the high order bit and CPHA is the
115low order bit. So when a chip's timing diagram shows the clock
116starting low (CPOL=0) and data stabilized for sampling during the
117trailing clock edge (CPHA=1), that's SPI mode 1.
118
119
77How do these driver programming interfaces work? 120How do these driver programming interfaces work?
78------------------------------------------------ 121------------------------------------------------
79The <linux/spi/spi.h> header file includes kerneldoc, as does the 122The <linux/spi/spi.h> header file includes kerneldoc, as does the
diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt
index 2d4803359a04..9e6b94face4b 100644
--- a/Documentation/thinkpad-acpi.txt
+++ b/Documentation/thinkpad-acpi.txt
@@ -138,7 +138,7 @@ Hot keys
138-------- 138--------
139 139
140procfs: /proc/acpi/ibm/hotkey 140procfs: /proc/acpi/ibm/hotkey
141sysfs device attribute: hotkey/* 141sysfs device attribute: hotkey_*
142 142
143Without this driver, only the Fn-F4 key (sleep button) generates an 143Without this driver, only the Fn-F4 key (sleep button) generates an
144ACPI event. With the driver loaded, the hotkey feature enabled and the 144ACPI event. With the driver loaded, the hotkey feature enabled and the
@@ -196,10 +196,7 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file:
196 196
197sysfs notes: 197sysfs notes:
198 198
199 The hot keys attributes are in a hotkey/ subdirectory off the 199 hotkey_bios_enabled:
200 thinkpad device.
201
202 bios_enabled:
203 Returns the status of the hot keys feature when 200 Returns the status of the hot keys feature when
204 thinkpad-acpi was loaded. Upon module unload, the hot 201 thinkpad-acpi was loaded. Upon module unload, the hot
205 key feature status will be restored to this value. 202 key feature status will be restored to this value.
@@ -207,19 +204,19 @@ sysfs notes:
207 0: hot keys were disabled 204 0: hot keys were disabled
208 1: hot keys were enabled 205 1: hot keys were enabled
209 206
210 bios_mask: 207 hotkey_bios_mask:
211 Returns the hot keys mask when thinkpad-acpi was loaded. 208 Returns the hot keys mask when thinkpad-acpi was loaded.
212 Upon module unload, the hot keys mask will be restored 209 Upon module unload, the hot keys mask will be restored
213 to this value. 210 to this value.
214 211
215 enable: 212 hotkey_enable:
216 Enables/disables the hot keys feature, and reports 213 Enables/disables the hot keys feature, and reports
217 current status of the hot keys feature. 214 current status of the hot keys feature.
218 215
219 0: disables the hot keys feature / feature disabled 216 0: disables the hot keys feature / feature disabled
220 1: enables the hot keys feature / feature enabled 217 1: enables the hot keys feature / feature enabled
221 218
222 mask: 219 hotkey_mask:
223 bit mask to enable ACPI event generation for each hot 220 bit mask to enable ACPI event generation for each hot
224 key (see above). Returns the current status of the hot 221 key (see above). Returns the current status of the hot
225 keys mask, and allows one to modify it. 222 keys mask, and allows one to modify it.
@@ -229,7 +226,7 @@ Bluetooth
229--------- 226---------
230 227
231procfs: /proc/acpi/ibm/bluetooth 228procfs: /proc/acpi/ibm/bluetooth
232sysfs device attribute: bluetooth/enable 229sysfs device attribute: bluetooth_enable
233 230
234This feature shows the presence and current state of a ThinkPad 231This feature shows the presence and current state of a ThinkPad
235Bluetooth device in the internal ThinkPad CDC slot. 232Bluetooth device in the internal ThinkPad CDC slot.
@@ -244,7 +241,7 @@ If Bluetooth is installed, the following commands can be used:
244Sysfs notes: 241Sysfs notes:
245 242
246 If the Bluetooth CDC card is installed, it can be enabled / 243 If the Bluetooth CDC card is installed, it can be enabled /
247 disabled through the "bluetooth/enable" thinkpad-acpi device 244 disabled through the "bluetooth_enable" thinkpad-acpi device
248 attribute, and its current status can also be queried. 245 attribute, and its current status can also be queried.
249 246
250 enable: 247 enable:
@@ -252,7 +249,7 @@ Sysfs notes:
252 1: enables Bluetooth / Bluetooth is enabled. 249 1: enables Bluetooth / Bluetooth is enabled.
253 250
254 Note: this interface will be probably be superseeded by the 251 Note: this interface will be probably be superseeded by the
255 generic rfkill class. 252 generic rfkill class, so it is NOT to be considered stable yet.
256 253
257Video output control -- /proc/acpi/ibm/video 254Video output control -- /proc/acpi/ibm/video
258-------------------------------------------- 255--------------------------------------------
@@ -898,7 +895,7 @@ EXPERIMENTAL: WAN
898----------------- 895-----------------
899 896
900procfs: /proc/acpi/ibm/wan 897procfs: /proc/acpi/ibm/wan
901sysfs device attribute: wwan/enable 898sysfs device attribute: wwan_enable
902 899
903This feature is marked EXPERIMENTAL because the implementation 900This feature is marked EXPERIMENTAL because the implementation
904directly accesses hardware registers and may not work as expected. USE 901directly accesses hardware registers and may not work as expected. USE
@@ -921,7 +918,7 @@ If the W-WAN card is installed, the following commands can be used:
921Sysfs notes: 918Sysfs notes:
922 919
923 If the W-WAN card is installed, it can be enabled / 920 If the W-WAN card is installed, it can be enabled /
924 disabled through the "wwan/enable" thinkpad-acpi device 921 disabled through the "wwan_enable" thinkpad-acpi device
925 attribute, and its current status can also be queried. 922 attribute, and its current status can also be queried.
926 923
927 enable: 924 enable:
@@ -929,7 +926,7 @@ Sysfs notes:
929 1: enables WWAN card / WWAN card is enabled. 926 1: enables WWAN card / WWAN card is enabled.
930 927
931 Note: this interface will be probably be superseeded by the 928 Note: this interface will be probably be superseeded by the
932 generic rfkill class. 929 generic rfkill class, so it is NOT to be considered stable yet.
933 930
934Multiple Commands, Module Parameters 931Multiple Commands, Module Parameters
935------------------------------------ 932------------------------------------
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt
index 727c8d81aeaf..1523320abd87 100644
--- a/Documentation/vm/slub.txt
+++ b/Documentation/vm/slub.txt
@@ -1,13 +1,9 @@
1Short users guide for SLUB 1Short users guide for SLUB
2-------------------------- 2--------------------------
3 3
4First of all slub should transparently replace SLAB. If you enable
5SLUB then everything should work the same (Note the word "should".
6There is likely not much value in that word at this point).
7
8The basic philosophy of SLUB is very different from SLAB. SLAB 4The basic philosophy of SLUB is very different from SLAB. SLAB
9requires rebuilding the kernel to activate debug options for all 5requires rebuilding the kernel to activate debug options for all
10SLABS. SLUB always includes full debugging but its off by default. 6slab caches. SLUB always includes full debugging but it is off by default.
11SLUB can enable debugging only for selected slabs in order to avoid 7SLUB can enable debugging only for selected slabs in order to avoid
12an impact on overall system performance which may make a bug more 8an impact on overall system performance which may make a bug more
13difficult to find. 9difficult to find.
@@ -76,13 +72,28 @@ of objects.
76Careful with tracing: It may spew out lots of information and never stop if 72Careful with tracing: It may spew out lots of information and never stop if
77used on the wrong slab. 73used on the wrong slab.
78 74
79SLAB Merging 75Slab merging
80------------ 76------------
81 77
82If no debugging is specified then SLUB may merge similar slabs together 78If no debug options are specified then SLUB may merge similar slabs together
83in order to reduce overhead and increase cache hotness of objects. 79in order to reduce overhead and increase cache hotness of objects.
84slabinfo -a displays which slabs were merged together. 80slabinfo -a displays which slabs were merged together.
85 81
82Slab validation
83---------------
84
85SLUB can validate all object if the kernel was booted with slub_debug. In
86order to do so you must have the slabinfo tool. Then you can do
87
88slabinfo -v
89
90which will test all objects. Output will be generated to the syslog.
91
92This also works in a more limited way if boot was without slab debug.
93In that case slabinfo -v simply tests all reachable objects. Usually
94these are in the cpu slabs and the partial slabs. Full slabs are not
95tracked by SLUB in a non debug situation.
96
86Getting more performance 97Getting more performance
87------------------------ 98------------------------
88 99
@@ -91,9 +102,9 @@ list_lock once in a while to deal with partial slabs. That overhead is
91governed by the order of the allocation for each slab. The allocations 102governed by the order of the allocation for each slab. The allocations
92can be influenced by kernel parameters: 103can be influenced by kernel parameters:
93 104
94slub_min_objects=x (default 8) 105slub_min_objects=x (default 4)
95slub_min_order=x (default 0) 106slub_min_order=x (default 0)
96slub_max_order=x (default 4) 107slub_max_order=x (default 1)
97 108
98slub_min_objects allows to specify how many objects must at least fit 109slub_min_objects allows to specify how many objects must at least fit
99into one slab in order for the allocation order to be acceptable. 110into one slab in order for the allocation order to be acceptable.
@@ -109,5 +120,107 @@ longer be checked. This is useful to avoid SLUB trying to generate
109super large order pages to fit slub_min_objects of a slab cache with 120super large order pages to fit slub_min_objects of a slab cache with
110large object sizes into one high order page. 121large object sizes into one high order page.
111 122
112 123SLUB Debug output
113Christoph Lameter, <clameter@sgi.com>, April 10, 2007 124-----------------
125
126Here is a sample of slub debug output:
127
128*** SLUB kmalloc-8: Redzone Active@0xc90f6d20 slab 0xc528c530 offset=3360 flags=0x400000c3 inuse=61 freelist=0xc90f6d58
129 Bytes b4 0xc90f6d10: 00 00 00 00 00 00 00 00 5a 5a 5a 5a 5a 5a 5a 5a ........ZZZZZZZZ
130 Object 0xc90f6d20: 31 30 31 39 2e 30 30 35 1019.005
131 Redzone 0xc90f6d28: 00 cc cc cc .
132FreePointer 0xc90f6d2c -> 0xc90f6d58
133Last alloc: get_modalias+0x61/0xf5 jiffies_ago=53 cpu=1 pid=554
134Filler 0xc90f6d50: 5a 5a 5a 5a 5a 5a 5a 5a ZZZZZZZZ
135 [<c010523d>] dump_trace+0x63/0x1eb
136 [<c01053df>] show_trace_log_lvl+0x1a/0x2f
137 [<c010601d>] show_trace+0x12/0x14
138 [<c0106035>] dump_stack+0x16/0x18
139 [<c017e0fa>] object_err+0x143/0x14b
140 [<c017e2cc>] check_object+0x66/0x234
141 [<c017eb43>] __slab_free+0x239/0x384
142 [<c017f446>] kfree+0xa6/0xc6
143 [<c02e2335>] get_modalias+0xb9/0xf5
144 [<c02e23b7>] dmi_dev_uevent+0x27/0x3c
145 [<c027866a>] dev_uevent+0x1ad/0x1da
146 [<c0205024>] kobject_uevent_env+0x20a/0x45b
147 [<c020527f>] kobject_uevent+0xa/0xf
148 [<c02779f1>] store_uevent+0x4f/0x58
149 [<c027758e>] dev_attr_store+0x29/0x2f
150 [<c01bec4f>] sysfs_write_file+0x16e/0x19c
151 [<c0183ba7>] vfs_write+0xd1/0x15a
152 [<c01841d7>] sys_write+0x3d/0x72
153 [<c0104112>] sysenter_past_esp+0x5f/0x99
154 [<b7f7b410>] 0xb7f7b410
155 =======================
156@@@ SLUB kmalloc-8: Restoring redzone (0xcc) from 0xc90f6d28-0xc90f6d2b
157
158
159
160If SLUB encounters a corrupted object then it will perform the following
161actions:
162
1631. Isolation and report of the issue
164
165This will be a message in the system log starting with
166
167*** SLUB <slab cache affected>: <What went wrong>@<object address>
168offset=<offset of object into slab> flags=<slabflags>
169inuse=<objects in use in this slab> freelist=<first free object in slab>
170
1712. Report on how the problem was dealt with in order to ensure the continued
172operation of the system.
173
174These are messages in the system log beginning with
175
176@@@ SLUB <slab cache affected>: <corrective action taken>
177
178
179In the above sample SLUB found that the Redzone of an active object has
180been overwritten. Here a string of 8 characters was written into a slab that
181has the length of 8 characters. However, a 8 character string needs a
182terminating 0. That zero has overwritten the first byte of the Redzone field.
183After reporting the details of the issue encountered the @@@ SLUB message
184tell us that SLUB has restored the redzone to its proper value and then
185system operations continue.
186
187Various types of lines can follow the @@@ SLUB line:
188
189Bytes b4 <address> : <bytes>
190 Show a few bytes before the object where the problem was detected.
191 Can be useful if the corruption does not stop with the start of the
192 object.
193
194Object <address> : <bytes>
195 The bytes of the object. If the object is inactive then the bytes
196 typically contain poisoning values. Any non-poison value shows a
197 corruption by a write after free.
198
199Redzone <address> : <bytes>
200 The redzone following the object. The redzone is used to detect
201 writes after the object. All bytes should always have the same
202 value. If there is any deviation then it is due to a write after
203 the object boundary.
204
205Freepointer
206 The pointer to the next free object in the slab. May become
207 corrupted if overwriting continues after the red zone.
208
209Last alloc:
210Last free:
211 Shows the address from which the object was allocated/freed last.
212 We note the pid, the time and the CPU that did so. This is usually
213 the most useful information to figure out where things went wrong.
214 Here get_modalias() did an kmalloc(8) instead of a kmalloc(9).
215
216Filler <address> : <bytes>
217 Unused data to fill up the space in order to get the next object
218 properly aligned. In the debug case we make sure that there are
219 at least 4 bytes of filler. This allow for the detection of writes
220 before the object.
221
222Following the filler will be a stackdump. That stackdump describes the
223location where the error was detected. The cause of the corruption is more
224likely to be found by looking at the information about the last alloc / free.
225
226Christoph Lameter, <clameter@sgi.com>, May 23, 2007
diff --git a/MAINTAINERS b/MAINTAINERS
index 4c3277cb925e..124b9508ae2e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -30,8 +30,11 @@ trivial patch so apply some common sense.
30 job the maintainers (and especially Linus) do is to keep things 30 job the maintainers (and especially Linus) do is to keep things
31 looking the same. Sometimes this means that the clever hack in 31 looking the same. Sometimes this means that the clever hack in
32 your driver to get around a problem actually needs to become a 32 your driver to get around a problem actually needs to become a
33 generalized kernel feature ready for next time. See 33 generalized kernel feature ready for next time.
34 Documentation/CodingStyle for guidance here. 34
35 PLEASE check your patch with the automated style checker
36 (scripts/checkpatch.pl) to catch trival style violations.
37 See Documentation/CodingStyle for guidance here.
35 38
36 PLEASE try to include any credit lines you want added with the 39 PLEASE try to include any credit lines you want added with the
37 patch. It avoids people being missed off by mistake and makes 40 patch. It avoids people being missed off by mistake and makes
@@ -332,6 +335,9 @@ L: linux-usb-devel@lists.sourceforge.net
332W: http://www.linux-usb.org/SpeedTouch/ 335W: http://www.linux-usb.org/SpeedTouch/
333S: Maintained 336S: Maintained
334 337
338ALCHEMY AU1XX0 MMC DRIVER
339S: Orphan
340
335ALI1563 I2C DRIVER 341ALI1563 I2C DRIVER
336P: Rudolf Marek 342P: Rudolf Marek
337M: r.marek@assembler.cz 343M: r.marek@assembler.cz
@@ -418,6 +424,12 @@ P: Ian Molton
418M: spyro@f2s.com 424M: spyro@f2s.com
419S: Maintained 425S: Maintained
420 426
427ARM PRIMECELL MMCI PL180/1 DRIVER
428P: Russell King
429M: rmk@arm.linux.org.uk
430L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
431S: Maintained
432
421ARM/ADI ROADRUNNER MACHINE SUPPORT 433ARM/ADI ROADRUNNER MACHINE SUPPORT
422P: Lennert Buytenhek 434P: Lennert Buytenhek
423M: kernel@wantstofly.org 435M: kernel@wantstofly.org
@@ -649,6 +661,9 @@ L: linux-atm-general@lists.sourceforge.net (subscribers-only)
649W: http://linux-atm.sourceforge.net 661W: http://linux-atm.sourceforge.net
650S: Maintained 662S: Maintained
651 663
664ATMEL AT91 MCI DRIVER
665S: Orphan
666
652ATMEL MACB ETHERNET DRIVER 667ATMEL MACB ETHERNET DRIVER
653P: Haavard Skinnemoen 668P: Haavard Skinnemoen
654M: hskinnemoen@atmel.com 669M: hskinnemoen@atmel.com
@@ -960,6 +975,15 @@ M: johannes@sipsolutions.net
960L: linux-wireless@vger.kernel.org 975L: linux-wireless@vger.kernel.org
961S: Maintained 976S: Maintained
962 977
978CHECKPATCH
979P: Andy Whitcroft
980M: apw@shadowen.org
981P: Randy Dunlap
982M: rdunlap@xenotime.net
983P: Joel Schopp
984M: jschopp@austin.ibm.com
985S: Supported
986
963COMMON INTERNET FILE SYSTEM (CIFS) 987COMMON INTERNET FILE SYSTEM (CIFS)
964P: Steve French 988P: Steve French
965M: sfrench@samba.org 989M: sfrench@samba.org
@@ -1474,6 +1498,14 @@ P: Alexander Viro
1474M: viro@zeniv.linux.org.uk 1498M: viro@zeniv.linux.org.uk
1475S: Maintained 1499S: Maintained
1476 1500
1501FIREWIRE SUBSYSTEM
1502P: Kristian Hoegsberg, Stefan Richter
1503M: krh@redhat.com, stefanr@s5r6.in-berlin.de
1504L: linux1394-devel@lists.sourceforge.net
1505W: http://www.linux1394.org/
1506T: git kernel.org:/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git
1507S: Maintained
1508
1477FIRMWARE LOADER (request_firmware) 1509FIRMWARE LOADER (request_firmware)
1478L: linux-kernel@vger.kernel.org 1510L: linux-kernel@vger.kernel.org
1479S: Orphan 1511S: Orphan
@@ -2231,11 +2263,11 @@ M: khali@linux-fr.org
2231L: lm-sensors@lm-sensors.org 2263L: lm-sensors@lm-sensors.org
2232S: Maintained 2264S: Maintained
2233 2265
2234LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP Dynamic Disks) 2266LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks)
2235P: Richard Russon (FlatCap) 2267P: Richard Russon (FlatCap)
2236M: ldm@flatcap.org 2268M: ldm@flatcap.org
2237L: ldm-devel@lists.sourceforge.net 2269L: linux-ntfs-dev@lists.sourceforge.net
2238W: http://ldm.sourceforge.net 2270W: http://www.linux-ntfs.org/content/view/19/37/
2239S: Maintained 2271S: Maintained
2240 2272
2241LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) 2273LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
@@ -2322,7 +2354,7 @@ S: Maintained
2322 2354
2323MEGARAID SCSI DRIVERS 2355MEGARAID SCSI DRIVERS
2324P: Neela Syam Kolli 2356P: Neela Syam Kolli
2325M: Neela.Kolli@engenio.com 2357M: megaraidlinux@lsi.com
2326S: linux-scsi@vger.kernel.org 2358S: linux-scsi@vger.kernel.org
2327W: http://megaraid.lsilogic.com 2359W: http://megaraid.lsilogic.com
2328S: Maintained 2360S: Maintained
@@ -2380,6 +2412,13 @@ M: stelian@popies.net
2380W: http://popies.net/meye/ 2412W: http://popies.net/meye/
2381S: Maintained 2413S: Maintained
2382 2414
2415MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER
2416P: Pavel Pisa
2417M: ppisa@pikron.com
2418L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
2419W: http://mmc.drzeus.cx/wiki/Controllers/Freescale/SDHC
2420S: Maintained
2421
2383MOUSE AND MISC DEVICES [GENERAL] 2422MOUSE AND MISC DEVICES [GENERAL]
2384P: Alessandro Rubini 2423P: Alessandro Rubini
2385M: rubini@ipvvis.unipv.it 2424M: rubini@ipvvis.unipv.it
@@ -2861,8 +2900,8 @@ W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel
2861S: Supported 2900S: Supported
2862 2901
2863PRISM54 WIRELESS DRIVER 2902PRISM54 WIRELESS DRIVER
2864P: Prism54 Development Team 2903P: Luis R. Rodriguez
2865M: developers@islsm.org 2904M: mcgrof@gmail.com
2866L: linux-wireless@vger.kernel.org 2905L: linux-wireless@vger.kernel.org
2867W: http://prism54.org 2906W: http://prism54.org
2868S: Maintained 2907S: Maintained
@@ -2900,6 +2939,9 @@ M: nico@cam.org
2900L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 2939L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
2901S: Maintained 2940S: Maintained
2902 2941
2942PXA MMCI DRIVER
2943S: Orphan
2944
2903QLOGIC QLA2XXX FC-SCSI DRIVER 2945QLOGIC QLA2XXX FC-SCSI DRIVER
2904P: Andrew Vasquez 2946P: Andrew Vasquez
2905M: linux-driver@qlogic.com 2947M: linux-driver@qlogic.com
@@ -3416,6 +3458,13 @@ P: Alex Dubov
3416M: oakad@yahoo.com 3458M: oakad@yahoo.com
3417S: Maintained 3459S: Maintained
3418 3460
3461TI OMAP MMC INTERFACE DRIVER
3462P: Carlos Aguiar, Anderson Briglia and Syed Khasim
3463M: linux-omap-open-source@linux.omap.com
3464W: http://linux.omap.com
3465W: http://www.muru.com/linux/omap/
3466S: Maintained
3467
3419TI OMAP RANDOM NUMBER GENERATOR SUPPORT 3468TI OMAP RANDOM NUMBER GENERATOR SUPPORT
3420P: Deepak Saxena 3469P: Deepak Saxena
3421M: dsaxena@plexity.net 3470M: dsaxena@plexity.net
diff --git a/Makefile b/Makefile
index 34210af91ce2..562a90902cf6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 22 3SUBLEVEL = 22
4EXTRAVERSION = -rc2 4EXTRAVERSION = -rc3
5NAME = Nocturnal Monster Puppy 5NAME = Jeff Thinks I Should Change This, But To What?
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
8# To see a list of typical targets execute "make help" 8# To see a list of typical targets execute "make help"
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 770f717bd250..79c6e5a24456 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -83,22 +83,20 @@ choice
83 check out the Linux/Alpha FAQ, accessible on the WWW from 83 check out the Linux/Alpha FAQ, accessible on the WWW from
84 <http://www.alphalinux.org/>. In summary: 84 <http://www.alphalinux.org/>. In summary:
85 85
86 Alcor/Alpha-XLT AS 600 86 Alcor/Alpha-XLT AS 600, AS 500, XL-300, XL-366
87 Alpha-XL XL-233, XL-266 87 Alpha-XL XL-233, XL-266
88 AlphaBook1 Alpha laptop 88 AlphaBook1 Alpha laptop
89 Avanti AS 200, AS 205, AS 250, AS 255, AS 300, AS 400 89 Avanti AS 200, AS 205, AS 250, AS 255, AS 300, AS 400
90 Cabriolet AlphaPC64, AlphaPCI64 90 Cabriolet AlphaPC64, AlphaPCI64
91 DP264 DP264 91 DP264 DP264 / DS20 / ES40 / DS10 / DS10L
92 EB164 EB164 21164 evaluation board 92 EB164 EB164 21164 evaluation board
93 EB64+ EB64+ 21064 evaluation board 93 EB64+ EB64+ 21064 evaluation board
94 EB66 EB66 21066 evaluation board 94 EB66 EB66 21066 evaluation board
95 EB66+ EB66+ 21066 evaluation board 95 EB66+ EB66+ 21066 evaluation board
96 Jensen DECpc 150, DEC 2000 model 300, 96 Jensen DECpc 150, DEC 2000 models 300, 500
97 DEC 2000 model 500
98 LX164 AlphaPC164-LX 97 LX164 AlphaPC164-LX
99 Lynx AS 2100A 98 Lynx AS 2100A
100 Miata Personal Workstation 433a, 433au, 500a, 99 Miata Personal Workstation 433/500/600 a/au
101 500au, 600a, or 600au
102 Marvel AlphaServer ES47 / ES80 / GS1280 100 Marvel AlphaServer ES47 / ES80 / GS1280
103 Mikasa AS 1000 101 Mikasa AS 1000
104 Noname AXPpci33, UDB (Multia) 102 Noname AXPpci33, UDB (Multia)
@@ -108,9 +106,9 @@ choice
108 Ruffian RPX164-2, AlphaPC164-UX, AlphaPC164-BX 106 Ruffian RPX164-2, AlphaPC164-UX, AlphaPC164-BX
109 SX164 AlphaPC164-SX 107 SX164 AlphaPC164-SX
110 Sable AS 2000, AS 2100 108 Sable AS 2000, AS 2100
111 Shark DS 20L 109 Shark DS 20L
112 Takara Takara 110 Takara Takara (OEM)
113 Titan AlphaServer ES45 / DS25 111 Titan AlphaServer ES45 / DS25 / DS15
114 Wildfire AlphaServer GS 40/80/160/320 112 Wildfire AlphaServer GS 40/80/160/320
115 113
116 If you don't know what to do, choose "generic". 114 If you don't know what to do, choose "generic".
@@ -481,6 +479,15 @@ config ALPHA_BROKEN_IRQ_MASK
481 depends on ALPHA_GENERIC || ALPHA_PC164 479 depends on ALPHA_GENERIC || ALPHA_PC164
482 default y 480 default y
483 481
482config VGA_HOSE
483 bool
484 depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL || ALPHA_TSUNAMI
485 default y
486 help
487 Support VGA on an arbitrary hose; needed for several platforms
488 which always have multiple hoses, and whose consoles support it.
489
490
484config ALPHA_SRM 491config ALPHA_SRM
485 bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME 492 bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME
486 default y if ALPHA_JENSEN || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_LYNX || ALPHA_NORITAKE || ALPHA_DP264 || ALPHA_RAWHIDE || ALPHA_EIGER || ALPHA_WILDFIRE || ALPHA_TITAN || ALPHA_SHARK || ALPHA_MARVEL 493 default y if ALPHA_JENSEN || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_LYNX || ALPHA_NORITAKE || ALPHA_DP264 || ALPHA_RAWHIDE || ALPHA_EIGER || ALPHA_WILDFIRE || ALPHA_TITAN || ALPHA_SHARK || ALPHA_MARVEL
@@ -537,10 +544,14 @@ config HAVE_DEC_LOCK
537 default y 544 default y
538 545
539config NR_CPUS 546config NR_CPUS
540 int "Maximum number of CPUs (2-64)" 547 int "Maximum number of CPUs (2-32)"
541 range 2 64 548 range 2 32
542 depends on SMP 549 depends on SMP
543 default "64" 550 default "32" if ALPHA_GENERIC || ALPHA_MARVEL
551 default "4" if !ALPHA_GENERIC && !ALPHA_MARVEL
552 help
553 MARVEL support can handle a maximum of 32 CPUs, all the others
554 with working support have a maximum of 4 CPUs.
544 555
545config ARCH_DISCONTIGMEM_ENABLE 556config ARCH_DISCONTIGMEM_ENABLE
546 bool "Discontiguous Memory Support (EXPERIMENTAL)" 557 bool "Discontiguous Memory Support (EXPERIMENTAL)"
@@ -644,6 +655,13 @@ source "arch/alpha/oprofile/Kconfig"
644 655
645source "arch/alpha/Kconfig.debug" 656source "arch/alpha/Kconfig.debug"
646 657
658# DUMMY_CONSOLE may be defined in drivers/video/console/Kconfig
659# but we also need it if VGA_HOSE is set
660config DUMMY_CONSOLE
661 bool
662 depends on VGA_HOSE
663 default y
664
647source "security/Kconfig" 665source "security/Kconfig"
648 666
649source "crypto/Kconfig" 667source "crypto/Kconfig"
diff --git a/arch/alpha/boot/tools/mkbb.c b/arch/alpha/boot/tools/mkbb.c
index 23c7190b047c..632a7fd6d7dc 100644
--- a/arch/alpha/boot/tools/mkbb.c
+++ b/arch/alpha/boot/tools/mkbb.c
@@ -81,7 +81,7 @@ typedef union __bootblock {
81#define bootblock_label __u1.__label 81#define bootblock_label __u1.__label
82#define bootblock_checksum __u2.__checksum 82#define bootblock_checksum __u2.__checksum
83 83
84main(int argc, char ** argv) 84int main(int argc, char ** argv)
85{ 85{
86 bootblock bootblock_from_disk; 86 bootblock bootblock_from_disk;
87 bootblock bootloader_image; 87 bootblock bootloader_image;
diff --git a/arch/alpha/kernel/console.c b/arch/alpha/kernel/console.c
index f313b34939bb..da711e37fc97 100644
--- a/arch/alpha/kernel/console.c
+++ b/arch/alpha/kernel/console.c
@@ -9,16 +9,20 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/tty.h> 10#include <linux/tty.h>
11#include <linux/console.h> 11#include <linux/console.h>
12#include <linux/vt.h>
12#include <asm/vga.h> 13#include <asm/vga.h>
13#include <asm/machvec.h> 14#include <asm/machvec.h>
14 15
16#include "pci_impl.h"
17
15#ifdef CONFIG_VGA_HOSE 18#ifdef CONFIG_VGA_HOSE
16 19
17/* 20struct pci_controller *pci_vga_hose;
18 * Externally-visible vga hose bases 21static struct resource alpha_vga = {
19 */ 22 .name = "alpha-vga+",
20unsigned long __vga_hose_io_base = 0; /* base for default hose */ 23 .start = 0x3C0,
21unsigned long __vga_hose_mem_base = 0; /* base for default hose */ 24 .end = 0x3DF
25};
22 26
23static struct pci_controller * __init 27static struct pci_controller * __init
24default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2) 28default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2)
@@ -30,36 +34,58 @@ default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2)
30} 34}
31 35
32void __init 36void __init
33set_vga_hose(struct pci_controller *hose)
34{
35 if (hose) {
36 __vga_hose_io_base = hose->io_space->start;
37 __vga_hose_mem_base = hose->mem_space->start;
38 }
39}
40
41void __init
42locate_and_init_vga(void *(*sel_func)(void *, void *)) 37locate_and_init_vga(void *(*sel_func)(void *, void *))
43{ 38{
44 struct pci_controller *hose = NULL; 39 struct pci_controller *hose = NULL;
45 struct pci_dev *dev = NULL; 40 struct pci_dev *dev = NULL;
46 41
42 /* Default the select function */
47 if (!sel_func) sel_func = (void *)default_vga_hose_select; 43 if (!sel_func) sel_func = (void *)default_vga_hose_select;
48 44
45 /* Find the console VGA device */
49 for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) { 46 for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) {
50 if (!hose) hose = dev->sysdata; 47 if (!hose)
51 else hose = sel_func(hose, dev->sysdata); 48 hose = dev->sysdata;
49 else
50 hose = sel_func(hose, dev->sysdata);
52 } 51 }
53 52
54 /* Did we already inititialize the correct one? */ 53 /* Did we already initialize the correct one? Is there one? */
55 if (conswitchp == &vga_con && 54 if (!hose || (conswitchp == &vga_con && pci_vga_hose == hose))
56 __vga_hose_io_base == hose->io_space->start &&
57 __vga_hose_mem_base == hose->mem_space->start)
58 return; 55 return;
59 56
60 /* Set the VGA hose and init the new console */ 57 /* Create a new VGA ioport resource WRT the hose it is on. */
61 set_vga_hose(hose); 58 alpha_vga.start += hose->io_space->start;
59 alpha_vga.end += hose->io_space->start;
60 request_resource(hose->io_space, &alpha_vga);
61
62 /* Set the VGA hose and init the new console. */
63 pci_vga_hose = hose;
62 take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1); 64 take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1);
63} 65}
64 66
67void __init
68find_console_vga_hose(void)
69{
70 u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset);
71
72 if (pu64[7] == 3) { /* TERM_TYPE == graphics */
73 struct pci_controller *hose;
74 int h = (pu64[30] >> 24) & 0xff; /* console hose # */
75
76 /*
77 * Our hose numbering DOES match the console's, so find
78 * the right one...
79 */
80 for (hose = hose_head; hose; hose = hose->next) {
81 if (hose->index == h) break;
82 }
83
84 if (hose) {
85 printk("Console graphics on hose %d\n", h);
86 pci_vga_hose = hose;
87 }
88 }
89}
90
65#endif 91#endif
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c
index 7f6a98455e74..f10d2eddd2c3 100644
--- a/arch/alpha/kernel/core_marvel.c
+++ b/arch/alpha/kernel/core_marvel.c
@@ -25,6 +25,7 @@
25#include <asm/pgalloc.h> 25#include <asm/pgalloc.h>
26#include <asm/tlbflush.h> 26#include <asm/tlbflush.h>
27#include <asm/rtc.h> 27#include <asm/rtc.h>
28#include <asm/vga.h>
28 29
29#include "proto.h" 30#include "proto.h"
30#include "pci_impl.h" 31#include "pci_impl.h"
@@ -367,9 +368,8 @@ marvel_io7_present(gct6_node *node)
367} 368}
368 369
369static void __init 370static void __init
370marvel_init_vga_hose(void) 371marvel_find_console_vga_hose(void)
371{ 372{
372#ifdef CONFIG_VGA_HOSE
373 u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset); 373 u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset);
374 374
375 if (pu64[7] == 3) { /* TERM_TYPE == graphics */ 375 if (pu64[7] == 3) { /* TERM_TYPE == graphics */
@@ -403,7 +403,6 @@ marvel_init_vga_hose(void)
403 pci_vga_hose = hose; 403 pci_vga_hose = hose;
404 } 404 }
405 } 405 }
406#endif /* CONFIG_VGA_HOSE */
407} 406}
408 407
409gct6_search_struct gct_wanted_node_list[] = { 408gct6_search_struct gct_wanted_node_list[] = {
@@ -459,7 +458,7 @@ marvel_init_arch(void)
459 marvel_init_io7(io7); 458 marvel_init_io7(io7);
460 459
461 /* Check for graphic console location (if any). */ 460 /* Check for graphic console location (if any). */
462 marvel_init_vga_hose(); 461 marvel_find_console_vga_hose();
463} 462}
464 463
465void 464void
@@ -684,9 +683,6 @@ __marvel_rtc_io(u8 b, unsigned long addr, int write)
684/* 683/*
685 * IO map support. 684 * IO map support.
686 */ 685 */
687
688#define __marvel_is_mem_vga(a) (((a) >= 0xa0000) && ((a) <= 0xc0000))
689
690void __iomem * 686void __iomem *
691marvel_ioremap(unsigned long addr, unsigned long size) 687marvel_ioremap(unsigned long addr, unsigned long size)
692{ 688{
@@ -698,13 +694,9 @@ marvel_ioremap(unsigned long addr, unsigned long size)
698 unsigned long pfn; 694 unsigned long pfn;
699 695
700 /* 696 /*
701 * Adjust the addr. 697 * Adjust the address.
702 */ 698 */
703#ifdef CONFIG_VGA_HOSE 699 FIXUP_MEMADDR_VGA(addr);
704 if (pci_vga_hose && __marvel_is_mem_vga(addr)) {
705 addr += pci_vga_hose->mem_space->start;
706 }
707#endif
708 700
709 /* 701 /*
710 * Find the hose. 702 * Find the hose.
@@ -781,7 +773,9 @@ marvel_ioremap(unsigned long addr, unsigned long size)
781 return (void __iomem *) vaddr; 773 return (void __iomem *) vaddr;
782 } 774 }
783 775
784 return NULL; 776 /* Assume it was already a reasonable address */
777 vaddr = baddr + hose->mem_space->start;
778 return (void __iomem *) vaddr;
785} 779}
786 780
787void 781void
@@ -803,21 +797,12 @@ marvel_is_mmio(const volatile void __iomem *xaddr)
803 return (addr & 0xFF000000UL) == 0; 797 return (addr & 0xFF000000UL) == 0;
804} 798}
805 799
806#define __marvel_is_port_vga(a) \
807 (((a) >= 0x3b0) && ((a) < 0x3e0) && ((a) != 0x3b3) && ((a) != 0x3d3))
808#define __marvel_is_port_kbd(a) (((a) == 0x60) || ((a) == 0x64)) 800#define __marvel_is_port_kbd(a) (((a) == 0x60) || ((a) == 0x64))
809#define __marvel_is_port_rtc(a) (((a) == 0x70) || ((a) == 0x71)) 801#define __marvel_is_port_rtc(a) (((a) == 0x70) || ((a) == 0x71))
810 802
811void __iomem *marvel_ioportmap (unsigned long addr) 803void __iomem *marvel_ioportmap (unsigned long addr)
812{ 804{
813 if (__marvel_is_port_rtc (addr) || __marvel_is_port_kbd(addr)) 805 FIXUP_IOADDR_VGA(addr);
814 ;
815#ifdef CONFIG_VGA_HOSE
816 else if (__marvel_is_port_vga (addr) && pci_vga_hose)
817 addr += pci_vga_hose->io_space->start;
818#endif
819 else
820 return NULL;
821 return (void __iomem *)addr; 806 return (void __iomem *)addr;
822} 807}
823 808
@@ -829,8 +814,14 @@ marvel_ioread8(void __iomem *xaddr)
829 return 0; 814 return 0;
830 else if (__marvel_is_port_rtc(addr)) 815 else if (__marvel_is_port_rtc(addr))
831 return __marvel_rtc_io(0, addr, 0); 816 return __marvel_rtc_io(0, addr, 0);
832 else 817 else if (marvel_is_ioaddr(addr))
833 return __kernel_ldbu(*(vucp)addr); 818 return __kernel_ldbu(*(vucp)addr);
819 else
820 /* this should catch other legacy addresses
821 that would normally fail on MARVEL,
822 because there really is nothing there...
823 */
824 return ~0;
834} 825}
835 826
836void 827void
@@ -841,7 +832,7 @@ marvel_iowrite8(u8 b, void __iomem *xaddr)
841 return; 832 return;
842 else if (__marvel_is_port_rtc(addr)) 833 else if (__marvel_is_port_rtc(addr))
843 __marvel_rtc_io(b, addr, 1); 834 __marvel_rtc_io(b, addr, 1);
844 else 835 else if (marvel_is_ioaddr(addr))
845 __kernel_stb(b, *(vucp)addr); 836 __kernel_stb(b, *(vucp)addr);
846} 837}
847 838
diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c
index 3662fef7db9a..819326627b96 100644
--- a/arch/alpha/kernel/core_titan.c
+++ b/arch/alpha/kernel/core_titan.c
@@ -21,6 +21,7 @@
21#include <asm/smp.h> 21#include <asm/smp.h>
22#include <asm/pgalloc.h> 22#include <asm/pgalloc.h>
23#include <asm/tlbflush.h> 23#include <asm/tlbflush.h>
24#include <asm/vga.h>
24 25
25#include "proto.h" 26#include "proto.h"
26#include "pci_impl.h" 27#include "pci_impl.h"
@@ -35,6 +36,11 @@ struct
35} saved_config[4] __attribute__((common)); 36} saved_config[4] __attribute__((common));
36 37
37/* 38/*
39 * Is PChip 1 present? No need to query it more than once.
40 */
41static int titan_pchip1_present;
42
43/*
38 * BIOS32-style PCI interface: 44 * BIOS32-style PCI interface:
39 */ 45 */
40 46
@@ -344,43 +350,17 @@ titan_init_one_pachip_port(titan_pachip_port *port, int index)
344static void __init 350static void __init
345titan_init_pachips(titan_pachip *pachip0, titan_pachip *pachip1) 351titan_init_pachips(titan_pachip *pachip0, titan_pachip *pachip1)
346{ 352{
347 int pchip1_present = TITAN_cchip->csc.csr & 1L<<14; 353 titan_pchip1_present = TITAN_cchip->csc.csr & 1L<<14;
348 354
349 /* Init the ports in hose order... */ 355 /* Init the ports in hose order... */
350 titan_init_one_pachip_port(&pachip0->g_port, 0); /* hose 0 */ 356 titan_init_one_pachip_port(&pachip0->g_port, 0); /* hose 0 */
351 if (pchip1_present) 357 if (titan_pchip1_present)
352 titan_init_one_pachip_port(&pachip1->g_port, 1);/* hose 1 */ 358 titan_init_one_pachip_port(&pachip1->g_port, 1);/* hose 1 */
353 titan_init_one_pachip_port(&pachip0->a_port, 2); /* hose 2 */ 359 titan_init_one_pachip_port(&pachip0->a_port, 2); /* hose 2 */
354 if (pchip1_present) 360 if (titan_pchip1_present)
355 titan_init_one_pachip_port(&pachip1->a_port, 3);/* hose 3 */ 361 titan_init_one_pachip_port(&pachip1->a_port, 3);/* hose 3 */
356} 362}
357 363
358static void __init
359titan_init_vga_hose(void)
360{
361#ifdef CONFIG_VGA_HOSE
362 u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset);
363
364 if (pu64[7] == 3) { /* TERM_TYPE == graphics */
365 struct pci_controller *hose;
366 int h = (pu64[30] >> 24) & 0xff; /* console hose # */
367
368 /*
369 * Our hose numbering matches the console's, so just find
370 * the right one...
371 */
372 for (hose = hose_head; hose; hose = hose->next) {
373 if (hose->index == h) break;
374 }
375
376 if (hose) {
377 printk("Console graphics on hose %d\n", hose->index);
378 pci_vga_hose = hose;
379 }
380 }
381#endif /* CONFIG_VGA_HOSE */
382}
383
384void __init 364void __init
385titan_init_arch(void) 365titan_init_arch(void)
386{ 366{
@@ -406,6 +386,7 @@ titan_init_arch(void)
406 386
407 /* With multiple PCI busses, we play with I/O as physical addrs. */ 387 /* With multiple PCI busses, we play with I/O as physical addrs. */
408 ioport_resource.end = ~0UL; 388 ioport_resource.end = ~0UL;
389 iomem_resource.end = ~0UL;
409 390
410 /* PCI DMA Direct Mapping is 1GB at 2GB. */ 391 /* PCI DMA Direct Mapping is 1GB at 2GB. */
411 __direct_map_base = 0x80000000; 392 __direct_map_base = 0x80000000;
@@ -415,7 +396,7 @@ titan_init_arch(void)
415 titan_init_pachips(TITAN_pachip0, TITAN_pachip1); 396 titan_init_pachips(TITAN_pachip0, TITAN_pachip1);
416 397
417 /* Check for graphic console location (if any). */ 398 /* Check for graphic console location (if any). */
418 titan_init_vga_hose(); 399 find_console_vga_hose();
419} 400}
420 401
421static void 402static void
@@ -441,9 +422,7 @@ titan_kill_one_pachip_port(titan_pachip_port *port, int index)
441static void 422static void
442titan_kill_pachips(titan_pachip *pachip0, titan_pachip *pachip1) 423titan_kill_pachips(titan_pachip *pachip0, titan_pachip *pachip1)
443{ 424{
444 int pchip1_present = TITAN_cchip->csc.csr & 1L<<14; 425 if (titan_pchip1_present) {
445
446 if (pchip1_present) {
447 titan_kill_one_pachip_port(&pachip1->g_port, 1); 426 titan_kill_one_pachip_port(&pachip1->g_port, 1);
448 titan_kill_one_pachip_port(&pachip1->a_port, 3); 427 titan_kill_one_pachip_port(&pachip1->a_port, 3);
449 } 428 }
@@ -463,6 +442,14 @@ titan_kill_arch(int mode)
463 */ 442 */
464 443
465void __iomem * 444void __iomem *
445titan_ioportmap(unsigned long addr)
446{
447 FIXUP_IOADDR_VGA(addr);
448 return (void __iomem *)(addr + TITAN_IO_BIAS);
449}
450
451
452void __iomem *
466titan_ioremap(unsigned long addr, unsigned long size) 453titan_ioremap(unsigned long addr, unsigned long size)
467{ 454{
468 int h = (addr & TITAN_HOSE_MASK) >> TITAN_HOSE_SHIFT; 455 int h = (addr & TITAN_HOSE_MASK) >> TITAN_HOSE_SHIFT;
@@ -475,14 +462,12 @@ titan_ioremap(unsigned long addr, unsigned long size)
475 unsigned long pfn; 462 unsigned long pfn;
476 463
477 /* 464 /*
478 * Adjust the addr. 465 * Adjust the address and hose, if necessary.
479 */ 466 */
480#ifdef CONFIG_VGA_HOSE 467 if (pci_vga_hose && __is_mem_vga(addr)) {
481 if (pci_vga_hose && __titan_is_mem_vga(addr)) {
482 h = pci_vga_hose->index; 468 h = pci_vga_hose->index;
483 addr += pci_vga_hose->mem_space->start; 469 addr += pci_vga_hose->mem_space->start;
484 } 470 }
485#endif
486 471
487 /* 472 /*
488 * Find the hose. 473 * Find the hose.
@@ -521,8 +506,10 @@ titan_ioremap(unsigned long addr, unsigned long size)
521 * Map it 506 * Map it
522 */ 507 */
523 area = get_vm_area(size, VM_IOREMAP); 508 area = get_vm_area(size, VM_IOREMAP);
524 if (!area) 509 if (!area) {
510 printk("ioremap failed... no vm_area...\n");
525 return NULL; 511 return NULL;
512 }
526 513
527 ptes = hose->sg_pci->ptes; 514 ptes = hose->sg_pci->ptes;
528 for (vaddr = (unsigned long)area->addr; 515 for (vaddr = (unsigned long)area->addr;
@@ -539,7 +526,7 @@ titan_ioremap(unsigned long addr, unsigned long size)
539 if (__alpha_remap_area_pages(vaddr, 526 if (__alpha_remap_area_pages(vaddr,
540 pfn << PAGE_SHIFT, 527 pfn << PAGE_SHIFT,
541 PAGE_SIZE, 0)) { 528 PAGE_SIZE, 0)) {
542 printk("FAILED to map...\n"); 529 printk("FAILED to remap_area_pages...\n");
543 vfree(area->addr); 530 vfree(area->addr);
544 return NULL; 531 return NULL;
545 } 532 }
@@ -551,7 +538,8 @@ titan_ioremap(unsigned long addr, unsigned long size)
551 return (void __iomem *) vaddr; 538 return (void __iomem *) vaddr;
552 } 539 }
553 540
554 return NULL; 541 /* Assume a legacy (read: VGA) address, and return appropriately. */
542 return (void __iomem *)(addr + TITAN_MEM_BIAS);
555} 543}
556 544
557void 545void
@@ -574,6 +562,7 @@ titan_is_mmio(const volatile void __iomem *xaddr)
574} 562}
575 563
576#ifndef CONFIG_ALPHA_GENERIC 564#ifndef CONFIG_ALPHA_GENERIC
565EXPORT_SYMBOL(titan_ioportmap);
577EXPORT_SYMBOL(titan_ioremap); 566EXPORT_SYMBOL(titan_ioremap);
578EXPORT_SYMBOL(titan_iounmap); 567EXPORT_SYMBOL(titan_iounmap);
579EXPORT_SYMBOL(titan_is_mmio); 568EXPORT_SYMBOL(titan_is_mmio);
@@ -750,6 +739,7 @@ titan_agp_info(void)
750 if (titan_query_agp(port)) 739 if (titan_query_agp(port))
751 hosenum = 2; 740 hosenum = 2;
752 if (hosenum < 0 && 741 if (hosenum < 0 &&
742 titan_pchip1_present &&
753 titan_query_agp(port = &TITAN_pachip1->a_port)) 743 titan_query_agp(port = &TITAN_pachip1->a_port))
754 hosenum = 3; 744 hosenum = 3;
755 745
diff --git a/arch/alpha/kernel/core_tsunami.c b/arch/alpha/kernel/core_tsunami.c
index ce623c6e55e1..ef91e09590d4 100644
--- a/arch/alpha/kernel/core_tsunami.c
+++ b/arch/alpha/kernel/core_tsunami.c
@@ -19,6 +19,7 @@
19 19
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21#include <asm/smp.h> 21#include <asm/smp.h>
22#include <asm/vga.h>
22 23
23#include "proto.h" 24#include "proto.h"
24#include "pci_impl.h" 25#include "pci_impl.h"
@@ -349,6 +350,26 @@ tsunami_init_one_pchip(tsunami_pchip *pchip, int index)
349 tsunami_pci_tbi(hose, 0, -1); 350 tsunami_pci_tbi(hose, 0, -1);
350} 351}
351 352
353
354void __iomem *
355tsunami_ioportmap(unsigned long addr)
356{
357 FIXUP_IOADDR_VGA(addr);
358 return (void __iomem *)(addr + TSUNAMI_IO_BIAS);
359}
360
361void __iomem *
362tsunami_ioremap(unsigned long addr, unsigned long size)
363{
364 FIXUP_MEMADDR_VGA(addr);
365 return (void __iomem *)(addr + TSUNAMI_MEM_BIAS);
366}
367
368#ifndef CONFIG_ALPHA_GENERIC
369EXPORT_SYMBOL(tsunami_ioportmap);
370EXPORT_SYMBOL(tsunami_ioremap);
371#endif
372
352void __init 373void __init
353tsunami_init_arch(void) 374tsunami_init_arch(void)
354{ 375{
@@ -393,6 +414,9 @@ tsunami_init_arch(void)
393 tsunami_init_one_pchip(TSUNAMI_pchip0, 0); 414 tsunami_init_one_pchip(TSUNAMI_pchip0, 0);
394 if (TSUNAMI_cchip->csc.csr & 1L<<14) 415 if (TSUNAMI_cchip->csc.csr & 1L<<14)
395 tsunami_init_one_pchip(TSUNAMI_pchip1, 1); 416 tsunami_init_one_pchip(TSUNAMI_pchip1, 1);
417
418 /* Check for graphic console location (if any). */
419 find_console_vga_hose();
396} 420}
397 421
398static void 422static void
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index c95e95e1ab04..debc8f03886c 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -391,11 +391,10 @@ $work_resched:
391 bne $2, $work_resched 391 bne $2, $work_resched
392 392
393$work_notifysig: 393$work_notifysig:
394 mov $sp, $17 394 mov $sp, $16
395 br $1, do_switch_stack 395 br $1, do_switch_stack
396 mov $5, $21 396 mov $sp, $17
397 mov $sp, $18 397 mov $5, $18
398 mov $31, $16
399 jsr $26, do_notify_resume 398 jsr $26, do_notify_resume
400 bsr $1, undo_switch_stack 399 bsr $1, undo_switch_stack
401 br restore_all 400 br restore_all
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c
index 6e7d1fe6e935..28c84e55feb9 100644
--- a/arch/alpha/kernel/pci_iommu.c
+++ b/arch/alpha/kernel/pci_iommu.c
@@ -7,6 +7,7 @@
7#include <linux/pci.h> 7#include <linux/pci.h>
8#include <linux/slab.h> 8#include <linux/slab.h>
9#include <linux/bootmem.h> 9#include <linux/bootmem.h>
10#include <linux/log2.h>
10 11
11#include <asm/io.h> 12#include <asm/io.h>
12#include <asm/hwrpb.h> 13#include <asm/hwrpb.h>
@@ -53,7 +54,7 @@ size_for_memory(unsigned long max)
53{ 54{
54 unsigned long mem = max_low_pfn << PAGE_SHIFT; 55 unsigned long mem = max_low_pfn << PAGE_SHIFT;
55 if (mem < max) 56 if (mem < max)
56 max = 1UL << ceil_log2(mem); 57 max = roundup_pow_of_two(mem);
57 return max; 58 return max;
58} 59}
59 60
diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h
index 95912ecc65e1..708d5ca87782 100644
--- a/arch/alpha/kernel/proto.h
+++ b/arch/alpha/kernel/proto.h
@@ -108,6 +108,15 @@ extern int wildfire_cpuid_to_nid(int);
108extern unsigned long wildfire_node_mem_start(int); 108extern unsigned long wildfire_node_mem_start(int);
109extern unsigned long wildfire_node_mem_size(int); 109extern unsigned long wildfire_node_mem_size(int);
110 110
111/* console.c */
112#ifdef CONFIG_VGA_HOSE
113extern void find_console_vga_hose(void);
114extern void locate_and_init_vga(void *(*)(void *, void *));
115#else
116static inline void find_console_vga_hose(void) { }
117static inline void locate_and_init_vga(void *(*sel_func)(void *, void *)) { }
118#endif
119
111/* setup.c */ 120/* setup.c */
112extern unsigned long srm_hae; 121extern unsigned long srm_hae;
113extern int boot_cpuid; 122extern int boot_cpuid;
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index 915f26345c45..bd5e68cd61e8 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -43,6 +43,7 @@
43#include <linux/notifier.h> 43#include <linux/notifier.h>
44#include <asm/setup.h> 44#include <asm/setup.h>
45#include <asm/io.h> 45#include <asm/io.h>
46#include <linux/log2.h>
46 47
47extern struct atomic_notifier_head panic_notifier_list; 48extern struct atomic_notifier_head panic_notifier_list;
48static int alpha_panic_event(struct notifier_block *, unsigned long, void *); 49static int alpha_panic_event(struct notifier_block *, unsigned long, void *);
@@ -1303,7 +1304,7 @@ external_cache_probe(int minsize, int width)
1303 long size = minsize, maxsize = MAX_BCACHE_SIZE * 2; 1304 long size = minsize, maxsize = MAX_BCACHE_SIZE * 2;
1304 1305
1305 if (maxsize > (max_low_pfn + 1) << PAGE_SHIFT) 1306 if (maxsize > (max_low_pfn + 1) << PAGE_SHIFT)
1306 maxsize = 1 << (floor_log2(max_low_pfn + 1) + PAGE_SHIFT); 1307 maxsize = 1 << (ilog2(max_low_pfn + 1) + PAGE_SHIFT);
1307 1308
1308 /* Get the first block cached. */ 1309 /* Get the first block cached. */
1309 read_mem_block(__va(0), stride, size); 1310 read_mem_block(__va(0), stride, size);
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
index 7f64aa767d5a..410af4f3140e 100644
--- a/arch/alpha/kernel/signal.c
+++ b/arch/alpha/kernel/signal.c
@@ -32,8 +32,8 @@
32#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 32#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
33 33
34asmlinkage void ret_from_sys_call(void); 34asmlinkage void ret_from_sys_call(void);
35static int do_signal(sigset_t *, struct pt_regs *, struct switch_stack *, 35static void do_signal(struct pt_regs *, struct switch_stack *,
36 unsigned long, unsigned long); 36 unsigned long, unsigned long);
37 37
38 38
39/* 39/*
@@ -146,11 +146,9 @@ sys_rt_sigaction(int sig, const struct sigaction __user *act,
146asmlinkage int 146asmlinkage int
147do_sigsuspend(old_sigset_t mask, struct pt_regs *regs, struct switch_stack *sw) 147do_sigsuspend(old_sigset_t mask, struct pt_regs *regs, struct switch_stack *sw)
148{ 148{
149 sigset_t oldset;
150
151 mask &= _BLOCKABLE; 149 mask &= _BLOCKABLE;
152 spin_lock_irq(&current->sighand->siglock); 150 spin_lock_irq(&current->sighand->siglock);
153 oldset = current->blocked; 151 current->saved_sigmask = current->blocked;
154 siginitset(&current->blocked, mask); 152 siginitset(&current->blocked, mask);
155 recalc_sigpending(); 153 recalc_sigpending();
156 spin_unlock_irq(&current->sighand->siglock); 154 spin_unlock_irq(&current->sighand->siglock);
@@ -160,19 +158,17 @@ do_sigsuspend(old_sigset_t mask, struct pt_regs *regs, struct switch_stack *sw)
160 regs->r0 = EINTR; 158 regs->r0 = EINTR;
161 regs->r19 = 1; 159 regs->r19 = 1;
162 160
163 while (1) { 161 current->state = TASK_INTERRUPTIBLE;
164 current->state = TASK_INTERRUPTIBLE; 162 schedule();
165 schedule(); 163 set_thread_flag(TIF_RESTORE_SIGMASK);
166 if (do_signal(&oldset, regs, sw, 0, 0)) 164 return -ERESTARTNOHAND;
167 return -EINTR;
168 }
169} 165}
170 166
171asmlinkage int 167asmlinkage int
172do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize, 168do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize,
173 struct pt_regs *regs, struct switch_stack *sw) 169 struct pt_regs *regs, struct switch_stack *sw)
174{ 170{
175 sigset_t oldset, set; 171 sigset_t set;
176 172
177 /* XXX: Don't preclude handling different sized sigset_t's. */ 173 /* XXX: Don't preclude handling different sized sigset_t's. */
178 if (sigsetsize != sizeof(sigset_t)) 174 if (sigsetsize != sizeof(sigset_t))
@@ -182,7 +178,7 @@ do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize,
182 178
183 sigdelsetmask(&set, ~_BLOCKABLE); 179 sigdelsetmask(&set, ~_BLOCKABLE);
184 spin_lock_irq(&current->sighand->siglock); 180 spin_lock_irq(&current->sighand->siglock);
185 oldset = current->blocked; 181 current->saved_sigmask = current->blocked;
186 current->blocked = set; 182 current->blocked = set;
187 recalc_sigpending(); 183 recalc_sigpending();
188 spin_unlock_irq(&current->sighand->siglock); 184 spin_unlock_irq(&current->sighand->siglock);
@@ -192,12 +188,10 @@ do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize,
192 regs->r0 = EINTR; 188 regs->r0 = EINTR;
193 regs->r19 = 1; 189 regs->r19 = 1;
194 190
195 while (1) { 191 current->state = TASK_INTERRUPTIBLE;
196 current->state = TASK_INTERRUPTIBLE; 192 schedule();
197 schedule(); 193 set_thread_flag(TIF_RESTORE_SIGMASK);
198 if (do_signal(&oldset, regs, sw, 0, 0)) 194 return -ERESTARTNOHAND;
199 return -EINTR;
200 }
201} 195}
202 196
203asmlinkage int 197asmlinkage int
@@ -436,7 +430,7 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
436 return err; 430 return err;
437} 431}
438 432
439static void 433static int
440setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, 434setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
441 struct pt_regs *regs, struct switch_stack * sw) 435 struct pt_regs *regs, struct switch_stack * sw)
442{ 436{
@@ -481,13 +475,14 @@ setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
481 current->comm, current->pid, frame, regs->pc, regs->r26); 475 current->comm, current->pid, frame, regs->pc, regs->r26);
482#endif 476#endif
483 477
484 return; 478 return 0;
485 479
486give_sigsegv: 480give_sigsegv:
487 force_sigsegv(sig, current); 481 force_sigsegv(sig, current);
482 return -EFAULT;
488} 483}
489 484
490static void 485static int
491setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 486setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
492 sigset_t *set, struct pt_regs *regs, struct switch_stack * sw) 487 sigset_t *set, struct pt_regs *regs, struct switch_stack * sw)
493{ 488{
@@ -543,34 +538,38 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
543 current->comm, current->pid, frame, regs->pc, regs->r26); 538 current->comm, current->pid, frame, regs->pc, regs->r26);
544#endif 539#endif
545 540
546 return; 541 return 0;
547 542
548give_sigsegv: 543give_sigsegv:
549 force_sigsegv(sig, current); 544 force_sigsegv(sig, current);
545 return -EFAULT;
550} 546}
551 547
552 548
553/* 549/*
554 * OK, we're invoking a handler. 550 * OK, we're invoking a handler.
555 */ 551 */
556static inline void 552static inline int
557handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, 553handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
558 sigset_t *oldset, struct pt_regs * regs, struct switch_stack *sw) 554 sigset_t *oldset, struct pt_regs * regs, struct switch_stack *sw)
559{ 555{
556 int ret;
557
560 if (ka->sa.sa_flags & SA_SIGINFO) 558 if (ka->sa.sa_flags & SA_SIGINFO)
561 setup_rt_frame(sig, ka, info, oldset, regs, sw); 559 ret = setup_rt_frame(sig, ka, info, oldset, regs, sw);
562 else 560 else
563 setup_frame(sig, ka, oldset, regs, sw); 561 ret = setup_frame(sig, ka, oldset, regs, sw);
564 562
565 if (ka->sa.sa_flags & SA_RESETHAND) 563 if (ret == 0) {
566 ka->sa.sa_handler = SIG_DFL; 564 spin_lock_irq(&current->sighand->siglock);
565 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
566 if (!(ka->sa.sa_flags & SA_NODEFER))
567 sigaddset(&current->blocked,sig);
568 recalc_sigpending();
569 spin_unlock_irq(&current->sighand->siglock);
570 }
567 571
568 spin_lock_irq(&current->sighand->siglock); 572 return ret;
569 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
570 if (!(ka->sa.sa_flags & SA_NODEFER))
571 sigaddset(&current->blocked,sig);
572 recalc_sigpending();
573 spin_unlock_irq(&current->sighand->siglock);
574} 573}
575 574
576static inline void 575static inline void
@@ -611,30 +610,42 @@ syscall_restart(unsigned long r0, unsigned long r19,
611 * restart. "r0" is also used as an indicator whether we can restart at 610 * restart. "r0" is also used as an indicator whether we can restart at
612 * all (if we get here from anything but a syscall return, it will be 0) 611 * all (if we get here from anything but a syscall return, it will be 0)
613 */ 612 */
614static int 613static void
615do_signal(sigset_t *oldset, struct pt_regs * regs, struct switch_stack * sw, 614do_signal(struct pt_regs * regs, struct switch_stack * sw,
616 unsigned long r0, unsigned long r19) 615 unsigned long r0, unsigned long r19)
617{ 616{
618 siginfo_t info; 617 siginfo_t info;
619 int signr; 618 int signr;
620 unsigned long single_stepping = ptrace_cancel_bpt(current); 619 unsigned long single_stepping = ptrace_cancel_bpt(current);
621 struct k_sigaction ka; 620 struct k_sigaction ka;
621 sigset_t *oldset;
622 622
623 if (!oldset) 623 if (test_thread_flag(TIF_RESTORE_SIGMASK))
624 oldset = &current->saved_sigmask;
625 else
624 oldset = &current->blocked; 626 oldset = &current->blocked;
625 627
626 /* This lets the debugger run, ... */ 628 /* This lets the debugger run, ... */
627 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 629 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
630
628 /* ... so re-check the single stepping. */ 631 /* ... so re-check the single stepping. */
629 single_stepping |= ptrace_cancel_bpt(current); 632 single_stepping |= ptrace_cancel_bpt(current);
630 633
631 if (signr > 0) { 634 if (signr > 0) {
632 /* Whee! Actually deliver the signal. */ 635 /* Whee! Actually deliver the signal. */
633 if (r0) syscall_restart(r0, r19, regs, &ka); 636 if (r0)
634 handle_signal(signr, &ka, &info, oldset, regs, sw); 637 syscall_restart(r0, r19, regs, &ka);
638 if (handle_signal(signr, &ka, &info, oldset, regs, sw) == 0) {
639 /* A signal was successfully delivered, and the
640 saved sigmask was stored on the signal frame,
641 and will be restored by sigreturn. So we can
642 simply clear the restore sigmask flag. */
643 if (test_thread_flag(TIF_RESTORE_SIGMASK))
644 clear_thread_flag(TIF_RESTORE_SIGMASK);
645 }
635 if (single_stepping) 646 if (single_stepping)
636 ptrace_set_bpt(current); /* re-set bpt */ 647 ptrace_set_bpt(current); /* re-set bpt */
637 return 1; 648 return;
638 } 649 }
639 650
640 if (r0) { 651 if (r0) {
@@ -654,17 +665,22 @@ do_signal(sigset_t *oldset, struct pt_regs * regs, struct switch_stack * sw,
654 break; 665 break;
655 } 666 }
656 } 667 }
668
669 /* If there's no signal to deliver, we just restore the saved mask. */
670 if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
671 clear_thread_flag(TIF_RESTORE_SIGMASK);
672 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
673 }
674
657 if (single_stepping) 675 if (single_stepping)
658 ptrace_set_bpt(current); /* re-set breakpoint */ 676 ptrace_set_bpt(current); /* re-set breakpoint */
659
660 return 0;
661} 677}
662 678
663void 679void
664do_notify_resume(sigset_t *oldset, struct pt_regs *regs, 680do_notify_resume(struct pt_regs *regs, struct switch_stack *sw,
665 struct switch_stack *sw, unsigned long r0, 681 unsigned long thread_info_flags,
666 unsigned long r19, unsigned long thread_info_flags) 682 unsigned long r0, unsigned long r19)
667{ 683{
668 if (thread_info_flags & _TIF_SIGPENDING) 684 if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK))
669 do_signal(oldset, regs, sw, r0, r19); 685 do_signal(regs, sw, r0, r19);
670} 686}
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index 85d2f933dd07..c71b0fd7a61f 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -543,6 +543,7 @@ dp264_init_pci(void)
543{ 543{
544 common_init_pci(); 544 common_init_pci();
545 SMC669_Init(0); 545 SMC669_Init(0);
546 locate_and_init_vga(NULL);
546} 547}
547 548
548static void __init 549static void __init
@@ -551,6 +552,14 @@ monet_init_pci(void)
551 common_init_pci(); 552 common_init_pci();
552 SMC669_Init(1); 553 SMC669_Init(1);
553 es1888_init(); 554 es1888_init();
555 locate_and_init_vga(NULL);
556}
557
558static void __init
559clipper_init_pci(void)
560{
561 common_init_pci();
562 locate_and_init_vga(NULL);
554} 563}
555 564
556static void __init 565static void __init
@@ -655,7 +664,7 @@ struct alpha_machine_vector clipper_mv __initmv = {
655 .init_arch = tsunami_init_arch, 664 .init_arch = tsunami_init_arch,
656 .init_irq = clipper_init_irq, 665 .init_irq = clipper_init_irq,
657 .init_rtc = common_init_rtc, 666 .init_rtc = common_init_rtc,
658 .init_pci = common_init_pci, 667 .init_pci = clipper_init_pci,
659 .kill_arch = tsunami_kill_arch, 668 .kill_arch = tsunami_kill_arch,
660 .pci_map_irq = clipper_map_irq, 669 .pci_map_irq = clipper_map_irq,
661 .pci_swizzle = common_swizzle, 670 .pci_swizzle = common_swizzle,
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index e349f03b830e..0bcb968cb60a 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -22,6 +22,7 @@
22#include <asm/core_marvel.h> 22#include <asm/core_marvel.h>
23#include <asm/hwrpb.h> 23#include <asm/hwrpb.h>
24#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
25#include <asm/vga.h>
25 26
26#include "proto.h" 27#include "proto.h"
27#include "err_impl.h" 28#include "err_impl.h"
@@ -412,10 +413,7 @@ marvel_init_pci(void)
412 413
413 pci_probe_only = 1; 414 pci_probe_only = 1;
414 common_init_pci(); 415 common_init_pci();
415
416#ifdef CONFIG_VGA_HOSE
417 locate_and_init_vga(NULL); 416 locate_and_init_vga(NULL);
418#endif
419 417
420 /* Clear any io7 errors. */ 418 /* Clear any io7 errors. */
421 for (io7 = NULL; (io7 = marvel_next_io7(io7)) != NULL; ) 419 for (io7 = NULL; (io7 = marvel_next_io7(io7)) != NULL; )
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index f009b7bc0943..1d3c1398c428 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -331,9 +331,7 @@ titan_init_pci(void)
331 pci_probe_only = 1; 331 pci_probe_only = 1;
332 common_init_pci(); 332 common_init_pci();
333 SMC669_Init(0); 333 SMC669_Init(0);
334#ifdef CONFIG_VGA_HOSE
335 locate_and_init_vga(NULL); 334 locate_and_init_vga(NULL);
336#endif
337} 335}
338 336
339 337
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S
index f6cfe8ce3f96..79de99e32c35 100644
--- a/arch/alpha/kernel/systbls.S
+++ b/arch/alpha/kernel/systbls.S
@@ -465,6 +465,38 @@ sys_call_table:
465 .quad sys_inotify_init 465 .quad sys_inotify_init
466 .quad sys_inotify_add_watch /* 445 */ 466 .quad sys_inotify_add_watch /* 445 */
467 .quad sys_inotify_rm_watch 467 .quad sys_inotify_rm_watch
468 .quad sys_fdatasync
469 .quad sys_kexec_load
470 .quad sys_migrate_pages
471 .quad sys_openat /* 450 */
472 .quad sys_mkdirat
473 .quad sys_mknodat
474 .quad sys_fchownat
475 .quad sys_futimesat
476 .quad sys_fstatat64 /* 455 */
477 .quad sys_unlinkat
478 .quad sys_renameat
479 .quad sys_linkat
480 .quad sys_symlinkat
481 .quad sys_readlinkat /* 460 */
482 .quad sys_fchmodat
483 .quad sys_faccessat
484 .quad sys_pselect6
485 .quad sys_ppoll
486 .quad sys_unshare /* 465 */
487 .quad sys_set_robust_list
488 .quad sys_get_robust_list
489 .quad sys_splice
490 .quad sys_sync_file_range
491 .quad sys_tee /* 470 */
492 .quad sys_vmsplice
493 .quad sys_move_pages
494 .quad sys_getcpu
495 .quad sys_epoll_pwait
496 .quad sys_utimensat /* 475 */
497 .quad sys_signalfd
498 .quad sys_timerfd
499 .quad sys_eventfd
468 500
469 .size sys_call_table, . - sys_call_table 501 .size sys_call_table, . - sys_call_table
470 .type sys_call_table, @object 502 .type sys_call_table, @object
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index cf1e6fc6c686..449e76f118d3 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -15,7 +15,7 @@ SECTIONS
15 15
16 _text = .; /* Text and read-only data */ 16 _text = .; /* Text and read-only data */
17 .text : { 17 .text : {
18 *(.text) 18 TEXT_TEXT
19 SCHED_TEXT 19 SCHED_TEXT
20 LOCK_TEXT 20 LOCK_TEXT
21 *(.fixup) 21 *(.fixup)
@@ -89,7 +89,7 @@ SECTIONS
89 89
90 _data = .; 90 _data = .;
91 .data : { /* Data */ 91 .data : { /* Data */
92 *(.data) 92 DATA_DATA
93 CONSTRUCTORS 93 CONSTRUCTORS
94 } 94 }
95 95
diff --git a/arch/alpha/lib/Makefile b/arch/alpha/lib/Makefile
index ea098f3b629f..266f78e13076 100644
--- a/arch/alpha/lib/Makefile
+++ b/arch/alpha/lib/Makefile
@@ -37,7 +37,8 @@ lib-y = __divqu.o __remqu.o __divlu.o __remlu.o \
37 $(ev6-y)clear_page.o \ 37 $(ev6-y)clear_page.o \
38 $(ev6-y)copy_page.o \ 38 $(ev6-y)copy_page.o \
39 fpreg.o \ 39 fpreg.o \
40 callback_srm.o srm_puts.o srm_printk.o 40 callback_srm.o srm_puts.o srm_printk.o \
41 fls.o
41 42
42lib-$(CONFIG_SMP) += dec_and_lock.o 43lib-$(CONFIG_SMP) += dec_and_lock.o
43 44
diff --git a/arch/alpha/lib/fls.c b/arch/alpha/lib/fls.c
new file mode 100644
index 000000000000..7ad84ea0acf8
--- /dev/null
+++ b/arch/alpha/lib/fls.c
@@ -0,0 +1,38 @@
1/*
2 * arch/alpha/lib/fls.c
3 */
4
5#include <linux/module.h>
6#include <asm/bitops.h>
7
8/* This is fls(x)-1, except zero is held to zero. This allows most
9 efficent input into extbl, plus it allows easy handling of fls(0)=0. */
10
11const unsigned char __flsm1_tab[256] =
12{
13 0,
14 0,
15 1, 1,
16 2, 2, 2, 2,
17 3, 3, 3, 3, 3, 3, 3, 3,
18 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
19
20 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
21 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
22
23 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
24 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
25 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
26 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
27
28 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
29 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
30 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
31 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
32 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
33 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
34 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
35 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
36};
37
38EXPORT_SYMBOL(__flsm1_tab);
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e55bbd32dcac..50d9f3e4e0f1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -287,6 +287,7 @@ config ARCH_IXP2000
287config ARCH_IXP4XX 287config ARCH_IXP4XX
288 bool "IXP4xx-based" 288 bool "IXP4xx-based"
289 depends on MMU 289 depends on MMU
290 select GENERIC_GPIO
290 select GENERIC_TIME 291 select GENERIC_TIME
291 select GENERIC_CLOCKEVENTS 292 select GENERIC_CLOCKEVENTS
292 help 293 help
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 6fbe7722aa44..b36b1e8a105d 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -6,7 +6,7 @@
6 * copy data to/from buffers located outside the DMA region. This 6 * copy data to/from buffers located outside the DMA region. This
7 * only works for systems in which DMA memory is at the bottom of 7 * only works for systems in which DMA memory is at the bottom of
8 * RAM, the remainder of memory is at the top and the DMA memory 8 * RAM, the remainder of memory is at the top and the DMA memory
9 * can be marked as ZONE_DMA. Anything beyond that such as discontigous 9 * can be marked as ZONE_DMA. Anything beyond that such as discontiguous
10 * DMA windows will require custom implementations that reserve memory 10 * DMA windows will require custom implementations that reserve memory
11 * areas at early bootup. 11 * areas at early bootup.
12 * 12 *
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 4deece5fbdf4..0c89bd35e06f 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -72,7 +72,7 @@ static inline unsigned int gic_irq(unsigned int irq)
72 * unmask it, in the same way we need to unmask an interrupt when 72 * unmask it, in the same way we need to unmask an interrupt when
73 * we first enable it. 73 * we first enable it.
74 * 74 *
75 * The GIC has a seperate notion of "end of interrupt" to re-enable 75 * The GIC has a separate notion of "end of interrupt" to re-enable
76 * an interrupt after handling, in order to support hardware 76 * an interrupt after handling, in order to support hardware
77 * prioritisation. 77 * prioritisation.
78 * 78 *
@@ -125,12 +125,11 @@ static void gic_set_cpu(unsigned int irq, cpumask_t mask_val)
125} 125}
126#endif 126#endif
127 127
128static void fastcall gic_handle_cascade_irq(unsigned int irq, 128static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
129 struct irq_desc *desc)
130{ 129{
131 struct gic_chip_data *chip_data = get_irq_data(irq); 130 struct gic_chip_data *chip_data = get_irq_data(irq);
132 struct irq_chip *chip = get_irq_chip(irq); 131 struct irq_chip *chip = get_irq_chip(irq);
133 unsigned int cascade_irq; 132 unsigned int cascade_irq, gic_irq;
134 unsigned long status; 133 unsigned long status;
135 134
136 /* primary controller ack'ing */ 135 /* primary controller ack'ing */
@@ -140,16 +139,15 @@ static void fastcall gic_handle_cascade_irq(unsigned int irq,
140 status = readl(chip_data->cpu_base + GIC_CPU_INTACK); 139 status = readl(chip_data->cpu_base + GIC_CPU_INTACK);
141 spin_unlock(&irq_controller_lock); 140 spin_unlock(&irq_controller_lock);
142 141
143 cascade_irq = (status & 0x3ff); 142 gic_irq = (status & 0x3ff);
144 if (cascade_irq > 1020) 143 if (gic_irq == 1023)
145 goto out; 144 goto out;
146 if (cascade_irq < 32 || cascade_irq >= NR_IRQS) {
147 do_bad_IRQ(cascade_irq, desc);
148 goto out;
149 }
150 145
151 cascade_irq += chip_data->irq_offset; 146 cascade_irq = gic_irq + chip_data->irq_offset;
152 generic_handle_irq(cascade_irq); 147 if (unlikely(gic_irq < 32 || gic_irq > 1020 || cascade_irq >= NR_IRQS))
148 do_bad_IRQ(cascade_irq, desc);
149 else
150 generic_handle_irq(cascade_irq);
153 151
154 out: 152 out:
155 /* primary controller unmasking */ 153 /* primary controller unmasking */
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c
index c94864c5b1af..aad4d94ba8f5 100644
--- a/arch/arm/common/sharpsl_param.c
+++ b/arch/arm/common/sharpsl_param.c
@@ -20,7 +20,7 @@
20 * typically including LCD parameters are loaded by the bootloader at the 20 * typically including LCD parameters are loaded by the bootloader at the
21 * address PARAM_BASE. As the kernel will overwrite them, we need to store 21 * address PARAM_BASE. As the kernel will overwrite them, we need to store
22 * them early in the boot process, then pass them to the appropriate drivers. 22 * them early in the boot process, then pass them to the appropriate drivers.
23 * Not all devices use all paramaters but the format is common to all. 23 * Not all devices use all parameters but the format is common to all.
24 */ 24 */
25#ifdef CONFIG_ARCH_SA1100 25#ifdef CONFIG_ARCH_SA1100
26#define PARAM_BASE 0xe8ffc000 26#define PARAM_BASE 0xe8ffc000
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c
index 5972df2b9af4..3bf3a927ae22 100644
--- a/arch/arm/common/sharpsl_pm.c
+++ b/arch/arm/common/sharpsl_pm.c
@@ -153,7 +153,7 @@ static void sharpsl_battery_thread(struct work_struct *private_)
153 sharpsl_pm.battstat.mainbat_percent = percent; 153 sharpsl_pm.battstat.mainbat_percent = percent;
154 } 154 }
155 155
156 dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %d\n", voltage, 156 dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage,
157 sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies); 157 sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies);
158 158
159 /* If battery is low. limit backlight intensity to save power. */ 159 /* If battery is low. limit backlight intensity to save power. */
@@ -291,7 +291,7 @@ static void sharpsl_chrg_full_timer(unsigned long data)
291} 291}
292 292
293/* Charging Finished Interrupt (Not present on Corgi) */ 293/* Charging Finished Interrupt (Not present on Corgi) */
294/* Can trigger at the same time as an AC staus change so 294/* Can trigger at the same time as an AC status change so
295 delay until after that has been processed */ 295 delay until after that has been processed */
296irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id) 296irqreturn_t sharpsl_chrg_full_isr(int irq, void *dev_id)
297{ 297{
@@ -625,7 +625,7 @@ static int sharpsl_fatal_check(void)
625 } 625 }
626 626
627 temp = get_select_val(buff); 627 temp = get_select_val(buff);
628 dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %d\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT)); 628 dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %ld\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT));
629 629
630 if ((acin && (temp < sharpsl_pm.machinfo->fatal_acin_volt)) || 630 if ((acin && (temp < sharpsl_pm.machinfo->fatal_acin_volt)) ||
631 (!acin && (temp < sharpsl_pm.machinfo->fatal_noacin_volt))) 631 (!acin && (temp < sharpsl_pm.machinfo->fatal_noacin_volt)))
@@ -635,7 +635,7 @@ static int sharpsl_fatal_check(void)
635 635
636static int sharpsl_off_charge_error(void) 636static int sharpsl_off_charge_error(void)
637{ 637{
638 dev_err(sharpsl_pm.dev, "Offline Charger: Error occured.\n"); 638 dev_err(sharpsl_pm.dev, "Offline Charger: Error occurred.\n");
639 sharpsl_pm.machinfo->charge(0); 639 sharpsl_pm.machinfo->charge(0);
640 sharpsl_pm_led(SHARPSL_LED_ERROR); 640 sharpsl_pm_led(SHARPSL_LED_ERROR);
641 sharpsl_pm.charge_mode = CHRG_ERROR; 641 sharpsl_pm.charge_mode = CHRG_ERROR;
@@ -691,14 +691,14 @@ static int sharpsl_off_charge_battery(void)
691 691
692 time = RCNR; 692 time = RCNR;
693 while(1) { 693 while(1) {
694 /* Check if any wakeup event had occured */ 694 /* Check if any wakeup event had occurred */
695 if (sharpsl_pm.machinfo->charger_wakeup() != 0) 695 if (sharpsl_pm.machinfo->charger_wakeup() != 0)
696 return 0; 696 return 0;
697 /* Check for timeout */ 697 /* Check for timeout */
698 if ((RCNR - time) > SHARPSL_WAIT_CO_TIME) 698 if ((RCNR - time) > SHARPSL_WAIT_CO_TIME)
699 return 1; 699 return 1;
700 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) { 700 if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_CHRGFULL)) {
701 dev_dbg(sharpsl_pm.dev, "Offline Charger: Charge full occured. Retrying to check\n"); 701 dev_dbg(sharpsl_pm.dev, "Offline Charger: Charge full occurred. Retrying to check\n");
702 sharpsl_pm.full_count++; 702 sharpsl_pm.full_count++;
703 sharpsl_pm.machinfo->charge(0); 703 sharpsl_pm.machinfo->charge(0);
704 mdelay(SHARPSL_CHARGE_WAIT_TIME); 704 mdelay(SHARPSL_CHARGE_WAIT_TIME);
@@ -714,7 +714,7 @@ static int sharpsl_off_charge_battery(void)
714 714
715 time = RCNR; 715 time = RCNR;
716 while(1) { 716 while(1) {
717 /* Check if any wakeup event had occured */ 717 /* Check if any wakeup event had occurred */
718 if (sharpsl_pm.machinfo->charger_wakeup() != 0) 718 if (sharpsl_pm.machinfo->charger_wakeup() != 0)
719 return 0; 719 return 0;
720 /* Check for timeout */ 720 /* Check for timeout */
@@ -774,6 +774,8 @@ static struct pm_ops sharpsl_pm_ops = {
774 774
775static int __init sharpsl_pm_probe(struct platform_device *pdev) 775static int __init sharpsl_pm_probe(struct platform_device *pdev)
776{ 776{
777 int ret;
778
777 if (!pdev->dev.platform_data) 779 if (!pdev->dev.platform_data)
778 return -EINVAL; 780 return -EINVAL;
779 781
@@ -792,8 +794,10 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev)
792 794
793 sharpsl_pm.machinfo->init(); 795 sharpsl_pm.machinfo->init();
794 796
795 device_create_file(&pdev->dev, &dev_attr_battery_percentage); 797 ret = device_create_file(&pdev->dev, &dev_attr_battery_percentage);
796 device_create_file(&pdev->dev, &dev_attr_battery_voltage); 798 ret |= device_create_file(&pdev->dev, &dev_attr_battery_voltage);
799 if (ret != 0)
800 dev_warn(&pdev->dev, "Failed to register attributes (%d)\n", ret);
797 801
798 apm_get_power_status = sharpsl_apm_get_power_status; 802 apm_get_power_status = sharpsl_apm_get_power_status;
799 803
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 9179e8220314..f73d62e8ab60 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -57,7 +57,7 @@ extern void fp_enter(void);
57#define EXPORT_SYMBOL_ALIAS(sym,orig) \ 57#define EXPORT_SYMBOL_ALIAS(sym,orig) \
58 EXPORT_CRC_ALIAS(sym) \ 58 EXPORT_CRC_ALIAS(sym) \
59 static const struct kernel_symbol __ksymtab_##sym \ 59 static const struct kernel_symbol __ksymtab_##sym \
60 __attribute_used__ __attribute__((section("__ksymtab"))) = \ 60 __used __attribute__((section("__ksymtab"))) = \
61 { (unsigned long)&orig, #sym }; 61 { (unsigned long)&orig, #sym };
62 62
63/* 63/*
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 3c078e346753..3278e713c32a 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -85,7 +85,7 @@ int main(void)
85 DEFINE(S_OLD_R0, offsetof(struct pt_regs, ARM_ORIG_r0)); 85 DEFINE(S_OLD_R0, offsetof(struct pt_regs, ARM_ORIG_r0));
86 DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs)); 86 DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs));
87 BLANK(); 87 BLANK();
88#if __LINUX_ARM_ARCH__ >= 6 88#ifdef CONFIG_CPU_HAS_ASID
89 DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id)); 89 DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id));
90 BLANK(); 90 BLANK();
91#endif 91#endif
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index ae89cdd82b16..19326d7cdeb3 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -357,6 +357,10 @@
357/* 345 */ CALL(sys_getcpu) 357/* 345 */ CALL(sys_getcpu)
358 CALL(sys_ni_syscall) /* eventually epoll_pwait */ 358 CALL(sys_ni_syscall) /* eventually epoll_pwait */
359 CALL(sys_kexec_load) 359 CALL(sys_kexec_load)
360 CALL(sys_utimensat)
361 CALL(sys_signalfd)
362/* 350 */ CALL(sys_timerfd)
363 CALL(sys_eventfd)
360#ifndef syscalls_counted 364#ifndef syscalls_counted
361.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls 365.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
362#define syscalls_counted 366#define syscalls_counted
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 0453dcc757b4..650eac1bc0a6 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -918,7 +918,7 @@ static int c_show(struct seq_file *m, void *v)
918 918
919 if ((processor_id & 0x0008f000) == 0x00000000) { 919 if ((processor_id & 0x0008f000) == 0x00000000) {
920 /* pre-ARM7 */ 920 /* pre-ARM7 */
921 seq_printf(m, "CPU part\t\t: %07x\n", processor_id >> 4); 921 seq_printf(m, "CPU part\t: %07x\n", processor_id >> 4);
922 } else { 922 } else {
923 if ((processor_id & 0x0008f000) == 0x00007000) { 923 if ((processor_id & 0x0008f000) == 0x00007000) {
924 /* ARM7 */ 924 /* ARM7 */
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
index 8b63ad89d0a8..ae31deb2d065 100644
--- a/arch/arm/kernel/stacktrace.c
+++ b/arch/arm/kernel/stacktrace.c
@@ -13,7 +13,7 @@ int walk_stackframe(unsigned long fp, unsigned long low, unsigned long high,
13 /* 13 /*
14 * Check current frame pointer is within bounds 14 * Check current frame pointer is within bounds
15 */ 15 */
16 if ((fp - 12) < low || fp + 4 >= high) 16 if (fp < (low + 12) || fp + 4 >= high)
17 break; 17 break;
18 18
19 frame = (struct stackframe *)(fp - 12); 19 frame = (struct stackframe *)(fp - 12);
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 3d4fcbc16276..1ca2d5174fcb 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -320,7 +320,7 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[])
320EXPORT_SYMBOL(kernel_execve); 320EXPORT_SYMBOL(kernel_execve);
321 321
322/* 322/*
323 * Since loff_t is a 64 bit type we avoid a lot of ABI hastle 323 * Since loff_t is a 64 bit type we avoid a lot of ABI hassle
324 * with a different argument ordering. 324 * with a different argument ordering.
325 */ 325 */
326asmlinkage long sys_arm_fadvise64_64(int fd, int advice, 326asmlinkage long sys_arm_fadvise64_64(int fd, int advice,
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index e4156e7868ce..2b7a8f5d8cf2 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -90,7 +90,7 @@ SECTIONS
90 __exception_text_start = .; 90 __exception_text_start = .;
91 *(.exception.text) 91 *(.exception.text)
92 __exception_text_end = .; 92 __exception_text_end = .;
93 *(.text) 93 TEXT_TEXT
94 SCHED_TEXT 94 SCHED_TEXT
95 LOCK_TEXT 95 LOCK_TEXT
96#ifdef CONFIG_MMU 96#ifdef CONFIG_MMU
@@ -158,7 +158,7 @@ SECTIONS
158 /* 158 /*
159 * and the usual data section 159 * and the usual data section
160 */ 160 */
161 *(.data) 161 DATA_DATA
162 CONSTRUCTORS 162 CONSTRUCTORS
163 163
164 _edata = .; 164 _edata = .;
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 542251021744..2e787d40d599 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -47,7 +47,7 @@
47 * @store: store instruction 47 * @store: store instruction
48 * 48 *
49 * Note: we can trivially conditionalise the store instruction 49 * Note: we can trivially conditionalise the store instruction
50 * to avoid dirting the data cache. 50 * to avoid dirtying the data cache.
51 */ 51 */
52 .macro testop, instr, store 52 .macro testop, instr, store
53 add r1, r1, r0, lsr #3 53 add r1, r1, r0, lsr #3
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index b4518619063a..76ec856cd4f9 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -79,7 +79,7 @@ static struct at91_udc_data __initdata carmeva_udc_data = {
79 .pullup_pin = AT91_PIN_PD9, 79 .pullup_pin = AT91_PIN_PD9,
80}; 80};
81 81
82/* FIXME: user dependend */ 82/* FIXME: user dependant */
83// static struct at91_cf_data __initdata carmeva_cf_data = { 83// static struct at91_cf_data __initdata carmeva_cf_data = {
84// .det_pin = AT91_PIN_PB0, 84// .det_pin = AT91_PIN_PB0,
85// .rst_pin = AT91_PIN_PC5, 85// .rst_pin = AT91_PIN_PC5,
@@ -100,17 +100,17 @@ static struct spi_board_info carmeva_spi_devices[] = {
100 .chip_select = 0, 100 .chip_select = 0,
101 .max_speed_hz = 10 * 1000 * 1000, 101 .max_speed_hz = 10 * 1000 * 1000,
102 }, 102 },
103 { /* User accessable spi - cs1 (250KHz) */ 103 { /* User accessible spi - cs1 (250KHz) */
104 .modalias = "spi-cs1", 104 .modalias = "spi-cs1",
105 .chip_select = 1, 105 .chip_select = 1,
106 .max_speed_hz = 250 * 1000, 106 .max_speed_hz = 250 * 1000,
107 }, 107 },
108 { /* User accessable spi - cs2 (1MHz) */ 108 { /* User accessible spi - cs2 (1MHz) */
109 .modalias = "spi-cs2", 109 .modalias = "spi-cs2",
110 .chip_select = 2, 110 .chip_select = 2,
111 .max_speed_hz = 1 * 1000 * 1000, 111 .max_speed_hz = 1 * 1000 * 1000,
112 }, 112 },
113 { /* User accessable spi - cs3 (10MHz) */ 113 { /* User accessible spi - cs3 (10MHz) */
114 .modalias = "spi-cs3", 114 .modalias = "spi-cs3",
115 .chip_select = 3, 115 .chip_select = 3,
116 .max_speed_hz = 10 * 1000 * 1000, 116 .max_speed_hz = 10 * 1000 * 1000,
diff --git a/arch/arm/mach-at91/board-dk.c b/arch/arm/mach-at91/board-dk.c
index 6043c38c0a9e..af497896a96c 100644
--- a/arch/arm/mach-at91/board-dk.c
+++ b/arch/arm/mach-at91/board-dk.c
@@ -132,7 +132,7 @@ static struct mtd_partition __initdata dk_nand_partition[] = {
132 }, 132 },
133}; 133};
134 134
135static struct mtd_partition *nand_partitions(int size, int *num_partitions) 135static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
136{ 136{
137 *num_partitions = ARRAY_SIZE(dk_nand_partition); 137 *num_partitions = ARRAY_SIZE(dk_nand_partition);
138 return dk_nand_partition; 138 return dk_nand_partition;
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
index 76f6e1e553ea..7d9b1a278fd6 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -96,7 +96,7 @@ static struct mtd_partition __initdata kb9202_nand_partition[] = {
96 }, 96 },
97}; 97};
98 98
99static struct mtd_partition *nand_partitions(int size, int *num_partitions) 99static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
100{ 100{
101 *num_partitions = ARRAY_SIZE(kb9202_nand_partition); 101 *num_partitions = ARRAY_SIZE(kb9202_nand_partition);
102 return kb9202_nand_partition; 102 return kb9202_nand_partition;
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 1f0c8a400b3a..26ca8ab3f62a 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -178,7 +178,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
178 }, 178 },
179}; 179};
180 180
181static struct mtd_partition *nand_partitions(int size, int *num_partitions) 181static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
182{ 182{
183 *num_partitions = ARRAY_SIZE(ek_nand_partition); 183 *num_partitions = ARRAY_SIZE(ek_nand_partition);
184 return ek_nand_partition; 184 return ek_nand_partition;
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index f57458559fb6..c164c8e58ae6 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -180,7 +180,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
180 }, 180 },
181}; 181};
182 182
183static struct mtd_partition *nand_partitions(int size, int *num_partitions) 183static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
184{ 184{
185 *num_partitions = ARRAY_SIZE(ek_nand_partition); 185 *num_partitions = ARRAY_SIZE(ek_nand_partition);
186 return ek_nand_partition; 186 return ek_nand_partition;
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index 30c79aca84d4..9b61320f295a 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -87,7 +87,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
87 }, 87 },
88}; 88};
89 89
90static struct mtd_partition *nand_partitions(int size, int *num_partitions) 90static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
91{ 91{
92 *num_partitions = ARRAY_SIZE(ek_nand_partition); 92 *num_partitions = ARRAY_SIZE(ek_nand_partition);
93 return ek_nand_partition; 93 return ek_nand_partition;
diff --git a/arch/arm/mach-footbridge/cats-pci.c b/arch/arm/mach-footbridge/cats-pci.c
index 4f984fde7375..35eb232a649a 100644
--- a/arch/arm/mach-footbridge/cats-pci.c
+++ b/arch/arm/mach-footbridge/cats-pci.c
@@ -45,7 +45,7 @@ static struct hw_pci cats_pci __initdata = {
45 .postinit = dc21285_postinit, 45 .postinit = dc21285_postinit,
46}; 46};
47 47
48static int cats_pci_init(void) 48static int __init cats_pci_init(void)
49{ 49{
50 if (machine_is_cats()) 50 if (machine_is_cats())
51 pci_common_init(&cats_pci); 51 pci_common_init(&cats_pci);
diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c
index 82e420d6fd19..0a1a25fb8ba8 100644
--- a/arch/arm/mach-h720x/cpu-h7202.c
+++ b/arch/arm/mach-h720x/cpu-h7202.c
@@ -143,7 +143,7 @@ h7202_timer_interrupt(int irq, void *dev_id)
143} 143}
144 144
145/* 145/*
146 * mask multiplexed timer irq's 146 * mask multiplexed timer IRQs
147 */ 147 */
148static void inline mask_timerx_irq (u32 irq) 148static void inline mask_timerx_irq (u32 irq)
149{ 149{
@@ -153,7 +153,7 @@ static void inline mask_timerx_irq (u32 irq)
153} 153}
154 154
155/* 155/*
156 * unmask multiplexed timer irq's 156 * unmask multiplexed timer IRQs
157 */ 157 */
158static void inline unmask_timerx_irq (u32 irq) 158static void inline unmask_timerx_irq (u32 irq)
159{ 159{
diff --git a/arch/arm/mach-imx/cpufreq.c b/arch/arm/mach-imx/cpufreq.c
index 7e70e0b0b989..467d899fbe75 100644
--- a/arch/arm/mach-imx/cpufreq.c
+++ b/arch/arm/mach-imx/cpufreq.c
@@ -245,7 +245,7 @@ static int imx_set_target(struct cpufreq_policy *policy,
245 if(mpctl0) { 245 if(mpctl0) {
246 CSCR |= CSCR_MPLL_RESTART; 246 CSCR |= CSCR_MPLL_RESTART;
247 247
248 /* Wait until MPLL is stablized */ 248 /* Wait until MPLL is stabilized */
249 while( CSCR & CSCR_MPLL_RESTART ); 249 while( CSCR & CSCR_MPLL_RESTART );
250 250
251 imx_set_async_mode(); 251 imx_set_async_mode();
diff --git a/arch/arm/mach-imx/dma.c b/arch/arm/mach-imx/dma.c
index 6d50d85a618c..bc6fb02d213b 100644
--- a/arch/arm/mach-imx/dma.c
+++ b/arch/arm/mach-imx/dma.c
@@ -131,7 +131,7 @@ imx_dma_setup_sg_base(imx_dmach_t dma_ch,
131 * The function setups DMA channel source and destination addresses for transfer 131 * The function setups DMA channel source and destination addresses for transfer
132 * specified by provided parameters. The scatter-gather emulation is disabled, 132 * specified by provided parameters. The scatter-gather emulation is disabled,
133 * because linear data block 133 * because linear data block
134 * form the physical address range is transfered. 134 * form the physical address range is transferred.
135 * Return value: if incorrect parameters are provided -%EINVAL. 135 * Return value: if incorrect parameters are provided -%EINVAL.
136 * Zero indicates success. 136 * Zero indicates success.
137 */ 137 */
@@ -192,7 +192,7 @@ imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
192 * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory 192 * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory
193 * or %DMA_MODE_WRITE from memory to the device 193 * or %DMA_MODE_WRITE from memory to the device
194 * 194 *
195 * The function setups DMA channel state and registers to be ready for transfer 195 * The function sets up DMA channel state and registers to be ready for transfer
196 * specified by provided parameters. The scatter-gather emulation is set up 196 * specified by provided parameters. The scatter-gather emulation is set up
197 * according to the parameters. 197 * according to the parameters.
198 * 198 *
@@ -212,7 +212,7 @@ imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
212 * 212 *
213 * %CCR_SMOD_LINEAR | %CCR_SSIZ_32 | %CCR_DMOD_FIFO | %CCR_DSIZ_x 213 * %CCR_SMOD_LINEAR | %CCR_SSIZ_32 | %CCR_DMOD_FIFO | %CCR_DSIZ_x
214 * 214 *
215 * Be carefull there and do not mistakenly mix source and target device 215 * Be careful here and do not mistakenly mix source and target device
216 * port sizes constants, they are really different: 216 * port sizes constants, they are really different:
217 * %CCR_SSIZ_8, %CCR_SSIZ_16, %CCR_SSIZ_32, 217 * %CCR_SSIZ_8, %CCR_SSIZ_16, %CCR_SSIZ_32,
218 * %CCR_DSIZ_8, %CCR_DSIZ_16, %CCR_DSIZ_32 218 * %CCR_DSIZ_8, %CCR_DSIZ_16, %CCR_DSIZ_32
@@ -495,7 +495,7 @@ static irqreturn_t dma_err_handler(int irq, void *dev_id)
495 /* 495 /*
496 * The cleaning of @sg field would be questionable 496 * The cleaning of @sg field would be questionable
497 * there, because its value can help to compute 497 * there, because its value can help to compute
498 * remaining/transfered bytes count in the handler 498 * remaining/transferred bytes count in the handler
499 */ 499 */
500 /*imx_dma_channels[i].sg = NULL;*/ 500 /*imx_dma_channels[i].sg = NULL;*/
501 501
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c
index 7a7fa51ec62c..1c474cf709ca 100644
--- a/arch/arm/mach-imx/generic.c
+++ b/arch/arm/mach-imx/generic.c
@@ -201,7 +201,6 @@ void __init imx_set_mmc_info(struct imxmmc_platform_data *info)
201{ 201{
202 imx_mmc_device.dev.platform_data = info; 202 imx_mmc_device.dev.platform_data = info;
203} 203}
204EXPORT_SYMBOL(imx_set_mmc_info);
205 204
206static struct imxfb_mach_info imx_fb_info; 205static struct imxfb_mach_info imx_fb_info;
207 206
diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile
index ebb255bdce8a..158daaf9e3b0 100644
--- a/arch/arm/mach-integrator/Makefile
+++ b/arch/arm/mach-integrator/Makefile
@@ -12,4 +12,3 @@ obj-$(CONFIG_LEDS) += leds.o
12obj-$(CONFIG_PCI) += pci_v3.o pci.o 12obj-$(CONFIG_PCI) += pci_v3.o pci.o
13obj-$(CONFIG_CPU_FREQ_INTEGRATOR) += cpu.o 13obj-$(CONFIG_CPU_FREQ_INTEGRATOR) += cpu.o
14obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o 14obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o
15obj-$(CONFIG_SMP) += platsmp.o headsmp.o
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 897c21c2fb5b..e9c82deb791d 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -257,23 +257,7 @@ integrator_timer_interrupt(int irq, void *dev_id)
257 */ 257 */
258 writel(1, TIMER1_VA_BASE + TIMER_INTCLR); 258 writel(1, TIMER1_VA_BASE + TIMER_INTCLR);
259 259
260 /* 260 timer_tick();
261 * the clock tick routines are only processed on the
262 * primary CPU
263 */
264 if (hard_smp_processor_id() == 0) {
265 timer_tick();
266#ifdef CONFIG_SMP
267 smp_send_timer();
268#endif
269 }
270
271#ifdef CONFIG_SMP
272 /*
273 * this is the ARM equivalent of the APIC timer interrupt
274 */
275 update_process_times(user_mode(get_irq_regs()));
276#endif /* CONFIG_SMP */
277 261
278 write_sequnlock(&xtime_lock); 262 write_sequnlock(&xtime_lock);
279 263
diff --git a/arch/arm/mach-integrator/headsmp.S b/arch/arm/mach-integrator/headsmp.S
deleted file mode 100644
index ceaa88e30d70..000000000000
--- a/arch/arm/mach-integrator/headsmp.S
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * linux/arch/arm/mach-integrator/headsmp.S
3 *
4 * Copyright (c) 2003 ARM Limited
5 * All Rights Reserved
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#include <linux/linkage.h>
12#include <linux/init.h>
13
14 __INIT
15
16/*
17 * Integrator specific entry point for secondary CPUs. This provides
18 * a "holding pen" into which all secondary cores are held until we're
19 * ready for them to initialise.
20 */
21ENTRY(integrator_secondary_startup)
22 adr r4, 1f
23 ldmia r4, {r5, r6}
24 sub r4, r4, r5
25 ldr r6, [r6, r4]
26pen: ldr r7, [r6]
27 cmp r7, r0
28 bne pen
29
30 /*
31 * we've been released from the holding pen: secondary_stack
32 * should now contain the SVC stack for this core
33 */
34 b secondary_startup
35
361: .long .
37 .long phys_pen_release
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index af9ebccac7c1..d4d8134ce567 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -33,6 +33,7 @@
33#include <asm/irq.h> 33#include <asm/irq.h>
34#include <asm/system.h> 34#include <asm/system.h>
35#include <asm/mach/pci.h> 35#include <asm/mach/pci.h>
36#include <asm/irq_regs.h>
36 37
37#include <asm/hardware/pci_v3.h> 38#include <asm/hardware/pci_v3.h>
38 39
diff --git a/arch/arm/mach-integrator/platsmp.c b/arch/arm/mach-integrator/platsmp.c
deleted file mode 100644
index 613b841a10f3..000000000000
--- a/arch/arm/mach-integrator/platsmp.c
+++ /dev/null
@@ -1,204 +0,0 @@
1/*
2 * linux/arch/arm/mach-cintegrator/platsmp.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
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#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/errno.h>
15#include <linux/mm.h>
16
17#include <asm/atomic.h>
18#include <asm/cacheflush.h>
19#include <asm/delay.h>
20#include <asm/mmu_context.h>
21#include <asm/ptrace.h>
22#include <asm/smp.h>
23
24extern void integrator_secondary_startup(void);
25
26/*
27 * control for which core is the next to come out of the secondary
28 * boot "holding pen"
29 */
30volatile int __cpuinitdata pen_release = -1;
31unsigned long __cpuinitdata phys_pen_release = 0;
32
33static DEFINE_SPINLOCK(boot_lock);
34
35void __cpuinit platform_secondary_init(unsigned int cpu)
36{
37 /*
38 * the primary core may have used a "cross call" soft interrupt
39 * to get this processor out of WFI in the BootMonitor - make
40 * sure that we are no longer being sent this soft interrupt
41 */
42 smp_cross_call_done(cpumask_of_cpu(cpu));
43
44 /*
45 * if any interrupts are already enabled for the primary
46 * core (e.g. timer irq), then they will not have been enabled
47 * for us: do so
48 */
49 secondary_scan_irqs();
50
51 /*
52 * let the primary processor know we're out of the
53 * pen, then head off into the C entry point
54 */
55 pen_release = -1;
56
57 /*
58 * Synchronise with the boot thread.
59 */
60 spin_lock(&boot_lock);
61 spin_unlock(&boot_lock);
62}
63
64int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
65{
66 unsigned long timeout;
67
68 /*
69 * set synchronisation state between this boot processor
70 * and the secondary one
71 */
72 spin_lock(&boot_lock);
73
74 /*
75 * The secondary processor is waiting to be released from
76 * the holding pen - release it, then wait for it to flag
77 * that it has been released by resetting pen_release.
78 *
79 * Note that "pen_release" is the hardware CPU ID, whereas
80 * "cpu" is Linux's internal ID.
81 */
82 pen_release = cpu;
83 flush_cache_all();
84
85 /*
86 * XXX
87 *
88 * This is a later addition to the booting protocol: the
89 * bootMonitor now puts secondary cores into WFI, so
90 * poke_milo() no longer gets the cores moving; we need
91 * to send a soft interrupt to wake the secondary core.
92 * Use smp_cross_call() for this, since there's little
93 * point duplicating the code here
94 */
95 smp_cross_call(cpumask_of_cpu(cpu));
96
97 timeout = jiffies + (1 * HZ);
98 while (time_before(jiffies, timeout)) {
99 if (pen_release == -1)
100 break;
101
102 udelay(10);
103 }
104
105 /*
106 * now the secondary core is starting up let it run its
107 * calibrations, then wait for it to finish
108 */
109 spin_unlock(&boot_lock);
110
111 return pen_release != -1 ? -ENOSYS : 0;
112}
113
114static void __init poke_milo(void)
115{
116 extern void secondary_startup(void);
117
118 /* nobody is to be released from the pen yet */
119 pen_release = -1;
120
121 phys_pen_release = virt_to_phys(&pen_release);
122
123 /*
124 * write the address of secondary startup into the system-wide
125 * flags register, then clear the bottom two bits, which is what
126 * BootMonitor is waiting for
127 */
128#if 1
129#define CINTEGRATOR_HDR_FLAGSS_OFFSET 0x30
130 __raw_writel(virt_to_phys(integrator_secondary_startup),
131 (IO_ADDRESS(INTEGRATOR_HDR_BASE) +
132 CINTEGRATOR_HDR_FLAGSS_OFFSET));
133#define CINTEGRATOR_HDR_FLAGSC_OFFSET 0x34
134 __raw_writel(3,
135 (IO_ADDRESS(INTEGRATOR_HDR_BASE) +
136 CINTEGRATOR_HDR_FLAGSC_OFFSET));
137#endif
138
139 mb();
140}
141
142/*
143 * Initialise the CPU possible map early - this describes the CPUs
144 * which may be present or become present in the system.
145 */
146void __init smp_init_cpus(void)
147{
148 unsigned int i, ncores = get_core_count();
149
150 for (i = 0; i < ncores; i++)
151 cpu_set(i, cpu_possible_map);
152}
153
154void __init smp_prepare_cpus(unsigned int max_cpus)
155{
156 unsigned int ncores = get_core_count();
157 unsigned int cpu = smp_processor_id();
158 int i;
159
160 /* sanity check */
161 if (ncores == 0) {
162 printk(KERN_ERR
163 "Integrator/CP: strange CM count of 0? Default to 1\n");
164
165 ncores = 1;
166 }
167
168 if (ncores > NR_CPUS) {
169 printk(KERN_WARNING
170 "Integrator/CP: no. of cores (%d) greater than configured "
171 "maximum of %d - clipping\n",
172 ncores, NR_CPUS);
173 ncores = NR_CPUS;
174 }
175
176 /*
177 * start with some more config for the Boot CPU, now that
178 * the world is a bit more alive (which was not the case
179 * when smp_prepare_boot_cpu() was called)
180 */
181 smp_store_cpu_info(cpu);
182
183 /*
184 * are we trying to boot more cores than exist?
185 */
186 if (max_cpus > ncores)
187 max_cpus = ncores;
188
189 /*
190 * Initialise the present map, which describes the set of CPUs
191 * actually populated at the present time.
192 */
193 for (i = 0; i < max_cpus; i++)
194 cpu_set(i, cpu_present_map);
195
196 /*
197 * Do we need any more CPUs? If so, then let them know where
198 * to start. Note that, on modern versions of MILO, the "poke"
199 * doesn't actually do anything until each individual core is
200 * sent a soft interrupt to get it out of WFI
201 */
202 if (max_cpus > 1)
203 poke_milo();
204}
diff --git a/arch/arm/mach-iop13xx/irq.c b/arch/arm/mach-iop13xx/irq.c
index 5791addd436b..69f07b25b3c9 100644
--- a/arch/arm/mach-iop13xx/irq.c
+++ b/arch/arm/mach-iop13xx/irq.c
@@ -30,77 +30,65 @@
30 30
31/* INTCTL0 CP6 R0 Page 4 31/* INTCTL0 CP6 R0 Page 4
32 */ 32 */
33static inline u32 read_intctl_0(void) 33static u32 read_intctl_0(void)
34{ 34{
35 u32 val; 35 u32 val;
36 asm volatile("mrc p6, 0, %0, c0, c4, 0":"=r" (val)); 36 asm volatile("mrc p6, 0, %0, c0, c4, 0":"=r" (val));
37 return val; 37 return val;
38} 38}
39static inline void write_intctl_0(u32 val) 39static void write_intctl_0(u32 val)
40{ 40{
41 asm volatile("mcr p6, 0, %0, c0, c4, 0"::"r" (val)); 41 asm volatile("mcr p6, 0, %0, c0, c4, 0"::"r" (val));
42} 42}
43 43
44/* INTCTL1 CP6 R1 Page 4 44/* INTCTL1 CP6 R1 Page 4
45 */ 45 */
46static inline u32 read_intctl_1(void) 46static u32 read_intctl_1(void)
47{ 47{
48 u32 val; 48 u32 val;
49 asm volatile("mrc p6, 0, %0, c1, c4, 0":"=r" (val)); 49 asm volatile("mrc p6, 0, %0, c1, c4, 0":"=r" (val));
50 return val; 50 return val;
51} 51}
52static inline void write_intctl_1(u32 val) 52static void write_intctl_1(u32 val)
53{ 53{
54 asm volatile("mcr p6, 0, %0, c1, c4, 0"::"r" (val)); 54 asm volatile("mcr p6, 0, %0, c1, c4, 0"::"r" (val));
55} 55}
56 56
57/* INTCTL2 CP6 R2 Page 4 57/* INTCTL2 CP6 R2 Page 4
58 */ 58 */
59static inline u32 read_intctl_2(void) 59static u32 read_intctl_2(void)
60{ 60{
61 u32 val; 61 u32 val;
62 asm volatile("mrc p6, 0, %0, c2, c4, 0":"=r" (val)); 62 asm volatile("mrc p6, 0, %0, c2, c4, 0":"=r" (val));
63 return val; 63 return val;
64} 64}
65static inline void write_intctl_2(u32 val) 65static void write_intctl_2(u32 val)
66{ 66{
67 asm volatile("mcr p6, 0, %0, c2, c4, 0"::"r" (val)); 67 asm volatile("mcr p6, 0, %0, c2, c4, 0"::"r" (val));
68} 68}
69 69
70/* INTCTL3 CP6 R3 Page 4 70/* INTCTL3 CP6 R3 Page 4
71 */ 71 */
72static inline u32 read_intctl_3(void) 72static u32 read_intctl_3(void)
73{ 73{
74 u32 val; 74 u32 val;
75 asm volatile("mrc p6, 0, %0, c3, c4, 0":"=r" (val)); 75 asm volatile("mrc p6, 0, %0, c3, c4, 0":"=r" (val));
76 return val; 76 return val;
77} 77}
78static inline void write_intctl_3(u32 val) 78static void write_intctl_3(u32 val)
79{ 79{
80 asm volatile("mcr p6, 0, %0, c3, c4, 0"::"r" (val)); 80 asm volatile("mcr p6, 0, %0, c3, c4, 0"::"r" (val));
81} 81}
82 82
83/* INTSTR0 CP6 R0 Page 5 83/* INTSTR0 CP6 R0 Page 5
84 */ 84 */
85static inline u32 read_intstr_0(void) 85static void write_intstr_0(u32 val)
86{
87 u32 val;
88 asm volatile("mrc p6, 0, %0, c0, c5, 0":"=r" (val));
89 return val;
90}
91static inline void write_intstr_0(u32 val)
92{ 86{
93 asm volatile("mcr p6, 0, %0, c0, c5, 0"::"r" (val)); 87 asm volatile("mcr p6, 0, %0, c0, c5, 0"::"r" (val));
94} 88}
95 89
96/* INTSTR1 CP6 R1 Page 5 90/* INTSTR1 CP6 R1 Page 5
97 */ 91 */
98static inline u32 read_intstr_1(void)
99{
100 u32 val;
101 asm volatile("mrc p6, 0, %0, c1, c5, 0":"=r" (val));
102 return val;
103}
104static void write_intstr_1(u32 val) 92static void write_intstr_1(u32 val)
105{ 93{
106 asm volatile("mcr p6, 0, %0, c1, c5, 0"::"r" (val)); 94 asm volatile("mcr p6, 0, %0, c1, c5, 0"::"r" (val));
@@ -108,12 +96,6 @@ static void write_intstr_1(u32 val)
108 96
109/* INTSTR2 CP6 R2 Page 5 97/* INTSTR2 CP6 R2 Page 5
110 */ 98 */
111static inline u32 read_intstr_2(void)
112{
113 u32 val;
114 asm volatile("mrc p6, 0, %0, c2, c5, 0":"=r" (val));
115 return val;
116}
117static void write_intstr_2(u32 val) 99static void write_intstr_2(u32 val)
118{ 100{
119 asm volatile("mcr p6, 0, %0, c2, c5, 0"::"r" (val)); 101 asm volatile("mcr p6, 0, %0, c2, c5, 0"::"r" (val));
@@ -121,12 +103,6 @@ static void write_intstr_2(u32 val)
121 103
122/* INTSTR3 CP6 R3 Page 5 104/* INTSTR3 CP6 R3 Page 5
123 */ 105 */
124static inline u32 read_intstr_3(void)
125{
126 u32 val;
127 asm volatile("mrc p6, 0, %0, c3, c5, 0":"=r" (val));
128 return val;
129}
130static void write_intstr_3(u32 val) 106static void write_intstr_3(u32 val)
131{ 107{
132 asm volatile("mcr p6, 0, %0, c3, c5, 0"::"r" (val)); 108 asm volatile("mcr p6, 0, %0, c3, c5, 0"::"r" (val));
@@ -134,12 +110,6 @@ static void write_intstr_3(u32 val)
134 110
135/* INTBASE CP6 R0 Page 2 111/* INTBASE CP6 R0 Page 2
136 */ 112 */
137static inline u32 read_intbase(void)
138{
139 u32 val;
140 asm volatile("mrc p6, 0, %0, c0, c2, 0":"=r" (val));
141 return val;
142}
143static void write_intbase(u32 val) 113static void write_intbase(u32 val)
144{ 114{
145 asm volatile("mcr p6, 0, %0, c0, c2, 0"::"r" (val)); 115 asm volatile("mcr p6, 0, %0, c0, c2, 0"::"r" (val));
@@ -147,12 +117,6 @@ static void write_intbase(u32 val)
147 117
148/* INTSIZE CP6 R2 Page 2 118/* INTSIZE CP6 R2 Page 2
149 */ 119 */
150static inline u32 read_intsize(void)
151{
152 u32 val;
153 asm volatile("mrc p6, 0, %0, c2, c2, 0":"=r" (val));
154 return val;
155}
156static void write_intsize(u32 val) 120static void write_intsize(u32 val)
157{ 121{
158 asm volatile("mcr p6, 0, %0, c2, c2, 0"::"r" (val)); 122 asm volatile("mcr p6, 0, %0, c2, c2, 0"::"r" (val));
diff --git a/arch/arm/mach-iop13xx/msi.c b/arch/arm/mach-iop13xx/msi.c
index 2d2369302220..63ef1124ca5c 100644
--- a/arch/arm/mach-iop13xx/msi.c
+++ b/arch/arm/mach-iop13xx/msi.c
@@ -30,52 +30,52 @@ static DECLARE_BITMAP(msi_irq_in_use, IOP13XX_NUM_MSI_IRQS);
30 30
31/* IMIPR0 CP6 R8 Page 1 31/* IMIPR0 CP6 R8 Page 1
32 */ 32 */
33static inline u32 read_imipr_0(void) 33static u32 read_imipr_0(void)
34{ 34{
35 u32 val; 35 u32 val;
36 asm volatile("mrc p6, 0, %0, c8, c1, 0":"=r" (val)); 36 asm volatile("mrc p6, 0, %0, c8, c1, 0":"=r" (val));
37 return val; 37 return val;
38} 38}
39static inline void write_imipr_0(u32 val) 39static void write_imipr_0(u32 val)
40{ 40{
41 asm volatile("mcr p6, 0, %0, c8, c1, 0"::"r" (val)); 41 asm volatile("mcr p6, 0, %0, c8, c1, 0"::"r" (val));
42} 42}
43 43
44/* IMIPR1 CP6 R9 Page 1 44/* IMIPR1 CP6 R9 Page 1
45 */ 45 */
46static inline u32 read_imipr_1(void) 46static u32 read_imipr_1(void)
47{ 47{
48 u32 val; 48 u32 val;
49 asm volatile("mrc p6, 0, %0, c9, c1, 0":"=r" (val)); 49 asm volatile("mrc p6, 0, %0, c9, c1, 0":"=r" (val));
50 return val; 50 return val;
51} 51}
52static inline void write_imipr_1(u32 val) 52static void write_imipr_1(u32 val)
53{ 53{
54 asm volatile("mcr p6, 0, %0, c9, c1, 0"::"r" (val)); 54 asm volatile("mcr p6, 0, %0, c9, c1, 0"::"r" (val));
55} 55}
56 56
57/* IMIPR2 CP6 R10 Page 1 57/* IMIPR2 CP6 R10 Page 1
58 */ 58 */
59static inline u32 read_imipr_2(void) 59static u32 read_imipr_2(void)
60{ 60{
61 u32 val; 61 u32 val;
62 asm volatile("mrc p6, 0, %0, c10, c1, 0":"=r" (val)); 62 asm volatile("mrc p6, 0, %0, c10, c1, 0":"=r" (val));
63 return val; 63 return val;
64} 64}
65static inline void write_imipr_2(u32 val) 65static void write_imipr_2(u32 val)
66{ 66{
67 asm volatile("mcr p6, 0, %0, c10, c1, 0"::"r" (val)); 67 asm volatile("mcr p6, 0, %0, c10, c1, 0"::"r" (val));
68} 68}
69 69
70/* IMIPR3 CP6 R11 Page 1 70/* IMIPR3 CP6 R11 Page 1
71 */ 71 */
72static inline u32 read_imipr_3(void) 72static u32 read_imipr_3(void)
73{ 73{
74 u32 val; 74 u32 val;
75 asm volatile("mrc p6, 0, %0, c11, c1, 0":"=r" (val)); 75 asm volatile("mrc p6, 0, %0, c11, c1, 0":"=r" (val));
76 return val; 76 return val;
77} 77}
78static inline void write_imipr_3(u32 val) 78static void write_imipr_3(u32 val)
79{ 79{
80 asm volatile("mcr p6, 0, %0, c11, c1, 0"::"r" (val)); 80 asm volatile("mcr p6, 0, %0, c11, c1, 0"::"r" (val));
81} 81}
@@ -190,5 +190,5 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
190 write_msi_msg(irq, &msg); 190 write_msi_msg(irq, &msg);
191 set_irq_chip_and_handler(irq, &iop13xx_msi_chip, handle_simple_irq); 191 set_irq_chip_and_handler(irq, &iop13xx_msi_chip, handle_simple_irq);
192 192
193 return irq; 193 return 0;
194} 194}
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
index 1c9e94c38b7e..9d63d7f260ca 100644
--- a/arch/arm/mach-iop13xx/pci.c
+++ b/arch/arm/mach-iop13xx/pci.c
@@ -19,10 +19,11 @@
19 19
20#include <linux/pci.h> 20#include <linux/pci.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22 22#include <linux/jiffies.h>
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <asm/hardware.h> 24#include <asm/hardware.h>
25#include <asm/sizes.h> 25#include <asm/sizes.h>
26#include <asm/signal.h>
26#include <asm/mach/pci.h> 27#include <asm/mach/pci.h>
27#include <asm/arch/pci.h> 28#include <asm/arch/pci.h>
28 29
@@ -144,7 +145,7 @@ void iop13xx_map_pci_memory(void)
144 } 145 }
145} 146}
146 147
147static inline int iop13xx_atu_function(int atu) 148static int iop13xx_atu_function(int atu)
148{ 149{
149 int func = 0; 150 int func = 0;
150 /* the function number depends on the value of the 151 /* the function number depends on the value of the
@@ -259,7 +260,7 @@ static int iop13xx_atux_pci_status(int clear)
259 * data. Note that the data dependency on %0 encourages an abort 260 * data. Note that the data dependency on %0 encourages an abort
260 * to be detected before we return. 261 * to be detected before we return.
261 */ 262 */
262static inline u32 iop13xx_atux_read(unsigned long addr) 263static u32 iop13xx_atux_read(unsigned long addr)
263{ 264{
264 u32 val; 265 u32 val;
265 266
@@ -387,7 +388,7 @@ static int iop13xx_atue_pci_status(int clear)
387 return err; 388 return err;
388} 389}
389 390
390static inline int __init 391static int
391iop13xx_pcie_map_irq(struct pci_dev *dev, u8 idsel, u8 pin) 392iop13xx_pcie_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
392{ 393{
393 WARN_ON(idsel != 0); 394 WARN_ON(idsel != 0);
@@ -401,7 +402,7 @@ iop13xx_pcie_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
401 } 402 }
402} 403}
403 404
404static inline u32 iop13xx_atue_read(unsigned long addr) 405static u32 iop13xx_atue_read(unsigned long addr)
405{ 406{
406 u32 val; 407 u32 val;
407 408
@@ -989,7 +990,7 @@ void __init iop13xx_pci_init(void)
989 "imprecise external abort"); 990 "imprecise external abort");
990} 991}
991 992
992/* intialize the pci memory space. handle any combination of 993/* initialize the pci memory space. handle any combination of
993 * atue and atux enabled/disabled 994 * atue and atux enabled/disabled
994 */ 995 */
995int iop13xx_pci_setup(int nr, struct pci_sys_data *sys) 996int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c
index 45f4f13ae11b..5776fd884115 100644
--- a/arch/arm/mach-iop32x/glantank.c
+++ b/arch/arm/mach-iop32x/glantank.c
@@ -75,7 +75,7 @@ void __init glantank_map_io(void)
75#define INTC IRQ_IOP32X_XINT2 75#define INTC IRQ_IOP32X_XINT2
76#define INTD IRQ_IOP32X_XINT3 76#define INTD IRQ_IOP32X_XINT3
77 77
78static inline int __init 78static int __init
79glantank_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 79glantank_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
80{ 80{
81 static int pci_irq_table[][4] = { 81 static int pci_irq_table[][4] = {
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index 7b21c6e13e59..d4eefbea1fe6 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -104,7 +104,7 @@ void __init iq31244_map_io(void)
104/* 104/*
105 * EP80219/IQ31244 PCI. 105 * EP80219/IQ31244 PCI.
106 */ 106 */
107static inline int __init 107static int __init
108ep80219_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 108ep80219_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
109{ 109{
110 int irq; 110 int irq;
@@ -140,7 +140,7 @@ static struct hw_pci ep80219_pci __initdata = {
140 .map_irq = ep80219_pci_map_irq, 140 .map_irq = ep80219_pci_map_irq,
141}; 141};
142 142
143static inline int __init 143static int __init
144iq31244_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 144iq31244_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
145{ 145{
146 int irq; 146 int irq;
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c
index bc25fb91e7b9..8d9f49164a84 100644
--- a/arch/arm/mach-iop32x/iq80321.c
+++ b/arch/arm/mach-iop32x/iq80321.c
@@ -72,7 +72,7 @@ void __init iq80321_map_io(void)
72/* 72/*
73 * IQ80321 PCI. 73 * IQ80321 PCI.
74 */ 74 */
75static inline int __init 75static int __init
76iq80321_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 76iq80321_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
77{ 77{
78 int irq; 78 int irq;
diff --git a/arch/arm/mach-iop32x/irq.c b/arch/arm/mach-iop32x/irq.c
index 82598dc18d80..c971171c2905 100644
--- a/arch/arm/mach-iop32x/irq.c
+++ b/arch/arm/mach-iop32x/irq.c
@@ -21,12 +21,12 @@
21 21
22static u32 iop32x_mask; 22static u32 iop32x_mask;
23 23
24static inline void intctl_write(u32 val) 24static void intctl_write(u32 val)
25{ 25{
26 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val)); 26 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val));
27} 27}
28 28
29static inline void intstr_write(u32 val) 29static void intstr_write(u32 val)
30{ 30{
31 asm volatile("mcr p6, 0, %0, c4, c0, 0" : : "r" (val)); 31 asm volatile("mcr p6, 0, %0, c4, c0, 0" : : "r" (val));
32} 32}
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
index 5f07344d96f3..d55005d64781 100644
--- a/arch/arm/mach-iop32x/n2100.c
+++ b/arch/arm/mach-iop32x/n2100.c
@@ -76,7 +76,7 @@ void __init n2100_map_io(void)
76/* 76/*
77 * N2100 PCI. 77 * N2100 PCI.
78 */ 78 */
79static inline int __init 79static int __init
80n2100_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 80n2100_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
81{ 81{
82 int irq; 82 int irq;
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c
index 376c932830be..2b063180687a 100644
--- a/arch/arm/mach-iop33x/iq80331.c
+++ b/arch/arm/mach-iop33x/iq80331.c
@@ -55,7 +55,7 @@ static struct sys_timer iq80331_timer = {
55/* 55/*
56 * IQ80331 PCI. 56 * IQ80331 PCI.
57 */ 57 */
58static inline int __init 58static int __init
59iq80331_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 59iq80331_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
60{ 60{
61 int irq; 61 int irq;
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c
index 58c81496c6f6..7889ce3cb08e 100644
--- a/arch/arm/mach-iop33x/iq80332.c
+++ b/arch/arm/mach-iop33x/iq80332.c
@@ -55,7 +55,7 @@ static struct sys_timer iq80332_timer = {
55/* 55/*
56 * IQ80332 PCI. 56 * IQ80332 PCI.
57 */ 57 */
58static inline int __init 58static int __init
59iq80332_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 59iq80332_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
60{ 60{
61 int irq; 61 int irq;
diff --git a/arch/arm/mach-iop33x/irq.c b/arch/arm/mach-iop33x/irq.c
index c65ea78a2427..f09dd054b9c0 100644
--- a/arch/arm/mach-iop33x/irq.c
+++ b/arch/arm/mach-iop33x/irq.c
@@ -22,32 +22,32 @@
22static u32 iop33x_mask0; 22static u32 iop33x_mask0;
23static u32 iop33x_mask1; 23static u32 iop33x_mask1;
24 24
25static inline void intctl0_write(u32 val) 25static void intctl0_write(u32 val)
26{ 26{
27 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val)); 27 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val));
28} 28}
29 29
30static inline void intctl1_write(u32 val) 30static void intctl1_write(u32 val)
31{ 31{
32 asm volatile("mcr p6, 0, %0, c1, c0, 0" : : "r" (val)); 32 asm volatile("mcr p6, 0, %0, c1, c0, 0" : : "r" (val));
33} 33}
34 34
35static inline void intstr0_write(u32 val) 35static void intstr0_write(u32 val)
36{ 36{
37 asm volatile("mcr p6, 0, %0, c2, c0, 0" : : "r" (val)); 37 asm volatile("mcr p6, 0, %0, c2, c0, 0" : : "r" (val));
38} 38}
39 39
40static inline void intstr1_write(u32 val) 40static void intstr1_write(u32 val)
41{ 41{
42 asm volatile("mcr p6, 0, %0, c3, c0, 0" : : "r" (val)); 42 asm volatile("mcr p6, 0, %0, c3, c0, 0" : : "r" (val));
43} 43}
44 44
45static inline void intbase_write(u32 val) 45static void intbase_write(u32 val)
46{ 46{
47 asm volatile("mcr p6, 0, %0, c12, c0, 0" : : "r" (val)); 47 asm volatile("mcr p6, 0, %0, c12, c0, 0" : : "r" (val));
48} 48}
49 49
50static inline void intsize_write(u32 val) 50static void intsize_write(u32 val)
51{ 51{
52 asm volatile("mcr p6, 0, %0, c13, c0, 0" : : "r" (val)); 52 asm volatile("mcr p6, 0, %0, c13, c0, 0" : : "r" (val));
53} 53}
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
index 500e997ba7a4..9c49435d42c3 100644
--- a/arch/arm/mach-ixp2000/enp2611.c
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -198,7 +198,7 @@ subsys_initcall(enp2611_pci_init);
198 198
199 199
200/************************************************************************* 200/*************************************************************************
201 * ENP-2611 Machine Intialization 201 * ENP-2611 Machine Initialization
202 *************************************************************************/ 202 *************************************************************************/
203static struct flash_platform_data enp2611_flash_platform_data = { 203static struct flash_platform_data enp2611_flash_platform_data = {
204 .map_name = "cfi_probe", 204 .map_name = "cfi_probe",
diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c
index 0fdd03ab36e6..ce7c15c73004 100644
--- a/arch/arm/mach-ixp2000/ixdp2400.c
+++ b/arch/arm/mach-ixp2000/ixdp2400.c
@@ -164,7 +164,7 @@ int __init ixdp2400_pci_init(void)
164 164
165subsys_initcall(ixdp2400_pci_init); 165subsys_initcall(ixdp2400_pci_init);
166 166
167void ixdp2400_init_irq(void) 167void __init ixdp2400_init_irq(void)
168{ 168{
169 ixdp2x00_init_irq(IXDP2400_CPLD_INT_STAT, IXDP2400_CPLD_INT_MASK, IXDP2400_NR_IRQS); 169 ixdp2x00_init_irq(IXDP2400_CPLD_INT_STAT, IXDP2400_CPLD_INT_MASK, IXDP2400_NR_IRQS);
170} 170}
diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c
index 70d247f09a7e..14f09b80ab77 100644
--- a/arch/arm/mach-ixp2000/ixdp2800.c
+++ b/arch/arm/mach-ixp2000/ixdp2800.c
@@ -279,7 +279,7 @@ int __init ixdp2800_pci_init(void)
279 279
280subsys_initcall(ixdp2800_pci_init); 280subsys_initcall(ixdp2800_pci_init);
281 281
282void ixdp2800_init_irq(void) 282void __init ixdp2800_init_irq(void)
283{ 283{
284 ixdp2x00_init_irq(IXDP2800_CPLD_INT_STAT, IXDP2800_CPLD_INT_MASK, IXDP2800_NR_IRQS); 284 ixdp2x00_init_irq(IXDP2800_CPLD_INT_STAT, IXDP2800_CPLD_INT_MASK, IXDP2800_NR_IRQS);
285} 285}
diff --git a/arch/arm/mach-ixp2000/ixdp2x00.c b/arch/arm/mach-ixp2000/ixdp2x00.c
index 52b368b34346..73c651e83d92 100644
--- a/arch/arm/mach-ixp2000/ixdp2x00.c
+++ b/arch/arm/mach-ixp2000/ixdp2x00.c
@@ -145,7 +145,7 @@ static struct irq_chip ixdp2x00_cpld_irq_chip = {
145 .unmask = ixdp2x00_irq_unmask 145 .unmask = ixdp2x00_irq_unmask
146}; 146};
147 147
148void ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long *mask_reg, unsigned long nr_irqs) 148void __init ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long *mask_reg, unsigned long nr_irqs)
149{ 149{
150 unsigned int irq; 150 unsigned int irq;
151 151
@@ -195,7 +195,7 @@ void __init ixdp2x00_map_io(void)
195 * instances of the kernel. So far so good. Peers on the PCI bus running 195 * instances of the kernel. So far so good. Peers on the PCI bus running
196 * Linux is a common design in telecom systems. The problem is that instead 196 * Linux is a common design in telecom systems. The problem is that instead
197 * of all the devices being controlled by a single host, different 197 * of all the devices being controlled by a single host, different
198 * devices are controlles by different NPUs on the same bus, leading to 198 * devices are controlled by different NPUs on the same bus, leading to
199 * multiple hosts on the bus. The exact bus layout looks like: 199 * multiple hosts on the bus. The exact bus layout looks like:
200 * 200 *
201 * Bus 0 201 * Bus 0
@@ -211,7 +211,7 @@ void __init ixdp2x00_map_io(void)
211 * | | | | | 211 * | | | | |
212 * ... Dev PMC Media Eth0 Eth1 ... 212 * ... Dev PMC Media Eth0 Eth1 ...
213 * 213 *
214 * The master controlls all but Eth1, which is controlled by the 214 * The master controls all but Eth1, which is controlled by the
215 * slave. What this means is that the both the master and the slave 215 * slave. What this means is that the both the master and the slave
216 * have to scan the bus, but only one of them can enumerate the bus. 216 * have to scan the bus, but only one of them can enumerate the bus.
217 * In addition, after the bus is scanned, each kernel must remove 217 * In addition, after the bus is scanned, each kernel must remove
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c
index 3084a5fa751c..d3d730d2fc2b 100644
--- a/arch/arm/mach-ixp2000/ixdp2x01.c
+++ b/arch/arm/mach-ixp2000/ixdp2x01.c
@@ -276,7 +276,7 @@ static int __init ixdp2x01_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
276 /* Device is located after first MB bridge */ 276 /* Device is located after first MB bridge */
277 case 0x0008: 277 case 0x0008:
278 if (tmp_bus == dev->bus) { 278 if (tmp_bus == dev->bus) {
279 /* Device is located directy after first MB bridge */ 279 /* Device is located directly after first MB bridge */
280 switch (devpin) { 280 switch (devpin) {
281 case DEVPIN(1, 1): /* Onboard 82546 ch 0 */ 281 case DEVPIN(1, 1): /* Onboard 82546 ch 0 */
282 if (machine_is_ixdp2401()) 282 if (machine_is_ixdp2401())
@@ -299,7 +299,7 @@ static int __init ixdp2x01_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
299 break; 299 break;
300 case 0x0010: 300 case 0x0010:
301 if (tmp_bus == dev->bus) { 301 if (tmp_bus == dev->bus) {
302 /* Device is located directy after second MB bridge */ 302 /* Device is located directly after second MB bridge */
303 /* Secondary bus of second bridge */ 303 /* Secondary bus of second bridge */
304 switch (devpin) { 304 switch (devpin) {
305 case DEVPIN(0, 1): /* DB#0 */ 305 case DEVPIN(0, 1): /* DB#0 */
@@ -348,7 +348,7 @@ int __init ixdp2x01_pci_init(void)
348subsys_initcall(ixdp2x01_pci_init); 348subsys_initcall(ixdp2x01_pci_init);
349 349
350/************************************************************************* 350/*************************************************************************
351 * IXDP2x01 Machine Intialization 351 * IXDP2x01 Machine Initialization
352 *************************************************************************/ 352 *************************************************************************/
353static struct flash_platform_data ixdp2x01_flash_platform_data = { 353static struct flash_platform_data ixdp2x01_flash_platform_data = {
354 .map_name = "cfi_probe", 354 .map_name = "cfi_probe",
diff --git a/arch/arm/mach-ixp2000/pci.c b/arch/arm/mach-ixp2000/pci.c
index 5a09a90c08fb..03f4cf7f9dec 100644
--- a/arch/arm/mach-ixp2000/pci.c
+++ b/arch/arm/mach-ixp2000/pci.c
@@ -102,7 +102,7 @@ int ixp2000_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where,
102} 102}
103 103
104/* 104/*
105 * We don't do error checks by callling clear_master_aborts() b/c the 105 * We don't do error checks by calling clear_master_aborts() b/c the
106 * assumption is that the caller did a read first to make sure a device 106 * assumption is that the caller did a read first to make sure a device
107 * exists. 107 * exists.
108 */ 108 */
diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c
index b644bbab7d0a..16356ffc86ae 100644
--- a/arch/arm/mach-ixp23xx/core.c
+++ b/arch/arm/mach-ixp23xx/core.c
@@ -389,7 +389,7 @@ struct sys_timer ixp23xx_timer = {
389 389
390 390
391/************************************************************************* 391/*************************************************************************
392 * IXP23xx Platform Initializaion 392 * IXP23xx Platform Initialization
393 *************************************************************************/ 393 *************************************************************************/
394static struct resource ixp23xx_uart_resources[] = { 394static struct resource ixp23xx_uart_resources[] = {
395 { 395 {
diff --git a/arch/arm/mach-ixp23xx/ixdp2351.c b/arch/arm/mach-ixp23xx/ixdp2351.c
index 7a86a2516eaa..c41a6b5a0acc 100644
--- a/arch/arm/mach-ixp23xx/ixdp2351.c
+++ b/arch/arm/mach-ixp23xx/ixdp2351.c
@@ -124,7 +124,7 @@ static struct irq_chip ixdp2351_intb_chip = {
124 .unmask = ixdp2351_intb_unmask 124 .unmask = ixdp2351_intb_unmask
125}; 125};
126 126
127void ixdp2351_init_irq(void) 127void __init ixdp2351_init_irq(void)
128{ 128{
129 int irq; 129 int irq;
130 130
diff --git a/arch/arm/mach-ixp23xx/pci.c b/arch/arm/mach-ixp23xx/pci.c
index ac7d43d23c28..227f808dc0ec 100644
--- a/arch/arm/mach-ixp23xx/pci.c
+++ b/arch/arm/mach-ixp23xx/pci.c
@@ -284,7 +284,7 @@ int ixp23xx_pci_setup(int nr, struct pci_sys_data *sys)
284 return 1; 284 return 1;
285} 285}
286 286
287void ixp23xx_pci_slave_init(void) 287void __init ixp23xx_pci_slave_init(void)
288{ 288{
289 ixp23xx_pci_common_init(); 289 ixp23xx_pci_common_init();
290} 290}
diff --git a/arch/arm/mach-ixp23xx/roadrunner.c b/arch/arm/mach-ixp23xx/roadrunner.c
index d06e21b70de5..e35644961aa4 100644
--- a/arch/arm/mach-ixp23xx/roadrunner.c
+++ b/arch/arm/mach-ixp23xx/roadrunner.c
@@ -110,7 +110,7 @@ static int __init roadrunner_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
110 return NO_IRQ; 110 return NO_IRQ;
111} 111}
112 112
113static void roadrunner_pci_preinit(void) 113static void __init roadrunner_pci_preinit(void)
114{ 114{
115 set_irq_type(IRQ_ROADRUNNER_PCI_INTC, IRQT_LOW); 115 set_irq_type(IRQ_ROADRUNNER_PCI_INTC, IRQT_LOW);
116 set_irq_type(IRQ_ROADRUNNER_PCI_INTD, IRQT_LOW); 116 set_irq_type(IRQ_ROADRUNNER_PCI_INTD, IRQT_LOW);
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index 9715ef506c24..060909870b50 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -104,9 +104,6 @@ config MACH_DSMG600
104 DSM-G600 RevA device. For more information on this platform, 104 DSM-G600 RevA device. For more information on this platform,
105 see http://www.nslu2-linux.org/wiki/DSMG600/HomePage 105 see http://www.nslu2-linux.org/wiki/DSMG600/HomePage
106 106
107#
108# Avila and IXDP share the same source for now. Will change in future
109#
110config ARCH_IXDP4XX 107config ARCH_IXDP4XX
111 bool 108 bool
112 depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435 109 depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 64685da1462d..8112f726ffa0 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -283,7 +283,7 @@ static struct irqaction ixp4xx_timer_irq = {
283 .handler = ixp4xx_timer_interrupt, 283 .handler = ixp4xx_timer_interrupt,
284}; 284};
285 285
286static void __init ixp4xx_timer_init(void) 286void __init ixp4xx_timer_init(void)
287{ 287{
288 /* Reset/disable counter */ 288 /* Reset/disable counter */
289 *IXP4XX_OSRT1 = 0; 289 *IXP4XX_OSRT1 = 0;
diff --git a/arch/arm/mach-ixp4xx/coyote-pci.c b/arch/arm/mach-ixp4xx/coyote-pci.c
index 7bc94f3def1c..ad2e5b97966e 100644
--- a/arch/arm/mach-ixp4xx/coyote-pci.c
+++ b/arch/arm/mach-ixp4xx/coyote-pci.c
@@ -25,10 +25,6 @@
25 25
26#include <asm/mach/pci.h> 26#include <asm/mach/pci.h>
27 27
28extern void ixp4xx_pci_preinit(void);
29extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
30extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
31
32void __init coyote_pci_preinit(void) 28void __init coyote_pci_preinit(void)
33{ 29{
34 set_irq_type(IRQ_COYOTE_PCI_SLOT0, IRQT_LOW); 30 set_irq_type(IRQ_COYOTE_PCI_SLOT0, IRQT_LOW);
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
index 1caff65e22cc..1e75e105c4f7 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -18,6 +18,7 @@
18#include <asm/mach-types.h> 18#include <asm/mach-types.h>
19#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
20#include <asm/mach/flash.h> 20#include <asm/mach/flash.h>
21#include <asm/mach/time.h>
21 22
22static struct flash_platform_data dsmg600_flash_data = { 23static struct flash_platform_data dsmg600_flash_data = {
23 .map_name = "cfi_probe", 24 .map_name = "cfi_probe",
@@ -128,6 +129,19 @@ static void dsmg600_power_off(void)
128 gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH); 129 gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH);
129} 130}
130 131
132static void __init dsmg600_timer_init(void)
133{
134 /* The xtal on this machine is non-standard. */
135 ixp4xx_timer_freq = DSMG600_FREQ;
136
137 /* Call standard timer_init function. */
138 ixp4xx_timer_init();
139}
140
141static struct sys_timer dsmg600_timer = {
142 .init = dsmg600_timer_init,
143};
144
131static void __init dsmg600_init(void) 145static void __init dsmg600_init(void)
132{ 146{
133 ixp4xx_sys_init(); 147 ixp4xx_sys_init();
@@ -155,21 +169,13 @@ static void __init dsmg600_init(void)
155#endif 169#endif
156} 170}
157 171
158static void __init dsmg600_fixup(struct machine_desc *desc,
159 struct tag *tags, char **cmdline, struct meminfo *mi)
160{
161 /* The xtal on this machine is non-standard. */
162 ixp4xx_timer_freq = DSMG600_FREQ;
163}
164
165MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") 172MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
166 /* Maintainer: www.nslu2-linux.org */ 173 /* Maintainer: www.nslu2-linux.org */
167 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, 174 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
168 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC, 175 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
169 .boot_params = 0x00000100, 176 .boot_params = 0x00000100,
170 .fixup = dsmg600_fixup,
171 .map_io = ixp4xx_map_io, 177 .map_io = ixp4xx_map_io,
172 .init_irq = ixp4xx_init_irq, 178 .init_irq = ixp4xx_init_irq,
173 .timer = &ixp4xx_timer, 179 .timer = &dsmg600_timer,
174 .init_machine = dsmg600_init, 180 .init_machine = dsmg600_init,
175MACHINE_END 181MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index 30f1300e0e21..dc6725bda3c4 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-ixp4xx/gtwx5715-setup.c 2 * arch/arm/mach-ixp4xx/gtwx5715-setup.c
3 * 3 *
4 * Gemtek GTWX5715 (Linksys WRV54G) board settup 4 * Gemtek GTWX5715 (Linksys WRV54G) board setup
5 * 5 *
6 * Copyright (C) 2004 George T. Joseph 6 * Copyright (C) 2004 George T. Joseph
7 * Derived from Coyote 7 * Derived from Coyote
diff --git a/arch/arm/mach-ixp4xx/ixdpg425-pci.c b/arch/arm/mach-ixp4xx/ixdpg425-pci.c
index 509a95a692a4..d1e75b7dc3b1 100644
--- a/arch/arm/mach-ixp4xx/ixdpg425-pci.c
+++ b/arch/arm/mach-ixp4xx/ixdpg425-pci.c
@@ -23,10 +23,6 @@
23 23
24#include <asm/mach/pci.h> 24#include <asm/mach/pci.h>
25 25
26extern void ixp4xx_pci_preinit(void);
27extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
28extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
29
30void __init ixdpg425_pci_preinit(void) 26void __init ixdpg425_pci_preinit(void)
31{ 27{
32 set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW); 28 set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW);
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index 9a31444d9214..78a17413ceca 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -155,7 +155,8 @@ static void __init nas100d_init(void)
155 155
156 pm_power_off = nas100d_power_off; 156 pm_power_off = nas100d_power_off;
157 157
158 /* This is only useful on a modified machine, but it is valuable 158 /*
159 * This is only useful on a modified machine, but it is valuable
159 * to have it first in order to see debug messages, and so that 160 * to have it first in order to see debug messages, and so that
160 * it does *not* get removed if platform_add_devices fails! 161 * it does *not* get removed if platform_add_devices fails!
161 */ 162 */
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index 162c266e5f8f..9bf8ccbcaccf 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -22,6 +22,7 @@
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/mach/flash.h> 24#include <asm/mach/flash.h>
25#include <asm/mach/time.h>
25 26
26static struct flash_platform_data nslu2_flash_data = { 27static struct flash_platform_data nslu2_flash_data = {
27 .map_name = "cfi_probe", 28 .map_name = "cfi_probe",
@@ -49,26 +50,26 @@ static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
49static struct resource nslu2_led_resources[] = { 50static struct resource nslu2_led_resources[] = {
50 { 51 {
51 .name = "ready", /* green led */ 52 .name = "ready", /* green led */
52 .start = NSLU2_LED_GRN, 53 .start = NSLU2_LED_GRN_GPIO,
53 .end = NSLU2_LED_GRN, 54 .end = NSLU2_LED_GRN_GPIO,
54 .flags = IXP4XX_GPIO_HIGH, 55 .flags = IXP4XX_GPIO_HIGH,
55 }, 56 },
56 { 57 {
57 .name = "status", /* red led */ 58 .name = "status", /* red led */
58 .start = NSLU2_LED_RED, 59 .start = NSLU2_LED_RED_GPIO,
59 .end = NSLU2_LED_RED, 60 .end = NSLU2_LED_RED_GPIO,
60 .flags = IXP4XX_GPIO_HIGH, 61 .flags = IXP4XX_GPIO_HIGH,
61 }, 62 },
62 { 63 {
63 .name = "disk-1", 64 .name = "disk-1",
64 .start = NSLU2_LED_DISK1, 65 .start = NSLU2_LED_DISK1_GPIO,
65 .end = NSLU2_LED_DISK1, 66 .end = NSLU2_LED_DISK1_GPIO,
66 .flags = IXP4XX_GPIO_LOW, 67 .flags = IXP4XX_GPIO_LOW,
67 }, 68 },
68 { 69 {
69 .name = "disk-2", 70 .name = "disk-2",
70 .start = NSLU2_LED_DISK2, 71 .start = NSLU2_LED_DISK2_GPIO,
71 .end = NSLU2_LED_DISK2, 72 .end = NSLU2_LED_DISK2_GPIO,
72 .flags = IXP4XX_GPIO_LOW, 73 .flags = IXP4XX_GPIO_LOW,
73 }, 74 },
74}; 75};
@@ -157,10 +158,21 @@ static void nslu2_power_off(void)
157 gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH); 158 gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH);
158} 159}
159 160
160static void __init nslu2_init(void) 161static void __init nslu2_timer_init(void)
161{ 162{
162 ixp4xx_timer_freq = NSLU2_FREQ; 163 /* The xtal on this machine is non-standard. */
164 ixp4xx_timer_freq = NSLU2_FREQ;
165
166 /* Call standard timer_init function. */
167 ixp4xx_timer_init();
168}
163 169
170static struct sys_timer nslu2_timer = {
171 .init = nslu2_timer_init,
172};
173
174static void __init nslu2_init(void)
175{
164 ixp4xx_sys_init(); 176 ixp4xx_sys_init();
165 177
166 nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); 178 nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
@@ -169,7 +181,8 @@ static void __init nslu2_init(void)
169 181
170 pm_power_off = nslu2_power_off; 182 pm_power_off = nslu2_power_off;
171 183
172 /* This is only useful on a modified machine, but it is valuable 184 /*
185 * This is only useful on a modified machine, but it is valuable
173 * to have it first in order to see debug messages, and so that 186 * to have it first in order to see debug messages, and so that
174 * it does *not* get removed if platform_add_devices fails! 187 * it does *not* get removed if platform_add_devices fails!
175 */ 188 */
@@ -185,6 +198,6 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
185 .boot_params = 0x00000100, 198 .boot_params = 0x00000100,
186 .map_io = ixp4xx_map_io, 199 .map_io = ixp4xx_map_io,
187 .init_irq = ixp4xx_init_irq, 200 .init_irq = ixp4xx_init_irq,
188 .timer = &ixp4xx_timer, 201 .timer = &nslu2_timer,
189 .init_machine = nslu2_init, 202 .init_machine = nslu2_init,
190MACHINE_END 203MACHINE_END
diff --git a/arch/arm/mach-lh7a40x/lcd-panel.h b/arch/arm/mach-lh7a40x/lcd-panel.h
index 4fb2efc4950f..df6e38ed425b 100644
--- a/arch/arm/mach-lh7a40x/lcd-panel.h
+++ b/arch/arm/mach-lh7a40x/lcd-panel.h
@@ -126,7 +126,7 @@ static struct clcd_panel_extra lcd_panel_extra = {
126 126
127 */ 127 */
128 128
129/* The full horozontal cycle (Th) is clock/360/400/450. */ 129/* The full horizontal cycle (Th) is clock/360/400/450. */
130/* The full vertical cycle (Tv) is line/251/262/280. */ 130/* The full vertical cycle (Tv) is line/251/262/280. */
131 131
132#define PIX_CLOCK_TARGET (6300000) /* -/6.3/7 MHz */ 132#define PIX_CLOCK_TARGET (6300000) /* -/6.3/7 MHz */
@@ -162,7 +162,7 @@ static struct clcd_panel lcd_panel = {
162 /* Logic Product Development LCD 6.4" VGA -10 */ 162 /* Logic Product Development LCD 6.4" VGA -10 */
163 /* Sharp PN LQ64D343 */ 163 /* Sharp PN LQ64D343 */
164 164
165/* The full horozontal cycle (Th) is clock/750/800/900. */ 165/* The full horizontal cycle (Th) is clock/750/800/900. */
166/* The full vertical cycle (Tv) is line/515/525/560. */ 166/* The full vertical cycle (Tv) is line/515/525/560. */
167 167
168#define PIX_CLOCK_TARGET (28330000) 168#define PIX_CLOCK_TARGET (28330000)
@@ -243,7 +243,7 @@ static struct clcd_panel lcd_panel = {
243 * (fdisk, e2fsck). And, at that speed the display may have a visible 243 * (fdisk, e2fsck). And, at that speed the display may have a visible
244 * flicker. */ 244 * flicker. */
245 245
246/* The full horozontal cycle (Th) is clock/832/1056/1395. */ 246/* The full horizontal cycle (Th) is clock/832/1056/1395. */
247 247
248#define PIX_CLOCK_TARGET (20000000) 248#define PIX_CLOCK_TARGET (20000000)
249#define PIX_CLOCK_DIVIDER CLOCK_TO_DIV (PIX_CLOCK_TARGET, HCLK) 249#define PIX_CLOCK_DIVIDER CLOCK_TO_DIV (PIX_CLOCK_TARGET, HCLK)
diff --git a/arch/arm/mach-ns9xxx/time.c b/arch/arm/mach-ns9xxx/time.c
index dd257084441c..b97d0c54a388 100644
--- a/arch/arm/mach-ns9xxx/time.c
+++ b/arch/arm/mach-ns9xxx/time.c
@@ -35,7 +35,7 @@ static unsigned long ns9xxx_timer_gettimeoffset(void)
35{ 35{
36 /* return the microseconds which have passed since the last interrupt 36 /* return the microseconds which have passed since the last interrupt
37 * was _serviced_. That is, if an interrupt is pending or the counter 37 * was _serviced_. That is, if an interrupt is pending or the counter
38 * reloads, return one periode more. */ 38 * reloads, return one period more. */
39 39
40 u32 counter1 = SYS_TR(0); 40 u32 counter1 = SYS_TR(0);
41 int pending = SYS_ISR & (1 << IRQ_TIMER0); 41 int pending = SYS_ISR & (1 << IRQ_TIMER0);
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 856c681ebbbc..f6ecdd3a2478 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -38,7 +38,7 @@ config MACH_OMAP_H2
38config MACH_OMAP_H3 38config MACH_OMAP_H3
39 bool "TI H3 Support" 39 bool "TI H3 Support"
40 depends on ARCH_OMAP1 && ARCH_OMAP16XX 40 depends on ARCH_OMAP1 && ARCH_OMAP16XX
41 select GPIOEXPANDER_OMAP 41# select GPIOEXPANDER_OMAP
42 help 42 help
43 TI OMAP 1710 H3 board support. Say Y here if you have such 43 TI OMAP 1710 H3 board support. Say Y here if you have such
44 a board. 44 a board.
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 7d0cf7af88ce..e7130293a03f 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -385,7 +385,7 @@ static void __init osk_init(void)
385 /* Workaround for wrong CS3 (NOR flash) timing 385 /* Workaround for wrong CS3 (NOR flash) timing
386 * There are some U-Boot versions out there which configure 386 * There are some U-Boot versions out there which configure
387 * wrong CS3 memory timings. This mainly leads to CRC 387 * wrong CS3 memory timings. This mainly leads to CRC
388 * or similiar errors if you use NOR flash (e.g. with JFFS2) 388 * or similar errors if you use NOR flash (e.g. with JFFS2)
389 */ 389 */
390 if (EMIFS_CCS(3) != EMIFS_CS3_VAL) 390 if (EMIFS_CCS(3) != EMIFS_CS3_VAL)
391 EMIFS_CCS(3) = EMIFS_CS3_VAL; 391 EMIFS_CCS(3) = EMIFS_CS3_VAL;
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 4bc8a62909b9..015824185629 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * Original version : Laurent Gonzalez 8 * Original version : Laurent Gonzalez
9 * 9 *
10 * Maintainters : http://palmtelinux.sf.net 10 * Maintainers : http://palmtelinux.sf.net
11 * palmtelinux-developpers@lists.sf.net 11 * palmtelinux-developpers@lists.sf.net
12 * 12 *
13 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 8caee68aa090..5bb348e2e315 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -438,7 +438,7 @@ void omap_pm_suspend(void)
438 omap_writew(0, ULPD_SOFT_DISABLE_REQ_REG); 438 omap_writew(0, ULPD_SOFT_DISABLE_REQ_REG);
439 439
440 /* 440 /*
441 * Reenable interrupts 441 * Re-enable interrupts
442 */ 442 */
443 443
444 local_irq_enable(); 444 local_irq_enable();
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 5170481afeab..588adb5ab47f 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -443,7 +443,7 @@ static long omap2_clk_round_rate(struct clk *clk, unsigned long rate)
443 443
444/* 444/*
445 * Check the DLL lock state, and return tue if running in unlock mode. 445 * Check the DLL lock state, and return tue if running in unlock mode.
446 * This is needed to compenste for the shifted DLL value in unlock mode. 446 * This is needed to compensate for the shifted DLL value in unlock mode.
447 */ 447 */
448static u32 omap2_dll_force_needed(void) 448static u32 omap2_dll_force_needed(void)
449{ 449{
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 162978fd5359..4f791866b910 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -338,7 +338,7 @@ struct prcm_config {
338/* 338/*
339 * These represent optimal values for common parts, it won't work for all. 339 * These represent optimal values for common parts, it won't work for all.
340 * As long as you scale down, most parameters are still work, they just 340 * As long as you scale down, most parameters are still work, they just
341 * become sub-optimal. The RFR value goes in the oppisite direction. If you 341 * become sub-optimal. The RFR value goes in the opposite direction. If you
342 * don't adjust it down as your clock period increases the refresh interval 342 * don't adjust it down as your clock period increases the refresh interval
343 * will not be met. Setting all parameters for complete worst case may work, 343 * will not be met. Setting all parameters for complete worst case may work,
344 * but may cut memory performance by 2x. Due to errata the DLLs need to be 344 * but may cut memory performance by 2x. Due to errata the DLLs need to be
@@ -384,7 +384,7 @@ struct prcm_config {
384 * Filling in table based on H4 boards and 2430-SDPs variants available. 384 * Filling in table based on H4 boards and 2430-SDPs variants available.
385 * There are quite a few more rates combinations which could be defined. 385 * There are quite a few more rates combinations which could be defined.
386 * 386 *
387 * When multiple values are defiend the start up will try and choose the 387 * When multiple values are defined the start up will try and choose the
388 * fastest one. If a 'fast' value is defined, then automatically, the /2 388 * fastest one. If a 'fast' value is defined, then automatically, the /2
389 * one should be included as it can be used. Generally having more that 389 * one should be included as it can be used. Generally having more that
390 * one fast set does not make sense, as static timings need to be changed 390 * one fast set does not make sense, as static timings need to be changed
diff --git a/arch/arm/mach-pxa/corgi_lcd.c b/arch/arm/mach-pxa/corgi_lcd.c
index a72476c24621..365b9435f748 100644
--- a/arch/arm/mach-pxa/corgi_lcd.c
+++ b/arch/arm/mach-pxa/corgi_lcd.c
@@ -40,7 +40,7 @@
40#define PICTRL_ADRS 0x06 40#define PICTRL_ADRS 0x06
41#define POLCTRL_ADRS 0x07 41#define POLCTRL_ADRS 0x07
42 42
43/* Resgister Bit Definitions */ 43/* Register Bit Definitions */
44#define RESCTL_QVGA 0x01 44#define RESCTL_QVGA 0x01
45#define RESCTL_VGA 0x00 45#define RESCTL_VGA 0x00
46 46
@@ -55,11 +55,11 @@
55#define POWER0_COM_DCLK 0x01 /* COM Voltage DC Bias DAC Serial Data Clock */ 55#define POWER0_COM_DCLK 0x01 /* COM Voltage DC Bias DAC Serial Data Clock */
56#define POWER0_COM_DOUT 0x02 /* COM Voltage DC Bias DAC Serial Data Out */ 56#define POWER0_COM_DOUT 0x02 /* COM Voltage DC Bias DAC Serial Data Out */
57#define POWER0_DAC_ON 0x04 /* DAC Power Supply ON */ 57#define POWER0_DAC_ON 0x04 /* DAC Power Supply ON */
58#define POWER0_COM_ON 0x08 /* COM Powewr Supply ON */ 58#define POWER0_COM_ON 0x08 /* COM Power Supply ON */
59#define POWER0_VCC5_ON 0x10 /* VCC5 Power Supply ON */ 59#define POWER0_VCC5_ON 0x10 /* VCC5 Power Supply ON */
60 60
61#define POWER0_DAC_OFF 0x00 /* DAC Power Supply OFF */ 61#define POWER0_DAC_OFF 0x00 /* DAC Power Supply OFF */
62#define POWER0_COM_OFF 0x00 /* COM Powewr Supply OFF */ 62#define POWER0_COM_OFF 0x00 /* COM Power Supply OFF */
63#define POWER0_VCC5_OFF 0x00 /* VCC5 Power Supply OFF */ 63#define POWER0_VCC5_OFF 0x00 /* VCC5 Power Supply OFF */
64 64
65#define PICTRL_INIT_STATE 0x01 65#define PICTRL_INIT_STATE 0x01
@@ -145,7 +145,7 @@ static void lcdtg_set_common_voltage(u8 base_data, u8 data)
145 lcdtg_i2c_send_stop(base_data); 145 lcdtg_i2c_send_stop(base_data);
146} 146}
147 147
148/* Set Phase Adjuct */ 148/* Set Phase Adjust */
149static void lcdtg_set_phadadj(int mode) 149static void lcdtg_set_phadadj(int mode)
150{ 150{
151 int adj; 151 int adj;
@@ -226,7 +226,7 @@ static void lcdtg_hw_init(int mode)
226 /* Signals output enable */ 226 /* Signals output enable */
227 corgi_ssp_lcdtg_send(PICTRL_ADRS, 0); 227 corgi_ssp_lcdtg_send(PICTRL_ADRS, 0);
228 228
229 /* Set Phase Adjuct */ 229 /* Set Phase Adjust */
230 lcdtg_set_phadadj(mode); 230 lcdtg_set_phadadj(mode);
231 231
232 /* Initialize for Input Signals from ATI */ 232 /* Initialize for Input Signals from ATI */
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index ff6b4ee037f5..40dea3d5142b 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -32,7 +32,7 @@ static struct corgissp_machinfo *ssp_machinfo;
32 * There are three devices connected to the SSP interface: 32 * There are three devices connected to the SSP interface:
33 * 1. A touchscreen controller (TI ADS7846 compatible) 33 * 1. A touchscreen controller (TI ADS7846 compatible)
34 * 2. An LCD contoller (with some Backlight functionality) 34 * 2. An LCD contoller (with some Backlight functionality)
35 * 3. A battery moinitoring IC (Maxim MAX1111) 35 * 3. A battery monitoring IC (Maxim MAX1111)
36 * 36 *
37 * Each device uses a different speed/mode of communication. 37 * Each device uses a different speed/mode of communication.
38 * 38 *
diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c
index caf6b8bb6c95..c7bdf04ab094 100644
--- a/arch/arm/mach-realview/localtimer.c
+++ b/arch/arm/mach-realview/localtimer.c
@@ -30,7 +30,7 @@ static unsigned long mpcore_timer_rate;
30/* 30/*
31 * local_timer_ack: checks for a local timer interrupt. 31 * local_timer_ack: checks for a local timer interrupt.
32 * 32 *
33 * If a local timer interrupt has occured, acknowledge and return 1. 33 * If a local timer interrupt has occurred, acknowledge and return 1.
34 * Otherwise, return 0. 34 * Otherwise, return 0.
35 */ 35 */
36int local_timer_ack(void) 36int local_timer_ack(void)
diff --git a/arch/arm/mach-s3c2410/bast.h b/arch/arm/mach-s3c2410/bast.h
deleted file mode 100644
index e98543742eb9..000000000000
--- a/arch/arm/mach-s3c2410/bast.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* linux/arch/arm/mach-s3c2410/bast.h
2extern void bast_init_irq(void);
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c
index bc308ceb91c3..435adcce6482 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -160,7 +160,7 @@ static struct platform_device *amlm5900_devices[] __initdata = {
160#endif 160#endif
161}; 161};
162 162
163void __init amlm5900_map_io(void) 163static void __init amlm5900_map_io(void)
164{ 164{
165 s3c24xx_init_io(amlm5900_iodesc, ARRAY_SIZE(amlm5900_iodesc)); 165 s3c24xx_init_io(amlm5900_iodesc, ARRAY_SIZE(amlm5900_iodesc));
166 s3c24xx_init_clocks(0); 166 s3c24xx_init_clocks(0);
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 5ccd0be23a33..5c9bcea74767 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -17,6 +17,7 @@
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/timer.h> 18#include <linux/timer.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/sysdev.h>
20#include <linux/serial_core.h> 21#include <linux/serial_core.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
22 23
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index 9cc4253d7bbc..d86e6f18bac9 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -27,6 +27,7 @@
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/timer.h> 28#include <linux/timer.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/sysdev.h>
30#include <linux/platform_device.h> 31#include <linux/platform_device.h>
31#include <linux/serial_core.h> 32#include <linux/serial_core.h>
32#include <linux/spi/spi.h> 33#include <linux/spi/spi.h>
diff --git a/arch/arm/mach-s3c2412/dma.c b/arch/arm/mach-s3c2412/dma.c
index d0f4695c09d9..668cccefe7b0 100644
--- a/arch/arm/mach-s3c2412/dma.c
+++ b/arch/arm/mach-s3c2412/dma.c
@@ -59,8 +59,8 @@ static struct s3c24xx_dma_map __initdata s3c2412_dma_mappings[] = {
59 [DMACH_SPI1] = { 59 [DMACH_SPI1] = {
60 .name = "spi1", 60 .name = "spi1",
61 .channels = MAP(S3C2412_DMAREQSEL_SPI1TX), 61 .channels = MAP(S3C2412_DMAREQSEL_SPI1TX),
62 .hw_addr.to = S3C2410_PA_SPI + 0x20 + S3C2410_SPTDAT, 62 .hw_addr.to = S3C2410_PA_SPI + S3C2412_SPI1 + S3C2410_SPTDAT,
63 .hw_addr.from = S3C2410_PA_SPI + 0x20 + S3C2410_SPRDAT, 63 .hw_addr.from = S3C2410_PA_SPI + S3C2412_SPI1 + S3C2410_SPRDAT,
64 }, 64 },
65 [DMACH_UART0] = { 65 [DMACH_UART0] = {
66 .name = "uart0", 66 .name = "uart0",
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index aafe0bc593f1..782b5814ced2 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -16,6 +16,7 @@
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/delay.h>
19#include <linux/sysdev.h> 20#include <linux/sysdev.h>
20#include <linux/serial_core.h> 21#include <linux/serial_core.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
@@ -29,6 +30,7 @@
29#include <asm/io.h> 30#include <asm/io.h>
30#include <asm/irq.h> 31#include <asm/irq.h>
31 32
33#include <asm/arch/reset.h>
32#include <asm/arch/idle.h> 34#include <asm/arch/idle.h>
33 35
34#include <asm/arch/regs-clock.h> 36#include <asm/arch/regs-clock.h>
@@ -37,6 +39,8 @@
37#include <asm/arch/regs-gpio.h> 39#include <asm/arch/regs-gpio.h>
38#include <asm/arch/regs-gpioj.h> 40#include <asm/arch/regs-gpioj.h>
39#include <asm/arch/regs-dsc.h> 41#include <asm/arch/regs-dsc.h>
42#include <asm/arch/regs-spi.h>
43#include <asm/arch/regs-s3c2412.h>
40 44
41#include <asm/plat-s3c24xx/s3c2412.h> 45#include <asm/plat-s3c24xx/s3c2412.h>
42#include <asm/plat-s3c24xx/cpu.h> 46#include <asm/plat-s3c24xx/cpu.h>
@@ -74,6 +78,14 @@ void __init s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no)
74 s3c_device_sdi.name = "s3c2412-sdi"; 78 s3c_device_sdi.name = "s3c2412-sdi";
75 s3c_device_lcd.name = "s3c2412-lcd"; 79 s3c_device_lcd.name = "s3c2412-lcd";
76 s3c_device_nand.name = "s3c2412-nand"; 80 s3c_device_nand.name = "s3c2412-nand";
81
82 /* spi channel related changes, s3c2412/13 specific */
83 s3c_device_spi0.name = "s3c2412-spi";
84 s3c_device_spi0.resource[0].end = S3C24XX_PA_SPI + 0x24;
85 s3c_device_spi1.name = "s3c2412-spi";
86 s3c_device_spi1.resource[0].start = S3C24XX_PA_SPI + S3C2412_SPI1;
87 s3c_device_spi1.resource[0].end = S3C24XX_PA_SPI + S3C2412_SPI1 + 0x24;
88
77} 89}
78 90
79/* s3c2412_idle 91/* s3c2412_idle
@@ -97,6 +109,23 @@ static void s3c2412_idle(void)
97 cpu_do_idle(); 109 cpu_do_idle();
98} 110}
99 111
112static void s3c2412_hard_reset(void)
113{
114 /* errata "Watch-dog/Software Reset Problem" specifies that
115 * this reset must be done with the SYSCLK sourced from
116 * EXTCLK instead of FOUT to avoid a glitch in the reset
117 * mechanism.
118 *
119 * See the watchdog section of the S3C2412 manual for more
120 * information on this fix.
121 */
122
123 __raw_writel(0x00, S3C2412_CLKSRC);
124 __raw_writel(S3C2412_SWRST_RESET, S3C2412_SWRST);
125
126 mdelay(1);
127}
128
100/* s3c2412_map_io 129/* s3c2412_map_io
101 * 130 *
102 * register the standard cpu IO areas, and any passed in from the 131 * register the standard cpu IO areas, and any passed in from the
@@ -113,6 +142,10 @@ void __init s3c2412_map_io(struct map_desc *mach_desc, int mach_size)
113 142
114 s3c24xx_idle = s3c2412_idle; 143 s3c24xx_idle = s3c2412_idle;
115 144
145 /* set custom reset hook */
146
147 s3c24xx_reset_hook = s3c2412_hard_reset;
148
116 /* register our io-tables */ 149 /* register our io-tables */
117 150
118 iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc)); 151 iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc));
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index 324f5a237921..4d6c7a574c1a 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -45,7 +45,7 @@
45#include <asm/plat-s3c24xx/devs.h> 45#include <asm/plat-s3c24xx/devs.h>
46#include <asm/plat-s3c24xx/cpu.h> 46#include <asm/plat-s3c24xx/cpu.h>
47 47
48/* onboard perihpheral map */ 48/* onboard perihperal map */
49 49
50static struct map_desc osiris_iodesc[] __initdata = { 50static struct map_desc osiris_iodesc[] __initdata = {
51 /* ISA IO areas (may be over-written later) */ 51 /* ISA IO areas (may be over-written later) */
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index c3cc4bf158f6..866ff71c01dd 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -19,6 +19,7 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/tty.h> 20#include <linux/tty.h>
21#include <linux/console.h> 21#include <linux/console.h>
22#include <linux/sysdev.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
23#include <linux/serial_core.h> 24#include <linux/serial_core.h>
24#include <linux/serial.h> 25#include <linux/serial.h>
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
index 0b6e360aeae7..58402948c47c 100644
--- a/arch/arm/mach-s3c2443/clock.c
+++ b/arch/arm/mach-s3c2443/clock.c
@@ -394,7 +394,7 @@ static int s3c2443_setrate_usbhost(struct clk *clk, unsigned long rate)
394 return 0; 394 return 0;
395} 395}
396 396
397struct clk clk_usb_bus_host = { 397static struct clk clk_usb_bus_host = {
398 .name = "usb-bus-host-parent", 398 .name = "usb-bus-host-parent",
399 .id = -1, 399 .id = -1,
400 .parent = &clk_esysclk, 400 .parent = &clk_esysclk,
@@ -747,6 +747,24 @@ static struct clk init_clocks[] = {
747 .enable = s3c2443_clkcon_enable_h, 747 .enable = s3c2443_clkcon_enable_h,
748 .ctrlbit = S3C2443_HCLKCON_USBD, 748 .ctrlbit = S3C2443_HCLKCON_USBD,
749 }, { 749 }, {
750 .name = "hsmmc",
751 .id = -1,
752 .parent = &clk_h,
753 .enable = s3c2443_clkcon_enable_h,
754 .ctrlbit = S3C2443_HCLKCON_HSMMC,
755 }, {
756 .name = "cfc",
757 .id = -1,
758 .parent = &clk_h,
759 .enable = s3c2443_clkcon_enable_h,
760 .ctrlbit = S3C2443_HCLKCON_CFC,
761 }, {
762 .name = "ssmc",
763 .id = -1,
764 .parent = &clk_h,
765 .enable = s3c2443_clkcon_enable_h,
766 .ctrlbit = S3C2443_HCLKCON_SSMC,
767 }, {
750 .name = "timers", 768 .name = "timers",
751 .id = -1, 769 .id = -1,
752 .parent = &clk_p, 770 .parent = &clk_p,
@@ -791,7 +809,8 @@ static struct clk init_clocks[] = {
791 .name = "usb-bus-host", 809 .name = "usb-bus-host",
792 .id = -1, 810 .id = -1,
793 .parent = &clk_usb_bus_host, 811 .parent = &clk_usb_bus_host,
794 }, { .name = "ac97", 812 }, {
813 .name = "ac97",
795 .id = -1, 814 .id = -1,
796 .parent = &clk_p, 815 .parent = &clk_p,
797 .ctrlbit = S3C2443_PCLKCON_AC97, 816 .ctrlbit = S3C2443_PCLKCON_AC97,
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index b71ee53c2865..b1eb709ee65a 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -104,6 +104,7 @@ static struct s3c2410_uartcfg smdk2443_uartcfgs[] __initdata = {
104static struct platform_device *smdk2443_devices[] __initdata = { 104static struct platform_device *smdk2443_devices[] __initdata = {
105 &s3c_device_wdt, 105 &s3c_device_wdt,
106 &s3c_device_i2c, 106 &s3c_device_i2c,
107 &s3c_device_hsmmc,
107}; 108};
108 109
109static void __init smdk2443_map_io(void) 110static void __init smdk2443_map_io(void)
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c2443/s3c2443.c
index 11b1d0b310c3..8d8117158d23 100644
--- a/arch/arm/mach-s3c2443/s3c2443.c
+++ b/arch/arm/mach-s3c2443/s3c2443.c
@@ -63,6 +63,10 @@ int __init s3c2443_init(void)
63 63
64 s3c_device_nand.name = "s3c2412-nand"; 64 s3c_device_nand.name = "s3c2412-nand";
65 65
66 /* change WDT IRQ number */
67 s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT;
68 s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT;
69
66 return sysdev_register(&s3c2443_sysdev); 70 return sysdev_register(&s3c2443_sysdev);
67} 71}
68 72
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index d7c038a0256b..4cbf9468f654 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -139,12 +139,12 @@ static u_int neponset_get_mctrl(struct uart_port *port)
139 return ret; 139 return ret;
140} 140}
141 141
142static struct sa1100_port_fns neponset_port_fns __initdata = { 142static struct sa1100_port_fns neponset_port_fns __devinitdata = {
143 .set_mctrl = neponset_set_mctrl, 143 .set_mctrl = neponset_set_mctrl,
144 .get_mctrl = neponset_get_mctrl, 144 .get_mctrl = neponset_get_mctrl,
145}; 145};
146 146
147static int neponset_probe(struct platform_device *dev) 147static int __devinit neponset_probe(struct platform_device *dev)
148{ 148{
149 sa1100_register_uart_fns(&neponset_port_fns); 149 sa1100_register_uart_fns(&neponset_port_fns);
150 150
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 416e277054c2..29cb0c1604ab 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -25,7 +25,7 @@ static unsigned long __init sa1100_get_rtc_time(void)
25{ 25{
26 /* 26 /*
27 * According to the manual we should be able to let RTTR be zero 27 * According to the manual we should be able to let RTTR be zero
28 * and then a default diviser for a 32.768KHz clock is used. 28 * and then a default divisor for a 32.768KHz clock is used.
29 * Apparently this doesn't work, at least for my SA1110 rev 5. 29 * Apparently this doesn't work, at least for my SA1110 rev 5.
30 * If the clock divider is uninitialized then reset it to the 30 * If the clock divider is uninitialized then reset it to the
31 * default value to get the 1Hz clock. 31 * default value to get the 1Hz clock.
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 15f0284010ca..e7904bc92c73 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -351,6 +351,7 @@ config CPU_V6
351 select CPU_CACHE_V6 351 select CPU_CACHE_V6
352 select CPU_CACHE_VIPT 352 select CPU_CACHE_VIPT
353 select CPU_CP15_MMU 353 select CPU_CP15_MMU
354 select CPU_HAS_ASID
354 select CPU_COPY_V6 if MMU 355 select CPU_COPY_V6 if MMU
355 select CPU_TLB_V6 if MMU 356 select CPU_TLB_V6 if MMU
356 357
@@ -376,8 +377,9 @@ config CPU_V7
376 select CPU_CACHE_V7 377 select CPU_CACHE_V7
377 select CPU_CACHE_VIPT 378 select CPU_CACHE_VIPT
378 select CPU_CP15_MMU 379 select CPU_CP15_MMU
380 select CPU_HAS_ASID
379 select CPU_COPY_V6 if MMU 381 select CPU_COPY_V6 if MMU
380 select CPU_TLB_V6 if MMU 382 select CPU_TLB_V7 if MMU
381 383
382# Figure out what processor architecture version we should be using. 384# Figure out what processor architecture version we should be using.
383# This defines the compiler instruction set which depends on the machine type. 385# This defines the compiler instruction set which depends on the machine type.
@@ -496,8 +498,17 @@ config CPU_TLB_V4WBI
496config CPU_TLB_V6 498config CPU_TLB_V6
497 bool 499 bool
498 500
501config CPU_TLB_V7
502 bool
503
499endif 504endif
500 505
506config CPU_HAS_ASID
507 bool
508 help
509 This indicates whether the CPU has the ASID register; used to
510 tag TLB and possibly cache entries.
511
501config CPU_CP15 512config CPU_CP15
502 bool 513 bool
503 help 514 help
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index b5bd335ff14a..762702765fc3 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -46,6 +46,7 @@ obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o
46obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o 46obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o
47obj-$(CONFIG_CPU_TLB_V4WBI) += tlb-v4wbi.o 47obj-$(CONFIG_CPU_TLB_V4WBI) += tlb-v4wbi.o
48obj-$(CONFIG_CPU_TLB_V6) += tlb-v6.o 48obj-$(CONFIG_CPU_TLB_V6) += tlb-v6.o
49obj-$(CONFIG_CPU_TLB_V7) += tlb-v7.o
49 50
50obj-$(CONFIG_CPU_ARM610) += proc-arm6_7.o 51obj-$(CONFIG_CPU_ARM610) += proc-arm6_7.o
51obj-$(CONFIG_CPU_ARM710) += proc-arm6_7.o 52obj-$(CONFIG_CPU_ARM710) += proc-arm6_7.o
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 19ca333240ec..074b7cb07743 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 1995 Linus Torvalds 4 * Copyright (C) 1995 Linus Torvalds
5 * Modifications for ARM processor (c) 1995-2001 Russell King 5 * Modifications for ARM processor (c) 1995-2001 Russell King
6 * Thumb aligment fault fixups (c) 2004 MontaVista Software, Inc. 6 * Thumb alignment fault fixups (c) 2004 MontaVista Software, Inc.
7 * - Adapted from gdb/sim/arm/thumbemu.c -- Thumb instruction emulation. 7 * - Adapted from gdb/sim/arm/thumbemu.c -- Thumb instruction emulation.
8 * Copyright (C) 1996, Cygnus Software Technologies Ltd. 8 * Copyright (C) 1996, Cygnus Software Technologies Ltd.
9 * 9 *
@@ -630,7 +630,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
630 630
631 fs = get_fs(); 631 fs = get_fs();
632 set_fs(KERNEL_DS); 632 set_fs(KERNEL_DS);
633 if thumb_mode(regs) { 633 if (thumb_mode(regs)) {
634 fault = __get_user(tinstr, (u16 *)(instrptr & ~1)); 634 fault = __get_user(tinstr, (u16 *)(instrptr & ~1));
635 if (!(fault)) 635 if (!(fault))
636 instr = thumb2arm(tinstr); 636 instr = thumb2arm(tinstr);
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index d6167ad4e011..f3ade18862aa 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -346,7 +346,7 @@ void __iounmap(volatile void __iomem *addr)
346#ifndef CONFIG_SMP 346#ifndef CONFIG_SMP
347 /* 347 /*
348 * If this is a section based mapping we need to handle it 348 * If this is a section based mapping we need to handle it
349 * specially as the VM subysystem does not know how to handle 349 * specially as the VM subsystem does not know how to handle
350 * such a beast. We need the lock here b/c we need to clear 350 * such a beast. We need the lock here b/c we need to clear
351 * all the mappings before the area can be reclaimed 351 * all the mappings before the area can be reclaimed
352 * by someone else. 352 * by someone else.
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index 2c4c2422cd1e..2728b0e7d2bb 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -5,7 +5,7 @@
5#include <linux/mm.h> 5#include <linux/mm.h>
6#include <linux/mman.h> 6#include <linux/mman.h>
7#include <linux/shm.h> 7#include <linux/shm.h>
8 8#include <linux/sched.h>
9#include <asm/system.h> 9#include <asm/system.h>
10 10
11#define COLOUR_ALIGN(addr,pgoff) \ 11#define COLOUR_ALIGN(addr,pgoff) \
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 2ba1530d1ce1..02e050ae59f6 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -92,7 +92,7 @@ static struct cachepolicy cache_policies[] __initdata = {
92}; 92};
93 93
94/* 94/*
95 * These are useful for identifing cache coherency 95 * These are useful for identifying cache coherency
96 * problems by allowing the cache or the cache and 96 * problems by allowing the cache or the cache and
97 * writebuffer to be turned off. (Note: the write 97 * writebuffer to be turned off. (Note: the write
98 * buffer should not be on and the cache off). 98 * buffer should not be on and the cache off).
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index dd823dd4a374..718f4782ee8b 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -256,7 +256,7 @@ __v7_proc_info:
256 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP 256 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
257 .long cpu_v7_name 257 .long cpu_v7_name
258 .long v7_processor_functions 258 .long v7_processor_functions
259 .long v6wbi_tlb_fns 259 .long v7wbi_tlb_fns
260 .long v6_user_fns 260 .long v6_user_fns
261 .long v7_cache_fns 261 .long v7_cache_fns
262 .size __v7_proc_info, . - __v7_proc_info 262 .size __v7_proc_info, . - __v7_proc_info
diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S
new file mode 100644
index 000000000000..b56dda8052f7
--- /dev/null
+++ b/arch/arm/mm/tlb-v7.S
@@ -0,0 +1,88 @@
1/*
2 * linux/arch/arm/mm/tlb-v7.S
3 *
4 * Copyright (C) 1997-2002 Russell King
5 * Modified for ARMv7 by Catalin Marinas
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 * ARM architecture version 6 TLB handling functions.
12 * These assume a split I/D TLB.
13 */
14#include <linux/linkage.h>
15#include <asm/asm-offsets.h>
16#include <asm/page.h>
17#include <asm/tlbflush.h>
18#include "proc-macros.S"
19
20/*
21 * v7wbi_flush_user_tlb_range(start, end, vma)
22 *
23 * Invalidate a range of TLB entries in the specified address space.
24 *
25 * - start - start address (may not be aligned)
26 * - end - end address (exclusive, may not be aligned)
27 * - vma - vma_struct describing address range
28 *
29 * It is assumed that:
30 * - the "Invalidate single entry" instruction will invalidate
31 * both the I and the D TLBs on Harvard-style TLBs
32 */
33ENTRY(v7wbi_flush_user_tlb_range)
34 vma_vm_mm r3, r2 @ get vma->vm_mm
35 mmid r3, r3 @ get vm_mm->context.id
36 dsb
37 mov r0, r0, lsr #PAGE_SHIFT @ align address
38 mov r1, r1, lsr #PAGE_SHIFT
39 asid r3, r3 @ mask ASID
40 orr r0, r3, r0, lsl #PAGE_SHIFT @ Create initial MVA
41 mov r1, r1, lsl #PAGE_SHIFT
42 vma_vm_flags r2, r2 @ get vma->vm_flags
431:
44 mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA (was 1)
45 tst r2, #VM_EXEC @ Executable area ?
46 mcrne p15, 0, r0, c8, c5, 1 @ TLB invalidate I MVA (was 1)
47 add r0, r0, #PAGE_SZ
48 cmp r0, r1
49 blo 1b
50 mov ip, #0
51 mcr p15, 0, ip, c7, c5, 6 @ flush BTAC/BTB
52 dsb
53 mov pc, lr
54
55/*
56 * v7wbi_flush_kern_tlb_range(start,end)
57 *
58 * Invalidate a range of kernel TLB entries
59 *
60 * - start - start address (may not be aligned)
61 * - end - end address (exclusive, may not be aligned)
62 */
63ENTRY(v7wbi_flush_kern_tlb_range)
64 dsb
65 mov r0, r0, lsr #PAGE_SHIFT @ align address
66 mov r1, r1, lsr #PAGE_SHIFT
67 mov r0, r0, lsl #PAGE_SHIFT
68 mov r1, r1, lsl #PAGE_SHIFT
691:
70 mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA
71 mcr p15, 0, r0, c8, c5, 1 @ TLB invalidate I MVA
72 add r0, r0, #PAGE_SZ
73 cmp r0, r1
74 blo 1b
75 mov r2, #0
76 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
77 dsb
78 isb
79 mov pc, lr
80
81 .section ".text.init", #alloc, #execinstr
82
83 .type v7wbi_tlb_fns, #object
84ENTRY(v7wbi_tlb_fns)
85 .long v7wbi_flush_user_tlb_range
86 .long v7wbi_flush_kern_tlb_range
87 .long v6wbi_tlb_flags
88 .size v7wbi_tlb_fns, . - v7wbi_tlb_fns
diff --git a/arch/arm/nwfpe/softfloat.h b/arch/arm/nwfpe/softfloat.h
index 0a3067452cd2..260fe29d73f5 100644
--- a/arch/arm/nwfpe/softfloat.h
+++ b/arch/arm/nwfpe/softfloat.h
@@ -273,4 +273,7 @@ static inline flag float64_lt_nocheck(float64 a, float64 b)
273extern flag float32_is_nan( float32 a ); 273extern flag float32_is_nan( float32 a );
274extern flag float64_is_nan( float64 a ); 274extern flag float64_is_nan( float64 a );
275 275
276extern int32 float64_to_uint32( struct roundingData *roundData, float64 a );
277extern int32 float64_to_uint32_round_to_zero( float64 a );
278
276#endif 279#endif
diff --git a/arch/arm/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c
index 898500718249..7791da791f5f 100644
--- a/arch/arm/oprofile/op_model_mpcore.c
+++ b/arch/arm/oprofile/op_model_mpcore.c
@@ -257,8 +257,13 @@ static void em_stop(void)
257 */ 257 */
258static void em_route_irq(int irq, unsigned int cpu) 258static void em_route_irq(int irq, unsigned int cpu)
259{ 259{
260 irq_desc[irq].affinity = cpumask_of_cpu(cpu); 260 struct irq_desc *desc = irq_desc + irq;
261 irq_desc[irq].chip->set_affinity(irq, cpumask_of_cpu(cpu)); 261 cpumask_t mask = cpumask_of_cpu(cpu);
262
263 spin_lock_irq(&desc->lock);
264 desc->affinity = mask;
265 desc->chip->set_affinity(irq, mask);
266 spin_unlock_irq(&desc->lock);
262} 267}
263 268
264static int em_setup(void) 269static int em_setup(void)
diff --git a/arch/arm/plat-iop/pci.c b/arch/arm/plat-iop/pci.c
index e2744b7227c5..2b5aa1135b11 100644
--- a/arch/arm/plat-iop/pci.c
+++ b/arch/arm/plat-iop/pci.c
@@ -19,6 +19,7 @@
19#include <linux/ioport.h> 19#include <linux/ioport.h>
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/signal.h>
22#include <asm/system.h> 23#include <asm/system.h>
23#include <asm/hardware.h> 24#include <asm/hardware.h>
24#include <asm/mach/pci.h> 25#include <asm/mach/pci.h>
@@ -85,10 +86,10 @@ static int iop3xx_pci_status(void)
85 86
86/* 87/*
87 * Simply write the address register and read the configuration 88 * Simply write the address register and read the configuration
88 * data. Note that the 4 nop's ensure that we are able to handle 89 * data. Note that the 4 nops ensure that we are able to handle
89 * a delayed abort (in theory.) 90 * a delayed abort (in theory.)
90 */ 91 */
91static inline u32 iop3xx_read(unsigned long addr) 92static u32 iop3xx_read(unsigned long addr)
92{ 93{
93 u32 val; 94 u32 val;
94 95
@@ -321,7 +322,7 @@ void __init iop3xx_atu_disable(void)
321/* Flag to determine whether the ATU is initialized and the PCI bus scanned */ 322/* Flag to determine whether the ATU is initialized and the PCI bus scanned */
322int init_atu; 323int init_atu;
323 324
324void iop3xx_pci_preinit(void) 325void __init iop3xx_pci_preinit(void)
325{ 326{
326 if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) { 327 if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) {
327 iop3xx_atu_disable(); 328 iop3xx_atu_disable();
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index dd8708ad0a71..7987aa6e95f8 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -73,7 +73,7 @@ static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
73 } 73 }
74 if (info != NULL) { 74 if (info != NULL) {
75 /* Check the length as a lame attempt to check for 75 /* Check the length as a lame attempt to check for
76 * binary inconsistancy. */ 76 * binary inconsistency. */
77 if (len != NO_LENGTH_CHECK) { 77 if (len != NO_LENGTH_CHECK) {
78 /* Word-align len */ 78 /* Word-align len */
79 if (len & 0x03) 79 if (len & 0x03)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 55a4d3be16b6..88d5b6d9f950 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -1172,7 +1172,7 @@ static void set_b1_regs(void)
1172 break; 1172 break;
1173 default: 1173 default:
1174 BUG(); 1174 BUG();
1175 return; /* Supress warning about uninitialized vars */ 1175 return; /* Suppress warning about uninitialized vars */
1176 } 1176 }
1177 1177
1178 if (omap_dma_in_1510_mode()) { 1178 if (omap_dma_in_1510_mode()) {
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index bc46f33aede3..1f23f0459e5f 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -59,8 +59,8 @@ extern unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
59 59
60/* 60/*
61 * Depending on the target RAMFS firewall setup, the public usable amount of 61 * Depending on the target RAMFS firewall setup, the public usable amount of
62 * SRAM varies. The default accessable size for all device types is 2k. A GP 62 * SRAM varies. The default accessible size for all device types is 2k. A GP
63 * device allows ARM11 but not other initators for full size. This 63 * device allows ARM11 but not other initiators for full size. This
64 * functionality seems ok until some nice security API happens. 64 * functionality seems ok until some nice security API happens.
65 */ 65 */
66static int is_sram_locked(void) 66static int is_sram_locked(void)
@@ -71,7 +71,7 @@ static int is_sram_locked(void)
71 type = __raw_readl(VA_CONTROL_STAT) & TYPE_MASK; 71 type = __raw_readl(VA_CONTROL_STAT) & TYPE_MASK;
72 72
73 if (type == GP_DEVICE) { 73 if (type == GP_DEVICE) {
74 /* RAMFW: R/W access to all initators for all qualifier sets */ 74 /* RAMFW: R/W access to all initiators for all qualifier sets */
75 if (cpu_is_omap242x()) { 75 if (cpu_is_omap242x()) {
76 __raw_writel(0xFF, VA_REQINFOPERM0); /* all q-vects */ 76 __raw_writel(0xFF, VA_REQINFOPERM0); /* all q-vects */
77 __raw_writel(0xCFDE, VA_READPERM0); /* all i-read */ 77 __raw_writel(0xCFDE, VA_READPERM0); /* all i-read */
diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
index 25489aafb113..a5aedf964b88 100644
--- a/arch/arm/plat-omap/usb.c
+++ b/arch/arm/plat-omap/usb.c
@@ -177,7 +177,7 @@ static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device)
177 177
178 /* NOTE: SPEED and SUSP aren't configured here. OTG hosts 178 /* NOTE: SPEED and SUSP aren't configured here. OTG hosts
179 * may be able to use I2C requests to set those bits along 179 * may be able to use I2C requests to set those bits along
180 * with VBUS switching and overcurrent detction. 180 * with VBUS switching and overcurrent detection.
181 */ 181 */
182 182
183 if (cpu_class_is_omap1() && nwires != 6) 183 if (cpu_class_is_omap1() && nwires != 6)
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c
index 908efa7d745f..7ed19b23ce56 100644
--- a/arch/arm/plat-s3c24xx/common-smdk.c
+++ b/arch/arm/plat-s3c24xx/common-smdk.c
@@ -18,6 +18,7 @@
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/sysdev.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
22 23
23#include <linux/mtd/mtd.h> 24#include <linux/mtd/mtd.h>
@@ -29,6 +30,7 @@
29#include <asm/mach/map.h> 30#include <asm/mach/map.h>
30#include <asm/mach/irq.h> 31#include <asm/mach/irq.h>
31 32
33#include <asm/mach-types.h>
32#include <asm/hardware.h> 34#include <asm/hardware.h>
33#include <asm/io.h> 35#include <asm/io.h>
34#include <asm/irq.h> 36#include <asm/irq.h>
@@ -192,6 +194,9 @@ void __init smdk_machine_init(void)
192 s3c2410_gpio_setpin(S3C2410_GPF6, 1); 194 s3c2410_gpio_setpin(S3C2410_GPF6, 1);
193 s3c2410_gpio_setpin(S3C2410_GPF7, 1); 195 s3c2410_gpio_setpin(S3C2410_GPF7, 1);
194 196
197 if (machine_is_smdk2443())
198 smdk_nand_info.twrph0 = 50;
199
195 s3c_device_nand.dev.platform_data = &smdk_nand_info; 200 s3c_device_nand.dev.platform_data = &smdk_nand_info;
196 201
197 platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs)); 202 platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs));
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 0fe53b39cb2f..5875da0ae0eb 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -33,6 +33,7 @@
33 33
34#include <asm/plat-s3c24xx/devs.h> 34#include <asm/plat-s3c24xx/devs.h>
35#include <asm/plat-s3c24xx/cpu.h> 35#include <asm/plat-s3c24xx/cpu.h>
36#include <asm/arch/regs-spi.h>
36 37
37/* Serial port registrations */ 38/* Serial port registrations */
38 39
@@ -402,6 +403,36 @@ struct platform_device s3c_device_sdi = {
402 403
403EXPORT_SYMBOL(s3c_device_sdi); 404EXPORT_SYMBOL(s3c_device_sdi);
404 405
406/* High-speed MMC/SD */
407
408static struct resource s3c_hsmmc_resource[] = {
409 [0] = {
410 .start = S3C2443_PA_HSMMC,
411 .end = S3C2443_PA_HSMMC + S3C2443_SZ_HSMMC - 1,
412 .flags = IORESOURCE_MEM,
413 },
414 [1] = {
415 .start = IRQ_S3C2443_HSMMC,
416 .end = IRQ_S3C2443_HSMMC,
417 .flags = IORESOURCE_IRQ,
418 }
419};
420
421static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL;
422
423struct platform_device s3c_device_hsmmc = {
424 .name = "s3c-sdhci",
425 .id = -1,
426 .num_resources = ARRAY_SIZE(s3c_hsmmc_resource),
427 .resource = s3c_hsmmc_resource,
428 .dev = {
429 .dma_mask = &s3c_device_hsmmc_dmamask,
430 .coherent_dma_mask = 0xffffffffUL
431 }
432};
433
434
435
405/* SPI (0) */ 436/* SPI (0) */
406 437
407static struct resource s3c_spi0_resource[] = { 438static struct resource s3c_spi0_resource[] = {
@@ -437,8 +468,8 @@ EXPORT_SYMBOL(s3c_device_spi0);
437 468
438static struct resource s3c_spi1_resource[] = { 469static struct resource s3c_spi1_resource[] = {
439 [0] = { 470 [0] = {
440 .start = S3C24XX_PA_SPI + 0x20, 471 .start = S3C24XX_PA_SPI + S3C2410_SPI1,
441 .end = S3C24XX_PA_SPI + 0x20 + 0x1f, 472 .end = S3C24XX_PA_SPI + S3C2410_SPI1 + 0x1f,
442 .flags = IORESOURCE_MEM, 473 .flags = IORESOURCE_MEM,
443 }, 474 },
444 [1] = { 475 [1] = {
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index 6f03c9370979..08d80f2f51f2 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -1153,7 +1153,7 @@ EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn);
1153 * 1153 *
1154 * hwcfg: the value for xxxSTCn register, 1154 * hwcfg: the value for xxxSTCn register,
1155 * bit 0: 0=increment pointer, 1=leave pointer 1155 * bit 0: 0=increment pointer, 1=leave pointer
1156 * bit 1: 0=soucre is AHB, 1=soucre is APB 1156 * bit 1: 0=source is AHB, 1=source is APB
1157 * 1157 *
1158 * devaddr: physical address of the source 1158 * devaddr: physical address of the source
1159*/ 1159*/
diff --git a/arch/arm/plat-s3c24xx/pm-simtec.c b/arch/arm/plat-s3c24xx/pm-simtec.c
index bd965f2feeca..cb0b3a4ccf1b 100644
--- a/arch/arm/plat-s3c24xx/pm-simtec.c
+++ b/arch/arm/plat-s3c24xx/pm-simtec.c
@@ -18,6 +18,7 @@
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/sysdev.h>
21#include <linux/device.h> 22#include <linux/device.h>
22 23
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c
index c6b03f8ab260..5692eccdf4d1 100644
--- a/arch/arm/plat-s3c24xx/pm.c
+++ b/arch/arm/plat-s3c24xx/pm.c
@@ -555,7 +555,7 @@ static int s3c2410_pm_enter(suspend_state_t state)
555 __raw_writel(__raw_readl(S3C2410_INTPND), S3C2410_INTPND); 555 __raw_writel(__raw_readl(S3C2410_INTPND), S3C2410_INTPND);
556 __raw_writel(__raw_readl(S3C2410_SRCPND), S3C2410_SRCPND); 556 __raw_writel(__raw_readl(S3C2410_SRCPND), S3C2410_SRCPND);
557 557
558 /* call cpu specific preperation */ 558 /* call cpu specific preparation */
559 559
560 pm_cpu_prep(); 560 pm_cpu_prep();
561 561
diff --git a/arch/arm26/kernel/vmlinux-arm26-xip.lds.in b/arch/arm26/kernel/vmlinux-arm26-xip.lds.in
index 046a85054018..4ec715c25dea 100644
--- a/arch/arm26/kernel/vmlinux-arm26-xip.lds.in
+++ b/arch/arm26/kernel/vmlinux-arm26-xip.lds.in
@@ -64,7 +64,7 @@ SECTIONS
64 64
65 .text : { /* Real text segment */ 65 .text : { /* Real text segment */
66 _text = .; /* Text and read-only data */ 66 _text = .; /* Text and read-only data */
67 *(.text) 67 TEXT_TEXT
68 SCHED_TEXT 68 SCHED_TEXT
69 LOCK_TEXT /* FIXME - borrowed from arm32 - check*/ 69 LOCK_TEXT /* FIXME - borrowed from arm32 - check*/
70 *(.fixup) 70 *(.fixup)
@@ -111,7 +111,7 @@ SECTIONS
111 /* 111 /*
112 * and the usual data section 112 * and the usual data section
113 */ 113 */
114 *(.data) 114 DATA_DATA
115 CONSTRUCTORS 115 CONSTRUCTORS
116 116
117 *(.init.data) 117 *(.init.data)
diff --git a/arch/arm26/kernel/vmlinux-arm26.lds.in b/arch/arm26/kernel/vmlinux-arm26.lds.in
index 1d2949e83be8..6c44f6a17bf7 100644
--- a/arch/arm26/kernel/vmlinux-arm26.lds.in
+++ b/arch/arm26/kernel/vmlinux-arm26.lds.in
@@ -65,7 +65,7 @@ SECTIONS
65 65
66 .text : { /* Real text segment */ 66 .text : { /* Real text segment */
67 _text = .; /* Text and read-only data */ 67 _text = .; /* Text and read-only data */
68 *(.text) 68 TEXT_TEXT
69 SCHED_TEXT 69 SCHED_TEXT
70 LOCK_TEXT 70 LOCK_TEXT
71 *(.fixup) 71 *(.fixup)
@@ -106,7 +106,7 @@ SECTIONS
106 /* 106 /*
107 * and the usual data section 107 * and the usual data section
108 */ 108 */
109 *(.data) 109 DATA_DATA
110 CONSTRUCTORS 110 CONSTRUCTORS
111 111
112 _edata = .; 112 _edata = .;
diff --git a/arch/avr32/kernel/vmlinux.lds.c b/arch/avr32/kernel/vmlinux.lds.c
index e7f72c995a32..db0438f35c00 100644
--- a/arch/avr32/kernel/vmlinux.lds.c
+++ b/arch/avr32/kernel/vmlinux.lds.c
@@ -76,7 +76,7 @@ SECTIONS
76 . = 0x100; 76 . = 0x100;
77 *(.scall.text) 77 *(.scall.text)
78 *(.irq.text) 78 *(.irq.text)
79 *(.text) 79 TEXT_TEXT
80 SCHED_TEXT 80 SCHED_TEXT
81 LOCK_TEXT 81 LOCK_TEXT
82 KPROBES_TEXT 82 KPROBES_TEXT
@@ -112,7 +112,7 @@ SECTIONS
112 112
113 /* And the rest... */ 113 /* And the rest... */
114 *(.data.rel*) 114 *(.data.rel*)
115 *(.data) 115 DATA_DATA
116 CONSTRUCTORS 116 CONSTRUCTORS
117 117
118 _edata = .; 118 _edata = .;
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index d80e5b1d686e..b1b111bb2f3a 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -25,6 +25,10 @@ config BLACKFIN
25 bool 25 bool
26 default y 26 default y
27 27
28config ZONE_DMA
29 bool
30 default y
31
28config BFIN 32config BFIN
29 bool 33 bool
30 default y 34 default y
@@ -189,7 +193,7 @@ config BFIN537_BLUETECHNIX_CM
189 CM-BF537 support for EVAL- and DEV-Board. 193 CM-BF537 support for EVAL- and DEV-Board.
190 194
191config BFIN561_BLUETECHNIX_CM 195config BFIN561_BLUETECHNIX_CM
192 bool "BF561-CM" 196 bool "Bluetechnix CM-BF561"
193 depends on (BF561) 197 depends on (BF561)
194 help 198 help
195 CM-BF561 support for EVAL- and DEV-Board. 199 CM-BF561 support for EVAL- and DEV-Board.
@@ -200,6 +204,12 @@ config BFIN561_EZKIT
200 help 204 help
201 BF561-EZKIT-LITE board Support. 205 BF561-EZKIT-LITE board Support.
202 206
207config BFIN561_TEPLA
208 bool "BF561-TEPLA"
209 depends on (BF561)
210 help
211 BF561-TEPLA board Support.
212
203config PNAV10 213config PNAV10
204 bool "PNAV 1.0 board" 214 bool "PNAV 1.0 board"
205 depends on (BF537) 215 depends on (BF537)
diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index 52d4dbdb2b1a..75e89c324756 100644
--- a/arch/blackfin/Makefile
+++ b/arch/blackfin/Makefile
@@ -15,6 +15,7 @@ GZFLAGS := -9
15CFLAGS_MODULE += -mlong-calls 15CFLAGS_MODULE += -mlong-calls
16KALLSYMS += --symbol-prefix=_ 16KALLSYMS += --symbol-prefix=_
17 17
18KBUILD_DEFCONFIG := BF537-STAMP_defconfig
18 19
19# setup the machine name and the machine dependent settings 20# setup the machine name and the machine dependent settings
20machine-$(CONFIG_BF531) := bf533 21machine-$(CONFIG_BF531) := bf533
diff --git a/arch/blackfin/configs/BF533-EZKIT_defconfig b/arch/blackfin/configs/BF533-EZKIT_defconfig
new file mode 100644
index 000000000000..377c8e05e4ab
--- /dev/null
+++ b/arch/blackfin/configs/BF533-EZKIT_defconfig
@@ -0,0 +1,1014 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.19.3
4#
5# CONFIG_MMU is not set
6# CONFIG_FPU is not set
7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y
10CONFIG_BFIN=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_IRQ_PROBE=y
16CONFIG_GENERIC_CALIBRATE_DELAY=y
17CONFIG_UCLINUX=y
18CONFIG_FORCE_MAX_ZONEORDER=14
19CONFIG_IRQCHIP_DEMUX_GPIO=y
20CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
21
22#
23# Code maturity level options
24#
25CONFIG_EXPERIMENTAL=y
26CONFIG_BROKEN_ON_SMP=y
27CONFIG_INIT_ENV_ARG_LIMIT=32
28
29#
30# General setup
31#
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set
36# CONFIG_POSIX_MQUEUE is not set
37# CONFIG_BSD_PROCESS_ACCT is not set
38# CONFIG_TASKSTATS is not set
39# CONFIG_UTS_NS is not set
40# CONFIG_AUDIT is not set
41# CONFIG_IKCONFIG is not set
42# CONFIG_RELAY is not set
43CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SYSCTL=y
46CONFIG_EMBEDDED=y
47CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y
49CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_EXTRA_PASS is not set
51CONFIG_HOTPLUG=y
52CONFIG_PRINTK=y
53CONFIG_BUG=y
54CONFIG_ELF_CORE=y
55CONFIG_BASE_FULL=y
56CONFIG_FUTEX=y
57CONFIG_EPOLL=y
58CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
59# CONFIG_LIMIT_PAGECACHE is not set
60CONFIG_BUDDY=y
61# CONFIG_NP2 is not set
62CONFIG_SLAB=y
63CONFIG_VM_EVENT_COUNTERS=y
64CONFIG_RT_MUTEXES=y
65CONFIG_TINY_SHMEM=y
66CONFIG_BASE_SMALL=0
67# CONFIG_SLOB is not set
68
69#
70# Loadable module support
71#
72CONFIG_MODULES=y
73CONFIG_MODULE_UNLOAD=y
74# CONFIG_MODULE_FORCE_UNLOAD is not set
75# CONFIG_MODVERSIONS is not set
76# CONFIG_MODULE_SRCVERSION_ALL is not set
77CONFIG_KMOD=y
78
79#
80# Block layer
81#
82CONFIG_BLOCK=y
83# CONFIG_BLK_DEV_IO_TRACE is not set
84
85#
86# IO Schedulers
87#
88CONFIG_IOSCHED_NOOP=y
89CONFIG_IOSCHED_AS=y
90# CONFIG_IOSCHED_DEADLINE is not set
91CONFIG_IOSCHED_CFQ=y
92CONFIG_DEFAULT_AS=y
93# CONFIG_DEFAULT_DEADLINE is not set
94# CONFIG_DEFAULT_CFQ is not set
95# CONFIG_DEFAULT_NOOP is not set
96CONFIG_DEFAULT_IOSCHED="anticipatory"
97# CONFIG_PREEMPT_NONE is not set
98CONFIG_PREEMPT_VOLUNTARY=y
99# CONFIG_PREEMPT is not set
100
101#
102# Blackfin Processor Options
103#
104
105#
106# Processor and Board Settings
107#
108# CONFIG_BF531 is not set
109# CONFIG_BF532 is not set
110CONFIG_BF533=y
111# CONFIG_BF534 is not set
112# CONFIG_BF535 is not set
113# CONFIG_BF536 is not set
114# CONFIG_BF537 is not set
115# CONFIG_BF561 is not set
116# CONFIG_BF_REV_0_2 is not set
117CONFIG_BF_REV_0_3=y
118# CONFIG_BF_REV_0_4 is not set
119# CONFIG_BF_REV_0_5 is not set
120CONFIG_BFIN_SINGLE_CORE=y
121CONFIG_BFIN533_EZKIT=y
122# CONFIG_BFIN533_STAMP is not set
123# CONFIG_BFIN537_STAMP is not set
124# CONFIG_BFIN533_BLUETECHNIX_CM is not set
125# CONFIG_BFIN537_BLUETECHNIX_CM is not set
126# CONFIG_BFIN561_BLUETECHNIX_CM is not set
127# CONFIG_BFIN561_EZKIT is not set
128# CONFIG_PNAV10 is not set
129# CONFIG_GENERIC_BOARD is not set
130CONFIG_MEM_MT48LC16M16A2TG_75=y
131
132#
133# BF533/2/1 Specific Configuration
134#
135
136#
137# Interrupt Priority Assignment
138#
139
140#
141# Priority
142#
143CONFIG_UART_ERROR=7
144CONFIG_SPORT0_ERROR=7
145CONFIG_SPI_ERROR=7
146CONFIG_SPORT1_ERROR=7
147CONFIG_PPI_ERROR=7
148CONFIG_DMA_ERROR=7
149CONFIG_PLLWAKE_ERROR=7
150CONFIG_RTC_ERROR=8
151CONFIG_DMA0_PPI=8
152CONFIG_DMA1_SPORT0RX=9
153CONFIG_DMA2_SPORT0TX=9
154CONFIG_DMA3_SPORT1RX=9
155CONFIG_DMA4_SPORT1TX=9
156CONFIG_DMA5_SPI=10
157CONFIG_DMA6_UARTRX=10
158CONFIG_DMA7_UARTTX=10
159CONFIG_TIMER0=11
160CONFIG_TIMER1=11
161CONFIG_TIMER2=11
162CONFIG_PFA=12
163CONFIG_PFB=12
164CONFIG_MEMDMA0=13
165CONFIG_MEMDMA1=13
166CONFIG_WDTIMER=13
167
168#
169# Board customizations
170#
171
172#
173# Board Setup
174#
175CONFIG_CLKIN_HZ=27000000
176CONFIG_MEM_SIZE=32
177CONFIG_MEM_ADD_WIDTH=9
178CONFIG_BOOT_LOAD=0x1000
179
180#
181# Console UART Setup
182#
183# CONFIG_BAUD_9600 is not set
184# CONFIG_BAUD_19200 is not set
185# CONFIG_BAUD_38400 is not set
186CONFIG_BAUD_57600=y
187# CONFIG_BAUD_115200 is not set
188CONFIG_BAUD_NO_PARITY=y
189# CONFIG_BAUD_PARITY is not set
190CONFIG_BAUD_1_STOPBIT=y
191# CONFIG_BAUD_2_STOPBIT is not set
192
193#
194# Blackfin Kernel Optimizations
195#
196
197#
198# Timer Tick
199#
200# CONFIG_HZ_100 is not set
201CONFIG_HZ_250=y
202# CONFIG_HZ_1000 is not set
203CONFIG_HZ=250
204
205#
206# Memory Optimizations
207#
208CONFIG_I_ENTRY_L1=y
209CONFIG_EXCPT_IRQ_SYSC_L1=y
210CONFIG_DO_IRQ_L1=y
211CONFIG_CORE_TIMER_IRQ_L1=y
212CONFIG_IDLE_L1=y
213CONFIG_SCHEDULE_L1=y
214CONFIG_ARITHMETIC_OPS_L1=y
215CONFIG_ACCESS_OK_L1=y
216CONFIG_MEMSET_L1=y
217CONFIG_MEMCPY_L1=y
218CONFIG_SYS_BFIN_SPINLOCK_L1=y
219# CONFIG_IP_CHECKSUM_L1 is not set
220# CONFIG_SYSCALL_TAB_L1 is not set
221# CONFIG_CPLB_SWITCH_TAB_L1 is not set
222CONFIG_RAMKERNEL=y
223# CONFIG_ROMKERNEL is not set
224CONFIG_SELECT_MEMORY_MODEL=y
225CONFIG_FLATMEM_MANUAL=y
226# CONFIG_DISCONTIGMEM_MANUAL is not set
227# CONFIG_SPARSEMEM_MANUAL is not set
228CONFIG_FLATMEM=y
229CONFIG_FLAT_NODE_MEM_MAP=y
230# CONFIG_SPARSEMEM_STATIC is not set
231CONFIG_SPLIT_PTLOCK_CPUS=4
232# CONFIG_RESOURCES_64BIT is not set
233CONFIG_LARGE_ALLOCS=y
234CONFIG_BFIN_DMA_5XX=y
235# CONFIG_DMA_UNCACHED_2M is not set
236CONFIG_DMA_UNCACHED_1M=y
237# CONFIG_DMA_UNCACHED_NONE is not set
238
239#
240# Cache Support
241#
242CONFIG_BLKFIN_CACHE=y
243CONFIG_BLKFIN_DCACHE=y
244# CONFIG_BLKFIN_DCACHE_BANKA is not set
245# CONFIG_BLKFIN_CACHE_LOCK is not set
246# CONFIG_BLKFIN_WB is not set
247CONFIG_BLKFIN_WT=y
248CONFIG_L1_MAX_PIECE=16
249
250#
251# Clock Settings
252#
253# CONFIG_BFIN_KERNEL_CLOCK is not set
254
255#
256# Asynchonous Memory Configuration
257#
258
259#
260# EBIU_AMBCTL Global Control
261#
262CONFIG_C_AMCKEN=y
263CONFIG_C_CDPRIO=y
264# CONFIG_C_AMBEN is not set
265# CONFIG_C_AMBEN_B0 is not set
266# CONFIG_C_AMBEN_B0_B1 is not set
267# CONFIG_C_AMBEN_B0_B1_B2 is not set
268CONFIG_C_AMBEN_ALL=y
269
270#
271# EBIU_AMBCTL Control
272#
273CONFIG_BANK_0=0x7BB0
274CONFIG_BANK_1=0x7BB0
275CONFIG_BANK_2=0x7BB0
276CONFIG_BANK_3=0x99B3
277
278#
279# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
280#
281# CONFIG_PCI is not set
282
283#
284# PCCARD (PCMCIA/CardBus) support
285#
286# CONFIG_PCCARD is not set
287
288#
289# PCI Hotplug Support
290#
291
292#
293# Executable file formats
294#
295CONFIG_BINFMT_ELF_FDPIC=y
296CONFIG_BINFMT_FLAT=y
297CONFIG_BINFMT_ZFLAT=y
298# CONFIG_BINFMT_SHARED_FLAT is not set
299# CONFIG_BINFMT_MISC is not set
300
301#
302# Power management options
303#
304CONFIG_PM=y
305CONFIG_PM_LEGACY=y
306# CONFIG_PM_DEBUG is not set
307# CONFIG_PM_SYSFS_DEPRECATED is not set
308CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR=y
309# CONFIG_PM_WAKEUP_BY_GPIO is not set
310# CONFIG_PM_WAKEUP_GPIO_API is not set
311CONFIG_PM_WAKEUP_SIC_IWR=0x100000
312
313#
314# CPU Frequency scaling
315#
316# CONFIG_CPU_FREQ is not set
317
318#
319# Networking
320#
321CONFIG_NET=y
322
323#
324# Networking options
325#
326# CONFIG_NETDEBUG is not set
327CONFIG_PACKET=y
328# CONFIG_PACKET_MMAP is not set
329CONFIG_UNIX=y
330CONFIG_XFRM=y
331# CONFIG_XFRM_USER is not set
332# CONFIG_XFRM_SUB_POLICY is not set
333# CONFIG_NET_KEY is not set
334CONFIG_INET=y
335# CONFIG_IP_MULTICAST is not set
336# CONFIG_IP_ADVANCED_ROUTER is not set
337CONFIG_IP_FIB_HASH=y
338CONFIG_IP_PNP=y
339# CONFIG_IP_PNP_DHCP is not set
340# CONFIG_IP_PNP_BOOTP is not set
341# CONFIG_IP_PNP_RARP is not set
342# CONFIG_NET_IPIP is not set
343# CONFIG_NET_IPGRE is not set
344# CONFIG_ARPD is not set
345CONFIG_SYN_COOKIES=y
346# CONFIG_INET_AH is not set
347# CONFIG_INET_ESP is not set
348# CONFIG_INET_IPCOMP is not set
349# CONFIG_INET_XFRM_TUNNEL is not set
350# CONFIG_INET_TUNNEL is not set
351CONFIG_INET_XFRM_MODE_TRANSPORT=y
352CONFIG_INET_XFRM_MODE_TUNNEL=y
353CONFIG_INET_XFRM_MODE_BEET=y
354CONFIG_INET_DIAG=y
355CONFIG_INET_TCP_DIAG=y
356# CONFIG_TCP_CONG_ADVANCED is not set
357CONFIG_TCP_CONG_CUBIC=y
358CONFIG_DEFAULT_TCP_CONG="cubic"
359# CONFIG_IPV6 is not set
360# CONFIG_INET6_XFRM_TUNNEL is not set
361# CONFIG_INET6_TUNNEL is not set
362# CONFIG_NETLABEL is not set
363# CONFIG_NETWORK_SECMARK is not set
364# CONFIG_NETFILTER is not set
365
366#
367# DCCP Configuration (EXPERIMENTAL)
368#
369# CONFIG_IP_DCCP is not set
370
371#
372# SCTP Configuration (EXPERIMENTAL)
373#
374# CONFIG_IP_SCTP is not set
375
376#
377# TIPC Configuration (EXPERIMENTAL)
378#
379# CONFIG_TIPC is not set
380# CONFIG_ATM is not set
381# CONFIG_BRIDGE is not set
382# CONFIG_VLAN_8021Q is not set
383# CONFIG_DECNET is not set
384# CONFIG_LLC2 is not set
385# CONFIG_IPX is not set
386# CONFIG_ATALK is not set
387# CONFIG_X25 is not set
388# CONFIG_LAPB is not set
389# CONFIG_ECONET is not set
390# CONFIG_WAN_ROUTER is not set
391
392#
393# QoS and/or fair queueing
394#
395# CONFIG_NET_SCHED is not set
396
397#
398# Network testing
399#
400# CONFIG_NET_PKTGEN is not set
401# CONFIG_HAMRADIO is not set
402# CONFIG_IRDA is not set
403# CONFIG_BT is not set
404# CONFIG_IEEE80211 is not set
405
406#
407# Device Drivers
408#
409
410#
411# Generic Driver Options
412#
413CONFIG_STANDALONE=y
414CONFIG_PREVENT_FIRMWARE_BUILD=y
415# CONFIG_FW_LOADER is not set
416# CONFIG_SYS_HYPERVISOR is not set
417
418#
419# Connector - unified userspace <-> kernelspace linker
420#
421# CONFIG_CONNECTOR is not set
422
423#
424# Memory Technology Devices (MTD)
425#
426CONFIG_MTD=y
427# CONFIG_MTD_DEBUG is not set
428# CONFIG_MTD_CONCAT is not set
429CONFIG_MTD_PARTITIONS=y
430# CONFIG_MTD_REDBOOT_PARTS is not set
431# CONFIG_MTD_CMDLINE_PARTS is not set
432
433#
434# User Modules And Translation Layers
435#
436CONFIG_MTD_CHAR=m
437CONFIG_MTD_BLOCK=y
438# CONFIG_FTL is not set
439# CONFIG_NFTL is not set
440# CONFIG_INFTL is not set
441# CONFIG_RFD_FTL is not set
442# CONFIG_SSFDC is not set
443
444#
445# RAM/ROM/Flash chip drivers
446#
447# CONFIG_MTD_CFI is not set
448CONFIG_MTD_JEDECPROBE=m
449CONFIG_MTD_GEN_PROBE=m
450# CONFIG_MTD_CFI_ADV_OPTIONS is not set
451CONFIG_MTD_MAP_BANK_WIDTH_1=y
452CONFIG_MTD_MAP_BANK_WIDTH_2=y
453CONFIG_MTD_MAP_BANK_WIDTH_4=y
454# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
455# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
456# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
457CONFIG_MTD_CFI_I1=y
458CONFIG_MTD_CFI_I2=y
459# CONFIG_MTD_CFI_I4 is not set
460# CONFIG_MTD_CFI_I8 is not set
461# CONFIG_MTD_CFI_INTELEXT is not set
462# CONFIG_MTD_CFI_AMDSTD is not set
463# CONFIG_MTD_CFI_STAA is not set
464CONFIG_MTD_MW320D=m
465CONFIG_MTD_RAM=y
466CONFIG_MTD_ROM=m
467# CONFIG_MTD_ABSENT is not set
468# CONFIG_MTD_OBSOLETE_CHIPS is not set
469
470#
471# Mapping drivers for chip access
472#
473CONFIG_MTD_COMPLEX_MAPPINGS=y
474# CONFIG_MTD_PHYSMAP is not set
475CONFIG_MTD_BF5xx=m
476CONFIG_BFIN_FLASH_SIZE=0x400000
477CONFIG_EBIU_FLASH_BASE=0x20000000
478
479#
480# FLASH_EBIU_AMBCTL Control
481#
482CONFIG_BFIN_FLASH_BANK_0=0x7BB0
483CONFIG_BFIN_FLASH_BANK_1=0x7BB0
484CONFIG_BFIN_FLASH_BANK_2=0x7BB0
485CONFIG_BFIN_FLASH_BANK_3=0x7BB0
486# CONFIG_MTD_UCLINUX is not set
487# CONFIG_MTD_PLATRAM is not set
488
489#
490# Self-contained MTD device drivers
491#
492# CONFIG_MTD_SLRAM is not set
493# CONFIG_MTD_PHRAM is not set
494# CONFIG_MTD_MTDRAM is not set
495# CONFIG_MTD_BLOCK2MTD is not set
496
497#
498# Disk-On-Chip Device Drivers
499#
500# CONFIG_MTD_DOC2000 is not set
501# CONFIG_MTD_DOC2001 is not set
502# CONFIG_MTD_DOC2001PLUS is not set
503
504#
505# NAND Flash Device Drivers
506#
507# CONFIG_MTD_NAND is not set
508
509#
510# OneNAND Flash Device Drivers
511#
512# CONFIG_MTD_ONENAND is not set
513
514#
515# Parallel port support
516#
517# CONFIG_PARPORT is not set
518
519#
520# Plug and Play support
521#
522
523#
524# Block devices
525#
526# CONFIG_BLK_DEV_COW_COMMON is not set
527# CONFIG_BLK_DEV_LOOP is not set
528# CONFIG_BLK_DEV_NBD is not set
529CONFIG_BLK_DEV_RAM=y
530CONFIG_BLK_DEV_RAM_COUNT=16
531CONFIG_BLK_DEV_RAM_SIZE=4096
532CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
533# CONFIG_BLK_DEV_INITRD is not set
534# CONFIG_CDROM_PKTCDVD is not set
535# CONFIG_ATA_OVER_ETH is not set
536
537#
538# Misc devices
539#
540# CONFIG_TIFM_CORE is not set
541
542#
543# ATA/ATAPI/MFM/RLL support
544#
545# CONFIG_IDE is not set
546
547#
548# SCSI device support
549#
550# CONFIG_RAID_ATTRS is not set
551# CONFIG_SCSI is not set
552# CONFIG_SCSI_NETLINK is not set
553
554#
555# Serial ATA (prod) and Parallel ATA (experimental) drivers
556#
557# CONFIG_ATA is not set
558
559#
560# Multi-device support (RAID and LVM)
561#
562# CONFIG_MD is not set
563
564#
565# Fusion MPT device support
566#
567# CONFIG_FUSION is not set
568
569#
570# IEEE 1394 (FireWire) support
571#
572
573#
574# I2O device support
575#
576
577#
578# Network device support
579#
580CONFIG_NETDEVICES=y
581# CONFIG_DUMMY is not set
582# CONFIG_BONDING is not set
583# CONFIG_EQUALIZER is not set
584# CONFIG_TUN is not set
585
586#
587# PHY device support
588#
589# CONFIG_PHYLIB is not set
590
591#
592# Ethernet (10 or 100Mbit)
593#
594CONFIG_NET_ETHERNET=y
595CONFIG_MII=y
596CONFIG_SMC91X=y
597
598#
599# Ethernet (1000 Mbit)
600#
601
602#
603# Ethernet (10000 Mbit)
604#
605
606#
607# Token Ring devices
608#
609
610#
611# Wireless LAN (non-hamradio)
612#
613# CONFIG_NET_RADIO is not set
614
615#
616# Wan interfaces
617#
618# CONFIG_WAN is not set
619# CONFIG_PPP is not set
620# CONFIG_SLIP is not set
621# CONFIG_SHAPER is not set
622# CONFIG_NETCONSOLE is not set
623# CONFIG_NETPOLL is not set
624# CONFIG_NET_POLL_CONTROLLER is not set
625
626#
627# ISDN subsystem
628#
629# CONFIG_ISDN is not set
630
631#
632# Telephony Support
633#
634# CONFIG_PHONE is not set
635
636#
637# Input device support
638#
639# CONFIG_INPUT is not set
640
641#
642# Hardware I/O ports
643#
644# CONFIG_SERIO is not set
645# CONFIG_GAMEPORT is not set
646
647#
648# Character devices
649#
650# CONFIG_AD9960 is not set
651# CONFIG_SPI_ADC_BF533 is not set
652# CONFIG_BF533_PFLAGS is not set
653# CONFIG_BF5xx_PPIFCD is not set
654# CONFIG_BF5xx_TIMERS is not set
655# CONFIG_BF5xx_PPI is not set
656# CONFIG_BFIN_SPORT is not set
657# CONFIG_BFIN_TIMER_LATENCY is not set
658# CONFIG_VT is not set
659# CONFIG_SERIAL_NONSTANDARD is not set
660
661#
662# Serial drivers
663#
664# CONFIG_SERIAL_8250 is not set
665
666#
667# Non-8250 serial port support
668#
669CONFIG_SERIAL_BFIN=y
670CONFIG_SERIAL_BFIN_CONSOLE=y
671CONFIG_SERIAL_BFIN_DMA=y
672# CONFIG_SERIAL_BFIN_PIO is not set
673CONFIG_SERIAL_BFIN_UART0=y
674# CONFIG_BFIN_UART0_CTSRTS is not set
675CONFIG_SERIAL_CORE=y
676CONFIG_SERIAL_CORE_CONSOLE=y
677# CONFIG_SERIAL_BFIN_SPORT is not set
678CONFIG_UNIX98_PTYS=y
679# CONFIG_LEGACY_PTYS is not set
680
681#
682# CAN, the car bus and industrial fieldbus
683#
684# CONFIG_CAN4LINUX is not set
685
686#
687# IPMI
688#
689# CONFIG_IPMI_HANDLER is not set
690
691#
692# Watchdog Cards
693#
694# CONFIG_WATCHDOG is not set
695CONFIG_HW_RANDOM=y
696# CONFIG_GEN_RTC is not set
697CONFIG_BLACKFIN_DPMC=y
698# CONFIG_DTLK is not set
699# CONFIG_R3964 is not set
700
701#
702# Ftape, the floppy tape device driver
703#
704# CONFIG_RAW_DRIVER is not set
705
706#
707# TPM devices
708#
709# CONFIG_TCG_TPM is not set
710
711#
712# I2C support
713#
714# CONFIG_I2C is not set
715
716#
717# SPI support
718#
719# CONFIG_SPI is not set
720# CONFIG_SPI_MASTER is not set
721
722#
723# Dallas's 1-wire bus
724#
725# CONFIG_W1 is not set
726
727#
728# Hardware Monitoring support
729#
730CONFIG_HWMON=y
731# CONFIG_HWMON_VID is not set
732# CONFIG_SENSORS_ABITUGURU is not set
733# CONFIG_SENSORS_F71805F is not set
734# CONFIG_SENSORS_VT1211 is not set
735# CONFIG_HWMON_DEBUG_CHIP is not set
736
737#
738# Multimedia devices
739#
740# CONFIG_VIDEO_DEV is not set
741
742#
743# Digital Video Broadcasting Devices
744#
745# CONFIG_DVB is not set
746
747#
748# Graphics support
749#
750CONFIG_FIRMWARE_EDID=y
751# CONFIG_FB is not set
752# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
753
754#
755# Sound
756#
757# CONFIG_SOUND is not set
758
759#
760# USB support
761#
762CONFIG_USB_ARCH_HAS_HCD=y
763# CONFIG_USB_ARCH_HAS_OHCI is not set
764# CONFIG_USB_ARCH_HAS_EHCI is not set
765# CONFIG_USB is not set
766
767#
768# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
769#
770
771#
772# USB Gadget Support
773#
774# CONFIG_USB_GADGET is not set
775
776#
777# MMC/SD Card support
778#
779# CONFIG_MMC is not set
780
781#
782# LED devices
783#
784# CONFIG_NEW_LEDS is not set
785
786#
787# LED drivers
788#
789
790#
791# LED Triggers
792#
793
794#
795# InfiniBand support
796#
797
798#
799# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
800#
801
802#
803# Real Time Clock
804#
805CONFIG_RTC_LIB=y
806CONFIG_RTC_CLASS=y
807CONFIG_RTC_HCTOSYS=y
808CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
809# CONFIG_RTC_DEBUG is not set
810
811#
812# RTC interfaces
813#
814CONFIG_RTC_INTF_SYSFS=y
815CONFIG_RTC_INTF_PROC=y
816CONFIG_RTC_INTF_DEV=y
817# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
818
819#
820# RTC drivers
821#
822# CONFIG_RTC_DRV_DS1553 is not set
823# CONFIG_RTC_DRV_DS1742 is not set
824# CONFIG_RTC_DRV_M48T86 is not set
825# CONFIG_RTC_DRV_TEST is not set
826# CONFIG_RTC_DRV_V3020 is not set
827CONFIG_RTC_DRV_BFIN=y
828
829#
830# DMA Engine support
831#
832# CONFIG_DMA_ENGINE is not set
833
834#
835# DMA Clients
836#
837
838#
839# DMA Devices
840#
841
842#
843# PBX support
844#
845# CONFIG_PBX is not set
846
847#
848# File systems
849#
850CONFIG_EXT2_FS=y
851CONFIG_EXT2_FS_XATTR=y
852# CONFIG_EXT2_FS_POSIX_ACL is not set
853# CONFIG_EXT2_FS_SECURITY is not set
854# CONFIG_EXT3_FS is not set
855# CONFIG_EXT4DEV_FS is not set
856CONFIG_FS_MBCACHE=y
857# CONFIG_REISERFS_FS is not set
858# CONFIG_JFS_FS is not set
859# CONFIG_FS_POSIX_ACL is not set
860# CONFIG_XFS_FS is not set
861# CONFIG_GFS2_FS is not set
862# CONFIG_OCFS2_FS is not set
863# CONFIG_MINIX_FS is not set
864# CONFIG_ROMFS_FS is not set
865# CONFIG_INOTIFY is not set
866# CONFIG_QUOTA is not set
867# CONFIG_DNOTIFY is not set
868# CONFIG_AUTOFS_FS is not set
869# CONFIG_AUTOFS4_FS is not set
870# CONFIG_FUSE_FS is not set
871
872#
873# CD-ROM/DVD Filesystems
874#
875# CONFIG_ISO9660_FS is not set
876# CONFIG_UDF_FS is not set
877
878#
879# DOS/FAT/NT Filesystems
880#
881# CONFIG_MSDOS_FS is not set
882# CONFIG_VFAT_FS is not set
883# CONFIG_NTFS_FS is not set
884
885#
886# Pseudo filesystems
887#
888CONFIG_PROC_FS=y
889CONFIG_PROC_SYSCTL=y
890CONFIG_SYSFS=y
891# CONFIG_TMPFS is not set
892# CONFIG_HUGETLB_PAGE is not set
893CONFIG_RAMFS=y
894# CONFIG_CONFIGFS_FS is not set
895
896#
897# Miscellaneous filesystems
898#
899# CONFIG_ADFS_FS is not set
900# CONFIG_AFFS_FS is not set
901# CONFIG_HFS_FS is not set
902# CONFIG_HFSPLUS_FS is not set
903# CONFIG_BEFS_FS is not set
904# CONFIG_BFS_FS is not set
905# CONFIG_EFS_FS is not set
906CONFIG_YAFFS_FS=m
907CONFIG_YAFFS_YAFFS1=y
908# CONFIG_YAFFS_DOES_ECC is not set
909CONFIG_YAFFS_YAFFS2=y
910CONFIG_YAFFS_AUTO_YAFFS2=y
911# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
912CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
913# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
914# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
915CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
916# CONFIG_JFFS_FS is not set
917CONFIG_JFFS2_FS=m
918CONFIG_JFFS2_FS_DEBUG=0
919CONFIG_JFFS2_FS_WRITEBUFFER=y
920# CONFIG_JFFS2_SUMMARY is not set
921# CONFIG_JFFS2_FS_XATTR is not set
922# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
923CONFIG_JFFS2_ZLIB=y
924CONFIG_JFFS2_RTIME=y
925# CONFIG_JFFS2_RUBIN is not set
926# CONFIG_CRAMFS is not set
927# CONFIG_VXFS_FS is not set
928# CONFIG_HPFS_FS is not set
929# CONFIG_QNX4FS_FS is not set
930# CONFIG_SYSV_FS is not set
931# CONFIG_UFS_FS is not set
932
933#
934# Network File Systems
935#
936CONFIG_NFS_FS=m
937CONFIG_NFS_V3=y
938# CONFIG_NFS_V3_ACL is not set
939# CONFIG_NFS_V4 is not set
940# CONFIG_NFS_DIRECTIO is not set
941# CONFIG_NFSD is not set
942CONFIG_LOCKD=m
943CONFIG_LOCKD_V4=y
944CONFIG_NFS_COMMON=y
945CONFIG_SUNRPC=m
946# CONFIG_RPCSEC_GSS_KRB5 is not set
947# CONFIG_RPCSEC_GSS_SPKM3 is not set
948# CONFIG_SMB_FS is not set
949# CONFIG_CIFS is not set
950# CONFIG_NCP_FS is not set
951# CONFIG_CODA_FS is not set
952# CONFIG_AFS_FS is not set
953# CONFIG_9P_FS is not set
954
955#
956# Partition Types
957#
958# CONFIG_PARTITION_ADVANCED is not set
959CONFIG_MSDOS_PARTITION=y
960
961#
962# Native Language Support
963#
964# CONFIG_NLS is not set
965
966#
967# Profiling support
968#
969# CONFIG_PROFILING is not set
970
971#
972# Kernel hacking
973#
974# CONFIG_PRINTK_TIME is not set
975CONFIG_ENABLE_MUST_CHECK=y
976# CONFIG_MAGIC_SYSRQ is not set
977# CONFIG_UNUSED_SYMBOLS is not set
978# CONFIG_DEBUG_KERNEL is not set
979CONFIG_LOG_BUF_SHIFT=14
980# CONFIG_DEBUG_BUGVERBOSE is not set
981# CONFIG_DEBUG_FS is not set
982# CONFIG_UNWIND_INFO is not set
983# CONFIG_HEADERS_CHECK is not set
984# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set
985CONFIG_DEBUG_HUNT_FOR_ZERO=y
986# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
987# CONFIG_BOOTPARAM is not set
988# CONFIG_NO_KERNEL_MSG is not set
989CONFIG_CPLB_INFO=y
990# CONFIG_NO_ACCESS_CHECK is not set
991
992#
993# Security options
994#
995# CONFIG_KEYS is not set
996CONFIG_SECURITY=y
997# CONFIG_SECURITY_NETWORK is not set
998CONFIG_SECURITY_CAPABILITIES=y
999
1000#
1001# Cryptographic options
1002#
1003# CONFIG_CRYPTO is not set
1004
1005#
1006# Library routines
1007#
1008# CONFIG_CRC_CCITT is not set
1009# CONFIG_CRC16 is not set
1010CONFIG_CRC32=y
1011# CONFIG_LIBCRC32C is not set
1012CONFIG_ZLIB_INFLATE=y
1013CONFIG_ZLIB_DEFLATE=m
1014CONFIG_PLIST=y
diff --git a/arch/blackfin/configs/BF533-STAMP_defconfig b/arch/blackfin/configs/BF533-STAMP_defconfig
new file mode 100644
index 000000000000..14a948c288a5
--- /dev/null
+++ b/arch/blackfin/configs/BF533-STAMP_defconfig
@@ -0,0 +1,1296 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20.4
4#
5# CONFIG_MMU is not set
6# CONFIG_FPU is not set
7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y
10CONFIG_BFIN=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_IRQ_PROBE=y
16# CONFIG_GENERIC_TIME is not set
17CONFIG_GENERIC_CALIBRATE_DELAY=y
18CONFIG_FORCE_MAX_ZONEORDER=14
19CONFIG_IRQCHIP_DEMUX_GPIO=y
20CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
21
22#
23# Code maturity level options
24#
25CONFIG_EXPERIMENTAL=y
26CONFIG_BROKEN_ON_SMP=y
27CONFIG_INIT_ENV_ARG_LIMIT=32
28
29#
30# General setup
31#
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set
36# CONFIG_POSIX_MQUEUE is not set
37# CONFIG_BSD_PROCESS_ACCT is not set
38# CONFIG_TASKSTATS is not set
39# CONFIG_UTS_NS is not set
40# CONFIG_AUDIT is not set
41# CONFIG_IKCONFIG is not set
42CONFIG_SYSFS_DEPRECATED=y
43# CONFIG_RELAY is not set
44CONFIG_INITRAMFS_SOURCE=""
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y
47CONFIG_EMBEDDED=y
48CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y
50CONFIG_KALLSYMS=y
51# CONFIG_KALLSYMS_EXTRA_PASS is not set
52CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y
54CONFIG_BUG=y
55CONFIG_ELF_CORE=y
56CONFIG_BASE_FULL=y
57CONFIG_FUTEX=y
58CONFIG_EPOLL=y
59CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
60# CONFIG_LIMIT_PAGECACHE is not set
61CONFIG_BUDDY=y
62# CONFIG_NP2 is not set
63CONFIG_SLAB=y
64CONFIG_VM_EVENT_COUNTERS=y
65CONFIG_RT_MUTEXES=y
66CONFIG_TINY_SHMEM=y
67CONFIG_BASE_SMALL=0
68# CONFIG_SLOB is not set
69
70#
71# Loadable module support
72#
73CONFIG_MODULES=y
74CONFIG_MODULE_UNLOAD=y
75# CONFIG_MODULE_FORCE_UNLOAD is not set
76# CONFIG_MODVERSIONS is not set
77# CONFIG_MODULE_SRCVERSION_ALL is not set
78CONFIG_KMOD=y
79
80#
81# Block layer
82#
83CONFIG_BLOCK=y
84# CONFIG_LBD is not set
85# CONFIG_BLK_DEV_IO_TRACE is not set
86# CONFIG_LSF is not set
87
88#
89# IO Schedulers
90#
91CONFIG_IOSCHED_NOOP=y
92CONFIG_IOSCHED_AS=y
93# CONFIG_IOSCHED_DEADLINE is not set
94CONFIG_IOSCHED_CFQ=y
95CONFIG_DEFAULT_AS=y
96# CONFIG_DEFAULT_DEADLINE is not set
97# CONFIG_DEFAULT_CFQ is not set
98# CONFIG_DEFAULT_NOOP is not set
99CONFIG_DEFAULT_IOSCHED="anticipatory"
100# CONFIG_PREEMPT_NONE is not set
101CONFIG_PREEMPT_VOLUNTARY=y
102# CONFIG_PREEMPT is not set
103
104#
105# Blackfin Processor Options
106#
107
108#
109# Processor and Board Settings
110#
111# CONFIG_BF531 is not set
112# CONFIG_BF532 is not set
113CONFIG_BF533=y
114# CONFIG_BF534 is not set
115# CONFIG_BF536 is not set
116# CONFIG_BF537 is not set
117# CONFIG_BF561 is not set
118# CONFIG_BF_REV_0_2 is not set
119CONFIG_BF_REV_0_3=y
120# CONFIG_BF_REV_0_4 is not set
121# CONFIG_BF_REV_0_5 is not set
122CONFIG_BFIN_SINGLE_CORE=y
123# CONFIG_BFIN533_EZKIT is not set
124CONFIG_BFIN533_STAMP=y
125# CONFIG_BFIN537_STAMP is not set
126# CONFIG_BFIN533_BLUETECHNIX_CM is not set
127# CONFIG_BFIN537_BLUETECHNIX_CM is not set
128# CONFIG_BFIN561_BLUETECHNIX_CM is not set
129# CONFIG_BFIN561_EZKIT is not set
130# CONFIG_PNAV10 is not set
131# CONFIG_GENERIC_BOARD is not set
132CONFIG_MEM_MT48LC64M4A2FB_7E=y
133CONFIG_BFIN_SHARED_FLASH_ENET=y
134
135#
136# BF533/2/1 Specific Configuration
137#
138
139#
140# Interrupt Priority Assignment
141#
142
143#
144# Priority
145#
146CONFIG_UART_ERROR=7
147CONFIG_SPORT0_ERROR=7
148CONFIG_SPI_ERROR=7
149CONFIG_SPORT1_ERROR=7
150CONFIG_PPI_ERROR=7
151CONFIG_DMA_ERROR=7
152CONFIG_PLLWAKE_ERROR=7
153CONFIG_RTC_ERROR=8
154CONFIG_DMA0_PPI=8
155CONFIG_DMA1_SPORT0RX=9
156CONFIG_DMA2_SPORT0TX=9
157CONFIG_DMA3_SPORT1RX=9
158CONFIG_DMA4_SPORT1TX=9
159CONFIG_DMA5_SPI=10
160CONFIG_DMA6_UARTRX=10
161CONFIG_DMA7_UARTTX=10
162CONFIG_TIMER0=11
163CONFIG_TIMER1=11
164CONFIG_TIMER2=11
165CONFIG_PFA=12
166CONFIG_PFB=12
167CONFIG_MEMDMA0=13
168CONFIG_MEMDMA1=13
169CONFIG_WDTIMER=13
170
171#
172# Board customizations
173#
174# CONFIG_CMDLINE_BOOL is not set
175
176#
177# Board Setup
178#
179CONFIG_CLKIN_HZ=11059200
180CONFIG_MEM_SIZE=128
181CONFIG_MEM_ADD_WIDTH=11
182CONFIG_ENET_FLASH_PIN=0
183CONFIG_BOOT_LOAD=0x1000
184
185#
186# LED Status Indicators
187#
188# CONFIG_BFIN_ALIVE_LED is not set
189# CONFIG_BFIN_IDLE_LED is not set
190CONFIG_BFIN_ALIVE_LED_PORT=0xFFC00700
191CONFIG_BFIN_ALIVE_LED_DPORT=0xFFC00730
192CONFIG_BFIN_IDLE_LED_PORT=0xFFC00700
193CONFIG_BFIN_IDLE_LED_DPORT=0xFFC00730
194
195#
196# Console UART Setup
197#
198# CONFIG_BAUD_9600 is not set
199# CONFIG_BAUD_19200 is not set
200# CONFIG_BAUD_38400 is not set
201CONFIG_BAUD_57600=y
202# CONFIG_BAUD_115200 is not set
203CONFIG_BAUD_NO_PARITY=y
204# CONFIG_BAUD_PARITY is not set
205CONFIG_BAUD_1_STOPBIT=y
206# CONFIG_BAUD_2_STOPBIT is not set
207
208#
209# Blackfin Kernel Optimizations
210#
211
212#
213# Timer Tick
214#
215# CONFIG_HZ_100 is not set
216CONFIG_HZ_250=y
217# CONFIG_HZ_300 is not set
218# CONFIG_HZ_1000 is not set
219CONFIG_HZ=250
220
221#
222# Memory Optimizations
223#
224CONFIG_I_ENTRY_L1=y
225CONFIG_EXCPT_IRQ_SYSC_L1=y
226CONFIG_DO_IRQ_L1=y
227CONFIG_CORE_TIMER_IRQ_L1=y
228CONFIG_IDLE_L1=y
229CONFIG_SCHEDULE_L1=y
230CONFIG_ARITHMETIC_OPS_L1=y
231CONFIG_ACCESS_OK_L1=y
232CONFIG_MEMSET_L1=y
233CONFIG_MEMCPY_L1=y
234CONFIG_SYS_BFIN_SPINLOCK_L1=y
235# CONFIG_IP_CHECKSUM_L1 is not set
236# CONFIG_SYSCALL_TAB_L1 is not set
237# CONFIG_CPLB_SWITCH_TAB_L1 is not set
238CONFIG_RAMKERNEL=y
239# CONFIG_ROMKERNEL is not set
240CONFIG_SELECT_MEMORY_MODEL=y
241CONFIG_FLATMEM_MANUAL=y
242# CONFIG_DISCONTIGMEM_MANUAL is not set
243# CONFIG_SPARSEMEM_MANUAL is not set
244CONFIG_FLATMEM=y
245CONFIG_FLAT_NODE_MEM_MAP=y
246# CONFIG_SPARSEMEM_STATIC is not set
247CONFIG_SPLIT_PTLOCK_CPUS=4
248# CONFIG_RESOURCES_64BIT is not set
249CONFIG_LARGE_ALLOCS=y
250CONFIG_BFIN_DMA_5XX=y
251# CONFIG_DMA_UNCACHED_2M is not set
252CONFIG_DMA_UNCACHED_1M=y
253# CONFIG_DMA_UNCACHED_NONE is not set
254
255#
256# Cache Support
257#
258CONFIG_BLKFIN_CACHE=y
259CONFIG_BLKFIN_DCACHE=y
260# CONFIG_BLKFIN_DCACHE_BANKA is not set
261# CONFIG_BLKFIN_CACHE_LOCK is not set
262# CONFIG_BLKFIN_WB is not set
263CONFIG_BLKFIN_WT=y
264CONFIG_L1_MAX_PIECE=16
265
266#
267# Clock Settings
268#
269# CONFIG_BFIN_KERNEL_CLOCK is not set
270
271#
272# Asynchonous Memory Configuration
273#
274
275#
276# EBIU_AMBCTL Global Control
277#
278CONFIG_C_AMCKEN=y
279CONFIG_C_CDPRIO=y
280# CONFIG_C_AMBEN is not set
281# CONFIG_C_AMBEN_B0 is not set
282# CONFIG_C_AMBEN_B0_B1 is not set
283# CONFIG_C_AMBEN_B0_B1_B2 is not set
284CONFIG_C_AMBEN_ALL=y
285
286#
287# EBIU_AMBCTL Control
288#
289CONFIG_BANK_0=0x7BB0
290CONFIG_BANK_1=0x7BB0
291CONFIG_BANK_2=0x7BB0
292CONFIG_BANK_3=0x99B3
293
294#
295# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
296#
297# CONFIG_PCI is not set
298
299#
300# PCCARD (PCMCIA/CardBus) support
301#
302# CONFIG_PCCARD is not set
303
304#
305# PCI Hotplug Support
306#
307
308#
309# Executable file formats
310#
311CONFIG_BINFMT_ELF_FDPIC=y
312CONFIG_BINFMT_FLAT=y
313CONFIG_BINFMT_ZFLAT=y
314# CONFIG_BINFMT_SHARED_FLAT is not set
315# CONFIG_BINFMT_MISC is not set
316
317#
318# Power management options
319#
320CONFIG_PM=y
321CONFIG_PM_LEGACY=y
322# CONFIG_PM_DEBUG is not set
323# CONFIG_PM_SYSFS_DEPRECATED is not set
324CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR=y
325# CONFIG_PM_WAKEUP_BY_GPIO is not set
326# CONFIG_PM_WAKEUP_GPIO_API is not set
327CONFIG_PM_WAKEUP_SIC_IWR=0x100000
328
329#
330# CPU Frequency scaling
331#
332# CONFIG_CPU_FREQ is not set
333
334#
335# Networking
336#
337CONFIG_NET=y
338
339#
340# Networking options
341#
342# CONFIG_NETDEBUG is not set
343CONFIG_PACKET=y
344# CONFIG_PACKET_MMAP is not set
345CONFIG_UNIX=y
346CONFIG_XFRM=y
347# CONFIG_XFRM_USER is not set
348# CONFIG_XFRM_SUB_POLICY is not set
349# CONFIG_NET_KEY is not set
350CONFIG_INET=y
351# CONFIG_IP_MULTICAST is not set
352# CONFIG_IP_ADVANCED_ROUTER is not set
353CONFIG_IP_FIB_HASH=y
354CONFIG_IP_PNP=y
355# CONFIG_IP_PNP_DHCP is not set
356# CONFIG_IP_PNP_BOOTP is not set
357# CONFIG_IP_PNP_RARP is not set
358# CONFIG_NET_IPIP is not set
359# CONFIG_NET_IPGRE is not set
360# CONFIG_ARPD is not set
361CONFIG_SYN_COOKIES=y
362# CONFIG_INET_AH is not set
363# CONFIG_INET_ESP is not set
364# CONFIG_INET_IPCOMP is not set
365# CONFIG_INET_XFRM_TUNNEL is not set
366# CONFIG_INET_TUNNEL is not set
367CONFIG_INET_XFRM_MODE_TRANSPORT=y
368CONFIG_INET_XFRM_MODE_TUNNEL=y
369CONFIG_INET_XFRM_MODE_BEET=y
370CONFIG_INET_DIAG=y
371CONFIG_INET_TCP_DIAG=y
372# CONFIG_TCP_CONG_ADVANCED is not set
373CONFIG_TCP_CONG_CUBIC=y
374CONFIG_DEFAULT_TCP_CONG="cubic"
375# CONFIG_TCP_MD5SIG is not set
376# CONFIG_IPV6 is not set
377# CONFIG_INET6_XFRM_TUNNEL is not set
378# CONFIG_INET6_TUNNEL is not set
379# CONFIG_NETLABEL is not set
380# CONFIG_NETWORK_SECMARK is not set
381# CONFIG_NETFILTER is not set
382
383#
384# DCCP Configuration (EXPERIMENTAL)
385#
386# CONFIG_IP_DCCP is not set
387
388#
389# SCTP Configuration (EXPERIMENTAL)
390#
391# CONFIG_IP_SCTP is not set
392
393#
394# TIPC Configuration (EXPERIMENTAL)
395#
396# CONFIG_TIPC is not set
397# CONFIG_ATM is not set
398# CONFIG_BRIDGE is not set
399# CONFIG_VLAN_8021Q is not set
400# CONFIG_DECNET is not set
401# CONFIG_LLC2 is not set
402# CONFIG_IPX is not set
403# CONFIG_ATALK is not set
404# CONFIG_X25 is not set
405# CONFIG_LAPB is not set
406# CONFIG_ECONET is not set
407# CONFIG_WAN_ROUTER is not set
408
409#
410# QoS and/or fair queueing
411#
412# CONFIG_NET_SCHED is not set
413
414#
415# Network testing
416#
417# CONFIG_NET_PKTGEN is not set
418# CONFIG_HAMRADIO is not set
419CONFIG_IRDA=m
420
421#
422# IrDA protocols
423#
424CONFIG_IRLAN=m
425CONFIG_IRCOMM=m
426# CONFIG_IRDA_ULTRA is not set
427
428#
429# IrDA options
430#
431CONFIG_IRDA_CACHE_LAST_LSAP=y
432# CONFIG_IRDA_FAST_RR is not set
433# CONFIG_IRDA_DEBUG is not set
434
435#
436# Infrared-port device drivers
437#
438
439#
440# SIR device drivers
441#
442CONFIG_IRTTY_SIR=m
443
444#
445# Dongle support
446#
447# CONFIG_DONGLE is not set
448
449#
450# Old SIR device drivers
451#
452# CONFIG_IRPORT_SIR is not set
453
454#
455# Old Serial dongle support
456#
457
458#
459# FIR device drivers
460#
461# CONFIG_BT is not set
462# CONFIG_IEEE80211 is not set
463
464#
465# Device Drivers
466#
467
468#
469# Generic Driver Options
470#
471CONFIG_STANDALONE=y
472CONFIG_PREVENT_FIRMWARE_BUILD=y
473# CONFIG_FW_LOADER is not set
474# CONFIG_SYS_HYPERVISOR is not set
475
476#
477# Connector - unified userspace <-> kernelspace linker
478#
479# CONFIG_CONNECTOR is not set
480
481#
482# Memory Technology Devices (MTD)
483#
484CONFIG_MTD=y
485# CONFIG_MTD_DEBUG is not set
486# CONFIG_MTD_CONCAT is not set
487CONFIG_MTD_PARTITIONS=y
488# CONFIG_MTD_REDBOOT_PARTS is not set
489# CONFIG_MTD_CMDLINE_PARTS is not set
490
491#
492# User Modules And Translation Layers
493#
494CONFIG_MTD_CHAR=m
495CONFIG_MTD_BLKDEVS=y
496CONFIG_MTD_BLOCK=y
497# CONFIG_FTL is not set
498# CONFIG_NFTL is not set
499# CONFIG_INFTL is not set
500# CONFIG_RFD_FTL is not set
501# CONFIG_SSFDC is not set
502
503#
504# RAM/ROM/Flash chip drivers
505#
506# CONFIG_MTD_CFI is not set
507CONFIG_MTD_JEDECPROBE=m
508CONFIG_MTD_GEN_PROBE=m
509# CONFIG_MTD_CFI_ADV_OPTIONS is not set
510CONFIG_MTD_MAP_BANK_WIDTH_1=y
511CONFIG_MTD_MAP_BANK_WIDTH_2=y
512CONFIG_MTD_MAP_BANK_WIDTH_4=y
513# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
514# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
515# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
516CONFIG_MTD_CFI_I1=y
517CONFIG_MTD_CFI_I2=y
518# CONFIG_MTD_CFI_I4 is not set
519# CONFIG_MTD_CFI_I8 is not set
520# CONFIG_MTD_CFI_INTELEXT is not set
521# CONFIG_MTD_CFI_AMDSTD is not set
522# CONFIG_MTD_CFI_STAA is not set
523CONFIG_MTD_MW320D=m
524CONFIG_MTD_RAM=y
525CONFIG_MTD_ROM=m
526# CONFIG_MTD_ABSENT is not set
527# CONFIG_MTD_OBSOLETE_CHIPS is not set
528
529#
530# Mapping drivers for chip access
531#
532CONFIG_MTD_COMPLEX_MAPPINGS=y
533# CONFIG_MTD_PHYSMAP is not set
534CONFIG_MTD_BF5xx=m
535CONFIG_BFIN_FLASH_SIZE=0x400000
536CONFIG_EBIU_FLASH_BASE=0x20000000
537
538#
539# FLASH_EBIU_AMBCTL Control
540#
541CONFIG_BFIN_FLASH_BANK_0=0x7BB0
542CONFIG_BFIN_FLASH_BANK_1=0x7BB0
543CONFIG_BFIN_FLASH_BANK_2=0x7BB0
544CONFIG_BFIN_FLASH_BANK_3=0x7BB0
545# CONFIG_MTD_UCLINUX is not set
546# CONFIG_MTD_PLATRAM is not set
547
548#
549# Self-contained MTD device drivers
550#
551# CONFIG_MTD_DATAFLASH is not set
552# CONFIG_MTD_M25P80 is not set
553# CONFIG_MTD_SLRAM is not set
554# CONFIG_MTD_PHRAM is not set
555# CONFIG_MTD_MTDRAM is not set
556# CONFIG_MTD_BLOCK2MTD is not set
557
558#
559# Disk-On-Chip Device Drivers
560#
561# CONFIG_MTD_DOC2000 is not set
562# CONFIG_MTD_DOC2001 is not set
563# CONFIG_MTD_DOC2001PLUS is not set
564
565#
566# NAND Flash Device Drivers
567#
568# CONFIG_MTD_NAND is not set
569
570#
571# OneNAND Flash Device Drivers
572#
573# CONFIG_MTD_ONENAND is not set
574
575#
576# Parallel port support
577#
578# CONFIG_PARPORT is not set
579
580#
581# Plug and Play support
582#
583
584#
585# Block devices
586#
587# CONFIG_BLK_DEV_COW_COMMON is not set
588# CONFIG_BLK_DEV_LOOP is not set
589# CONFIG_BLK_DEV_NBD is not set
590CONFIG_BLK_DEV_RAM=y
591CONFIG_BLK_DEV_RAM_COUNT=16
592CONFIG_BLK_DEV_RAM_SIZE=4096
593CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
594# CONFIG_BLK_DEV_INITRD is not set
595# CONFIG_CDROM_PKTCDVD is not set
596# CONFIG_ATA_OVER_ETH is not set
597
598#
599# Misc devices
600#
601# CONFIG_TIFM_CORE is not set
602
603#
604# ATA/ATAPI/MFM/RLL support
605#
606# CONFIG_IDE is not set
607
608#
609# SCSI device support
610#
611# CONFIG_RAID_ATTRS is not set
612# CONFIG_SCSI is not set
613# CONFIG_SCSI_NETLINK is not set
614
615#
616# Serial ATA (prod) and Parallel ATA (experimental) drivers
617#
618# CONFIG_ATA is not set
619
620#
621# Multi-device support (RAID and LVM)
622#
623# CONFIG_MD is not set
624
625#
626# Fusion MPT device support
627#
628# CONFIG_FUSION is not set
629
630#
631# IEEE 1394 (FireWire) support
632#
633
634#
635# I2O device support
636#
637
638#
639# Network device support
640#
641CONFIG_NETDEVICES=y
642# CONFIG_DUMMY is not set
643# CONFIG_BONDING is not set
644# CONFIG_EQUALIZER is not set
645# CONFIG_TUN is not set
646
647#
648# PHY device support
649#
650# CONFIG_PHYLIB is not set
651
652#
653# Ethernet (10 or 100Mbit)
654#
655CONFIG_NET_ETHERNET=y
656CONFIG_MII=y
657CONFIG_SMC91X=y
658
659#
660# Ethernet (1000 Mbit)
661#
662
663#
664# Ethernet (10000 Mbit)
665#
666
667#
668# Token Ring devices
669#
670
671#
672# Wireless LAN (non-hamradio)
673#
674# CONFIG_NET_RADIO is not set
675
676#
677# Wan interfaces
678#
679# CONFIG_WAN is not set
680# CONFIG_PPP is not set
681# CONFIG_SLIP is not set
682# CONFIG_SHAPER is not set
683# CONFIG_NETCONSOLE is not set
684# CONFIG_NETPOLL is not set
685# CONFIG_NET_POLL_CONTROLLER is not set
686
687#
688# ISDN subsystem
689#
690# CONFIG_ISDN is not set
691
692#
693# Telephony Support
694#
695# CONFIG_PHONE is not set
696
697#
698# Input device support
699#
700CONFIG_INPUT=y
701# CONFIG_INPUT_FF_MEMLESS is not set
702
703#
704# Userland interfaces
705#
706# CONFIG_INPUT_MOUSEDEV is not set
707# CONFIG_INPUT_JOYDEV is not set
708# CONFIG_INPUT_TSDEV is not set
709CONFIG_INPUT_EVDEV=m
710# CONFIG_INPUT_EVBUG is not set
711
712#
713# Input Device Drivers
714#
715# CONFIG_INPUT_KEYBOARD is not set
716# CONFIG_INPUT_MOUSE is not set
717# CONFIG_INPUT_JOYSTICK is not set
718# CONFIG_INPUT_TOUCHSCREEN is not set
719CONFIG_INPUT_MISC=y
720# CONFIG_INPUT_UINPUT is not set
721# CONFIG_BF53X_PFBUTTONS is not set
722CONFIG_TWI_KEYPAD=m
723CONFIG_BFIN_TWIKEYPAD_IRQ_PFX=39
724
725#
726# Hardware I/O ports
727#
728# CONFIG_SERIO is not set
729# CONFIG_GAMEPORT is not set
730
731#
732# Character devices
733#
734# CONFIG_AD9960 is not set
735# CONFIG_SPI_ADC_BF533 is not set
736# CONFIG_BF533_PFLAGS is not set
737# CONFIG_BF5xx_PPIFCD is not set
738# CONFIG_BF5xx_TIMERS is not set
739# CONFIG_BF5xx_PPI is not set
740CONFIG_BFIN_SPORT=y
741# CONFIG_BFIN_TIMER_LATENCY is not set
742CONFIG_TWI_LCD=m
743CONFIG_TWI_LCD_SLAVE_ADDR=34
744# CONFIG_AD5304 is not set
745# CONFIG_VT is not set
746# CONFIG_SERIAL_NONSTANDARD is not set
747
748#
749# Serial drivers
750#
751# CONFIG_SERIAL_8250 is not set
752
753#
754# Non-8250 serial port support
755#
756CONFIG_SERIAL_BFIN=y
757CONFIG_SERIAL_BFIN_CONSOLE=y
758CONFIG_SERIAL_BFIN_DMA=y
759# CONFIG_SERIAL_BFIN_PIO is not set
760CONFIG_SERIAL_BFIN_UART0=y
761# CONFIG_BFIN_UART0_CTSRTS is not set
762CONFIG_SERIAL_CORE=y
763CONFIG_SERIAL_CORE_CONSOLE=y
764# CONFIG_SERIAL_BFIN_SPORT is not set
765CONFIG_UNIX98_PTYS=y
766# CONFIG_LEGACY_PTYS is not set
767
768#
769# CAN, the car bus and industrial fieldbus
770#
771# CONFIG_CAN4LINUX is not set
772
773#
774# IPMI
775#
776# CONFIG_IPMI_HANDLER is not set
777
778#
779# Watchdog Cards
780#
781# CONFIG_WATCHDOG is not set
782CONFIG_HW_RANDOM=y
783# CONFIG_GEN_RTC is not set
784CONFIG_BLACKFIN_DPMC=y
785# CONFIG_DTLK is not set
786# CONFIG_R3964 is not set
787# CONFIG_RAW_DRIVER is not set
788
789#
790# TPM devices
791#
792# CONFIG_TCG_TPM is not set
793
794#
795# I2C support
796#
797CONFIG_I2C=m
798CONFIG_I2C_CHARDEV=m
799
800#
801# I2C Algorithms
802#
803CONFIG_I2C_ALGOBIT=m
804# CONFIG_I2C_ALGOPCF is not set
805# CONFIG_I2C_ALGOPCA is not set
806
807#
808# I2C Hardware Bus support
809#
810# CONFIG_I2C_BLACKFIN_GPIO is not set
811# CONFIG_I2C_OCORES is not set
812# CONFIG_I2C_PARPORT_LIGHT is not set
813# CONFIG_I2C_STUB is not set
814# CONFIG_I2C_PCA_ISA is not set
815
816#
817# Miscellaneous I2C Chip support
818#
819# CONFIG_SENSORS_DS1337 is not set
820# CONFIG_SENSORS_DS1374 is not set
821# CONFIG_SENSORS_AD5252 is not set
822# CONFIG_SENSORS_EEPROM is not set
823# CONFIG_SENSORS_PCF8574 is not set
824# CONFIG_SENSORS_PCF8575 is not set
825# CONFIG_SENSORS_PCA9543 is not set
826# CONFIG_SENSORS_PCA9539 is not set
827# CONFIG_SENSORS_PCF8591 is not set
828# CONFIG_SENSORS_MAX6875 is not set
829# CONFIG_I2C_DEBUG_CORE is not set
830# CONFIG_I2C_DEBUG_ALGO is not set
831# CONFIG_I2C_DEBUG_BUS is not set
832# CONFIG_I2C_DEBUG_CHIP is not set
833
834#
835# SPI support
836#
837CONFIG_SPI=y
838CONFIG_SPI_MASTER=y
839
840#
841# SPI Master Controller Drivers
842#
843# CONFIG_SPI_BITBANG is not set
844
845#
846# SPI Protocol Masters
847#
848CONFIG_SPI_BFIN=y
849
850#
851# Dallas's 1-wire bus
852#
853# CONFIG_W1 is not set
854
855#
856# Hardware Monitoring support
857#
858CONFIG_HWMON=y
859# CONFIG_HWMON_VID is not set
860# CONFIG_SENSORS_ABITUGURU is not set
861# CONFIG_SENSORS_ADM1021 is not set
862# CONFIG_SENSORS_ADM1025 is not set
863# CONFIG_SENSORS_ADM1026 is not set
864# CONFIG_SENSORS_ADM1031 is not set
865# CONFIG_SENSORS_ADM9240 is not set
866# CONFIG_SENSORS_ASB100 is not set
867# CONFIG_SENSORS_ATXP1 is not set
868# CONFIG_SENSORS_DS1621 is not set
869# CONFIG_SENSORS_F71805F is not set
870# CONFIG_SENSORS_FSCHER is not set
871# CONFIG_SENSORS_FSCPOS is not set
872# CONFIG_SENSORS_GL518SM is not set
873# CONFIG_SENSORS_GL520SM is not set
874# CONFIG_SENSORS_IT87 is not set
875# CONFIG_SENSORS_LM63 is not set
876# CONFIG_SENSORS_LM70 is not set
877# CONFIG_SENSORS_LM75 is not set
878# CONFIG_SENSORS_LM77 is not set
879# CONFIG_SENSORS_LM78 is not set
880# CONFIG_SENSORS_LM80 is not set
881# CONFIG_SENSORS_LM83 is not set
882# CONFIG_SENSORS_LM85 is not set
883# CONFIG_SENSORS_LM87 is not set
884# CONFIG_SENSORS_LM90 is not set
885# CONFIG_SENSORS_LM92 is not set
886# CONFIG_SENSORS_MAX1619 is not set
887# CONFIG_SENSORS_PC87360 is not set
888# CONFIG_SENSORS_PC87427 is not set
889# CONFIG_SENSORS_SMSC47M1 is not set
890# CONFIG_SENSORS_SMSC47M192 is not set
891# CONFIG_SENSORS_SMSC47B397 is not set
892# CONFIG_SENSORS_VT1211 is not set
893# CONFIG_SENSORS_W83781D is not set
894# CONFIG_SENSORS_W83791D is not set
895# CONFIG_SENSORS_W83792D is not set
896# CONFIG_SENSORS_W83793 is not set
897# CONFIG_SENSORS_W83L785TS is not set
898# CONFIG_SENSORS_W83627HF is not set
899# CONFIG_SENSORS_W83627EHF is not set
900# CONFIG_HWMON_DEBUG_CHIP is not set
901
902#
903# Multimedia devices
904#
905# CONFIG_VIDEO_DEV is not set
906
907#
908# Digital Video Broadcasting Devices
909#
910# CONFIG_DVB is not set
911
912#
913# Graphics support
914#
915CONFIG_FIRMWARE_EDID=y
916CONFIG_FB=m
917CONFIG_FB_CFB_FILLRECT=m
918CONFIG_FB_CFB_COPYAREA=m
919CONFIG_FB_CFB_IMAGEBLIT=m
920# CONFIG_FB_MACMODES is not set
921# CONFIG_FB_BACKLIGHT is not set
922# CONFIG_FB_MODE_HELPERS is not set
923# CONFIG_FB_TILEBLITTING is not set
924CONFIG_FB_BFIN_7171=m
925CONFIG_FB_BFIN_7393=m
926CONFIG_NTSC=y
927# CONFIG_PAL is not set
928# CONFIG_NTSC_640x480 is not set
929# CONFIG_PAL_640x480 is not set
930# CONFIG_NTSC_YCBCR is not set
931# CONFIG_PAL_YCBCR is not set
932CONFIG_ADV7393_1XMEM=y
933# CONFIG_ADV7393_2XMEM is not set
934# CONFIG_FB_S1D13XXX is not set
935# CONFIG_FB_VIRTUAL is not set
936
937#
938# Logo configuration
939#
940# CONFIG_LOGO is not set
941# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
942
943#
944# Sound
945#
946CONFIG_SOUND=m
947
948#
949# Advanced Linux Sound Architecture
950#
951CONFIG_SND=m
952CONFIG_SND_TIMER=m
953CONFIG_SND_PCM=m
954# CONFIG_SND_SEQUENCER is not set
955CONFIG_SND_OSSEMUL=y
956CONFIG_SND_MIXER_OSS=m
957CONFIG_SND_PCM_OSS=m
958CONFIG_SND_PCM_OSS_PLUGINS=y
959# CONFIG_SND_DYNAMIC_MINORS is not set
960CONFIG_SND_SUPPORT_OLD_API=y
961CONFIG_SND_VERBOSE_PROCFS=y
962# CONFIG_SND_VERBOSE_PRINTK is not set
963# CONFIG_SND_DEBUG is not set
964
965#
966# Generic devices
967#
968# CONFIG_SND_DUMMY is not set
969# CONFIG_SND_MTPAV is not set
970# CONFIG_SND_SERIAL_U16550 is not set
971# CONFIG_SND_MPU401 is not set
972
973#
974# Open Sound System
975#
976# CONFIG_SOUND_PRIME is not set
977
978#
979# HID Devices
980#
981CONFIG_HID=y
982
983#
984# USB support
985#
986CONFIG_USB_ARCH_HAS_HCD=y
987# CONFIG_USB_ARCH_HAS_OHCI is not set
988# CONFIG_USB_ARCH_HAS_EHCI is not set
989# CONFIG_USB is not set
990
991#
992# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
993#
994
995#
996# USB Gadget Support
997#
998# CONFIG_USB_GADGET is not set
999
1000#
1001# MMC/SD Card support
1002#
1003# CONFIG_SPI_MMC is not set
1004# CONFIG_MMC is not set
1005
1006#
1007# LED devices
1008#
1009# CONFIG_NEW_LEDS is not set
1010
1011#
1012# LED drivers
1013#
1014
1015#
1016# LED Triggers
1017#
1018
1019#
1020# InfiniBand support
1021#
1022
1023#
1024# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1025#
1026
1027#
1028# Real Time Clock
1029#
1030CONFIG_RTC_LIB=y
1031CONFIG_RTC_CLASS=y
1032CONFIG_RTC_HCTOSYS=y
1033CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1034# CONFIG_RTC_DEBUG is not set
1035
1036#
1037# RTC interfaces
1038#
1039CONFIG_RTC_INTF_SYSFS=y
1040CONFIG_RTC_INTF_PROC=y
1041CONFIG_RTC_INTF_DEV=y
1042# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1043
1044#
1045# RTC drivers
1046#
1047# CONFIG_RTC_DRV_X1205 is not set
1048# CONFIG_RTC_DRV_DS1307 is not set
1049# CONFIG_RTC_DRV_DS1553 is not set
1050# CONFIG_RTC_DRV_ISL1208 is not set
1051# CONFIG_RTC_DRV_DS1672 is not set
1052# CONFIG_RTC_DRV_DS1742 is not set
1053# CONFIG_RTC_DRV_PCF8563 is not set
1054# CONFIG_RTC_DRV_PCF8583 is not set
1055# CONFIG_RTC_DRV_RS5C348 is not set
1056# CONFIG_RTC_DRV_RS5C372 is not set
1057# CONFIG_RTC_DRV_M48T86 is not set
1058# CONFIG_RTC_DRV_TEST is not set
1059# CONFIG_RTC_DRV_MAX6902 is not set
1060# CONFIG_RTC_DRV_V3020 is not set
1061CONFIG_RTC_DRV_BFIN=y
1062
1063#
1064# DMA Engine support
1065#
1066# CONFIG_DMA_ENGINE is not set
1067
1068#
1069# DMA Clients
1070#
1071
1072#
1073# DMA Devices
1074#
1075
1076#
1077# Virtualization
1078#
1079
1080#
1081# PBX support
1082#
1083# CONFIG_PBX is not set
1084
1085#
1086# File systems
1087#
1088CONFIG_EXT2_FS=y
1089CONFIG_EXT2_FS_XATTR=y
1090# CONFIG_EXT2_FS_POSIX_ACL is not set
1091# CONFIG_EXT2_FS_SECURITY is not set
1092# CONFIG_EXT3_FS is not set
1093# CONFIG_EXT4DEV_FS is not set
1094CONFIG_FS_MBCACHE=y
1095# CONFIG_REISERFS_FS is not set
1096# CONFIG_JFS_FS is not set
1097# CONFIG_FS_POSIX_ACL is not set
1098# CONFIG_XFS_FS is not set
1099# CONFIG_GFS2_FS is not set
1100# CONFIG_OCFS2_FS is not set
1101# CONFIG_MINIX_FS is not set
1102# CONFIG_ROMFS_FS is not set
1103CONFIG_INOTIFY=y
1104CONFIG_INOTIFY_USER=y
1105# CONFIG_QUOTA is not set
1106CONFIG_DNOTIFY=y
1107# CONFIG_AUTOFS_FS is not set
1108# CONFIG_AUTOFS4_FS is not set
1109# CONFIG_FUSE_FS is not set
1110
1111#
1112# CD-ROM/DVD Filesystems
1113#
1114# CONFIG_ISO9660_FS is not set
1115# CONFIG_UDF_FS is not set
1116
1117#
1118# DOS/FAT/NT Filesystems
1119#
1120# CONFIG_MSDOS_FS is not set
1121# CONFIG_VFAT_FS is not set
1122# CONFIG_NTFS_FS is not set
1123
1124#
1125# Pseudo filesystems
1126#
1127CONFIG_PROC_FS=y
1128CONFIG_PROC_SYSCTL=y
1129CONFIG_SYSFS=y
1130# CONFIG_TMPFS is not set
1131# CONFIG_HUGETLB_PAGE is not set
1132CONFIG_RAMFS=y
1133# CONFIG_CONFIGFS_FS is not set
1134
1135#
1136# Miscellaneous filesystems
1137#
1138# CONFIG_ADFS_FS is not set
1139# CONFIG_AFFS_FS is not set
1140# CONFIG_HFS_FS is not set
1141# CONFIG_HFSPLUS_FS is not set
1142# CONFIG_BEFS_FS is not set
1143# CONFIG_BFS_FS is not set
1144# CONFIG_EFS_FS is not set
1145CONFIG_YAFFS_FS=m
1146CONFIG_YAFFS_YAFFS1=y
1147# CONFIG_YAFFS_DOES_ECC is not set
1148CONFIG_YAFFS_YAFFS2=y
1149CONFIG_YAFFS_AUTO_YAFFS2=y
1150# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1151CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
1152# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1153# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1154CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1155CONFIG_JFFS2_FS=m
1156CONFIG_JFFS2_FS_DEBUG=0
1157CONFIG_JFFS2_FS_WRITEBUFFER=y
1158# CONFIG_JFFS2_SUMMARY is not set
1159# CONFIG_JFFS2_FS_XATTR is not set
1160# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1161CONFIG_JFFS2_ZLIB=y
1162CONFIG_JFFS2_RTIME=y
1163# CONFIG_JFFS2_RUBIN is not set
1164# CONFIG_CRAMFS is not set
1165# CONFIG_VXFS_FS is not set
1166# CONFIG_HPFS_FS is not set
1167# CONFIG_QNX4FS_FS is not set
1168# CONFIG_SYSV_FS is not set
1169# CONFIG_UFS_FS is not set
1170
1171#
1172# Network File Systems
1173#
1174CONFIG_NFS_FS=m
1175CONFIG_NFS_V3=y
1176# CONFIG_NFS_V3_ACL is not set
1177# CONFIG_NFS_V4 is not set
1178# CONFIG_NFS_DIRECTIO is not set
1179# CONFIG_NFSD is not set
1180CONFIG_LOCKD=m
1181CONFIG_LOCKD_V4=y
1182CONFIG_NFS_COMMON=y
1183CONFIG_SUNRPC=m
1184# CONFIG_RPCSEC_GSS_KRB5 is not set
1185# CONFIG_RPCSEC_GSS_SPKM3 is not set
1186CONFIG_SMB_FS=m
1187# CONFIG_SMB_NLS_DEFAULT is not set
1188# CONFIG_CIFS is not set
1189# CONFIG_NCP_FS is not set
1190# CONFIG_CODA_FS is not set
1191# CONFIG_AFS_FS is not set
1192# CONFIG_9P_FS is not set
1193
1194#
1195# Partition Types
1196#
1197# CONFIG_PARTITION_ADVANCED is not set
1198CONFIG_MSDOS_PARTITION=y
1199
1200#
1201# Native Language Support
1202#
1203CONFIG_NLS=m
1204CONFIG_NLS_DEFAULT="iso8859-1"
1205# CONFIG_NLS_CODEPAGE_437 is not set
1206# CONFIG_NLS_CODEPAGE_737 is not set
1207# CONFIG_NLS_CODEPAGE_775 is not set
1208# CONFIG_NLS_CODEPAGE_850 is not set
1209# CONFIG_NLS_CODEPAGE_852 is not set
1210# CONFIG_NLS_CODEPAGE_855 is not set
1211# CONFIG_NLS_CODEPAGE_857 is not set
1212# CONFIG_NLS_CODEPAGE_860 is not set
1213# CONFIG_NLS_CODEPAGE_861 is not set
1214# CONFIG_NLS_CODEPAGE_862 is not set
1215# CONFIG_NLS_CODEPAGE_863 is not set
1216# CONFIG_NLS_CODEPAGE_864 is not set
1217# CONFIG_NLS_CODEPAGE_865 is not set
1218# CONFIG_NLS_CODEPAGE_866 is not set
1219# CONFIG_NLS_CODEPAGE_869 is not set
1220# CONFIG_NLS_CODEPAGE_936 is not set
1221# CONFIG_NLS_CODEPAGE_950 is not set
1222# CONFIG_NLS_CODEPAGE_932 is not set
1223# CONFIG_NLS_CODEPAGE_949 is not set
1224# CONFIG_NLS_CODEPAGE_874 is not set
1225# CONFIG_NLS_ISO8859_8 is not set
1226# CONFIG_NLS_CODEPAGE_1250 is not set
1227# CONFIG_NLS_CODEPAGE_1251 is not set
1228# CONFIG_NLS_ASCII is not set
1229# CONFIG_NLS_ISO8859_1 is not set
1230# CONFIG_NLS_ISO8859_2 is not set
1231# CONFIG_NLS_ISO8859_3 is not set
1232# CONFIG_NLS_ISO8859_4 is not set
1233# CONFIG_NLS_ISO8859_5 is not set
1234# CONFIG_NLS_ISO8859_6 is not set
1235# CONFIG_NLS_ISO8859_7 is not set
1236# CONFIG_NLS_ISO8859_9 is not set
1237# CONFIG_NLS_ISO8859_13 is not set
1238# CONFIG_NLS_ISO8859_14 is not set
1239# CONFIG_NLS_ISO8859_15 is not set
1240# CONFIG_NLS_KOI8_R is not set
1241# CONFIG_NLS_KOI8_U is not set
1242# CONFIG_NLS_UTF8 is not set
1243
1244#
1245# Distributed Lock Manager
1246#
1247# CONFIG_DLM is not set
1248
1249#
1250# Profiling support
1251#
1252# CONFIG_PROFILING is not set
1253
1254#
1255# Kernel hacking
1256#
1257# CONFIG_PRINTK_TIME is not set
1258CONFIG_ENABLE_MUST_CHECK=y
1259# CONFIG_MAGIC_SYSRQ is not set
1260# CONFIG_UNUSED_SYMBOLS is not set
1261# CONFIG_DEBUG_FS is not set
1262# CONFIG_HEADERS_CHECK is not set
1263# CONFIG_DEBUG_KERNEL is not set
1264CONFIG_LOG_BUF_SHIFT=14
1265# CONFIG_DEBUG_BUGVERBOSE is not set
1266# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set
1267CONFIG_DEBUG_HUNT_FOR_ZERO=y
1268# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1269CONFIG_CPLB_INFO=y
1270CONFIG_ACCESS_CHECK=y
1271
1272#
1273# Security options
1274#
1275# CONFIG_KEYS is not set
1276CONFIG_SECURITY=y
1277# CONFIG_SECURITY_NETWORK is not set
1278CONFIG_SECURITY_CAPABILITIES=y
1279
1280#
1281# Cryptographic options
1282#
1283# CONFIG_CRYPTO is not set
1284
1285#
1286# Library routines
1287#
1288CONFIG_BITREVERSE=y
1289CONFIG_CRC_CCITT=m
1290# CONFIG_CRC16 is not set
1291CONFIG_CRC32=y
1292# CONFIG_LIBCRC32C is not set
1293CONFIG_ZLIB_INFLATE=y
1294CONFIG_ZLIB_DEFLATE=m
1295CONFIG_PLIST=y
1296CONFIG_IOMAP_COPY=y
diff --git a/arch/blackfin/configs/BF537-STAMP_defconfig b/arch/blackfin/configs/BF537-STAMP_defconfig
new file mode 100644
index 000000000000..8ed67dc450fd
--- /dev/null
+++ b/arch/blackfin/configs/BF537-STAMP_defconfig
@@ -0,0 +1,1332 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20.4
4#
5# CONFIG_MMU is not set
6# CONFIG_FPU is not set
7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y
10CONFIG_BFIN=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_IRQ_PROBE=y
16# CONFIG_GENERIC_TIME is not set
17CONFIG_GENERIC_CALIBRATE_DELAY=y
18CONFIG_FORCE_MAX_ZONEORDER=14
19CONFIG_IRQCHIP_DEMUX_GPIO=y
20CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
21
22#
23# Code maturity level options
24#
25CONFIG_EXPERIMENTAL=y
26CONFIG_BROKEN_ON_SMP=y
27CONFIG_INIT_ENV_ARG_LIMIT=32
28
29#
30# General setup
31#
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set
36# CONFIG_POSIX_MQUEUE is not set
37# CONFIG_BSD_PROCESS_ACCT is not set
38# CONFIG_TASKSTATS is not set
39# CONFIG_UTS_NS is not set
40# CONFIG_AUDIT is not set
41# CONFIG_IKCONFIG is not set
42CONFIG_SYSFS_DEPRECATED=y
43# CONFIG_RELAY is not set
44CONFIG_INITRAMFS_SOURCE=""
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y
47CONFIG_EMBEDDED=y
48CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y
50CONFIG_KALLSYMS=y
51# CONFIG_KALLSYMS_EXTRA_PASS is not set
52CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y
54CONFIG_BUG=y
55CONFIG_ELF_CORE=y
56CONFIG_BASE_FULL=y
57CONFIG_FUTEX=y
58CONFIG_EPOLL=y
59CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
60# CONFIG_LIMIT_PAGECACHE is not set
61CONFIG_BUDDY=y
62# CONFIG_NP2 is not set
63CONFIG_SLAB=y
64CONFIG_VM_EVENT_COUNTERS=y
65CONFIG_RT_MUTEXES=y
66CONFIG_TINY_SHMEM=y
67CONFIG_BASE_SMALL=0
68# CONFIG_SLOB is not set
69
70#
71# Loadable module support
72#
73CONFIG_MODULES=y
74CONFIG_MODULE_UNLOAD=y
75# CONFIG_MODULE_FORCE_UNLOAD is not set
76# CONFIG_MODVERSIONS is not set
77# CONFIG_MODULE_SRCVERSION_ALL is not set
78CONFIG_KMOD=y
79
80#
81# Block layer
82#
83CONFIG_BLOCK=y
84# CONFIG_LBD is not set
85# CONFIG_BLK_DEV_IO_TRACE is not set
86# CONFIG_LSF is not set
87
88#
89# IO Schedulers
90#
91CONFIG_IOSCHED_NOOP=y
92CONFIG_IOSCHED_AS=y
93# CONFIG_IOSCHED_DEADLINE is not set
94CONFIG_IOSCHED_CFQ=y
95CONFIG_DEFAULT_AS=y
96# CONFIG_DEFAULT_DEADLINE is not set
97# CONFIG_DEFAULT_CFQ is not set
98# CONFIG_DEFAULT_NOOP is not set
99CONFIG_DEFAULT_IOSCHED="anticipatory"
100# CONFIG_PREEMPT_NONE is not set
101CONFIG_PREEMPT_VOLUNTARY=y
102# CONFIG_PREEMPT is not set
103
104#
105# Blackfin Processor Options
106#
107
108#
109# Processor and Board Settings
110#
111# CONFIG_BF531 is not set
112# CONFIG_BF532 is not set
113# CONFIG_BF533 is not set
114# CONFIG_BF534 is not set
115# CONFIG_BF536 is not set
116CONFIG_BF537=y
117# CONFIG_BF561 is not set
118CONFIG_BF_REV_0_2=y
119# CONFIG_BF_REV_0_3 is not set
120# CONFIG_BF_REV_0_4 is not set
121# CONFIG_BF_REV_0_5 is not set
122CONFIG_BFIN_SINGLE_CORE=y
123# CONFIG_BFIN533_EZKIT is not set
124# CONFIG_BFIN533_STAMP is not set
125CONFIG_BFIN537_STAMP=y
126# CONFIG_BFIN533_BLUETECHNIX_CM is not set
127# CONFIG_BFIN537_BLUETECHNIX_CM is not set
128# CONFIG_BFIN561_BLUETECHNIX_CM is not set
129# CONFIG_BFIN561_EZKIT is not set
130# CONFIG_PNAV10 is not set
131# CONFIG_GENERIC_BOARD is not set
132CONFIG_MEM_MT48LC32M8A2_75=y
133CONFIG_IRQ_PLL_WAKEUP=7
134
135#
136# BF537 Specific Configuration
137#
138
139#
140# PORT F/G Selection
141#
142CONFIG_BF537_PORT_F=y
143# CONFIG_BF537_PORT_G is not set
144# CONFIG_BF537_PORT_H is not set
145
146#
147# Interrupt Priority Assignment
148#
149
150#
151# Priority
152#
153CONFIG_IRQ_DMA_ERROR=7
154CONFIG_IRQ_ERROR=7
155CONFIG_IRQ_RTC=8
156CONFIG_IRQ_PPI=8
157CONFIG_IRQ_SPORT0_RX=9
158CONFIG_IRQ_SPORT0_TX=9
159CONFIG_IRQ_SPORT1_RX=9
160CONFIG_IRQ_SPORT1_TX=9
161CONFIG_IRQ_TWI=10
162CONFIG_IRQ_SPI=10
163CONFIG_IRQ_UART0_RX=10
164CONFIG_IRQ_UART0_TX=10
165CONFIG_IRQ_UART1_RX=10
166CONFIG_IRQ_UART1_TX=10
167CONFIG_IRQ_CAN_RX=11
168CONFIG_IRQ_CAN_TX=11
169CONFIG_IRQ_MAC_RX=11
170CONFIG_IRQ_MAC_TX=11
171CONFIG_IRQ_TMR0=12
172CONFIG_IRQ_TMR1=12
173CONFIG_IRQ_TMR2=12
174CONFIG_IRQ_TMR3=12
175CONFIG_IRQ_TMR4=12
176CONFIG_IRQ_TMR5=12
177CONFIG_IRQ_TMR6=12
178CONFIG_IRQ_TMR7=12
179CONFIG_IRQ_PROG_INTA=12
180CONFIG_IRQ_PORTG_INTB=12
181CONFIG_IRQ_MEM_DMA0=13
182CONFIG_IRQ_MEM_DMA1=13
183CONFIG_IRQ_WATCH=13
184
185#
186# Board customizations
187#
188# CONFIG_CMDLINE_BOOL is not set
189
190#
191# Board Setup
192#
193CONFIG_CLKIN_HZ=25000000
194CONFIG_MEM_SIZE=64
195CONFIG_MEM_ADD_WIDTH=10
196CONFIG_BOOT_LOAD=0x1000
197
198#
199# Console UART Setup
200#
201# CONFIG_BAUD_9600 is not set
202# CONFIG_BAUD_19200 is not set
203# CONFIG_BAUD_38400 is not set
204CONFIG_BAUD_57600=y
205# CONFIG_BAUD_115200 is not set
206CONFIG_BAUD_NO_PARITY=y
207# CONFIG_BAUD_PARITY is not set
208CONFIG_BAUD_1_STOPBIT=y
209# CONFIG_BAUD_2_STOPBIT is not set
210
211#
212# Blackfin Kernel Optimizations
213#
214
215#
216# Timer Tick
217#
218# CONFIG_HZ_100 is not set
219CONFIG_HZ_250=y
220# CONFIG_HZ_300 is not set
221# CONFIG_HZ_1000 is not set
222CONFIG_HZ=250
223
224#
225# Memory Optimizations
226#
227CONFIG_I_ENTRY_L1=y
228CONFIG_EXCPT_IRQ_SYSC_L1=y
229CONFIG_DO_IRQ_L1=y
230CONFIG_CORE_TIMER_IRQ_L1=y
231CONFIG_IDLE_L1=y
232CONFIG_SCHEDULE_L1=y
233CONFIG_ARITHMETIC_OPS_L1=y
234CONFIG_ACCESS_OK_L1=y
235CONFIG_MEMSET_L1=y
236CONFIG_MEMCPY_L1=y
237CONFIG_SYS_BFIN_SPINLOCK_L1=y
238# CONFIG_IP_CHECKSUM_L1 is not set
239# CONFIG_SYSCALL_TAB_L1 is not set
240# CONFIG_CPLB_SWITCH_TAB_L1 is not set
241CONFIG_RAMKERNEL=y
242# CONFIG_ROMKERNEL is not set
243CONFIG_SELECT_MEMORY_MODEL=y
244CONFIG_FLATMEM_MANUAL=y
245# CONFIG_DISCONTIGMEM_MANUAL is not set
246# CONFIG_SPARSEMEM_MANUAL is not set
247CONFIG_FLATMEM=y
248CONFIG_FLAT_NODE_MEM_MAP=y
249# CONFIG_SPARSEMEM_STATIC is not set
250CONFIG_SPLIT_PTLOCK_CPUS=4
251# CONFIG_RESOURCES_64BIT is not set
252CONFIG_LARGE_ALLOCS=y
253CONFIG_BFIN_DMA_5XX=y
254# CONFIG_DMA_UNCACHED_2M is not set
255CONFIG_DMA_UNCACHED_1M=y
256# CONFIG_DMA_UNCACHED_NONE is not set
257
258#
259# Cache Support
260#
261CONFIG_BLKFIN_CACHE=y
262CONFIG_BLKFIN_DCACHE=y
263# CONFIG_BLKFIN_DCACHE_BANKA is not set
264# CONFIG_BLKFIN_CACHE_LOCK is not set
265# CONFIG_BLKFIN_WB is not set
266CONFIG_BLKFIN_WT=y
267CONFIG_L1_MAX_PIECE=16
268
269#
270# Clock Settings
271#
272# CONFIG_BFIN_KERNEL_CLOCK is not set
273
274#
275# Asynchonous Memory Configuration
276#
277
278#
279# EBIU_AMBCTL Global Control
280#
281CONFIG_C_AMCKEN=y
282CONFIG_C_CDPRIO=y
283# CONFIG_C_AMBEN is not set
284# CONFIG_C_AMBEN_B0 is not set
285# CONFIG_C_AMBEN_B0_B1 is not set
286# CONFIG_C_AMBEN_B0_B1_B2 is not set
287CONFIG_C_AMBEN_ALL=y
288
289#
290# EBIU_AMBCTL Control
291#
292CONFIG_BANK_0=0x7BB0
293CONFIG_BANK_1=0x7BB0
294CONFIG_BANK_2=0x7BB0
295CONFIG_BANK_3=0x99B3
296
297#
298# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
299#
300# CONFIG_PCI is not set
301
302#
303# PCCARD (PCMCIA/CardBus) support
304#
305# CONFIG_PCCARD is not set
306
307#
308# PCI Hotplug Support
309#
310
311#
312# Executable file formats
313#
314CONFIG_BINFMT_ELF_FDPIC=y
315CONFIG_BINFMT_FLAT=y
316CONFIG_BINFMT_ZFLAT=y
317# CONFIG_BINFMT_SHARED_FLAT is not set
318# CONFIG_BINFMT_MISC is not set
319
320#
321# Power management options
322#
323CONFIG_PM=y
324CONFIG_PM_LEGACY=y
325# CONFIG_PM_DEBUG is not set
326# CONFIG_PM_SYSFS_DEPRECATED is not set
327CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR=y
328# CONFIG_PM_WAKEUP_BY_GPIO is not set
329# CONFIG_PM_WAKEUP_GPIO_API is not set
330CONFIG_PM_WAKEUP_SIC_IWR=0x80000000
331
332#
333# CPU Frequency scaling
334#
335# CONFIG_CPU_FREQ is not set
336
337#
338# Networking
339#
340CONFIG_NET=y
341
342#
343# Networking options
344#
345# CONFIG_NETDEBUG is not set
346CONFIG_PACKET=y
347# CONFIG_PACKET_MMAP is not set
348CONFIG_UNIX=y
349CONFIG_XFRM=y
350# CONFIG_XFRM_USER is not set
351# CONFIG_XFRM_SUB_POLICY is not set
352# CONFIG_NET_KEY is not set
353CONFIG_INET=y
354# CONFIG_IP_MULTICAST is not set
355# CONFIG_IP_ADVANCED_ROUTER is not set
356CONFIG_IP_FIB_HASH=y
357CONFIG_IP_PNP=y
358# CONFIG_IP_PNP_DHCP is not set
359# CONFIG_IP_PNP_BOOTP is not set
360# CONFIG_IP_PNP_RARP is not set
361# CONFIG_NET_IPIP is not set
362# CONFIG_NET_IPGRE is not set
363# CONFIG_ARPD is not set
364CONFIG_SYN_COOKIES=y
365# CONFIG_INET_AH is not set
366# CONFIG_INET_ESP is not set
367# CONFIG_INET_IPCOMP is not set
368# CONFIG_INET_XFRM_TUNNEL is not set
369# CONFIG_INET_TUNNEL is not set
370CONFIG_INET_XFRM_MODE_TRANSPORT=y
371CONFIG_INET_XFRM_MODE_TUNNEL=y
372CONFIG_INET_XFRM_MODE_BEET=y
373CONFIG_INET_DIAG=y
374CONFIG_INET_TCP_DIAG=y
375# CONFIG_TCP_CONG_ADVANCED is not set
376CONFIG_TCP_CONG_CUBIC=y
377CONFIG_DEFAULT_TCP_CONG="cubic"
378# CONFIG_TCP_MD5SIG is not set
379# CONFIG_IPV6 is not set
380# CONFIG_INET6_XFRM_TUNNEL is not set
381# CONFIG_INET6_TUNNEL is not set
382# CONFIG_NETLABEL is not set
383# CONFIG_NETWORK_SECMARK is not set
384# CONFIG_NETFILTER is not set
385
386#
387# DCCP Configuration (EXPERIMENTAL)
388#
389# CONFIG_IP_DCCP is not set
390
391#
392# SCTP Configuration (EXPERIMENTAL)
393#
394# CONFIG_IP_SCTP is not set
395
396#
397# TIPC Configuration (EXPERIMENTAL)
398#
399# CONFIG_TIPC is not set
400# CONFIG_ATM is not set
401# CONFIG_BRIDGE is not set
402# CONFIG_VLAN_8021Q is not set
403# CONFIG_DECNET is not set
404# CONFIG_LLC2 is not set
405# CONFIG_IPX is not set
406# CONFIG_ATALK is not set
407# CONFIG_X25 is not set
408# CONFIG_LAPB is not set
409# CONFIG_ECONET is not set
410# CONFIG_WAN_ROUTER is not set
411
412#
413# QoS and/or fair queueing
414#
415# CONFIG_NET_SCHED is not set
416
417#
418# Network testing
419#
420# CONFIG_NET_PKTGEN is not set
421# CONFIG_HAMRADIO is not set
422CONFIG_IRDA=m
423
424#
425# IrDA protocols
426#
427CONFIG_IRLAN=m
428CONFIG_IRCOMM=m
429# CONFIG_IRDA_ULTRA is not set
430
431#
432# IrDA options
433#
434CONFIG_IRDA_CACHE_LAST_LSAP=y
435# CONFIG_IRDA_FAST_RR is not set
436# CONFIG_IRDA_DEBUG is not set
437
438#
439# Infrared-port device drivers
440#
441
442#
443# SIR device drivers
444#
445CONFIG_IRTTY_SIR=m
446
447#
448# Dongle support
449#
450# CONFIG_DONGLE is not set
451
452#
453# Old SIR device drivers
454#
455# CONFIG_IRPORT_SIR is not set
456
457#
458# Old Serial dongle support
459#
460
461#
462# FIR device drivers
463#
464# CONFIG_BT is not set
465# CONFIG_IEEE80211 is not set
466
467#
468# Device Drivers
469#
470
471#
472# Generic Driver Options
473#
474CONFIG_STANDALONE=y
475CONFIG_PREVENT_FIRMWARE_BUILD=y
476# CONFIG_FW_LOADER is not set
477# CONFIG_SYS_HYPERVISOR is not set
478
479#
480# Connector - unified userspace <-> kernelspace linker
481#
482# CONFIG_CONNECTOR is not set
483
484#
485# Memory Technology Devices (MTD)
486#
487CONFIG_MTD=y
488# CONFIG_MTD_DEBUG is not set
489# CONFIG_MTD_CONCAT is not set
490CONFIG_MTD_PARTITIONS=y
491# CONFIG_MTD_REDBOOT_PARTS is not set
492# CONFIG_MTD_CMDLINE_PARTS is not set
493
494#
495# User Modules And Translation Layers
496#
497CONFIG_MTD_CHAR=m
498CONFIG_MTD_BLKDEVS=y
499CONFIG_MTD_BLOCK=y
500# CONFIG_FTL is not set
501# CONFIG_NFTL is not set
502# CONFIG_INFTL is not set
503# CONFIG_RFD_FTL is not set
504# CONFIG_SSFDC is not set
505
506#
507# RAM/ROM/Flash chip drivers
508#
509# CONFIG_MTD_CFI is not set
510CONFIG_MTD_JEDECPROBE=m
511CONFIG_MTD_GEN_PROBE=m
512# CONFIG_MTD_CFI_ADV_OPTIONS is not set
513CONFIG_MTD_MAP_BANK_WIDTH_1=y
514CONFIG_MTD_MAP_BANK_WIDTH_2=y
515CONFIG_MTD_MAP_BANK_WIDTH_4=y
516# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
517# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
518# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
519CONFIG_MTD_CFI_I1=y
520CONFIG_MTD_CFI_I2=y
521# CONFIG_MTD_CFI_I4 is not set
522# CONFIG_MTD_CFI_I8 is not set
523# CONFIG_MTD_CFI_INTELEXT is not set
524# CONFIG_MTD_CFI_AMDSTD is not set
525# CONFIG_MTD_CFI_STAA is not set
526CONFIG_MTD_MW320D=m
527CONFIG_MTD_RAM=y
528CONFIG_MTD_ROM=m
529# CONFIG_MTD_ABSENT is not set
530# CONFIG_MTD_OBSOLETE_CHIPS is not set
531
532#
533# Mapping drivers for chip access
534#
535CONFIG_MTD_COMPLEX_MAPPINGS=y
536# CONFIG_MTD_PHYSMAP is not set
537CONFIG_MTD_BF5xx=m
538CONFIG_BFIN_FLASH_SIZE=0x400000
539CONFIG_EBIU_FLASH_BASE=0x20000000
540
541#
542# FLASH_EBIU_AMBCTL Control
543#
544CONFIG_BFIN_FLASH_BANK_0=0x7BB0
545CONFIG_BFIN_FLASH_BANK_1=0x7BB0
546CONFIG_BFIN_FLASH_BANK_2=0x7BB0
547CONFIG_BFIN_FLASH_BANK_3=0x7BB0
548# CONFIG_MTD_UCLINUX is not set
549# CONFIG_MTD_PLATRAM is not set
550
551#
552# Self-contained MTD device drivers
553#
554# CONFIG_MTD_DATAFLASH is not set
555# CONFIG_MTD_M25P80 is not set
556# CONFIG_MTD_SLRAM is not set
557# CONFIG_MTD_PHRAM is not set
558# CONFIG_MTD_MTDRAM is not set
559# CONFIG_MTD_BLOCK2MTD is not set
560
561#
562# Disk-On-Chip Device Drivers
563#
564# CONFIG_MTD_DOC2000 is not set
565# CONFIG_MTD_DOC2001 is not set
566# CONFIG_MTD_DOC2001PLUS is not set
567
568#
569# NAND Flash Device Drivers
570#
571CONFIG_MTD_NAND=m
572# CONFIG_MTD_NAND_VERIFY_WRITE is not set
573# CONFIG_MTD_NAND_ECC_SMC is not set
574CONFIG_MTD_NAND_BFIN=m
575CONFIG_BFIN_NAND_BASE=0x20212000
576CONFIG_BFIN_NAND_CLE=2
577CONFIG_BFIN_NAND_ALE=1
578CONFIG_BFIN_NAND_READY=3
579CONFIG_MTD_NAND_IDS=m
580# CONFIG_MTD_NAND_DISKONCHIP is not set
581# CONFIG_MTD_NAND_NANDSIM is not set
582
583#
584# OneNAND Flash Device Drivers
585#
586# CONFIG_MTD_ONENAND is not set
587
588#
589# Parallel port support
590#
591# CONFIG_PARPORT is not set
592
593#
594# Plug and Play support
595#
596
597#
598# Block devices
599#
600# CONFIG_BLK_DEV_COW_COMMON is not set
601# CONFIG_BLK_DEV_LOOP is not set
602# CONFIG_BLK_DEV_NBD is not set
603CONFIG_BLK_DEV_RAM=y
604CONFIG_BLK_DEV_RAM_COUNT=16
605CONFIG_BLK_DEV_RAM_SIZE=4096
606CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
607# CONFIG_BLK_DEV_INITRD is not set
608# CONFIG_CDROM_PKTCDVD is not set
609# CONFIG_ATA_OVER_ETH is not set
610
611#
612# Misc devices
613#
614# CONFIG_TIFM_CORE is not set
615
616#
617# ATA/ATAPI/MFM/RLL support
618#
619# CONFIG_IDE is not set
620
621#
622# SCSI device support
623#
624# CONFIG_RAID_ATTRS is not set
625# CONFIG_SCSI is not set
626# CONFIG_SCSI_NETLINK is not set
627
628#
629# Serial ATA (prod) and Parallel ATA (experimental) drivers
630#
631# CONFIG_ATA is not set
632
633#
634# Multi-device support (RAID and LVM)
635#
636# CONFIG_MD is not set
637
638#
639# Fusion MPT device support
640#
641# CONFIG_FUSION is not set
642
643#
644# IEEE 1394 (FireWire) support
645#
646
647#
648# I2O device support
649#
650
651#
652# Network device support
653#
654CONFIG_NETDEVICES=y
655# CONFIG_DUMMY is not set
656# CONFIG_BONDING is not set
657# CONFIG_EQUALIZER is not set
658# CONFIG_TUN is not set
659
660#
661# PHY device support
662#
663# CONFIG_PHYLIB is not set
664
665#
666# Ethernet (10 or 100Mbit)
667#
668CONFIG_NET_ETHERNET=y
669CONFIG_MII=y
670# CONFIG_SMC91X is not set
671CONFIG_BFIN_MAC=y
672CONFIG_BFIN_MAC_USE_L1=y
673CONFIG_BFIN_TX_DESC_NUM=10
674CONFIG_BFIN_RX_DESC_NUM=20
675# CONFIG_BFIN_MAC_RMII is not set
676
677#
678# Ethernet (1000 Mbit)
679#
680
681#
682# Ethernet (10000 Mbit)
683#
684
685#
686# Token Ring devices
687#
688
689#
690# Wireless LAN (non-hamradio)
691#
692# CONFIG_NET_RADIO is not set
693
694#
695# Wan interfaces
696#
697# CONFIG_WAN is not set
698# CONFIG_PPP is not set
699# CONFIG_SLIP is not set
700# CONFIG_SHAPER is not set
701# CONFIG_NETCONSOLE is not set
702# CONFIG_NETPOLL is not set
703# CONFIG_NET_POLL_CONTROLLER is not set
704
705#
706# ISDN subsystem
707#
708# CONFIG_ISDN is not set
709
710#
711# Telephony Support
712#
713# CONFIG_PHONE is not set
714
715#
716# Input device support
717#
718CONFIG_INPUT=y
719# CONFIG_INPUT_FF_MEMLESS is not set
720
721#
722# Userland interfaces
723#
724# CONFIG_INPUT_MOUSEDEV is not set
725# CONFIG_INPUT_JOYDEV is not set
726# CONFIG_INPUT_TSDEV is not set
727CONFIG_INPUT_EVDEV=m
728# CONFIG_INPUT_EVBUG is not set
729
730#
731# Input Device Drivers
732#
733# CONFIG_INPUT_KEYBOARD is not set
734# CONFIG_INPUT_MOUSE is not set
735# CONFIG_INPUT_JOYSTICK is not set
736# CONFIG_INPUT_TOUCHSCREEN is not set
737CONFIG_INPUT_MISC=y
738# CONFIG_INPUT_UINPUT is not set
739# CONFIG_BF53X_PFBUTTONS is not set
740CONFIG_TWI_KEYPAD=m
741CONFIG_BFIN_TWIKEYPAD_IRQ_PFX=72
742
743#
744# Hardware I/O ports
745#
746# CONFIG_SERIO is not set
747# CONFIG_GAMEPORT is not set
748
749#
750# Character devices
751#
752# CONFIG_AD9960 is not set
753# CONFIG_SPI_ADC_BF533 is not set
754# CONFIG_BF533_PFLAGS is not set
755# CONFIG_BF5xx_PPIFCD is not set
756# CONFIG_BF5xx_TIMERS is not set
757# CONFIG_BF5xx_PPI is not set
758CONFIG_BFIN_SPORT=y
759# CONFIG_BFIN_TIMER_LATENCY is not set
760CONFIG_TWI_LCD=m
761CONFIG_TWI_LCD_SLAVE_ADDR=34
762# CONFIG_AD5304 is not set
763# CONFIG_VT is not set
764# CONFIG_SERIAL_NONSTANDARD is not set
765
766#
767# Serial drivers
768#
769# CONFIG_SERIAL_8250 is not set
770
771#
772# Non-8250 serial port support
773#
774CONFIG_SERIAL_BFIN=y
775CONFIG_SERIAL_BFIN_CONSOLE=y
776CONFIG_SERIAL_BFIN_DMA=y
777# CONFIG_SERIAL_BFIN_PIO is not set
778CONFIG_SERIAL_BFIN_UART0=y
779# CONFIG_BFIN_UART0_CTSRTS is not set
780# CONFIG_SERIAL_BFIN_UART1 is not set
781CONFIG_SERIAL_CORE=y
782CONFIG_SERIAL_CORE_CONSOLE=y
783# CONFIG_SERIAL_BFIN_SPORT is not set
784CONFIG_UNIX98_PTYS=y
785# CONFIG_LEGACY_PTYS is not set
786
787#
788# CAN, the car bus and industrial fieldbus
789#
790CONFIG_CAN4LINUX=y
791
792#
793# linux embedded drivers
794#
795# CONFIG_CAN_MCF5282 is not set
796# CONFIG_CAN_UNCTWINCAN is not set
797CONFIG_CAN_BLACKFIN=m
798
799#
800# IPMI
801#
802# CONFIG_IPMI_HANDLER is not set
803
804#
805# Watchdog Cards
806#
807# CONFIG_WATCHDOG is not set
808CONFIG_HW_RANDOM=y
809# CONFIG_GEN_RTC is not set
810CONFIG_BLACKFIN_DPMC=y
811# CONFIG_DTLK is not set
812# CONFIG_R3964 is not set
813# CONFIG_RAW_DRIVER is not set
814
815#
816# TPM devices
817#
818# CONFIG_TCG_TPM is not set
819
820#
821# I2C support
822#
823CONFIG_I2C=m
824CONFIG_I2C_CHARDEV=m
825
826#
827# I2C Algorithms
828#
829# CONFIG_I2C_ALGOBIT is not set
830# CONFIG_I2C_ALGOPCF is not set
831# CONFIG_I2C_ALGOPCA is not set
832
833#
834# I2C Hardware Bus support
835#
836# CONFIG_I2C_BLACKFIN_GPIO is not set
837CONFIG_I2C_BLACKFIN_TWI=m
838CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50
839# CONFIG_I2C_OCORES is not set
840# CONFIG_I2C_PARPORT_LIGHT is not set
841# CONFIG_I2C_STUB is not set
842# CONFIG_I2C_PCA_ISA is not set
843
844#
845# Miscellaneous I2C Chip support
846#
847# CONFIG_SENSORS_DS1337 is not set
848# CONFIG_SENSORS_DS1374 is not set
849CONFIG_SENSORS_AD5252=m
850# CONFIG_SENSORS_EEPROM is not set
851# CONFIG_SENSORS_PCF8574 is not set
852# CONFIG_SENSORS_PCF8575 is not set
853# CONFIG_SENSORS_PCA9543 is not set
854# CONFIG_SENSORS_PCA9539 is not set
855# CONFIG_SENSORS_PCF8591 is not set
856# CONFIG_SENSORS_MAX6875 is not set
857# CONFIG_I2C_DEBUG_CORE is not set
858# CONFIG_I2C_DEBUG_ALGO is not set
859# CONFIG_I2C_DEBUG_BUS is not set
860# CONFIG_I2C_DEBUG_CHIP is not set
861
862#
863# SPI support
864#
865CONFIG_SPI=y
866CONFIG_SPI_MASTER=y
867
868#
869# SPI Master Controller Drivers
870#
871# CONFIG_SPI_BITBANG is not set
872
873#
874# SPI Protocol Masters
875#
876CONFIG_SPI_BFIN=y
877
878#
879# Dallas's 1-wire bus
880#
881# CONFIG_W1 is not set
882
883#
884# Hardware Monitoring support
885#
886CONFIG_HWMON=y
887# CONFIG_HWMON_VID is not set
888# CONFIG_SENSORS_ABITUGURU is not set
889# CONFIG_SENSORS_ADM1021 is not set
890# CONFIG_SENSORS_ADM1025 is not set
891# CONFIG_SENSORS_ADM1026 is not set
892# CONFIG_SENSORS_ADM1031 is not set
893# CONFIG_SENSORS_ADM9240 is not set
894# CONFIG_SENSORS_ASB100 is not set
895# CONFIG_SENSORS_ATXP1 is not set
896# CONFIG_SENSORS_DS1621 is not set
897# CONFIG_SENSORS_F71805F is not set
898# CONFIG_SENSORS_FSCHER is not set
899# CONFIG_SENSORS_FSCPOS is not set
900# CONFIG_SENSORS_GL518SM is not set
901# CONFIG_SENSORS_GL520SM is not set
902# CONFIG_SENSORS_IT87 is not set
903# CONFIG_SENSORS_LM63 is not set
904# CONFIG_SENSORS_LM70 is not set
905# CONFIG_SENSORS_LM75 is not set
906# CONFIG_SENSORS_LM77 is not set
907# CONFIG_SENSORS_LM78 is not set
908# CONFIG_SENSORS_LM80 is not set
909# CONFIG_SENSORS_LM83 is not set
910# CONFIG_SENSORS_LM85 is not set
911# CONFIG_SENSORS_LM87 is not set
912# CONFIG_SENSORS_LM90 is not set
913# CONFIG_SENSORS_LM92 is not set
914# CONFIG_SENSORS_MAX1619 is not set
915# CONFIG_SENSORS_PC87360 is not set
916# CONFIG_SENSORS_PC87427 is not set
917# CONFIG_SENSORS_SMSC47M1 is not set
918# CONFIG_SENSORS_SMSC47M192 is not set
919# CONFIG_SENSORS_SMSC47B397 is not set
920# CONFIG_SENSORS_VT1211 is not set
921# CONFIG_SENSORS_W83781D is not set
922# CONFIG_SENSORS_W83791D is not set
923# CONFIG_SENSORS_W83792D is not set
924# CONFIG_SENSORS_W83793 is not set
925# CONFIG_SENSORS_W83L785TS is not set
926# CONFIG_SENSORS_W83627HF is not set
927# CONFIG_SENSORS_W83627EHF is not set
928# CONFIG_HWMON_DEBUG_CHIP is not set
929
930#
931# Multimedia devices
932#
933# CONFIG_VIDEO_DEV is not set
934
935#
936# Digital Video Broadcasting Devices
937#
938# CONFIG_DVB is not set
939
940#
941# Graphics support
942#
943CONFIG_FIRMWARE_EDID=y
944CONFIG_FB=m
945CONFIG_FB_CFB_FILLRECT=m
946CONFIG_FB_CFB_COPYAREA=m
947CONFIG_FB_CFB_IMAGEBLIT=m
948# CONFIG_FB_MACMODES is not set
949# CONFIG_FB_BACKLIGHT is not set
950# CONFIG_FB_MODE_HELPERS is not set
951# CONFIG_FB_TILEBLITTING is not set
952CONFIG_FB_BFIN_7171=m
953CONFIG_FB_BFIN_7393=m
954CONFIG_NTSC=y
955# CONFIG_PAL is not set
956# CONFIG_NTSC_640x480 is not set
957# CONFIG_PAL_640x480 is not set
958# CONFIG_NTSC_YCBCR is not set
959# CONFIG_PAL_YCBCR is not set
960CONFIG_ADV7393_1XMEM=y
961# CONFIG_ADV7393_2XMEM is not set
962CONFIG_FB_BF537_LQ035=m
963CONFIG_LQ035_SLAVE_ADDR=0x58
964# CONFIG_FB_BFIN_LANDSCAPE is not set
965# CONFIG_FB_BFIN_BGR is not set
966# CONFIG_FB_S1D13XXX is not set
967# CONFIG_FB_VIRTUAL is not set
968
969#
970# Logo configuration
971#
972# CONFIG_LOGO is not set
973CONFIG_BACKLIGHT_LCD_SUPPORT=y
974CONFIG_BACKLIGHT_CLASS_DEVICE=m
975CONFIG_BACKLIGHT_DEVICE=y
976CONFIG_LCD_CLASS_DEVICE=m
977CONFIG_LCD_DEVICE=y
978
979#
980# Sound
981#
982CONFIG_SOUND=m
983
984#
985# Advanced Linux Sound Architecture
986#
987CONFIG_SND=m
988CONFIG_SND_TIMER=m
989CONFIG_SND_PCM=m
990# CONFIG_SND_SEQUENCER is not set
991CONFIG_SND_OSSEMUL=y
992CONFIG_SND_MIXER_OSS=m
993CONFIG_SND_PCM_OSS=m
994CONFIG_SND_PCM_OSS_PLUGINS=y
995# CONFIG_SND_DYNAMIC_MINORS is not set
996CONFIG_SND_SUPPORT_OLD_API=y
997CONFIG_SND_VERBOSE_PROCFS=y
998# CONFIG_SND_VERBOSE_PRINTK is not set
999# CONFIG_SND_DEBUG is not set
1000
1001#
1002# Generic devices
1003#
1004# CONFIG_SND_DUMMY is not set
1005# CONFIG_SND_MTPAV is not set
1006# CONFIG_SND_SERIAL_U16550 is not set
1007# CONFIG_SND_MPU401 is not set
1008
1009#
1010# Open Sound System
1011#
1012# CONFIG_SOUND_PRIME is not set
1013
1014#
1015# HID Devices
1016#
1017CONFIG_HID=y
1018
1019#
1020# USB support
1021#
1022CONFIG_USB_ARCH_HAS_HCD=y
1023# CONFIG_USB_ARCH_HAS_OHCI is not set
1024# CONFIG_USB_ARCH_HAS_EHCI is not set
1025# CONFIG_USB is not set
1026
1027#
1028# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
1029#
1030
1031#
1032# USB Gadget Support
1033#
1034# CONFIG_USB_GADGET is not set
1035
1036#
1037# MMC/SD Card support
1038#
1039# CONFIG_SPI_MMC is not set
1040# CONFIG_MMC is not set
1041
1042#
1043# LED devices
1044#
1045# CONFIG_NEW_LEDS is not set
1046
1047#
1048# LED drivers
1049#
1050
1051#
1052# LED Triggers
1053#
1054
1055#
1056# InfiniBand support
1057#
1058
1059#
1060# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1061#
1062
1063#
1064# Real Time Clock
1065#
1066CONFIG_RTC_LIB=y
1067CONFIG_RTC_CLASS=y
1068CONFIG_RTC_HCTOSYS=y
1069CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1070# CONFIG_RTC_DEBUG is not set
1071
1072#
1073# RTC interfaces
1074#
1075CONFIG_RTC_INTF_SYSFS=y
1076CONFIG_RTC_INTF_PROC=y
1077CONFIG_RTC_INTF_DEV=y
1078# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1079
1080#
1081# RTC drivers
1082#
1083# CONFIG_RTC_DRV_X1205 is not set
1084# CONFIG_RTC_DRV_DS1307 is not set
1085# CONFIG_RTC_DRV_DS1553 is not set
1086# CONFIG_RTC_DRV_ISL1208 is not set
1087# CONFIG_RTC_DRV_DS1672 is not set
1088# CONFIG_RTC_DRV_DS1742 is not set
1089# CONFIG_RTC_DRV_PCF8563 is not set
1090# CONFIG_RTC_DRV_PCF8583 is not set
1091# CONFIG_RTC_DRV_RS5C348 is not set
1092# CONFIG_RTC_DRV_RS5C372 is not set
1093# CONFIG_RTC_DRV_M48T86 is not set
1094# CONFIG_RTC_DRV_TEST is not set
1095# CONFIG_RTC_DRV_MAX6902 is not set
1096# CONFIG_RTC_DRV_V3020 is not set
1097CONFIG_RTC_DRV_BFIN=y
1098
1099#
1100# DMA Engine support
1101#
1102# CONFIG_DMA_ENGINE is not set
1103
1104#
1105# DMA Clients
1106#
1107
1108#
1109# DMA Devices
1110#
1111
1112#
1113# Virtualization
1114#
1115
1116#
1117# PBX support
1118#
1119# CONFIG_PBX is not set
1120
1121#
1122# File systems
1123#
1124CONFIG_EXT2_FS=y
1125CONFIG_EXT2_FS_XATTR=y
1126# CONFIG_EXT2_FS_POSIX_ACL is not set
1127# CONFIG_EXT2_FS_SECURITY is not set
1128# CONFIG_EXT3_FS is not set
1129# CONFIG_EXT4DEV_FS is not set
1130CONFIG_FS_MBCACHE=y
1131# CONFIG_REISERFS_FS is not set
1132# CONFIG_JFS_FS is not set
1133# CONFIG_FS_POSIX_ACL is not set
1134# CONFIG_XFS_FS is not set
1135# CONFIG_GFS2_FS is not set
1136# CONFIG_OCFS2_FS is not set
1137# CONFIG_MINIX_FS is not set
1138# CONFIG_ROMFS_FS is not set
1139CONFIG_INOTIFY=y
1140CONFIG_INOTIFY_USER=y
1141# CONFIG_QUOTA is not set
1142CONFIG_DNOTIFY=y
1143# CONFIG_AUTOFS_FS is not set
1144# CONFIG_AUTOFS4_FS is not set
1145# CONFIG_FUSE_FS is not set
1146
1147#
1148# CD-ROM/DVD Filesystems
1149#
1150# CONFIG_ISO9660_FS is not set
1151# CONFIG_UDF_FS is not set
1152
1153#
1154# DOS/FAT/NT Filesystems
1155#
1156# CONFIG_MSDOS_FS is not set
1157# CONFIG_VFAT_FS is not set
1158# CONFIG_NTFS_FS is not set
1159
1160#
1161# Pseudo filesystems
1162#
1163CONFIG_PROC_FS=y
1164CONFIG_PROC_SYSCTL=y
1165CONFIG_SYSFS=y
1166# CONFIG_TMPFS is not set
1167# CONFIG_HUGETLB_PAGE is not set
1168CONFIG_RAMFS=y
1169# CONFIG_CONFIGFS_FS is not set
1170
1171#
1172# Miscellaneous filesystems
1173#
1174# CONFIG_ADFS_FS is not set
1175# CONFIG_AFFS_FS is not set
1176# CONFIG_HFS_FS is not set
1177# CONFIG_HFSPLUS_FS is not set
1178# CONFIG_BEFS_FS is not set
1179# CONFIG_BFS_FS is not set
1180# CONFIG_EFS_FS is not set
1181CONFIG_YAFFS_FS=m
1182CONFIG_YAFFS_YAFFS1=y
1183# CONFIG_YAFFS_DOES_ECC is not set
1184CONFIG_YAFFS_YAFFS2=y
1185CONFIG_YAFFS_AUTO_YAFFS2=y
1186# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1187CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
1188# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1189# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1190CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1191CONFIG_JFFS2_FS=m
1192CONFIG_JFFS2_FS_DEBUG=0
1193CONFIG_JFFS2_FS_WRITEBUFFER=y
1194# CONFIG_JFFS2_SUMMARY is not set
1195# CONFIG_JFFS2_FS_XATTR is not set
1196# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1197CONFIG_JFFS2_ZLIB=y
1198CONFIG_JFFS2_RTIME=y
1199# CONFIG_JFFS2_RUBIN is not set
1200# CONFIG_CRAMFS is not set
1201# CONFIG_VXFS_FS is not set
1202# CONFIG_HPFS_FS is not set
1203# CONFIG_QNX4FS_FS is not set
1204# CONFIG_SYSV_FS is not set
1205# CONFIG_UFS_FS is not set
1206
1207#
1208# Network File Systems
1209#
1210CONFIG_NFS_FS=m
1211CONFIG_NFS_V3=y
1212# CONFIG_NFS_V3_ACL is not set
1213# CONFIG_NFS_V4 is not set
1214# CONFIG_NFS_DIRECTIO is not set
1215# CONFIG_NFSD is not set
1216CONFIG_LOCKD=m
1217CONFIG_LOCKD_V4=y
1218CONFIG_NFS_COMMON=y
1219CONFIG_SUNRPC=m
1220# CONFIG_RPCSEC_GSS_KRB5 is not set
1221# CONFIG_RPCSEC_GSS_SPKM3 is not set
1222CONFIG_SMB_FS=m
1223# CONFIG_SMB_NLS_DEFAULT is not set
1224# CONFIG_CIFS is not set
1225# CONFIG_NCP_FS is not set
1226# CONFIG_CODA_FS is not set
1227# CONFIG_AFS_FS is not set
1228# CONFIG_9P_FS is not set
1229
1230#
1231# Partition Types
1232#
1233# CONFIG_PARTITION_ADVANCED is not set
1234CONFIG_MSDOS_PARTITION=y
1235
1236#
1237# Native Language Support
1238#
1239CONFIG_NLS=m
1240CONFIG_NLS_DEFAULT="iso8859-1"
1241# CONFIG_NLS_CODEPAGE_437 is not set
1242# CONFIG_NLS_CODEPAGE_737 is not set
1243# CONFIG_NLS_CODEPAGE_775 is not set
1244# CONFIG_NLS_CODEPAGE_850 is not set
1245# CONFIG_NLS_CODEPAGE_852 is not set
1246# CONFIG_NLS_CODEPAGE_855 is not set
1247# CONFIG_NLS_CODEPAGE_857 is not set
1248# CONFIG_NLS_CODEPAGE_860 is not set
1249# CONFIG_NLS_CODEPAGE_861 is not set
1250# CONFIG_NLS_CODEPAGE_862 is not set
1251# CONFIG_NLS_CODEPAGE_863 is not set
1252# CONFIG_NLS_CODEPAGE_864 is not set
1253# CONFIG_NLS_CODEPAGE_865 is not set
1254# CONFIG_NLS_CODEPAGE_866 is not set
1255# CONFIG_NLS_CODEPAGE_869 is not set
1256# CONFIG_NLS_CODEPAGE_936 is not set
1257# CONFIG_NLS_CODEPAGE_950 is not set
1258# CONFIG_NLS_CODEPAGE_932 is not set
1259# CONFIG_NLS_CODEPAGE_949 is not set
1260# CONFIG_NLS_CODEPAGE_874 is not set
1261# CONFIG_NLS_ISO8859_8 is not set
1262# CONFIG_NLS_CODEPAGE_1250 is not set
1263# CONFIG_NLS_CODEPAGE_1251 is not set
1264# CONFIG_NLS_ASCII is not set
1265# CONFIG_NLS_ISO8859_1 is not set
1266# CONFIG_NLS_ISO8859_2 is not set
1267# CONFIG_NLS_ISO8859_3 is not set
1268# CONFIG_NLS_ISO8859_4 is not set
1269# CONFIG_NLS_ISO8859_5 is not set
1270# CONFIG_NLS_ISO8859_6 is not set
1271# CONFIG_NLS_ISO8859_7 is not set
1272# CONFIG_NLS_ISO8859_9 is not set
1273# CONFIG_NLS_ISO8859_13 is not set
1274# CONFIG_NLS_ISO8859_14 is not set
1275# CONFIG_NLS_ISO8859_15 is not set
1276# CONFIG_NLS_KOI8_R is not set
1277# CONFIG_NLS_KOI8_U is not set
1278# CONFIG_NLS_UTF8 is not set
1279
1280#
1281# Distributed Lock Manager
1282#
1283# CONFIG_DLM is not set
1284
1285#
1286# Profiling support
1287#
1288# CONFIG_PROFILING is not set
1289
1290#
1291# Kernel hacking
1292#
1293# CONFIG_PRINTK_TIME is not set
1294CONFIG_ENABLE_MUST_CHECK=y
1295# CONFIG_MAGIC_SYSRQ is not set
1296# CONFIG_UNUSED_SYMBOLS is not set
1297# CONFIG_DEBUG_FS is not set
1298# CONFIG_HEADERS_CHECK is not set
1299# CONFIG_DEBUG_KERNEL is not set
1300CONFIG_LOG_BUF_SHIFT=14
1301# CONFIG_DEBUG_BUGVERBOSE is not set
1302# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set
1303CONFIG_DEBUG_HUNT_FOR_ZERO=y
1304# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1305CONFIG_CPLB_INFO=y
1306CONFIG_ACCESS_CHECK=y
1307
1308#
1309# Security options
1310#
1311# CONFIG_KEYS is not set
1312CONFIG_SECURITY=y
1313# CONFIG_SECURITY_NETWORK is not set
1314CONFIG_SECURITY_CAPABILITIES=y
1315
1316#
1317# Cryptographic options
1318#
1319# CONFIG_CRYPTO is not set
1320
1321#
1322# Library routines
1323#
1324CONFIG_BITREVERSE=y
1325CONFIG_CRC_CCITT=m
1326# CONFIG_CRC16 is not set
1327CONFIG_CRC32=y
1328# CONFIG_LIBCRC32C is not set
1329CONFIG_ZLIB_INFLATE=y
1330CONFIG_ZLIB_DEFLATE=m
1331CONFIG_PLIST=y
1332CONFIG_IOMAP_COPY=y
diff --git a/arch/blackfin/configs/BF561-EZKIT_defconfig b/arch/blackfin/configs/BF561-EZKIT_defconfig
new file mode 100644
index 000000000000..e32ca2072cbf
--- /dev/null
+++ b/arch/blackfin/configs/BF561-EZKIT_defconfig
@@ -0,0 +1,1073 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.19.3
4#
5# CONFIG_MMU is not set
6# CONFIG_FPU is not set
7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y
10CONFIG_BFIN=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_IRQ_PROBE=y
16CONFIG_GENERIC_CALIBRATE_DELAY=y
17CONFIG_UCLINUX=y
18CONFIG_FORCE_MAX_ZONEORDER=14
19CONFIG_IRQCHIP_DEMUX_GPIO=y
20CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
21
22#
23# Code maturity level options
24#
25CONFIG_EXPERIMENTAL=y
26CONFIG_BROKEN_ON_SMP=y
27CONFIG_INIT_ENV_ARG_LIMIT=32
28
29#
30# General setup
31#
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set
36# CONFIG_POSIX_MQUEUE is not set
37# CONFIG_BSD_PROCESS_ACCT is not set
38# CONFIG_TASKSTATS is not set
39# CONFIG_UTS_NS is not set
40# CONFIG_AUDIT is not set
41# CONFIG_IKCONFIG is not set
42# CONFIG_RELAY is not set
43CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SYSCTL=y
46CONFIG_EMBEDDED=y
47# CONFIG_UID16 is not set
48CONFIG_SYSCTL_SYSCALL=y
49CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_EXTRA_PASS is not set
51CONFIG_HOTPLUG=y
52CONFIG_PRINTK=y
53CONFIG_BUG=y
54CONFIG_ELF_CORE=y
55CONFIG_BASE_FULL=y
56CONFIG_FUTEX=y
57CONFIG_EPOLL=y
58CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
59# CONFIG_LIMIT_PAGECACHE is not set
60CONFIG_BUDDY=y
61# CONFIG_NP2 is not set
62CONFIG_SLAB=y
63CONFIG_VM_EVENT_COUNTERS=y
64CONFIG_RT_MUTEXES=y
65CONFIG_TINY_SHMEM=y
66CONFIG_BASE_SMALL=0
67# CONFIG_SLOB is not set
68
69#
70# Loadable module support
71#
72CONFIG_MODULES=y
73CONFIG_MODULE_UNLOAD=y
74# CONFIG_MODULE_FORCE_UNLOAD is not set
75# CONFIG_MODVERSIONS is not set
76# CONFIG_MODULE_SRCVERSION_ALL is not set
77CONFIG_KMOD=y
78
79#
80# Block layer
81#
82CONFIG_BLOCK=y
83# CONFIG_BLK_DEV_IO_TRACE is not set
84
85#
86# IO Schedulers
87#
88CONFIG_IOSCHED_NOOP=y
89CONFIG_IOSCHED_AS=y
90# CONFIG_IOSCHED_DEADLINE is not set
91CONFIG_IOSCHED_CFQ=y
92CONFIG_DEFAULT_AS=y
93# CONFIG_DEFAULT_DEADLINE is not set
94# CONFIG_DEFAULT_CFQ is not set
95# CONFIG_DEFAULT_NOOP is not set
96CONFIG_DEFAULT_IOSCHED="anticipatory"
97# CONFIG_PREEMPT_NONE is not set
98CONFIG_PREEMPT_VOLUNTARY=y
99# CONFIG_PREEMPT is not set
100
101#
102# Blackfin Processor Options
103#
104
105#
106# Processor and Board Settings
107#
108# CONFIG_BF531 is not set
109# CONFIG_BF532 is not set
110# CONFIG_BF533 is not set
111# CONFIG_BF534 is not set
112# CONFIG_BF535 is not set
113# CONFIG_BF536 is not set
114# CONFIG_BF537 is not set
115CONFIG_BF561=y
116# CONFIG_BF_REV_0_2 is not set
117CONFIG_BF_REV_0_3=y
118# CONFIG_BF_REV_0_4 is not set
119# CONFIG_BF_REV_0_5 is not set
120CONFIG_BFIN_DUAL_CORE=y
121# CONFIG_BFIN533_EZKIT is not set
122# CONFIG_BFIN533_STAMP is not set
123# CONFIG_BFIN537_STAMP is not set
124# CONFIG_BFIN533_BLUETECHNIX_CM is not set
125# CONFIG_BFIN537_BLUETECHNIX_CM is not set
126# CONFIG_BFIN561_BLUETECHNIX_CM is not set
127CONFIG_BFIN561_EZKIT=y
128# CONFIG_PNAV10 is not set
129# CONFIG_GENERIC_BOARD is not set
130CONFIG_MEM_MT48LC16M16A2TG_75=y
131
132#
133# BF561 Specific Configuration
134#
135
136#
137# Core B Support
138#
139
140#
141# Core B Support
142#
143CONFIG_BF561_COREB=y
144CONFIG_BF561_COREB_RESET=y
145
146#
147# Interrupt Priority Assignment
148#
149
150#
151# Priority
152#
153CONFIG_IRQ_PLL_WAKEUP=7
154CONFIG_IRQ_DMA1_ERROR=7
155CONFIG_IRQ_DMA2_ERROR=7
156CONFIG_IRQ_IMDMA_ERROR=7
157CONFIG_IRQ_PPI0_ERROR=7
158CONFIG_IRQ_PPI1_ERROR=7
159CONFIG_IRQ_SPORT0_ERROR=7
160CONFIG_IRQ_SPORT1_ERROR=7
161CONFIG_IRQ_SPI_ERROR=7
162CONFIG_IRQ_UART_ERROR=7
163CONFIG_IRQ_RESERVED_ERROR=7
164CONFIG_IRQ_DMA1_0=8
165CONFIG_IRQ_DMA1_1=8
166CONFIG_IRQ_DMA1_2=8
167CONFIG_IRQ_DMA1_3=8
168CONFIG_IRQ_DMA1_4=8
169CONFIG_IRQ_DMA1_5=8
170CONFIG_IRQ_DMA1_6=8
171CONFIG_IRQ_DMA1_7=8
172CONFIG_IRQ_DMA1_8=8
173CONFIG_IRQ_DMA1_9=8
174CONFIG_IRQ_DMA1_10=8
175CONFIG_IRQ_DMA1_11=8
176CONFIG_IRQ_DMA2_0=9
177CONFIG_IRQ_DMA2_1=9
178CONFIG_IRQ_DMA2_2=9
179CONFIG_IRQ_DMA2_3=9
180CONFIG_IRQ_DMA2_4=9
181CONFIG_IRQ_DMA2_5=9
182CONFIG_IRQ_DMA2_6=9
183CONFIG_IRQ_DMA2_7=9
184CONFIG_IRQ_DMA2_8=9
185CONFIG_IRQ_DMA2_9=9
186CONFIG_IRQ_DMA2_10=9
187CONFIG_IRQ_DMA2_11=9
188CONFIG_IRQ_TIMER0=10
189CONFIG_IRQ_TIMER1=10
190CONFIG_IRQ_TIMER2=10
191CONFIG_IRQ_TIMER3=10
192CONFIG_IRQ_TIMER4=10
193CONFIG_IRQ_TIMER5=10
194CONFIG_IRQ_TIMER6=10
195CONFIG_IRQ_TIMER7=10
196CONFIG_IRQ_TIMER8=10
197CONFIG_IRQ_TIMER9=10
198CONFIG_IRQ_TIMER10=10
199CONFIG_IRQ_TIMER11=10
200CONFIG_IRQ_PROG0_INTA=11
201CONFIG_IRQ_PROG0_INTB=11
202CONFIG_IRQ_PROG1_INTA=11
203CONFIG_IRQ_PROG1_INTB=11
204CONFIG_IRQ_PROG2_INTA=11
205CONFIG_IRQ_PROG2_INTB=11
206CONFIG_IRQ_DMA1_WRRD0=8
207CONFIG_IRQ_DMA1_WRRD1=8
208CONFIG_IRQ_DMA2_WRRD0=9
209CONFIG_IRQ_DMA2_WRRD1=9
210CONFIG_IRQ_IMDMA_WRRD0=12
211CONFIG_IRQ_IMDMA_WRRD1=12
212CONFIG_IRQ_WDTIMER=13
213
214#
215# Board customizations
216#
217
218#
219# Board Setup
220#
221CONFIG_CLKIN_HZ=30000000
222CONFIG_MEM_SIZE=64
223CONFIG_MEM_ADD_WIDTH=9
224CONFIG_BOOT_LOAD=0x1000
225
226#
227# Console UART Setup
228#
229# CONFIG_BAUD_9600 is not set
230# CONFIG_BAUD_19200 is not set
231# CONFIG_BAUD_38400 is not set
232CONFIG_BAUD_57600=y
233# CONFIG_BAUD_115200 is not set
234CONFIG_BAUD_NO_PARITY=y
235# CONFIG_BAUD_PARITY is not set
236CONFIG_BAUD_1_STOPBIT=y
237# CONFIG_BAUD_2_STOPBIT is not set
238
239#
240# Blackfin Kernel Optimizations
241#
242
243#
244# Timer Tick
245#
246# CONFIG_HZ_100 is not set
247CONFIG_HZ_250=y
248# CONFIG_HZ_1000 is not set
249CONFIG_HZ=250
250
251#
252# Memory Optimizations
253#
254CONFIG_I_ENTRY_L1=y
255CONFIG_EXCPT_IRQ_SYSC_L1=y
256CONFIG_DO_IRQ_L1=y
257CONFIG_CORE_TIMER_IRQ_L1=y
258CONFIG_IDLE_L1=y
259CONFIG_SCHEDULE_L1=y
260CONFIG_ARITHMETIC_OPS_L1=y
261CONFIG_ACCESS_OK_L1=y
262CONFIG_MEMSET_L1=y
263CONFIG_MEMCPY_L1=y
264CONFIG_SYS_BFIN_SPINLOCK_L1=y
265# CONFIG_IP_CHECKSUM_L1 is not set
266# CONFIG_SYSCALL_TAB_L1 is not set
267# CONFIG_CPLB_SWITCH_TAB_L1 is not set
268CONFIG_RAMKERNEL=y
269# CONFIG_ROMKERNEL is not set
270CONFIG_SELECT_MEMORY_MODEL=y
271CONFIG_FLATMEM_MANUAL=y
272# CONFIG_DISCONTIGMEM_MANUAL is not set
273# CONFIG_SPARSEMEM_MANUAL is not set
274CONFIG_FLATMEM=y
275CONFIG_FLAT_NODE_MEM_MAP=y
276# CONFIG_SPARSEMEM_STATIC is not set
277CONFIG_SPLIT_PTLOCK_CPUS=4
278# CONFIG_RESOURCES_64BIT is not set
279CONFIG_LARGE_ALLOCS=y
280CONFIG_BFIN_DMA_5XX=y
281# CONFIG_DMA_UNCACHED_2M is not set
282CONFIG_DMA_UNCACHED_1M=y
283# CONFIG_DMA_UNCACHED_NONE is not set
284
285#
286# Cache Support
287#
288CONFIG_BLKFIN_CACHE=y
289CONFIG_BLKFIN_DCACHE=y
290# CONFIG_BLKFIN_DCACHE_BANKA is not set
291# CONFIG_BLKFIN_CACHE_LOCK is not set
292# CONFIG_BLKFIN_WB is not set
293CONFIG_BLKFIN_WT=y
294CONFIG_L1_MAX_PIECE=16
295
296#
297# Clock Settings
298#
299# CONFIG_BFIN_KERNEL_CLOCK is not set
300
301#
302# Asynchonous Memory Configuration
303#
304
305#
306# EBIU_AMBCTL Global Control
307#
308CONFIG_C_AMCKEN=y
309CONFIG_C_CDPRIO=y
310CONFIG_C_B0PEN=y
311CONFIG_C_B1PEN=y
312CONFIG_C_B2PEN=y
313# CONFIG_C_B3PEN is not set
314# CONFIG_C_AMBEN is not set
315# CONFIG_C_AMBEN_B0 is not set
316# CONFIG_C_AMBEN_B0_B1 is not set
317# CONFIG_C_AMBEN_B0_B1_B2 is not set
318CONFIG_C_AMBEN_ALL=y
319
320#
321# EBIU_AMBCTL Control
322#
323CONFIG_BANK_0=0x7BB0
324CONFIG_BANK_1=0x7BB0
325CONFIG_BANK_2=0x7BB0
326CONFIG_BANK_3=0x99B3
327
328#
329# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
330#
331# CONFIG_PCI is not set
332
333#
334# PCCARD (PCMCIA/CardBus) support
335#
336# CONFIG_PCCARD is not set
337
338#
339# PCI Hotplug Support
340#
341
342#
343# Executable file formats
344#
345CONFIG_BINFMT_ELF_FDPIC=y
346CONFIG_BINFMT_FLAT=y
347CONFIG_BINFMT_ZFLAT=y
348# CONFIG_BINFMT_SHARED_FLAT is not set
349# CONFIG_BINFMT_MISC is not set
350
351#
352# Power management options
353#
354# CONFIG_PM is not set
355
356#
357# Networking
358#
359CONFIG_NET=y
360
361#
362# Networking options
363#
364# CONFIG_NETDEBUG is not set
365CONFIG_PACKET=y
366# CONFIG_PACKET_MMAP is not set
367CONFIG_UNIX=y
368CONFIG_XFRM=y
369# CONFIG_XFRM_USER is not set
370# CONFIG_XFRM_SUB_POLICY is not set
371# CONFIG_NET_KEY is not set
372CONFIG_INET=y
373# CONFIG_IP_MULTICAST is not set
374# CONFIG_IP_ADVANCED_ROUTER is not set
375CONFIG_IP_FIB_HASH=y
376CONFIG_IP_PNP=y
377# CONFIG_IP_PNP_DHCP is not set
378# CONFIG_IP_PNP_BOOTP is not set
379# CONFIG_IP_PNP_RARP is not set
380# CONFIG_NET_IPIP is not set
381# CONFIG_NET_IPGRE is not set
382# CONFIG_ARPD is not set
383CONFIG_SYN_COOKIES=y
384# CONFIG_INET_AH is not set
385# CONFIG_INET_ESP is not set
386# CONFIG_INET_IPCOMP is not set
387# CONFIG_INET_XFRM_TUNNEL is not set
388# CONFIG_INET_TUNNEL is not set
389CONFIG_INET_XFRM_MODE_TRANSPORT=y
390CONFIG_INET_XFRM_MODE_TUNNEL=y
391CONFIG_INET_XFRM_MODE_BEET=y
392CONFIG_INET_DIAG=y
393CONFIG_INET_TCP_DIAG=y
394# CONFIG_TCP_CONG_ADVANCED is not set
395CONFIG_TCP_CONG_CUBIC=y
396CONFIG_DEFAULT_TCP_CONG="cubic"
397# CONFIG_IPV6 is not set
398# CONFIG_INET6_XFRM_TUNNEL is not set
399# CONFIG_INET6_TUNNEL is not set
400# CONFIG_NETLABEL is not set
401# CONFIG_NETWORK_SECMARK is not set
402# CONFIG_NETFILTER is not set
403
404#
405# DCCP Configuration (EXPERIMENTAL)
406#
407# CONFIG_IP_DCCP is not set
408
409#
410# SCTP Configuration (EXPERIMENTAL)
411#
412# CONFIG_IP_SCTP is not set
413
414#
415# TIPC Configuration (EXPERIMENTAL)
416#
417# CONFIG_TIPC is not set
418# CONFIG_ATM is not set
419# CONFIG_BRIDGE is not set
420# CONFIG_VLAN_8021Q is not set
421# CONFIG_DECNET is not set
422# CONFIG_LLC2 is not set
423# CONFIG_IPX is not set
424# CONFIG_ATALK is not set
425# CONFIG_X25 is not set
426# CONFIG_LAPB is not set
427# CONFIG_ECONET is not set
428# CONFIG_WAN_ROUTER is not set
429
430#
431# QoS and/or fair queueing
432#
433# CONFIG_NET_SCHED is not set
434
435#
436# Network testing
437#
438# CONFIG_NET_PKTGEN is not set
439# CONFIG_HAMRADIO is not set
440# CONFIG_IRDA is not set
441# CONFIG_BT is not set
442# CONFIG_IEEE80211 is not set
443
444#
445# Device Drivers
446#
447
448#
449# Generic Driver Options
450#
451CONFIG_STANDALONE=y
452CONFIG_PREVENT_FIRMWARE_BUILD=y
453# CONFIG_FW_LOADER is not set
454# CONFIG_SYS_HYPERVISOR is not set
455
456#
457# Connector - unified userspace <-> kernelspace linker
458#
459# CONFIG_CONNECTOR is not set
460
461#
462# Memory Technology Devices (MTD)
463#
464CONFIG_MTD=y
465# CONFIG_MTD_DEBUG is not set
466# CONFIG_MTD_CONCAT is not set
467CONFIG_MTD_PARTITIONS=y
468# CONFIG_MTD_REDBOOT_PARTS is not set
469# CONFIG_MTD_CMDLINE_PARTS is not set
470
471#
472# User Modules And Translation Layers
473#
474CONFIG_MTD_CHAR=m
475CONFIG_MTD_BLOCK=y
476# CONFIG_FTL is not set
477# CONFIG_NFTL is not set
478# CONFIG_INFTL is not set
479# CONFIG_RFD_FTL is not set
480# CONFIG_SSFDC is not set
481
482#
483# RAM/ROM/Flash chip drivers
484#
485# CONFIG_MTD_CFI is not set
486CONFIG_MTD_JEDECPROBE=m
487CONFIG_MTD_GEN_PROBE=m
488# CONFIG_MTD_CFI_ADV_OPTIONS is not set
489CONFIG_MTD_MAP_BANK_WIDTH_1=y
490CONFIG_MTD_MAP_BANK_WIDTH_2=y
491CONFIG_MTD_MAP_BANK_WIDTH_4=y
492# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
493# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
494# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
495CONFIG_MTD_CFI_I1=y
496CONFIG_MTD_CFI_I2=y
497# CONFIG_MTD_CFI_I4 is not set
498# CONFIG_MTD_CFI_I8 is not set
499# CONFIG_MTD_CFI_INTELEXT is not set
500# CONFIG_MTD_CFI_AMDSTD is not set
501# CONFIG_MTD_CFI_STAA is not set
502CONFIG_MTD_MW320D=m
503CONFIG_MTD_RAM=y
504CONFIG_MTD_ROM=m
505# CONFIG_MTD_ABSENT is not set
506# CONFIG_MTD_OBSOLETE_CHIPS is not set
507
508#
509# Mapping drivers for chip access
510#
511CONFIG_MTD_COMPLEX_MAPPINGS=y
512# CONFIG_MTD_PHYSMAP is not set
513# CONFIG_MTD_EZKIT561 is not set
514CONFIG_MTD_BF5xx=m
515CONFIG_BFIN_FLASH_SIZE=0x0400000
516CONFIG_EBIU_FLASH_BASE=0x20000000
517
518#
519# FLASH_EBIU_AMBCTL Control
520#
521CONFIG_BFIN_FLASH_BANK_0=0x7BB0
522CONFIG_BFIN_FLASH_BANK_1=0x7BB0
523CONFIG_BFIN_FLASH_BANK_2=0x7BB0
524CONFIG_BFIN_FLASH_BANK_3=0x7BB0
525# CONFIG_MTD_UCLINUX is not set
526# CONFIG_MTD_PLATRAM is not set
527
528#
529# Self-contained MTD device drivers
530#
531# CONFIG_MTD_SLRAM is not set
532# CONFIG_MTD_PHRAM is not set
533# CONFIG_MTD_MTDRAM is not set
534# CONFIG_MTD_BLOCK2MTD is not set
535
536#
537# Disk-On-Chip Device Drivers
538#
539# CONFIG_MTD_DOC2000 is not set
540# CONFIG_MTD_DOC2001 is not set
541# CONFIG_MTD_DOC2001PLUS is not set
542
543#
544# NAND Flash Device Drivers
545#
546# CONFIG_MTD_NAND is not set
547
548#
549# OneNAND Flash Device Drivers
550#
551# CONFIG_MTD_ONENAND is not set
552
553#
554# Parallel port support
555#
556# CONFIG_PARPORT is not set
557
558#
559# Plug and Play support
560#
561
562#
563# Block devices
564#
565# CONFIG_BLK_DEV_COW_COMMON is not set
566# CONFIG_BLK_DEV_LOOP is not set
567# CONFIG_BLK_DEV_NBD is not set
568CONFIG_BLK_DEV_RAM=y
569CONFIG_BLK_DEV_RAM_COUNT=16
570CONFIG_BLK_DEV_RAM_SIZE=4096
571CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
572# CONFIG_BLK_DEV_INITRD is not set
573# CONFIG_CDROM_PKTCDVD is not set
574# CONFIG_ATA_OVER_ETH is not set
575
576#
577# Misc devices
578#
579# CONFIG_TIFM_CORE is not set
580
581#
582# ATA/ATAPI/MFM/RLL support
583#
584# CONFIG_IDE is not set
585
586#
587# SCSI device support
588#
589# CONFIG_RAID_ATTRS is not set
590# CONFIG_SCSI is not set
591# CONFIG_SCSI_NETLINK is not set
592
593#
594# Serial ATA (prod) and Parallel ATA (experimental) drivers
595#
596# CONFIG_ATA is not set
597
598#
599# Multi-device support (RAID and LVM)
600#
601# CONFIG_MD is not set
602
603#
604# Fusion MPT device support
605#
606# CONFIG_FUSION is not set
607
608#
609# IEEE 1394 (FireWire) support
610#
611
612#
613# I2O device support
614#
615
616#
617# Network device support
618#
619CONFIG_NETDEVICES=y
620# CONFIG_DUMMY is not set
621# CONFIG_BONDING is not set
622# CONFIG_EQUALIZER is not set
623# CONFIG_TUN is not set
624
625#
626# PHY device support
627#
628# CONFIG_PHYLIB is not set
629
630#
631# Ethernet (10 or 100Mbit)
632#
633CONFIG_NET_ETHERNET=y
634CONFIG_MII=y
635CONFIG_SMC91X=y
636
637#
638# Ethernet (1000 Mbit)
639#
640
641#
642# Ethernet (10000 Mbit)
643#
644
645#
646# Token Ring devices
647#
648
649#
650# Wireless LAN (non-hamradio)
651#
652# CONFIG_NET_RADIO is not set
653
654#
655# Wan interfaces
656#
657# CONFIG_WAN is not set
658# CONFIG_PPP is not set
659# CONFIG_SLIP is not set
660# CONFIG_SHAPER is not set
661# CONFIG_NETCONSOLE is not set
662# CONFIG_NETPOLL is not set
663# CONFIG_NET_POLL_CONTROLLER is not set
664
665#
666# ISDN subsystem
667#
668# CONFIG_ISDN is not set
669
670#
671# Telephony Support
672#
673# CONFIG_PHONE is not set
674
675#
676# Input device support
677#
678# CONFIG_INPUT is not set
679
680#
681# Hardware I/O ports
682#
683# CONFIG_SERIO is not set
684# CONFIG_GAMEPORT is not set
685
686#
687# Character devices
688#
689# CONFIG_AD9960 is not set
690# CONFIG_SPI_ADC_BF533 is not set
691# CONFIG_BF533_PFLAGS is not set
692# CONFIG_BF5xx_PPIFCD is not set
693# CONFIG_BF5xx_TIMERS is not set
694# CONFIG_BF5xx_PPI is not set
695# CONFIG_BFIN_SPORT is not set
696# CONFIG_BFIN_TIMER_LATENCY is not set
697# CONFIG_VT is not set
698# CONFIG_SERIAL_NONSTANDARD is not set
699
700#
701# Serial drivers
702#
703# CONFIG_SERIAL_8250 is not set
704
705#
706# Non-8250 serial port support
707#
708CONFIG_SERIAL_BFIN=y
709CONFIG_SERIAL_BFIN_CONSOLE=y
710CONFIG_SERIAL_BFIN_DMA=y
711# CONFIG_SERIAL_BFIN_PIO is not set
712CONFIG_SERIAL_BFIN_UART0=y
713# CONFIG_BFIN_UART0_CTSRTS is not set
714CONFIG_SERIAL_CORE=y
715CONFIG_SERIAL_CORE_CONSOLE=y
716# CONFIG_SERIAL_BFIN_SPORT is not set
717CONFIG_UNIX98_PTYS=y
718# CONFIG_LEGACY_PTYS is not set
719
720#
721# CAN, the car bus and industrial fieldbus
722#
723# CONFIG_CAN4LINUX is not set
724
725#
726# IPMI
727#
728# CONFIG_IPMI_HANDLER is not set
729
730#
731# Watchdog Cards
732#
733# CONFIG_WATCHDOG is not set
734CONFIG_HW_RANDOM=y
735# CONFIG_GEN_RTC is not set
736# CONFIG_BLACKFIN_DPMC is not set
737# CONFIG_DTLK is not set
738# CONFIG_R3964 is not set
739
740#
741# Ftape, the floppy tape device driver
742#
743# CONFIG_RAW_DRIVER is not set
744
745#
746# TPM devices
747#
748# CONFIG_TCG_TPM is not set
749
750#
751# I2C support
752#
753# CONFIG_I2C is not set
754
755#
756# SPI support
757#
758# CONFIG_SPI is not set
759# CONFIG_SPI_MASTER is not set
760
761#
762# Dallas's 1-wire bus
763#
764# CONFIG_W1 is not set
765
766#
767# Hardware Monitoring support
768#
769CONFIG_HWMON=y
770# CONFIG_HWMON_VID is not set
771# CONFIG_SENSORS_ABITUGURU is not set
772# CONFIG_SENSORS_F71805F is not set
773# CONFIG_SENSORS_VT1211 is not set
774# CONFIG_HWMON_DEBUG_CHIP is not set
775
776#
777# Multimedia devices
778#
779# CONFIG_VIDEO_DEV is not set
780
781#
782# Digital Video Broadcasting Devices
783#
784# CONFIG_DVB is not set
785
786#
787# Graphics support
788#
789CONFIG_FIRMWARE_EDID=y
790# CONFIG_FB is not set
791# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
792
793#
794# Sound
795#
796# CONFIG_SOUND is not set
797
798#
799# USB support
800#
801CONFIG_USB_ARCH_HAS_HCD=y
802# CONFIG_USB_ARCH_HAS_OHCI is not set
803# CONFIG_USB_ARCH_HAS_EHCI is not set
804# CONFIG_USB is not set
805
806#
807# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
808#
809
810#
811# USB Gadget Support
812#
813# CONFIG_USB_GADGET is not set
814
815#
816# MMC/SD Card support
817#
818# CONFIG_MMC is not set
819
820#
821# LED devices
822#
823# CONFIG_NEW_LEDS is not set
824
825#
826# LED drivers
827#
828
829#
830# LED Triggers
831#
832
833#
834# InfiniBand support
835#
836
837#
838# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
839#
840
841#
842# Real Time Clock
843#
844# CONFIG_RTC_CLASS is not set
845
846#
847# DMA Engine support
848#
849# CONFIG_DMA_ENGINE is not set
850
851#
852# DMA Clients
853#
854
855#
856# DMA Devices
857#
858
859#
860# PBX support
861#
862# CONFIG_PBX is not set
863
864#
865# File systems
866#
867CONFIG_EXT2_FS=y
868CONFIG_EXT2_FS_XATTR=y
869# CONFIG_EXT2_FS_POSIX_ACL is not set
870# CONFIG_EXT2_FS_SECURITY is not set
871# CONFIG_EXT3_FS is not set
872# CONFIG_EXT4DEV_FS is not set
873CONFIG_FS_MBCACHE=y
874# CONFIG_REISERFS_FS is not set
875# CONFIG_JFS_FS is not set
876# CONFIG_FS_POSIX_ACL is not set
877# CONFIG_XFS_FS is not set
878# CONFIG_GFS2_FS is not set
879# CONFIG_OCFS2_FS is not set
880# CONFIG_MINIX_FS is not set
881# CONFIG_ROMFS_FS is not set
882CONFIG_INOTIFY=y
883CONFIG_INOTIFY_USER=y
884# CONFIG_QUOTA is not set
885CONFIG_DNOTIFY=y
886# CONFIG_AUTOFS_FS is not set
887# CONFIG_AUTOFS4_FS is not set
888# CONFIG_FUSE_FS is not set
889
890#
891# CD-ROM/DVD Filesystems
892#
893# CONFIG_ISO9660_FS is not set
894# CONFIG_UDF_FS is not set
895
896#
897# DOS/FAT/NT Filesystems
898#
899# CONFIG_MSDOS_FS is not set
900# CONFIG_VFAT_FS is not set
901# CONFIG_NTFS_FS is not set
902
903#
904# Pseudo filesystems
905#
906CONFIG_PROC_FS=y
907CONFIG_PROC_SYSCTL=y
908CONFIG_SYSFS=y
909# CONFIG_TMPFS is not set
910# CONFIG_HUGETLB_PAGE is not set
911CONFIG_RAMFS=y
912# CONFIG_CONFIGFS_FS is not set
913
914#
915# Miscellaneous filesystems
916#
917# CONFIG_ADFS_FS is not set
918# CONFIG_AFFS_FS is not set
919# CONFIG_HFS_FS is not set
920# CONFIG_HFSPLUS_FS is not set
921# CONFIG_BEFS_FS is not set
922# CONFIG_BFS_FS is not set
923# CONFIG_EFS_FS is not set
924CONFIG_YAFFS_FS=m
925CONFIG_YAFFS_YAFFS1=y
926# CONFIG_YAFFS_DOES_ECC is not set
927CONFIG_YAFFS_YAFFS2=y
928CONFIG_YAFFS_AUTO_YAFFS2=y
929# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
930CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
931# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
932# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
933CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
934# CONFIG_JFFS_FS is not set
935CONFIG_JFFS2_FS=m
936CONFIG_JFFS2_FS_DEBUG=0
937CONFIG_JFFS2_FS_WRITEBUFFER=y
938# CONFIG_JFFS2_SUMMARY is not set
939# CONFIG_JFFS2_FS_XATTR is not set
940# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
941CONFIG_JFFS2_ZLIB=y
942CONFIG_JFFS2_RTIME=y
943# CONFIG_JFFS2_RUBIN is not set
944# CONFIG_CRAMFS is not set
945# CONFIG_VXFS_FS is not set
946# CONFIG_HPFS_FS is not set
947# CONFIG_QNX4FS_FS is not set
948# CONFIG_SYSV_FS is not set
949# CONFIG_UFS_FS is not set
950
951#
952# Network File Systems
953#
954CONFIG_NFS_FS=m
955CONFIG_NFS_V3=y
956# CONFIG_NFS_V3_ACL is not set
957# CONFIG_NFS_V4 is not set
958# CONFIG_NFS_DIRECTIO is not set
959# CONFIG_NFSD is not set
960CONFIG_LOCKD=m
961CONFIG_LOCKD_V4=y
962CONFIG_NFS_COMMON=y
963CONFIG_SUNRPC=m
964# CONFIG_RPCSEC_GSS_KRB5 is not set
965# CONFIG_RPCSEC_GSS_SPKM3 is not set
966CONFIG_SMB_FS=m
967# CONFIG_SMB_NLS_DEFAULT is not set
968# CONFIG_CIFS is not set
969# CONFIG_NCP_FS is not set
970# CONFIG_CODA_FS is not set
971# CONFIG_AFS_FS is not set
972# CONFIG_9P_FS is not set
973
974#
975# Partition Types
976#
977# CONFIG_PARTITION_ADVANCED is not set
978CONFIG_MSDOS_PARTITION=y
979
980#
981# Native Language Support
982#
983CONFIG_NLS=m
984CONFIG_NLS_DEFAULT="iso8859-1"
985# CONFIG_NLS_CODEPAGE_437 is not set
986# CONFIG_NLS_CODEPAGE_737 is not set
987# CONFIG_NLS_CODEPAGE_775 is not set
988# CONFIG_NLS_CODEPAGE_850 is not set
989# CONFIG_NLS_CODEPAGE_852 is not set
990# CONFIG_NLS_CODEPAGE_855 is not set
991# CONFIG_NLS_CODEPAGE_857 is not set
992# CONFIG_NLS_CODEPAGE_860 is not set
993# CONFIG_NLS_CODEPAGE_861 is not set
994# CONFIG_NLS_CODEPAGE_862 is not set
995# CONFIG_NLS_CODEPAGE_863 is not set
996# CONFIG_NLS_CODEPAGE_864 is not set
997# CONFIG_NLS_CODEPAGE_865 is not set
998# CONFIG_NLS_CODEPAGE_866 is not set
999# CONFIG_NLS_CODEPAGE_869 is not set
1000# CONFIG_NLS_CODEPAGE_936 is not set
1001# CONFIG_NLS_CODEPAGE_950 is not set
1002# CONFIG_NLS_CODEPAGE_932 is not set
1003# CONFIG_NLS_CODEPAGE_949 is not set
1004# CONFIG_NLS_CODEPAGE_874 is not set
1005# CONFIG_NLS_ISO8859_8 is not set
1006# CONFIG_NLS_CODEPAGE_1250 is not set
1007# CONFIG_NLS_CODEPAGE_1251 is not set
1008# CONFIG_NLS_ASCII is not set
1009# CONFIG_NLS_ISO8859_1 is not set
1010# CONFIG_NLS_ISO8859_2 is not set
1011# CONFIG_NLS_ISO8859_3 is not set
1012# CONFIG_NLS_ISO8859_4 is not set
1013# CONFIG_NLS_ISO8859_5 is not set
1014# CONFIG_NLS_ISO8859_6 is not set
1015# CONFIG_NLS_ISO8859_7 is not set
1016# CONFIG_NLS_ISO8859_9 is not set
1017# CONFIG_NLS_ISO8859_13 is not set
1018# CONFIG_NLS_ISO8859_14 is not set
1019# CONFIG_NLS_ISO8859_15 is not set
1020# CONFIG_NLS_KOI8_R is not set
1021# CONFIG_NLS_KOI8_U is not set
1022# CONFIG_NLS_UTF8 is not set
1023
1024#
1025# Profiling support
1026#
1027# CONFIG_PROFILING is not set
1028
1029#
1030# Kernel hacking
1031#
1032# CONFIG_PRINTK_TIME is not set
1033CONFIG_ENABLE_MUST_CHECK=y
1034# CONFIG_MAGIC_SYSRQ is not set
1035# CONFIG_UNUSED_SYMBOLS is not set
1036# CONFIG_DEBUG_KERNEL is not set
1037CONFIG_LOG_BUF_SHIFT=14
1038# CONFIG_DEBUG_BUGVERBOSE is not set
1039# CONFIG_DEBUG_FS is not set
1040# CONFIG_UNWIND_INFO is not set
1041# CONFIG_HEADERS_CHECK is not set
1042# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set
1043CONFIG_DEBUG_HUNT_FOR_ZERO=y
1044# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1045# CONFIG_DUAL_CORE_TEST_MODULE is not set
1046# CONFIG_BOOTPARAM is not set
1047# CONFIG_NO_KERNEL_MSG is not set
1048CONFIG_CPLB_INFO=y
1049# CONFIG_NO_ACCESS_CHECK is not set
1050
1051#
1052# Security options
1053#
1054# CONFIG_KEYS is not set
1055CONFIG_SECURITY=y
1056# CONFIG_SECURITY_NETWORK is not set
1057CONFIG_SECURITY_CAPABILITIES=y
1058
1059#
1060# Cryptographic options
1061#
1062# CONFIG_CRYPTO is not set
1063
1064#
1065# Library routines
1066#
1067# CONFIG_CRC_CCITT is not set
1068# CONFIG_CRC16 is not set
1069CONFIG_CRC32=y
1070# CONFIG_LIBCRC32C is not set
1071CONFIG_ZLIB_INFLATE=y
1072CONFIG_ZLIB_DEFLATE=m
1073CONFIG_PLIST=y
diff --git a/arch/blackfin/configs/PNAV-10_defconfig b/arch/blackfin/configs/PNAV-10_defconfig
new file mode 100644
index 000000000000..97b4ffa2b4ac
--- /dev/null
+++ b/arch/blackfin/configs/PNAV-10_defconfig
@@ -0,0 +1,1253 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.19.3
4#
5# CONFIG_MMU is not set
6# CONFIG_FPU is not set
7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y
10CONFIG_BFIN=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_IRQ_PROBE=y
16CONFIG_GENERIC_CALIBRATE_DELAY=y
17CONFIG_UCLINUX=y
18CONFIG_FORCE_MAX_ZONEORDER=14
19CONFIG_IRQCHIP_DEMUX_GPIO=y
20CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
21
22#
23# Code maturity level options
24#
25CONFIG_EXPERIMENTAL=y
26CONFIG_BROKEN_ON_SMP=y
27CONFIG_INIT_ENV_ARG_LIMIT=32
28
29#
30# General setup
31#
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set
36# CONFIG_POSIX_MQUEUE is not set
37# CONFIG_BSD_PROCESS_ACCT is not set
38# CONFIG_TASKSTATS is not set
39# CONFIG_UTS_NS is not set
40# CONFIG_AUDIT is not set
41# CONFIG_IKCONFIG is not set
42# CONFIG_RELAY is not set
43CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SYSCTL=y
46CONFIG_EMBEDDED=y
47CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y
49CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_EXTRA_PASS is not set
51CONFIG_HOTPLUG=y
52CONFIG_PRINTK=y
53CONFIG_BUG=y
54CONFIG_ELF_CORE=y
55CONFIG_BASE_FULL=y
56CONFIG_FUTEX=y
57CONFIG_EPOLL=y
58CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=9
59# CONFIG_LIMIT_PAGECACHE is not set
60CONFIG_BUDDY=y
61# CONFIG_NP2 is not set
62CONFIG_SLAB=y
63CONFIG_VM_EVENT_COUNTERS=y
64CONFIG_RT_MUTEXES=y
65CONFIG_TINY_SHMEM=y
66CONFIG_BASE_SMALL=0
67# CONFIG_SLOB is not set
68
69#
70# Loadable module support
71#
72CONFIG_MODULES=y
73CONFIG_MODULE_UNLOAD=y
74# CONFIG_MODULE_FORCE_UNLOAD is not set
75# CONFIG_MODVERSIONS is not set
76# CONFIG_MODULE_SRCVERSION_ALL is not set
77CONFIG_KMOD=y
78
79#
80# Block layer
81#
82CONFIG_BLOCK=y
83# CONFIG_BLK_DEV_IO_TRACE is not set
84
85#
86# IO Schedulers
87#
88CONFIG_IOSCHED_NOOP=y
89CONFIG_IOSCHED_AS=y
90# CONFIG_IOSCHED_DEADLINE is not set
91CONFIG_IOSCHED_CFQ=y
92CONFIG_DEFAULT_AS=y
93# CONFIG_DEFAULT_DEADLINE is not set
94# CONFIG_DEFAULT_CFQ is not set
95# CONFIG_DEFAULT_NOOP is not set
96CONFIG_DEFAULT_IOSCHED="anticipatory"
97# CONFIG_PREEMPT_NONE is not set
98CONFIG_PREEMPT_VOLUNTARY=y
99# CONFIG_PREEMPT is not set
100
101#
102# Blackfin Processor Options
103#
104
105#
106# Processor and Board Settings
107#
108# CONFIG_BF531 is not set
109# CONFIG_BF532 is not set
110# CONFIG_BF533 is not set
111# CONFIG_BF534 is not set
112# CONFIG_BF535 is not set
113# CONFIG_BF536 is not set
114CONFIG_BF537=y
115# CONFIG_BF561 is not set
116CONFIG_BF_REV_0_2=y
117# CONFIG_BF_REV_0_3 is not set
118# CONFIG_BF_REV_0_4 is not set
119# CONFIG_BF_REV_0_5 is not set
120CONFIG_BFIN_SINGLE_CORE=y
121# CONFIG_BFIN533_EZKIT is not set
122# CONFIG_BFIN533_STAMP is not set
123# CONFIG_BFIN537_STAMP is not set
124# CONFIG_BFIN533_BLUETECHNIX_CM is not set
125# CONFIG_BFIN537_BLUETECHNIX_CM is not set
126# CONFIG_BFIN561_BLUETECHNIX_CM is not set
127# CONFIG_BFIN561_EZKIT is not set
128CONFIG_PNAV10=y
129# CONFIG_GENERIC_BOARD is not set
130CONFIG_MEM_MT48LC32M8A2_75=y
131CONFIG_IRQ_PLL_WAKEUP=7
132
133#
134# BF537 Specific Configuration
135#
136
137#
138# PORT F/G Selection
139#
140CONFIG_BF537_PORT_F=y
141# CONFIG_BF537_PORT_G is not set
142# CONFIG_BF537_PORT_H is not set
143
144#
145# Interrupt Priority Assignment
146#
147
148#
149# Priority
150#
151CONFIG_IRQ_DMA_ERROR=7
152CONFIG_IRQ_ERROR=7
153CONFIG_IRQ_RTC=8
154CONFIG_IRQ_PPI=8
155CONFIG_IRQ_SPORT0_RX=9
156CONFIG_IRQ_SPORT0_TX=9
157CONFIG_IRQ_SPORT1_RX=9
158CONFIG_IRQ_SPORT1_TX=9
159CONFIG_IRQ_TWI=10
160CONFIG_IRQ_SPI=10
161CONFIG_IRQ_UART0_RX=10
162CONFIG_IRQ_UART0_TX=10
163CONFIG_IRQ_UART1_RX=10
164CONFIG_IRQ_UART1_TX=10
165CONFIG_IRQ_CAN_RX=11
166CONFIG_IRQ_CAN_TX=11
167CONFIG_IRQ_MAC_RX=11
168CONFIG_IRQ_MAC_TX=11
169CONFIG_IRQ_TMR0=12
170CONFIG_IRQ_TMR1=12
171CONFIG_IRQ_TMR2=12
172CONFIG_IRQ_TMR3=12
173CONFIG_IRQ_TMR4=12
174CONFIG_IRQ_TMR5=12
175CONFIG_IRQ_TMR6=12
176CONFIG_IRQ_TMR7=12
177CONFIG_IRQ_PROG_INTA=12
178CONFIG_IRQ_PORTG_INTB=12
179CONFIG_IRQ_MEM_DMA0=13
180CONFIG_IRQ_MEM_DMA1=13
181CONFIG_IRQ_WATCH=13
182
183#
184# Board customizations
185#
186
187#
188# Board Setup
189#
190CONFIG_CLKIN_HZ=24576000
191CONFIG_MEM_SIZE=64
192CONFIG_MEM_ADD_WIDTH=10
193CONFIG_BOOT_LOAD=0x1000
194
195#
196# Console UART Setup
197#
198# CONFIG_BAUD_9600 is not set
199# CONFIG_BAUD_19200 is not set
200# CONFIG_BAUD_38400 is not set
201# CONFIG_BAUD_57600 is not set
202CONFIG_BAUD_115200=y
203CONFIG_BAUD_NO_PARITY=y
204# CONFIG_BAUD_PARITY is not set
205CONFIG_BAUD_1_STOPBIT=y
206# CONFIG_BAUD_2_STOPBIT is not set
207
208#
209# Blackfin Kernel Optimizations
210#
211
212#
213# Timer Tick
214#
215# CONFIG_HZ_100 is not set
216CONFIG_HZ_250=y
217# CONFIG_HZ_1000 is not set
218CONFIG_HZ=250
219
220#
221# Memory Optimizations
222#
223CONFIG_I_ENTRY_L1=y
224CONFIG_EXCPT_IRQ_SYSC_L1=y
225CONFIG_DO_IRQ_L1=y
226CONFIG_CORE_TIMER_IRQ_L1=y
227CONFIG_IDLE_L1=y
228CONFIG_SCHEDULE_L1=y
229CONFIG_ARITHMETIC_OPS_L1=y
230CONFIG_ACCESS_OK_L1=y
231CONFIG_MEMSET_L1=y
232CONFIG_MEMCPY_L1=y
233CONFIG_SYS_BFIN_SPINLOCK_L1=y
234CONFIG_IP_CHECKSUM_L1=y
235CONFIG_SYSCALL_TAB_L1=y
236CONFIG_CPLB_SWITCH_TAB_L1=y
237CONFIG_RAMKERNEL=y
238# CONFIG_ROMKERNEL is not set
239CONFIG_SELECT_MEMORY_MODEL=y
240CONFIG_FLATMEM_MANUAL=y
241# CONFIG_DISCONTIGMEM_MANUAL is not set
242# CONFIG_SPARSEMEM_MANUAL is not set
243CONFIG_FLATMEM=y
244CONFIG_FLAT_NODE_MEM_MAP=y
245# CONFIG_SPARSEMEM_STATIC is not set
246CONFIG_SPLIT_PTLOCK_CPUS=4
247# CONFIG_RESOURCES_64BIT is not set
248CONFIG_LARGE_ALLOCS=y
249CONFIG_BFIN_DMA_5XX=y
250# CONFIG_DMA_UNCACHED_2M is not set
251CONFIG_DMA_UNCACHED_1M=y
252# CONFIG_DMA_UNCACHED_NONE is not set
253
254#
255# Cache Support
256#
257CONFIG_BLKFIN_CACHE=y
258CONFIG_BLKFIN_DCACHE=y
259# CONFIG_BLKFIN_DCACHE_BANKA is not set
260# CONFIG_BLKFIN_CACHE_LOCK is not set
261CONFIG_BLKFIN_WB=y
262# CONFIG_BLKFIN_WT is not set
263CONFIG_L1_MAX_PIECE=16
264
265#
266# Clock Settings
267#
268# CONFIG_BFIN_KERNEL_CLOCK is not set
269
270#
271# Asynchonous Memory Configuration
272#
273
274#
275# EBIU_AMBCTL Global Control
276#
277CONFIG_C_AMCKEN=y
278CONFIG_C_CDPRIO=y
279# CONFIG_C_AMBEN is not set
280# CONFIG_C_AMBEN_B0 is not set
281# CONFIG_C_AMBEN_B0_B1 is not set
282# CONFIG_C_AMBEN_B0_B1_B2 is not set
283CONFIG_C_AMBEN_ALL=y
284
285#
286# EBIU_AMBCTL Control
287#
288CONFIG_BANK_0=0x7BB0
289CONFIG_BANK_1=0x33B0
290CONFIG_BANK_2=0x33B0
291CONFIG_BANK_3=0x99B3
292
293#
294# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
295#
296# CONFIG_PCI is not set
297
298#
299# PCCARD (PCMCIA/CardBus) support
300#
301# CONFIG_PCCARD is not set
302
303#
304# PCI Hotplug Support
305#
306
307#
308# Executable file formats
309#
310CONFIG_BINFMT_ELF_FDPIC=y
311CONFIG_BINFMT_FLAT=y
312CONFIG_BINFMT_ZFLAT=y
313# CONFIG_BINFMT_SHARED_FLAT is not set
314# CONFIG_BINFMT_MISC is not set
315
316#
317# Power management options
318#
319# CONFIG_PM is not set
320
321#
322# CPU Frequency scaling
323#
324# CONFIG_CPU_FREQ is not set
325
326#
327# Networking
328#
329CONFIG_NET=y
330
331#
332# Networking options
333#
334# CONFIG_NETDEBUG is not set
335CONFIG_PACKET=y
336# CONFIG_PACKET_MMAP is not set
337CONFIG_UNIX=y
338CONFIG_XFRM=y
339# CONFIG_XFRM_USER is not set
340# CONFIG_XFRM_SUB_POLICY is not set
341# CONFIG_NET_KEY is not set
342CONFIG_INET=y
343# CONFIG_IP_MULTICAST is not set
344# CONFIG_IP_ADVANCED_ROUTER is not set
345CONFIG_IP_FIB_HASH=y
346CONFIG_IP_PNP=y
347# CONFIG_IP_PNP_DHCP is not set
348# CONFIG_IP_PNP_BOOTP is not set
349# CONFIG_IP_PNP_RARP is not set
350# CONFIG_NET_IPIP is not set
351# CONFIG_NET_IPGRE is not set
352# CONFIG_ARPD is not set
353CONFIG_SYN_COOKIES=y
354# CONFIG_INET_AH is not set
355# CONFIG_INET_ESP is not set
356# CONFIG_INET_IPCOMP is not set
357# CONFIG_INET_XFRM_TUNNEL is not set
358# CONFIG_INET_TUNNEL is not set
359CONFIG_INET_XFRM_MODE_TRANSPORT=y
360CONFIG_INET_XFRM_MODE_TUNNEL=y
361CONFIG_INET_XFRM_MODE_BEET=y
362CONFIG_INET_DIAG=y
363CONFIG_INET_TCP_DIAG=y
364# CONFIG_TCP_CONG_ADVANCED is not set
365CONFIG_TCP_CONG_CUBIC=y
366CONFIG_DEFAULT_TCP_CONG="cubic"
367# CONFIG_IPV6 is not set
368# CONFIG_INET6_XFRM_TUNNEL is not set
369# CONFIG_INET6_TUNNEL is not set
370# CONFIG_NETLABEL is not set
371# CONFIG_NETWORK_SECMARK is not set
372# CONFIG_NETFILTER is not set
373
374#
375# DCCP Configuration (EXPERIMENTAL)
376#
377# CONFIG_IP_DCCP is not set
378
379#
380# SCTP Configuration (EXPERIMENTAL)
381#
382# CONFIG_IP_SCTP is not set
383
384#
385# TIPC Configuration (EXPERIMENTAL)
386#
387# CONFIG_TIPC is not set
388# CONFIG_ATM is not set
389# CONFIG_BRIDGE is not set
390# CONFIG_VLAN_8021Q is not set
391# CONFIG_DECNET is not set
392# CONFIG_LLC2 is not set
393# CONFIG_IPX is not set
394# CONFIG_ATALK is not set
395# CONFIG_X25 is not set
396# CONFIG_LAPB is not set
397# CONFIG_ECONET is not set
398# CONFIG_WAN_ROUTER is not set
399
400#
401# QoS and/or fair queueing
402#
403# CONFIG_NET_SCHED is not set
404
405#
406# Network testing
407#
408# CONFIG_NET_PKTGEN is not set
409# CONFIG_HAMRADIO is not set
410# CONFIG_IRDA is not set
411# CONFIG_BT is not set
412# CONFIG_IEEE80211 is not set
413
414#
415# Device Drivers
416#
417
418#
419# Generic Driver Options
420#
421CONFIG_STANDALONE=y
422CONFIG_PREVENT_FIRMWARE_BUILD=y
423# CONFIG_FW_LOADER is not set
424# CONFIG_SYS_HYPERVISOR is not set
425
426#
427# Connector - unified userspace <-> kernelspace linker
428#
429# CONFIG_CONNECTOR is not set
430
431#
432# Memory Technology Devices (MTD)
433#
434CONFIG_MTD=y
435# CONFIG_MTD_DEBUG is not set
436# CONFIG_MTD_CONCAT is not set
437CONFIG_MTD_PARTITIONS=y
438# CONFIG_MTD_REDBOOT_PARTS is not set
439# CONFIG_MTD_CMDLINE_PARTS is not set
440
441#
442# User Modules And Translation Layers
443#
444CONFIG_MTD_CHAR=m
445CONFIG_MTD_BLOCK=y
446# CONFIG_FTL is not set
447# CONFIG_NFTL is not set
448# CONFIG_INFTL is not set
449# CONFIG_RFD_FTL is not set
450# CONFIG_SSFDC is not set
451
452#
453# RAM/ROM/Flash chip drivers
454#
455# CONFIG_MTD_CFI is not set
456# CONFIG_MTD_JEDECPROBE is not set
457CONFIG_MTD_MAP_BANK_WIDTH_1=y
458CONFIG_MTD_MAP_BANK_WIDTH_2=y
459CONFIG_MTD_MAP_BANK_WIDTH_4=y
460# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
461# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
462# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
463CONFIG_MTD_CFI_I1=y
464CONFIG_MTD_CFI_I2=y
465# CONFIG_MTD_CFI_I4 is not set
466# CONFIG_MTD_CFI_I8 is not set
467CONFIG_MTD_RAM=y
468# CONFIG_MTD_ROM is not set
469# CONFIG_MTD_ABSENT is not set
470# CONFIG_MTD_OBSOLETE_CHIPS is not set
471
472#
473# Mapping drivers for chip access
474#
475CONFIG_MTD_COMPLEX_MAPPINGS=y
476# CONFIG_MTD_BF5xx is not set
477CONFIG_MTD_UCLINUX=y
478# CONFIG_MTD_PLATRAM is not set
479
480#
481# Self-contained MTD device drivers
482#
483# CONFIG_MTD_DATAFLASH is not set
484# CONFIG_MTD_M25P80 is not set
485# CONFIG_MTD_SLRAM is not set
486# CONFIG_MTD_PHRAM is not set
487# CONFIG_MTD_MTDRAM is not set
488# CONFIG_MTD_BLOCK2MTD is not set
489
490#
491# Disk-On-Chip Device Drivers
492#
493# CONFIG_MTD_DOC2000 is not set
494# CONFIG_MTD_DOC2001 is not set
495# CONFIG_MTD_DOC2001PLUS is not set
496
497#
498# NAND Flash Device Drivers
499#
500CONFIG_MTD_NAND=y
501# CONFIG_MTD_NAND_VERIFY_WRITE is not set
502# CONFIG_MTD_NAND_ECC_SMC is not set
503CONFIG_MTD_NAND_BFIN=y
504CONFIG_BFIN_NAND_BASE=0x20100000
505CONFIG_BFIN_NAND_CLE=2
506CONFIG_BFIN_NAND_ALE=1
507CONFIG_BFIN_NAND_READY=44
508CONFIG_MTD_NAND_IDS=y
509# CONFIG_MTD_NAND_DISKONCHIP is not set
510# CONFIG_MTD_NAND_NANDSIM is not set
511
512#
513# OneNAND Flash Device Drivers
514#
515# CONFIG_MTD_ONENAND is not set
516
517#
518# Parallel port support
519#
520# CONFIG_PARPORT is not set
521
522#
523# Plug and Play support
524#
525
526#
527# Block devices
528#
529# CONFIG_BLK_DEV_COW_COMMON is not set
530# CONFIG_BLK_DEV_LOOP is not set
531# CONFIG_BLK_DEV_NBD is not set
532CONFIG_BLK_DEV_RAM=y
533CONFIG_BLK_DEV_RAM_COUNT=16
534CONFIG_BLK_DEV_RAM_SIZE=4096
535CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
536# CONFIG_BLK_DEV_INITRD is not set
537# CONFIG_CDROM_PKTCDVD is not set
538# CONFIG_ATA_OVER_ETH is not set
539
540#
541# Misc devices
542#
543# CONFIG_TIFM_CORE is not set
544
545#
546# ATA/ATAPI/MFM/RLL support
547#
548# CONFIG_IDE is not set
549
550#
551# SCSI device support
552#
553# CONFIG_RAID_ATTRS is not set
554# CONFIG_SCSI is not set
555# CONFIG_SCSI_NETLINK is not set
556
557#
558# Serial ATA (prod) and Parallel ATA (experimental) drivers
559#
560# CONFIG_ATA is not set
561
562#
563# Multi-device support (RAID and LVM)
564#
565# CONFIG_MD is not set
566
567#
568# Fusion MPT device support
569#
570# CONFIG_FUSION is not set
571
572#
573# IEEE 1394 (FireWire) support
574#
575
576#
577# I2O device support
578#
579
580#
581# Network device support
582#
583CONFIG_NETDEVICES=y
584# CONFIG_DUMMY is not set
585# CONFIG_BONDING is not set
586# CONFIG_EQUALIZER is not set
587# CONFIG_TUN is not set
588
589#
590# PHY device support
591#
592# CONFIG_PHYLIB is not set
593
594#
595# Ethernet (10 or 100Mbit)
596#
597CONFIG_NET_ETHERNET=y
598CONFIG_MII=y
599# CONFIG_SMC91X is not set
600CONFIG_BFIN_MAC=y
601# CONFIG_BFIN_MAC_USE_L1 is not set
602CONFIG_BFIN_TX_DESC_NUM=100
603CONFIG_BFIN_RX_DESC_NUM=100
604CONFIG_BFIN_MAC_RMII=y
605
606#
607# Ethernet (1000 Mbit)
608#
609
610#
611# Ethernet (10000 Mbit)
612#
613
614#
615# Token Ring devices
616#
617
618#
619# Wireless LAN (non-hamradio)
620#
621# CONFIG_NET_RADIO is not set
622
623#
624# Wan interfaces
625#
626# CONFIG_WAN is not set
627# CONFIG_PPP is not set
628# CONFIG_SLIP is not set
629# CONFIG_SHAPER is not set
630# CONFIG_NETCONSOLE is not set
631# CONFIG_NETPOLL is not set
632# CONFIG_NET_POLL_CONTROLLER is not set
633
634#
635# ISDN subsystem
636#
637# CONFIG_ISDN is not set
638
639#
640# Telephony Support
641#
642# CONFIG_PHONE is not set
643
644#
645# Input device support
646#
647CONFIG_INPUT=y
648# CONFIG_INPUT_FF_MEMLESS is not set
649
650#
651# Userland interfaces
652#
653# CONFIG_INPUT_MOUSEDEV is not set
654# CONFIG_INPUT_JOYDEV is not set
655CONFIG_INPUT_TSDEV=y
656CONFIG_INPUT_TSDEV_SCREEN_X=240
657CONFIG_INPUT_TSDEV_SCREEN_Y=320
658CONFIG_INPUT_EVDEV=y
659# CONFIG_INPUT_EVBUG is not set
660
661#
662# Input Device Drivers
663#
664# CONFIG_INPUT_KEYBOARD is not set
665# CONFIG_INPUT_MOUSE is not set
666# CONFIG_INPUT_JOYSTICK is not set
667CONFIG_INPUT_TOUCHSCREEN=y
668# CONFIG_TOUCHSCREEN_ADS7846 is not set
669CONFIG_TOUCHSCREEN_AD7877=y
670# CONFIG_TOUCHSCREEN_GUNZE is not set
671# CONFIG_TOUCHSCREEN_ELO is not set
672# CONFIG_TOUCHSCREEN_MTOUCH is not set
673# CONFIG_TOUCHSCREEN_MK712 is not set
674# CONFIG_TOUCHSCREEN_PENMOUNT is not set
675# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
676# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
677CONFIG_INPUT_MISC=y
678CONFIG_INPUT_UINPUT=y
679# CONFIG_BF53X_PFBUTTONS is not set
680# CONFIG_TWI_KEYPAD is not set
681
682#
683# Hardware I/O ports
684#
685# CONFIG_SERIO is not set
686# CONFIG_GAMEPORT is not set
687
688#
689# Character devices
690#
691# CONFIG_AD9960 is not set
692# CONFIG_SPI_ADC_BF533 is not set
693# CONFIG_BF533_PFLAGS is not set
694# CONFIG_BF5xx_PPIFCD is not set
695# CONFIG_BF5xx_TIMERS is not set
696# CONFIG_BF5xx_PPI is not set
697CONFIG_BFIN_SPORT=y
698# CONFIG_BFIN_TIMER_LATENCY is not set
699CONFIG_TWI_LCD=m
700CONFIG_TWI_LCD_SLAVE_ADDR=34
701# CONFIG_AD5304 is not set
702# CONFIG_VT is not set
703# CONFIG_SERIAL_NONSTANDARD is not set
704
705#
706# Serial drivers
707#
708# CONFIG_SERIAL_8250 is not set
709
710#
711# Non-8250 serial port support
712#
713CONFIG_SERIAL_BFIN=y
714CONFIG_SERIAL_BFIN_CONSOLE=y
715CONFIG_SERIAL_BFIN_DMA=y
716# CONFIG_SERIAL_BFIN_PIO is not set
717CONFIG_SERIAL_BFIN_UART0=y
718# CONFIG_BFIN_UART0_CTSRTS is not set
719CONFIG_SERIAL_BFIN_UART1=y
720# CONFIG_BFIN_UART1_CTSRTS is not set
721CONFIG_SERIAL_CORE=y
722CONFIG_SERIAL_CORE_CONSOLE=y
723# CONFIG_SERIAL_BFIN_SPORT is not set
724CONFIG_UNIX98_PTYS=y
725# CONFIG_LEGACY_PTYS is not set
726
727#
728# CAN, the car bus and industrial fieldbus
729#
730CONFIG_CAN4LINUX=y
731
732#
733# linux embedded drivers
734#
735# CONFIG_CAN_MCF5282 is not set
736# CONFIG_CAN_UNCTWINCAN is not set
737CONFIG_CAN_BLACKFIN=m
738
739#
740# IPMI
741#
742# CONFIG_IPMI_HANDLER is not set
743
744#
745# Watchdog Cards
746#
747# CONFIG_WATCHDOG is not set
748CONFIG_HW_RANDOM=y
749# CONFIG_GEN_RTC is not set
750CONFIG_BLACKFIN_DPMC=y
751# CONFIG_DTLK is not set
752# CONFIG_R3964 is not set
753
754#
755# Ftape, the floppy tape device driver
756#
757# CONFIG_RAW_DRIVER is not set
758
759#
760# TPM devices
761#
762# CONFIG_TCG_TPM is not set
763
764#
765# I2C support
766#
767CONFIG_I2C=y
768CONFIG_I2C_CHARDEV=y
769
770#
771# I2C Algorithms
772#
773# CONFIG_I2C_ALGOBIT is not set
774# CONFIG_I2C_ALGOPCF is not set
775# CONFIG_I2C_ALGOPCA is not set
776
777#
778# I2C Hardware Bus support
779#
780# CONFIG_I2C_BFIN_GPIO is not set
781CONFIG_I2C_BFIN_TWI=y
782CONFIG_TWICLK_KHZ=50
783# CONFIG_I2C_OCORES is not set
784# CONFIG_I2C_PARPORT_LIGHT is not set
785# CONFIG_I2C_STUB is not set
786# CONFIG_I2C_PCA_ISA is not set
787
788#
789# Miscellaneous I2C Chip support
790#
791# CONFIG_SENSORS_DS1337 is not set
792# CONFIG_SENSORS_DS1374 is not set
793# CONFIG_SENSORS_AD5252 is not set
794# CONFIG_SENSORS_EEPROM is not set
795CONFIG_SENSORS_PCF8574=m
796CONFIG_SENSORS_PCF8575=y
797# CONFIG_SENSORS_PCA9543 is not set
798# CONFIG_SENSORS_PCA9539 is not set
799# CONFIG_SENSORS_PCF8591 is not set
800# CONFIG_SENSORS_MAX6875 is not set
801# CONFIG_I2C_DEBUG_CORE is not set
802# CONFIG_I2C_DEBUG_ALGO is not set
803# CONFIG_I2C_DEBUG_BUS is not set
804# CONFIG_I2C_DEBUG_CHIP is not set
805
806#
807# SPI support
808#
809CONFIG_SPI=y
810CONFIG_SPI_MASTER=y
811
812#
813# SPI Master Controller Drivers
814#
815# CONFIG_SPI_BITBANG is not set
816CONFIG_SPI_BFIN=y
817
818#
819# SPI Protocol Masters
820#
821
822#
823# Dallas's 1-wire bus
824#
825# CONFIG_W1 is not set
826
827#
828# Hardware Monitoring support
829#
830CONFIG_HWMON=y
831# CONFIG_HWMON_VID is not set
832# CONFIG_SENSORS_ABITUGURU is not set
833# CONFIG_SENSORS_ADM1021 is not set
834# CONFIG_SENSORS_ADM1025 is not set
835# CONFIG_SENSORS_ADM1026 is not set
836# CONFIG_SENSORS_ADM1031 is not set
837# CONFIG_SENSORS_ADM9240 is not set
838# CONFIG_SENSORS_ASB100 is not set
839# CONFIG_SENSORS_ATXP1 is not set
840# CONFIG_SENSORS_DS1621 is not set
841# CONFIG_SENSORS_F71805F is not set
842# CONFIG_SENSORS_FSCHER is not set
843# CONFIG_SENSORS_FSCPOS is not set
844# CONFIG_SENSORS_GL518SM is not set
845# CONFIG_SENSORS_GL520SM is not set
846# CONFIG_SENSORS_IT87 is not set
847# CONFIG_SENSORS_LM63 is not set
848# CONFIG_SENSORS_LM70 is not set
849# CONFIG_SENSORS_LM75 is not set
850# CONFIG_SENSORS_LM77 is not set
851# CONFIG_SENSORS_LM78 is not set
852# CONFIG_SENSORS_LM80 is not set
853# CONFIG_SENSORS_LM83 is not set
854# CONFIG_SENSORS_LM85 is not set
855# CONFIG_SENSORS_LM87 is not set
856# CONFIG_SENSORS_LM90 is not set
857# CONFIG_SENSORS_LM92 is not set
858# CONFIG_SENSORS_MAX1619 is not set
859# CONFIG_SENSORS_PC87360 is not set
860# CONFIG_SENSORS_SMSC47M1 is not set
861# CONFIG_SENSORS_SMSC47M192 is not set
862# CONFIG_SENSORS_SMSC47B397 is not set
863# CONFIG_SENSORS_VT1211 is not set
864# CONFIG_SENSORS_W83781D is not set
865# CONFIG_SENSORS_W83791D is not set
866# CONFIG_SENSORS_W83792D is not set
867# CONFIG_SENSORS_W83L785TS is not set
868# CONFIG_SENSORS_W83627HF is not set
869# CONFIG_SENSORS_W83627EHF is not set
870# CONFIG_HWMON_DEBUG_CHIP is not set
871
872#
873# Multimedia devices
874#
875# CONFIG_VIDEO_DEV is not set
876
877#
878# Digital Video Broadcasting Devices
879#
880# CONFIG_DVB is not set
881
882#
883# Graphics support
884#
885CONFIG_FIRMWARE_EDID=y
886CONFIG_FB=y
887CONFIG_FB_CFB_FILLRECT=y
888CONFIG_FB_CFB_COPYAREA=y
889CONFIG_FB_CFB_IMAGEBLIT=y
890# CONFIG_FB_MACMODES is not set
891# CONFIG_FB_BACKLIGHT is not set
892# CONFIG_FB_MODE_HELPERS is not set
893# CONFIG_FB_TILEBLITTING is not set
894# CONFIG_FB_BFIN_7171 is not set
895# CONFIG_FB_BFIN_7393 is not set
896CONFIG_FB_BF537_LQ035=y
897CONFIG_LQ035_SLAVE_ADDR=0x58
898CONFIG_FB_BFIN_LANDSCAPE=y
899# CONFIG_FB_BFIN_BGR is not set
900# CONFIG_FB_S1D13XXX is not set
901# CONFIG_FB_VIRTUAL is not set
902
903#
904# Logo configuration
905#
906# CONFIG_LOGO is not set
907CONFIG_BACKLIGHT_LCD_SUPPORT=y
908CONFIG_BACKLIGHT_CLASS_DEVICE=y
909CONFIG_BACKLIGHT_DEVICE=y
910CONFIG_LCD_CLASS_DEVICE=y
911CONFIG_LCD_DEVICE=y
912
913#
914# Sound
915#
916CONFIG_SOUND=y
917
918#
919# Advanced Linux Sound Architecture
920#
921CONFIG_SND=m
922CONFIG_SND_TIMER=m
923CONFIG_SND_PCM=m
924# CONFIG_SND_SEQUENCER is not set
925# CONFIG_SND_MIXER_OSS is not set
926# CONFIG_SND_PCM_OSS is not set
927# CONFIG_SND_DYNAMIC_MINORS is not set
928# CONFIG_SND_SUPPORT_OLD_API is not set
929# CONFIG_SND_VERBOSE_PROCFS is not set
930# CONFIG_SND_VERBOSE_PRINTK is not set
931# CONFIG_SND_DEBUG is not set
932
933#
934# Generic devices
935#
936# CONFIG_SND_DUMMY is not set
937# CONFIG_SND_MTPAV is not set
938# CONFIG_SND_SERIAL_U16550 is not set
939# CONFIG_SND_MPU401 is not set
940
941#
942# ALSA Blackfin devices
943#
944# CONFIG_SND_BLACKFIN_AD1836 is not set
945CONFIG_SND_BLACKFIN_AD1981B=m
946# CONFIG_SND_BFIN_AD73311 is not set
947
948#
949# Open Sound System
950#
951CONFIG_SOUND_PRIME=y
952CONFIG_OSS_OBSOLETE_DRIVER=y
953# CONFIG_SOUND_MSNDCLAS is not set
954# CONFIG_SOUND_MSNDPIN is not set
955
956#
957# USB support
958#
959CONFIG_USB_ARCH_HAS_HCD=y
960# CONFIG_USB_ARCH_HAS_OHCI is not set
961# CONFIG_USB_ARCH_HAS_EHCI is not set
962# CONFIG_USB is not set
963
964#
965# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
966#
967
968#
969# USB Gadget Support
970#
971# CONFIG_USB_GADGET is not set
972
973#
974# MMC/SD Card support
975#
976# CONFIG_SPI_MMC is not set
977# CONFIG_MMC is not set
978
979#
980# LED devices
981#
982# CONFIG_NEW_LEDS is not set
983
984#
985# LED drivers
986#
987
988#
989# LED Triggers
990#
991
992#
993# InfiniBand support
994#
995
996#
997# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
998#
999
1000#
1001# Real Time Clock
1002#
1003CONFIG_RTC_LIB=y
1004CONFIG_RTC_CLASS=y
1005CONFIG_RTC_HCTOSYS=y
1006CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1007# CONFIG_RTC_DEBUG is not set
1008
1009#
1010# RTC interfaces
1011#
1012CONFIG_RTC_INTF_SYSFS=y
1013CONFIG_RTC_INTF_PROC=y
1014CONFIG_RTC_INTF_DEV=y
1015# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1016
1017#
1018# RTC drivers
1019#
1020# CONFIG_RTC_DRV_X1205 is not set
1021# CONFIG_RTC_DRV_DS1307 is not set
1022# CONFIG_RTC_DRV_DS1553 is not set
1023# CONFIG_RTC_DRV_ISL1208 is not set
1024# CONFIG_RTC_DRV_DS1672 is not set
1025# CONFIG_RTC_DRV_DS1742 is not set
1026# CONFIG_RTC_DRV_PCF8563 is not set
1027# CONFIG_RTC_DRV_PCF8583 is not set
1028# CONFIG_RTC_DRV_RS5C348 is not set
1029# CONFIG_RTC_DRV_RS5C372 is not set
1030# CONFIG_RTC_DRV_M48T86 is not set
1031# CONFIG_RTC_DRV_TEST is not set
1032# CONFIG_RTC_DRV_MAX6902 is not set
1033# CONFIG_RTC_DRV_V3020 is not set
1034CONFIG_RTC_DRV_BFIN=y
1035
1036#
1037# DMA Engine support
1038#
1039# CONFIG_DMA_ENGINE is not set
1040
1041#
1042# DMA Clients
1043#
1044
1045#
1046# DMA Devices
1047#
1048
1049#
1050# PBX support
1051#
1052# CONFIG_PBX is not set
1053
1054#
1055# File systems
1056#
1057CONFIG_EXT2_FS=y
1058CONFIG_EXT2_FS_XATTR=y
1059# CONFIG_EXT2_FS_POSIX_ACL is not set
1060# CONFIG_EXT2_FS_SECURITY is not set
1061# CONFIG_EXT3_FS is not set
1062# CONFIG_EXT4DEV_FS is not set
1063CONFIG_FS_MBCACHE=y
1064# CONFIG_REISERFS_FS is not set
1065# CONFIG_JFS_FS is not set
1066# CONFIG_FS_POSIX_ACL is not set
1067# CONFIG_XFS_FS is not set
1068# CONFIG_GFS2_FS is not set
1069# CONFIG_OCFS2_FS is not set
1070# CONFIG_MINIX_FS is not set
1071# CONFIG_ROMFS_FS is not set
1072CONFIG_INOTIFY=y
1073CONFIG_INOTIFY_USER=y
1074# CONFIG_QUOTA is not set
1075CONFIG_DNOTIFY=y
1076# CONFIG_AUTOFS_FS is not set
1077# CONFIG_AUTOFS4_FS is not set
1078# CONFIG_FUSE_FS is not set
1079
1080#
1081# CD-ROM/DVD Filesystems
1082#
1083# CONFIG_ISO9660_FS is not set
1084# CONFIG_UDF_FS is not set
1085
1086#
1087# DOS/FAT/NT Filesystems
1088#
1089# CONFIG_MSDOS_FS is not set
1090# CONFIG_VFAT_FS is not set
1091# CONFIG_NTFS_FS is not set
1092
1093#
1094# Pseudo filesystems
1095#
1096CONFIG_PROC_FS=y
1097CONFIG_PROC_SYSCTL=y
1098CONFIG_SYSFS=y
1099# CONFIG_TMPFS is not set
1100# CONFIG_HUGETLB_PAGE is not set
1101CONFIG_RAMFS=y
1102# CONFIG_CONFIGFS_FS is not set
1103
1104#
1105# Miscellaneous filesystems
1106#
1107# CONFIG_ADFS_FS is not set
1108# CONFIG_AFFS_FS is not set
1109# CONFIG_HFS_FS is not set
1110# CONFIG_HFSPLUS_FS is not set
1111# CONFIG_BEFS_FS is not set
1112# CONFIG_BFS_FS is not set
1113# CONFIG_EFS_FS is not set
1114CONFIG_YAFFS_FS=y
1115CONFIG_YAFFS_YAFFS1=y
1116# CONFIG_YAFFS_DOES_ECC is not set
1117CONFIG_YAFFS_YAFFS2=y
1118CONFIG_YAFFS_AUTO_YAFFS2=y
1119# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1120CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
1121# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1122# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1123CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1124# CONFIG_JFFS_FS is not set
1125# CONFIG_JFFS2_FS is not set
1126# CONFIG_CRAMFS is not set
1127# CONFIG_VXFS_FS is not set
1128# CONFIG_HPFS_FS is not set
1129# CONFIG_QNX4FS_FS is not set
1130# CONFIG_SYSV_FS is not set
1131# CONFIG_UFS_FS is not set
1132
1133#
1134# Network File Systems
1135#
1136CONFIG_NFS_FS=m
1137CONFIG_NFS_V3=y
1138# CONFIG_NFS_V3_ACL is not set
1139# CONFIG_NFS_V4 is not set
1140# CONFIG_NFS_DIRECTIO is not set
1141# CONFIG_NFSD is not set
1142CONFIG_LOCKD=m
1143CONFIG_LOCKD_V4=y
1144CONFIG_NFS_COMMON=y
1145CONFIG_SUNRPC=m
1146# CONFIG_RPCSEC_GSS_KRB5 is not set
1147# CONFIG_RPCSEC_GSS_SPKM3 is not set
1148CONFIG_SMB_FS=m
1149# CONFIG_SMB_NLS_DEFAULT is not set
1150# CONFIG_CIFS is not set
1151# CONFIG_NCP_FS is not set
1152# CONFIG_CODA_FS is not set
1153# CONFIG_AFS_FS is not set
1154# CONFIG_9P_FS is not set
1155
1156#
1157# Partition Types
1158#
1159# CONFIG_PARTITION_ADVANCED is not set
1160CONFIG_MSDOS_PARTITION=y
1161
1162#
1163# Native Language Support
1164#
1165CONFIG_NLS=m
1166CONFIG_NLS_DEFAULT="iso8859-1"
1167# CONFIG_NLS_CODEPAGE_437 is not set
1168# CONFIG_NLS_CODEPAGE_737 is not set
1169# CONFIG_NLS_CODEPAGE_775 is not set
1170# CONFIG_NLS_CODEPAGE_850 is not set
1171# CONFIG_NLS_CODEPAGE_852 is not set
1172# CONFIG_NLS_CODEPAGE_855 is not set
1173# CONFIG_NLS_CODEPAGE_857 is not set
1174# CONFIG_NLS_CODEPAGE_860 is not set
1175# CONFIG_NLS_CODEPAGE_861 is not set
1176# CONFIG_NLS_CODEPAGE_862 is not set
1177# CONFIG_NLS_CODEPAGE_863 is not set
1178# CONFIG_NLS_CODEPAGE_864 is not set
1179# CONFIG_NLS_CODEPAGE_865 is not set
1180# CONFIG_NLS_CODEPAGE_866 is not set
1181# CONFIG_NLS_CODEPAGE_869 is not set
1182# CONFIG_NLS_CODEPAGE_936 is not set
1183# CONFIG_NLS_CODEPAGE_950 is not set
1184# CONFIG_NLS_CODEPAGE_932 is not set
1185# CONFIG_NLS_CODEPAGE_949 is not set
1186# CONFIG_NLS_CODEPAGE_874 is not set
1187# CONFIG_NLS_ISO8859_8 is not set
1188# CONFIG_NLS_CODEPAGE_1250 is not set
1189# CONFIG_NLS_CODEPAGE_1251 is not set
1190# CONFIG_NLS_ASCII is not set
1191# CONFIG_NLS_ISO8859_1 is not set
1192# CONFIG_NLS_ISO8859_2 is not set
1193# CONFIG_NLS_ISO8859_3 is not set
1194# CONFIG_NLS_ISO8859_4 is not set
1195# CONFIG_NLS_ISO8859_5 is not set
1196# CONFIG_NLS_ISO8859_6 is not set
1197# CONFIG_NLS_ISO8859_7 is not set
1198# CONFIG_NLS_ISO8859_9 is not set
1199# CONFIG_NLS_ISO8859_13 is not set
1200# CONFIG_NLS_ISO8859_14 is not set
1201# CONFIG_NLS_ISO8859_15 is not set
1202# CONFIG_NLS_KOI8_R is not set
1203# CONFIG_NLS_KOI8_U is not set
1204# CONFIG_NLS_UTF8 is not set
1205
1206#
1207# Profiling support
1208#
1209# CONFIG_PROFILING is not set
1210
1211#
1212# Kernel hacking
1213#
1214# CONFIG_PRINTK_TIME is not set
1215CONFIG_ENABLE_MUST_CHECK=y
1216# CONFIG_MAGIC_SYSRQ is not set
1217# CONFIG_UNUSED_SYMBOLS is not set
1218# CONFIG_DEBUG_KERNEL is not set
1219CONFIG_LOG_BUF_SHIFT=14
1220# CONFIG_DEBUG_BUGVERBOSE is not set
1221# CONFIG_DEBUG_FS is not set
1222# CONFIG_UNWIND_INFO is not set
1223# CONFIG_HEADERS_CHECK is not set
1224# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set
1225# CONFIG_DEBUG_HUNT_FOR_ZERO is not set
1226# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1227# CONFIG_BOOTPARAM is not set
1228# CONFIG_NO_KERNEL_MSG is not set
1229# CONFIG_CPLB_INFO is not set
1230# CONFIG_NO_ACCESS_CHECK is not set
1231
1232#
1233# Security options
1234#
1235# CONFIG_KEYS is not set
1236CONFIG_SECURITY=y
1237# CONFIG_SECURITY_NETWORK is not set
1238CONFIG_SECURITY_CAPABILITIES=y
1239
1240#
1241# Cryptographic options
1242#
1243# CONFIG_CRYPTO is not set
1244
1245#
1246# Library routines
1247#
1248CONFIG_CRC_CCITT=m
1249# CONFIG_CRC16 is not set
1250CONFIG_CRC32=y
1251# CONFIG_LIBCRC32C is not set
1252CONFIG_ZLIB_INFLATE=y
1253CONFIG_PLIST=y
diff --git a/arch/blackfin/defconfig b/arch/blackfin/defconfig
index d5904ca994cf..a513fbe39567 100644
--- a/arch/blackfin/defconfig
+++ b/arch/blackfin/defconfig
@@ -1,19 +1,20 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.20.4
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
7CONFIG_RWSEM_GENERIC_SPINLOCK=y 7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y
9CONFIG_BFIN=y 10CONFIG_BFIN=y
10CONFIG_SEMAPHORE_SLEEPERS=y 11CONFIG_SEMAPHORE_SLEEPERS=y
11CONFIG_GENERIC_FIND_NEXT_BIT=y 12CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y 13CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y 14CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_IRQ_PROBE=y 15CONFIG_GENERIC_IRQ_PROBE=y
16# CONFIG_GENERIC_TIME is not set
15CONFIG_GENERIC_CALIBRATE_DELAY=y 17CONFIG_GENERIC_CALIBRATE_DELAY=y
16CONFIG_UCLINUX=y
17CONFIG_FORCE_MAX_ZONEORDER=14 18CONFIG_FORCE_MAX_ZONEORDER=14
18CONFIG_IRQCHIP_DEMUX_GPIO=y 19CONFIG_IRQCHIP_DEMUX_GPIO=y
19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 20CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
@@ -55,6 +56,7 @@ CONFIG_ELF_CORE=y
55CONFIG_BASE_FULL=y 56CONFIG_BASE_FULL=y
56CONFIG_FUTEX=y 57CONFIG_FUTEX=y
57CONFIG_EPOLL=y 58CONFIG_EPOLL=y
59CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
58# CONFIG_LIMIT_PAGECACHE is not set 60# CONFIG_LIMIT_PAGECACHE is not set
59CONFIG_BUDDY=y 61CONFIG_BUDDY=y
60# CONFIG_NP2 is not set 62# CONFIG_NP2 is not set
@@ -95,6 +97,9 @@ CONFIG_DEFAULT_AS=y
95# CONFIG_DEFAULT_CFQ is not set 97# CONFIG_DEFAULT_CFQ is not set
96# CONFIG_DEFAULT_NOOP is not set 98# CONFIG_DEFAULT_NOOP is not set
97CONFIG_DEFAULT_IOSCHED="anticipatory" 99CONFIG_DEFAULT_IOSCHED="anticipatory"
100# CONFIG_PREEMPT_NONE is not set
101CONFIG_PREEMPT_VOLUNTARY=y
102# CONFIG_PREEMPT is not set
98 103
99# 104#
100# Blackfin Processor Options 105# Blackfin Processor Options
@@ -107,7 +112,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
107# CONFIG_BF532 is not set 112# CONFIG_BF532 is not set
108# CONFIG_BF533 is not set 113# CONFIG_BF533 is not set
109# CONFIG_BF534 is not set 114# CONFIG_BF534 is not set
110# CONFIG_BF535 is not set
111# CONFIG_BF536 is not set 115# CONFIG_BF536 is not set
112CONFIG_BF537=y 116CONFIG_BF537=y
113# CONFIG_BF561 is not set 117# CONFIG_BF561 is not set
@@ -115,7 +119,6 @@ CONFIG_BF_REV_0_2=y
115# CONFIG_BF_REV_0_3 is not set 119# CONFIG_BF_REV_0_3 is not set
116# CONFIG_BF_REV_0_4 is not set 120# CONFIG_BF_REV_0_4 is not set
117# CONFIG_BF_REV_0_5 is not set 121# CONFIG_BF_REV_0_5 is not set
118CONFIG_BLACKFIN=y
119CONFIG_BFIN_SINGLE_CORE=y 122CONFIG_BFIN_SINGLE_CORE=y
120# CONFIG_BFIN533_EZKIT is not set 123# CONFIG_BFIN533_EZKIT is not set
121# CONFIG_BFIN533_STAMP is not set 124# CONFIG_BFIN533_STAMP is not set
@@ -182,6 +185,7 @@ CONFIG_IRQ_WATCH=13
182# 185#
183# Board customizations 186# Board customizations
184# 187#
188# CONFIG_CMDLINE_BOOL is not set
185 189
186# 190#
187# Board Setup 191# Board Setup
@@ -221,6 +225,19 @@ CONFIG_HZ=250
221# Memory Optimizations 225# Memory Optimizations
222# 226#
223CONFIG_I_ENTRY_L1=y 227CONFIG_I_ENTRY_L1=y
228CONFIG_EXCPT_IRQ_SYSC_L1=y
229CONFIG_DO_IRQ_L1=y
230CONFIG_CORE_TIMER_IRQ_L1=y
231CONFIG_IDLE_L1=y
232CONFIG_SCHEDULE_L1=y
233CONFIG_ARITHMETIC_OPS_L1=y
234CONFIG_ACCESS_OK_L1=y
235CONFIG_MEMSET_L1=y
236CONFIG_MEMCPY_L1=y
237CONFIG_SYS_BFIN_SPINLOCK_L1=y
238# CONFIG_IP_CHECKSUM_L1 is not set
239# CONFIG_SYSCALL_TAB_L1 is not set
240# CONFIG_CPLB_SWITCH_TAB_L1 is not set
224CONFIG_RAMKERNEL=y 241CONFIG_RAMKERNEL=y
225# CONFIG_ROMKERNEL is not set 242# CONFIG_ROMKERNEL is not set
226CONFIG_SELECT_MEMORY_MODEL=y 243CONFIG_SELECT_MEMORY_MODEL=y
@@ -243,6 +260,7 @@ CONFIG_DMA_UNCACHED_1M=y
243# 260#
244CONFIG_BLKFIN_CACHE=y 261CONFIG_BLKFIN_CACHE=y
245CONFIG_BLKFIN_DCACHE=y 262CONFIG_BLKFIN_DCACHE=y
263# CONFIG_BLKFIN_DCACHE_BANKA is not set
246# CONFIG_BLKFIN_CACHE_LOCK is not set 264# CONFIG_BLKFIN_CACHE_LOCK is not set
247# CONFIG_BLKFIN_WB is not set 265# CONFIG_BLKFIN_WB is not set
248CONFIG_BLKFIN_WT=y 266CONFIG_BLKFIN_WT=y
@@ -815,9 +833,8 @@ CONFIG_I2C_CHARDEV=m
815# 833#
816# I2C Hardware Bus support 834# I2C Hardware Bus support
817# 835#
818# CONFIG_I2C_BFIN_GPIO is not set 836# CONFIG_I2C_BLACKFIN_GPIO is not set
819CONFIG_I2C_BFIN_TWI=m 837# CONFIG_I2C_BLACKFIN_TWI is not set
820CONFIG_TWICLK_KHZ=50
821# CONFIG_I2C_OCORES is not set 838# CONFIG_I2C_OCORES is not set
822# CONFIG_I2C_PARPORT_LIGHT is not set 839# CONFIG_I2C_PARPORT_LIGHT is not set
823# CONFIG_I2C_STUB is not set 840# CONFIG_I2C_STUB is not set
@@ -832,6 +849,7 @@ CONFIG_SENSORS_AD5252=m
832# CONFIG_SENSORS_EEPROM is not set 849# CONFIG_SENSORS_EEPROM is not set
833# CONFIG_SENSORS_PCF8574 is not set 850# CONFIG_SENSORS_PCF8574 is not set
834# CONFIG_SENSORS_PCF8575 is not set 851# CONFIG_SENSORS_PCF8575 is not set
852# CONFIG_SENSORS_PCA9543 is not set
835# CONFIG_SENSORS_PCA9539 is not set 853# CONFIG_SENSORS_PCA9539 is not set
836# CONFIG_SENSORS_PCF8591 is not set 854# CONFIG_SENSORS_PCF8591 is not set
837# CONFIG_SENSORS_MAX6875 is not set 855# CONFIG_SENSORS_MAX6875 is not set
@@ -850,11 +868,11 @@ CONFIG_SPI_MASTER=y
850# SPI Master Controller Drivers 868# SPI Master Controller Drivers
851# 869#
852# CONFIG_SPI_BITBANG is not set 870# CONFIG_SPI_BITBANG is not set
853CONFIG_SPI_BFIN=y
854 871
855# 872#
856# SPI Protocol Masters 873# SPI Protocol Masters
857# 874#
875CONFIG_SPI_BFIN=y
858 876
859# 877#
860# Dallas's 1-wire bus 878# Dallas's 1-wire bus
@@ -940,10 +958,6 @@ CONFIG_NTSC=y
940# CONFIG_PAL_YCBCR is not set 958# CONFIG_PAL_YCBCR is not set
941CONFIG_ADV7393_1XMEM=y 959CONFIG_ADV7393_1XMEM=y
942# CONFIG_ADV7393_2XMEM is not set 960# CONFIG_ADV7393_2XMEM is not set
943CONFIG_FB_BF537_LQ035=m
944CONFIG_LQ035_SLAVE_ADDR=0x58
945# CONFIG_FB_BFIN_LANDSCAPE is not set
946# CONFIG_FB_BFIN_BGR is not set
947# CONFIG_FB_S1D13XXX is not set 961# CONFIG_FB_S1D13XXX is not set
948# CONFIG_FB_VIRTUAL is not set 962# CONFIG_FB_VIRTUAL is not set
949 963
@@ -1280,12 +1294,11 @@ CONFIG_ENABLE_MUST_CHECK=y
1280# CONFIG_DEBUG_KERNEL is not set 1294# CONFIG_DEBUG_KERNEL is not set
1281CONFIG_LOG_BUF_SHIFT=14 1295CONFIG_LOG_BUF_SHIFT=14
1282# CONFIG_DEBUG_BUGVERBOSE is not set 1296# CONFIG_DEBUG_BUGVERBOSE is not set
1297# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set
1283CONFIG_DEBUG_HUNT_FOR_ZERO=y 1298CONFIG_DEBUG_HUNT_FOR_ZERO=y
1284# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1299# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1285# CONFIG_BOOTPARAM is not set
1286# CONFIG_NO_KERNEL_MSG is not set
1287CONFIG_CPLB_INFO=y 1300CONFIG_CPLB_INFO=y
1288# CONFIG_NO_ACCESS_CHECK is not set 1301CONFIG_ACCESS_CHECK=y
1289 1302
1290# 1303#
1291# Security options 1304# Security options
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 8ea079ebecb5..0ccb0dc3f833 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -119,7 +119,7 @@ static void clear_dma_buffer(unsigned int channel)
119 SSYNC(); 119 SSYNC();
120} 120}
121 121
122int __init blackfin_dma_init(void) 122static int __init blackfin_dma_init(void)
123{ 123{
124 int i; 124 int i;
125 125
@@ -130,7 +130,9 @@ int __init blackfin_dma_init(void)
130 dma_ch[i].regs = base_addr[i]; 130 dma_ch[i].regs = base_addr[i];
131 mutex_init(&(dma_ch[i].dmalock)); 131 mutex_init(&(dma_ch[i].dmalock));
132 } 132 }
133 133 /* Mark MEMDMA Channel 0 as requested since we're using it internally */
134 dma_ch[CH_MEM_STREAM0_DEST].chan_status = DMA_CHANNEL_REQUESTED;
135 dma_ch[CH_MEM_STREAM0_SRC].chan_status = DMA_CHANNEL_REQUESTED;
134 return 0; 136 return 0;
135} 137}
136 138
@@ -593,14 +595,17 @@ unsigned short get_dma_curr_ycount(unsigned int channel)
593} 595}
594EXPORT_SYMBOL(get_dma_curr_ycount); 596EXPORT_SYMBOL(get_dma_curr_ycount);
595 597
596void *dma_memcpy(void *dest, const void *src, size_t size) 598void *_dma_memcpy(void *dest, const void *src, size_t size)
597{ 599{
598 int direction; /* 1 - address decrease, 0 - address increase */ 600 int direction; /* 1 - address decrease, 0 - address increase */
599 int flag_align; /* 1 - address aligned, 0 - address unaligned */ 601 int flag_align; /* 1 - address aligned, 0 - address unaligned */
600 int flag_2D; /* 1 - 2D DMA needed, 0 - 1D DMA needed */ 602 int flag_2D; /* 1 - 2D DMA needed, 0 - 1D DMA needed */
603 unsigned long flags;
601 604
602 if (size <= 0) 605 if (size <= 0)
603 return NULL; 606 return NULL;
607
608 local_irq_save(flags);
604 609
605 if ((unsigned long)src < memory_end) 610 if ((unsigned long)src < memory_end)
606 blackfin_dcache_flush_range((unsigned int)src, 611 blackfin_dcache_flush_range((unsigned int)src,
@@ -725,18 +730,224 @@ void *dma_memcpy(void *dest, const void *src, size_t size)
725 if ((unsigned long)dest < memory_end) 730 if ((unsigned long)dest < memory_end)
726 blackfin_dcache_invalidate_range((unsigned int)dest, 731 blackfin_dcache_invalidate_range((unsigned int)dest,
727 (unsigned int)(dest + size)); 732 (unsigned int)(dest + size));
733 local_irq_restore(flags);
728 734
729 return dest; 735 return dest;
730} 736}
737
738void *dma_memcpy(void *dest, const void *src, size_t size)
739{
740 size_t bulk;
741 size_t rest;
742 void * addr;
743
744 bulk = (size >> 16) << 16;
745 rest = size - bulk;
746 if (bulk)
747 _dma_memcpy(dest, src, bulk);
748 addr = _dma_memcpy(dest+bulk, src+bulk, rest);
749 return addr;
750}
751
731EXPORT_SYMBOL(dma_memcpy); 752EXPORT_SYMBOL(dma_memcpy);
732 753
733void *safe_dma_memcpy(void *dest, const void *src, size_t size) 754void *safe_dma_memcpy(void *dest, const void *src, size_t size)
734{ 755{
735 int flags = 0;
736 void *addr; 756 void *addr;
737 local_irq_save(flags);
738 addr = dma_memcpy(dest, src, size); 757 addr = dma_memcpy(dest, src, size);
739 local_irq_restore(flags);
740 return addr; 758 return addr;
741} 759}
742EXPORT_SYMBOL(safe_dma_memcpy); 760EXPORT_SYMBOL(safe_dma_memcpy);
761
762void dma_outsb(void __iomem *addr, const void *buf, unsigned short len)
763{
764
765 unsigned long flags;
766
767 local_irq_save(flags);
768
769 blackfin_dcache_flush_range((unsigned int)buf,(unsigned int)(buf) + len);
770
771 bfin_write_MDMA_D0_START_ADDR(addr);
772 bfin_write_MDMA_D0_X_COUNT(len);
773 bfin_write_MDMA_D0_X_MODIFY(0);
774 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
775
776 bfin_write_MDMA_S0_START_ADDR(buf);
777 bfin_write_MDMA_S0_X_COUNT(len);
778 bfin_write_MDMA_S0_X_MODIFY(1);
779 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
780
781 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_8);
782 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_8);
783
784 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
785
786 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
787
788 bfin_write_MDMA_S0_CONFIG(0);
789 bfin_write_MDMA_D0_CONFIG(0);
790 local_irq_restore(flags);
791
792}
793EXPORT_SYMBOL(dma_outsb);
794
795
796void dma_insb(const void __iomem *addr, void *buf, unsigned short len)
797{
798 unsigned long flags;
799
800 local_irq_save(flags);
801 bfin_write_MDMA_D0_START_ADDR(buf);
802 bfin_write_MDMA_D0_X_COUNT(len);
803 bfin_write_MDMA_D0_X_MODIFY(1);
804 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
805
806 bfin_write_MDMA_S0_START_ADDR(addr);
807 bfin_write_MDMA_S0_X_COUNT(len);
808 bfin_write_MDMA_S0_X_MODIFY(0);
809 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
810
811 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_8);
812 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_8);
813
814 blackfin_dcache_invalidate_range((unsigned int)buf, (unsigned int)(buf) + len);
815
816 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
817
818 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
819
820 bfin_write_MDMA_S0_CONFIG(0);
821 bfin_write_MDMA_D0_CONFIG(0);
822 local_irq_restore(flags);
823
824}
825EXPORT_SYMBOL(dma_insb);
826
827void dma_outsw(void __iomem *addr, const void *buf, unsigned short len)
828{
829 unsigned long flags;
830
831 local_irq_save(flags);
832
833 blackfin_dcache_flush_range((unsigned int)buf,(unsigned int)(buf) + len);
834
835 bfin_write_MDMA_D0_START_ADDR(addr);
836 bfin_write_MDMA_D0_X_COUNT(len);
837 bfin_write_MDMA_D0_X_MODIFY(0);
838 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
839
840 bfin_write_MDMA_S0_START_ADDR(buf);
841 bfin_write_MDMA_S0_X_COUNT(len);
842 bfin_write_MDMA_S0_X_MODIFY(2);
843 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
844
845 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16);
846 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16);
847
848 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
849
850 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
851
852 bfin_write_MDMA_S0_CONFIG(0);
853 bfin_write_MDMA_D0_CONFIG(0);
854 local_irq_restore(flags);
855
856}
857EXPORT_SYMBOL(dma_outsw);
858
859void dma_insw(const void __iomem *addr, void *buf, unsigned short len)
860{
861 unsigned long flags;
862
863 local_irq_save(flags);
864
865 bfin_write_MDMA_D0_START_ADDR(buf);
866 bfin_write_MDMA_D0_X_COUNT(len);
867 bfin_write_MDMA_D0_X_MODIFY(2);
868 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
869
870 bfin_write_MDMA_S0_START_ADDR(addr);
871 bfin_write_MDMA_S0_X_COUNT(len);
872 bfin_write_MDMA_S0_X_MODIFY(0);
873 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
874
875 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16);
876 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16);
877
878 blackfin_dcache_invalidate_range((unsigned int)buf, (unsigned int)(buf) + len);
879
880 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
881
882 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
883
884 bfin_write_MDMA_S0_CONFIG(0);
885 bfin_write_MDMA_D0_CONFIG(0);
886 local_irq_restore(flags);
887
888}
889EXPORT_SYMBOL(dma_insw);
890
891void dma_outsl(void __iomem *addr, const void *buf, unsigned short len)
892{
893 unsigned long flags;
894
895 local_irq_save(flags);
896
897 blackfin_dcache_flush_range((unsigned int)buf,(unsigned int)(buf) + len);
898
899 bfin_write_MDMA_D0_START_ADDR(addr);
900 bfin_write_MDMA_D0_X_COUNT(len);
901 bfin_write_MDMA_D0_X_MODIFY(0);
902 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
903
904 bfin_write_MDMA_S0_START_ADDR(buf);
905 bfin_write_MDMA_S0_X_COUNT(len);
906 bfin_write_MDMA_S0_X_MODIFY(4);
907 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
908
909 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_32);
910 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_32);
911
912 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
913
914 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
915
916 bfin_write_MDMA_S0_CONFIG(0);
917 bfin_write_MDMA_D0_CONFIG(0);
918 local_irq_restore(flags);
919
920}
921EXPORT_SYMBOL(dma_outsl);
922
923void dma_insl(const void __iomem *addr, void *buf, unsigned short len)
924{
925 unsigned long flags;
926
927 local_irq_save(flags);
928
929 bfin_write_MDMA_D0_START_ADDR(buf);
930 bfin_write_MDMA_D0_X_COUNT(len);
931 bfin_write_MDMA_D0_X_MODIFY(4);
932 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
933
934 bfin_write_MDMA_S0_START_ADDR(addr);
935 bfin_write_MDMA_S0_X_COUNT(len);
936 bfin_write_MDMA_S0_X_MODIFY(0);
937 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
938
939 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_32);
940 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_32);
941
942 blackfin_dcache_invalidate_range((unsigned int)buf, (unsigned int)(buf) + len);
943
944 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
945
946 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
947
948 bfin_write_MDMA_S0_CONFIG(0);
949 bfin_write_MDMA_D0_CONFIG(0);
950 local_irq_restore(flags);
951
952}
953EXPORT_SYMBOL(dma_insl);
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index e9f24a9a46ba..3f49fae1cb1f 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -144,7 +144,7 @@ inline int check_gpio(unsigned short gpio)
144} 144}
145 145
146#ifdef BF537_FAMILY 146#ifdef BF537_FAMILY
147void port_setup(unsigned short gpio, unsigned short usage) 147static void port_setup(unsigned short gpio, unsigned short usage)
148{ 148{
149 if (usage == GPIO_USAGE) { 149 if (usage == GPIO_USAGE) {
150 if (*port_fer[gpio_bank(gpio)] & gpio_bit(gpio)) 150 if (*port_fer[gpio_bank(gpio)] & gpio_bit(gpio))
@@ -160,7 +160,7 @@ void port_setup(unsigned short gpio, unsigned short usage)
160#endif 160#endif
161 161
162 162
163void default_gpio(unsigned short gpio) 163static void default_gpio(unsigned short gpio)
164{ 164{
165 unsigned short bank,bitmask; 165 unsigned short bank,bitmask;
166 166
@@ -177,8 +177,7 @@ void default_gpio(unsigned short gpio)
177 gpio_bankb[bank]->edge &= ~bitmask; 177 gpio_bankb[bank]->edge &= ~bitmask;
178} 178}
179 179
180 180static int __init bfin_gpio_init(void)
181int __init bfin_gpio_init(void)
182{ 181{
183 int i; 182 int i;
184 183
@@ -189,9 +188,9 @@ int __init bfin_gpio_init(void)
189 188
190#if defined(BF537_FAMILY) && (defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) 189#if defined(BF537_FAMILY) && (defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE))
191# if defined(CONFIG_BFIN_MAC_RMII) 190# if defined(CONFIG_BFIN_MAC_RMII)
192 reserved_map[PORT_H] = 0xC373; 191 reserved_map[gpio_bank(PORT_H)] = 0xC373;
193# else 192# else
194 reserved_map[PORT_H] = 0xFFFF; 193 reserved_map[gpio_bank(PORT_H)] = 0xFFFF;
195# endif 194# endif
196#endif 195#endif
197 196
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 342bb8dd56ac..02dc74301920 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -33,7 +33,6 @@
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/cpu.h> 34#include <linux/cpu.h>
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/console.h>
37#include <linux/tty.h> 36#include <linux/tty.h>
38 37
39#include <linux/ext2_fs.h> 38#include <linux/ext2_fs.h>
@@ -44,6 +43,8 @@
44#include <asm/blackfin.h> 43#include <asm/blackfin.h>
45#include <asm/cplbinit.h> 44#include <asm/cplbinit.h>
46 45
46u16 _bfin_swrst;
47
47unsigned long memory_start, memory_end, physical_mem_end; 48unsigned long memory_start, memory_end, physical_mem_end;
48unsigned long reserved_mem_dcache_on; 49unsigned long reserved_mem_dcache_on;
49unsigned long reserved_mem_icache_on; 50unsigned long reserved_mem_icache_on;
@@ -175,6 +176,9 @@ void __init setup_arch(char **cmdline_p)
175 unsigned long mtd_phys = 0; 176 unsigned long mtd_phys = 0;
176#endif 177#endif
177 178
179#ifdef CONFIG_DUMMY_CONSOLE
180 conswitchp = &dummy_con;
181#endif
178 cclk = get_cclk(); 182 cclk = get_cclk();
179 sclk = get_sclk(); 183 sclk = get_sclk();
180 184
@@ -379,37 +383,27 @@ void __init setup_arch(char **cmdline_p)
379 if (l1_length > L1_DATA_A_LENGTH) 383 if (l1_length > L1_DATA_A_LENGTH)
380 panic("L1 memory overflow\n"); 384 panic("L1 memory overflow\n");
381 385
382 bf53x_cache_init(); 386#ifdef BF561_FAMILY
383 387 _bfin_swrst = bfin_read_SICA_SWRST();
384#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 388#else
385# if defined(CONFIG_BFIN_SHARED_FLASH_ENET) && defined(CONFIG_BFIN533_STAMP) 389 _bfin_swrst = bfin_read_SWRST();
386 /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
387 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN));
388 bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN);
389 SSYNC();
390# endif
391# if defined (CONFIG_BFIN561_EZKIT)
392 bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12));
393 SSYNC();
394# endif /* defined (CONFIG_BFIN561_EZKIT) */
395#endif 390#endif
396 391
392 bf53x_cache_init();
393
397 printk(KERN_INFO "Hardware Trace Enabled\n"); 394 printk(KERN_INFO "Hardware Trace Enabled\n");
398 bfin_write_TBUFCTL(0x03); 395 bfin_write_TBUFCTL(0x03);
399} 396}
400 397
401#if defined(CONFIG_BF561)
402static struct cpu cpu[2];
403#else
404static struct cpu cpu[1];
405#endif
406static int __init topology_init(void) 398static int __init topology_init(void)
407{ 399{
408#if defined (CONFIG_BF561) 400#if defined (CONFIG_BF561)
401 static struct cpu cpu[2];
409 register_cpu(&cpu[0], 0); 402 register_cpu(&cpu[0], 0);
410 register_cpu(&cpu[1], 1); 403 register_cpu(&cpu[1], 1);
411 return 0; 404 return 0;
412#else 405#else
406 static struct cpu cpu[1];
413 return register_cpu(cpu, 0); 407 return register_cpu(cpu, 0);
414#endif 408#endif
415} 409}
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 9556b73de808..9932edee8cb4 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -59,9 +59,10 @@ static int printk_address(unsigned long address)
59 struct vm_list_struct *vml; 59 struct vm_list_struct *vml;
60 struct task_struct *p; 60 struct task_struct *p;
61 struct mm_struct *mm; 61 struct mm_struct *mm;
62 unsigned long offset;
62 63
63#ifdef CONFIG_KALLSYMS 64#ifdef CONFIG_KALLSYMS
64 unsigned long offset = 0, symsize; 65 unsigned long symsize;
65 const char *symname; 66 const char *symname;
66 char *modname; 67 char *modname;
67 char *delim = ":"; 68 char *delim = ":";
@@ -106,12 +107,19 @@ static int printk_address(unsigned long address)
106 sizeof(_tmpbuf)); 107 sizeof(_tmpbuf));
107 } 108 }
108 109
110 /* FLAT does not have its text aligned to the start of
111 * the map while FDPIC ELF does ...
112 */
113 if (current->mm &&
114 (address > current->mm->start_code) &&
115 (address < current->mm->end_code))
116 offset = address - current->mm->start_code;
117 else
118 offset = (address - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT);
119
109 write_unlock_irq(&tasklist_lock); 120 write_unlock_irq(&tasklist_lock);
110 return printk("<0x%p> [ %s + 0x%lx ]", 121 return printk("<0x%p> [ %s + 0x%lx ]",
111 (void*)address, name, 122 (void*)address, name, offset);
112 (unsigned long)
113 ((address - vma->vm_start) +
114 (vma->vm_pgoff << PAGE_SHIFT)));
115 } 123 }
116 124
117 vml = vml->next; 125 vml = vml->next;
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 6ae9ebbd8e58..86fe67995802 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -54,7 +54,7 @@ SECTIONS
54 { 54 {
55 _text = .; 55 _text = .;
56 __stext = .; 56 __stext = .;
57 *(.text) 57 TEXT_TEXT
58 SCHED_TEXT 58 SCHED_TEXT
59 *(.text.lock) 59 *(.text.lock)
60 . = ALIGN(16); 60 . = ALIGN(16);
@@ -200,7 +200,7 @@ SECTIONS
200 __sdata = .; 200 __sdata = .;
201 . = ALIGN(0x2000); 201 . = ALIGN(0x2000);
202 *(.data.init_task) 202 *(.data.init_task)
203 *(.data) 203 DATA_DATA
204 204
205 . = ALIGN(32); 205 . = ALIGN(32);
206 *(.data.cacheline_aligned) 206 *(.data.cacheline_aligned)
diff --git a/arch/blackfin/lib/ins.S b/arch/blackfin/lib/ins.S
index 730d2b427538..7d5e9846311d 100644
--- a/arch/blackfin/lib/ins.S
+++ b/arch/blackfin/lib/ins.S
@@ -29,6 +29,7 @@
29 */ 29 */
30 30
31#include <linux/linkage.h> 31#include <linux/linkage.h>
32#include <asm/blackfin.h>
32 33
33.align 2 34.align 2
34 35
@@ -39,11 +40,14 @@ ENTRY(_insl)
39 P2 = R2; /* P2 = count */ 40 P2 = R2; /* P2 = count */
40 SSYNC; 41 SSYNC;
41 LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2; 42 LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2;
42.Llong_loop_s: R0 = [P0]; 43.Llong_loop_s: R0 = [P0];
43.Llong_loop_e: [P1++] = R0; 44 [P1++] = R0;
45 NOP;
46.Llong_loop_e: NOP;
44 sti R3; 47 sti R3;
45 RTS; 48 RTS;
46 49
50
47ENTRY(_insw) 51ENTRY(_insw)
48 P0 = R0; /* P0 = port */ 52 P0 = R0; /* P0 = port */
49 cli R3; 53 cli R3;
@@ -51,8 +55,10 @@ ENTRY(_insw)
51 P2 = R2; /* P2 = count */ 55 P2 = R2; /* P2 = count */
52 SSYNC; 56 SSYNC;
53 LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2; 57 LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2;
54.Lword_loop_s: R0 = W[P0]; 58.Lword_loop_s: R0 = W[P0];
55.Lword_loop_e: W[P1++] = R0; 59 W[P1++] = R0;
60 NOP;
61.Lword_loop_e: NOP;
56 sti R3; 62 sti R3;
57 RTS; 63 RTS;
58 64
@@ -63,7 +69,9 @@ ENTRY(_insb)
63 P2 = R2; /* P2 = count */ 69 P2 = R2; /* P2 = count */
64 SSYNC; 70 SSYNC;
65 LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2; 71 LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2;
66.Lbyte_loop_s: R0 = B[P0]; 72.Lbyte_loop_s: R0 = B[P0];
67.Lbyte_loop_e: B[P1++] = R0; 73 B[P1++] = R0;
74 NOP;
75.Lbyte_loop_e: NOP;
68 sti R3; 76 sti R3;
69 RTS; 77 RTS;
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index d7b3a5d74e8c..9a472fe15833 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -164,6 +164,13 @@ static struct bfin5xx_spi_chip ad5304_chip_info = {
164}; 164};
165#endif 165#endif
166 166
167#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
168static struct bfin5xx_spi_chip spi_mmc_chip_info = {
169 .enable_dma = 1,
170 .bits_per_word = 8,
171};
172#endif
173
167static struct spi_board_info bfin_spi_board_info[] __initdata = { 174static struct spi_board_info bfin_spi_board_info[] __initdata = {
168#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 175#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
169 { 176 {
@@ -199,6 +206,27 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
199 }, 206 },
200#endif 207#endif
201 208
209#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
210 {
211 .modalias = "spi_mmc_dummy",
212 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
213 .bus_num = 1,
214 .chip_select = 0,
215 .platform_data = NULL,
216 .controller_data = &spi_mmc_chip_info,
217 .mode = SPI_MODE_3,
218 },
219 {
220 .modalias = "spi_mmc",
221 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
222 .bus_num = 1,
223 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
224 .platform_data = NULL,
225 .controller_data = &spi_mmc_chip_info,
226 .mode = SPI_MODE_3,
227 },
228#endif
229
202#if defined(CONFIG_PBX) 230#if defined(CONFIG_PBX)
203 { 231 {
204 .modalias = "fxs-spi", 232 .modalias = "fxs-spi",
@@ -310,12 +338,25 @@ static struct platform_device *stamp_devices[] __initdata = {
310 338
311static int __init stamp_init(void) 339static int __init stamp_init(void)
312{ 340{
341 int ret;
342
313 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); 343 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
314 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); 344 ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
345 if (ret < 0)
346 return ret;
347
348#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
349# if defined(CONFIG_BFIN_SHARED_FLASH_ENET)
350 /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
351 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN));
352 bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN);
353 SSYNC();
354# endif
355#endif
356
315#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 357#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
316 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 358 return spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
317#endif 359#endif
318 return 0;
319} 360}
320 361
321arch_initcall(stamp_init); 362arch_initcall(stamp_init);
diff --git a/arch/blackfin/mach-bf533/head.S b/arch/blackfin/mach-bf533/head.S
index 4808edb0680f..4db9e6240906 100644
--- a/arch/blackfin/mach-bf533/head.S
+++ b/arch/blackfin/mach-bf533/head.S
@@ -173,7 +173,8 @@ ENTRY(__stext)
173 STI R2; 173 STI R2;
174#endif 174#endif
175 175
176 /* Initialise UART */ 176 /* Initialise UART - when booting from u-boot, the UART is not disabled
177 * so if we dont initalize here, our serial console gets hosed */
177 p0.h = hi(UART_LCR); 178 p0.h = hi(UART_LCR);
178 p0.l = lo(UART_LCR); 179 p0.l = lo(UART_LCR);
179 r0 = 0x0(Z); 180 r0 = 0x0(Z);
@@ -468,12 +469,6 @@ ENTRY(_bfin_reset)
468 w[p0] = r0.l; 469 w[p0] = r0.l;
469#endif 470#endif
470 471
471 /* Clear the bits 13-15 in SWRST if they werent cleared */
472 p0.h = hi(SWRST);
473 p0.l = lo(SWRST);
474 csync;
475 r0.l = w[p0];
476
477 /* Clear the IMASK register */ 472 /* Clear the IMASK register */
478 p0.h = hi(IMASK); 473 p0.h = hi(IMASK);
479 p0.l = lo(IMASK); 474 p0.l = lo(IMASK);
@@ -487,66 +482,30 @@ ENTRY(_bfin_reset)
487 [p0] = r0; 482 [p0] = r0;
488 SSYNC; 483 SSYNC;
489 484
490 /* Disable the WDOG TIMER */ 485 /* make sure SYSCR is set to use BMODE */
491 p0.h = hi(WDOG_CTL); 486 P0.h = hi(SYSCR);
492 p0.l = lo(WDOG_CTL); 487 P0.l = lo(SYSCR);
493 r0.l = 0xAD6; 488 R0.l = 0x0;
494 w[p0] = r0.l; 489 W[P0] = R0.l;
495 SSYNC;
496
497 /* Clear the sticky bit incase it is already set */
498 p0.h = hi(WDOG_CTL);
499 p0.l = lo(WDOG_CTL);
500 r0.l = 0x8AD6;
501 w[p0] = r0.l;
502 SSYNC;
503
504 /* Program the count value */
505 R0.l = 0x100;
506 R0.h = 0x0;
507 P0.h = hi(WDOG_CNT);
508 P0.l = lo(WDOG_CNT);
509 [P0] = R0;
510 SSYNC; 490 SSYNC;
511 491
512 /* Program WDOG_STAT if necessary */ 492 /* issue a system soft reset */
513 P0.h = hi(WDOG_CTL); 493 P1.h = hi(SWRST);
514 P0.l = lo(WDOG_CTL); 494 P1.l = lo(SWRST);
515 R0 = W[P0](Z); 495 R1.l = 0x0007;
516 CC = BITTST(R0,1); 496 W[P1] = R1;
517 if !CC JUMP .LWRITESTAT;
518 CC = BITTST(R0,2);
519 if !CC JUMP .LWRITESTAT;
520 JUMP .LSKIP_WRITE;
521
522.LWRITESTAT:
523 /* When watch dog timer is enabled, a write to STAT will load the contents of CNT to STAT */
524 R0 = 0x0000(z);
525 P0.h = hi(WDOG_STAT);
526 P0.l = lo(WDOG_STAT)
527 [P0] = R0;
528 SSYNC; 497 SSYNC;
529 498
530.LSKIP_WRITE: 499 /* clear system soft reset */
531 /* Enable the reset event */ 500 R0.l = 0x0000;
532 P0.h = hi(WDOG_CTL); 501 W[P0] = R0;
533 P0.l = lo(WDOG_CTL);
534 R0 = W[P0](Z);
535 BITCLR(R0,1);
536 BITCLR(R0,2);
537 W[P0] = R0.L;
538 SSYNC;
539 NOP;
540
541 /* Enable the wdog counter */
542 R0 = W[P0](Z);
543 BITCLR(R0,4);
544 W[P0] = R0.L;
545 SSYNC; 502 SSYNC;
546 503
547 IDLE; 504 /* issue core reset */
505 raise 1;
548 506
549 RTS; 507 RTS;
508ENDPROC(_bfin_reset)
550 509
551#if CONFIG_DEBUG_KERNEL_START 510#if CONFIG_DEBUG_KERNEL_START
552debug_kernel_start_trap: 511debug_kernel_start_trap:
diff --git a/arch/blackfin/mach-bf537/cpu.c b/arch/blackfin/mach-bf537/cpu.c
index 2d83b7e35469..0442c4c7f723 100644
--- a/arch/blackfin/mach-bf537/cpu.c
+++ b/arch/blackfin/mach-bf537/cpu.c
@@ -43,13 +43,13 @@
43#define VCO1 (CONFIG_CLKIN_HZ*9) /*99532800 */ 43#define VCO1 (CONFIG_CLKIN_HZ*9) /*99532800 */
44#define VCO(x) VCO##x 44#define VCO(x) VCO##x
45 45
46#define FREQ(x) {VCO(x),VCO(x)/4},{VCO(x),VCO(x)/2},{VCO(x),VCO(x)} 46#define MFREQ(x) {VCO(x),VCO(x)/4},{VCO(x),VCO(x)/2},{VCO(x),VCO(x)}
47/* frequency */ 47/* frequency */
48static struct cpufreq_frequency_table bf537_freq_table[] = { 48static struct cpufreq_frequency_table bf537_freq_table[] = {
49 FREQ(1), 49 MFREQ(1),
50 FREQ(3), 50 MFREQ(3),
51 {VCO4, VCO4 / 2}, {VCO4, VCO4}, 51 {VCO4, VCO4 / 2}, {VCO4, VCO4},
52 FREQ(5), 52 MFREQ(5),
53 {0, CPUFREQ_TABLE_END}, 53 {0, CPUFREQ_TABLE_END},
54}; 54};
55 55
@@ -59,13 +59,14 @@ static struct cpufreq_frequency_table bf537_freq_table[] = {
59 */ 59 */
60static int bf537_getfreq(unsigned int cpu) 60static int bf537_getfreq(unsigned int cpu)
61{ 61{
62 unsigned long cclk_mhz, vco_mhz; 62 unsigned long cclk_mhz;
63 63
64 /* The driver only support single cpu */ 64 /* The driver only support single cpu */
65 if (cpu == 0) 65 if (cpu == 0)
66 dpmc_fops.ioctl(NULL, NULL, IOCTL_GET_CORECLOCK, &cclk_mhz); 66 dpmc_fops.ioctl(NULL, NULL, IOCTL_GET_CORECLOCK, &cclk_mhz);
67 else 67 else
68 cclk_mhz = -1; 68 cclk_mhz = -1;
69
69 return cclk_mhz; 70 return cclk_mhz;
70} 71}
71 72
@@ -75,13 +76,12 @@ static int bf537_target(struct cpufreq_policy *policy,
75 unsigned long cclk_mhz; 76 unsigned long cclk_mhz;
76 unsigned long vco_mhz; 77 unsigned long vco_mhz;
77 unsigned long flags; 78 unsigned long flags;
78 unsigned int index, vco_index; 79 unsigned int index;
79 int i;
80
81 struct cpufreq_freqs freqs; 80 struct cpufreq_freqs freqs;
82 if (cpufreq_frequency_table_target 81
83 (policy, bf537_freq_table, target_freq, relation, &index)) 82 if (cpufreq_frequency_table_target(policy, bf537_freq_table, target_freq, relation, &index))
84 return -EINVAL; 83 return -EINVAL;
84
85 cclk_mhz = bf537_freq_table[index].frequency; 85 cclk_mhz = bf537_freq_table[index].frequency;
86 vco_mhz = bf537_freq_table[index].index; 86 vco_mhz = bf537_freq_table[index].index;
87 87
@@ -114,8 +114,6 @@ static int bf537_verify_speed(struct cpufreq_policy *policy)
114 114
115static int __init __bf537_cpu_init(struct cpufreq_policy *policy) 115static int __init __bf537_cpu_init(struct cpufreq_policy *policy)
116{ 116{
117 int result;
118
119 if (policy->cpu != 0) 117 if (policy->cpu != 0)
120 return -EINVAL; 118 return -EINVAL;
121 119
diff --git a/arch/blackfin/mach-bf537/head.S b/arch/blackfin/mach-bf537/head.S
index d104e1d8e07a..2c2652bee7e5 100644
--- a/arch/blackfin/mach-bf537/head.S
+++ b/arch/blackfin/mach-bf537/head.S
@@ -181,7 +181,8 @@ ENTRY(__stext)
181 SSYNC; 181 SSYNC;
182#endif 182#endif
183 183
184 /*Initialise UART*/ 184 /* Initialise UART - when booting from u-boot, the UART is not disabled
185 * so if we dont initalize here, our serial console gets hosed */
185 p0.h = hi(UART_LCR); 186 p0.h = hi(UART_LCR);
186 p0.l = lo(UART_LCR); 187 p0.l = lo(UART_LCR);
187 r0 = 0x0(Z); 188 r0 = 0x0(Z);
@@ -469,47 +470,41 @@ ENTRY(_bfin_reset)
469 SSYNC; 470 SSYNC;
470 471
471#if defined(CONFIG_MTD_M25P80) 472#if defined(CONFIG_MTD_M25P80)
472/* 473 /*
473 * The following code fix the SPI flash reboot issue, 474 * The following code fix the SPI flash reboot issue,
474 * /CS signal of the chip which is using PF10 return to GPIO mode 475 * /CS signal of the chip which is using PF10 return to GPIO mode
475 */ 476 */
476 p0.h = hi(PORTF_FER); 477 p0.h = hi(PORTF_FER);
477 p0.l = lo(PORTF_FER); 478 p0.l = lo(PORTF_FER);
478 r0.l = 0x0000; 479 r0.l = 0x0000;
479 w[p0] = r0.l; 480 w[p0] = r0.l;
480 SSYNC; 481 SSYNC;
481 482
482/* /CS return to high */ 483 /* /CS return to high */
483 p0.h = hi(PORTFIO); 484 p0.h = hi(PORTFIO);
484 p0.l = lo(PORTFIO); 485 p0.l = lo(PORTFIO);
485 r0.l = 0xFFFF; 486 r0.l = 0xFFFF;
486 w[p0] = r0.l; 487 w[p0] = r0.l;
487 SSYNC; 488 SSYNC;
488 489
489/* Delay some time, This is necessary */ 490 /* Delay some time, This is necessary */
490 r1.h = 0; 491 r1.h = 0;
491 r1.l = 0x400; 492 r1.l = 0x400;
492 p1 = r1; 493 p1 = r1;
493 lsetup (_delay_lab1,_delay_lab1_end ) lc1 = p1; 494 lsetup (.L_delay_lab1, .L_delay_lab1_end) lc1 = p1;
494_delay_lab1: 495.L_delay_lab1:
495 r0.h = 0; 496 r0.h = 0;
496 r0.l = 0x8000; 497 r0.l = 0x8000;
497 p0 = r0; 498 p0 = r0;
498 lsetup (_delay_lab0,_delay_lab0_end ) lc0 = p0; 499 lsetup (.L_delay_lab0, .L_delay_lab0_end) lc0 = p0;
499_delay_lab0: 500.L_delay_lab0:
500 nop; 501 nop;
501_delay_lab0_end: 502.L_delay_lab0_end:
502 nop; 503 nop;
503_delay_lab1_end: 504.L_delay_lab1_end:
504 nop; 505 nop;
505#endif 506#endif
506 507
507 /* Clear the bits 13-15 in SWRST if they werent cleared */
508 p0.h = hi(SWRST);
509 p0.l = lo(SWRST);
510 csync;
511 r0.l = w[p0];
512
513 /* Clear the IMASK register */ 508 /* Clear the IMASK register */
514 p0.h = hi(IMASK); 509 p0.h = hi(IMASK);
515 p0.l = lo(IMASK); 510 p0.l = lo(IMASK);
@@ -523,68 +518,30 @@ _delay_lab1_end:
523 [p0] = r0; 518 [p0] = r0;
524 SSYNC; 519 SSYNC;
525 520
526 /* Disable the WDOG TIMER */ 521 /* make sure SYSCR is set to use BMODE */
527 p0.h = hi(WDOG_CTL); 522 P0.h = hi(SYSCR);
528 p0.l = lo(WDOG_CTL); 523 P0.l = lo(SYSCR);
529 r0.l = 0xAD6; 524 R0.l = 0x0;
530 w[p0] = r0.l; 525 W[P0] = R0.l;
531 SSYNC;
532
533 /* Clear the sticky bit incase it is already set */
534 p0.h = hi(WDOG_CTL);
535 p0.l = lo(WDOG_CTL);
536 r0.l = 0x8AD6;
537 w[p0] = r0.l;
538 SSYNC;
539
540 /* Program the count value */
541 R0.l = 0x100;
542 R0.h = 0x0;
543 P0.h = hi(WDOG_CNT);
544 P0.l = lo(WDOG_CNT);
545 [P0] = R0;
546 SSYNC;
547
548 /* Program WDOG_STAT if necessary */
549 P0.h = hi(WDOG_CTL);
550 P0.l = lo(WDOG_CTL);
551 R0 = W[P0](Z);
552 CC = BITTST(R0,1);
553 if !CC JUMP .LWRITESTAT;
554 CC = BITTST(R0,2);
555 if !CC JUMP .LWRITESTAT;
556 JUMP .LSKIP_WRITE;
557
558.LWRITESTAT:
559 /* When watch dog timer is enabled,
560 * a write to STAT will load the contents of CNT to STAT
561 */
562 R0 = 0x0000(z);
563 P0.h = hi(WDOG_STAT);
564 P0.l = lo(WDOG_STAT)
565 [P0] = R0;
566 SSYNC; 526 SSYNC;
567 527
568.LSKIP_WRITE: 528 /* issue a system soft reset */
569 /* Enable the reset event */ 529 P1.h = hi(SWRST);
570 P0.h = hi(WDOG_CTL); 530 P1.l = lo(SWRST);
571 P0.l = lo(WDOG_CTL); 531 R1.l = 0x0007;
572 R0 = W[P0](Z); 532 W[P1] = R1;
573 BITCLR(R0,1);
574 BITCLR(R0,2);
575 W[P0] = R0.L;
576 SSYNC; 533 SSYNC;
577 NOP;
578 534
579 /* Enable the wdog counter */ 535 /* clear system soft reset */
580 R0 = W[P0](Z); 536 R0.l = 0x0000;
581 BITCLR(R0,4); 537 W[P0] = R0;
582 W[P0] = R0.L;
583 SSYNC; 538 SSYNC;
584 539
585 IDLE; 540 /* issue core reset */
541 raise 1;
586 542
587 RTS; 543 RTS;
544ENDPROC(_bfin_reset)
588 545
589.data 546.data
590 547
diff --git a/arch/blackfin/mach-bf561/boards/Makefile b/arch/blackfin/mach-bf561/boards/Makefile
index 886edc739ab4..495a1cf9d452 100644
--- a/arch/blackfin/mach-bf561/boards/Makefile
+++ b/arch/blackfin/mach-bf561/boards/Makefile
@@ -3,5 +3,6 @@
3# 3#
4 4
5obj-$(CONFIG_GENERIC_BOARD) += generic_board.o 5obj-$(CONFIG_GENERIC_BOARD) += generic_board.o
6obj-$(CONFIG_BFIN561_EZKIT) += ezkit.o
7obj-$(CONFIG_BFIN561_BLUETECHNIX_CM) += cm_bf561.o 6obj-$(CONFIG_BFIN561_BLUETECHNIX_CM) += cm_bf561.o
7obj-$(CONFIG_BFIN561_EZKIT) += ezkit.o
8obj-$(CONFIG_BFIN561_TEPLA) += tepla.o
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 14eb4f9a68ea..9720b5c307ab 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -32,12 +32,61 @@
32#include <linux/spi/spi.h> 32#include <linux/spi/spi.h>
33#include <asm/irq.h> 33#include <asm/irq.h>
34#include <asm/bfin5xx_spi.h> 34#include <asm/bfin5xx_spi.h>
35#include <linux/interrupt.h>
36#include <linux/irq.h>
35 37
36/* 38/*
37 * Name the Board for the /proc/cpuinfo 39 * Name the Board for the /proc/cpuinfo
38 */ 40 */
39char *bfin_board_name = "ADDS-BF561-EZKIT"; 41char *bfin_board_name = "ADDS-BF561-EZKIT";
40 42
43#define ISP1761_BASE 0x2C0F0000
44#define ISP1761_IRQ IRQ_PF10
45
46#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
47static struct resource bfin_isp1761_resources[] = {
48 [0] = {
49 .name = "isp1761-regs",
50 .start = ISP1761_BASE + 0x00000000,
51 .end = ISP1761_BASE + 0x000fffff,
52 .flags = IORESOURCE_MEM,
53 },
54 [1] = {
55 .start = ISP1761_IRQ,
56 .end = ISP1761_IRQ,
57 .flags = IORESOURCE_IRQ,
58 },
59};
60
61static struct platform_device bfin_isp1761_device = {
62 .name = "isp1761",
63 .id = 0,
64 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
65 .resource = bfin_isp1761_resources,
66};
67
68static struct platform_device *bfin_isp1761_devices[] = {
69 &bfin_isp1761_device,
70};
71
72int __init bfin_isp1761_init(void)
73{
74 unsigned int num_devices=ARRAY_SIZE(bfin_isp1761_devices);
75
76 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
77 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
78
79 return platform_add_devices(bfin_isp1761_devices, num_devices);
80}
81
82void __exit bfin_isp1761_exit(void)
83{
84 platform_device_unregister(&bfin_isp1761_device);
85}
86
87arch_initcall(bfin_isp1761_init);
88#endif
89
41/* 90/*
42 * USB-LAN EzExtender board 91 * USB-LAN EzExtender board
43 * Driver needs to know address, irq and flag pin. 92 * Driver needs to know address, irq and flag pin.
@@ -135,13 +184,18 @@ static int __init ezkit_init(void)
135{ 184{
136 int ret; 185 int ret;
137 186
138 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); 187 printk(KERN_INFO "%s(): registering device resources\n", __func__);
139 ret = platform_add_devices(ezkit_devices, 188
140 ARRAY_SIZE(ezkit_devices)); 189 ret = platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
141 if (ret < 0) 190 if (ret < 0)
142 return ret; 191 return ret;
143 return spi_register_board_info(bfin_spi_board_info, 192
144 ARRAY_SIZE(bfin_spi_board_info)); 193#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
194 bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12));
195 SSYNC();
196#endif
197
198 return spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
145} 199}
146 200
147arch_initcall(ezkit_init); 201arch_initcall(ezkit_init);
diff --git a/arch/blackfin/mach-bf561/boards/tepla.c b/arch/blackfin/mach-bf561/boards/tepla.c
new file mode 100644
index 000000000000..db308c7ccabb
--- /dev/null
+++ b/arch/blackfin/mach-bf561/boards/tepla.c
@@ -0,0 +1,61 @@
1/*
2 * File: arch/blackfin/mach-bf561/tepla.c
3 *
4 * Copyright 2004-2007 Analog Devices Inc.
5 * Only SMSC91C1111 was registered, may do more later.
6 *
7 * Copyright 2005 National ICT Australia (NICTA), Aidan Williams <aidan@nicta.com.au>
8 * Thanks to Jamey Hicks.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/device.h>
16#include <linux/platform_device.h>
17#include <asm/irq.h>
18
19char *bfin_board_name = "Tepla-BF561";
20
21/*
22 * Driver needs to know address, irq and flag pin.
23 */
24static struct resource smc91x_resources[] = {
25 {
26 .start = 0x2C000300,
27 .end = 0x2C000320,
28 .flags = IORESOURCE_MEM,
29 },{
30 .start = IRQ_PROG_INTB,
31 .end = IRQ_PROG_INTB,
32 .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,
33 },{
34 /*
35 * denotes the flag pin and is used directly if
36 * CONFIG_IRQCHIP_DEMUX_GPIO is defined.
37 */
38 .start = IRQ_PF7,
39 .end = IRQ_PF7,
40 .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,
41 },
42};
43
44static struct platform_device smc91x_device = {
45 .name = "smc91x",
46 .id = 0,
47 .num_resources = ARRAY_SIZE(smc91x_resources),
48 .resource = smc91x_resources,
49};
50
51static struct platform_device *tepla_devices[] __initdata = {
52 &smc91x_device,
53};
54
55static int __init tepla_init(void)
56{
57 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
58 return platform_add_devices(tepla_devices, ARRAY_SIZE(tepla_devices));
59}
60
61arch_initcall(tepla_init);
diff --git a/arch/blackfin/mach-bf561/head.S b/arch/blackfin/mach-bf561/head.S
index 7bca478526b9..ad9187a866a5 100644
--- a/arch/blackfin/mach-bf561/head.S
+++ b/arch/blackfin/mach-bf561/head.S
@@ -127,7 +127,8 @@ ENTRY(__stext)
127 STI R2; 127 STI R2;
128#endif 128#endif
129 129
130 /* Initialise UART*/ 130 /* Initialise UART - when booting from u-boot, the UART is not disabled
131 * so if we dont initalize here, our serial console gets hosed */
131 p0.h = hi(UART_LCR); 132 p0.h = hi(UART_LCR);
132 p0.l = lo(UART_LCR); 133 p0.l = lo(UART_LCR);
133 r0 = 0x0(Z); 134 r0 = 0x0(Z);
@@ -414,12 +415,6 @@ ENTRY(_bfin_reset)
414 w[p0] = r0.l; 415 w[p0] = r0.l;
415#endif 416#endif
416 417
417 /* Clear the bits 13-15 in SWRST if they werent cleared */
418 p0.h = hi(SICA_SWRST);
419 p0.l = lo(SICA_SWRST);
420 csync;
421 r0.l = w[p0];
422
423 /* Clear the IMASK register */ 418 /* Clear the IMASK register */
424 p0.h = hi(IMASK); 419 p0.h = hi(IMASK);
425 p0.l = lo(IMASK); 420 p0.l = lo(IMASK);
@@ -433,68 +428,30 @@ ENTRY(_bfin_reset)
433 [p0] = r0; 428 [p0] = r0;
434 SSYNC; 429 SSYNC;
435 430
436 /* Disable the WDOG TIMER */ 431 /* make sure SYSCR is set to use BMODE */
437 p0.h = hi(WDOGA_CTL); 432 P0.h = hi(SICA_SYSCR);
438 p0.l = lo(WDOGA_CTL); 433 P0.l = lo(SICA_SYSCR);
439 r0.l = 0xAD6; 434 R0.l = 0x20;
440 w[p0] = r0.l; 435 W[P0] = R0.l;
441 SSYNC;
442
443 /* Clear the sticky bit incase it is already set */
444 p0.h = hi(WDOGA_CTL);
445 p0.l = lo(WDOGA_CTL);
446 r0.l = 0x8AD6;
447 w[p0] = r0.l;
448 SSYNC; 436 SSYNC;
449 437
450 /* Program the count value */ 438 /* issue a system soft reset */
451 R0.l = 0x100; 439 P1.h = hi(SICA_SWRST);
452 R0.h = 0x0; 440 P1.l = lo(SICA_SWRST);
453 P0.h = hi(WDOGA_CNT); 441 R1.l = 0x0007;
454 P0.l = lo(WDOGA_CNT); 442 W[P1] = R1;
455 [P0] = R0;
456 SSYNC; 443 SSYNC;
457 444
458 /* Program WDOG_STAT if necessary */ 445 /* clear system soft reset */
459 P0.h = hi(WDOGA_CTL); 446 R0.l = 0x0000;
460 P0.l = lo(WDOGA_CTL); 447 W[P0] = R0;
461 R0 = W[P0](Z);
462 CC = BITTST(R0,1);
463 if !CC JUMP .LWRITESTAT;
464 CC = BITTST(R0,2);
465 if !CC JUMP .LWRITESTAT;
466 JUMP .LSKIP_WRITE;
467
468.LWRITESTAT:
469 /* When watch dog timer is enabled,
470 * a write to STAT will load the contents of CNT to STAT
471 */
472 R0 = 0x0000(z);
473 P0.h = hi(WDOGA_STAT);
474 P0.l = lo(WDOGA_STAT)
475 [P0] = R0;
476 SSYNC;
477
478.LSKIP_WRITE:
479 /* Enable the reset event */
480 P0.h = hi(WDOGA_CTL);
481 P0.l = lo(WDOGA_CTL);
482 R0 = W[P0](Z);
483 BITCLR(R0,1);
484 BITCLR(R0,2);
485 W[P0] = R0.L;
486 SSYNC;
487 NOP;
488
489 /* Enable the wdog counter */
490 R0 = W[P0](Z);
491 BITCLR(R0,4);
492 W[P0] = R0.L;
493 SSYNC; 448 SSYNC;
494 449
495 IDLE; 450 /* issue core reset */
451 raise 1;
496 452
497 RTS; 453 RTS;
454ENDPROC(_bfin_reset)
498 455
499.data 456.data
500 457
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index 8eb0a9023482..7d0368772cda 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -181,6 +181,12 @@ ENTRY(_ex_single_step)
181 181
182_return_from_exception: 182_return_from_exception:
183 DEBUG_START_HWTRACE 183 DEBUG_START_HWTRACE
184#ifdef ANOMALY_05000257
185 R7=LC0;
186 LC0=R7;
187 R7=LC1;
188 LC1=R7;
189#endif
184 (R7:6,P5:4) = [sp++]; 190 (R7:6,P5:4) = [sp++];
185 ASTAT = [sp++]; 191 ASTAT = [sp++];
186 sp = retn; 192 sp = retn;
@@ -706,6 +712,11 @@ _schedule_and_signal_from_int:
706 p1.h = _evt_system_call; 712 p1.h = _evt_system_call;
707 [p0] = p1; 713 [p0] = p1;
708 csync; 714 csync;
715
716 /* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */
717 r0 = -1 (x);
718 [sp + PT_ORIG_P0] = r0;
719
709 p1 = rets; 720 p1 = rets;
710 [sp + PT_RESERVED] = p1; 721 [sp + PT_RESERVED] = p1;
711 722
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c
index deb27272c658..afed5246dd9e 100644
--- a/arch/blackfin/mach-common/pm.c
+++ b/arch/blackfin/mach-common/pm.c
@@ -102,10 +102,8 @@ static int bfin_pm_prepare(suspend_state_t state)
102 switch (state) { 102 switch (state) {
103 case PM_SUSPEND_STANDBY: 103 case PM_SUSPEND_STANDBY:
104 break; 104 break;
105 case PM_SUSPEND_MEM:
106 return -ENOTSUPP;
107 105
108 case PM_SUSPEND_DISK: 106 case PM_SUSPEND_MEM:
109 return -ENOTSUPP; 107 return -ENOTSUPP;
110 108
111 default: 109 default:
@@ -126,10 +124,8 @@ static int bfin_pm_enter(suspend_state_t state)
126 case PM_SUSPEND_STANDBY: 124 case PM_SUSPEND_STANDBY:
127 bfin_pm_suspend_standby_enter(); 125 bfin_pm_suspend_standby_enter();
128 break; 126 break;
129 case PM_SUSPEND_MEM:
130 return -ENOTSUPP;
131 127
132 case PM_SUSPEND_DISK: 128 case PM_SUSPEND_MEM:
133 return -ENOTSUPP; 129 return -ENOTSUPP;
134 130
135 default: 131 default:
@@ -155,9 +151,6 @@ static int bfin_pm_finish(suspend_state_t state)
155 case PM_SUSPEND_MEM: 151 case PM_SUSPEND_MEM:
156 return -ENOTSUPP; 152 return -ENOTSUPP;
157 153
158 case PM_SUSPEND_DISK:
159 return -ENOTSUPP;
160
161 default: 154 default:
162 return -EINVAL; 155 return -EINVAL;
163 } 156 }
@@ -166,7 +159,6 @@ static int bfin_pm_finish(suspend_state_t state)
166} 159}
167 160
168struct pm_ops bfin_pm_ops = { 161struct pm_ops bfin_pm_ops = {
169 .pm_disk_mode = PM_DISK_PLATFORM,
170 .prepare = bfin_pm_prepare, 162 .prepare = bfin_pm_prepare,
171 .enter = bfin_pm_enter, 163 .enter = bfin_pm_enter,
172 .finish = bfin_pm_finish, 164 .finish = bfin_pm_finish,
diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
index 73f72abed432..d6cf1059560d 100644
--- a/arch/blackfin/mm/init.c
+++ b/arch/blackfin/mm/init.c
@@ -116,7 +116,8 @@ void paging_init(void)
116 { 116 {
117 unsigned long zones_size[MAX_NR_ZONES] = { 0, }; 117 unsigned long zones_size[MAX_NR_ZONES] = { 0, };
118 118
119 zones_size[ZONE_NORMAL] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT; 119 zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
120 zones_size[ZONE_NORMAL] = 0;
120#ifdef CONFIG_HIGHMEM 121#ifdef CONFIG_HIGHMEM
121 zones_size[ZONE_HIGHMEM] = 0; 122 zones_size[ZONE_HIGHMEM] = 0;
122#endif 123#endif
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index 28eae9735ad6..481dc1374640 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -101,13 +101,14 @@ SECTIONS
101 _stext = .; 101 _stext = .;
102 .text : { 102 .text : {
103 *( 103 *(
104 .text.start .text .text.* 104 .text.start .text.*
105#ifdef CONFIG_DEBUG_INFO 105#ifdef CONFIG_DEBUG_INFO
106 .init.text 106 .init.text
107 .exit.text 107 .exit.text
108 .exitcall.exit 108 .exitcall.exit
109#endif 109#endif
110 ) 110 )
111 TEXT_TEXT
111 SCHED_TEXT 112 SCHED_TEXT
112 LOCK_TEXT 113 LOCK_TEXT
113 *(.fixup) 114 *(.fixup)
@@ -135,7 +136,8 @@ SECTIONS
135 136
136 _sdata = .; 137 _sdata = .;
137 .data : { /* Data */ 138 .data : { /* Data */
138 *(.data .data.*) 139 DATA_DATA
140 *(.data.*)
139 *(.exit.data) 141 *(.exit.data)
140 CONSTRUCTORS 142 CONSTRUCTORS
141 } 143 }
diff --git a/arch/h8300/kernel/sys_h8300.c b/arch/h8300/kernel/sys_h8300.c
index 11ba75a05220..de7688cfd573 100644
--- a/arch/h8300/kernel/sys_h8300.c
+++ b/arch/h8300/kernel/sys_h8300.c
@@ -288,9 +288,9 @@ asmlinkage void syscall_print(void *dummy,...)
288int kernel_execve(const char *filename, char *const argv[], char *const envp[]) 288int kernel_execve(const char *filename, char *const argv[], char *const envp[])
289{ 289{
290 register long res __asm__("er0"); 290 register long res __asm__("er0");
291 register char *const *_c __asm__("er3") = envp;
292 register char *const *_b __asm__("er2") = argv;
291 register const char * _a __asm__("er1") = filename; 293 register const char * _a __asm__("er1") = filename;
292 register void *_b __asm__("er2") = argv;
293 register void *_c __asm__("er3") = envp;
294 __asm__ __volatile__ ("mov.l %1,er0\n\t" 294 __asm__ __volatile__ ("mov.l %1,er0\n\t"
295 "trapa #0\n\t" 295 "trapa #0\n\t"
296 : "=r" (res) 296 : "=r" (res)
diff --git a/arch/h8300/kernel/traps.c b/arch/h8300/kernel/traps.c
index 300e3279ca5a..f97183011c2c 100644
--- a/arch/h8300/kernel/traps.c
+++ b/arch/h8300/kernel/traps.c
@@ -136,7 +136,7 @@ void show_stack(struct task_struct *task, unsigned long *esp)
136 printk("\nCall Trace:"); 136 printk("\nCall Trace:");
137 i = 0; 137 i = 0;
138 stack = esp; 138 stack = esp;
139 while (((unsigned long)stack & (THREAD_SIZE - 1)) == 0) { 139 while (((unsigned long)stack & (THREAD_SIZE - 1)) != 0) {
140 addr = *stack++; 140 addr = *stack++;
141 /* 141 /*
142 * If the address is either in the text segment of the 142 * If the address is either in the text segment of the
diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S
index 65f1cdc5ee04..a2e72d495551 100644
--- a/arch/h8300/kernel/vmlinux.lds.S
+++ b/arch/h8300/kernel/vmlinux.lds.S
@@ -75,7 +75,7 @@ SECTIONS
75 *(.int_redirect) 75 *(.int_redirect)
76#endif 76#endif
77 __stext = . ; 77 __stext = . ;
78 *(.text) 78 TEXT_TEXT
79 SCHED_TEXT 79 SCHED_TEXT
80 LOCK_TEXT 80 LOCK_TEXT
81 __etext = . ; 81 __etext = . ;
@@ -103,7 +103,7 @@ SECTIONS
103 . = ALIGN(0x2000) ; 103 . = ALIGN(0x2000) ;
104 *(.data.init_task) 104 *(.data.init_task)
105 . = ALIGN(0x4) ; 105 . = ALIGN(0x4) ;
106 *(.data) 106 DATA_DATA
107 . = ALIGN(0x4) ; 107 . = ALIGN(0x4) ;
108 *(.data.*) 108 *(.data.*)
109 109
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index c2d54b802232..8770a5d0b143 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -891,7 +891,7 @@ config PHYSICAL_ALIGN
891 Don't change this unless you know what you are doing. 891 Don't change this unless you know what you are doing.
892 892
893config HOTPLUG_CPU 893config HOTPLUG_CPU
894 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" 894 bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
895 depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER 895 depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER
896 ---help--- 896 ---help---
897 Say Y here to experiment with turning CPUs off and on, and to 897 Say Y here to experiment with turning CPUs off and on, and to
diff --git a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
index f8b3b9cda2b1..6dbcc95b2120 100644
--- a/arch/i386/boot/setup.S
+++ b/arch/i386/boot/setup.S
@@ -310,6 +310,8 @@ loader_ok:
310 call verify_cpu 310 call verify_cpu
311 testl %eax,%eax 311 testl %eax,%eax
312 jz cpu_ok 312 jz cpu_ok
313 movw %cs,%ax # aka SETUPSEG
314 movw %ax,%ds
313 lea cpu_panic_mess,%si 315 lea cpu_panic_mess,%si
314 call prtstr 316 call prtstr
3151: jmp 1b 3171: jmp 1b
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 9da84412a831..1a3a2217b7c2 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21-git3 3# Linux kernel version: 2.6.22-rc2
4# Tue May 1 07:30:51 2007 4# Mon May 21 13:23:44 2007
5# 5#
6CONFIG_X86_32=y 6CONFIG_X86_32=y
7CONFIG_GENERIC_TIME=y 7CONFIG_GENERIC_TIME=y
@@ -14,6 +14,7 @@ CONFIG_SEMAPHORE_SLEEPERS=y
14CONFIG_X86=y 14CONFIG_X86=y
15CONFIG_MMU=y 15CONFIG_MMU=y
16CONFIG_ZONE_DMA=y 16CONFIG_ZONE_DMA=y
17CONFIG_QUICKLIST=y
17CONFIG_GENERIC_ISA_DMA=y 18CONFIG_GENERIC_ISA_DMA=y
18CONFIG_GENERIC_IOMAP=y 19CONFIG_GENERIC_IOMAP=y
19CONFIG_GENERIC_BUG=y 20CONFIG_GENERIC_BUG=y
@@ -45,6 +46,7 @@ CONFIG_POSIX_MQUEUE=y
45# CONFIG_AUDIT is not set 46# CONFIG_AUDIT is not set
46CONFIG_IKCONFIG=y 47CONFIG_IKCONFIG=y
47CONFIG_IKCONFIG_PROC=y 48CONFIG_IKCONFIG_PROC=y
49CONFIG_LOG_BUF_SHIFT=18
48# CONFIG_CPUSETS is not set 50# CONFIG_CPUSETS is not set
49CONFIG_SYSFS_DEPRECATED=y 51CONFIG_SYSFS_DEPRECATED=y
50# CONFIG_RELAY is not set 52# CONFIG_RELAY is not set
@@ -64,14 +66,19 @@ CONFIG_BUG=y
64CONFIG_ELF_CORE=y 66CONFIG_ELF_CORE=y
65CONFIG_BASE_FULL=y 67CONFIG_BASE_FULL=y
66CONFIG_FUTEX=y 68CONFIG_FUTEX=y
69CONFIG_ANON_INODES=y
67CONFIG_EPOLL=y 70CONFIG_EPOLL=y
71CONFIG_SIGNALFD=y
72CONFIG_TIMERFD=y
73CONFIG_EVENTFD=y
68CONFIG_SHMEM=y 74CONFIG_SHMEM=y
69CONFIG_SLAB=y
70CONFIG_VM_EVENT_COUNTERS=y 75CONFIG_VM_EVENT_COUNTERS=y
76CONFIG_SLAB=y
77# CONFIG_SLUB is not set
78# CONFIG_SLOB is not set
71CONFIG_RT_MUTEXES=y 79CONFIG_RT_MUTEXES=y
72# CONFIG_TINY_SHMEM is not set 80# CONFIG_TINY_SHMEM is not set
73CONFIG_BASE_SMALL=0 81CONFIG_BASE_SMALL=0
74# CONFIG_SLOB is not set
75 82
76# 83#
77# Loadable module support 84# Loadable module support
@@ -165,7 +172,7 @@ CONFIG_X86_INTEL_USERCOPY=y
165CONFIG_X86_USE_PPRO_CHECKSUM=y 172CONFIG_X86_USE_PPRO_CHECKSUM=y
166CONFIG_X86_TSC=y 173CONFIG_X86_TSC=y
167CONFIG_X86_CMOV=y 174CONFIG_X86_CMOV=y
168CONFIG_X86_MINIMUM_CPU_MODEL=4 175CONFIG_X86_MINIMUM_CPU_FAMILY=4
169CONFIG_HPET_TIMER=y 176CONFIG_HPET_TIMER=y
170CONFIG_HPET_EMULATE_RTC=y 177CONFIG_HPET_EMULATE_RTC=y
171CONFIG_NR_CPUS=32 178CONFIG_NR_CPUS=32
@@ -211,6 +218,7 @@ CONFIG_FLAT_NODE_MEM_MAP=y
211CONFIG_SPLIT_PTLOCK_CPUS=4 218CONFIG_SPLIT_PTLOCK_CPUS=4
212CONFIG_RESOURCES_64BIT=y 219CONFIG_RESOURCES_64BIT=y
213CONFIG_ZONE_DMA_FLAG=1 220CONFIG_ZONE_DMA_FLAG=1
221CONFIG_NR_QUICK=1
214# CONFIG_HIGHPTE is not set 222# CONFIG_HIGHPTE is not set
215# CONFIG_MATH_EMULATION is not set 223# CONFIG_MATH_EMULATION is not set
216CONFIG_MTRR=y 224CONFIG_MTRR=y
@@ -237,7 +245,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
237CONFIG_PM=y 245CONFIG_PM=y
238CONFIG_PM_LEGACY=y 246CONFIG_PM_LEGACY=y
239# CONFIG_PM_DEBUG is not set 247# CONFIG_PM_DEBUG is not set
240CONFIG_PM_SYSFS_DEPRECATED=y 248# CONFIG_PM_SYSFS_DEPRECATED is not set
241 249
242# 250#
243# ACPI (Advanced Configuration and Power Interface) Support 251# ACPI (Advanced Configuration and Power Interface) Support
@@ -277,7 +285,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
277# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 285# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
278CONFIG_CPU_FREQ_GOV_USERSPACE=y 286CONFIG_CPU_FREQ_GOV_USERSPACE=y
279CONFIG_CPU_FREQ_GOV_ONDEMAND=y 287CONFIG_CPU_FREQ_GOV_ONDEMAND=y
280CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y 288# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
281 289
282# 290#
283# CPUFreq processor drivers 291# CPUFreq processor drivers
@@ -315,9 +323,10 @@ CONFIG_PCI_BIOS=y
315CONFIG_PCI_DIRECT=y 323CONFIG_PCI_DIRECT=y
316CONFIG_PCI_MMCONFIG=y 324CONFIG_PCI_MMCONFIG=y
317# CONFIG_PCIEPORTBUS is not set 325# CONFIG_PCIEPORTBUS is not set
326CONFIG_ARCH_SUPPORTS_MSI=y
318CONFIG_PCI_MSI=y 327CONFIG_PCI_MSI=y
319# CONFIG_PCI_DEBUG is not set 328# CONFIG_PCI_DEBUG is not set
320# CONFIG_HT_IRQ is not set 329CONFIG_HT_IRQ=y
321CONFIG_ISA_DMA_API=y 330CONFIG_ISA_DMA_API=y
322# CONFIG_ISA is not set 331# CONFIG_ISA is not set
323# CONFIG_MCA is not set 332# CONFIG_MCA is not set
@@ -328,10 +337,6 @@ CONFIG_K8_NB=y
328# PCCARD (PCMCIA/CardBus) support 337# PCCARD (PCMCIA/CardBus) support
329# 338#
330# CONFIG_PCCARD is not set 339# CONFIG_PCCARD is not set
331
332#
333# PCI Hotplug Support
334#
335# CONFIG_HOTPLUG_PCI is not set 340# CONFIG_HOTPLUG_PCI is not set
336 341
337# 342#
@@ -377,7 +382,7 @@ CONFIG_IP_PNP_DHCP=y
377CONFIG_INET_TUNNEL=y 382CONFIG_INET_TUNNEL=y
378CONFIG_INET_XFRM_MODE_TRANSPORT=y 383CONFIG_INET_XFRM_MODE_TRANSPORT=y
379CONFIG_INET_XFRM_MODE_TUNNEL=y 384CONFIG_INET_XFRM_MODE_TUNNEL=y
380# CONFIG_INET_XFRM_MODE_BEET is not set 385CONFIG_INET_XFRM_MODE_BEET=y
381CONFIG_INET_DIAG=y 386CONFIG_INET_DIAG=y
382CONFIG_INET_TCP_DIAG=y 387CONFIG_INET_TCP_DIAG=y
383# CONFIG_TCP_CONG_ADVANCED is not set 388# CONFIG_TCP_CONG_ADVANCED is not set
@@ -396,7 +401,7 @@ CONFIG_IPV6=y
396# CONFIG_INET6_TUNNEL is not set 401# CONFIG_INET6_TUNNEL is not set
397CONFIG_INET6_XFRM_MODE_TRANSPORT=y 402CONFIG_INET6_XFRM_MODE_TRANSPORT=y
398CONFIG_INET6_XFRM_MODE_TUNNEL=y 403CONFIG_INET6_XFRM_MODE_TUNNEL=y
399# CONFIG_INET6_XFRM_MODE_BEET is not set 404CONFIG_INET6_XFRM_MODE_BEET=y
400# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set 405# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
401CONFIG_IPV6_SIT=y 406CONFIG_IPV6_SIT=y
402# CONFIG_IPV6_TUNNEL is not set 407# CONFIG_IPV6_TUNNEL is not set
@@ -450,7 +455,9 @@ CONFIG_IPV6_SIT=y
450# 455#
451# CONFIG_CFG80211 is not set 456# CONFIG_CFG80211 is not set
452# CONFIG_WIRELESS_EXT is not set 457# CONFIG_WIRELESS_EXT is not set
458# CONFIG_MAC80211 is not set
453# CONFIG_IEEE80211 is not set 459# CONFIG_IEEE80211 is not set
460# CONFIG_RFKILL is not set
454 461
455# 462#
456# Device Drivers 463# Device Drivers
@@ -513,14 +520,12 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
513# Misc devices 520# Misc devices
514# 521#
515# CONFIG_IBM_ASM is not set 522# CONFIG_IBM_ASM is not set
523# CONFIG_PHANTOM is not set
516# CONFIG_SGI_IOC4 is not set 524# CONFIG_SGI_IOC4 is not set
517# CONFIG_TIFM_CORE is not set 525# CONFIG_TIFM_CORE is not set
518# CONFIG_SONY_LAPTOP is not set 526# CONFIG_SONY_LAPTOP is not set
519# CONFIG_THINKPAD_ACPI is not set 527# CONFIG_THINKPAD_ACPI is not set
520 528# CONFIG_BLINK is not set
521#
522# ATA/ATAPI/MFM/RLL support
523#
524CONFIG_IDE=y 529CONFIG_IDE=y
525CONFIG_BLK_DEV_IDE=y 530CONFIG_BLK_DEV_IDE=y
526 531
@@ -537,6 +542,7 @@ CONFIG_BLK_DEV_IDECD=y
537# CONFIG_BLK_DEV_IDESCSI is not set 542# CONFIG_BLK_DEV_IDESCSI is not set
538CONFIG_BLK_DEV_IDEACPI=y 543CONFIG_BLK_DEV_IDEACPI=y
539# CONFIG_IDE_TASK_IOCTL is not set 544# CONFIG_IDE_TASK_IOCTL is not set
545CONFIG_IDE_PROC_FS=y
540 546
541# 547#
542# IDE chipset support/bugfixes 548# IDE chipset support/bugfixes
@@ -546,6 +552,7 @@ CONFIG_IDE_GENERIC=y
546# CONFIG_BLK_DEV_IDEPNP is not set 552# CONFIG_BLK_DEV_IDEPNP is not set
547CONFIG_BLK_DEV_IDEPCI=y 553CONFIG_BLK_DEV_IDEPCI=y
548# CONFIG_IDEPCI_SHARE_IRQ is not set 554# CONFIG_IDEPCI_SHARE_IRQ is not set
555CONFIG_IDEPCI_PCIBUS_ORDER=y
549# CONFIG_BLK_DEV_OFFBOARD is not set 556# CONFIG_BLK_DEV_OFFBOARD is not set
550# CONFIG_BLK_DEV_GENERIC is not set 557# CONFIG_BLK_DEV_GENERIC is not set
551# CONFIG_BLK_DEV_OPTI621 is not set 558# CONFIG_BLK_DEV_OPTI621 is not set
@@ -600,9 +607,8 @@ CONFIG_SCSI_NETLINK=y
600CONFIG_BLK_DEV_SD=y 607CONFIG_BLK_DEV_SD=y
601# CONFIG_CHR_DEV_ST is not set 608# CONFIG_CHR_DEV_ST is not set
602# CONFIG_CHR_DEV_OSST is not set 609# CONFIG_CHR_DEV_OSST is not set
603CONFIG_BLK_DEV_SR=y 610# CONFIG_BLK_DEV_SR is not set
604# CONFIG_BLK_DEV_SR_VENDOR is not set 611# CONFIG_CHR_DEV_SG is not set
605CONFIG_CHR_DEV_SG=y
606# CONFIG_CHR_DEV_SCH is not set 612# CONFIG_CHR_DEV_SCH is not set
607 613
608# 614#
@@ -612,6 +618,7 @@ CONFIG_CHR_DEV_SG=y
612# CONFIG_SCSI_CONSTANTS is not set 618# CONFIG_SCSI_CONSTANTS is not set
613# CONFIG_SCSI_LOGGING is not set 619# CONFIG_SCSI_LOGGING is not set
614# CONFIG_SCSI_SCAN_ASYNC is not set 620# CONFIG_SCSI_SCAN_ASYNC is not set
621CONFIG_SCSI_WAIT_SCAN=m
615 622
616# 623#
617# SCSI Transports 624# SCSI Transports
@@ -640,7 +647,6 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
640CONFIG_SCSI_AIC79XX=y 647CONFIG_SCSI_AIC79XX=y
641CONFIG_AIC79XX_CMDS_PER_DEVICE=32 648CONFIG_AIC79XX_CMDS_PER_DEVICE=32
642CONFIG_AIC79XX_RESET_DELAY_MS=4000 649CONFIG_AIC79XX_RESET_DELAY_MS=4000
643# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
644# CONFIG_AIC79XX_DEBUG_ENABLE is not set 650# CONFIG_AIC79XX_DEBUG_ENABLE is not set
645CONFIG_AIC79XX_DEBUG_MASK=0 651CONFIG_AIC79XX_DEBUG_MASK=0
646# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set 652# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
@@ -662,7 +668,6 @@ CONFIG_AIC79XX_DEBUG_MASK=0
662# CONFIG_SCSI_INIA100 is not set 668# CONFIG_SCSI_INIA100 is not set
663# CONFIG_SCSI_STEX is not set 669# CONFIG_SCSI_STEX is not set
664# CONFIG_SCSI_SYM53C8XX_2 is not set 670# CONFIG_SCSI_SYM53C8XX_2 is not set
665# CONFIG_SCSI_IPR is not set
666# CONFIG_SCSI_QLOGIC_1280 is not set 671# CONFIG_SCSI_QLOGIC_1280 is not set
667# CONFIG_SCSI_QLA_FC is not set 672# CONFIG_SCSI_QLA_FC is not set
668# CONFIG_SCSI_QLA_ISCSI is not set 673# CONFIG_SCSI_QLA_ISCSI is not set
@@ -673,79 +678,12 @@ CONFIG_AIC79XX_DEBUG_MASK=0
673# CONFIG_SCSI_DEBUG is not set 678# CONFIG_SCSI_DEBUG is not set
674# CONFIG_SCSI_ESP_CORE is not set 679# CONFIG_SCSI_ESP_CORE is not set
675# CONFIG_SCSI_SRP is not set 680# CONFIG_SCSI_SRP is not set
676 681# CONFIG_ATA is not set
677#
678# Serial ATA (prod) and Parallel ATA (experimental) drivers
679#
680CONFIG_ATA=y
681# CONFIG_ATA_NONSTANDARD is not set
682CONFIG_SATA_AHCI=y
683CONFIG_SATA_SVW=y
684CONFIG_ATA_PIIX=y
685# CONFIG_SATA_MV is not set
686CONFIG_SATA_NV=y
687# CONFIG_PDC_ADMA is not set
688# CONFIG_SATA_QSTOR is not set
689# CONFIG_SATA_PROMISE is not set
690# CONFIG_SATA_SX4 is not set
691CONFIG_SATA_SIL=y
692# CONFIG_SATA_SIL24 is not set
693# CONFIG_SATA_SIS is not set
694# CONFIG_SATA_ULI is not set
695CONFIG_SATA_VIA=y
696# CONFIG_SATA_VITESSE is not set
697# CONFIG_SATA_INIC162X is not set
698CONFIG_SATA_ACPI=y
699# CONFIG_PATA_ALI is not set
700# CONFIG_PATA_AMD is not set
701# CONFIG_PATA_ARTOP is not set
702# CONFIG_PATA_ATIIXP is not set
703# CONFIG_PATA_CMD640_PCI is not set
704# CONFIG_PATA_CMD64X is not set
705# CONFIG_PATA_CS5520 is not set
706# CONFIG_PATA_CS5530 is not set
707# CONFIG_PATA_CS5535 is not set
708# CONFIG_PATA_CYPRESS is not set
709# CONFIG_PATA_EFAR is not set
710# CONFIG_ATA_GENERIC is not set
711# CONFIG_PATA_HPT366 is not set
712# CONFIG_PATA_HPT37X is not set
713# CONFIG_PATA_HPT3X2N is not set
714# CONFIG_PATA_HPT3X3 is not set
715# CONFIG_PATA_IT821X is not set
716# CONFIG_PATA_IT8213 is not set
717# CONFIG_PATA_JMICRON is not set
718# CONFIG_PATA_TRIFLEX is not set
719# CONFIG_PATA_MARVELL is not set
720# CONFIG_PATA_MPIIX is not set
721# CONFIG_PATA_OLDPIIX is not set
722# CONFIG_PATA_NETCELL is not set
723# CONFIG_PATA_NS87410 is not set
724# CONFIG_PATA_OPTI is not set
725# CONFIG_PATA_OPTIDMA is not set
726# CONFIG_PATA_PDC_OLD is not set
727# CONFIG_PATA_RADISYS is not set
728# CONFIG_PATA_RZ1000 is not set
729# CONFIG_PATA_SC1200 is not set
730# CONFIG_PATA_SERVERWORKS is not set
731# CONFIG_PATA_PDC2027X is not set
732# CONFIG_PATA_SIL680 is not set
733# CONFIG_PATA_SIS is not set
734# CONFIG_PATA_VIA is not set
735# CONFIG_PATA_WINBOND is not set
736 682
737# 683#
738# Multi-device support (RAID and LVM) 684# Multi-device support (RAID and LVM)
739# 685#
740CONFIG_MD=y 686# CONFIG_MD is not set
741# CONFIG_BLK_DEV_MD is not set
742CONFIG_BLK_DEV_DM=y
743# CONFIG_DM_DEBUG is not set
744# CONFIG_DM_CRYPT is not set
745# CONFIG_DM_SNAPSHOT is not set
746# CONFIG_DM_MIRROR is not set
747# CONFIG_DM_ZERO is not set
748# CONFIG_DM_MULTIPATH is not set
749 687
750# 688#
751# Fusion MPT device support 689# Fusion MPT device support
@@ -760,6 +698,7 @@ CONFIG_FUSION_MAX_SGE=128
760# 698#
761# IEEE 1394 (FireWire) support 699# IEEE 1394 (FireWire) support
762# 700#
701# CONFIG_FIREWIRE is not set
763CONFIG_IEEE1394=y 702CONFIG_IEEE1394=y
764 703
765# 704#
@@ -790,11 +729,7 @@ CONFIG_IEEE1394_RAWIO=y
790# I2O device support 729# I2O device support
791# 730#
792# CONFIG_I2O is not set 731# CONFIG_I2O is not set
793 732# CONFIG_MACINTOSH_DRIVERS is not set
794#
795# Macintosh device drivers
796#
797# CONFIG_MAC_EMUMOUSEBTN is not set
798 733
799# 734#
800# Network device support 735# Network device support
@@ -810,10 +745,6 @@ CONFIG_NETDEVICES=y
810# ARCnet devices 745# ARCnet devices
811# 746#
812# CONFIG_ARCNET is not set 747# CONFIG_ARCNET is not set
813
814#
815# PHY device support
816#
817# CONFIG_PHYLIB is not set 748# CONFIG_PHYLIB is not set
818 749
819# 750#
@@ -824,9 +755,7 @@ CONFIG_MII=y
824# CONFIG_HAPPYMEAL is not set 755# CONFIG_HAPPYMEAL is not set
825# CONFIG_SUNGEM is not set 756# CONFIG_SUNGEM is not set
826# CONFIG_CASSINI is not set 757# CONFIG_CASSINI is not set
827CONFIG_NET_VENDOR_3COM=y 758# CONFIG_NET_VENDOR_3COM is not set
828CONFIG_VORTEX=y
829# CONFIG_TYPHOON is not set
830 759
831# 760#
832# Tulip family network device support 761# Tulip family network device support
@@ -867,10 +796,7 @@ CONFIG_8139TOO=y
867# CONFIG_TLAN is not set 796# CONFIG_TLAN is not set
868# CONFIG_VIA_RHINE is not set 797# CONFIG_VIA_RHINE is not set
869# CONFIG_SC92031 is not set 798# CONFIG_SC92031 is not set
870 799CONFIG_NETDEV_1000=y
871#
872# Ethernet (1000 Mbit)
873#
874# CONFIG_ACENIC is not set 800# CONFIG_ACENIC is not set
875# CONFIG_DL2K is not set 801# CONFIG_DL2K is not set
876CONFIG_E1000=y 802CONFIG_E1000=y
@@ -890,16 +816,14 @@ CONFIG_TIGON3=y
890CONFIG_BNX2=y 816CONFIG_BNX2=y
891# CONFIG_QLA3XXX is not set 817# CONFIG_QLA3XXX is not set
892# CONFIG_ATL1 is not set 818# CONFIG_ATL1 is not set
893 819CONFIG_NETDEV_10000=y
894#
895# Ethernet (10000 Mbit)
896#
897# CONFIG_CHELSIO_T1 is not set 820# CONFIG_CHELSIO_T1 is not set
898# CONFIG_CHELSIO_T3 is not set 821# CONFIG_CHELSIO_T3 is not set
899# CONFIG_IXGB is not set 822# CONFIG_IXGB is not set
900# CONFIG_S2IO is not set 823# CONFIG_S2IO is not set
901# CONFIG_MYRI10GE is not set 824# CONFIG_MYRI10GE is not set
902# CONFIG_NETXEN_NIC is not set 825# CONFIG_NETXEN_NIC is not set
826# CONFIG_MLX4_CORE is not set
903 827
904# 828#
905# Token Ring devices 829# Token Ring devices
@@ -913,8 +837,14 @@ CONFIG_BNX2=y
913# CONFIG_WLAN_80211 is not set 837# CONFIG_WLAN_80211 is not set
914 838
915# 839#
916# Wan interfaces 840# USB Network Adapters
917# 841#
842# CONFIG_USB_CATC is not set
843# CONFIG_USB_KAWETH is not set
844# CONFIG_USB_PEGASUS is not set
845# CONFIG_USB_RTL8150 is not set
846# CONFIG_USB_USBNET_MII is not set
847# CONFIG_USB_USBNET is not set
918# CONFIG_WAN is not set 848# CONFIG_WAN is not set
919# CONFIG_FDDI is not set 849# CONFIG_FDDI is not set
920# CONFIG_HIPPI is not set 850# CONFIG_HIPPI is not set
@@ -967,9 +897,17 @@ CONFIG_KEYBOARD_ATKBD=y
967# CONFIG_KEYBOARD_STOWAWAY is not set 897# CONFIG_KEYBOARD_STOWAWAY is not set
968CONFIG_INPUT_MOUSE=y 898CONFIG_INPUT_MOUSE=y
969CONFIG_MOUSE_PS2=y 899CONFIG_MOUSE_PS2=y
900CONFIG_MOUSE_PS2_ALPS=y
901CONFIG_MOUSE_PS2_LOGIPS2PP=y
902CONFIG_MOUSE_PS2_SYNAPTICS=y
903CONFIG_MOUSE_PS2_LIFEBOOK=y
904CONFIG_MOUSE_PS2_TRACKPOINT=y
905# CONFIG_MOUSE_PS2_TOUCHKIT is not set
970# CONFIG_MOUSE_SERIAL is not set 906# CONFIG_MOUSE_SERIAL is not set
907# CONFIG_MOUSE_APPLETOUCH is not set
971# CONFIG_MOUSE_VSXXXAA is not set 908# CONFIG_MOUSE_VSXXXAA is not set
972# CONFIG_INPUT_JOYSTICK is not set 909# CONFIG_INPUT_JOYSTICK is not set
910# CONFIG_INPUT_TABLET is not set
973# CONFIG_INPUT_TOUCHSCREEN is not set 911# CONFIG_INPUT_TOUCHSCREEN is not set
974# CONFIG_INPUT_MISC is not set 912# CONFIG_INPUT_MISC is not set
975 913
@@ -1019,10 +957,6 @@ CONFIG_LEGACY_PTY_COUNT=256
1019# IPMI 957# IPMI
1020# 958#
1021# CONFIG_IPMI_HANDLER is not set 959# CONFIG_IPMI_HANDLER is not set
1022
1023#
1024# Watchdog Cards
1025#
1026# CONFIG_WATCHDOG is not set 960# CONFIG_WATCHDOG is not set
1027CONFIG_HW_RANDOM=y 961CONFIG_HW_RANDOM=y
1028CONFIG_HW_RANDOM_INTEL=y 962CONFIG_HW_RANDOM_INTEL=y
@@ -1031,7 +965,6 @@ CONFIG_HW_RANDOM_GEODE=y
1031CONFIG_HW_RANDOM_VIA=y 965CONFIG_HW_RANDOM_VIA=y
1032# CONFIG_NVRAM is not set 966# CONFIG_NVRAM is not set
1033CONFIG_RTC=y 967CONFIG_RTC=y
1034# CONFIG_DTLK is not set
1035# CONFIG_R3964 is not set 968# CONFIG_R3964 is not set
1036# CONFIG_APPLICOM is not set 969# CONFIG_APPLICOM is not set
1037# CONFIG_SONYPI is not set 970# CONFIG_SONYPI is not set
@@ -1056,17 +989,14 @@ CONFIG_MAX_RAW_DEVS=256
1056CONFIG_HPET=y 989CONFIG_HPET=y
1057# CONFIG_HPET_RTC_IRQ is not set 990# CONFIG_HPET_RTC_IRQ is not set
1058CONFIG_HPET_MMAP=y 991CONFIG_HPET_MMAP=y
1059# CONFIG_HANGCHECK_TIMER is not set 992CONFIG_HANGCHECK_TIMER=y
1060 993
1061# 994#
1062# TPM devices 995# TPM devices
1063# 996#
1064# CONFIG_TCG_TPM is not set 997# CONFIG_TCG_TPM is not set
1065# CONFIG_TELCLOCK is not set 998# CONFIG_TELCLOCK is not set
1066 999CONFIG_DEVPORT=y
1067#
1068# I2C support
1069#
1070# CONFIG_I2C is not set 1000# CONFIG_I2C is not set
1071 1001
1072# 1002#
@@ -1079,12 +1009,7 @@ CONFIG_HPET_MMAP=y
1079# Dallas's 1-wire bus 1009# Dallas's 1-wire bus
1080# 1010#
1081# CONFIG_W1 is not set 1011# CONFIG_W1 is not set
1082
1083#
1084# Hardware Monitoring support
1085#
1086# CONFIG_HWMON is not set 1012# CONFIG_HWMON is not set
1087# CONFIG_HWMON_VID is not set
1088 1013
1089# 1014#
1090# Multifunction device drivers 1015# Multifunction device drivers
@@ -1095,17 +1020,20 @@ CONFIG_HPET_MMAP=y
1095# Multimedia devices 1020# Multimedia devices
1096# 1021#
1097# CONFIG_VIDEO_DEV is not set 1022# CONFIG_VIDEO_DEV is not set
1098 1023# CONFIG_DVB_CORE is not set
1099# 1024CONFIG_DAB=y
1100# Digital Video Broadcasting Devices
1101#
1102# CONFIG_DVB is not set
1103# CONFIG_USB_DABUSB is not set 1025# CONFIG_USB_DABUSB is not set
1104 1026
1105# 1027#
1106# Graphics support 1028# Graphics support
1107# 1029#
1108# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 1030# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1031
1032#
1033# Display device support
1034#
1035# CONFIG_DISPLAY_SUPPORT is not set
1036# CONFIG_VGASTATE is not set
1109# CONFIG_FB is not set 1037# CONFIG_FB is not set
1110 1038
1111# 1039#
@@ -1114,7 +1042,7 @@ CONFIG_HPET_MMAP=y
1114CONFIG_VGA_CONSOLE=y 1042CONFIG_VGA_CONSOLE=y
1115CONFIG_VGACON_SOFT_SCROLLBACK=y 1043CONFIG_VGACON_SOFT_SCROLLBACK=y
1116CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=128 1044CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=128
1117CONFIG_VIDEO_SELECT=y 1045# CONFIG_VIDEO_SELECT is not set
1118CONFIG_DUMMY_CONSOLE=y 1046CONFIG_DUMMY_CONSOLE=y
1119 1047
1120# 1048#
@@ -1131,14 +1059,10 @@ CONFIG_SOUND=y
1131# Open Sound System 1059# Open Sound System
1132# 1060#
1133CONFIG_SOUND_PRIME=y 1061CONFIG_SOUND_PRIME=y
1134CONFIG_OBSOLETE_OSS=y 1062# CONFIG_OSS_OBSOLETE is not set
1135# CONFIG_SOUND_BT878 is not set
1136# CONFIG_SOUND_ES1371 is not set
1137CONFIG_SOUND_ICH=y
1138# CONFIG_SOUND_TRIDENT is not set 1063# CONFIG_SOUND_TRIDENT is not set
1139# CONFIG_SOUND_MSNDCLAS is not set 1064# CONFIG_SOUND_MSNDCLAS is not set
1140# CONFIG_SOUND_MSNDPIN is not set 1065# CONFIG_SOUND_MSNDPIN is not set
1141# CONFIG_SOUND_VIA82CXXX is not set
1142# CONFIG_SOUND_OSS is not set 1066# CONFIG_SOUND_OSS is not set
1143 1067
1144# 1068#
@@ -1217,37 +1141,10 @@ CONFIG_USB_STORAGE=y
1217# CONFIG_USB_LIBUSUAL is not set 1141# CONFIG_USB_LIBUSUAL is not set
1218 1142
1219# 1143#
1220# USB Input Devices
1221#
1222# CONFIG_USB_AIPTEK is not set
1223# CONFIG_USB_WACOM is not set
1224# CONFIG_USB_ACECAD is not set
1225# CONFIG_USB_KBTAB is not set
1226# CONFIG_USB_POWERMATE is not set
1227# CONFIG_USB_TOUCHSCREEN is not set
1228# CONFIG_USB_YEALINK is not set
1229# CONFIG_USB_XPAD is not set
1230# CONFIG_USB_ATI_REMOTE is not set
1231# CONFIG_USB_ATI_REMOTE2 is not set
1232# CONFIG_USB_KEYSPAN_REMOTE is not set
1233# CONFIG_USB_APPLETOUCH is not set
1234# CONFIG_USB_GTCO is not set
1235
1236#
1237# USB Imaging devices 1144# USB Imaging devices
1238# 1145#
1239# CONFIG_USB_MDC800 is not set 1146# CONFIG_USB_MDC800 is not set
1240# CONFIG_USB_MICROTEK is not set 1147# CONFIG_USB_MICROTEK is not set
1241
1242#
1243# USB Network Adapters
1244#
1245# CONFIG_USB_CATC is not set
1246# CONFIG_USB_KAWETH is not set
1247# CONFIG_USB_PEGASUS is not set
1248# CONFIG_USB_RTL8150 is not set
1249# CONFIG_USB_USBNET_MII is not set
1250# CONFIG_USB_USBNET is not set
1251CONFIG_USB_MON=y 1148CONFIG_USB_MON=y
1252 1149
1253# 1150#
@@ -1291,10 +1188,6 @@ CONFIG_USB_MON=y
1291# USB Gadget Support 1188# USB Gadget Support
1292# 1189#
1293# CONFIG_USB_GADGET is not set 1190# CONFIG_USB_GADGET is not set
1294
1295#
1296# MMC/SD Card support
1297#
1298# CONFIG_MMC is not set 1191# CONFIG_MMC is not set
1299 1192
1300# 1193#
@@ -1339,10 +1232,6 @@ CONFIG_USB_MON=y
1339# 1232#
1340 1233
1341# 1234#
1342# Auxiliary Display support
1343#
1344
1345#
1346# Virtualization 1235# Virtualization
1347# 1236#
1348# CONFIG_KVM is not set 1237# CONFIG_KVM is not set
@@ -1383,7 +1272,6 @@ CONFIG_DNOTIFY=y
1383# CONFIG_AUTOFS_FS is not set 1272# CONFIG_AUTOFS_FS is not set
1384CONFIG_AUTOFS4_FS=y 1273CONFIG_AUTOFS4_FS=y
1385# CONFIG_FUSE_FS is not set 1274# CONFIG_FUSE_FS is not set
1386CONFIG_GENERIC_ACL=y
1387 1275
1388# 1276#
1389# CD-ROM/DVD Filesystems 1277# CD-ROM/DVD Filesystems
@@ -1411,7 +1299,7 @@ CONFIG_PROC_KCORE=y
1411CONFIG_PROC_SYSCTL=y 1299CONFIG_PROC_SYSCTL=y
1412CONFIG_SYSFS=y 1300CONFIG_SYSFS=y
1413CONFIG_TMPFS=y 1301CONFIG_TMPFS=y
1414CONFIG_TMPFS_POSIX_ACL=y 1302# CONFIG_TMPFS_POSIX_ACL is not set
1415CONFIG_HUGETLBFS=y 1303CONFIG_HUGETLBFS=y
1416CONFIG_HUGETLB_PAGE=y 1304CONFIG_HUGETLB_PAGE=y
1417CONFIG_RAMFS=y 1305CONFIG_RAMFS=y
@@ -1453,6 +1341,7 @@ CONFIG_LOCKD_V4=y
1453CONFIG_EXPORTFS=y 1341CONFIG_EXPORTFS=y
1454CONFIG_NFS_COMMON=y 1342CONFIG_NFS_COMMON=y
1455CONFIG_SUNRPC=y 1343CONFIG_SUNRPC=y
1344# CONFIG_SUNRPC_BIND34 is not set
1456# CONFIG_RPCSEC_GSS_KRB5 is not set 1345# CONFIG_RPCSEC_GSS_KRB5 is not set
1457# CONFIG_RPCSEC_GSS_SPKM3 is not set 1346# CONFIG_RPCSEC_GSS_SPKM3 is not set
1458# CONFIG_SMB_FS is not set 1347# CONFIG_SMB_FS is not set
@@ -1529,17 +1418,16 @@ CONFIG_KPROBES=y
1529# 1418#
1530CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1419CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1531# CONFIG_PRINTK_TIME is not set 1420# CONFIG_PRINTK_TIME is not set
1532# CONFIG_ENABLE_MUST_CHECK is not set 1421CONFIG_ENABLE_MUST_CHECK=y
1533CONFIG_MAGIC_SYSRQ=y 1422CONFIG_MAGIC_SYSRQ=y
1534CONFIG_UNUSED_SYMBOLS=y 1423CONFIG_UNUSED_SYMBOLS=y
1535# CONFIG_DEBUG_FS is not set 1424# CONFIG_DEBUG_FS is not set
1536# CONFIG_HEADERS_CHECK is not set 1425# CONFIG_HEADERS_CHECK is not set
1537CONFIG_DEBUG_KERNEL=y 1426CONFIG_DEBUG_KERNEL=y
1538# CONFIG_DEBUG_SHIRQ is not set 1427# CONFIG_DEBUG_SHIRQ is not set
1539CONFIG_LOG_BUF_SHIFT=18
1540CONFIG_DETECT_SOFTLOCKUP=y 1428CONFIG_DETECT_SOFTLOCKUP=y
1541# CONFIG_SCHEDSTATS is not set 1429# CONFIG_SCHEDSTATS is not set
1542CONFIG_TIMER_STATS=y 1430# CONFIG_TIMER_STATS is not set
1543# CONFIG_DEBUG_SLAB is not set 1431# CONFIG_DEBUG_SLAB is not set
1544# CONFIG_DEBUG_RT_MUTEXES is not set 1432# CONFIG_DEBUG_RT_MUTEXES is not set
1545# CONFIG_RT_MUTEX_TESTER is not set 1433# CONFIG_RT_MUTEX_TESTER is not set
@@ -1556,6 +1444,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1556# CONFIG_DEBUG_VM is not set 1444# CONFIG_DEBUG_VM is not set
1557# CONFIG_DEBUG_LIST is not set 1445# CONFIG_DEBUG_LIST is not set
1558# CONFIG_FRAME_POINTER is not set 1446# CONFIG_FRAME_POINTER is not set
1447# CONFIG_UNWIND_INFO is not set
1559# CONFIG_FORCED_INLINING is not set 1448# CONFIG_FORCED_INLINING is not set
1560# CONFIG_RCU_TORTURE_TEST is not set 1449# CONFIG_RCU_TORTURE_TEST is not set
1561# CONFIG_LKDTM is not set 1450# CONFIG_LKDTM is not set
@@ -1586,12 +1475,14 @@ CONFIG_DOUBLEFAULT=y
1586CONFIG_BITREVERSE=y 1475CONFIG_BITREVERSE=y
1587# CONFIG_CRC_CCITT is not set 1476# CONFIG_CRC_CCITT is not set
1588# CONFIG_CRC16 is not set 1477# CONFIG_CRC16 is not set
1478# CONFIG_CRC_ITU_T is not set
1589CONFIG_CRC32=y 1479CONFIG_CRC32=y
1590# CONFIG_LIBCRC32C is not set 1480# CONFIG_LIBCRC32C is not set
1591CONFIG_ZLIB_INFLATE=y 1481CONFIG_ZLIB_INFLATE=y
1592CONFIG_PLIST=y 1482CONFIG_PLIST=y
1593CONFIG_HAS_IOMEM=y 1483CONFIG_HAS_IOMEM=y
1594CONFIG_HAS_IOPORT=y 1484CONFIG_HAS_IOPORT=y
1485CONFIG_HAS_DMA=y
1595CONFIG_GENERIC_HARDIRQS=y 1486CONFIG_GENERIC_HARDIRQS=y
1596CONFIG_GENERIC_IRQ_PROBE=y 1487CONFIG_GENERIC_IRQ_PROBE=y
1597CONFIG_GENERIC_PENDING_IRQ=y 1488CONFIG_GENERIC_PENDING_IRQ=y
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index 4fec702afd7e..6f47eeeb93ea 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -280,6 +280,10 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
280 280
281 if (c->x86 == 0x10 && !force_mwait) 281 if (c->x86 == 0x10 && !force_mwait)
282 clear_bit(X86_FEATURE_MWAIT, c->x86_capability); 282 clear_bit(X86_FEATURE_MWAIT, c->x86_capability);
283
284 /* K6s reports MCEs but don't actually have all the MSRs */
285 if (c->x86 < 6)
286 clear_bit(X86_FEATURE_MCE, c->x86_capability);
283} 287}
284 288
285static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 * c, unsigned int size) 289static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 * c, unsigned int size)
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
index b425cd3d1838..698f980eb443 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
@@ -24,6 +24,7 @@
24#include <linux/cpufreq.h> 24#include <linux/cpufreq.h>
25#include <linux/pci.h> 25#include <linux/pci.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/sched.h>
27 28
28#include "speedstep-lib.h" 29#include "speedstep-lib.h"
29 30
diff --git a/arch/i386/kernel/cpu/cyrix.c b/arch/i386/kernel/cpu/cyrix.c
index 0b8411a864fb..e88d2fba156b 100644
--- a/arch/i386/kernel/cpu/cyrix.c
+++ b/arch/i386/kernel/cpu/cyrix.c
@@ -7,6 +7,7 @@
7#include <asm/processor.h> 7#include <asm/processor.h>
8#include <asm/timer.h> 8#include <asm/timer.h>
9#include <asm/pci-direct.h> 9#include <asm/pci-direct.h>
10#include <asm/tsc.h>
10 11
11#include "cpu.h" 12#include "cpu.h"
12 13
diff --git a/arch/i386/kernel/cpu/mcheck/k7.c b/arch/i386/kernel/cpu/mcheck/k7.c
index f9fa4142551e..eef63e3630c2 100644
--- a/arch/i386/kernel/cpu/mcheck/k7.c
+++ b/arch/i386/kernel/cpu/mcheck/k7.c
@@ -72,12 +72,12 @@ void amd_mcheck_init(struct cpuinfo_x86 *c)
72 u32 l, h; 72 u32 l, h;
73 int i; 73 int i;
74 74
75 machine_check_vector = k7_machine_check;
76 wmb();
77
78 if (!cpu_has(c, X86_FEATURE_MCE)) 75 if (!cpu_has(c, X86_FEATURE_MCE))
79 return; 76 return;
80 77
78 machine_check_vector = k7_machine_check;
79 wmb();
80
81 printk (KERN_INFO "Intel machine check architecture supported.\n"); 81 printk (KERN_INFO "Intel machine check architecture supported.\n");
82 rdmsr (MSR_IA32_MCG_CAP, l, h); 82 rdmsr (MSR_IA32_MCG_CAP, l, h);
83 if (l & (1<<8)) /* Control register present ? */ 83 if (l & (1<<8)) /* Control register present ? */
diff --git a/arch/i386/kernel/cpu/mtrr/cyrix.c b/arch/i386/kernel/cpu/mtrr/cyrix.c
index 0737a596db43..9edf5625584f 100644
--- a/arch/i386/kernel/cpu/mtrr/cyrix.c
+++ b/arch/i386/kernel/cpu/mtrr/cyrix.c
@@ -136,7 +136,7 @@ static void prepare_set(void)
136 /* Save value of CR4 and clear Page Global Enable (bit 7) */ 136 /* Save value of CR4 and clear Page Global Enable (bit 7) */
137 if ( cpu_has_pge ) { 137 if ( cpu_has_pge ) {
138 cr4 = read_cr4(); 138 cr4 = read_cr4();
139 write_cr4(cr4 & (unsigned char) ~(1 << 7)); 139 write_cr4(cr4 & ~X86_CR4_PGE);
140 } 140 }
141 141
142 /* Disable and flush caches. Note that wbinvd flushes the TLBs as 142 /* Disable and flush caches. Note that wbinvd flushes the TLBs as
diff --git a/arch/i386/kernel/cpu/mtrr/state.c b/arch/i386/kernel/cpu/mtrr/state.c
index f62ecd15811a..7b39a2f954d9 100644
--- a/arch/i386/kernel/cpu/mtrr/state.c
+++ b/arch/i386/kernel/cpu/mtrr/state.c
@@ -19,7 +19,7 @@ void set_mtrr_prepare_save(struct set_mtrr_context *ctxt)
19 /* Save value of CR4 and clear Page Global Enable (bit 7) */ 19 /* Save value of CR4 and clear Page Global Enable (bit 7) */
20 if ( cpu_has_pge ) { 20 if ( cpu_has_pge ) {
21 ctxt->cr4val = read_cr4(); 21 ctxt->cr4val = read_cr4();
22 write_cr4(ctxt->cr4val & (unsigned char) ~(1 << 7)); 22 write_cr4(ctxt->cr4val & ~X86_CR4_PGE);
23 } 23 }
24 24
25 /* Disable and flush caches. Note that wbinvd flushes the TLBs as 25 /* Disable and flush caches. Note that wbinvd flushes the TLBs as
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c
index 83f825f2e2d7..d865d041bea1 100644
--- a/arch/i386/kernel/microcode.c
+++ b/arch/i386/kernel/microcode.c
@@ -478,7 +478,7 @@ static int __init microcode_dev_init (void)
478 return 0; 478 return 0;
479} 479}
480 480
481static void __exit microcode_dev_exit (void) 481static void microcode_dev_exit (void)
482{ 482{
483 misc_deregister(&microcode_dev); 483 misc_deregister(&microcode_dev);
484} 484}
diff --git a/arch/i386/kernel/reboot.c b/arch/i386/kernel/reboot.c
index 50dfc65319cd..5513f8d5b5be 100644
--- a/arch/i386/kernel/reboot.c
+++ b/arch/i386/kernel/reboot.c
@@ -89,6 +89,14 @@ static int __init set_bios_reboot(struct dmi_system_id *d)
89} 89}
90 90
91static struct dmi_system_id __initdata reboot_dmi_table[] = { 91static struct dmi_system_id __initdata reboot_dmi_table[] = {
92 { /* Handle problems with rebooting on Dell E520's */
93 .callback = set_bios_reboot,
94 .ident = "Dell E520",
95 .matches = {
96 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
97 DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
98 },
99 },
92 { /* Handle problems with rebooting on Dell 1300's */ 100 { /* Handle problems with rebooting on Dell 1300's */
93 .callback = set_bios_reboot, 101 .callback = set_bios_reboot,
94 .ident = "Dell PowerEdge 1300", 102 .ident = "Dell PowerEdge 1300",
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 08f07a74a9d3..88baed1e7e83 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -943,10 +943,9 @@ exit:
943 943
944static void smp_tune_scheduling(void) 944static void smp_tune_scheduling(void)
945{ 945{
946 unsigned long cachesize; /* kB */
947
948 if (cpu_khz) { 946 if (cpu_khz) {
949 cachesize = boot_cpu_data.x86_cache_size; 947 /* cache size in kB */
948 long cachesize = boot_cpu_data.x86_cache_size;
950 949
951 if (cachesize > 0) 950 if (cachesize > 0)
952 max_cache_size = cachesize * 1024; 951 max_cache_size = cachesize * 1024;
diff --git a/arch/i386/kernel/verify_cpu.S b/arch/i386/kernel/verify_cpu.S
index b2a9d80b6421..f1d1eacf4ab0 100644
--- a/arch/i386/kernel/verify_cpu.S
+++ b/arch/i386/kernel/verify_cpu.S
@@ -2,6 +2,7 @@
2 This runs in 16bit mode so that the caller can still use the BIOS 2 This runs in 16bit mode so that the caller can still use the BIOS
3 to output errors on the screen */ 3 to output errors on the screen */
4#include <asm/cpufeature.h> 4#include <asm/cpufeature.h>
5#include <asm/msr.h>
5 6
6verify_cpu: 7verify_cpu:
7 pushfl # Save caller passed flags 8 pushfl # Save caller passed flags
@@ -45,6 +46,32 @@ verify_cpu:
45 cmpl $0x1,%eax 46 cmpl $0x1,%eax
46 jb bad # no cpuid 1 47 jb bad # no cpuid 1
47 48
49#if REQUIRED_MASK1 & NEED_CMPXCHG64
50 /* Some VIA C3s need magic MSRs to enable CX64. Do this here */
51 cmpl $0x746e6543,%ebx # Cent
52 jne 1f
53 cmpl $0x48727561,%edx # aurH
54 jne 1f
55 cmpl $0x736c7561,%ecx # auls
56 jne 1f
57 movl $1,%eax # check model
58 cpuid
59 movl %eax,%ebx
60 shr $8,%ebx
61 andl $0xf,%ebx
62 cmp $6,%ebx # check family == 6
63 jne 1f
64 shr $4,%eax
65 andl $0xf,%eax
66 cmpl $6,%eax # check model >= 6
67 jb 1f
68 # assume models >= 6 all support this MSR
69 movl $MSR_VIA_FCR,%ecx
70 rdmsr
71 orl $((1<<1)|(1<<7)),%eax # enable CMPXCHG64 and PGE
72 wrmsr
731:
74#endif
48 movl $0x1,%eax # Does the cpu have what it takes 75 movl $0x1,%eax # Does the cpu have what it takes
49 cpuid 76 cpuid
50 77
diff --git a/arch/i386/kernel/vmi.c b/arch/i386/kernel/vmi.c
index c8726c424b35..c12720d7cbc5 100644
--- a/arch/i386/kernel/vmi.c
+++ b/arch/i386/kernel/vmi.c
@@ -27,6 +27,7 @@
27#include <linux/bootmem.h> 27#include <linux/bootmem.h>
28#include <linux/mm.h> 28#include <linux/mm.h>
29#include <linux/highmem.h> 29#include <linux/highmem.h>
30#include <linux/sched.h>
30#include <asm/vmi.h> 31#include <asm/vmi.h>
31#include <asm/io.h> 32#include <asm/io.h>
32#include <asm/fixmap.h> 33#include <asm/fixmap.h>
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S
index 80bec6640230..aa87b06c7c82 100644
--- a/arch/i386/kernel/vmlinux.lds.S
+++ b/arch/i386/kernel/vmlinux.lds.S
@@ -44,7 +44,7 @@ SECTIONS
44 44
45 /* read-only */ 45 /* read-only */
46 .text : AT(ADDR(.text) - LOAD_OFFSET) { 46 .text : AT(ADDR(.text) - LOAD_OFFSET) {
47 *(.text) 47 TEXT_TEXT
48 SCHED_TEXT 48 SCHED_TEXT
49 LOCK_TEXT 49 LOCK_TEXT
50 KPROBES_TEXT 50 KPROBES_TEXT
@@ -74,7 +74,7 @@ SECTIONS
74 /* writeable */ 74 /* writeable */
75 . = ALIGN(4096); 75 . = ALIGN(4096);
76 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ 76 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
77 *(.data) 77 DATA_DATA
78 CONSTRUCTORS 78 CONSTRUCTORS
79 } :data 79 } :data
80 80
diff --git a/arch/i386/mach-generic/bigsmp.c b/arch/i386/mach-generic/bigsmp.c
index e932d3485ae2..58a477baec30 100644
--- a/arch/i386/mach-generic/bigsmp.c
+++ b/arch/i386/mach-generic/bigsmp.c
@@ -21,7 +21,7 @@
21 21
22static int dmi_bigsmp; /* can be set by dmi scanners */ 22static int dmi_bigsmp; /* can be set by dmi scanners */
23 23
24static __init int hp_ht_bigsmp(struct dmi_system_id *d) 24static int hp_ht_bigsmp(struct dmi_system_id *d)
25{ 25{
26#ifdef CONFIG_X86_GENERICARCH 26#ifdef CONFIG_X86_GENERICARCH
27 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident); 27 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
@@ -31,7 +31,7 @@ static __init int hp_ht_bigsmp(struct dmi_system_id *d)
31} 31}
32 32
33 33
34static struct dmi_system_id __initdata bigsmp_dmi_table[] = { 34static struct dmi_system_id bigsmp_dmi_table[] = {
35 { hp_ht_bigsmp, "HP ProLiant DL760 G2", { 35 { hp_ht_bigsmp, "HP ProLiant DL760 G2", {
36 DMI_MATCH(DMI_BIOS_VENDOR, "HP"), 36 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
37 DMI_MATCH(DMI_BIOS_VERSION, "P44-"), 37 DMI_MATCH(DMI_BIOS_VERSION, "P44-"),
@@ -45,7 +45,7 @@ static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
45}; 45};
46 46
47 47
48static int __init probe_bigsmp(void) 48static int probe_bigsmp(void)
49{ 49{
50 if (def_to_bigsmp) 50 if (def_to_bigsmp)
51 dmi_bigsmp = 1; 51 dmi_bigsmp = 1;
diff --git a/arch/i386/mm/mmap.c b/arch/i386/mm/mmap.c
index e4730a1a43dd..552e08473755 100644
--- a/arch/i386/mm/mmap.c
+++ b/arch/i386/mm/mmap.c
@@ -27,6 +27,7 @@
27#include <linux/personality.h> 27#include <linux/personality.h>
28#include <linux/mm.h> 28#include <linux/mm.h>
29#include <linux/random.h> 29#include <linux/random.h>
30#include <linux/sched.h>
30 31
31/* 32/*
32 * Top of mmap area (just below the process stack). 33 * Top of mmap area (just below the process stack).
diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c
index 8e185208dfd4..11b7a51566a8 100644
--- a/arch/i386/oprofile/nmi_int.c
+++ b/arch/i386/oprofile/nmi_int.c
@@ -131,7 +131,6 @@ static void nmi_save_registers(void * dummy)
131{ 131{
132 int cpu = smp_processor_id(); 132 int cpu = smp_processor_id();
133 struct op_msrs * msrs = &cpu_msrs[cpu]; 133 struct op_msrs * msrs = &cpu_msrs[cpu];
134 model->fill_in_addresses(msrs);
135 nmi_cpu_save_registers(msrs); 134 nmi_cpu_save_registers(msrs);
136} 135}
137 136
@@ -155,7 +154,7 @@ static int allocate_msrs(void)
155 size_t counters_size = sizeof(struct op_msr) * model->num_counters; 154 size_t counters_size = sizeof(struct op_msr) * model->num_counters;
156 155
157 int i; 156 int i;
158 for_each_online_cpu(i) { 157 for_each_possible_cpu(i) {
159 cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL); 158 cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL);
160 if (!cpu_msrs[i].counters) { 159 if (!cpu_msrs[i].counters) {
161 success = 0; 160 success = 0;
@@ -195,6 +194,7 @@ static struct notifier_block profile_exceptions_nb = {
195static int nmi_setup(void) 194static int nmi_setup(void)
196{ 195{
197 int err=0; 196 int err=0;
197 int cpu;
198 198
199 if (!allocate_msrs()) 199 if (!allocate_msrs())
200 return -ENOMEM; 200 return -ENOMEM;
@@ -207,6 +207,19 @@ static int nmi_setup(void)
207 /* We need to serialize save and setup for HT because the subset 207 /* We need to serialize save and setup for HT because the subset
208 * of msrs are distinct for save and setup operations 208 * of msrs are distinct for save and setup operations
209 */ 209 */
210
211 /* Assume saved/restored counters are the same on all CPUs */
212 model->fill_in_addresses(&cpu_msrs[0]);
213 for_each_possible_cpu (cpu) {
214 if (cpu != 0) {
215 memcpy(cpu_msrs[cpu].counters, cpu_msrs[0].counters,
216 sizeof(struct op_msr) * model->num_counters);
217
218 memcpy(cpu_msrs[cpu].controls, cpu_msrs[0].controls,
219 sizeof(struct op_msr) * model->num_controls);
220 }
221
222 }
210 on_each_cpu(nmi_save_registers, NULL, 0, 1); 223 on_each_cpu(nmi_save_registers, NULL, 0, 1);
211 on_each_cpu(nmi_cpu_setup, NULL, 0, 1); 224 on_each_cpu(nmi_cpu_setup, NULL, 0, 1);
212 nmi_enabled = 1; 225 nmi_enabled = 1;
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c
index b62eafb997bc..b95b42950ed4 100644
--- a/arch/i386/pci/fixup.c
+++ b/arch/i386/pci/fixup.c
@@ -436,3 +436,14 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY,
436 pci_early_fixup_cyrix_5530); 436 pci_early_fixup_cyrix_5530);
437DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, 437DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY,
438 pci_early_fixup_cyrix_5530); 438 pci_early_fixup_cyrix_5530);
439
440/*
441 * Siemens Nixdorf AG FSC Multiprocessor Interrupt Controller:
442 * prevent update of the BAR0, which doesn't look like a normal BAR.
443 */
444static void __devinit pci_siemens_interrupt_controller(struct pci_dev *dev)
445{
446 dev->resource[0].flags |= IORESOURCE_PCI_FIXED;
447}
448DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SIEMENS, 0x0015,
449 pci_siemens_interrupt_controller);
diff --git a/arch/ia64/kernel/acpi-processor.c b/arch/ia64/kernel/acpi-processor.c
index 4d4993a47e55..5a216c019924 100644
--- a/arch/ia64/kernel/acpi-processor.c
+++ b/arch/ia64/kernel/acpi-processor.c
@@ -44,7 +44,7 @@ static void init_intel_pdc(struct acpi_processor *pr)
44 44
45 buf[0] = ACPI_PDC_REVISION_ID; 45 buf[0] = ACPI_PDC_REVISION_ID;
46 buf[1] = 1; 46 buf[1] = 1;
47 buf[2] |= ACPI_PDC_EST_CAPABILITY_SMP; 47 buf[2] = ACPI_PDC_EST_CAPABILITY_SMP;
48 48
49 obj->type = ACPI_TYPE_BUFFER; 49 obj->type = ACPI_TYPE_BUFFER;
50 obj->buffer.length = 12; 50 obj->buffer.length = 12;
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index c4784494970e..103dd8edda71 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -67,7 +67,8 @@ EXPORT_SYMBOL(pm_power_off);
67unsigned int acpi_cpei_override; 67unsigned int acpi_cpei_override;
68unsigned int acpi_cpei_phys_cpuid; 68unsigned int acpi_cpei_phys_cpuid;
69 69
70const char *acpi_get_sysname(void) 70const char __init *
71acpi_get_sysname(void)
71{ 72{
72#ifdef CONFIG_IA64_GENERIC 73#ifdef CONFIG_IA64_GENERIC
73 unsigned long rsdp_phys; 74 unsigned long rsdp_phys;
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index d1c3ed9943e5..af73b8dfde28 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -763,6 +763,9 @@ get_wchan (struct task_struct *p)
763 unsigned long ip; 763 unsigned long ip;
764 int count = 0; 764 int count = 0;
765 765
766 if (!p || p == current || p->state == TASK_RUNNING)
767 return 0;
768
766 /* 769 /*
767 * Note: p may not be a blocked task (it could be current or 770 * Note: p may not be a blocked task (it could be current or
768 * another process running on some other CPU. Rather than 771 * another process running on some other CPU. Rather than
@@ -773,6 +776,8 @@ get_wchan (struct task_struct *p)
773 */ 776 */
774 unw_init_from_blocked_task(&info, p); 777 unw_init_from_blocked_task(&info, p);
775 do { 778 do {
779 if (p->state == TASK_RUNNING)
780 return 0;
776 if (unw_unwind(&info) < 0) 781 if (unw_unwind(&info) < 0)
777 return 0; 782 return 0;
778 unw_get_ip(&info, &ip); 783 unw_get_ip(&info, &ip);
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 542958079f1b..3c9d8e6089cf 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -370,7 +370,7 @@ smp_setup_percpu_timer (void)
370{ 370{
371} 371}
372 372
373static void __devinit 373static void __cpuinit
374smp_callin (void) 374smp_callin (void)
375{ 375{
376 int cpuid, phys_id, itc_master; 376 int cpuid, phys_id, itc_master;
@@ -456,7 +456,7 @@ smp_callin (void)
456/* 456/*
457 * Activate a secondary processor. head.S calls this. 457 * Activate a secondary processor. head.S calls this.
458 */ 458 */
459int __devinit 459int __cpuinit
460start_secondary (void *unused) 460start_secondary (void *unused)
461{ 461{
462 /* Early console may use I/O ports */ 462 /* Early console may use I/O ports */
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c
index 7d3dd6cdafa4..b0b08b5f3eca 100644
--- a/arch/ia64/kernel/unwind.c
+++ b/arch/ia64/kernel/unwind.c
@@ -1860,7 +1860,7 @@ int
1860unw_unwind (struct unw_frame_info *info) 1860unw_unwind (struct unw_frame_info *info)
1861{ 1861{
1862 unsigned long prev_ip, prev_sp, prev_bsp; 1862 unsigned long prev_ip, prev_sp, prev_bsp;
1863 unsigned long ip, pr, num_regs; 1863 unsigned long ip, pr, num_regs, rp_loc, pfs_loc;
1864 STAT(unsigned long start, flags;) 1864 STAT(unsigned long start, flags;)
1865 int retval; 1865 int retval;
1866 1866
@@ -1870,14 +1870,16 @@ unw_unwind (struct unw_frame_info *info)
1870 prev_sp = info->sp; 1870 prev_sp = info->sp;
1871 prev_bsp = info->bsp; 1871 prev_bsp = info->bsp;
1872 1872
1873 /* restore the ip */ 1873 /* validate the return IP pointer */
1874 if (!info->rp_loc) { 1874 rp_loc = (unsigned long) info->rp_loc;
1875 if ((rp_loc < info->regstk.limit) || (rp_loc > info->regstk.top)) {
1875 /* FIXME: should really be level 0 but it occurs too often. KAO */ 1876 /* FIXME: should really be level 0 but it occurs too often. KAO */
1876 UNW_DPRINT(1, "unwind.%s: failed to locate return link (ip=0x%lx)!\n", 1877 UNW_DPRINT(1, "unwind.%s: failed to locate return link (ip=0x%lx)!\n",
1877 __FUNCTION__, info->ip); 1878 __FUNCTION__, info->ip);
1878 STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags)); 1879 STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
1879 return -1; 1880 return -1;
1880 } 1881 }
1882 /* restore the ip */
1881 ip = info->ip = *info->rp_loc; 1883 ip = info->ip = *info->rp_loc;
1882 if (ip < GATE_ADDR) { 1884 if (ip < GATE_ADDR) {
1883 UNW_DPRINT(2, "unwind.%s: reached user-space (ip=0x%lx)\n", __FUNCTION__, ip); 1885 UNW_DPRINT(2, "unwind.%s: reached user-space (ip=0x%lx)\n", __FUNCTION__, ip);
@@ -1885,12 +1887,14 @@ unw_unwind (struct unw_frame_info *info)
1885 return -1; 1887 return -1;
1886 } 1888 }
1887 1889
1888 /* restore the cfm: */ 1890 /* validate the previous stack frame pointer */
1889 if (!info->pfs_loc) { 1891 pfs_loc = (unsigned long) info->pfs_loc;
1892 if ((pfs_loc < info->regstk.limit) || (pfs_loc > info->regstk.top)) {
1890 UNW_DPRINT(0, "unwind.%s: failed to locate ar.pfs!\n", __FUNCTION__); 1893 UNW_DPRINT(0, "unwind.%s: failed to locate ar.pfs!\n", __FUNCTION__);
1891 STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags)); 1894 STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
1892 return -1; 1895 return -1;
1893 } 1896 }
1897 /* restore the cfm: */
1894 info->cfm_loc = info->pfs_loc; 1898 info->cfm_loc = info->pfs_loc;
1895 1899
1896 /* restore the bsp: */ 1900 /* restore the bsp: */
@@ -1992,13 +1996,16 @@ init_frame_info (struct unw_frame_info *info, struct task_struct *t,
1992 memset(info, 0, sizeof(*info)); 1996 memset(info, 0, sizeof(*info));
1993 1997
1994 rbslimit = (unsigned long) t + IA64_RBS_OFFSET; 1998 rbslimit = (unsigned long) t + IA64_RBS_OFFSET;
1999 stklimit = (unsigned long) t + IA64_STK_OFFSET;
2000
1995 rbstop = sw->ar_bspstore; 2001 rbstop = sw->ar_bspstore;
1996 if (rbstop - (unsigned long) t >= IA64_STK_OFFSET) 2002 if (rbstop > stklimit || rbstop < rbslimit)
1997 rbstop = rbslimit; 2003 rbstop = rbslimit;
1998 2004
1999 stklimit = (unsigned long) t + IA64_STK_OFFSET;
2000 if (stktop <= rbstop) 2005 if (stktop <= rbstop)
2001 stktop = rbstop; 2006 stktop = rbstop;
2007 if (stktop > stklimit)
2008 stktop = stklimit;
2002 2009
2003 info->regstk.limit = rbslimit; 2010 info->regstk.limit = rbslimit;
2004 info->regstk.top = rbstop; 2011 info->regstk.top = rbstop;
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 692382642118..5a65965c8b53 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -44,7 +44,7 @@ SECTIONS
44 .text : AT(ADDR(.text) - LOAD_OFFSET) 44 .text : AT(ADDR(.text) - LOAD_OFFSET)
45 { 45 {
46 IVT_TEXT 46 IVT_TEXT
47 *(.text) 47 TEXT_TEXT
48 SCHED_TEXT 48 SCHED_TEXT
49 LOCK_TEXT 49 LOCK_TEXT
50 KPROBES_TEXT 50 KPROBES_TEXT
@@ -214,7 +214,12 @@ SECTIONS
214 214
215 data : { } :data 215 data : { } :data
216 .data : AT(ADDR(.data) - LOAD_OFFSET) 216 .data : AT(ADDR(.data) - LOAD_OFFSET)
217 { *(.data) *(.data1) *(.gnu.linkonce.d*) CONSTRUCTORS } 217 {
218 DATA_DATA
219 *(.data1)
220 *(.gnu.linkonce.d*)
221 CONSTRUCTORS
222 }
218 223
219 . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */ 224 . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
220 .got : AT(ADDR(.got) - LOAD_OFFSET) 225 .got : AT(ADDR(.got) - LOAD_OFFSET)
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 3549f3b42592..73696b4a2eed 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -354,10 +354,13 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus)
354 354
355 acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window, 355 acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window,
356 &windows); 356 &windows);
357 controller->window = kmalloc_node(sizeof(*controller->window) * windows, 357 if (windows) {
358 GFP_KERNEL, controller->node); 358 controller->window =
359 if (!controller->window) 359 kmalloc_node(sizeof(*controller->window) * windows,
360 goto out2; 360 GFP_KERNEL, controller->node);
361 if (!controller->window)
362 goto out2;
363 }
361 364
362 name = kmalloc(16, GFP_KERNEL); 365 name = kmalloc(16, GFP_KERNEL);
363 if (!name) 366 if (!name)
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index a574fcd163dd..684b1c984a44 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -194,7 +194,7 @@ void __init early_sn_setup(void)
194} 194}
195 195
196extern int platform_intr_list[]; 196extern int platform_intr_list[];
197static int __initdata shub_1_1_found; 197static int __cpuinitdata shub_1_1_found;
198 198
199/* 199/*
200 * sn_check_for_wars 200 * sn_check_for_wars
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 6c73bca3f478..4e2d5b9f0a9a 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -27,7 +27,7 @@ SECTIONS
27 _text = .; /* Text and read-only data */ 27 _text = .; /* Text and read-only data */
28 .boot : { *(.boot) } = 0 28 .boot : { *(.boot) } = 0
29 .text : { 29 .text : {
30 *(.text) 30 TEXT_TEXT
31 SCHED_TEXT 31 SCHED_TEXT
32 LOCK_TEXT 32 LOCK_TEXT
33 *(.fixup) 33 *(.fixup)
@@ -50,7 +50,7 @@ SECTIONS
50 .data : { /* Data */ 50 .data : { /* Data */
51 *(.spu) 51 *(.spu)
52 *(.spi) 52 *(.spi)
53 *(.data) 53 DATA_DATA
54 CONSTRUCTORS 54 CONSTRUCTORS
55 } 55 }
56 56
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index b8536c7c0877..85cdd23b0447 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -355,8 +355,9 @@ config RMW_INSNS
355 adventurous. 355 adventurous.
356 356
357config SINGLE_MEMORY_CHUNK 357config SINGLE_MEMORY_CHUNK
358 bool "Use one physical chunk of memory only" 358 bool "Use one physical chunk of memory only" if ADVANCED && !SUN3
359 depends on ADVANCED && !SUN3 359 default y if SUN3
360 select NEED_MULTIPLE_NODES
360 help 361 help
361 Ignore all but the first contiguous chunk of physical memory for VM 362 Ignore all but the first contiguous chunk of physical memory for VM
362 purposes. This will save a few bytes kernel size and may speed up 363 purposes. This will save a few bytes kernel size and may speed up
@@ -377,6 +378,14 @@ config 060_WRITETHROUGH
377 is hardwired on. The 53c710 SCSI driver is known to suffer from 378 is hardwired on. The 53c710 SCSI driver is known to suffer from
378 this problem. 379 this problem.
379 380
381config ARCH_DISCONTIGMEM_ENABLE
382 def_bool !SINGLE_MEMORY_CHUNK
383
384config NODES_SHIFT
385 int
386 default "3"
387 depends on !SINGLE_MEMORY_CHUNK
388
380source "mm/Kconfig" 389source "mm/Kconfig"
381 390
382endmenu 391endmenu
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index c20831a7e1a9..aa383a5ea7ac 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -19,6 +19,7 @@ COMPILE_ARCH = $(shell uname -m)
19# override top level makefile 19# override top level makefile
20AS += -m68020 20AS += -m68020
21LDFLAGS := -m m68kelf 21LDFLAGS := -m m68kelf
22LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
22ifneq ($(COMPILE_ARCH),$(ARCH)) 23ifneq ($(COMPILE_ARCH),$(ARCH))
23 # prefix for cross-compiling binaries 24 # prefix for cross-compiling binaries
24 CROSS_COMPILE = m68k-linux-gnu- 25 CROSS_COMPILE = m68k-linux-gnu-
diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile
index 0b68ab8d63d1..a806208c7fb5 100644
--- a/arch/m68k/kernel/Makefile
+++ b/arch/m68k/kernel/Makefile
@@ -9,13 +9,12 @@ else
9endif 9endif
10extra-y += vmlinux.lds 10extra-y += vmlinux.lds
11 11
12obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ 12obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o module.o \
13 sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o devres.o 13 sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o devres.o
14 14
15devres-y = ../../../kernel/irq/devres.o 15devres-y = ../../../kernel/irq/devres.o
16 16
17obj-$(CONFIG_PCI) += bios32.o 17obj-$(CONFIG_PCI) += bios32.o
18obj-$(CONFIG_MODULES) += module.o
19obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo 18obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo
20 19
21EXTRA_AFLAGS := -traditional 20EXTRA_AFLAGS := -traditional
diff --git a/arch/m68k/kernel/module.c b/arch/m68k/kernel/module.c
index 3b1a2ff61ddc..774862bc6977 100644
--- a/arch/m68k/kernel/module.c
+++ b/arch/m68k/kernel/module.c
@@ -1,3 +1,9 @@
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
1#include <linux/moduleloader.h> 7#include <linux/moduleloader.h>
2#include <linux/elf.h> 8#include <linux/elf.h>
3#include <linux/vmalloc.h> 9#include <linux/vmalloc.h>
@@ -11,6 +17,8 @@
11#define DEBUGP(fmt...) 17#define DEBUGP(fmt...)
12#endif 18#endif
13 19
20#ifdef CONFIG_MODULES
21
14void *module_alloc(unsigned long size) 22void *module_alloc(unsigned long size)
15{ 23{
16 if (size == 0) 24 if (size == 0)
@@ -118,11 +126,32 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
118 126
119int module_finalize(const Elf_Ehdr *hdr, 127int module_finalize(const Elf_Ehdr *hdr,
120 const Elf_Shdr *sechdrs, 128 const Elf_Shdr *sechdrs,
121 struct module *me) 129 struct module *mod)
122{ 130{
131 module_fixup(mod, mod->arch.fixup_start, mod->arch.fixup_end);
132
123 return 0; 133 return 0;
124} 134}
125 135
126void module_arch_cleanup(struct module *mod) 136void module_arch_cleanup(struct module *mod)
127{ 137{
128} 138}
139
140#endif /* CONFIG_MODULES */
141
142void module_fixup(struct module *mod, struct m68k_fixup_info *start,
143 struct m68k_fixup_info *end)
144{
145 struct m68k_fixup_info *fixup;
146
147 for (fixup = start; fixup < end; fixup++) {
148 switch (fixup->type) {
149 case m68k_fixup_memoffset:
150 *(u32 *)fixup->addr = m68k_memoffset;
151 break;
152 case m68k_fixup_vnode_shift:
153 *(u16 *)fixup->addr += m68k_virt_to_node_shift;
154 break;
155 }
156 }
157}
diff --git a/arch/m68k/kernel/module.lds b/arch/m68k/kernel/module.lds
new file mode 100644
index 000000000000..fda94fa38243
--- /dev/null
+++ b/arch/m68k/kernel/module.lds
@@ -0,0 +1,7 @@
1SECTIONS {
2 .m68k_fixup : {
3 __start_fixup = .;
4 *(.m68k_fixup)
5 __stop_fixup = .;
6 }
7}
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c
index 610319356691..215c7bd43924 100644
--- a/arch/m68k/kernel/setup.c
+++ b/arch/m68k/kernel/setup.c
@@ -60,14 +60,12 @@ extern unsigned long availmem;
60int m68k_num_memory; 60int m68k_num_memory;
61int m68k_realnum_memory; 61int m68k_realnum_memory;
62EXPORT_SYMBOL(m68k_realnum_memory); 62EXPORT_SYMBOL(m68k_realnum_memory);
63#ifdef CONFIG_SINGLE_MEMORY_CHUNK
64unsigned long m68k_memoffset; 63unsigned long m68k_memoffset;
65EXPORT_SYMBOL(m68k_memoffset); 64EXPORT_SYMBOL(m68k_memoffset);
66#endif
67struct mem_info m68k_memory[NUM_MEMINFO]; 65struct mem_info m68k_memory[NUM_MEMINFO];
68EXPORT_SYMBOL(m68k_memory); 66EXPORT_SYMBOL(m68k_memory);
69 67
70static struct mem_info m68k_ramdisk; 68struct mem_info m68k_ramdisk;
71 69
72static char m68k_command_line[CL_SIZE]; 70static char m68k_command_line[CL_SIZE];
73 71
@@ -208,9 +206,6 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
208void __init setup_arch(char **cmdline_p) 206void __init setup_arch(char **cmdline_p)
209{ 207{
210 extern int _etext, _edata, _end; 208 extern int _etext, _edata, _end;
211#ifndef CONFIG_SUN3
212 unsigned long endmem, startmem;
213#endif
214 int i; 209 int i;
215 210
216 /* The bootinfo is located right after the kernel bss */ 211 /* The bootinfo is located right after the kernel bss */
@@ -320,30 +315,16 @@ void __init setup_arch(char **cmdline_p)
320 panic("No configuration setup"); 315 panic("No configuration setup");
321 } 316 }
322 317
323#ifndef CONFIG_SUN3 318 paging_init();
324 startmem= m68k_memory[0].addr;
325 endmem = startmem + m68k_memory[0].size;
326 high_memory = (void *)PAGE_OFFSET;
327 for (i = 0; i < m68k_num_memory; i++) {
328 m68k_memory[i].size &= MASK_256K;
329 if (m68k_memory[i].addr < startmem)
330 startmem = m68k_memory[i].addr;
331 if (m68k_memory[i].addr+m68k_memory[i].size > endmem)
332 endmem = m68k_memory[i].addr+m68k_memory[i].size;
333 high_memory += m68k_memory[i].size;
334 }
335
336 availmem += init_bootmem_node(NODE_DATA(0), availmem >> PAGE_SHIFT,
337 startmem >> PAGE_SHIFT, endmem >> PAGE_SHIFT);
338
339 for (i = 0; i < m68k_num_memory; i++)
340 free_bootmem(m68k_memory[i].addr, m68k_memory[i].size);
341
342 reserve_bootmem(m68k_memory[0].addr, availmem - m68k_memory[0].addr);
343 319
320#ifndef CONFIG_SUN3
321 for (i = 1; i < m68k_num_memory; i++)
322 free_bootmem_node(NODE_DATA(i), m68k_memory[i].addr,
323 m68k_memory[i].size);
344#ifdef CONFIG_BLK_DEV_INITRD 324#ifdef CONFIG_BLK_DEV_INITRD
345 if (m68k_ramdisk.size) { 325 if (m68k_ramdisk.size) {
346 reserve_bootmem(m68k_ramdisk.addr, m68k_ramdisk.size); 326 reserve_bootmem_node(__virt_to_node(phys_to_virt(m68k_ramdisk.addr)),
327 m68k_ramdisk.addr, m68k_ramdisk.size);
347 initrd_start = (unsigned long)phys_to_virt(m68k_ramdisk.addr); 328 initrd_start = (unsigned long)phys_to_virt(m68k_ramdisk.addr);
348 initrd_end = initrd_start + m68k_ramdisk.size; 329 initrd_end = initrd_start + m68k_ramdisk.size;
349 printk("initrd: %08lx - %08lx\n", initrd_start, initrd_end); 330 printk("initrd: %08lx - %08lx\n", initrd_start, initrd_end);
@@ -362,8 +343,6 @@ void __init setup_arch(char **cmdline_p)
362 343
363#endif /* !CONFIG_SUN3 */ 344#endif /* !CONFIG_SUN3 */
364 345
365 paging_init();
366
367/* set ISA defs early as possible */ 346/* set ISA defs early as possible */
368#if defined(CONFIG_ISA) && defined(MULTI_ISA) 347#if defined(CONFIG_ISA) && defined(MULTI_ISA)
369#if defined(CONFIG_Q40) 348#if defined(CONFIG_Q40)
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 437b4f8d86c5..40f02b128f22 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -11,7 +11,7 @@ SECTIONS
11 . = 0x1000; 11 . = 0x1000;
12 _text = .; /* Text and read-only data */ 12 _text = .; /* Text and read-only data */
13 .text : { 13 .text : {
14 *(.text) 14 TEXT_TEXT
15 SCHED_TEXT 15 SCHED_TEXT
16 LOCK_TEXT 16 LOCK_TEXT
17 *(.fixup) 17 *(.fixup)
@@ -28,7 +28,7 @@ SECTIONS
28 _etext = .; /* End of text section */ 28 _etext = .; /* End of text section */
29 29
30 .data : { /* Data */ 30 .data : { /* Data */
31 *(.data) 31 DATA_DATA
32 CONSTRUCTORS 32 CONSTRUCTORS
33 } 33 }
34 34
@@ -60,6 +60,11 @@ SECTIONS
60 __con_initcall_start = .; 60 __con_initcall_start = .;
61 .con_initcall.init : { *(.con_initcall.init) } 61 .con_initcall.init : { *(.con_initcall.init) }
62 __con_initcall_end = .; 62 __con_initcall_end = .;
63 .m68k_fixup : {
64 __start_fixup = .;
65 *(.m68k_fixup)
66 __stop_fixup = .;
67 }
63 SECURITY_INIT 68 SECURITY_INIT
64#ifdef CONFIG_BLK_DEV_INITRD 69#ifdef CONFIG_BLK_DEV_INITRD
65 . = ALIGN(8192); 70 . = ALIGN(8192);
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 2868e206fc76..f06425b6d206 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -12,7 +12,7 @@ SECTIONS
12 _text = .; /* Text and read-only data */ 12 _text = .; /* Text and read-only data */
13 .text : { 13 .text : {
14 *(.head) 14 *(.head)
15 *(.text) 15 TEXT_TEXT
16 SCHED_TEXT 16 SCHED_TEXT
17 LOCK_TEXT 17 LOCK_TEXT
18 *(.fixup) 18 *(.fixup)
@@ -23,7 +23,7 @@ SECTIONS
23 _etext = .; /* End of text section */ 23 _etext = .; /* End of text section */
24 24
25 .data : { /* Data */ 25 .data : { /* Data */
26 *(.data) 26 DATA_DATA
27 CONSTRUCTORS 27 CONSTRUCTORS
28 . = ALIGN(16); /* Exception table */ 28 . = ALIGN(16); /* Exception table */
29 __start___ex_table = .; 29 __start___ex_table = .;
@@ -54,6 +54,11 @@ __init_begin = .;
54 __con_initcall_start = .; 54 __con_initcall_start = .;
55 .con_initcall.init : { *(.con_initcall.init) } 55 .con_initcall.init : { *(.con_initcall.init) }
56 __con_initcall_end = .; 56 __con_initcall_end = .;
57 .m68k_fixup : {
58 __start_fixup = .;
59 *(.m68k_fixup)
60 __stop_fixup = .;
61 }
57 SECURITY_INIT 62 SECURITY_INIT
58#ifdef CONFIG_BLK_DEV_INITRD 63#ifdef CONFIG_BLK_DEV_INITRD
59 . = ALIGN(8192); 64 . = ALIGN(8192);
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c
index 7a5bed5bdc57..e8a57138b4a6 100644
--- a/arch/m68k/mac/debug.c
+++ b/arch/m68k/mac/debug.c
@@ -71,7 +71,7 @@ void mac_debugging_short(int pos, short num)
71 71
72 /* calculate current offset */ 72 /* calculate current offset */
73 pengoffset = (unsigned char *)mac_videobase + 73 pengoffset = (unsigned char *)mac_videobase +
74 (150+line*2) * mac_rowbytes) + 80 * peng; 74 (150+line*2) * mac_rowbytes + 80 * peng;
75 75
76 pptr = pengoffset; 76 pptr = pengoffset;
77 77
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index ab90213e5c54..f1de19e1dde6 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -7,6 +7,7 @@
7 * to motorola.c and sun3mmu.c 7 * to motorola.c and sun3mmu.c
8 */ 8 */
9 9
10#include <linux/module.h>
10#include <linux/signal.h> 11#include <linux/signal.h>
11#include <linux/sched.h> 12#include <linux/sched.h>
12#include <linux/mm.h> 13#include <linux/mm.h>
@@ -31,6 +32,37 @@
31 32
32DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 33DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
33 34
35static bootmem_data_t __initdata bootmem_data[MAX_NUMNODES];
36
37pg_data_t pg_data_map[MAX_NUMNODES];
38EXPORT_SYMBOL(pg_data_map);
39
40int m68k_virt_to_node_shift;
41
42#ifndef CONFIG_SINGLE_MEMORY_CHUNK
43pg_data_t *pg_data_table[65];
44EXPORT_SYMBOL(pg_data_table);
45#endif
46
47void m68k_setup_node(int node)
48{
49#ifndef CONFIG_SINGLE_MEMORY_CHUNK
50 struct mem_info *info = m68k_memory + node;
51 int i, end;
52
53 i = (unsigned long)phys_to_virt(info->addr) >> __virt_to_node_shift();
54 end = (unsigned long)phys_to_virt(info->addr + info->size - 1) >> __virt_to_node_shift();
55 for (; i <= end; i++) {
56 if (pg_data_table[i])
57 printk("overlap at %u for chunk %u\n", i, node);
58 pg_data_table[i] = pg_data_map + node;
59 }
60#endif
61 pg_data_map[node].bdata = bootmem_data + node;
62 node_set_online(node);
63}
64
65
34/* 66/*
35 * ZERO_PAGE is a special page that is used for zero-initialized 67 * ZERO_PAGE is a special page that is used for zero-initialized
36 * data and COW. 68 * data and COW.
@@ -40,52 +72,51 @@ void *empty_zero_page;
40 72
41void show_mem(void) 73void show_mem(void)
42{ 74{
43 unsigned long i; 75 pg_data_t *pgdat;
44 int free = 0, total = 0, reserved = 0, shared = 0; 76 int free = 0, total = 0, reserved = 0, shared = 0;
45 int cached = 0; 77 int cached = 0;
46 78 int i;
47 printk("\nMem-info:\n"); 79
48 show_free_areas(); 80 printk("\nMem-info:\n");
49 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 81 show_free_areas();
50 i = max_mapnr; 82 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
51 while (i-- > 0) { 83 for_each_online_pgdat(pgdat) {
52 total++; 84 for (i = 0; i < pgdat->node_spanned_pages; i++) {
53 if (PageReserved(mem_map+i)) 85 struct page *page = pgdat->node_mem_map + i;
54 reserved++; 86 total++;
55 else if (PageSwapCache(mem_map+i)) 87 if (PageReserved(page))
56 cached++; 88 reserved++;
57 else if (!page_count(mem_map+i)) 89 else if (PageSwapCache(page))
58 free++; 90 cached++;
59 else 91 else if (!page_count(page))
60 shared += page_count(mem_map+i) - 1; 92 free++;
61 } 93 else
62 printk("%d pages of RAM\n",total); 94 shared += page_count(page) - 1;
63 printk("%d free pages\n",free); 95 }
64 printk("%d reserved pages\n",reserved); 96 }
65 printk("%d pages shared\n",shared); 97 printk("%d pages of RAM\n",total);
66 printk("%d pages swap cached\n",cached); 98 printk("%d free pages\n",free);
99 printk("%d reserved pages\n",reserved);
100 printk("%d pages shared\n",shared);
101 printk("%d pages swap cached\n",cached);
67} 102}
68 103
69extern void init_pointer_table(unsigned long ptable); 104extern void init_pointer_table(unsigned long ptable);
70 105
71/* References to section boundaries */ 106/* References to section boundaries */
72 107
73extern char _text, _etext, _edata, __bss_start, _end; 108extern char _text[], _etext[];
74extern char __init_begin, __init_end; 109extern char __init_begin[], __init_end[];
75 110
76extern pmd_t *zero_pgtable; 111extern pmd_t *zero_pgtable;
77 112
78void __init mem_init(void) 113void __init mem_init(void)
79{ 114{
115 pg_data_t *pgdat;
80 int codepages = 0; 116 int codepages = 0;
81 int datapages = 0; 117 int datapages = 0;
82 int initpages = 0; 118 int initpages = 0;
83 unsigned long tmp;
84#ifndef CONFIG_SUN3
85 int i; 119 int i;
86#endif
87
88 max_mapnr = num_physpages = (((unsigned long)high_memory - PAGE_OFFSET) >> PAGE_SHIFT);
89 120
90#ifdef CONFIG_ATARI 121#ifdef CONFIG_ATARI
91 if (MACH_IS_ATARI) 122 if (MACH_IS_ATARI)
@@ -93,19 +124,25 @@ void __init mem_init(void)
93#endif 124#endif
94 125
95 /* this will put all memory onto the freelists */ 126 /* this will put all memory onto the freelists */
96 totalram_pages = free_all_bootmem(); 127 totalram_pages = num_physpages = 0;
97 128 for_each_online_pgdat(pgdat) {
98 for (tmp = PAGE_OFFSET ; tmp < (unsigned long)high_memory; tmp += PAGE_SIZE) { 129 num_physpages += pgdat->node_present_pages;
99 if (PageReserved(virt_to_page(tmp))) { 130
100 if (tmp >= (unsigned long)&_text 131 totalram_pages += free_all_bootmem_node(pgdat);
101 && tmp < (unsigned long)&_etext) 132 for (i = 0; i < pgdat->node_spanned_pages; i++) {
133 struct page *page = pgdat->node_mem_map + i;
134 char *addr = page_to_virt(page);
135
136 if (!PageReserved(page))
137 continue;
138 if (addr >= _text &&
139 addr < _etext)
102 codepages++; 140 codepages++;
103 else if (tmp >= (unsigned long) &__init_begin 141 else if (addr >= __init_begin &&
104 && tmp < (unsigned long) &__init_end) 142 addr < __init_end)
105 initpages++; 143 initpages++;
106 else 144 else
107 datapages++; 145 datapages++;
108 continue;
109 } 146 }
110 } 147 }
111 148
@@ -124,7 +161,7 @@ void __init mem_init(void)
124 161
125 printk("Memory: %luk/%luk available (%dk kernel code, %dk data, %dk init)\n", 162 printk("Memory: %luk/%luk available (%dk kernel code, %dk data, %dk init)\n",
126 (unsigned long)nr_free_pages() << (PAGE_SHIFT-10), 163 (unsigned long)nr_free_pages() << (PAGE_SHIFT-10),
127 max_mapnr << (PAGE_SHIFT-10), 164 totalram_pages << (PAGE_SHIFT-10),
128 codepages << (PAGE_SHIFT-10), 165 codepages << (PAGE_SHIFT-10),
129 datapages << (PAGE_SHIFT-10), 166 datapages << (PAGE_SHIFT-10),
130 initpages << (PAGE_SHIFT-10)); 167 initpages << (PAGE_SHIFT-10));
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c
index 13c0b4ad01eb..b7473525b431 100644
--- a/arch/m68k/mm/memory.c
+++ b/arch/m68k/mm/memory.c
@@ -127,67 +127,6 @@ int free_pointer_table (pmd_t *ptable)
127 return 0; 127 return 0;
128} 128}
129 129
130#ifdef DEBUG_INVALID_PTOV
131int mm_inv_cnt = 5;
132#endif
133
134#ifndef CONFIG_SINGLE_MEMORY_CHUNK
135/*
136 * The following two routines map from a physical address to a kernel
137 * virtual address and vice versa.
138 */
139unsigned long mm_vtop(unsigned long vaddr)
140{
141 int i=0;
142 unsigned long voff = (unsigned long)vaddr - PAGE_OFFSET;
143
144 do {
145 if (voff < m68k_memory[i].size) {
146#ifdef DEBUGPV
147 printk ("VTOP(%p)=%lx\n", vaddr,
148 m68k_memory[i].addr + voff);
149#endif
150 return m68k_memory[i].addr + voff;
151 }
152 voff -= m68k_memory[i].size;
153 } while (++i < m68k_num_memory);
154
155 /* As a special case allow `__pa(high_memory)'. */
156 if (voff == 0)
157 return m68k_memory[i-1].addr + m68k_memory[i-1].size;
158
159 return -1;
160}
161EXPORT_SYMBOL(mm_vtop);
162
163unsigned long mm_ptov (unsigned long paddr)
164{
165 int i = 0;
166 unsigned long poff, voff = PAGE_OFFSET;
167
168 do {
169 poff = paddr - m68k_memory[i].addr;
170 if (poff < m68k_memory[i].size) {
171#ifdef DEBUGPV
172 printk ("PTOV(%lx)=%lx\n", paddr, poff + voff);
173#endif
174 return poff + voff;
175 }
176 voff += m68k_memory[i].size;
177 } while (++i < m68k_num_memory);
178
179#ifdef DEBUG_INVALID_PTOV
180 if (mm_inv_cnt > 0) {
181 mm_inv_cnt--;
182 printk("Invalid use of phys_to_virt(0x%lx) at 0x%p!\n",
183 paddr, __builtin_return_address(0));
184 }
185#endif
186 return -1;
187}
188EXPORT_SYMBOL(mm_ptov);
189#endif
190
191/* invalidate page in both caches */ 130/* invalidate page in both caches */
192static inline void clear040(unsigned long paddr) 131static inline void clear040(unsigned long paddr)
193{ 132{
@@ -354,15 +293,3 @@ void cache_push (unsigned long paddr, int len)
354} 293}
355EXPORT_SYMBOL(cache_push); 294EXPORT_SYMBOL(cache_push);
356 295
357#ifndef CONFIG_SINGLE_MEMORY_CHUNK
358int mm_end_of_chunk (unsigned long addr, int len)
359{
360 int i;
361
362 for (i = 0; i < m68k_num_memory; i++)
363 if (m68k_memory[i].addr + m68k_memory[i].size == addr + len)
364 return 1;
365 return 0;
366}
367EXPORT_SYMBOL(mm_end_of_chunk);
368#endif
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index afcccdc6ad45..7d571a2b44dd 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -43,6 +43,11 @@ unsigned long mm_cachebits;
43EXPORT_SYMBOL(mm_cachebits); 43EXPORT_SYMBOL(mm_cachebits);
44#endif 44#endif
45 45
46/* size of memory already mapped in head.S */
47#define INIT_MAPPED_SIZE (4UL<<20)
48
49extern unsigned long availmem;
50
46static pte_t * __init kernel_page_table(void) 51static pte_t * __init kernel_page_table(void)
47{ 52{
48 pte_t *ptablep; 53 pte_t *ptablep;
@@ -98,19 +103,20 @@ static pmd_t * __init kernel_ptr_table(void)
98 return last_pgtable; 103 return last_pgtable;
99} 104}
100 105
101static unsigned long __init 106static void __init map_node(int node)
102map_chunk (unsigned long addr, long size)
103{ 107{
104#define PTRTREESIZE (256*1024) 108#define PTRTREESIZE (256*1024)
105#define ROOTTREESIZE (32*1024*1024) 109#define ROOTTREESIZE (32*1024*1024)
106 static unsigned long virtaddr = PAGE_OFFSET; 110 unsigned long physaddr, virtaddr, size;
107 unsigned long physaddr;
108 pgd_t *pgd_dir; 111 pgd_t *pgd_dir;
109 pmd_t *pmd_dir; 112 pmd_t *pmd_dir;
110 pte_t *pte_dir; 113 pte_t *pte_dir;
111 114
112 physaddr = (addr | m68k_supervisor_cachemode | 115 size = m68k_memory[node].size;
113 _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY); 116 physaddr = m68k_memory[node].addr;
117 virtaddr = (unsigned long)phys_to_virt(physaddr);
118 physaddr |= m68k_supervisor_cachemode |
119 _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY;
114 if (CPU_IS_040_OR_060) 120 if (CPU_IS_040_OR_060)
115 physaddr |= _PAGE_GLOBAL040; 121 physaddr |= _PAGE_GLOBAL040;
116 122
@@ -190,8 +196,6 @@ map_chunk (unsigned long addr, long size)
190#ifdef DEBUG 196#ifdef DEBUG
191 printk("\n"); 197 printk("\n");
192#endif 198#endif
193
194 return virtaddr;
195} 199}
196 200
197/* 201/*
@@ -200,15 +204,16 @@ map_chunk (unsigned long addr, long size)
200 */ 204 */
201void __init paging_init(void) 205void __init paging_init(void)
202{ 206{
203 int chunk;
204 unsigned long mem_avail = 0;
205 unsigned long zones_size[MAX_NR_ZONES] = { 0, }; 207 unsigned long zones_size[MAX_NR_ZONES] = { 0, };
208 unsigned long min_addr, max_addr;
209 unsigned long addr, size, end;
210 int i;
206 211
207#ifdef DEBUG 212#ifdef DEBUG
208 { 213 {
209 extern unsigned long availmem; 214 extern unsigned long availmem;
210 printk ("start of paging_init (%p, %lx, %lx, %lx)\n", 215 printk ("start of paging_init (%p, %lx)\n",
211 kernel_pg_dir, availmem, start_mem, end_mem); 216 kernel_pg_dir, availmem);
212 } 217 }
213#endif 218#endif
214 219
@@ -222,24 +227,62 @@ void __init paging_init(void)
222 pgprot_val(protection_map[i]) |= _PAGE_CACHE040; 227 pgprot_val(protection_map[i]) |= _PAGE_CACHE040;
223 } 228 }
224 229
230 min_addr = m68k_memory[0].addr;
231 max_addr = min_addr + m68k_memory[0].size;
232 for (i = 1; i < m68k_num_memory;) {
233 if (m68k_memory[i].addr < min_addr) {
234 printk("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n",
235 m68k_memory[i].addr, m68k_memory[i].size);
236 printk("Fix your bootloader or use a memfile to make use of this area!\n");
237 m68k_num_memory--;
238 memmove(m68k_memory + i, m68k_memory + i + 1,
239 (m68k_num_memory - i) * sizeof(struct mem_info));
240 continue;
241 }
242 addr = m68k_memory[i].addr + m68k_memory[i].size;
243 if (addr > max_addr)
244 max_addr = addr;
245 i++;
246 }
247 m68k_memoffset = min_addr - PAGE_OFFSET;
248 m68k_virt_to_node_shift = fls(max_addr - min_addr - 1) - 6;
249
250 module_fixup(NULL, __start_fixup, __stop_fixup);
251 flush_icache();
252
253 high_memory = phys_to_virt(max_addr);
254
255 min_low_pfn = availmem >> PAGE_SHIFT;
256 max_low_pfn = max_addr >> PAGE_SHIFT;
257
258 for (i = 0; i < m68k_num_memory; i++) {
259 addr = m68k_memory[i].addr;
260 end = addr + m68k_memory[i].size;
261 m68k_setup_node(i);
262 availmem = PAGE_ALIGN(availmem);
263 availmem += init_bootmem_node(NODE_DATA(i),
264 availmem >> PAGE_SHIFT,
265 addr >> PAGE_SHIFT,
266 end >> PAGE_SHIFT);
267 }
268
225 /* 269 /*
226 * Map the physical memory available into the kernel virtual 270 * Map the physical memory available into the kernel virtual
227 * address space. It may allocate some memory for page 271 * address space. First initialize the bootmem allocator with
228 * tables and thus modify availmem. 272 * the memory we already mapped, so map_node() has something
273 * to allocate.
229 */ 274 */
275 addr = m68k_memory[0].addr;
276 size = m68k_memory[0].size;
277 free_bootmem_node(NODE_DATA(0), availmem, min(INIT_MAPPED_SIZE, size) - (availmem - addr));
278 map_node(0);
279 if (size > INIT_MAPPED_SIZE)
280 free_bootmem_node(NODE_DATA(0), addr + INIT_MAPPED_SIZE, size - INIT_MAPPED_SIZE);
230 281
231 for (chunk = 0; chunk < m68k_num_memory; chunk++) { 282 for (i = 1; i < m68k_num_memory; i++)
232 mem_avail = map_chunk (m68k_memory[chunk].addr, 283 map_node(i);
233 m68k_memory[chunk].size);
234
235 }
236 284
237 flush_tlb_all(); 285 flush_tlb_all();
238#ifdef DEBUG
239 printk ("memory available is %ldKB\n", mem_avail >> 10);
240 printk ("start_mem is %#lx\nvirtual_end is %#lx\n",
241 start_mem, end_mem);
242#endif
243 286
244 /* 287 /*
245 * initialize the bad page table and bad page to point 288 * initialize the bad page table and bad page to point
@@ -256,14 +299,11 @@ void __init paging_init(void)
256#ifdef DEBUG 299#ifdef DEBUG
257 printk ("before free_area_init\n"); 300 printk ("before free_area_init\n");
258#endif 301#endif
259 zones_size[ZONE_DMA] = (mach_max_dma_address < (unsigned long)high_memory ? 302 for (i = 0; i < m68k_num_memory; i++) {
260 (mach_max_dma_address+1) : (unsigned long)high_memory); 303 zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
261 zones_size[ZONE_NORMAL] = (unsigned long)high_memory - zones_size[0]; 304 free_area_init_node(i, pg_data_map + i, zones_size,
262 305 m68k_memory[i].addr >> PAGE_SHIFT, NULL);
263 zones_size[ZONE_DMA] = (zones_size[ZONE_DMA] - PAGE_OFFSET) >> PAGE_SHIFT; 306 }
264 zones_size[ZONE_NORMAL] >>= PAGE_SHIFT;
265
266 free_area_init(zones_size);
267} 307}
268 308
269extern char __init_begin, __init_end; 309extern char __init_begin, __init_end;
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index 4851b8437a87..c0fbd278fbb1 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -21,6 +21,7 @@
21#include <asm/contregs.h> 21#include <asm/contregs.h>
22#include <asm/movs.h> 22#include <asm/movs.h>
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/pgalloc.h>
24#include <asm/sun3-head.h> 25#include <asm/sun3-head.h>
25#include <asm/sun3mmu.h> 26#include <asm/sun3mmu.h>
26#include <asm/rtc.h> 27#include <asm/rtc.h>
@@ -127,6 +128,7 @@ void __init sun3_bootmem_alloc(unsigned long memory_start, unsigned long memory_
127 high_memory = (void *)memory_end; 128 high_memory = (void *)memory_end;
128 availmem = memory_start; 129 availmem = memory_start;
129 130
131 m68k_setup_node(0);
130 availmem += init_bootmem_node(NODE_DATA(0), start_page, 0, num_pages); 132 availmem += init_bootmem_node(NODE_DATA(0), start_page, 0, num_pages);
131 availmem = (availmem + (PAGE_SIZE-1)) & PAGE_MASK; 133 availmem = (availmem + (PAGE_SIZE-1)) & PAGE_MASK;
132 134
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index c86a1bf589d4..07a0055602f4 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -62,7 +62,7 @@ SECTIONS {
62 .text : { 62 .text : {
63 _text = .; 63 _text = .;
64 _stext = . ; 64 _stext = . ;
65 *(.text) 65 TEXT_TEXT
66 SCHED_TEXT 66 SCHED_TEXT
67 *(.text.lock) 67 *(.text.lock)
68 68
@@ -133,7 +133,7 @@ SECTIONS {
133 .data DATA_ADDR : { 133 .data DATA_ADDR : {
134 . = ALIGN(4); 134 . = ALIGN(4);
135 _sdata = . ; 135 _sdata = . ;
136 *(.data) 136 DATA_DATA
137 . = ALIGN(8192) ; 137 . = ALIGN(8192) ;
138 *(.data.init_task) 138 *(.data.init_task)
139 _edata = . ; 139 _edata = . ;
diff --git a/arch/mips/jmr3927/rbhma3100/kgdb_io.c b/arch/mips/jmr3927/rbhma3100/kgdb_io.c
index 2604f2c9a96e..342579cfdc01 100644
--- a/arch/mips/jmr3927/rbhma3100/kgdb_io.c
+++ b/arch/mips/jmr3927/rbhma3100/kgdb_io.c
@@ -36,7 +36,7 @@
36#define TIMEOUT 0xffffff 36#define TIMEOUT 0xffffff
37 37
38static int remoteDebugInitialized = 0; 38static int remoteDebugInitialized = 0;
39static void debugInit(int baud) 39static void debugInit(int baud);
40 40
41int putDebugChar(unsigned char c) 41int putDebugChar(unsigned char c)
42{ 42{
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index a7d49ae805b4..18c4a3c45a31 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -76,7 +76,7 @@
76#include <linux/module.h> 76#include <linux/module.h>
77#include <linux/signal.h> 77#include <linux/signal.h>
78#include <linux/smp.h> 78#include <linux/smp.h>
79 79#include <linux/sched.h>
80#include <asm/asm.h> 80#include <asm/asm.h>
81#include <asm/branch.h> 81#include <asm/branch.h>
82#include <asm/byteorder.h> 82#include <asm/byteorder.h>
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 043f637e3d10..9b9992cd562a 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -27,7 +27,7 @@ SECTIONS
27 /* read-only */ 27 /* read-only */
28 _text = .; /* Text and read-only data */ 28 _text = .; /* Text and read-only data */
29 .text : { 29 .text : {
30 *(.text) 30 TEXT_TEXT
31 SCHED_TEXT 31 SCHED_TEXT
32 LOCK_TEXT 32 LOCK_TEXT
33 *(.fixup) 33 *(.fixup)
@@ -62,7 +62,7 @@ SECTIONS
62 . = ALIGN(_PAGE_SIZE); 62 . = ALIGN(_PAGE_SIZE);
63 *(.data.init_task) 63 *(.data.init_task)
64 64
65 *(.data) 65 DATA_DATA
66 66
67 CONSTRUCTORS 67 CONSTRUCTORS
68 } 68 }
diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c
index cea7d0ea36e4..59945b9ee23c 100644
--- a/arch/mips/mm/ioremap.c
+++ b/arch/mips/mm/ioremap.c
@@ -9,7 +9,7 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <asm/addrspace.h> 10#include <asm/addrspace.h>
11#include <asm/byteorder.h> 11#include <asm/byteorder.h>
12 12#include <linux/sched.h>
13#include <linux/vmalloc.h> 13#include <linux/vmalloc.h>
14#include <asm/cacheflush.h> 14#include <asm/cacheflush.h>
15#include <asm/io.h> 15#include <asm/io.h>
diff --git a/arch/mips/pci/pci-ocelot.c b/arch/mips/pci/pci-ocelot.c
index 7f94f26d35ae..1421d34535ef 100644
--- a/arch/mips/pci/pci-ocelot.c
+++ b/arch/mips/pci/pci-ocelot.c
@@ -71,19 +71,19 @@ static inline void pci0WriteConfigReg(unsigned int offset, unsigned int data)
71} 71}
72 72
73static struct resource ocelot_mem_resource = { 73static struct resource ocelot_mem_resource = {
74 start = GT_PCI_MEM_BASE; 74 .start = GT_PCI_MEM_BASE,
75 end = GT_PCI_MEM_BASE + GT_PCI_MEM_BASE - 1; 75 .end = GT_PCI_MEM_BASE + GT_PCI_MEM_BASE - 1,
76}; 76};
77 77
78static struct resource ocelot_io_resource = { 78static struct resource ocelot_io_resource = {
79 start = GT_PCI_IO_BASE; 79 .start = GT_PCI_IO_BASE,
80 end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1; 80 .end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1,
81}; 81};
82 82
83static struct pci_controller ocelot_pci_controller = { 83static struct pci_controller ocelot_pci_controller = {
84 .pci_ops = gt64xxx_pci0_ops; 84 .pci_ops = gt64xxx_pci0_ops,
85 .mem_resource = &ocelot_mem_resource; 85 .mem_resource = &ocelot_mem_resource,
86 .io_resource = &ocelot_io_resource; 86 .io_resource = &ocelot_io_resource,
87}; 87};
88 88
89static int __init ocelot_pcibios_init(void) 89static int __init ocelot_pcibios_init(void)
diff --git a/arch/mips/sgi-ip32/Makefile b/arch/mips/sgi-ip32/Makefile
index 7e1416768a60..60f0227425e7 100644
--- a/arch/mips/sgi-ip32/Makefile
+++ b/arch/mips/sgi-ip32/Makefile
@@ -3,5 +3,5 @@
3# under Linux. 3# under Linux.
4# 4#
5 5
6obj-y += ip32-berr.o ip32-irq.o ip32-setup.o ip32-reset.o \ 6obj-y += ip32-berr.o ip32-irq.o ip32-platform.o ip32-setup.o ip32-reset.o \
7 crime.o ip32-memory.o 7 crime.o ip32-memory.o
diff --git a/arch/mips/sgi-ip32/ip32-platform.c b/arch/mips/sgi-ip32/ip32-platform.c
new file mode 100644
index 000000000000..120b15932caf
--- /dev/null
+++ b/arch/mips/sgi-ip32/ip32-platform.c
@@ -0,0 +1,20 @@
1#include <linux/init.h>
2#include <linux/platform_device.h>
3
4static __init int meth_devinit(void)
5{
6 struct platform_device *pd;
7 int ret;
8
9 pd = platform_device_alloc("meth", -1);
10 if (!pd)
11 return -ENOMEM;
12
13 ret = platform_device_add(pd);
14 if (ret)
15 platform_device_put(pd);
16
17 return ret;
18}
19
20device_initcall(meth_devinit);
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 0dc924ccceb5..395bbce64993 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -18,7 +18,7 @@
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <linux/pagemap.h> 20#include <linux/pagemap.h>
21 21#include <linux/sched.h>
22#include <asm/pdc.h> 22#include <asm/pdc.h>
23#include <asm/cache.h> 23#include <asm/cache.h>
24#include <asm/cacheflush.h> 24#include <asm/cacheflush.h>
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index dd5d0cb6b347..566226d78bc9 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -33,7 +33,7 @@
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/cpu.h> 35#include <linux/cpu.h>
36 36#include <asm/param.h>
37#include <asm/cache.h> 37#include <asm/cache.h>
38#include <asm/hardware.h> /* for register_parisc_driver() stuff */ 38#include <asm/hardware.h> /* for register_parisc_driver() stuff */
39#include <asm/processor.h> 39#include <asm/processor.h>
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index c74585990598..4d96ba4b9849 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -51,7 +51,7 @@ SECTIONS
51 51
52 _text = .; /* Text and read-only data */ 52 _text = .; /* Text and read-only data */
53 .text ALIGN(16) : { 53 .text ALIGN(16) : {
54 *(.text) 54 TEXT_TEXT
55 SCHED_TEXT 55 SCHED_TEXT
56 LOCK_TEXT 56 LOCK_TEXT
57 *(.text.do_softirq) 57 *(.text.do_softirq)
@@ -91,7 +91,7 @@ SECTIONS
91 91
92 . = ALIGN(L1_CACHE_BYTES); 92 . = ALIGN(L1_CACHE_BYTES);
93 .data : { /* Data */ 93 .data : { /* Data */
94 *(.data) 94 DATA_DATA
95 CONSTRUCTORS 95 CONSTRUCTORS
96 } 96 }
97 97
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 56d3c0dcd2b8..5eaeafd30bdf 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -118,6 +118,7 @@ config GENERIC_BUG
118 depends on BUG 118 depends on BUG
119 119
120config SYS_SUPPORTS_APM_EMULATION 120config SYS_SUPPORTS_APM_EMULATION
121 default y if PMAC_APM_EMU
121 bool 122 bool
122 123
123config DEFAULT_UIMAGE 124config DEFAULT_UIMAGE
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6238b5875fd1..fbafd965dcd2 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -142,7 +142,6 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
142 142
143# Default to zImage, override when needed 143# Default to zImage, override when needed
144defaultimage-y := zImage 144defaultimage-y := zImage
145defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
146defaultimage-$(CONFIG_DEFAULT_UIMAGE) := uImage 145defaultimage-$(CONFIG_DEFAULT_UIMAGE) := uImage
147KBUILD_IMAGE := $(defaultimage-y) 146KBUILD_IMAGE := $(defaultimage-y)
148all: $(KBUILD_IMAGE) 147all: $(KBUILD_IMAGE)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 83788986b93b..ff2701949ee1 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -11,20 +11,18 @@
11# bootloader and increase compatibility with OpenFirmware. 11# bootloader and increase compatibility with OpenFirmware.
12# 12#
13# To this end we need to define BOOTCC, etc, as the tools 13# To this end we need to define BOOTCC, etc, as the tools
14# needed to build the 32 bit image. These are normally HOSTCC, 14# needed to build the 32 bit image. That's normally the same
15# but may be a third compiler if, for example, you are cross 15# compiler for the rest of the kernel, with the -m32 flag added.
16# compiling from an intel box. Once the 64bit ppc gcc is
17# stable it will probably simply be a compiler switch to
18# compile for 32bit mode.
19# To make it easier to setup a cross compiler, 16# To make it easier to setup a cross compiler,
20# CROSS32_COMPILE is setup as a prefix just like CROSS_COMPILE 17# CROSS32_COMPILE is setup as a prefix just like CROSS_COMPILE
21# in the toplevel makefile. 18# in the toplevel makefile.
22 19
23all: $(obj)/zImage 20all: $(obj)/zImage
24 21
25HOSTCC := gcc 22BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
26BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \ 23 -fno-strict-aliasing -Os -msoft-float -pipe \
27 $(shell $(CROSS32CC) -print-file-name=include) -fPIC 24 -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
25 -isystem $(shell $(CROSS32CC) -print-file-name=include)
28BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc 26BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
29 27
30ifeq ($(call cc-option-yn, -fstack-protector),y) 28ifeq ($(call cc-option-yn, -fstack-protector),y)
@@ -33,8 +31,8 @@ endif
33 31
34BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) 32BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
35 33
36$(obj)/44x.o: BOOTCFLAGS += -Wa,-mbooke 34$(obj)/44x.o: BOOTCFLAGS += -mcpu=440
37$(obj)/ebony.o: BOOTCFLAGS += -Wa,-mbooke 35$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
38 36
39zlib := inffast.c inflate.c inftrees.c 37zlib := inffast.c inflate.c inftrees.c
40zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h 38zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
@@ -136,6 +134,7 @@ image-$(CONFIG_PPC_EFIKA) += zImage.chrp
136image-$(CONFIG_PPC_PMAC) += zImage.pmac 134image-$(CONFIG_PPC_PMAC) += zImage.pmac
137image-$(CONFIG_PPC_HOLLY) += zImage.holly-elf 135image-$(CONFIG_PPC_HOLLY) += zImage.holly-elf
138image-$(CONFIG_PPC_PRPMC2800) += zImage.prpmc2800 136image-$(CONFIG_PPC_PRPMC2800) += zImage.prpmc2800
137image-$(CONFIG_PPC_ISERIES) += zImage.iseries
139image-$(CONFIG_DEFAULT_UIMAGE) += uImage 138image-$(CONFIG_DEFAULT_UIMAGE) += uImage
140 139
141ifneq ($(CONFIG_DEVICE_TREE),"") 140ifneq ($(CONFIG_DEVICE_TREE),"")
@@ -185,6 +184,9 @@ $(obj)/zImage.initrd.%: vmlinux $(wrapperbits)
185$(obj)/zImage.%: vmlinux $(wrapperbits) 184$(obj)/zImage.%: vmlinux $(wrapperbits)
186 $(call if_changed,wrap,$*) 185 $(call if_changed,wrap,$*)
187 186
187$(obj)/zImage.iseries: vmlinux
188 $(STRIP) -s -R .comment $< -o $@
189
188$(obj)/zImage.ps3: vmlinux 190$(obj)/zImage.ps3: vmlinux
189 $(STRIP) -s -R .comment $< -o $@ 191 $(STRIP) -s -R .comment $< -o $@
190 192
diff --git a/arch/powerpc/boot/dts/lite5200.dts b/arch/powerpc/boot/dts/lite5200.dts
index eae68ab1177f..d29308fe4c24 100644
--- a/arch/powerpc/boot/dts/lite5200.dts
+++ b/arch/powerpc/boot/dts/lite5200.dts
@@ -67,7 +67,7 @@
67 interrupt-controller; 67 interrupt-controller;
68 #interrupt-cells = <3>; 68 #interrupt-cells = <3>;
69 device_type = "interrupt-controller"; 69 device_type = "interrupt-controller";
70 compatible = "mpc5200_pic"; 70 compatible = "mpc5200-pic";
71 reg = <500 80>; 71 reg = <500 80>;
72 built-in; 72 built-in;
73 }; 73 };
diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts
index 5185625a9419..f242531f0451 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -67,7 +67,7 @@
67 interrupt-controller; 67 interrupt-controller;
68 #interrupt-cells = <3>; 68 #interrupt-cells = <3>;
69 device_type = "interrupt-controller"; 69 device_type = "interrupt-controller";
70 compatible = "mpc5200b-pic\0mpc5200_pic"; 70 compatible = "mpc5200b-pic\0mpc5200-pic";
71 reg = <500 80>; 71 reg = <500 80>;
72 built-in; 72 built-in;
73 }; 73 };
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 2ed8b8b3f0ec..da77adc73078 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -129,7 +129,7 @@ case "$platform" in
129pmac|pseries|chrp) 129pmac|pseries|chrp)
130 platformo=$object/of.o 130 platformo=$object/of.o
131 ;; 131 ;;
132pmaccoff) 132coff)
133 platformo=$object/of.o 133 platformo=$object/of.o
134 lds=$object/zImage.coff.lds 134 lds=$object/zImage.coff.lds
135 ;; 135 ;;
@@ -220,7 +220,7 @@ case "$platform" in
220pseries|chrp) 220pseries|chrp)
221 $object/addnote "$ofile" 221 $object/addnote "$ofile"
222 ;; 222 ;;
223pmaccoff) 223coff)
224 ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile" 224 ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"
225 $object/hack-coff "$ofile" 225 $object/hack-coff "$ofile"
226 ;; 226 ;;
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 6ef87fb90b8e..b2b5d664d328 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -235,6 +235,7 @@ static struct cpu_spec cpu_specs[] = {
235 .icache_bsize = 128, 235 .icache_bsize = 128,
236 .dcache_bsize = 128, 236 .dcache_bsize = 128,
237 .num_pmcs = 8, 237 .num_pmcs = 8,
238 .pmc_type = PPC_PMC_IBM,
238 .cpu_setup = __setup_cpu_ppc970, 239 .cpu_setup = __setup_cpu_ppc970,
239 .cpu_restore = __restore_cpu_ppc970, 240 .cpu_restore = __restore_cpu_ppc970,
240 .oprofile_cpu_type = "ppc64/970MP", 241 .oprofile_cpu_type = "ppc64/970MP",
@@ -251,6 +252,7 @@ static struct cpu_spec cpu_specs[] = {
251 .icache_bsize = 128, 252 .icache_bsize = 128,
252 .dcache_bsize = 128, 253 .dcache_bsize = 128,
253 .num_pmcs = 8, 254 .num_pmcs = 8,
255 .pmc_type = PPC_PMC_IBM,
254 .cpu_setup = __setup_cpu_ppc970MP, 256 .cpu_setup = __setup_cpu_ppc970MP,
255 .cpu_restore = __restore_cpu_ppc970, 257 .cpu_restore = __restore_cpu_ppc970,
256 .oprofile_cpu_type = "ppc64/970MP", 258 .oprofile_cpu_type = "ppc64/970MP",
@@ -317,6 +319,7 @@ static struct cpu_spec cpu_specs[] = {
317 .icache_bsize = 128, 319 .icache_bsize = 128,
318 .dcache_bsize = 128, 320 .dcache_bsize = 128,
319 .num_pmcs = 6, 321 .num_pmcs = 6,
322 .pmc_type = PPC_PMC_IBM,
320 .oprofile_cpu_type = "ppc64/power6", 323 .oprofile_cpu_type = "ppc64/power6",
321 .oprofile_type = PPC_OPROFILE_POWER4, 324 .oprofile_type = PPC_OPROFILE_POWER4,
322 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV, 325 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
@@ -335,6 +338,7 @@ static struct cpu_spec cpu_specs[] = {
335 .icache_bsize = 128, 338 .icache_bsize = 128,
336 .dcache_bsize = 128, 339 .dcache_bsize = 128,
337 .num_pmcs = 6, 340 .num_pmcs = 6,
341 .pmc_type = PPC_PMC_IBM,
338 .oprofile_cpu_type = "ppc64/power6", 342 .oprofile_cpu_type = "ppc64/power6",
339 .oprofile_type = PPC_OPROFILE_POWER4, 343 .oprofile_type = PPC_OPROFILE_POWER4,
340 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV, 344 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 068377a2a8dc..42c8ed6ed528 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -489,7 +489,7 @@ struct irq_host *irq_alloc_host(unsigned int revmap_type,
489 case IRQ_HOST_MAP_LINEAR: 489 case IRQ_HOST_MAP_LINEAR:
490 rmap = (unsigned int *)(host + 1); 490 rmap = (unsigned int *)(host + 1);
491 for (i = 0; i < revmap_arg; i++) 491 for (i = 0; i < revmap_arg; i++)
492 rmap[i] = IRQ_NONE; 492 rmap[i] = NO_IRQ;
493 host->revmap_data.linear.size = revmap_arg; 493 host->revmap_data.linear.size = revmap_arg;
494 smp_wmb(); 494 smp_wmb();
495 host->revmap_data.linear.revmap = rmap; 495 host->revmap_data.linear.revmap = rmap;
@@ -614,7 +614,7 @@ unsigned int irq_create_mapping(struct irq_host *host,
614 * host->ops->map() to update the flags 614 * host->ops->map() to update the flags
615 */ 615 */
616 virq = irq_find_mapping(host, hwirq); 616 virq = irq_find_mapping(host, hwirq);
617 if (virq != IRQ_NONE) { 617 if (virq != NO_IRQ) {
618 if (host->ops->remap) 618 if (host->ops->remap)
619 host->ops->remap(host, virq, hwirq); 619 host->ops->remap(host, virq, hwirq);
620 pr_debug("irq: -> existing mapping on virq %d\n", virq); 620 pr_debug("irq: -> existing mapping on virq %d\n", virq);
@@ -741,7 +741,7 @@ void irq_dispose_mapping(unsigned int virq)
741 switch(host->revmap_type) { 741 switch(host->revmap_type) {
742 case IRQ_HOST_MAP_LINEAR: 742 case IRQ_HOST_MAP_LINEAR:
743 if (hwirq < host->revmap_data.linear.size) 743 if (hwirq < host->revmap_data.linear.size)
744 host->revmap_data.linear.revmap[hwirq] = IRQ_NONE; 744 host->revmap_data.linear.revmap[hwirq] = NO_IRQ;
745 break; 745 break;
746 case IRQ_HOST_MAP_TREE: 746 case IRQ_HOST_MAP_TREE:
747 /* Check if radix tree allocated yet */ 747 /* Check if radix tree allocated yet */
diff --git a/arch/powerpc/kernel/pmc.c b/arch/powerpc/kernel/pmc.c
index 24d7b7c99bb9..ea04e0ab3f2f 100644
--- a/arch/powerpc/kernel/pmc.c
+++ b/arch/powerpc/kernel/pmc.c
@@ -20,8 +20,8 @@
20#include <asm/cputable.h> 20#include <asm/cputable.h>
21#include <asm/pmc.h> 21#include <asm/pmc.h>
22 22
23#ifndef MMCR0_PMA0 23#ifndef MMCR0_PMAO
24#define MMCR0_PMA0 0 24#define MMCR0_PMAO 0
25#endif 25#endif
26 26
27static void dummy_perf(struct pt_regs *regs) 27static void dummy_perf(struct pt_regs *regs)
@@ -30,7 +30,7 @@ static void dummy_perf(struct pt_regs *regs)
30 mtpmr(PMRN_PMGC0, mfpmr(PMRN_PMGC0) & ~PMGC0_PMIE); 30 mtpmr(PMRN_PMGC0, mfpmr(PMRN_PMGC0) & ~PMGC0_PMIE);
31#elif defined(CONFIG_PPC64) || defined(CONFIG_6xx) 31#elif defined(CONFIG_PPC64) || defined(CONFIG_6xx)
32 if (cur_cpu_spec->pmc_type == PPC_PMC_IBM) 32 if (cur_cpu_spec->pmc_type == PPC_PMC_IBM)
33 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~(MMCR0_PMXE|MMCR0_PMA0)); 33 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~(MMCR0_PMXE|MMCR0_PMAO));
34#else 34#else
35 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~MMCR0_PMXE); 35 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~MMCR0_PMXE);
36#endif 36#endif
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 066a6a7a25b8..af42ddab3ab4 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1171,11 +1171,12 @@ EXPORT_SYMBOL(of_find_node_by_name);
1171 1171
1172/** 1172/**
1173 * of_find_node_by_type - Find a node by its "device_type" property 1173 * of_find_node_by_type - Find a node by its "device_type" property
1174 * @from: The node to start searching from or NULL, the node 1174 * @from: The node to start searching from, or NULL to start searching
1175 * you pass will not be searched, only the next one 1175 * the entire device tree. The node you pass will not be
1176 * will; typically, you pass what the previous call 1176 * searched, only the next one will; typically, you pass
1177 * returned. of_node_put() will be called on it 1177 * what the previous call returned. of_node_put() will be
1178 * @name: The type string to match against 1178 * called on from for you.
1179 * @type: The type string to match against
1179 * 1180 *
1180 * Returns a node pointer with refcount incremented, use 1181 * Returns a node pointer with refcount incremented, use
1181 * of_node_put() on it when done. 1182 * of_node_put() on it when done.
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index f4f391cdd8f5..bf76562167c3 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -218,6 +218,7 @@ set_single_step(struct task_struct *task)
218 regs->msr |= MSR_SE; 218 regs->msr |= MSR_SE;
219#endif 219#endif
220 } 220 }
221 set_tsk_thread_flag(task, TIF_SINGLESTEP);
221} 222}
222 223
223static inline void 224static inline void
@@ -233,6 +234,7 @@ clear_single_step(struct task_struct *task)
233 regs->msr &= ~MSR_SE; 234 regs->msr &= ~MSR_SE;
234#endif 235#endif
235 } 236 }
237 clear_tsk_thread_flag(task, TIF_SINGLESTEP);
236} 238}
237#endif /* CONFIG_PPC32 */ 239#endif /* CONFIG_PPC32 */
238 240
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 22f1ef1b3100..d577b71db375 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -201,13 +201,6 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
201 /* Can deadlock when called with interrupts disabled */ 201 /* Can deadlock when called with interrupts disabled */
202 WARN_ON(irqs_disabled()); 202 WARN_ON(irqs_disabled());
203 203
204 /* remove 'self' from the map */
205 if (cpu_isset(smp_processor_id(), map))
206 cpu_clear(smp_processor_id(), map);
207
208 /* sanity check the map, remove any non-online processors. */
209 cpus_and(map, map, cpu_online_map);
210
211 if (unlikely(smp_ops == NULL)) 204 if (unlikely(smp_ops == NULL))
212 return ret; 205 return ret;
213 206
@@ -222,10 +215,17 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
222 /* Must grab online cpu count with preempt disabled, otherwise 215 /* Must grab online cpu count with preempt disabled, otherwise
223 * it can change. */ 216 * it can change. */
224 num_cpus = num_online_cpus() - 1; 217 num_cpus = num_online_cpus() - 1;
225 if (!num_cpus || cpus_empty(map)) { 218 if (!num_cpus)
226 ret = 0; 219 goto done;
227 goto out; 220
228 } 221 /* remove 'self' from the map */
222 if (cpu_isset(smp_processor_id(), map))
223 cpu_clear(smp_processor_id(), map);
224
225 /* sanity check the map, remove any non-online processors. */
226 cpus_and(map, map, cpu_online_map);
227 if (cpus_empty(map))
228 goto done;
229 229
230 call_data = &data; 230 call_data = &data;
231 smp_wmb(); 231 smp_wmb();
@@ -263,6 +263,7 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
263 } 263 }
264 } 264 }
265 265
266 done:
266 ret = 0; 267 ret = 0;
267 268
268 out: 269 out:
@@ -282,16 +283,17 @@ EXPORT_SYMBOL(smp_call_function);
282int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int nonatomic, 283int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int nonatomic,
283 int wait) 284 int wait)
284{ 285{
285 cpumask_t map=CPU_MASK_NONE; 286 cpumask_t map = CPU_MASK_NONE;
287 int ret = -EBUSY;
286 288
287 if (!cpu_online(cpu)) 289 if (!cpu_online(cpu))
288 return -EINVAL; 290 return -EINVAL;
289 291
290 if (cpu == smp_processor_id())
291 return -EBUSY;
292
293 cpu_set(cpu, map); 292 cpu_set(cpu, map);
294 return smp_call_function_map(func,info,nonatomic,wait,map); 293 if (cpu != get_cpu())
294 ret = smp_call_function_map(func,info,nonatomic,wait,map);
295 put_cpu();
296 return ret;
295} 297}
296EXPORT_SYMBOL(smp_call_function_single); 298EXPORT_SYMBOL(smp_call_function_single);
297 299
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 132067313147..21c39ff2dc39 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -34,7 +34,7 @@ SECTIONS
34 /* Text and gots */ 34 /* Text and gots */
35 .text : { 35 .text : {
36 _text = .; 36 _text = .;
37 *(.text .text.*) 37 TEXT_TEXT
38 SCHED_TEXT 38 SCHED_TEXT
39 LOCK_TEXT 39 LOCK_TEXT
40 KPROBES_TEXT 40 KPROBES_TEXT
@@ -167,7 +167,7 @@ SECTIONS
167#ifdef CONFIG_PPC32 167#ifdef CONFIG_PPC32
168 .data : 168 .data :
169 { 169 {
170 *(.data) 170 DATA_DATA
171 *(.sdata) 171 *(.sdata)
172 *(.got.plt) *(.got) 172 *(.got.plt) *(.got)
173 } 173 }
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 246eeea40ece..0266a94d83b6 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -310,11 +310,12 @@ void __init paging_init(void)
310 310
311#ifdef CONFIG_HIGHMEM 311#ifdef CONFIG_HIGHMEM
312 map_page(PKMAP_BASE, 0, 0); /* XXX gross */ 312 map_page(PKMAP_BASE, 0, 0); /* XXX gross */
313 pkmap_page_table = pte_offset_kernel(pmd_offset(pgd_offset_k 313 pkmap_page_table = pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k
314 (PKMAP_BASE), PKMAP_BASE), PKMAP_BASE); 314 (PKMAP_BASE), PKMAP_BASE), PKMAP_BASE), PKMAP_BASE);
315 map_page(KMAP_FIX_BEGIN, 0, 0); /* XXX gross */ 315 map_page(KMAP_FIX_BEGIN, 0, 0); /* XXX gross */
316 kmap_pte = pte_offset_kernel(pmd_offset(pgd_offset_k 316 kmap_pte = pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k
317 (KMAP_FIX_BEGIN), KMAP_FIX_BEGIN), KMAP_FIX_BEGIN); 317 (KMAP_FIX_BEGIN), KMAP_FIX_BEGIN), KMAP_FIX_BEGIN),
318 KMAP_FIX_BEGIN);
318 kmap_prot = PAGE_KERNEL; 319 kmap_prot = PAGE_KERNEL;
319#endif /* CONFIG_HIGHMEM */ 320#endif /* CONFIG_HIGHMEM */
320 321
diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c
index 972a8e884b9a..86010fc7d3b1 100644
--- a/arch/powerpc/mm/mmap.c
+++ b/arch/powerpc/mm/mmap.c
@@ -24,6 +24,7 @@
24 24
25#include <linux/personality.h> 25#include <linux/personality.h>
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/sched.h>
27 28
28/* 29/*
29 * Top of mmap area (just below the process stack). 30 * Top of mmap area (just below the process stack).
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index d8232b7a08f7..f6ae1a57d652 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -93,7 +93,7 @@ void pgd_free(pgd_t *pgd)
93 free_pages((unsigned long)pgd, PGDIR_ORDER); 93 free_pages((unsigned long)pgd, PGDIR_ORDER);
94} 94}
95 95
96pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) 96__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
97{ 97{
98 pte_t *pte; 98 pte_t *pte;
99 extern int mem_init_done; 99 extern int mem_init_done;
diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
index 71045677559a..5bcc58d9a4dd 100644
--- a/arch/powerpc/platforms/chrp/pegasos_eth.c
+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -169,7 +169,7 @@ static int Enable_SRAM(void)
169 169
170/***********/ 170/***********/
171/***********/ 171/***********/
172int mv643xx_eth_add_pds(void) 172static int __init mv643xx_eth_add_pds(void)
173{ 173{
174 int ret = 0; 174 int ret = 0;
175 static struct pci_device_id pci_marvell_mv64360[] = { 175 static struct pci_device_id pci_marvell_mv64360[] = {
diff --git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c
index 03cd45d8fefa..3c962d5757be 100644
--- a/arch/powerpc/platforms/pasemi/idle.c
+++ b/arch/powerpc/platforms/pasemi/idle.c
@@ -26,6 +26,7 @@
26 26
27#include <asm/machdep.h> 27#include <asm/machdep.h>
28#include <asm/reg.h> 28#include <asm/reg.h>
29#include <asm/smp.h>
29 30
30#include "pasemi.h" 31#include "pasemi.h"
31 32
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index a410bc76a8a8..07b1c4ec428d 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -384,7 +384,7 @@ int boot_part;
384static dev_t boot_dev; 384static dev_t boot_dev;
385 385
386#ifdef CONFIG_SCSI 386#ifdef CONFIG_SCSI
387void __init note_scsi_host(struct device_node *node, void *host) 387void note_scsi_host(struct device_node *node, void *host)
388{ 388{
389 int l; 389 int l;
390 char *p; 390 char *p;
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
index 9da82c266ba9..ec9030dbb5f1 100644
--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -25,6 +25,7 @@
25#include <asm/machdep.h> 25#include <asm/machdep.h>
26#include <asm/udbg.h> 26#include <asm/udbg.h>
27#include <asm/lv1call.h> 27#include <asm/lv1call.h>
28#include <asm/smp.h>
28 29
29#include "platform.h" 30#include "platform.h"
30 31
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index b854e7f1001c..f1df942072bb 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -752,6 +752,7 @@ skip_gserver_check:
752void xics_request_IPIs(void) 752void xics_request_IPIs(void)
753{ 753{
754 unsigned int ipi; 754 unsigned int ipi;
755 int rc;
755 756
756 ipi = irq_create_mapping(xics_host, XICS_IPI); 757 ipi = irq_create_mapping(xics_host, XICS_IPI);
757 BUG_ON(ipi == NO_IRQ); 758 BUG_ON(ipi == NO_IRQ);
@@ -762,11 +763,12 @@ void xics_request_IPIs(void)
762 */ 763 */
763 set_irq_handler(ipi, handle_percpu_irq); 764 set_irq_handler(ipi, handle_percpu_irq);
764 if (firmware_has_feature(FW_FEATURE_LPAR)) 765 if (firmware_has_feature(FW_FEATURE_LPAR))
765 request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED, 766 rc = request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
766 "IPI", NULL); 767 "IPI", NULL);
767 else 768 else
768 request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED, 769 rc = request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
769 "IPI", NULL); 770 "IPI", NULL);
771 BUG_ON(rc);
770} 772}
771#endif /* CONFIG_SMP */ 773#endif /* CONFIG_SMP */
772 774
diff --git a/arch/powerpc/sysdev/qe_lib/Kconfig b/arch/powerpc/sysdev/qe_lib/Kconfig
index 887739f3badc..f611d344a126 100644
--- a/arch/powerpc/sysdev/qe_lib/Kconfig
+++ b/arch/powerpc/sysdev/qe_lib/Kconfig
@@ -5,15 +5,13 @@
5config UCC_SLOW 5config UCC_SLOW
6 bool 6 bool
7 default n 7 default n
8 select UCC
9 help 8 help
10 This option provides qe_lib support to UCC slow 9 This option provides qe_lib support to UCC slow
11 protocols: UART, BISYNC, QMC 10 protocols: UART, BISYNC, QMC
12 11
13config UCC_FAST 12config UCC_FAST
14 bool 13 bool
15 default n 14 default y if UCC_GETH
16 select UCC
17 help 15 help
18 This option provides qe_lib support to UCC fast 16 This option provides qe_lib support to UCC fast
19 protocols: HDLC, Ethernet, ATM, transparent 17 protocols: HDLC, Ethernet, ATM, transparent
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index ab64256110bd..fba7ca17a67e 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -596,7 +596,11 @@ fast_exception_return:
596 mr r12,r4 /* restart at exc_exit_restart */ 596 mr r12,r4 /* restart at exc_exit_restart */
597 b 2b 597 b 2b
598 598
599 .comm fee_restarts,4 599 .section .bss
600 .align 2
601fee_restarts:
602 .space 4
603 .previous
600 604
601/* aargh, a nonrecoverable interrupt, panic */ 605/* aargh, a nonrecoverable interrupt, panic */
602/* aargh, we don't know which trap this is */ 606/* aargh, we don't know which trap this is */
@@ -851,7 +855,11 @@ load_dbcr0:
851 mtspr SPRN_DBSR,r11 /* clear all pending debug events */ 855 mtspr SPRN_DBSR,r11 /* clear all pending debug events */
852 blr 856 blr
853 857
854 .comm global_dbcr0,8 858 .section .bss
859 .align 4
860global_dbcr0:
861 .space 8
862 .previous
855#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */ 863#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */
856 864
857do_work: /* r10 contains MSR_KERNEL here */ 865do_work: /* r10 contains MSR_KERNEL here */
@@ -926,4 +934,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
926 /* shouldn't return */ 934 /* shouldn't return */
927 b 4b 935 b 4b
928 936
929 .comm ee_restarts,4 937 .section .bss
938 .align 2
939ee_restarts:
940 .space 4
941 .previous
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 4ad499605d05..a4165209ac7c 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -40,7 +40,6 @@
40#include <asm/time.h> 40#include <asm/time.h>
41#include <asm/cputable.h> 41#include <asm/cputable.h>
42#include <asm/btext.h> 42#include <asm/btext.h>
43#include <asm/div64.h>
44#include <asm/xmon.h> 43#include <asm/xmon.h>
45#include <asm/signal.h> 44#include <asm/signal.h>
46#include <asm/dcr.h> 45#include <asm/dcr.h>
@@ -93,7 +92,6 @@ EXPORT_SYMBOL(strncpy);
93EXPORT_SYMBOL(strcat); 92EXPORT_SYMBOL(strcat);
94EXPORT_SYMBOL(strlen); 93EXPORT_SYMBOL(strlen);
95EXPORT_SYMBOL(strcmp); 94EXPORT_SYMBOL(strcmp);
96EXPORT_SYMBOL(__div64_32);
97 95
98EXPORT_SYMBOL(csum_partial); 96EXPORT_SYMBOL(csum_partial);
99EXPORT_SYMBOL(csum_partial_copy_generic); 97EXPORT_SYMBOL(csum_partial_copy_generic);
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index 44cd128fb719..19db8746ff14 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -32,7 +32,7 @@ SECTIONS
32 .text : 32 .text :
33 { 33 {
34 _text = .; 34 _text = .;
35 *(.text) 35 TEXT_TEXT
36 SCHED_TEXT 36 SCHED_TEXT
37 LOCK_TEXT 37 LOCK_TEXT
38 *(.fixup) 38 *(.fixup)
@@ -67,7 +67,7 @@ SECTIONS
67 . = ALIGN(4096); 67 . = ALIGN(4096);
68 .data : 68 .data :
69 { 69 {
70 *(.data) 70 DATA_DATA
71 *(.data1) 71 *(.data1)
72 *(.sdata) 72 *(.sdata)
73 *(.sdata2) 73 *(.sdata2)
diff --git a/arch/ppc/mm/hashtable.S b/arch/ppc/mm/hashtable.S
index e756942e65c4..5f364dc50154 100644
--- a/arch/ppc/mm/hashtable.S
+++ b/arch/ppc/mm/hashtable.S
@@ -30,7 +30,11 @@
30#include <asm/asm-offsets.h> 30#include <asm/asm-offsets.h>
31 31
32#ifdef CONFIG_SMP 32#ifdef CONFIG_SMP
33 .comm mmu_hash_lock,4 33 .section .bss
34 .align 2
35 .globl mmu_hash_lock
36mmu_hash_lock:
37 .space 4
34#endif /* CONFIG_SMP */ 38#endif /* CONFIG_SMP */
35 39
36/* 40/*
@@ -461,9 +465,17 @@ found_slot:
461 sync /* make sure pte updates get to memory */ 465 sync /* make sure pte updates get to memory */
462 blr 466 blr
463 467
464 .comm next_slot,4 468 .section .bss
465 .comm primary_pteg_full,4 469 .align 2
466 .comm htab_hash_searches,4 470next_slot:
471 .space 4
472 .globl primary_pteg_full
473primary_pteg_full:
474 .space 4
475 .globl htab_hash_searches
476htab_hash_searches:
477 .space 4
478 .previous
467 479
468/* 480/*
469 * Flush the entry for a particular page from the hash table. 481 * Flush the entry for a particular page from the hash table.
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index c023b7298809..35ebb6395ae3 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -92,7 +92,7 @@ void pgd_free(pgd_t *pgd)
92 free_pages((unsigned long)pgd, PGDIR_ORDER); 92 free_pages((unsigned long)pgd, PGDIR_ORDER);
93} 93}
94 94
95pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) 95__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
96{ 96{
97 pte_t *pte; 97 pte_t *pte;
98 extern int mem_init_done; 98 extern int mem_init_done;
diff --git a/arch/ppc/syslib/ibm_ocp.c b/arch/ppc/syslib/ibm_ocp.c
index 3f6e55c79181..2ee176610e7c 100644
--- a/arch/ppc/syslib/ibm_ocp.c
+++ b/arch/ppc/syslib/ibm_ocp.c
@@ -1,4 +1,5 @@
1#include <linux/module.h> 1#include <linux/module.h>
2#include <asm/ibm4xx.h>
2#include <asm/ocp.h> 3#include <asm/ocp.h>
3 4
4struct ocp_sys_info_data ocp_sys_info = { 5struct ocp_sys_info_data ocp_sys_info = {
diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c
index 2782cf9da5b4..b9a1ce1f28e4 100644
--- a/arch/s390/hypfs/hypfs_diag.c
+++ b/arch/s390/hypfs/hypfs_diag.c
@@ -481,9 +481,17 @@ out:
481 481
482/* Diagnose 224 functions */ 482/* Diagnose 224 functions */
483 483
484static void diag224(void *ptr) 484static int diag224(void *ptr)
485{ 485{
486 asm volatile("diag %0,%1,0x224" : :"d" (0), "d"(ptr) : "memory"); 486 int rc = -ENOTSUPP;
487
488 asm volatile(
489 " diag %1,%2,0x224\n"
490 "0: lhi %0,0x0\n"
491 "1:\n"
492 EX_TABLE(0b,1b)
493 : "+d" (rc) :"d" (0), "d" (ptr) : "memory");
494 return rc;
487} 495}
488 496
489static int diag224_get_name_table(void) 497static int diag224_get_name_table(void)
@@ -492,7 +500,10 @@ static int diag224_get_name_table(void)
492 diag224_cpu_names = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA); 500 diag224_cpu_names = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
493 if (!diag224_cpu_names) 501 if (!diag224_cpu_names)
494 return -ENOMEM; 502 return -ENOMEM;
495 diag224(diag224_cpu_names); 503 if (diag224(diag224_cpu_names)) {
504 kfree(diag224_cpu_names);
505 return -ENOTSUPP;
506 }
496 EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16); 507 EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16);
497 return 0; 508 return 0;
498} 509}
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 32a69a18a796..acc415457b45 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1682,3 +1682,31 @@ compat_sys_utimes_wrapper:
1682 llgtr %r2,%r2 # char * 1682 llgtr %r2,%r2 # char *
1683 llgtr %r3,%r3 # struct compat_timeval * 1683 llgtr %r3,%r3 # struct compat_timeval *
1684 jg compat_sys_utimes 1684 jg compat_sys_utimes
1685
1686 .globl compat_sys_utimensat_wrapper
1687compat_sys_utimensat_wrapper:
1688 llgfr %r2,%r2 # unsigned int
1689 llgtr %r3,%r3 # char *
1690 llgtr %r4,%r4 # struct compat_timespec *
1691 lgfr %r5,%r5 # int
1692 jg compat_sys_utimensat
1693
1694 .globl compat_sys_signalfd_wrapper
1695compat_sys_signalfd_wrapper:
1696 lgfr %r2,%r2 # int
1697 llgtr %r3,%r3 # compat_sigset_t *
1698 llgfr %r4,%r4 # compat_size_t
1699 jg compat_sys_signalfd
1700
1701 .globl compat_sys_timerfd_wrapper
1702compat_sys_timerfd_wrapper:
1703 lgfr %r2,%r2 # int
1704 lgfr %r3,%r3 # int
1705 lgfr %r4,%r4 # int
1706 llgtr %r5,%r5 # struct compat_itimerspec *
1707 jg compat_sys_timerfd
1708
1709 .globl sys_eventfd_wrapper
1710sys_eventfd_wrapper:
1711 llgfr %r2,%r2 # unsigned int
1712 jg sys_eventfd
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index dca6eaf82c80..1b2f5ce45320 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -163,7 +163,7 @@ unsigned int debug_feature_version = __DEBUG_FEATURE_VERSION;
163 163
164static debug_info_t *debug_area_first = NULL; 164static debug_info_t *debug_area_first = NULL;
165static debug_info_t *debug_area_last = NULL; 165static debug_info_t *debug_area_last = NULL;
166static DECLARE_MUTEX(debug_lock); 166static DEFINE_MUTEX(debug_mutex);
167 167
168static int initialized; 168static int initialized;
169 169
@@ -576,7 +576,7 @@ debug_input(struct file *file, const char __user *user_buf, size_t length,
576 int rc = 0; 576 int rc = 0;
577 file_private_info_t *p_info; 577 file_private_info_t *p_info;
578 578
579 down(&debug_lock); 579 mutex_lock(&debug_mutex);
580 p_info = ((file_private_info_t *) file->private_data); 580 p_info = ((file_private_info_t *) file->private_data);
581 if (p_info->view->input_proc) 581 if (p_info->view->input_proc)
582 rc = p_info->view->input_proc(p_info->debug_info_org, 582 rc = p_info->view->input_proc(p_info->debug_info_org,
@@ -584,7 +584,7 @@ debug_input(struct file *file, const char __user *user_buf, size_t length,
584 length, offset); 584 length, offset);
585 else 585 else
586 rc = -EPERM; 586 rc = -EPERM;
587 up(&debug_lock); 587 mutex_unlock(&debug_mutex);
588 return rc; /* number of input characters */ 588 return rc; /* number of input characters */
589} 589}
590 590
@@ -602,7 +602,7 @@ debug_open(struct inode *inode, struct file *file)
602 file_private_info_t *p_info; 602 file_private_info_t *p_info;
603 debug_info_t *debug_info, *debug_info_snapshot; 603 debug_info_t *debug_info, *debug_info_snapshot;
604 604
605 down(&debug_lock); 605 mutex_lock(&debug_mutex);
606 debug_info = file->f_path.dentry->d_inode->i_private; 606 debug_info = file->f_path.dentry->d_inode->i_private;
607 /* find debug view */ 607 /* find debug view */
608 for (i = 0; i < DEBUG_MAX_VIEWS; i++) { 608 for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
@@ -653,7 +653,7 @@ found:
653 file->private_data = p_info; 653 file->private_data = p_info;
654 debug_info_get(debug_info); 654 debug_info_get(debug_info);
655out: 655out:
656 up(&debug_lock); 656 mutex_unlock(&debug_mutex);
657 return rc; 657 return rc;
658} 658}
659 659
@@ -688,7 +688,7 @@ debug_register (char *name, int pages_per_area, int nr_areas, int buf_size)
688 688
689 if (!initialized) 689 if (!initialized)
690 BUG(); 690 BUG();
691 down(&debug_lock); 691 mutex_lock(&debug_mutex);
692 692
693 /* create new debug_info */ 693 /* create new debug_info */
694 694
@@ -702,7 +702,7 @@ out:
702 if (!rc){ 702 if (!rc){
703 printk(KERN_ERR "debug: debug_register failed for %s\n",name); 703 printk(KERN_ERR "debug: debug_register failed for %s\n",name);
704 } 704 }
705 up(&debug_lock); 705 mutex_unlock(&debug_mutex);
706 return rc; 706 return rc;
707} 707}
708 708
@@ -716,9 +716,9 @@ debug_unregister(debug_info_t * id)
716{ 716{
717 if (!id) 717 if (!id)
718 goto out; 718 goto out;
719 down(&debug_lock); 719 mutex_lock(&debug_mutex);
720 debug_info_put(id); 720 debug_info_put(id);
721 up(&debug_lock); 721 mutex_unlock(&debug_mutex);
722 722
723out: 723out:
724 return; 724 return;
@@ -1054,11 +1054,11 @@ __init debug_init(void)
1054 int rc = 0; 1054 int rc = 0;
1055 1055
1056 s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table); 1056 s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table);
1057 down(&debug_lock); 1057 mutex_lock(&debug_mutex);
1058 debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT,NULL); 1058 debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT,NULL);
1059 printk(KERN_INFO "debug: Initialization complete\n"); 1059 printk(KERN_INFO "debug: Initialization complete\n");
1060 initialized = 1; 1060 initialized = 1;
1061 up(&debug_lock); 1061 mutex_unlock(&debug_mutex);
1062 1062
1063 return rc; 1063 return rc;
1064} 1064}
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index e39333ae0fcf..358d2bbbc481 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -413,7 +413,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
413 break; 413 break;
414 } 414 }
415 } 415 }
416 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address)); 416 kretprobe_assert(ri, orig_ret_address, trampoline_address);
417 regs->psw.addr = orig_ret_address | PSW_ADDR_AMODE; 417 regs->psw.addr = orig_ret_address | PSW_ADDR_AMODE;
418 418
419 reset_current_kprobe(); 419 reset_current_kprobe();
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 6bfb0889eb10..51d6309e7f3b 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -102,7 +102,7 @@ static struct resource data_resource = {
102/* 102/*
103 * cpu_init() initializes state that is per-CPU. 103 * cpu_init() initializes state that is per-CPU.
104 */ 104 */
105void __devinit cpu_init (void) 105void __cpuinit cpu_init(void)
106{ 106{
107 int addr = hard_smp_processor_id(); 107 int addr = hard_smp_processor_id();
108 108
@@ -915,7 +915,7 @@ setup_arch(char **cmdline_p)
915 setup_zfcpdump(console_devno); 915 setup_zfcpdump(console_devno);
916} 916}
917 917
918void print_cpu_info(struct cpuinfo_S390 *cpuinfo) 918void __cpuinit print_cpu_info(struct cpuinfo_S390 *cpuinfo)
919{ 919{
920 printk("cpu %d " 920 printk("cpu %d "
921#ifdef CONFIG_SMP 921#ifdef CONFIG_SMP
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 09f028a3266b..8ff2feaf9b00 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -492,7 +492,7 @@ static unsigned int __init smp_count_cpus(void)
492/* 492/*
493 * Activate a secondary processor. 493 * Activate a secondary processor.
494 */ 494 */
495int __devinit start_secondary(void *cpuvoid) 495int __cpuinit start_secondary(void *cpuvoid)
496{ 496{
497 /* Setup the cpu */ 497 /* Setup the cpu */
498 cpu_init(); 498 cpu_init();
@@ -741,7 +741,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
741 smp_create_idle(cpu); 741 smp_create_idle(cpu);
742} 742}
743 743
744void __devinit smp_prepare_boot_cpu(void) 744void __init smp_prepare_boot_cpu(void)
745{ 745{
746 BUG_ON(smp_processor_id() != 0); 746 BUG_ON(smp_processor_id() != 0);
747 747
@@ -750,7 +750,7 @@ void __devinit smp_prepare_boot_cpu(void)
750 current_set[0] = current; 750 current_set[0] = current;
751} 751}
752 752
753void smp_cpus_done(unsigned int max_cpus) 753void __init smp_cpus_done(unsigned int max_cpus)
754{ 754{
755 cpu_present_map = cpu_possible_map; 755 cpu_present_map = cpu_possible_map;
756} 756}
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index cd8d321cd0c2..738feb4a0aad 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -322,3 +322,8 @@ NI_SYSCALL /* 310 sys_move_pages */
322SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) 322SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper)
323SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper) 323SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper)
324SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) 324SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper)
325NI_SYSCALL /* 314 sys_fallocate */
326SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */
327SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper)
328SYSCALL(sys_timerfd,sys_timerfd,compat_sys_timerfd_wrapper)
329SYSCALL(sys_eventfd,sys_eventfd,sys_eventfd_wrapper)
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index e9d3432aba60..7158a804a5e4 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -21,7 +21,7 @@ SECTIONS
21 . = 0x00000000; 21 . = 0x00000000;
22 _text = .; /* Text and read-only data */ 22 _text = .; /* Text and read-only data */
23 .text : { 23 .text : {
24 *(.text) 24 TEXT_TEXT
25 SCHED_TEXT 25 SCHED_TEXT
26 LOCK_TEXT 26 LOCK_TEXT
27 KPROBES_TEXT 27 KPROBES_TEXT
@@ -48,7 +48,7 @@ SECTIONS
48 BUG_TABLE 48 BUG_TABLE
49 49
50 .data : { /* Data */ 50 .data : { /* Data */
51 *(.data) 51 DATA_DATA
52 CONSTRUCTORS 52 CONSTRUCTORS
53 } 53 }
54 54
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 916b72a8cde8..9098531a2671 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -61,30 +61,38 @@ void diag10(unsigned long addr)
61 61
62void show_mem(void) 62void show_mem(void)
63{ 63{
64 int i, total = 0, reserved = 0; 64 int i, total = 0, reserved = 0;
65 int shared = 0, cached = 0; 65 int shared = 0, cached = 0;
66 struct page *page; 66 struct page *page;
67 67
68 printk("Mem-info:\n"); 68 printk("Mem-info:\n");
69 show_free_areas(); 69 show_free_areas();
70 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 70 printk("Free swap: %6ldkB\n", nr_swap_pages << (PAGE_SHIFT - 10));
71 i = max_mapnr; 71 i = max_mapnr;
72 while (i-- > 0) { 72 while (i-- > 0) {
73 if (!pfn_valid(i)) 73 if (!pfn_valid(i))
74 continue; 74 continue;
75 page = pfn_to_page(i); 75 page = pfn_to_page(i);
76 total++; 76 total++;
77 if (PageReserved(page)) 77 if (PageReserved(page))
78 reserved++; 78 reserved++;
79 else if (PageSwapCache(page)) 79 else if (PageSwapCache(page))
80 cached++; 80 cached++;
81 else if (page_count(page)) 81 else if (page_count(page))
82 shared += page_count(page) - 1; 82 shared += page_count(page) - 1;
83 } 83 }
84 printk("%d pages of RAM\n",total); 84 printk("%d pages of RAM\n", total);
85 printk("%d reserved pages\n",reserved); 85 printk("%d reserved pages\n", reserved);
86 printk("%d pages shared\n",shared); 86 printk("%d pages shared\n", shared);
87 printk("%d pages swap cached\n",cached); 87 printk("%d pages swap cached\n", cached);
88
89 printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
90 printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK));
91 printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
92 printk("%lu pages slab\n",
93 global_page_state(NR_SLAB_RECLAIMABLE) +
94 global_page_state(NR_SLAB_UNRECLAIMABLE));
95 printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE));
88} 96}
89 97
90static void __init setup_ro_region(void) 98static void __init setup_ro_region(void)
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 7b1122417050..883b03b040c4 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -39,7 +39,7 @@ cflags-$(CONFIG_CPU_SH2A) := -m2a $(call cc-option,-m2a-nofpu,)
39cflags-$(CONFIG_CPU_SH3) := -m3 39cflags-$(CONFIG_CPU_SH3) := -m3
40cflags-$(CONFIG_CPU_SH4) := -m4 \ 40cflags-$(CONFIG_CPU_SH4) := -m4 \
41 $(call cc-option,-mno-implicit-fp,-m4-nofpu) 41 $(call cc-option,-mno-implicit-fp,-m4-nofpu)
42cflags-$(CONFIG_CPU_SH4A) := -m4a $(call cc-option,-m4a-nofpu,) 42cflags-$(CONFIG_CPU_SH4A) := $(call cc-option,-m4a,) $(call cc-option,-m4a-nofpu,)
43 43
44cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb 44cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb
45cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml 45cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml
diff --git a/arch/sh/boards/landisk/gio.c b/arch/sh/boards/landisk/gio.c
index 50d38be62f01..a37643d002b2 100644
--- a/arch/sh/boards/landisk/gio.c
+++ b/arch/sh/boards/landisk/gio.c
@@ -69,7 +69,7 @@ static int gio_ioctl(struct inode *inode, struct file *filp,
69 } 69 }
70 70
71 switch (cmd) { 71 switch (cmd) {
72 case GIODRV_IOCSGIOSETADDR: /* addres set */ 72 case GIODRV_IOCSGIOSETADDR: /* address set */
73 addr = data; 73 addr = data;
74 break; 74 break;
75 75
diff --git a/arch/sh/boards/landisk/setup.c b/arch/sh/boards/landisk/setup.c
index 4058b4f50d44..f953c7427769 100644
--- a/arch/sh/boards/landisk/setup.c
+++ b/arch/sh/boards/landisk/setup.c
@@ -44,8 +44,14 @@ static struct platform_device cf_ide_device = {
44 }, 44 },
45}; 45};
46 46
47static struct platform_device rtc_device = {
48 .name = "rs5c313",
49 .id = -1,
50};
51
47static struct platform_device *landisk_devices[] __initdata = { 52static struct platform_device *landisk_devices[] __initdata = {
48 &cf_ide_device, 53 &cf_ide_device,
54 &rtc_device,
49}; 55};
50 56
51static int __init landisk_devices_setup(void) 57static int __init landisk_devices_setup(void)
diff --git a/arch/sh/boards/renesas/r7780rp/Makefile b/arch/sh/boards/renesas/r7780rp/Makefile
index 609e5d50dde8..b1d20afb4eb3 100644
--- a/arch/sh/boards/renesas/r7780rp/Makefile
+++ b/arch/sh/boards/renesas/r7780rp/Makefile
@@ -3,5 +3,8 @@
3# 3#
4irqinit-y := irq-r7780rp.o 4irqinit-y := irq-r7780rp.o
5irqinit-$(CONFIG_SH_R7785RP) := irq-r7785rp.o 5irqinit-$(CONFIG_SH_R7785RP) := irq-r7785rp.o
6obj-y := setup.o irq.o $(irqinit-y)
7
8ifneq ($(CONFIG_SH_R7785RP),y)
6obj-$(CONFIG_PUSH_SWITCH) += psw.o 9obj-$(CONFIG_PUSH_SWITCH) += psw.o
7obj-y := setup.o irq.o $(irqinit-y) 10endif
diff --git a/arch/sh/boards/snapgear/rtc.c b/arch/sh/boards/snapgear/rtc.c
index 1659fdd6695a..edb3dd936cbb 100644
--- a/arch/sh/boards/snapgear/rtc.c
+++ b/arch/sh/boards/snapgear/rtc.c
@@ -108,7 +108,7 @@ static void ds1302_writebyte(unsigned int addr, unsigned int val)
108static void ds1302_reset(void) 108static void ds1302_reset(void)
109{ 109{
110 unsigned long flags; 110 unsigned long flags;
111 /* Hardware dependant reset/init */ 111 /* Hardware dependent reset/init */
112 local_irq_save(flags); 112 local_irq_save(flags);
113 set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK); 113 set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK);
114 set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK)); 114 set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK));
diff --git a/arch/sh/boards/superh/microdev/io.c b/arch/sh/boards/superh/microdev/io.c
index 83419bf4c834..b704e20d7e4d 100644
--- a/arch/sh/boards/superh/microdev/io.c
+++ b/arch/sh/boards/superh/microdev/io.c
@@ -198,12 +198,12 @@ void microdev_outb(unsigned char b, unsigned long port)
198 /* 198 /*
199 * There is a board feature with the current SH4-202 MicroDev in 199 * There is a board feature with the current SH4-202 MicroDev in
200 * that the 2 byte enables (nBE0 and nBE1) are tied together (and 200 * that the 2 byte enables (nBE0 and nBE1) are tied together (and
201 * to the Chip Select Line (Ethernet_CS)). Due to this conectivity, 201 * to the Chip Select Line (Ethernet_CS)). Due to this connectivity,
202 * it is not possible to safely perform 8-bit writes to the 202 * it is not possible to safely perform 8-bit writes to the
203 * Ethernet registers, as 16-bits will be consumed from the Data 203 * Ethernet registers, as 16-bits will be consumed from the Data
204 * lines (corrupting the other byte). Hence, this function is 204 * lines (corrupting the other byte). Hence, this function is
205 * written to impliment 16-bit read/modify/write for all byte-wide 205 * written to implement 16-bit read/modify/write for all byte-wide
206 * acceses. 206 * accesses.
207 * 207 *
208 * Note: there is no problem with byte READS (even or odd). 208 * Note: there is no problem with byte READS (even or odd).
209 * 209 *
diff --git a/arch/sh/boards/superh/microdev/irq.c b/arch/sh/boards/superh/microdev/irq.c
index 8c64baa30364..cc1cb04fa618 100644
--- a/arch/sh/boards/superh/microdev/irq.c
+++ b/arch/sh/boards/superh/microdev/irq.c
@@ -100,7 +100,7 @@ static void disable_microdev_irq(unsigned int irq)
100 100
101 fpgaIrq = fpgaIrqTable[irq].fpgaIrq; 101 fpgaIrq = fpgaIrqTable[irq].fpgaIrq;
102 102
103 /* disable interupts on the FPGA INTC register */ 103 /* disable interrupts on the FPGA INTC register */
104 ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG); 104 ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG);
105} 105}
106 106
@@ -125,7 +125,7 @@ static void enable_microdev_irq(unsigned int irq)
125 priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri); 125 priorities |= MICRODEV_FPGA_INTPRI_LEVEL(fpgaIrq, pri);
126 ctrl_outl(priorities, priorityReg); 126 ctrl_outl(priorities, priorityReg);
127 127
128 /* enable interupts on the FPGA INTC register */ 128 /* enable interrupts on the FPGA INTC register */
129 ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG); 129 ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG);
130} 130}
131 131
@@ -152,7 +152,7 @@ extern void __init init_microdev_irq(void)
152{ 152{
153 int i; 153 int i;
154 154
155 /* disable interupts on the FPGA INTC register */ 155 /* disable interrupts on the FPGA INTC register */
156 ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG); 156 ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG);
157 157
158 for (i = 0; i < NUM_EXTERNAL_IRQS; i++) 158 for (i = 0; i < NUM_EXTERNAL_IRQS; i++)
diff --git a/arch/sh/boards/superh/microdev/setup.c b/arch/sh/boards/superh/microdev/setup.c
index 031c814e6e76..6396cea1c896 100644
--- a/arch/sh/boards/superh/microdev/setup.c
+++ b/arch/sh/boards/superh/microdev/setup.c
@@ -349,7 +349,7 @@ static int __init smsc_superio_setup(void)
349 SMSC_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */ 349 SMSC_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
350 SMSC_WRITE_INDEXED(0x08, 0xe8); /* GP20 = nIDE2_OE */ 350 SMSC_WRITE_INDEXED(0x08, 0xe8); /* GP20 = nIDE2_OE */
351 351
352 /* Exit the configuraton state */ 352 /* Exit the configuration state */
353 outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR); 353 outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
354 354
355 return 0; 355 return 0;
diff --git a/arch/sh/boards/unknown/setup.c b/arch/sh/boards/unknown/setup.c
index 1c941370a2e3..bee4612de59b 100644
--- a/arch/sh/boards/unknown/setup.c
+++ b/arch/sh/boards/unknown/setup.c
@@ -6,7 +6,7 @@
6 * May be copied or modified under the terms of the GNU General Public 6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information. 7 * License. See linux/COPYING for more information.
8 * 8 *
9 * Setup code for an unknown machine (internal peripherials only) 9 * Setup code for an unknown machine (internal peripherals only)
10 * 10 *
11 * This is the simplest of all boards, and serves only as a quick and dirty 11 * This is the simplest of all boards, and serves only as a quick and dirty
12 * method to start debugging a new board during bring-up until proper board 12 * method to start debugging a new board during bring-up until proper board
diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c
index e062067edd24..cf8e11994330 100644
--- a/arch/sh/drivers/dma/dma-api.c
+++ b/arch/sh/drivers/dma/dma-api.c
@@ -16,6 +16,7 @@
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/sched.h>
19#include <asm/dma.h> 20#include <asm/dma.h>
20 21
21DEFINE_SPINLOCK(dma_spin_lock); 22DEFINE_SPINLOCK(dma_spin_lock);
@@ -115,7 +116,7 @@ static int search_cap(const char **haystack, const char *needle)
115/** 116/**
116 * request_dma_bycap - Allocate a DMA channel based on its capabilities 117 * request_dma_bycap - Allocate a DMA channel based on its capabilities
117 * @dmac: List of DMA controllers to search 118 * @dmac: List of DMA controllers to search
118 * @caps: List of capabilites 119 * @caps: List of capabilities
119 * 120 *
120 * Search all channels of all DMA controllers to find a channel which 121 * Search all channels of all DMA controllers to find a channel which
121 * matches the requested capabilities. The result is the channel 122 * matches the requested capabilities. The result is the channel
diff --git a/arch/sh/drivers/dma/dma-isa.c b/arch/sh/drivers/dma/dma-isa.c
index 05a74ffdb68d..5fb044b791c3 100644
--- a/arch/sh/drivers/dma/dma-isa.c
+++ b/arch/sh/drivers/dma/dma-isa.c
@@ -28,7 +28,7 @@
28 * NOTE: ops->xfer() is the preferred way of doing things. However, there 28 * NOTE: ops->xfer() is the preferred way of doing things. However, there
29 * are some users of the ISA DMA API that exist in common code that we 29 * are some users of the ISA DMA API that exist in common code that we
30 * don't necessarily want to go out of our way to break, so we still 30 * don't necessarily want to go out of our way to break, so we still
31 * allow for some compatability at that level. Any new code is strongly 31 * allow for some compatibility at that level. Any new code is strongly
32 * advised to run far away from the ISA DMA API and use the SH DMA API 32 * advised to run far away from the ISA DMA API and use the SH DMA API
33 * directly. 33 * directly.
34 */ 34 */
diff --git a/arch/sh/drivers/dma/dmabrg.c b/arch/sh/drivers/dma/dmabrg.c
index 9d0a29370f21..5e22689c2fcf 100644
--- a/arch/sh/drivers/dma/dmabrg.c
+++ b/arch/sh/drivers/dma/dmabrg.c
@@ -33,7 +33,7 @@
33 * 9 | HAC1/SSI1 | rec | half done | DMABRGI2 33 * 9 | HAC1/SSI1 | rec | half done | DMABRGI2
34 * 34 *
35 * all can be enabled/disabled in the DMABRGCR register, 35 * all can be enabled/disabled in the DMABRGCR register,
36 * as well as checked if they occured. 36 * as well as checked if they occurred.
37 * 37 *
38 * DMABRGI0 services USB DMA Address errors, but it still must be 38 * DMABRGI0 services USB DMA Address errors, but it still must be
39 * enabled/acked in the DMABRGCR register. USB-DMA complete indicator 39 * enabled/acked in the DMABRGCR register. USB-DMA complete indicator
diff --git a/arch/sh/drivers/pci/ops-dreamcast.c b/arch/sh/drivers/pci/ops-dreamcast.c
index 381306cf5425..e1284fc69361 100644
--- a/arch/sh/drivers/pci/ops-dreamcast.c
+++ b/arch/sh/drivers/pci/ops-dreamcast.c
@@ -57,7 +57,7 @@ struct pci_channel board_pci_channels[] = {
57 * 57 *
58 * Also, we could very easily support both Type 0 and Type 1 configurations 58 * Also, we could very easily support both Type 0 and Type 1 configurations
59 * here, but since it doesn't seem that there is any such implementation in 59 * here, but since it doesn't seem that there is any such implementation in
60 * existance, we don't bother. 60 * existence, we don't bother.
61 * 61 *
62 * I suppose if someone actually gets around to ripping the chip out of 62 * I suppose if someone actually gets around to ripping the chip out of
63 * the BBA and hanging some more devices off of it, then this might be 63 * the BBA and hanging some more devices off of it, then this might be
diff --git a/arch/sh/drivers/pci/pci-st40.c b/arch/sh/drivers/pci/pci-st40.c
index d67656a44b15..543417ff8314 100644
--- a/arch/sh/drivers/pci/pci-st40.c
+++ b/arch/sh/drivers/pci/pci-st40.c
@@ -292,7 +292,7 @@ int __init st40pci_init(unsigned memStart, unsigned memSize)
292 PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | 292 PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
293 PCI_COMMAND_IO); 293 PCI_COMMAND_IO);
294 294
295 /* Accesse to the 0xb0000000 -> 0xb6000000 area will go through to 0x10000000 -> 0x16000000 295 /* Access to the 0xb0000000 -> 0xb6000000 area will go through to 0x10000000 -> 0x16000000
296 * on the PCI bus. This allows a nice 1-1 bus to phys mapping. 296 * on the PCI bus. This allows a nice 1-1 bus to phys mapping.
297 */ 297 */
298 298
@@ -315,7 +315,7 @@ int __init st40pci_init(unsigned memStart, unsigned memSize)
315 ST40PCI_WRITE(CSR_MBAR0, 0); 315 ST40PCI_WRITE(CSR_MBAR0, 0);
316 ST40PCI_WRITE(LSR0, 0x0fff0001); 316 ST40PCI_WRITE(LSR0, 0x0fff0001);
317 317
318 /* ... and set up the initial incomming window to expose all of RAM */ 318 /* ... and set up the initial incoming window to expose all of RAM */
319 pci_set_rbar_region(7, memStart, memStart, memSize); 319 pci_set_rbar_region(7, memStart, memStart, memSize);
320 320
321 /* Maximise timeout values */ 321 /* Maximise timeout values */
@@ -473,7 +473,7 @@ static void pci_set_rbar_region(unsigned int region, unsigned long localAddr
473 473
474 mask = r2p2(regionSize) - 0x10000; 474 mask = r2p2(regionSize) - 0x10000;
475 475
476 /* Diable the region (in case currently in use, should never happen) */ 476 /* Disable the region (in case currently in use, should never happen) */
477 ST40PCI_WRITE_INDEXED(RSR, region, 0); 477 ST40PCI_WRITE_INDEXED(RSR, region, 0);
478 478
479 /* Start of local address space to publish */ 479 /* Start of local address space to publish */
diff --git a/arch/sh/drivers/pci/pci-st40.h b/arch/sh/drivers/pci/pci-st40.h
index d729e0c2d5fe..cf0d35bd135c 100644
--- a/arch/sh/drivers/pci/pci-st40.h
+++ b/arch/sh/drivers/pci/pci-st40.h
@@ -4,7 +4,7 @@
4 * May be copied or modified under the terms of the GNU General Public 4 * May be copied or modified under the terms of the GNU General Public
5 * License. See linux/COPYING for more information. 5 * License. See linux/COPYING for more information.
6 * 6 *
7 * Defintions for the ST40 PCI hardware. 7 * Definitions for the ST40 PCI hardware.
8 */ 8 */
9 9
10#ifndef __PCI_ST40_H__ 10#ifndef __PCI_ST40_H__
diff --git a/arch/sh/drivers/superhyway/ops-sh4-202.c b/arch/sh/drivers/superhyway/ops-sh4-202.c
index a55c98a9052b..3b14bf860db6 100644
--- a/arch/sh/drivers/superhyway/ops-sh4-202.c
+++ b/arch/sh/drivers/superhyway/ops-sh4-202.c
@@ -130,7 +130,7 @@ static int sh4202_read_vcr(unsigned long base, struct superhyway_vcr_info *vcr)
130 * Some modules (PBR and ePBR for instance) also appear to have 130 * Some modules (PBR and ePBR for instance) also appear to have
131 * VCRL/VCRH flipped in the documentation, but on the SH4-202 131 * VCRL/VCRH flipped in the documentation, but on the SH4-202
132 * itself it appears that these are all consistently mapped with 132 * itself it appears that these are all consistently mapped with
133 * VCRH preceeding VCRL. 133 * VCRH preceding VCRL.
134 * 134 *
135 * Do not trust the documentation, for it is evil. 135 * Do not trust the documentation, for it is evil.
136 */ 136 */
diff --git a/arch/sh/kernel/cf-enabler.c b/arch/sh/kernel/cf-enabler.c
index 0758d48147a0..ebc73b85094a 100644
--- a/arch/sh/kernel/cf-enabler.c
+++ b/arch/sh/kernel/cf-enabler.c
@@ -12,6 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/vmalloc.h> 14#include <linux/vmalloc.h>
15#include <linux/interrupt.h>
15#include <asm/io.h> 16#include <asm/io.h>
16#include <asm/irq.h> 17#include <asm/irq.h>
17 18
@@ -31,7 +32,7 @@
31 */ 32 */
32#if defined(CONFIG_CPU_SH4) 33#if defined(CONFIG_CPU_SH4)
33/* SH4 can't access PCMCIA interface through P2 area. 34/* SH4 can't access PCMCIA interface through P2 area.
34 * we must remap it with appropreate attribute bit of the page set. 35 * we must remap it with appropriate attribute bit of the page set.
35 * this part is based on Greg Banks' hd64465_ss.c implementation - Masahiro Abe */ 36 * this part is based on Greg Banks' hd64465_ss.c implementation - Masahiro Abe */
36 37
37#if defined(CONFIG_CF_AREA6) 38#if defined(CONFIG_CF_AREA6)
@@ -149,6 +150,11 @@ static int __init cf_init_se(void)
149 ctrl_outb(0x42, PA_MRSHPC_MW2 + 0x200); 150 ctrl_outb(0x42, PA_MRSHPC_MW2 + 0x200);
150 return 0; 151 return 0;
151} 152}
153#else
154static int __init cf_init_se(void)
155{
156 return -1;
157}
152#endif 158#endif
153 159
154int __init cf_init(void) 160int __init cf_init(void)
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 014f318f5a05..63251549e9a8 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -278,6 +278,11 @@ arch_init_clk_ops(struct clk_ops **ops, int type)
278{ 278{
279} 279}
280 280
281void __init __attribute__ ((weak))
282arch_clk_init(void)
283{
284}
285
281static int show_clocks(char *buf, char **start, off_t off, 286static int show_clocks(char *buf, char **start, off_t off,
282 int len, int *eof, void *data) 287 int len, int *eof, void *data)
283{ 288{
@@ -314,6 +319,8 @@ int __init clk_init(void)
314 ret |= clk_register(clk); 319 ret |= clk_register(clk);
315 } 320 }
316 321
322 arch_clk_init();
323
317 /* Kick the child clocks.. */ 324 /* Kick the child clocks.. */
318 propagate_rate(&master_clk); 325 propagate_rate(&master_clk);
319 propagate_rate(&bus_clk); 326 propagate_rate(&bus_clk);
diff --git a/arch/sh/kernel/cpu/irq/maskreg.c b/arch/sh/kernel/cpu/irq/maskreg.c
index 492db31b3cab..978992e367a5 100644
--- a/arch/sh/kernel/cpu/irq/maskreg.c
+++ b/arch/sh/kernel/cpu/irq/maskreg.c
@@ -38,7 +38,7 @@ static struct hw_interrupt_type maskreg_irq_type = {
38 .end = end_maskreg_irq 38 .end = end_maskreg_irq
39}; 39};
40 40
41/* actual implementatin */ 41/* actual implementation */
42static unsigned int startup_maskreg_irq(unsigned int irq) 42static unsigned int startup_maskreg_irq(unsigned int irq)
43{ 43{
44 enable_maskreg_irq(irq); 44 enable_maskreg_irq(irq);
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S
index 832c0b4a1e6c..659cc081e5e7 100644
--- a/arch/sh/kernel/cpu/sh3/entry.S
+++ b/arch/sh/kernel/cpu/sh3/entry.S
@@ -320,6 +320,7 @@ skip_restore:
320 320
321 .align 2 321 .align 2
3225: .long 0x00001000 ! DSP 3225: .long 0x00001000 ! DSP
3236: .long in_nmi
3237: .long 0x30000000 3247: .long 0x30000000
324 325
325! common exception handler 326! common exception handler
diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c
index d61dd599169f..c5a4fc77fa06 100644
--- a/arch/sh/kernel/cpu/sh4/fpu.c
+++ b/arch/sh/kernel/cpu/sh4/fpu.c
@@ -138,7 +138,7 @@ restore_fpu(struct task_struct *tsk)
138/* 138/*
139 * Load the FPU with signalling NANS. This bit pattern we're using 139 * Load the FPU with signalling NANS. This bit pattern we're using
140 * has the property that no matter wether considered as single or as 140 * has the property that no matter wether considered as single or as
141 * double precission represents signaling NANS. 141 * double precision represents signaling NANS.
142 */ 142 */
143 143
144static void 144static void
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c
index 8cd04904c77a..fab2eb07196b 100644
--- a/arch/sh/kernel/cpu/sh4/probe.c
+++ b/arch/sh/kernel/cpu/sh4/probe.c
@@ -12,6 +12,7 @@
12 */ 12 */
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/smp.h>
15#include <asm/processor.h> 16#include <asm/processor.h>
16#include <asm/cache.h> 17#include <asm/cache.h>
17 18
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
index 6f8f458912c7..03b14cf78ddf 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
@@ -106,6 +106,7 @@ static struct ipr_data sh7750_ipr_map[] = {
106 { 38, 2, 8, 7 }, /* DMAC DMAE */ 106 { 38, 2, 8, 7 }, /* DMAC DMAE */
107}; 107};
108 108
109#ifdef CONFIG_CPU_SUBTYPE_SH7751
109static struct ipr_data sh7751_ipr_map[] = { 110static struct ipr_data sh7751_ipr_map[] = {
110 { 44, 2, 8, 7 }, /* DMAC DMTE4 */ 111 { 44, 2, 8, 7 }, /* DMAC DMTE4 */
111 { 45, 2, 8, 7 }, /* DMAC DMTE5 */ 112 { 45, 2, 8, 7 }, /* DMAC DMTE5 */
@@ -117,6 +118,7 @@ static struct ipr_data sh7751_ipr_map[] = {
117 /*{ 72, INTPRI00, 8, ? },*/ /* TMU3 TUNI */ 118 /*{ 72, INTPRI00, 8, ? },*/ /* TMU3 TUNI */
118 /*{ 76, INTPRI00, 12, ? },*/ /* TMU4 TUNI */ 119 /*{ 76, INTPRI00, 12, ? },*/ /* TMU4 TUNI */
119}; 120};
121#endif
120 122
121static unsigned long ipr_offsets[] = { 123static unsigned long ipr_offsets[] = {
122 0xffd00004UL, /* 0: IPRA */ 124 0xffd00004UL, /* 0: IPRA */
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index 29090035bc5b..51b386d454de 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -17,7 +17,6 @@
17#include <asm/clock.h> 17#include <asm/clock.h>
18#include <asm/freq.h> 18#include <asm/freq.h>
19 19
20#define SH7722_PLL_FREQ (32000000/8)
21#define N (-1) 20#define N (-1)
22#define NM (-2) 21#define NM (-2)
23#define ROUND_NEAREST 0 22#define ROUND_NEAREST 0
@@ -141,28 +140,36 @@ static void adjust_clocks(int originate, int *l, unsigned long v[],
141*/ 140*/
142static int divisors2[] = { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40 }; 141static int divisors2[] = { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40 };
143 142
143static void master_clk_recalc(struct clk *clk)
144{
145 unsigned frqcr = ctrl_inl(FRQCR);
146
147 clk->rate = CONFIG_SH_PCLK_FREQ * (((frqcr >> 24) & 0x1f) + 1);
148}
149
144static void master_clk_init(struct clk *clk) 150static void master_clk_init(struct clk *clk)
145{ 151{
146 clk_set_rate(clk, clk_get_rate(clk)); 152 clk->parent = NULL;
153 clk->flags |= CLK_RATE_PROPAGATES;
154 clk->rate = CONFIG_SH_PCLK_FREQ;
155 master_clk_recalc(clk);
147} 156}
148 157
149static void master_clk_recalc(struct clk *clk) 158
159static void module_clk_recalc(struct clk *clk)
150{ 160{
151 unsigned long frqcr = ctrl_inl(FRQCR); 161 unsigned long frqcr = ctrl_inl(FRQCR);
152 162
153 clk->rate = CONFIG_SH_PCLK_FREQ * (1 + (frqcr >> 24 & 0xF)); 163 clk->rate = clk->parent->rate / (((frqcr >> 24) & 0x1f) + 1);
154} 164}
155 165
156static int master_clk_setrate(struct clk *clk, unsigned long rate, int id) 166static int master_clk_setrate(struct clk *clk, unsigned long rate, int id)
157{ 167{
158 int div = rate / SH7722_PLL_FREQ; 168 int div = rate / clk->rate;
159 int master_divs[] = { 2, 3, 4, 6, 8, 16 }; 169 int master_divs[] = { 2, 3, 4, 6, 8, 16 };
160 int index; 170 int index;
161 unsigned long frqcr; 171 unsigned long frqcr;
162 172
163 if (rate < SH7722_PLL_FREQ * 2)
164 return -EINVAL;
165
166 for (index = 1; index < ARRAY_SIZE(master_divs); index++) 173 for (index = 1; index < ARRAY_SIZE(master_divs); index++)
167 if (div >= master_divs[index - 1] && div < master_divs[index]) 174 if (div >= master_divs[index - 1] && div < master_divs[index])
168 break; 175 break;
@@ -185,6 +192,10 @@ static struct clk_ops sh7722_master_clk_ops = {
185 .set_rate = master_clk_setrate, 192 .set_rate = master_clk_setrate,
186}; 193};
187 194
195static struct clk_ops sh7722_module_clk_ops = {
196 .recalc = module_clk_recalc,
197};
198
188struct frqcr_context { 199struct frqcr_context {
189 unsigned mask; 200 unsigned mask;
190 unsigned shift; 201 unsigned shift;
@@ -489,7 +500,7 @@ static void sh7722_siu_recalc(struct clk *clk)
489 500
490 if (siu < 0) 501 if (siu < 0)
491 return /* siu */ ; 502 return /* siu */ ;
492 BUG_ON(siu > 1); 503 BUG_ON(siu > 2);
493 r = ctrl_inl(sh7722_siu_regs[siu]); 504 r = ctrl_inl(sh7722_siu_regs[siu]);
494 clk->rate = clk->parent->rate * 2 / divisors2[r & 0xF]; 505 clk->rate = clk->parent->rate * 2 / divisors2[r & 0xF];
495} 506}
@@ -571,7 +582,7 @@ static struct clk *sh7722_clocks[] = {
571 */ 582 */
572struct clk_ops *onchip_ops[] = { 583struct clk_ops *onchip_ops[] = {
573 &sh7722_master_clk_ops, 584 &sh7722_master_clk_ops,
574 &sh7722_frqcr_clk_ops, 585 &sh7722_module_clk_ops,
575 &sh7722_frqcr_clk_ops, 586 &sh7722_frqcr_clk_ops,
576 &sh7722_frqcr_clk_ops, 587 &sh7722_frqcr_clk_ops,
577}; 588};
@@ -583,7 +594,7 @@ arch_init_clk_ops(struct clk_ops **ops, int type)
583 *ops = onchip_ops[type]; 594 *ops = onchip_ops[type];
584} 595}
585 596
586int __init sh7722_clock_init(void) 597int __init arch_clk_init(void)
587{ 598{
588 struct clk *master; 599 struct clk *master;
589 int i; 600 int i;
@@ -597,4 +608,3 @@ int __init sh7722_clock_init(void)
597 clk_put(master); 608 clk_put(master);
598 return 0; 609 return 0;
599} 610}
600arch_initcall(sh7722_clock_init);
diff --git a/arch/sh/kernel/kgdb_stub.c b/arch/sh/kernel/kgdb_stub.c
index a5323364cbca..edd1ec214e6d 100644
--- a/arch/sh/kernel/kgdb_stub.c
+++ b/arch/sh/kernel/kgdb_stub.c
@@ -2,7 +2,7 @@
2 * May be copied or modified under the terms of the GNU General Public 2 * May be copied or modified under the terms of the GNU General Public
3 * License. See linux/COPYING for more information. 3 * License. See linux/COPYING for more information.
4 * 4 *
5 * Containes extracts from code by Glenn Engel, Jim Kingdon, 5 * Contains extracts from code by Glenn Engel, Jim Kingdon,
6 * David Grothe <dave@gcom.com>, Tigran Aivazian <tigran@sco.com>, 6 * David Grothe <dave@gcom.com>, Tigran Aivazian <tigran@sco.com>,
7 * Amit S. Kale <akale@veritas.com>, William Gatliff <bgat@open-widgets.com>, 7 * Amit S. Kale <akale@veritas.com>, William Gatliff <bgat@open-widgets.com>,
8 * Ben Lee, Steve Chamberlain and Benoit Miller <fulg@iname.com>. 8 * Ben Lee, Steve Chamberlain and Benoit Miller <fulg@iname.com>.
@@ -85,7 +85,7 @@
85 * 85 *
86 * Responses can be run-length encoded to save space. A '*' means that 86 * Responses can be run-length encoded to save space. A '*' means that
87 * the next character is an ASCII encoding giving a repeat count which 87 * the next character is an ASCII encoding giving a repeat count which
88 * stands for that many repititions of the character preceding the '*'. 88 * stands for that many repetitions of the character preceding the '*'.
89 * The encoding is n+29, yielding a printable character where n >=3 89 * The encoding is n+29, yielding a printable character where n >=3
90 * (which is where RLE starts to win). Don't use an n > 126. 90 * (which is where RLE starts to win). Don't use an n > 126.
91 * 91 *
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 6b4f5748d0be..a11e2aa73cbc 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -26,8 +26,6 @@
26static int hlt_counter; 26static int hlt_counter;
27int ubc_usercnt = 0; 27int ubc_usercnt = 0;
28 28
29#define HARD_IDLE_TIMEOUT (HZ / 3)
30
31void (*pm_idle)(void); 29void (*pm_idle)(void);
32void (*pm_power_off)(void); 30void (*pm_power_off)(void);
33EXPORT_SYMBOL(pm_power_off); 31EXPORT_SYMBOL(pm_power_off);
@@ -44,16 +42,39 @@ void enable_hlt(void)
44} 42}
45EXPORT_SYMBOL(enable_hlt); 43EXPORT_SYMBOL(enable_hlt);
46 44
45static int __init nohlt_setup(char *__unused)
46{
47 hlt_counter = 1;
48 return 1;
49}
50__setup("nohlt", nohlt_setup);
51
52static int __init hlt_setup(char *__unused)
53{
54 hlt_counter = 0;
55 return 1;
56}
57__setup("hlt", hlt_setup);
58
47void default_idle(void) 59void default_idle(void)
48{ 60{
49 if (!hlt_counter) 61 if (!hlt_counter) {
50 cpu_sleep(); 62 clear_thread_flag(TIF_POLLING_NRFLAG);
51 else 63 smp_mb__after_clear_bit();
52 cpu_relax(); 64 set_bl_bit();
65 while (!need_resched())
66 cpu_sleep();
67 clear_bl_bit();
68 set_thread_flag(TIF_POLLING_NRFLAG);
69 } else
70 while (!need_resched())
71 cpu_relax();
53} 72}
54 73
55void cpu_idle(void) 74void cpu_idle(void)
56{ 75{
76 set_thread_flag(TIF_POLLING_NRFLAG);
77
57 /* endless idle loop with no priority at all */ 78 /* endless idle loop with no priority at all */
58 while (1) { 79 while (1) {
59 void (*idle)(void) = pm_idle; 80 void (*idle)(void) = pm_idle;
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index dbebaddcfe39..283e1425ced5 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -10,6 +10,8 @@
10 * Free Software Foundation; either version 2 of the License, or (at your 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version. 11 * option) any later version.
12 */ 12 */
13
14#include <linux/err.h>
13#include <linux/cache.h> 15#include <linux/cache.h>
14#include <linux/cpumask.h> 16#include <linux/cpumask.h>
15#include <linux/delay.h> 17#include <linux/delay.h>
diff --git a/arch/sh/kernel/syscalls.S b/arch/sh/kernel/syscalls.S
index 4357d1a6358f..7db1c2dc5992 100644
--- a/arch/sh/kernel/syscalls.S
+++ b/arch/sh/kernel/syscalls.S
@@ -355,3 +355,6 @@ ENTRY(sys_call_table)
355 .long sys_getcpu 355 .long sys_getcpu
356 .long sys_epoll_pwait 356 .long sys_epoll_pwait
357 .long sys_utimensat /* 320 */ 357 .long sys_utimensat /* 320 */
358 .long sys_signalfd
359 .long sys_timerfd
360 .long sys_eventfd
diff --git a/arch/sh/kernel/timers/timer.c b/arch/sh/kernel/timers/timer.c
index a6bcc913d25e..4e7e747d1b69 100644
--- a/arch/sh/kernel/timers/timer.c
+++ b/arch/sh/kernel/timers/timer.c
@@ -13,7 +13,7 @@
13#include <linux/string.h> 13#include <linux/string.h>
14#include <asm/timer.h> 14#include <asm/timer.h>
15 15
16static struct sys_timer *sys_timers[] __initdata = { 16static struct sys_timer *sys_timers[] = {
17#ifdef CONFIG_SH_TMU 17#ifdef CONFIG_SH_TMU
18 &tmu_timer, 18 &tmu_timer,
19#endif 19#endif
@@ -26,7 +26,7 @@ static struct sys_timer *sys_timers[] __initdata = {
26 NULL, 26 NULL,
27}; 27};
28 28
29static char timer_override[10] __initdata; 29static char timer_override[10];
30static int __init timer_setup(char *str) 30static int __init timer_setup(char *str)
31{ 31{
32 if (str) 32 if (str)
@@ -53,4 +53,3 @@ struct sys_timer *get_sys_timer(void)
53 53
54 return NULL; 54 return NULL;
55} 55}
56
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index 3a197649cd83..5b75cb6f8f9b 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -21,6 +21,7 @@
21#include <linux/bug.h> 21#include <linux/bug.h>
22#include <linux/debug_locks.h> 22#include <linux/debug_locks.h>
23#include <linux/kdebug.h> 23#include <linux/kdebug.h>
24#include <linux/kexec.h>
24#include <linux/limits.h> 25#include <linux/limits.h>
25#include <asm/system.h> 26#include <asm/system.h>
26#include <asm/uaccess.h> 27#include <asm/uaccess.h>
@@ -101,6 +102,16 @@ void die(const char * str, struct pt_regs * regs, long err)
101 102
102 bust_spinlocks(0); 103 bust_spinlocks(0);
103 spin_unlock_irq(&die_lock); 104 spin_unlock_irq(&die_lock);
105
106 if (kexec_should_crash(current))
107 crash_kexec(regs);
108
109 if (in_interrupt())
110 panic("Fatal exception in interrupt");
111
112 if (panic_on_oops)
113 panic("Fatal exception");
114
104 do_exit(SIGSEGV); 115 do_exit(SIGSEGV);
105} 116}
106 117
@@ -513,7 +524,7 @@ static int handle_unaligned_access(u16 instruction, struct pt_regs *regs)
513 * misaligned data access 524 * misaligned data access
514 * access to >= 0x80000000 is user mode 525 * access to >= 0x80000000 is user mode
515 * Unfortuntaly we can't distinguish between instruction address error 526 * Unfortuntaly we can't distinguish between instruction address error
516 * and data address errors caused by read acceses. 527 * and data address errors caused by read accesses.
517 */ 528 */
518asmlinkage void do_address_error(struct pt_regs *regs, 529asmlinkage void do_address_error(struct pt_regs *regs,
519 unsigned long writeaccess, 530 unsigned long writeaccess,
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index d83143cc5ca9..4c5b57e9c3c1 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -22,7 +22,7 @@ SECTIONS
22 *(.empty_zero_page) 22 *(.empty_zero_page)
23 } = 0 23 } = 0
24 .text : { 24 .text : {
25 *(.text) 25 TEXT_TEXT
26 SCHED_TEXT 26 SCHED_TEXT
27 LOCK_TEXT 27 LOCK_TEXT
28 *(.fixup) 28 *(.fixup)
@@ -41,7 +41,7 @@ SECTIONS
41 BUG_TABLE 41 BUG_TABLE
42 42
43 .data : { /* Data */ 43 .data : { /* Data */
44 *(.data) 44 DATA_DATA
45 45
46 /* Align the initial ramdisk image (INITRD) on page boundaries. */ 46 /* Align the initial ramdisk image (INITRD) on page boundaries. */
47 . = ALIGN(PAGE_SIZE); 47 . = ALIGN(PAGE_SIZE);
diff --git a/arch/sh/kernel/vsyscall/vsyscall.c b/arch/sh/kernel/vsyscall/vsyscall.c
index e146bafcd14f..2aa9438361bc 100644
--- a/arch/sh/kernel/vsyscall/vsyscall.c
+++ b/arch/sh/kernel/vsyscall/vsyscall.c
@@ -17,6 +17,7 @@
17#include <linux/gfp.h> 17#include <linux/gfp.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/elf.h> 19#include <linux/elf.h>
20#include <linux/sched.h>
20 21
21/* 22/*
22 * Should the kernel map a VDSO page into processes and pass its 23 * Should the kernel map a VDSO page into processes and pass its
diff --git a/arch/sh/math-emu/math.c b/arch/sh/math-emu/math.c
index 1efbac15ff4e..a38e1eed9e77 100644
--- a/arch/sh/math-emu/math.c
+++ b/arch/sh/math-emu/math.c
@@ -148,7 +148,7 @@ fmac(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, int m, int n)
148 return 0; 148 return 0;
149} 149}
150 150
151// to process fmov's extention (odd n for DR access XD). 151// to process fmov's extension (odd n for DR access XD).
152#define FMOV_EXT(x) if(x&1) x+=16-1 152#define FMOV_EXT(x) if(x&1) x+=16-1
153 153
154static int 154static int
diff --git a/arch/sh/mm/copy_page.S b/arch/sh/mm/copy_page.S
index 397c94c97315..ae039f2da162 100644
--- a/arch/sh/mm/copy_page.S
+++ b/arch/sh/mm/copy_page.S
@@ -129,6 +129,7 @@ ENTRY(__copy_user_page)
129 rts 129 rts
130 nop 130 nop
131#endif 131#endif
132 .align 2
132.Lpsz: .long PAGE_SIZE 133.Lpsz: .long PAGE_SIZE
133/* 134/*
134 * __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); 135 * __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n);
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
index 9207da67ff8a..c878faa4ae46 100644
--- a/arch/sh/mm/fault.c
+++ b/arch/sh/mm/fault.c
@@ -15,43 +15,11 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/hardirq.h> 16#include <linux/hardirq.h>
17#include <linux/kprobes.h> 17#include <linux/kprobes.h>
18#include <linux/kdebug.h>
19#include <asm/system.h> 18#include <asm/system.h>
20#include <asm/mmu_context.h> 19#include <asm/mmu_context.h>
21#include <asm/tlbflush.h> 20#include <asm/tlbflush.h>
22#include <asm/kgdb.h> 21#include <asm/kgdb.h>
23 22
24#ifdef CONFIG_KPROBES
25ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain);
26
27/* Hook to register for page fault notifications */
28int register_page_fault_notifier(struct notifier_block *nb)
29{
30 return atomic_notifier_chain_register(&notify_page_fault_chain, nb);
31}
32
33int unregister_page_fault_notifier(struct notifier_block *nb)
34{
35 return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb);
36}
37
38static inline int notify_page_fault(enum die_val val, struct pt_regs *regs,
39 int trap, int sig)
40{
41 struct die_args args = {
42 .regs = regs,
43 .trapnr = trap,
44 };
45 return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
46}
47#else
48static inline int notify_page_fault(enum die_val val, struct pt_regs *regs,
49 int trap, int sig)
50{
51 return NOTIFY_DONE;
52}
53#endif
54
55/* 23/*
56 * This routine handles page faults. It determines the address, 24 * This routine handles page faults. It determines the address,
57 * and the problem, and then passes it off to one of the appropriate 25 * and the problem, and then passes it off to one of the appropriate
@@ -69,11 +37,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
69 siginfo_t info; 37 siginfo_t info;
70 38
71 trace_hardirqs_on(); 39 trace_hardirqs_on();
72
73 if (notify_page_fault(DIE_PAGE_FAULT, regs,
74 writeaccess, SIGSEGV) == NOTIFY_STOP)
75 return;
76
77 local_irq_enable(); 40 local_irq_enable();
78 41
79#ifdef CONFIG_SH_KGDB 42#ifdef CONFIG_SH_KGDB
@@ -285,7 +248,7 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
285 pte_t *pte; 248 pte_t *pte;
286 pte_t entry; 249 pte_t entry;
287 struct mm_struct *mm = current->mm; 250 struct mm_struct *mm = current->mm;
288 spinlock_t *ptl; 251 spinlock_t *ptl = NULL;
289 int ret = 1; 252 int ret = 1;
290 253
291#ifdef CONFIG_SH_KGDB 254#ifdef CONFIG_SH_KGDB
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 8fe223a890ed..e0e644ff3204 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -12,6 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/bootmem.h> 13#include <linux/bootmem.h>
14#include <linux/proc_fs.h> 14#include <linux/proc_fs.h>
15#include <linux/pagemap.h>
15#include <linux/percpu.h> 16#include <linux/percpu.h>
16#include <linux/io.h> 17#include <linux/io.h>
17#include <asm/mmu_context.h> 18#include <asm/mmu_context.h>
@@ -112,7 +113,7 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
112 * As a performance optimization, other platforms preserve the fixmap mapping 113 * As a performance optimization, other platforms preserve the fixmap mapping
113 * across a context switch, we don't presently do this, but this could be done 114 * across a context switch, we don't presently do this, but this could be done
114 * in a similar fashion as to the wired TLB interface that sh64 uses (by way 115 * in a similar fashion as to the wired TLB interface that sh64 uses (by way
115 * of the memorry mapped UTLB configuration) -- this unfortunately forces us to 116 * of the memory mapped UTLB configuration) -- this unfortunately forces us to
116 * give up a TLB entry for each mapping we want to preserve. While this may be 117 * give up a TLB entry for each mapping we want to preserve. While this may be
117 * viable for a small number of fixmaps, it's not particularly useful for 118 * viable for a small number of fixmaps, it's not particularly useful for
118 * everything and needs to be carefully evaluated. (ie, we may want this for 119 * everything and needs to be carefully evaluated. (ie, we may want this for
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index 02aae06527dc..b6a5a338145b 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Privileged Space Mapping Buffer (PMB) Support. 4 * Privileged Space Mapping Buffer (PMB) Support.
5 * 5 *
6 * Copyright (C) 2005, 2006 Paul Mundt 6 * Copyright (C) 2005, 2006, 2007 Paul Mundt
7 * 7 *
8 * P1/P2 Section mapping definitions from map32.h, which was: 8 * P1/P2 Section mapping definitions from map32.h, which was:
9 * 9 *
@@ -68,6 +68,32 @@ static inline unsigned long mk_pmb_data(unsigned int entry)
68 return mk_pmb_entry(entry) | PMB_DATA; 68 return mk_pmb_entry(entry) | PMB_DATA;
69} 69}
70 70
71static DEFINE_SPINLOCK(pmb_list_lock);
72static struct pmb_entry *pmb_list;
73
74static inline void pmb_list_add(struct pmb_entry *pmbe)
75{
76 struct pmb_entry **p, *tmp;
77
78 p = &pmb_list;
79 while ((tmp = *p) != NULL)
80 p = &tmp->next;
81
82 pmbe->next = tmp;
83 *p = pmbe;
84}
85
86static inline void pmb_list_del(struct pmb_entry *pmbe)
87{
88 struct pmb_entry **p, *tmp;
89
90 for (p = &pmb_list; (tmp = *p); p = &tmp->next)
91 if (tmp == pmbe) {
92 *p = tmp->next;
93 return;
94 }
95}
96
71struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, 97struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
72 unsigned long flags) 98 unsigned long flags)
73{ 99{
@@ -81,11 +107,19 @@ struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
81 pmbe->ppn = ppn; 107 pmbe->ppn = ppn;
82 pmbe->flags = flags; 108 pmbe->flags = flags;
83 109
110 spin_lock_irq(&pmb_list_lock);
111 pmb_list_add(pmbe);
112 spin_unlock_irq(&pmb_list_lock);
113
84 return pmbe; 114 return pmbe;
85} 115}
86 116
87void pmb_free(struct pmb_entry *pmbe) 117void pmb_free(struct pmb_entry *pmbe)
88{ 118{
119 spin_lock_irq(&pmb_list_lock);
120 pmb_list_del(pmbe);
121 spin_unlock_irq(&pmb_list_lock);
122
89 kmem_cache_free(pmb_cache, pmbe); 123 kmem_cache_free(pmb_cache, pmbe);
90} 124}
91 125
@@ -167,31 +201,6 @@ void clear_pmb_entry(struct pmb_entry *pmbe)
167 clear_bit(entry, &pmb_map); 201 clear_bit(entry, &pmb_map);
168} 202}
169 203
170static DEFINE_SPINLOCK(pmb_list_lock);
171static struct pmb_entry *pmb_list;
172
173static inline void pmb_list_add(struct pmb_entry *pmbe)
174{
175 struct pmb_entry **p, *tmp;
176
177 p = &pmb_list;
178 while ((tmp = *p) != NULL)
179 p = &tmp->next;
180
181 pmbe->next = tmp;
182 *p = pmbe;
183}
184
185static inline void pmb_list_del(struct pmb_entry *pmbe)
186{
187 struct pmb_entry **p, *tmp;
188
189 for (p = &pmb_list; (tmp = *p); p = &tmp->next)
190 if (tmp == pmbe) {
191 *p = tmp->next;
192 return;
193 }
194}
195 204
196static struct { 205static struct {
197 unsigned long size; 206 unsigned long size;
@@ -283,25 +292,14 @@ void pmb_unmap(unsigned long addr)
283 } while (pmbe); 292 } while (pmbe);
284} 293}
285 294
286static void pmb_cache_ctor(void *pmb, struct kmem_cache *cachep, unsigned long flags) 295static void pmb_cache_ctor(void *pmb, struct kmem_cache *cachep,
296 unsigned long flags)
287{ 297{
288 struct pmb_entry *pmbe = pmb; 298 struct pmb_entry *pmbe = pmb;
289 299
290 memset(pmb, 0, sizeof(struct pmb_entry)); 300 memset(pmb, 0, sizeof(struct pmb_entry));
291 301
292 spin_lock_irq(&pmb_list_lock);
293
294 pmbe->entry = PMB_NO_ENTRY; 302 pmbe->entry = PMB_NO_ENTRY;
295 pmb_list_add(pmbe);
296
297 spin_unlock_irq(&pmb_list_lock);
298}
299
300static void pmb_cache_dtor(void *pmb, struct kmem_cache *cachep, unsigned long flags)
301{
302 spin_lock_irq(&pmb_list_lock);
303 pmb_list_del(pmb);
304 spin_unlock_irq(&pmb_list_lock);
305} 303}
306 304
307static int __init pmb_init(void) 305static int __init pmb_init(void)
@@ -312,8 +310,7 @@ static int __init pmb_init(void)
312 BUG_ON(unlikely(nr_entries >= NR_PMB_ENTRIES)); 310 BUG_ON(unlikely(nr_entries >= NR_PMB_ENTRIES));
313 311
314 pmb_cache = kmem_cache_create("pmb", sizeof(struct pmb_entry), 0, 312 pmb_cache = kmem_cache_create("pmb", sizeof(struct pmb_entry), 0,
315 SLAB_PANIC, pmb_cache_ctor, 313 SLAB_PANIC, pmb_cache_ctor, NULL);
316 pmb_cache_dtor);
317 314
318 jump_to_P2(); 315 jump_to_P2();
319 316
diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types
index 554f801db67b..fb40f188aff9 100644
--- a/arch/sh/tools/mach-types
+++ b/arch/sh/tools/mach-types
@@ -7,8 +7,11 @@
7# 7#
8SE SH_SOLUTION_ENGINE 8SE SH_SOLUTION_ENGINE
97751SE SH_7751_SOLUTION_ENGINE 97751SE SH_7751_SOLUTION_ENGINE
107722SE SH_7722_SOLUTION_ENGINE
107300SE SH_7300_SOLUTION_ENGINE 117300SE SH_7300_SOLUTION_ENGINE
117343SE SH_7343_SOLUTION_ENGINE 127343SE SH_7343_SOLUTION_ENGINE
137206SE SH_7206_SOLUTION_ENGINE
147619SE SH_7619_SOLUTION_ENGINE
127780SE SH_7780_SOLUTION_ENGINE 157780SE SH_7780_SOLUTION_ENGINE
1373180SE SH_73180_SOLUTION_ENGINE 1673180SE SH_73180_SOLUTION_ENGINE
147751SYSTEMH SH_7751_SYSTEMH 177751SYSTEMH SH_7751_SYSTEMH
@@ -31,5 +34,3 @@ R7785RP SH_R7785RP
31TITAN SH_TITAN 34TITAN SH_TITAN
32SHMIN SH_SHMIN 35SHMIN SH_SHMIN
337710VOIPGW SH_7710VOIPGW 367710VOIPGW SH_7710VOIPGW
347206SE SH_7206_SOLUTION_ENGINE
357619SE SH_7619_SOLUTION_ENGINE
diff --git a/arch/sh64/kernel/vmlinux.lds.S b/arch/sh64/kernel/vmlinux.lds.S
index 4f9616f39830..02aea86c5907 100644
--- a/arch/sh64/kernel/vmlinux.lds.S
+++ b/arch/sh64/kernel/vmlinux.lds.S
@@ -54,7 +54,7 @@ SECTIONS
54 } = 0 54 } = 0
55 55
56 .text : C_PHYS(.text) { 56 .text : C_PHYS(.text) {
57 *(.text) 57 TEXT_TEXT
58 *(.text64) 58 *(.text64)
59 *(.text..SHmedia32) 59 *(.text..SHmedia32)
60 SCHED_TEXT 60 SCHED_TEXT
@@ -78,7 +78,7 @@ SECTIONS
78 _etext = .; /* End of text section */ 78 _etext = .; /* End of text section */
79 79
80 .data : C_PHYS(.data) { /* Data */ 80 .data : C_PHYS(.data) { /* Data */
81 *(.data) 81 DATA_DATA
82 CONSTRUCTORS 82 CONSTRUCTORS
83 } 83 }
84 84
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index bd992c0048f0..fbcc00c6c06e 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -178,6 +178,13 @@ config ARCH_HAS_ILOG2_U64
178 bool 178 bool
179 default n 179 default n
180 180
181config EMULATED_CMPXCHG
182 bool
183 default y
184 help
185 Sparc32 does not have a CAS instruction like sparc64. cmpxchg()
186 is emulated, and therefore it is not completely atomic.
187
181config SUN_PM 188config SUN_PM
182 bool 189 bool
183 default y 190 default y
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index f1401b57ccc7..7b4612da74a6 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -148,7 +148,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
148} 148}
149 149
150/* Kick start a stopped clock (procedure from the Sun NVRAM/hostid FAQ). */ 150/* Kick start a stopped clock (procedure from the Sun NVRAM/hostid FAQ). */
151static void __init kick_start_clock(void) 151static void __devinit kick_start_clock(void)
152{ 152{
153 struct mostek48t02 *regs = (struct mostek48t02 *)mstk48t02_regs; 153 struct mostek48t02 *regs = (struct mostek48t02 *)mstk48t02_regs;
154 unsigned char sec; 154 unsigned char sec;
@@ -223,7 +223,7 @@ static __inline__ int has_low_battery(void)
223 return (data1 == data2); /* Was the write blocked? */ 223 return (data1 == data2); /* Was the write blocked? */
224} 224}
225 225
226static void __init mostek_set_system_time(void) 226static void __devinit mostek_set_system_time(void)
227{ 227{
228 unsigned int year, mon, day, hour, min, sec; 228 unsigned int year, mon, day, hour, min, sec;
229 struct mostek48t02 *mregs; 229 struct mostek48t02 *mregs;
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index f0bb6e60e620..f75a1b822789 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -12,7 +12,7 @@ SECTIONS
12 .text 0xf0004000 : 12 .text 0xf0004000 :
13 { 13 {
14 _text = .; 14 _text = .;
15 *(.text) 15 TEXT_TEXT
16 SCHED_TEXT 16 SCHED_TEXT
17 LOCK_TEXT 17 LOCK_TEXT
18 *(.gnu.warning) 18 *(.gnu.warning)
@@ -22,7 +22,7 @@ SECTIONS
22 RODATA 22 RODATA
23 .data : 23 .data :
24 { 24 {
25 *(.data) 25 DATA_DATA
26 CONSTRUCTORS 26 CONSTRUCTORS
27 } 27 }
28 .data1 : { *(.data1) } 28 .data1 : { *(.data1) }
diff --git a/arch/sparc/lib/atomic32.c b/arch/sparc/lib/atomic32.c
index 559335f4917d..cbddeb38ffda 100644
--- a/arch/sparc/lib/atomic32.c
+++ b/arch/sparc/lib/atomic32.c
@@ -2,6 +2,7 @@
2 * atomic32.c: 32-bit atomic_t implementation 2 * atomic32.c: 32-bit atomic_t implementation
3 * 3 *
4 * Copyright (C) 2004 Keith M Wesolowski 4 * Copyright (C) 2004 Keith M Wesolowski
5 * Copyright (C) 2007 Kyle McMartin
5 * 6 *
6 * Based on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf 7 * Based on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf
7 */ 8 */
@@ -117,3 +118,17 @@ unsigned long ___change_bit(unsigned long *addr, unsigned long mask)
117 return old & mask; 118 return old & mask;
118} 119}
119EXPORT_SYMBOL(___change_bit); 120EXPORT_SYMBOL(___change_bit);
121
122unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new)
123{
124 unsigned long flags;
125 u32 prev;
126
127 spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
128 if ((prev = *ptr) == old)
129 *ptr = new;
130 spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
131
132 return (unsigned long)prev;
133}
134EXPORT_SYMBOL(__cmpxchg_u32);
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 831781cab271..bd00f89eed1e 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -147,10 +147,10 @@ config SMP
147 If you don't know what to do here, say N. 147 If you don't know what to do here, say N.
148 148
149config NR_CPUS 149config NR_CPUS
150 int "Maximum number of CPUs (2-64)" 150 int "Maximum number of CPUs (2-1024)"
151 range 2 64 151 range 2 1024
152 depends on SMP 152 depends on SMP
153 default "32" 153 default "64"
154 154
155source "drivers/cpufreq/Kconfig" 155source "drivers/cpufreq/Kconfig"
156 156
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index c749dccacc32..d8d19093d12f 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -8,11 +8,11 @@ EXTRA_CFLAGS := -Werror
8extra-y := head.o init_task.o vmlinux.lds 8extra-y := head.o init_task.o vmlinux.lds
9 9
10obj-y := process.o setup.o cpu.o idprom.o \ 10obj-y := process.o setup.o cpu.o idprom.o \
11 traps.o devices.o auxio.o una_asm.o \ 11 traps.o auxio.o una_asm.o \
12 irq.o ptrace.o time.o sys_sparc.o signal.o \ 12 irq.o ptrace.o time.o sys_sparc.o signal.o \
13 unaligned.o central.o pci.o starfire.o semaphore.o \ 13 unaligned.o central.o pci.o starfire.o semaphore.o \
14 power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \ 14 power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \
15 visemul.o prom.o of_device.o hvapi.o 15 visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o
16 16
17obj-$(CONFIG_STACKTRACE) += stacktrace.o 17obj-$(CONFIG_STACKTRACE) += stacktrace.o
18obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \ 18obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \
diff --git a/arch/sparc64/kernel/devices.c b/arch/sparc64/kernel/devices.c
deleted file mode 100644
index 0e03c8e218cd..000000000000
--- a/arch/sparc64/kernel/devices.c
+++ /dev/null
@@ -1,196 +0,0 @@
1/* devices.c: Initial scan of the prom device tree for important
2 * Sparc device nodes which we need to find.
3 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 */
6
7#include <linux/kernel.h>
8#include <linux/threads.h>
9#include <linux/init.h>
10#include <linux/ioport.h>
11#include <linux/string.h>
12#include <linux/spinlock.h>
13#include <linux/errno.h>
14#include <linux/bootmem.h>
15
16#include <asm/page.h>
17#include <asm/oplib.h>
18#include <asm/system.h>
19#include <asm/smp.h>
20#include <asm/spitfire.h>
21#include <asm/timer.h>
22#include <asm/cpudata.h>
23
24/* Used to synchronize accesses to NatSemi SUPER I/O chip configure
25 * operations in asm/ns87303.h
26 */
27DEFINE_SPINLOCK(ns87303_lock);
28
29extern void cpu_probe(void);
30extern void central_probe(void);
31
32static const char *cpu_mid_prop(void)
33{
34 if (tlb_type == spitfire)
35 return "upa-portid";
36 return "portid";
37}
38
39static int get_cpu_mid(struct device_node *dp)
40{
41 struct property *prop;
42
43 if (tlb_type == hypervisor) {
44 struct linux_prom64_registers *reg;
45 int len;
46
47 prop = of_find_property(dp, "cpuid", &len);
48 if (prop && len == 4)
49 return *(int *) prop->value;
50
51 prop = of_find_property(dp, "reg", NULL);
52 reg = prop->value;
53 return (reg[0].phys_addr >> 32) & 0x0fffffffUL;
54 } else {
55 const char *prop_name = cpu_mid_prop();
56
57 prop = of_find_property(dp, prop_name, NULL);
58 if (prop)
59 return *(int *) prop->value;
60 return 0;
61 }
62}
63
64static int check_cpu_node(struct device_node *dp, int *cur_inst,
65 int (*compare)(struct device_node *, int, void *),
66 void *compare_arg,
67 struct device_node **dev_node, int *mid)
68{
69 if (!compare(dp, *cur_inst, compare_arg)) {
70 if (dev_node)
71 *dev_node = dp;
72 if (mid)
73 *mid = get_cpu_mid(dp);
74 return 0;
75 }
76
77 (*cur_inst)++;
78
79 return -ENODEV;
80}
81
82static int __cpu_find_by(int (*compare)(struct device_node *, int, void *),
83 void *compare_arg,
84 struct device_node **dev_node, int *mid)
85{
86 struct device_node *dp;
87 int cur_inst;
88
89 cur_inst = 0;
90 for_each_node_by_type(dp, "cpu") {
91 int err = check_cpu_node(dp, &cur_inst,
92 compare, compare_arg,
93 dev_node, mid);
94 if (err == 0)
95 return 0;
96 }
97
98 return -ENODEV;
99}
100
101static int cpu_instance_compare(struct device_node *dp, int instance, void *_arg)
102{
103 int desired_instance = (int) (long) _arg;
104
105 if (instance == desired_instance)
106 return 0;
107 return -ENODEV;
108}
109
110int cpu_find_by_instance(int instance, struct device_node **dev_node, int *mid)
111{
112 return __cpu_find_by(cpu_instance_compare, (void *)(long)instance,
113 dev_node, mid);
114}
115
116static int cpu_mid_compare(struct device_node *dp, int instance, void *_arg)
117{
118 int desired_mid = (int) (long) _arg;
119 int this_mid;
120
121 this_mid = get_cpu_mid(dp);
122 if (this_mid == desired_mid)
123 return 0;
124 return -ENODEV;
125}
126
127int cpu_find_by_mid(int mid, struct device_node **dev_node)
128{
129 return __cpu_find_by(cpu_mid_compare, (void *)(long)mid,
130 dev_node, NULL);
131}
132
133void __init device_scan(void)
134{
135 /* FIX ME FAST... -DaveM */
136 ioport_resource.end = 0xffffffffffffffffUL;
137
138 prom_printf("Booting Linux...\n");
139
140#ifndef CONFIG_SMP
141 {
142 struct device_node *dp;
143 int err, def;
144
145 err = cpu_find_by_instance(0, &dp, NULL);
146 if (err) {
147 prom_printf("No cpu nodes, cannot continue\n");
148 prom_halt();
149 }
150 cpu_data(0).clock_tick =
151 of_getintprop_default(dp, "clock-frequency", 0);
152
153 def = ((tlb_type == hypervisor) ?
154 (8 * 1024) :
155 (16 * 1024));
156 cpu_data(0).dcache_size = of_getintprop_default(dp,
157 "dcache-size",
158 def);
159
160 def = 32;
161 cpu_data(0).dcache_line_size =
162 of_getintprop_default(dp, "dcache-line-size", def);
163
164 def = 16 * 1024;
165 cpu_data(0).icache_size = of_getintprop_default(dp,
166 "icache-size",
167 def);
168
169 def = 32;
170 cpu_data(0).icache_line_size =
171 of_getintprop_default(dp, "icache-line-size", def);
172
173 def = ((tlb_type == hypervisor) ?
174 (3 * 1024 * 1024) :
175 (4 * 1024 * 1024));
176 cpu_data(0).ecache_size = of_getintprop_default(dp,
177 "ecache-size",
178 def);
179
180 def = 64;
181 cpu_data(0).ecache_line_size =
182 of_getintprop_default(dp, "ecache-line-size", def);
183 printk("CPU[0]: Caches "
184 "D[sz(%d):line_sz(%d)] "
185 "I[sz(%d):line_sz(%d)] "
186 "E[sz(%d):line_sz(%d)]\n",
187 cpu_data(0).dcache_size, cpu_data(0).dcache_line_size,
188 cpu_data(0).icache_size, cpu_data(0).icache_line_size,
189 cpu_data(0).ecache_size, cpu_data(0).ecache_line_size);
190 }
191#endif
192
193 central_probe();
194
195 cpu_probe();
196}
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index 732b77cb71f8..ed712e0b3372 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -1725,96 +1725,142 @@ real_hard_smp_processor_id:
1725 * returns %o0: sysino 1725 * returns %o0: sysino
1726 */ 1726 */
1727 .globl sun4v_devino_to_sysino 1727 .globl sun4v_devino_to_sysino
1728 .type sun4v_devino_to_sysino,#function
1728sun4v_devino_to_sysino: 1729sun4v_devino_to_sysino:
1729 mov HV_FAST_INTR_DEVINO2SYSINO, %o5 1730 mov HV_FAST_INTR_DEVINO2SYSINO, %o5
1730 ta HV_FAST_TRAP 1731 ta HV_FAST_TRAP
1731 retl 1732 retl
1732 mov %o1, %o0 1733 mov %o1, %o0
1734 .size sun4v_devino_to_sysino, .-sun4v_devino_to_sysino
1733 1735
1734 /* %o0: sysino 1736 /* %o0: sysino
1735 * 1737 *
1736 * returns %o0: intr_enabled (HV_INTR_{DISABLED,ENABLED}) 1738 * returns %o0: intr_enabled (HV_INTR_{DISABLED,ENABLED})
1737 */ 1739 */
1738 .globl sun4v_intr_getenabled 1740 .globl sun4v_intr_getenabled
1741 .type sun4v_intr_getenabled,#function
1739sun4v_intr_getenabled: 1742sun4v_intr_getenabled:
1740 mov HV_FAST_INTR_GETENABLED, %o5 1743 mov HV_FAST_INTR_GETENABLED, %o5
1741 ta HV_FAST_TRAP 1744 ta HV_FAST_TRAP
1742 retl 1745 retl
1743 mov %o1, %o0 1746 mov %o1, %o0
1747 .size sun4v_intr_getenabled, .-sun4v_intr_getenabled
1744 1748
1745 /* %o0: sysino 1749 /* %o0: sysino
1746 * %o1: intr_enabled (HV_INTR_{DISABLED,ENABLED}) 1750 * %o1: intr_enabled (HV_INTR_{DISABLED,ENABLED})
1747 */ 1751 */
1748 .globl sun4v_intr_setenabled 1752 .globl sun4v_intr_setenabled
1753 .type sun4v_intr_setenabled,#function
1749sun4v_intr_setenabled: 1754sun4v_intr_setenabled:
1750 mov HV_FAST_INTR_SETENABLED, %o5 1755 mov HV_FAST_INTR_SETENABLED, %o5
1751 ta HV_FAST_TRAP 1756 ta HV_FAST_TRAP
1752 retl 1757 retl
1753 nop 1758 nop
1759 .size sun4v_intr_setenabled, .-sun4v_intr_setenabled
1754 1760
1755 /* %o0: sysino 1761 /* %o0: sysino
1756 * 1762 *
1757 * returns %o0: intr_state (HV_INTR_STATE_*) 1763 * returns %o0: intr_state (HV_INTR_STATE_*)
1758 */ 1764 */
1759 .globl sun4v_intr_getstate 1765 .globl sun4v_intr_getstate
1766 .type sun4v_intr_getstate,#function
1760sun4v_intr_getstate: 1767sun4v_intr_getstate:
1761 mov HV_FAST_INTR_GETSTATE, %o5 1768 mov HV_FAST_INTR_GETSTATE, %o5
1762 ta HV_FAST_TRAP 1769 ta HV_FAST_TRAP
1763 retl 1770 retl
1764 mov %o1, %o0 1771 mov %o1, %o0
1772 .size sun4v_intr_getstate, .-sun4v_intr_getstate
1765 1773
1766 /* %o0: sysino 1774 /* %o0: sysino
1767 * %o1: intr_state (HV_INTR_STATE_*) 1775 * %o1: intr_state (HV_INTR_STATE_*)
1768 */ 1776 */
1769 .globl sun4v_intr_setstate 1777 .globl sun4v_intr_setstate
1778 .type sun4v_intr_setstate,#function
1770sun4v_intr_setstate: 1779sun4v_intr_setstate:
1771 mov HV_FAST_INTR_SETSTATE, %o5 1780 mov HV_FAST_INTR_SETSTATE, %o5
1772 ta HV_FAST_TRAP 1781 ta HV_FAST_TRAP
1773 retl 1782 retl
1774 nop 1783 nop
1784 .size sun4v_intr_setstate, .-sun4v_intr_setstate
1775 1785
1776 /* %o0: sysino 1786 /* %o0: sysino
1777 * 1787 *
1778 * returns %o0: cpuid 1788 * returns %o0: cpuid
1779 */ 1789 */
1780 .globl sun4v_intr_gettarget 1790 .globl sun4v_intr_gettarget
1791 .type sun4v_intr_gettarget,#function
1781sun4v_intr_gettarget: 1792sun4v_intr_gettarget:
1782 mov HV_FAST_INTR_GETTARGET, %o5 1793 mov HV_FAST_INTR_GETTARGET, %o5
1783 ta HV_FAST_TRAP 1794 ta HV_FAST_TRAP
1784 retl 1795 retl
1785 mov %o1, %o0 1796 mov %o1, %o0
1797 .size sun4v_intr_gettarget, .-sun4v_intr_gettarget
1786 1798
1787 /* %o0: sysino 1799 /* %o0: sysino
1788 * %o1: cpuid 1800 * %o1: cpuid
1789 */ 1801 */
1790 .globl sun4v_intr_settarget 1802 .globl sun4v_intr_settarget
1803 .type sun4v_intr_settarget,#function
1791sun4v_intr_settarget: 1804sun4v_intr_settarget:
1792 mov HV_FAST_INTR_SETTARGET, %o5 1805 mov HV_FAST_INTR_SETTARGET, %o5
1793 ta HV_FAST_TRAP 1806 ta HV_FAST_TRAP
1794 retl 1807 retl
1795 nop 1808 nop
1809 .size sun4v_intr_settarget, .-sun4v_intr_settarget
1796 1810
1797 /* %o0: type 1811 /* %o0: cpuid
1798 * %o1: queue paddr 1812 * %o1: pc
1799 * %o2: num queue entries 1813 * %o2: rtba
1814 * %o3: arg0
1800 * 1815 *
1801 * returns %o0: status 1816 * returns %o0: status
1802 */ 1817 */
1803 .globl sun4v_cpu_qconf 1818 .globl sun4v_cpu_start
1804sun4v_cpu_qconf: 1819 .type sun4v_cpu_start,#function
1805 mov HV_FAST_CPU_QCONF, %o5 1820sun4v_cpu_start:
1821 mov HV_FAST_CPU_START, %o5
1806 ta HV_FAST_TRAP 1822 ta HV_FAST_TRAP
1807 retl 1823 retl
1808 nop 1824 nop
1825 .size sun4v_cpu_start, .-sun4v_cpu_start
1809 1826
1810 /* returns %o0: status 1827 /* %o0: cpuid
1828 *
1829 * returns %o0: status
1811 */ 1830 */
1831 .globl sun4v_cpu_stop
1832 .type sun4v_cpu_stop,#function
1833sun4v_cpu_stop:
1834 mov HV_FAST_CPU_STOP, %o5
1835 ta HV_FAST_TRAP
1836 retl
1837 nop
1838 .size sun4v_cpu_stop, .-sun4v_cpu_stop
1839
1840 /* returns %o0: status */
1812 .globl sun4v_cpu_yield 1841 .globl sun4v_cpu_yield
1842 .type sun4v_cpu_yield, #function
1813sun4v_cpu_yield: 1843sun4v_cpu_yield:
1814 mov HV_FAST_CPU_YIELD, %o5 1844 mov HV_FAST_CPU_YIELD, %o5
1815 ta HV_FAST_TRAP 1845 ta HV_FAST_TRAP
1816 retl 1846 retl
1817 nop 1847 nop
1848 .size sun4v_cpu_yield, .-sun4v_cpu_yield
1849
1850 /* %o0: type
1851 * %o1: queue paddr
1852 * %o2: num queue entries
1853 *
1854 * returns %o0: status
1855 */
1856 .globl sun4v_cpu_qconf
1857 .type sun4v_cpu_qconf,#function
1858sun4v_cpu_qconf:
1859 mov HV_FAST_CPU_QCONF, %o5
1860 ta HV_FAST_TRAP
1861 retl
1862 nop
1863 .size sun4v_cpu_qconf, .-sun4v_cpu_qconf
1818 1864
1819 /* %o0: num cpus in cpu list 1865 /* %o0: num cpus in cpu list
1820 * %o1: cpu list paddr 1866 * %o1: cpu list paddr
@@ -1823,11 +1869,13 @@ sun4v_cpu_yield:
1823 * returns %o0: status 1869 * returns %o0: status
1824 */ 1870 */
1825 .globl sun4v_cpu_mondo_send 1871 .globl sun4v_cpu_mondo_send
1872 .type sun4v_cpu_mondo_send,#function
1826sun4v_cpu_mondo_send: 1873sun4v_cpu_mondo_send:
1827 mov HV_FAST_CPU_MONDO_SEND, %o5 1874 mov HV_FAST_CPU_MONDO_SEND, %o5
1828 ta HV_FAST_TRAP 1875 ta HV_FAST_TRAP
1829 retl 1876 retl
1830 nop 1877 nop
1878 .size sun4v_cpu_mondo_send, .-sun4v_cpu_mondo_send
1831 1879
1832 /* %o0: CPU ID 1880 /* %o0: CPU ID
1833 * 1881 *
@@ -1835,6 +1883,7 @@ sun4v_cpu_mondo_send:
1835 * %o0: cpu state as HV_CPU_STATE_* 1883 * %o0: cpu state as HV_CPU_STATE_*
1836 */ 1884 */
1837 .globl sun4v_cpu_state 1885 .globl sun4v_cpu_state
1886 .type sun4v_cpu_state,#function
1838sun4v_cpu_state: 1887sun4v_cpu_state:
1839 mov HV_FAST_CPU_STATE, %o5 1888 mov HV_FAST_CPU_STATE, %o5
1840 ta HV_FAST_TRAP 1889 ta HV_FAST_TRAP
@@ -1843,6 +1892,37 @@ sun4v_cpu_state:
1843 mov %o1, %o0 1892 mov %o1, %o0
18441: retl 18931: retl
1845 nop 1894 nop
1895 .size sun4v_cpu_state, .-sun4v_cpu_state
1896
1897 /* %o0: virtual address
1898 * %o1: must be zero
1899 * %o2: TTE
1900 * %o3: HV_MMU_* flags
1901 *
1902 * returns %o0: status
1903 */
1904 .globl sun4v_mmu_map_perm_addr
1905 .type sun4v_mmu_map_perm_addr,#function
1906sun4v_mmu_map_perm_addr:
1907 mov HV_FAST_MMU_MAP_PERM_ADDR, %o5
1908 ta HV_FAST_TRAP
1909 retl
1910 nop
1911 .size sun4v_mmu_map_perm_addr, .-sun4v_mmu_map_perm_addr
1912
1913 /* %o0: number of TSB descriptions
1914 * %o1: TSB descriptions real address
1915 *
1916 * returns %o0: status
1917 */
1918 .globl sun4v_mmu_tsb_ctx0
1919 .type sun4v_mmu_tsb_ctx0,#function
1920sun4v_mmu_tsb_ctx0:
1921 mov HV_FAST_MMU_TSB_CTX0, %o5
1922 ta HV_FAST_TRAP
1923 retl
1924 nop
1925 .size sun4v_mmu_tsb_ctx0, .-sun4v_mmu_tsb_ctx0
1846 1926
1847 /* %o0: API group number 1927 /* %o0: API group number
1848 * %o1: pointer to unsigned long major number storage 1928 * %o1: pointer to unsigned long major number storage
@@ -1851,6 +1931,7 @@ sun4v_cpu_state:
1851 * returns %o0: status 1931 * returns %o0: status
1852 */ 1932 */
1853 .globl sun4v_get_version 1933 .globl sun4v_get_version
1934 .type sun4v_get_version,#function
1854sun4v_get_version: 1935sun4v_get_version:
1855 mov HV_CORE_GET_VER, %o5 1936 mov HV_CORE_GET_VER, %o5
1856 mov %o1, %o3 1937 mov %o1, %o3
@@ -1859,6 +1940,7 @@ sun4v_get_version:
1859 stx %o1, [%o3] 1940 stx %o1, [%o3]
1860 retl 1941 retl
1861 stx %o2, [%o4] 1942 stx %o2, [%o4]
1943 .size sun4v_get_version, .-sun4v_get_version
1862 1944
1863 /* %o0: API group number 1945 /* %o0: API group number
1864 * %o1: desired major number 1946 * %o1: desired major number
@@ -1868,18 +1950,49 @@ sun4v_get_version:
1868 * returns %o0: status 1950 * returns %o0: status
1869 */ 1951 */
1870 .globl sun4v_set_version 1952 .globl sun4v_set_version
1953 .type sun4v_set_version,#function
1871sun4v_set_version: 1954sun4v_set_version:
1872 mov HV_CORE_SET_VER, %o5 1955 mov HV_CORE_SET_VER, %o5
1873 mov %o3, %o4 1956 mov %o3, %o4
1874 ta HV_CORE_TRAP 1957 ta HV_CORE_TRAP
1875 retl 1958 retl
1876 stx %o1, [%o4] 1959 stx %o1, [%o4]
1960 .size sun4v_set_version, .-sun4v_set_version
1961
1962 /* %o0: pointer to unsigned long time
1963 *
1964 * returns %o0: status
1965 */
1966 .globl sun4v_tod_get
1967 .type sun4v_tod_get,#function
1968sun4v_tod_get:
1969 mov %o0, %o4
1970 mov HV_FAST_TOD_GET, %o5
1971 ta HV_FAST_TRAP
1972 stx %o1, [%o4]
1973 retl
1974 nop
1975 .size sun4v_tod_get, .-sun4v_tod_get
1976
1977 /* %o0: time
1978 *
1979 * returns %o0: status
1980 */
1981 .globl sun4v_tod_set
1982 .type sun4v_tod_set,#function
1983sun4v_tod_set:
1984 mov HV_FAST_TOD_SET, %o5
1985 ta HV_FAST_TRAP
1986 retl
1987 nop
1988 .size sun4v_tod_set, .-sun4v_tod_set
1877 1989
1878 /* %o0: pointer to unsigned long status 1990 /* %o0: pointer to unsigned long status
1879 * 1991 *
1880 * returns %o0: signed character 1992 * returns %o0: signed character
1881 */ 1993 */
1882 .globl sun4v_con_getchar 1994 .globl sun4v_con_getchar
1995 .type sun4v_con_getchar,#function
1883sun4v_con_getchar: 1996sun4v_con_getchar:
1884 mov %o0, %o4 1997 mov %o0, %o4
1885 mov HV_FAST_CONS_GETCHAR, %o5 1998 mov HV_FAST_CONS_GETCHAR, %o5
@@ -1889,17 +2002,20 @@ sun4v_con_getchar:
1889 stx %o0, [%o4] 2002 stx %o0, [%o4]
1890 retl 2003 retl
1891 sra %o1, 0, %o0 2004 sra %o1, 0, %o0
2005 .size sun4v_con_getchar, .-sun4v_con_getchar
1892 2006
1893 /* %o0: signed long character 2007 /* %o0: signed long character
1894 * 2008 *
1895 * returns %o0: status 2009 * returns %o0: status
1896 */ 2010 */
1897 .globl sun4v_con_putchar 2011 .globl sun4v_con_putchar
2012 .type sun4v_con_putchar,#function
1898sun4v_con_putchar: 2013sun4v_con_putchar:
1899 mov HV_FAST_CONS_PUTCHAR, %o5 2014 mov HV_FAST_CONS_PUTCHAR, %o5
1900 ta HV_FAST_TRAP 2015 ta HV_FAST_TRAP
1901 retl 2016 retl
1902 sra %o0, 0, %o0 2017 sra %o0, 0, %o0
2018 .size sun4v_con_putchar, .-sun4v_con_putchar
1903 2019
1904 /* %o0: buffer real address 2020 /* %o0: buffer real address
1905 * %o1: buffer size 2021 * %o1: buffer size
@@ -1908,6 +2024,7 @@ sun4v_con_putchar:
1908 * returns %o0: status 2024 * returns %o0: status
1909 */ 2025 */
1910 .globl sun4v_con_read 2026 .globl sun4v_con_read
2027 .type sun4v_con_read,#function
1911sun4v_con_read: 2028sun4v_con_read:
1912 mov %o2, %o4 2029 mov %o2, %o4
1913 mov HV_FAST_CONS_READ, %o5 2030 mov HV_FAST_CONS_READ, %o5
@@ -1922,6 +2039,7 @@ sun4v_con_read:
1922 stx %o1, [%o4] 2039 stx %o1, [%o4]
19231: retl 20401: retl
1924 nop 2041 nop
2042 .size sun4v_con_read, .-sun4v_con_read
1925 2043
1926 /* %o0: buffer real address 2044 /* %o0: buffer real address
1927 * %o1: buffer size 2045 * %o1: buffer size
@@ -1930,6 +2048,7 @@ sun4v_con_read:
1930 * returns %o0: status 2048 * returns %o0: status
1931 */ 2049 */
1932 .globl sun4v_con_write 2050 .globl sun4v_con_write
2051 .type sun4v_con_write,#function
1933sun4v_con_write: 2052sun4v_con_write:
1934 mov %o2, %o4 2053 mov %o2, %o4
1935 mov HV_FAST_CONS_WRITE, %o5 2054 mov HV_FAST_CONS_WRITE, %o5
@@ -1937,3 +2056,517 @@ sun4v_con_write:
1937 stx %o1, [%o4] 2056 stx %o1, [%o4]
1938 retl 2057 retl
1939 nop 2058 nop
2059 .size sun4v_con_write, .-sun4v_con_write
2060
2061 /* %o0: soft state
2062 * %o1: address of description string
2063 *
2064 * returns %o0: status
2065 */
2066 .globl sun4v_mach_set_soft_state
2067 .type sun4v_mach_set_soft_state,#function
2068sun4v_mach_set_soft_state:
2069 mov HV_FAST_MACH_SET_SOFT_STATE, %o5
2070 ta HV_FAST_TRAP
2071 retl
2072 nop
2073 .size sun4v_mach_set_soft_state, .-sun4v_mach_set_soft_state
2074
2075 /* %o0: exit code
2076 *
2077 * Does not return.
2078 */
2079 .globl sun4v_mach_exit
2080 .type sun4v_mach_exit,#function
2081sun4v_mach_exit:
2082 mov HV_FAST_MACH_EXIT, %o5
2083 ta HV_FAST_TRAP
2084 retl
2085 nop
2086 .size sun4v_mach_exit, .-sun4v_mach_exit
2087
2088 /* %o0: buffer real address
2089 * %o1: buffer length
2090 * %o2: pointer to unsigned long real_buf_len
2091 *
2092 * returns %o0: status
2093 */
2094 .globl sun4v_mach_desc
2095 .type sun4v_mach_desc,#function
2096sun4v_mach_desc:
2097 mov %o2, %o4
2098 mov HV_FAST_MACH_DESC, %o5
2099 ta HV_FAST_TRAP
2100 stx %o1, [%o4]
2101 retl
2102 nop
2103 .size sun4v_mach_desc, .-sun4v_mach_desc
2104
2105 /* %o0: new timeout in milliseconds
2106 * %o1: pointer to unsigned long orig_timeout
2107 *
2108 * returns %o0: status
2109 */
2110 .globl sun4v_mach_set_watchdog
2111 .type sun4v_mach_set_watchdog,#function
2112sun4v_mach_set_watchdog:
2113 mov %o1, %o4
2114 mov HV_FAST_MACH_SET_WATCHDOG, %o5
2115 ta HV_FAST_TRAP
2116 stx %o1, [%o4]
2117 retl
2118 nop
2119 .size sun4v_mach_set_watchdog, .-sun4v_mach_set_watchdog
2120
2121 /* No inputs and does not return. */
2122 .globl sun4v_mach_sir
2123 .type sun4v_mach_sir,#function
2124sun4v_mach_sir:
2125 mov %o1, %o4
2126 mov HV_FAST_MACH_SIR, %o5
2127 ta HV_FAST_TRAP
2128 stx %o1, [%o4]
2129 retl
2130 nop
2131 .size sun4v_mach_sir, .-sun4v_mach_sir
2132
2133 /* %o0: channel
2134 * %o1: ra
2135 * %o2: num_entries
2136 *
2137 * returns %o0: status
2138 */
2139 .globl sun4v_ldc_tx_qconf
2140 .type sun4v_ldc_tx_qconf,#function
2141sun4v_ldc_tx_qconf:
2142 mov HV_FAST_LDC_TX_QCONF, %o5
2143 ta HV_FAST_TRAP
2144 retl
2145 nop
2146 .size sun4v_ldc_tx_qconf, .-sun4v_ldc_tx_qconf
2147
2148 /* %o0: channel
2149 * %o1: pointer to unsigned long ra
2150 * %o2: pointer to unsigned long num_entries
2151 *
2152 * returns %o0: status
2153 */
2154 .globl sun4v_ldc_tx_qinfo
2155 .type sun4v_ldc_tx_qinfo,#function
2156sun4v_ldc_tx_qinfo:
2157 mov %o1, %g1
2158 mov %o2, %g2
2159 mov HV_FAST_LDC_TX_QINFO, %o5
2160 ta HV_FAST_TRAP
2161 stx %o1, [%g1]
2162 stx %o2, [%g2]
2163 retl
2164 nop
2165 .size sun4v_ldc_tx_qinfo, .-sun4v_ldc_tx_qinfo
2166
2167 /* %o0: channel
2168 * %o1: pointer to unsigned long head_off
2169 * %o2: pointer to unsigned long tail_off
2170 * %o2: pointer to unsigned long chan_state
2171 *
2172 * returns %o0: status
2173 */
2174 .globl sun4v_ldc_tx_get_state
2175 .type sun4v_ldc_tx_get_state,#function
2176sun4v_ldc_tx_get_state:
2177 mov %o1, %g1
2178 mov %o2, %g2
2179 mov %o3, %g3
2180 mov HV_FAST_LDC_TX_GET_STATE, %o5
2181 ta HV_FAST_TRAP
2182 stx %o1, [%g1]
2183 stx %o2, [%g2]
2184 stx %o3, [%g3]
2185 retl
2186 nop
2187 .size sun4v_ldc_tx_get_state, .-sun4v_ldc_tx_get_state
2188
2189 /* %o0: channel
2190 * %o1: tail_off
2191 *
2192 * returns %o0: status
2193 */
2194 .globl sun4v_ldc_tx_set_qtail
2195 .type sun4v_ldc_tx_set_qtail,#function
2196sun4v_ldc_tx_set_qtail:
2197 mov HV_FAST_LDC_TX_SET_QTAIL, %o5
2198 ta HV_FAST_TRAP
2199 retl
2200 nop
2201 .size sun4v_ldc_tx_set_qtail, .-sun4v_ldc_tx_set_qtail
2202
2203 /* %o0: channel
2204 * %o1: ra
2205 * %o2: num_entries
2206 *
2207 * returns %o0: status
2208 */
2209 .globl sun4v_ldc_rx_qconf
2210 .type sun4v_ldc_rx_qconf,#function
2211sun4v_ldc_rx_qconf:
2212 mov HV_FAST_LDC_RX_QCONF, %o5
2213 ta HV_FAST_TRAP
2214 retl
2215 nop
2216 .size sun4v_ldc_rx_qconf, .-sun4v_ldc_rx_qconf
2217
2218 /* %o0: channel
2219 * %o1: pointer to unsigned long ra
2220 * %o2: pointer to unsigned long num_entries
2221 *
2222 * returns %o0: status
2223 */
2224 .globl sun4v_ldc_rx_qinfo
2225 .type sun4v_ldc_rx_qinfo,#function
2226sun4v_ldc_rx_qinfo:
2227 mov %o1, %g1
2228 mov %o2, %g2
2229 mov HV_FAST_LDC_RX_QINFO, %o5
2230 ta HV_FAST_TRAP
2231 stx %o1, [%g1]
2232 stx %o2, [%g2]
2233 retl
2234 nop
2235 .size sun4v_ldc_rx_qinfo, .-sun4v_ldc_rx_qinfo
2236
2237 /* %o0: channel
2238 * %o1: pointer to unsigned long head_off
2239 * %o2: pointer to unsigned long tail_off
2240 * %o2: pointer to unsigned long chan_state
2241 *
2242 * returns %o0: status
2243 */
2244 .globl sun4v_ldc_rx_get_state
2245 .type sun4v_ldc_rx_get_state,#function
2246sun4v_ldc_rx_get_state:
2247 mov %o1, %g1
2248 mov %o2, %g2
2249 mov %o3, %g3
2250 mov HV_FAST_LDC_RX_GET_STATE, %o5
2251 ta HV_FAST_TRAP
2252 stx %o1, [%g1]
2253 stx %o2, [%g2]
2254 stx %o3, [%g3]
2255 retl
2256 nop
2257 .size sun4v_ldc_rx_get_state, .-sun4v_ldc_rx_get_state
2258
2259 /* %o0: channel
2260 * %o1: head_off
2261 *
2262 * returns %o0: status
2263 */
2264 .globl sun4v_ldc_rx_set_qhead
2265 .type sun4v_ldc_rx_set_qhead,#function
2266sun4v_ldc_rx_set_qhead:
2267 mov HV_FAST_LDC_RX_SET_QHEAD, %o5
2268 ta HV_FAST_TRAP
2269 retl
2270 nop
2271 .size sun4v_ldc_rx_set_qhead, .-sun4v_ldc_rx_set_qhead
2272
2273 /* %o0: channel
2274 * %o1: ra
2275 * %o2: num_entries
2276 *
2277 * returns %o0: status
2278 */
2279 .globl sun4v_ldc_set_map_table
2280 .type sun4v_ldc_set_map_table,#function
2281sun4v_ldc_set_map_table:
2282 mov HV_FAST_LDC_SET_MAP_TABLE, %o5
2283 ta HV_FAST_TRAP
2284 retl
2285 nop
2286 .size sun4v_ldc_set_map_table, .-sun4v_ldc_set_map_table
2287
2288 /* %o0: channel
2289 * %o1: pointer to unsigned long ra
2290 * %o2: pointer to unsigned long num_entries
2291 *
2292 * returns %o0: status
2293 */
2294 .globl sun4v_ldc_get_map_table
2295 .type sun4v_ldc_get_map_table,#function
2296sun4v_ldc_get_map_table:
2297 mov %o1, %g1
2298 mov %o2, %g2
2299 mov HV_FAST_LDC_GET_MAP_TABLE, %o5
2300 ta HV_FAST_TRAP
2301 stx %o1, [%g1]
2302 stx %o2, [%g2]
2303 retl
2304 nop
2305 .size sun4v_ldc_get_map_table, .-sun4v_ldc_get_map_table
2306
2307 /* %o0: channel
2308 * %o1: dir_code
2309 * %o2: tgt_raddr
2310 * %o3: lcl_raddr
2311 * %o4: len
2312 * %o5: pointer to unsigned long actual_len
2313 *
2314 * returns %o0: status
2315 */
2316 .globl sun4v_ldc_copy
2317 .type sun4v_ldc_copy,#function
2318sun4v_ldc_copy:
2319 mov %o5, %g1
2320 mov HV_FAST_LDC_COPY, %o5
2321 ta HV_FAST_TRAP
2322 stx %o1, [%g1]
2323 retl
2324 nop
2325 .size sun4v_ldc_copy, .-sun4v_ldc_copy
2326
2327 /* %o0: channel
2328 * %o1: cookie
2329 * %o2: pointer to unsigned long ra
2330 * %o3: pointer to unsigned long perm
2331 *
2332 * returns %o0: status
2333 */
2334 .globl sun4v_ldc_mapin
2335 .type sun4v_ldc_mapin,#function
2336sun4v_ldc_mapin:
2337 mov %o2, %g1
2338 mov %o3, %g2
2339 mov HV_FAST_LDC_MAPIN, %o5
2340 ta HV_FAST_TRAP
2341 stx %o1, [%g1]
2342 stx %o2, [%g2]
2343 retl
2344 nop
2345 .size sun4v_ldc_mapin, .-sun4v_ldc_mapin
2346
2347 /* %o0: ra
2348 *
2349 * returns %o0: status
2350 */
2351 .globl sun4v_ldc_unmap
2352 .type sun4v_ldc_unmap,#function
2353sun4v_ldc_unmap:
2354 mov HV_FAST_LDC_UNMAP, %o5
2355 ta HV_FAST_TRAP
2356 retl
2357 nop
2358 .size sun4v_ldc_unmap, .-sun4v_ldc_unmap
2359
2360 /* %o0: cookie
2361 * %o1: mte_cookie
2362 *
2363 * returns %o0: status
2364 */
2365 .globl sun4v_ldc_revoke
2366 .type sun4v_ldc_revoke,#function
2367sun4v_ldc_revoke:
2368 mov HV_FAST_LDC_REVOKE, %o5
2369 ta HV_FAST_TRAP
2370 retl
2371 nop
2372 .size sun4v_ldc_revoke, .-sun4v_ldc_revoke
2373
2374 /* %o0: device handle
2375 * %o1: device INO
2376 * %o2: pointer to unsigned long cookie
2377 *
2378 * returns %o0: status
2379 */
2380 .globl sun4v_vintr_get_cookie
2381 .type sun4v_vintr_get_cookie,#function
2382sun4v_vintr_get_cookie:
2383 mov %o2, %g1
2384 mov HV_FAST_VINTR_GET_COOKIE, %o5
2385 ta HV_FAST_TRAP
2386 stx %o1, [%g1]
2387 retl
2388 nop
2389 .size sun4v_vintr_get_cookie, .-sun4v_vintr_get_cookie
2390
2391 /* %o0: device handle
2392 * %o1: device INO
2393 * %o2: cookie
2394 *
2395 * returns %o0: status
2396 */
2397 .globl sun4v_vintr_set_cookie
2398 .type sun4v_vintr_set_cookie,#function
2399sun4v_vintr_set_cookie:
2400 mov HV_FAST_VINTR_SET_COOKIE, %o5
2401 ta HV_FAST_TRAP
2402 retl
2403 nop
2404 .size sun4v_vintr_set_cookie, .-sun4v_vintr_set_cookie
2405
2406 /* %o0: device handle
2407 * %o1: device INO
2408 * %o2: pointer to unsigned long valid_state
2409 *
2410 * returns %o0: status
2411 */
2412 .globl sun4v_vintr_get_valid
2413 .type sun4v_vintr_get_valid,#function
2414sun4v_vintr_get_valid:
2415 mov %o2, %g1
2416 mov HV_FAST_VINTR_GET_VALID, %o5
2417 ta HV_FAST_TRAP
2418 stx %o1, [%g1]
2419 retl
2420 nop
2421 .size sun4v_vintr_get_valid, .-sun4v_vintr_get_valid
2422
2423 /* %o0: device handle
2424 * %o1: device INO
2425 * %o2: valid_state
2426 *
2427 * returns %o0: status
2428 */
2429 .globl sun4v_vintr_set_valid
2430 .type sun4v_vintr_set_valid,#function
2431sun4v_vintr_set_valid:
2432 mov HV_FAST_VINTR_SET_VALID, %o5
2433 ta HV_FAST_TRAP
2434 retl
2435 nop
2436 .size sun4v_vintr_set_valid, .-sun4v_vintr_set_valid
2437
2438 /* %o0: device handle
2439 * %o1: device INO
2440 * %o2: pointer to unsigned long state
2441 *
2442 * returns %o0: status
2443 */
2444 .globl sun4v_vintr_get_state
2445 .type sun4v_vintr_get_state,#function
2446sun4v_vintr_get_state:
2447 mov %o2, %g1
2448 mov HV_FAST_VINTR_GET_STATE, %o5
2449 ta HV_FAST_TRAP
2450 stx %o1, [%g1]
2451 retl
2452 nop
2453 .size sun4v_vintr_get_state, .-sun4v_vintr_get_state
2454
2455 /* %o0: device handle
2456 * %o1: device INO
2457 * %o2: state
2458 *
2459 * returns %o0: status
2460 */
2461 .globl sun4v_vintr_set_state
2462 .type sun4v_vintr_set_state,#function
2463sun4v_vintr_set_state:
2464 mov HV_FAST_VINTR_SET_STATE, %o5
2465 ta HV_FAST_TRAP
2466 retl
2467 nop
2468 .size sun4v_vintr_set_state, .-sun4v_vintr_set_state
2469
2470 /* %o0: device handle
2471 * %o1: device INO
2472 * %o2: pointer to unsigned long cpuid
2473 *
2474 * returns %o0: status
2475 */
2476 .globl sun4v_vintr_get_target
2477 .type sun4v_vintr_get_target,#function
2478sun4v_vintr_get_target:
2479 mov %o2, %g1
2480 mov HV_FAST_VINTR_GET_TARGET, %o5
2481 ta HV_FAST_TRAP
2482 stx %o1, [%g1]
2483 retl
2484 nop
2485 .size sun4v_vintr_get_target, .-sun4v_vintr_get_target
2486
2487 /* %o0: device handle
2488 * %o1: device INO
2489 * %o2: cpuid
2490 *
2491 * returns %o0: status
2492 */
2493 .globl sun4v_vintr_set_target
2494 .type sun4v_vintr_set_target,#function
2495sun4v_vintr_set_target:
2496 mov HV_FAST_VINTR_SET_TARGET, %o5
2497 ta HV_FAST_TRAP
2498 retl
2499 nop
2500 .size sun4v_vintr_set_target, .-sun4v_vintr_set_target
2501
2502 /* %o0: NCS sub-function
2503 * %o1: sub-function arg real-address
2504 * %o2: sub-function arg size
2505 *
2506 * returns %o0: status
2507 */
2508 .globl sun4v_ncs_request
2509 .type sun4v_ncs_request,#function
2510sun4v_ncs_request:
2511 mov HV_FAST_NCS_REQUEST, %o5
2512 ta HV_FAST_TRAP
2513 retl
2514 nop
2515 .size sun4v_ncs_request, .-sun4v_ncs_request
2516
2517 .globl sun4v_scv_send
2518 .type sun4v_scv_send,#function
2519sun4v_scv_send:
2520 save %sp, -192, %sp
2521 mov %i0, %o0
2522 mov %i1, %o1
2523 mov %i2, %o2
2524 mov HV_FAST_SVC_SEND, %o5
2525 ta HV_FAST_TRAP
2526 stx %o1, [%i3]
2527 ret
2528 restore
2529 .size sun4v_scv_send, .-sun4v_scv_send
2530
2531 .globl sun4v_scv_recv
2532 .type sun4v_scv_recv,#function
2533sun4v_scv_recv:
2534 save %sp, -192, %sp
2535 mov %i0, %o0
2536 mov %i1, %o1
2537 mov %i2, %o2
2538 mov HV_FAST_SVC_RECV, %o5
2539 ta HV_FAST_TRAP
2540 stx %o1, [%i3]
2541 ret
2542 restore
2543 .size sun4v_scv_recv, .-sun4v_scv_recv
2544
2545 .globl sun4v_scv_getstatus
2546 .type sun4v_scv_getstatus,#function
2547sun4v_scv_getstatus:
2548 mov HV_FAST_SVC_GETSTATUS, %o5
2549 mov %o1, %o4
2550 ta HV_FAST_TRAP
2551 stx %o1, [%o4]
2552 retl
2553 nop
2554 .size sun4v_scv_getstatus, .-sun4v_scv_getstatus
2555
2556 .globl sun4v_scv_setstatus
2557 .type sun4v_scv_setstatus,#function
2558sun4v_scv_setstatus:
2559 mov HV_FAST_SVC_SETSTATUS, %o5
2560 ta HV_FAST_TRAP
2561 retl
2562 nop
2563 .size sun4v_scv_setstatus, .-sun4v_scv_setstatus
2564
2565 .globl sun4v_scv_clrstatus
2566 .type sun4v_scv_clrstatus,#function
2567sun4v_scv_clrstatus:
2568 mov HV_FAST_SVC_CLRSTATUS, %o5
2569 ta HV_FAST_TRAP
2570 retl
2571 nop
2572 .size sun4v_scv_clrstatus, .-sun4v_scv_clrstatus
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
index baea10a98196..77259526cb15 100644
--- a/arch/sparc64/kernel/head.S
+++ b/arch/sparc64/kernel/head.S
@@ -523,7 +523,7 @@ tlb_fixup_done:
523#else 523#else
524 mov 0, %o0 524 mov 0, %o0
525#endif 525#endif
526 stb %o0, [%g6 + TI_CPU] 526 sth %o0, [%g6 + TI_CPU]
527 527
528 /* Off we go.... */ 528 /* Off we go.... */
529 call start_kernel 529 call start_kernel
@@ -653,33 +653,54 @@ setup_tba:
653 restore 653 restore
654sparc64_boot_end: 654sparc64_boot_end:
655 655
656#include "ktlb.S"
657#include "tsb.S"
658#include "etrap.S" 656#include "etrap.S"
659#include "rtrap.S" 657#include "rtrap.S"
660#include "winfixup.S" 658#include "winfixup.S"
661#include "entry.S" 659#include "entry.S"
662#include "sun4v_tlb_miss.S" 660#include "sun4v_tlb_miss.S"
663#include "sun4v_ivec.S" 661#include "sun4v_ivec.S"
662#include "ktlb.S"
663#include "tsb.S"
664 664
665/* 665/*
666 * The following skip makes sure the trap table in ttable.S is aligned 666 * The following skip makes sure the trap table in ttable.S is aligned
667 * on a 32K boundary as required by the v9 specs for TBA register. 667 * on a 32K boundary as required by the v9 specs for TBA register.
668 * 668 *
669 * We align to a 32K boundary, then we have the 32K kernel TSB, 669 * We align to a 32K boundary, then we have the 32K kernel TSB,
670 * then the 32K aligned trap table. 670 * the 64K kernel 4MB TSB, and then the 32K aligned trap table.
671 */ 671 */
6721: 6721:
673 .skip 0x4000 + _start - 1b 673 .skip 0x4000 + _start - 1b
674 674
675! 0x0000000000408000
676
675 .globl swapper_tsb 677 .globl swapper_tsb
676swapper_tsb: 678swapper_tsb:
677 .skip (32 * 1024) 679 .skip (32 * 1024)
678 680
679! 0x0000000000408000 681 .globl swapper_4m_tsb
682swapper_4m_tsb:
683 .skip (64 * 1024)
684
685! 0x0000000000420000
680 686
687 /* Some care needs to be exercised if you try to move the
688 * location of the trap table relative to other things. For
689 * one thing there are br* instructions in some of the
690 * trap table entires which branch back to code in ktlb.S
691 * Those instructions can only handle a signed 16-bit
692 * displacement.
693 *
694 * There is a binutils bug (bugzilla #4558) which causes
695 * the relocation overflow checks for such instructions to
696 * not be done correctly. So bintuils will not notice the
697 * error and will instead write junk into the relocation and
698 * you'll have an unbootable kernel.
699 */
681#include "ttable.S" 700#include "ttable.S"
682 701
702! 0x0000000000428000
703
683#include "systbls.S" 704#include "systbls.S"
684 705
685 .data 706 .data
diff --git a/arch/sparc64/kernel/hvapi.c b/arch/sparc64/kernel/hvapi.c
index f03ffc829c7a..f34f5d6181ef 100644
--- a/arch/sparc64/kernel/hvapi.c
+++ b/arch/sparc64/kernel/hvapi.c
@@ -9,6 +9,7 @@
9 9
10#include <asm/hypervisor.h> 10#include <asm/hypervisor.h>
11#include <asm/oplib.h> 11#include <asm/oplib.h>
12#include <asm/sstate.h>
12 13
13/* If the hypervisor indicates that the API setting 14/* If the hypervisor indicates that the API setting
14 * calls are unsupported, by returning HV_EBADTRAP or 15 * calls are unsupported, by returning HV_EBADTRAP or
@@ -107,7 +108,7 @@ int sun4v_hvapi_register(unsigned long group, unsigned long major,
107 p->minor = actual_minor; 108 p->minor = actual_minor;
108 ret = 0; 109 ret = 0;
109 } else if (hv_ret == HV_EBADTRAP || 110 } else if (hv_ret == HV_EBADTRAP ||
110 HV_ENOTSUPPORTED) { 111 hv_ret == HV_ENOTSUPPORTED) {
111 if (p->flags & FLAG_PRE_API) { 112 if (p->flags & FLAG_PRE_API) {
112 if (major == 1) { 113 if (major == 1) {
113 p->major = 1; 114 p->major = 1;
@@ -179,6 +180,8 @@ void __init sun4v_hvapi_init(void)
179 if (sun4v_hvapi_register(group, major, &minor)) 180 if (sun4v_hvapi_register(group, major, &minor))
180 goto bad; 181 goto bad;
181 182
183 sun4v_sstate_init();
184
182 return; 185 return;
183 186
184bad: 187bad:
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 3edc18e1b818..a36f8dd0c021 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -171,8 +171,6 @@ skip:
171 return 0; 171 return 0;
172} 172}
173 173
174extern unsigned long real_hard_smp_processor_id(void);
175
176static unsigned int sun4u_compute_tid(unsigned long imap, unsigned long cpuid) 174static unsigned int sun4u_compute_tid(unsigned long imap, unsigned long cpuid)
177{ 175{
178 unsigned int tid; 176 unsigned int tid;
@@ -694,9 +692,20 @@ void init_irqwork_curcpu(void)
694 trap_block[cpu].irq_worklist = 0; 692 trap_block[cpu].irq_worklist = 0;
695} 693}
696 694
697static void __cpuinit register_one_mondo(unsigned long paddr, unsigned long type) 695/* Please be very careful with register_one_mondo() and
696 * sun4v_register_mondo_queues().
697 *
698 * On SMP this gets invoked from the CPU trampoline before
699 * the cpu has fully taken over the trap table from OBP,
700 * and it's kernel stack + %g6 thread register state is
701 * not fully cooked yet.
702 *
703 * Therefore you cannot make any OBP calls, not even prom_printf,
704 * from these two routines.
705 */
706static void __cpuinit register_one_mondo(unsigned long paddr, unsigned long type, unsigned long qmask)
698{ 707{
699 unsigned long num_entries = 128; 708 unsigned long num_entries = (qmask + 1) / 64;
700 unsigned long status; 709 unsigned long status;
701 710
702 status = sun4v_cpu_qconf(type, paddr, num_entries); 711 status = sun4v_cpu_qconf(type, paddr, num_entries);
@@ -711,44 +720,58 @@ static void __cpuinit sun4v_register_mondo_queues(int this_cpu)
711{ 720{
712 struct trap_per_cpu *tb = &trap_block[this_cpu]; 721 struct trap_per_cpu *tb = &trap_block[this_cpu];
713 722
714 register_one_mondo(tb->cpu_mondo_pa, HV_CPU_QUEUE_CPU_MONDO); 723 register_one_mondo(tb->cpu_mondo_pa, HV_CPU_QUEUE_CPU_MONDO,
715 register_one_mondo(tb->dev_mondo_pa, HV_CPU_QUEUE_DEVICE_MONDO); 724 tb->cpu_mondo_qmask);
716 register_one_mondo(tb->resum_mondo_pa, HV_CPU_QUEUE_RES_ERROR); 725 register_one_mondo(tb->dev_mondo_pa, HV_CPU_QUEUE_DEVICE_MONDO,
717 register_one_mondo(tb->nonresum_mondo_pa, HV_CPU_QUEUE_NONRES_ERROR); 726 tb->dev_mondo_qmask);
727 register_one_mondo(tb->resum_mondo_pa, HV_CPU_QUEUE_RES_ERROR,
728 tb->resum_qmask);
729 register_one_mondo(tb->nonresum_mondo_pa, HV_CPU_QUEUE_NONRES_ERROR,
730 tb->nonresum_qmask);
718} 731}
719 732
720static void __cpuinit alloc_one_mondo(unsigned long *pa_ptr, int use_bootmem) 733static void __cpuinit alloc_one_mondo(unsigned long *pa_ptr, unsigned long qmask, int use_bootmem)
721{ 734{
722 void *page; 735 unsigned long size = PAGE_ALIGN(qmask + 1);
736 unsigned long order = get_order(size);
737 void *p = NULL;
723 738
724 if (use_bootmem) 739 if (use_bootmem) {
725 page = alloc_bootmem_low_pages(PAGE_SIZE); 740 p = __alloc_bootmem_low(size, size, 0);
726 else 741 } else {
727 page = (void *) get_zeroed_page(GFP_ATOMIC); 742 struct page *page = alloc_pages(GFP_ATOMIC | __GFP_ZERO, order);
743 if (page)
744 p = page_address(page);
745 }
728 746
729 if (!page) { 747 if (!p) {
730 prom_printf("SUN4V: Error, cannot allocate mondo queue.\n"); 748 prom_printf("SUN4V: Error, cannot allocate mondo queue.\n");
731 prom_halt(); 749 prom_halt();
732 } 750 }
733 751
734 *pa_ptr = __pa(page); 752 *pa_ptr = __pa(p);
735} 753}
736 754
737static void __cpuinit alloc_one_kbuf(unsigned long *pa_ptr, int use_bootmem) 755static void __cpuinit alloc_one_kbuf(unsigned long *pa_ptr, unsigned long qmask, int use_bootmem)
738{ 756{
739 void *page; 757 unsigned long size = PAGE_ALIGN(qmask + 1);
758 unsigned long order = get_order(size);
759 void *p = NULL;
740 760
741 if (use_bootmem) 761 if (use_bootmem) {
742 page = alloc_bootmem_low_pages(PAGE_SIZE); 762 p = __alloc_bootmem_low(size, size, 0);
743 else 763 } else {
744 page = (void *) get_zeroed_page(GFP_ATOMIC); 764 struct page *page = alloc_pages(GFP_ATOMIC | __GFP_ZERO, order);
765 if (page)
766 p = page_address(page);
767 }
745 768
746 if (!page) { 769 if (!p) {
747 prom_printf("SUN4V: Error, cannot allocate kbuf page.\n"); 770 prom_printf("SUN4V: Error, cannot allocate kbuf page.\n");
748 prom_halt(); 771 prom_halt();
749 } 772 }
750 773
751 *pa_ptr = __pa(page); 774 *pa_ptr = __pa(p);
752} 775}
753 776
754static void __cpuinit init_cpu_send_mondo_info(struct trap_per_cpu *tb, int use_bootmem) 777static void __cpuinit init_cpu_send_mondo_info(struct trap_per_cpu *tb, int use_bootmem)
@@ -779,12 +802,12 @@ void __cpuinit sun4v_init_mondo_queues(int use_bootmem, int cpu, int alloc, int
779 struct trap_per_cpu *tb = &trap_block[cpu]; 802 struct trap_per_cpu *tb = &trap_block[cpu];
780 803
781 if (alloc) { 804 if (alloc) {
782 alloc_one_mondo(&tb->cpu_mondo_pa, use_bootmem); 805 alloc_one_mondo(&tb->cpu_mondo_pa, tb->cpu_mondo_qmask, use_bootmem);
783 alloc_one_mondo(&tb->dev_mondo_pa, use_bootmem); 806 alloc_one_mondo(&tb->dev_mondo_pa, tb->dev_mondo_qmask, use_bootmem);
784 alloc_one_mondo(&tb->resum_mondo_pa, use_bootmem); 807 alloc_one_mondo(&tb->resum_mondo_pa, tb->resum_qmask, use_bootmem);
785 alloc_one_kbuf(&tb->resum_kernel_buf_pa, use_bootmem); 808 alloc_one_kbuf(&tb->resum_kernel_buf_pa, tb->resum_qmask, use_bootmem);
786 alloc_one_mondo(&tb->nonresum_mondo_pa, use_bootmem); 809 alloc_one_mondo(&tb->nonresum_mondo_pa, tb->nonresum_qmask, use_bootmem);
787 alloc_one_kbuf(&tb->nonresum_kernel_buf_pa, use_bootmem); 810 alloc_one_kbuf(&tb->nonresum_kernel_buf_pa, tb->nonresum_qmask, use_bootmem);
788 811
789 init_cpu_send_mondo_info(tb, use_bootmem); 812 init_cpu_send_mondo_info(tb, use_bootmem);
790 } 813 }
diff --git a/arch/sparc64/kernel/itlb_miss.S b/arch/sparc64/kernel/itlb_miss.S
index ad46e2024f4b..5a8377b54955 100644
--- a/arch/sparc64/kernel/itlb_miss.S
+++ b/arch/sparc64/kernel/itlb_miss.S
@@ -11,12 +11,12 @@
11/* ITLB ** ICACHE line 2: TSB compare and TLB load */ 11/* ITLB ** ICACHE line 2: TSB compare and TLB load */
12 bne,pn %xcc, tsb_miss_itlb ! Miss 12 bne,pn %xcc, tsb_miss_itlb ! Miss
13 mov FAULT_CODE_ITLB, %g3 13 mov FAULT_CODE_ITLB, %g3
14 andcc %g5, _PAGE_EXEC_4U, %g0 ! Executable? 14 sethi %hi(_PAGE_EXEC_4U), %g4
15 andcc %g5, %g4, %g0 ! Executable?
15 be,pn %xcc, tsb_do_fault 16 be,pn %xcc, tsb_do_fault
16 nop ! Delay slot, fill me 17 nop ! Delay slot, fill me
17 stxa %g5, [%g0] ASI_ITLB_DATA_IN ! Load TLB 18 stxa %g5, [%g0] ASI_ITLB_DATA_IN ! Load TLB
18 retry ! Trap done 19 retry ! Trap done
19 nop
20 20
21/* ITLB ** ICACHE line 3: */ 21/* ITLB ** ICACHE line 3: */
22 nop 22 nop
diff --git a/arch/sparc64/kernel/mdesc.c b/arch/sparc64/kernel/mdesc.c
new file mode 100644
index 000000000000..9246c2cf9574
--- /dev/null
+++ b/arch/sparc64/kernel/mdesc.c
@@ -0,0 +1,619 @@
1/* mdesc.c: Sun4V machine description handling.
2 *
3 * Copyright (C) 2007 David S. Miller <davem@davemloft.net>
4 */
5#include <linux/kernel.h>
6#include <linux/types.h>
7#include <linux/bootmem.h>
8#include <linux/log2.h>
9
10#include <asm/hypervisor.h>
11#include <asm/mdesc.h>
12#include <asm/prom.h>
13#include <asm/oplib.h>
14#include <asm/smp.h>
15
16/* Unlike the OBP device tree, the machine description is a full-on
17 * DAG. An arbitrary number of ARCs are possible from one
18 * node to other nodes and thus we can't use the OBP device_node
19 * data structure to represent these nodes inside of the kernel.
20 *
21 * Actually, it isn't even a DAG, because there are back pointers
22 * which create cycles in the graph.
23 *
24 * mdesc_hdr and mdesc_elem describe the layout of the data structure
25 * we get from the Hypervisor.
26 */
27struct mdesc_hdr {
28 u32 version; /* Transport version */
29 u32 node_sz; /* node block size */
30 u32 name_sz; /* name block size */
31 u32 data_sz; /* data block size */
32};
33
34struct mdesc_elem {
35 u8 tag;
36#define MD_LIST_END 0x00
37#define MD_NODE 0x4e
38#define MD_NODE_END 0x45
39#define MD_NOOP 0x20
40#define MD_PROP_ARC 0x61
41#define MD_PROP_VAL 0x76
42#define MD_PROP_STR 0x73
43#define MD_PROP_DATA 0x64
44 u8 name_len;
45 u16 resv;
46 u32 name_offset;
47 union {
48 struct {
49 u32 data_len;
50 u32 data_offset;
51 } data;
52 u64 val;
53 } d;
54};
55
56static struct mdesc_hdr *main_mdesc;
57static struct mdesc_node *allnodes;
58
59static struct mdesc_node *allnodes_tail;
60static unsigned int unique_id;
61
62static struct mdesc_node **mdesc_hash;
63static unsigned int mdesc_hash_size;
64
65static inline unsigned int node_hashfn(u64 node)
66{
67 return ((unsigned int) (node ^ (node >> 8) ^ (node >> 16)))
68 & (mdesc_hash_size - 1);
69}
70
71static inline void hash_node(struct mdesc_node *mp)
72{
73 struct mdesc_node **head = &mdesc_hash[node_hashfn(mp->node)];
74
75 mp->hash_next = *head;
76 *head = mp;
77
78 if (allnodes_tail) {
79 allnodes_tail->allnodes_next = mp;
80 allnodes_tail = mp;
81 } else {
82 allnodes = allnodes_tail = mp;
83 }
84}
85
86static struct mdesc_node *find_node(u64 node)
87{
88 struct mdesc_node *mp = mdesc_hash[node_hashfn(node)];
89
90 while (mp) {
91 if (mp->node == node)
92 return mp;
93
94 mp = mp->hash_next;
95 }
96 return NULL;
97}
98
99struct property *md_find_property(const struct mdesc_node *mp,
100 const char *name,
101 int *lenp)
102{
103 struct property *pp;
104
105 for (pp = mp->properties; pp != 0; pp = pp->next) {
106 if (strcasecmp(pp->name, name) == 0) {
107 if (lenp)
108 *lenp = pp->length;
109 break;
110 }
111 }
112 return pp;
113}
114EXPORT_SYMBOL(md_find_property);
115
116/*
117 * Find a property with a given name for a given node
118 * and return the value.
119 */
120const void *md_get_property(const struct mdesc_node *mp, const char *name,
121 int *lenp)
122{
123 struct property *pp = md_find_property(mp, name, lenp);
124 return pp ? pp->value : NULL;
125}
126EXPORT_SYMBOL(md_get_property);
127
128struct mdesc_node *md_find_node_by_name(struct mdesc_node *from,
129 const char *name)
130{
131 struct mdesc_node *mp;
132
133 mp = from ? from->allnodes_next : allnodes;
134 for (; mp != NULL; mp = mp->allnodes_next) {
135 if (strcmp(mp->name, name) == 0)
136 break;
137 }
138 return mp;
139}
140EXPORT_SYMBOL(md_find_node_by_name);
141
142static unsigned int mdesc_early_allocated;
143
144static void * __init mdesc_early_alloc(unsigned long size)
145{
146 void *ret;
147
148 ret = __alloc_bootmem(size, SMP_CACHE_BYTES, 0UL);
149 if (ret == NULL) {
150 prom_printf("MDESC: alloc of %lu bytes failed.\n", size);
151 prom_halt();
152 }
153
154 memset(ret, 0, size);
155
156 mdesc_early_allocated += size;
157
158 return ret;
159}
160
161static unsigned int __init count_arcs(struct mdesc_elem *ep)
162{
163 unsigned int ret = 0;
164
165 ep++;
166 while (ep->tag != MD_NODE_END) {
167 if (ep->tag == MD_PROP_ARC)
168 ret++;
169 ep++;
170 }
171 return ret;
172}
173
174static void __init mdesc_node_alloc(u64 node, struct mdesc_elem *ep, const char *names)
175{
176 unsigned int num_arcs = count_arcs(ep);
177 struct mdesc_node *mp;
178
179 mp = mdesc_early_alloc(sizeof(*mp) +
180 (num_arcs * sizeof(struct mdesc_arc)));
181 mp->name = names + ep->name_offset;
182 mp->node = node;
183 mp->unique_id = unique_id++;
184 mp->num_arcs = num_arcs;
185
186 hash_node(mp);
187}
188
189static inline struct mdesc_elem *node_block(struct mdesc_hdr *mdesc)
190{
191 return (struct mdesc_elem *) (mdesc + 1);
192}
193
194static inline void *name_block(struct mdesc_hdr *mdesc)
195{
196 return ((void *) node_block(mdesc)) + mdesc->node_sz;
197}
198
199static inline void *data_block(struct mdesc_hdr *mdesc)
200{
201 return ((void *) name_block(mdesc)) + mdesc->name_sz;
202}
203
204/* In order to avoid recursion (the graph can be very deep) we use a
205 * two pass algorithm. First we allocate all the nodes and hash them.
206 * Then we iterate over each node, filling in the arcs and properties.
207 */
208static void __init build_all_nodes(struct mdesc_hdr *mdesc)
209{
210 struct mdesc_elem *start, *ep;
211 struct mdesc_node *mp;
212 const char *names;
213 void *data;
214 u64 last_node;
215
216 start = ep = node_block(mdesc);
217 last_node = mdesc->node_sz / 16;
218
219 names = name_block(mdesc);
220
221 while (1) {
222 u64 node = ep - start;
223
224 if (ep->tag == MD_LIST_END)
225 break;
226
227 if (ep->tag != MD_NODE) {
228 prom_printf("MDESC: Inconsistent element list.\n");
229 prom_halt();
230 }
231
232 mdesc_node_alloc(node, ep, names);
233
234 if (ep->d.val >= last_node) {
235 printk("MDESC: Warning, early break out of node scan.\n");
236 printk("MDESC: Next node [%lu] last_node [%lu].\n",
237 node, last_node);
238 break;
239 }
240
241 ep = start + ep->d.val;
242 }
243
244 data = data_block(mdesc);
245 for (mp = allnodes; mp; mp = mp->allnodes_next) {
246 struct mdesc_elem *ep = start + mp->node;
247 struct property **link = &mp->properties;
248 unsigned int this_arc = 0;
249
250 ep++;
251 while (ep->tag != MD_NODE_END) {
252 switch (ep->tag) {
253 case MD_PROP_ARC: {
254 struct mdesc_node *target;
255
256 if (this_arc >= mp->num_arcs) {
257 prom_printf("MDESC: ARC overrun [%u:%u]\n",
258 this_arc, mp->num_arcs);
259 prom_halt();
260 }
261 target = find_node(ep->d.val);
262 if (!target) {
263 printk("MDESC: Warning, arc points to "
264 "missing node, ignoring.\n");
265 break;
266 }
267 mp->arcs[this_arc].name =
268 (names + ep->name_offset);
269 mp->arcs[this_arc].arc = target;
270 this_arc++;
271 break;
272 }
273
274 case MD_PROP_VAL:
275 case MD_PROP_STR:
276 case MD_PROP_DATA: {
277 struct property *p = mdesc_early_alloc(sizeof(*p));
278
279 p->unique_id = unique_id++;
280 p->name = (char *) names + ep->name_offset;
281 if (ep->tag == MD_PROP_VAL) {
282 p->value = &ep->d.val;
283 p->length = 8;
284 } else {
285 p->value = data + ep->d.data.data_offset;
286 p->length = ep->d.data.data_len;
287 }
288 *link = p;
289 link = &p->next;
290 break;
291 }
292
293 case MD_NOOP:
294 break;
295
296 default:
297 printk("MDESC: Warning, ignoring unknown tag type %02x\n",
298 ep->tag);
299 }
300 ep++;
301 }
302 }
303}
304
305static unsigned int __init count_nodes(struct mdesc_hdr *mdesc)
306{
307 struct mdesc_elem *ep = node_block(mdesc);
308 struct mdesc_elem *end;
309 unsigned int cnt = 0;
310
311 end = ((void *)ep) + mdesc->node_sz;
312 while (ep < end) {
313 if (ep->tag == MD_NODE)
314 cnt++;
315 ep++;
316 }
317 return cnt;
318}
319
320static void __init report_platform_properties(void)
321{
322 struct mdesc_node *pn = md_find_node_by_name(NULL, "platform");
323 const char *s;
324 const u64 *v;
325
326 if (!pn) {
327 prom_printf("No platform node in machine-description.\n");
328 prom_halt();
329 }
330
331 s = md_get_property(pn, "banner-name", NULL);
332 printk("PLATFORM: banner-name [%s]\n", s);
333 s = md_get_property(pn, "name", NULL);
334 printk("PLATFORM: name [%s]\n", s);
335
336 v = md_get_property(pn, "hostid", NULL);
337 if (v)
338 printk("PLATFORM: hostid [%08lx]\n", *v);
339 v = md_get_property(pn, "serial#", NULL);
340 if (v)
341 printk("PLATFORM: serial# [%08lx]\n", *v);
342 v = md_get_property(pn, "stick-frequency", NULL);
343 printk("PLATFORM: stick-frequency [%08lx]\n", *v);
344 v = md_get_property(pn, "mac-address", NULL);
345 if (v)
346 printk("PLATFORM: mac-address [%lx]\n", *v);
347 v = md_get_property(pn, "watchdog-resolution", NULL);
348 if (v)
349 printk("PLATFORM: watchdog-resolution [%lu ms]\n", *v);
350 v = md_get_property(pn, "watchdog-max-timeout", NULL);
351 if (v)
352 printk("PLATFORM: watchdog-max-timeout [%lu ms]\n", *v);
353 v = md_get_property(pn, "max-cpus", NULL);
354 if (v)
355 printk("PLATFORM: max-cpus [%lu]\n", *v);
356}
357
358static int inline find_in_proplist(const char *list, const char *match, int len)
359{
360 while (len > 0) {
361 int l;
362
363 if (!strcmp(list, match))
364 return 1;
365 l = strlen(list) + 1;
366 list += l;
367 len -= l;
368 }
369 return 0;
370}
371
372static void __init fill_in_one_cache(cpuinfo_sparc *c, struct mdesc_node *mp)
373{
374 const u64 *level = md_get_property(mp, "level", NULL);
375 const u64 *size = md_get_property(mp, "size", NULL);
376 const u64 *line_size = md_get_property(mp, "line-size", NULL);
377 const char *type;
378 int type_len;
379
380 type = md_get_property(mp, "type", &type_len);
381
382 switch (*level) {
383 case 1:
384 if (find_in_proplist(type, "instn", type_len)) {
385 c->icache_size = *size;
386 c->icache_line_size = *line_size;
387 } else if (find_in_proplist(type, "data", type_len)) {
388 c->dcache_size = *size;
389 c->dcache_line_size = *line_size;
390 }
391 break;
392
393 case 2:
394 c->ecache_size = *size;
395 c->ecache_line_size = *line_size;
396 break;
397
398 default:
399 break;
400 }
401
402 if (*level == 1) {
403 unsigned int i;
404
405 for (i = 0; i < mp->num_arcs; i++) {
406 struct mdesc_node *t = mp->arcs[i].arc;
407
408 if (strcmp(mp->arcs[i].name, "fwd"))
409 continue;
410
411 if (!strcmp(t->name, "cache"))
412 fill_in_one_cache(c, t);
413 }
414 }
415}
416
417static void __init mark_core_ids(struct mdesc_node *mp, int core_id)
418{
419 unsigned int i;
420
421 for (i = 0; i < mp->num_arcs; i++) {
422 struct mdesc_node *t = mp->arcs[i].arc;
423 const u64 *id;
424
425 if (strcmp(mp->arcs[i].name, "back"))
426 continue;
427
428 if (!strcmp(t->name, "cpu")) {
429 id = md_get_property(t, "id", NULL);
430 if (*id < NR_CPUS)
431 cpu_data(*id).core_id = core_id;
432 } else {
433 unsigned int j;
434
435 for (j = 0; j < t->num_arcs; j++) {
436 struct mdesc_node *n = t->arcs[j].arc;
437
438 if (strcmp(t->arcs[j].name, "back"))
439 continue;
440
441 if (strcmp(n->name, "cpu"))
442 continue;
443
444 id = md_get_property(n, "id", NULL);
445 if (*id < NR_CPUS)
446 cpu_data(*id).core_id = core_id;
447 }
448 }
449 }
450}
451
452static void __init set_core_ids(void)
453{
454 struct mdesc_node *mp;
455 int idx;
456
457 idx = 1;
458 md_for_each_node_by_name(mp, "cache") {
459 const u64 *level = md_get_property(mp, "level", NULL);
460 const char *type;
461 int len;
462
463 if (*level != 1)
464 continue;
465
466 type = md_get_property(mp, "type", &len);
467 if (!find_in_proplist(type, "instn", len))
468 continue;
469
470 mark_core_ids(mp, idx);
471
472 idx++;
473 }
474}
475
476static void __init get_one_mondo_bits(const u64 *p, unsigned int *mask, unsigned char def)
477{
478 u64 val;
479
480 if (!p)
481 goto use_default;
482 val = *p;
483
484 if (!val || val >= 64)
485 goto use_default;
486
487 *mask = ((1U << val) * 64U) - 1U;
488 return;
489
490use_default:
491 *mask = ((1U << def) * 64U) - 1U;
492}
493
494static void __init get_mondo_data(struct mdesc_node *mp, struct trap_per_cpu *tb)
495{
496 const u64 *val;
497
498 val = md_get_property(mp, "q-cpu-mondo-#bits", NULL);
499 get_one_mondo_bits(val, &tb->cpu_mondo_qmask, 7);
500
501 val = md_get_property(mp, "q-dev-mondo-#bits", NULL);
502 get_one_mondo_bits(val, &tb->dev_mondo_qmask, 7);
503
504 val = md_get_property(mp, "q-resumable-#bits", NULL);
505 get_one_mondo_bits(val, &tb->resum_qmask, 6);
506
507 val = md_get_property(mp, "q-nonresumable-#bits", NULL);
508 get_one_mondo_bits(val, &tb->nonresum_qmask, 2);
509}
510
511static void __init mdesc_fill_in_cpu_data(void)
512{
513 struct mdesc_node *mp;
514
515 ncpus_probed = 0;
516 md_for_each_node_by_name(mp, "cpu") {
517 const u64 *id = md_get_property(mp, "id", NULL);
518 const u64 *cfreq = md_get_property(mp, "clock-frequency", NULL);
519 struct trap_per_cpu *tb;
520 cpuinfo_sparc *c;
521 unsigned int i;
522 int cpuid;
523
524 ncpus_probed++;
525
526 cpuid = *id;
527
528#ifdef CONFIG_SMP
529 if (cpuid >= NR_CPUS)
530 continue;
531#else
532 /* On uniprocessor we only want the values for the
533 * real physical cpu the kernel booted onto, however
534 * cpu_data() only has one entry at index 0.
535 */
536 if (cpuid != real_hard_smp_processor_id())
537 continue;
538 cpuid = 0;
539#endif
540
541 c = &cpu_data(cpuid);
542 c->clock_tick = *cfreq;
543
544 tb = &trap_block[cpuid];
545 get_mondo_data(mp, tb);
546
547 for (i = 0; i < mp->num_arcs; i++) {
548 struct mdesc_node *t = mp->arcs[i].arc;
549 unsigned int j;
550
551 if (strcmp(mp->arcs[i].name, "fwd"))
552 continue;
553
554 if (!strcmp(t->name, "cache")) {
555 fill_in_one_cache(c, t);
556 continue;
557 }
558
559 for (j = 0; j < t->num_arcs; j++) {
560 struct mdesc_node *n;
561
562 n = t->arcs[j].arc;
563 if (strcmp(t->arcs[j].name, "fwd"))
564 continue;
565
566 if (!strcmp(n->name, "cache"))
567 fill_in_one_cache(c, n);
568 }
569 }
570
571#ifdef CONFIG_SMP
572 cpu_set(cpuid, cpu_present_map);
573 cpu_set(cpuid, phys_cpu_present_map);
574#endif
575
576 c->core_id = 0;
577 }
578
579 set_core_ids();
580
581 smp_fill_in_sib_core_maps();
582}
583
584void __init sun4v_mdesc_init(void)
585{
586 unsigned long len, real_len, status;
587
588 (void) sun4v_mach_desc(0UL, 0UL, &len);
589
590 printk("MDESC: Size is %lu bytes.\n", len);
591
592 main_mdesc = mdesc_early_alloc(len);
593
594 status = sun4v_mach_desc(__pa(main_mdesc), len, &real_len);
595 if (status != HV_EOK || real_len > len) {
596 prom_printf("sun4v_mach_desc fails, err(%lu), "
597 "len(%lu), real_len(%lu)\n",
598 status, len, real_len);
599 prom_halt();
600 }
601
602 len = count_nodes(main_mdesc);
603 printk("MDESC: %lu nodes.\n", len);
604
605 len = roundup_pow_of_two(len);
606
607 mdesc_hash = mdesc_early_alloc(len * sizeof(struct mdesc_node *));
608 mdesc_hash_size = len;
609
610 printk("MDESC: Hash size %lu entries.\n", len);
611
612 build_all_nodes(main_mdesc);
613
614 printk("MDESC: Built graph with %u bytes of memory.\n",
615 mdesc_early_allocated);
616
617 report_platform_properties();
618 mdesc_fill_in_cpu_data();
619}
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index d4c077dc5e85..38a32bc95d22 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -306,6 +306,20 @@ static void __init pci_controller_probe(void)
306 pci_controller_scan(pci_controller_init); 306 pci_controller_scan(pci_controller_init);
307} 307}
308 308
309static int ofpci_verbose;
310
311static int __init ofpci_debug(char *str)
312{
313 int val = 0;
314
315 get_option(&str, &val);
316 if (val)
317 ofpci_verbose = 1;
318 return 1;
319}
320
321__setup("ofpci_debug=", ofpci_debug);
322
309static unsigned long pci_parse_of_flags(u32 addr0) 323static unsigned long pci_parse_of_flags(u32 addr0)
310{ 324{
311 unsigned long flags = 0; 325 unsigned long flags = 0;
@@ -337,7 +351,9 @@ static void pci_parse_of_addrs(struct of_device *op,
337 addrs = of_get_property(node, "assigned-addresses", &proplen); 351 addrs = of_get_property(node, "assigned-addresses", &proplen);
338 if (!addrs) 352 if (!addrs)
339 return; 353 return;
340 printk(" parse addresses (%d bytes) @ %p\n", proplen, addrs); 354 if (ofpci_verbose)
355 printk(" parse addresses (%d bytes) @ %p\n",
356 proplen, addrs);
341 op_res = &op->resource[0]; 357 op_res = &op->resource[0];
342 for (; proplen >= 20; proplen -= 20, addrs += 5, op_res++) { 358 for (; proplen >= 20; proplen -= 20, addrs += 5, op_res++) {
343 struct resource *res; 359 struct resource *res;
@@ -348,8 +364,9 @@ static void pci_parse_of_addrs(struct of_device *op,
348 if (!flags) 364 if (!flags)
349 continue; 365 continue;
350 i = addrs[0] & 0xff; 366 i = addrs[0] & 0xff;
351 printk(" start: %lx, end: %lx, i: %x\n", 367 if (ofpci_verbose)
352 op_res->start, op_res->end, i); 368 printk(" start: %lx, end: %lx, i: %x\n",
369 op_res->start, op_res->end, i);
353 370
354 if (PCI_BASE_ADDRESS_0 <= i && i <= PCI_BASE_ADDRESS_5) { 371 if (PCI_BASE_ADDRESS_0 <= i && i <= PCI_BASE_ADDRESS_5) {
355 res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2]; 372 res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2];
@@ -393,8 +410,9 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
393 if (type == NULL) 410 if (type == NULL)
394 type = ""; 411 type = "";
395 412
396 printk(" create device, devfn: %x, type: %s hostcontroller(%d)\n", 413 if (ofpci_verbose)
397 devfn, type, host_controller); 414 printk(" create device, devfn: %x, type: %s\n",
415 devfn, type);
398 416
399 dev->bus = bus; 417 dev->bus = bus;
400 dev->sysdata = node; 418 dev->sysdata = node;
@@ -434,8 +452,9 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
434 sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus), 452 sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
435 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); 453 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
436 } 454 }
437 printk(" class: 0x%x device name: %s\n", 455 if (ofpci_verbose)
438 dev->class, pci_name(dev)); 456 printk(" class: 0x%x device name: %s\n",
457 dev->class, pci_name(dev));
439 458
440 /* I have seen IDE devices which will not respond to 459 /* I have seen IDE devices which will not respond to
441 * the bmdma simplex check reads if bus mastering is 460 * the bmdma simplex check reads if bus mastering is
@@ -469,7 +488,8 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
469 } 488 }
470 pci_parse_of_addrs(sd->op, node, dev); 489 pci_parse_of_addrs(sd->op, node, dev);
471 490
472 printk(" adding to system ...\n"); 491 if (ofpci_verbose)
492 printk(" adding to system ...\n");
473 493
474 pci_device_add(dev, bus); 494 pci_device_add(dev, bus);
475 495
@@ -547,7 +567,8 @@ static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm,
547 unsigned int flags; 567 unsigned int flags;
548 u64 size; 568 u64 size;
549 569
550 printk("of_scan_pci_bridge(%s)\n", node->full_name); 570 if (ofpci_verbose)
571 printk("of_scan_pci_bridge(%s)\n", node->full_name);
551 572
552 /* parse bus-range property */ 573 /* parse bus-range property */
553 busrange = of_get_property(node, "bus-range", &len); 574 busrange = of_get_property(node, "bus-range", &len);
@@ -632,7 +653,8 @@ static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm,
632simba_cont: 653simba_cont:
633 sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus), 654 sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
634 bus->number); 655 bus->number);
635 printk(" bus name: %s\n", bus->name); 656 if (ofpci_verbose)
657 printk(" bus name: %s\n", bus->name);
636 658
637 pci_of_scan_bus(pbm, node, bus); 659 pci_of_scan_bus(pbm, node, bus);
638} 660}
@@ -646,12 +668,14 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
646 int reglen, devfn; 668 int reglen, devfn;
647 struct pci_dev *dev; 669 struct pci_dev *dev;
648 670
649 printk("PCI: scan_bus[%s] bus no %d\n", 671 if (ofpci_verbose)
650 node->full_name, bus->number); 672 printk("PCI: scan_bus[%s] bus no %d\n",
673 node->full_name, bus->number);
651 674
652 child = NULL; 675 child = NULL;
653 while ((child = of_get_next_child(node, child)) != NULL) { 676 while ((child = of_get_next_child(node, child)) != NULL) {
654 printk(" * %s\n", child->full_name); 677 if (ofpci_verbose)
678 printk(" * %s\n", child->full_name);
655 reg = of_get_property(child, "reg", &reglen); 679 reg = of_get_property(child, "reg", &reglen);
656 if (reg == NULL || reglen < 20) 680 if (reg == NULL || reglen < 20)
657 continue; 681 continue;
@@ -661,7 +685,9 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
661 dev = of_create_pci_dev(pbm, child, bus, devfn, 0); 685 dev = of_create_pci_dev(pbm, child, bus, devfn, 0);
662 if (!dev) 686 if (!dev)
663 continue; 687 continue;
664 printk("PCI: dev header type: %x\n", dev->hdr_type); 688 if (ofpci_verbose)
689 printk("PCI: dev header type: %x\n",
690 dev->hdr_type);
665 691
666 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE || 692 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
667 dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) 693 dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c
index e2377796de89..323d6c278518 100644
--- a/arch/sparc64/kernel/pci_sabre.c
+++ b/arch/sparc64/kernel/pci_sabre.c
@@ -762,9 +762,10 @@ void sabre_init(struct device_node *dp, char *model_name)
762 /* Of course, Sun has to encode things a thousand 762 /* Of course, Sun has to encode things a thousand
763 * different ways, inconsistently. 763 * different ways, inconsistently.
764 */ 764 */
765 cpu_find_by_instance(0, &dp, NULL); 765 for_each_node_by_type(dp, "cpu") {
766 if (!strcmp(dp->name, "SUNW,UltraSPARC-IIe")) 766 if (!strcmp(dp->name, "SUNW,UltraSPARC-IIe"))
767 hummingbird_p = 1; 767 hummingbird_p = 1;
768 }
768 } 769 }
769 } 770 }
770 771
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c
index 044e8ec4c0f5..6b3fe2c1d65e 100644
--- a/arch/sparc64/kernel/pci_sun4v.c
+++ b/arch/sparc64/kernel/pci_sun4v.c
@@ -12,6 +12,7 @@
12#include <linux/percpu.h> 12#include <linux/percpu.h>
13#include <linux/irq.h> 13#include <linux/irq.h>
14#include <linux/msi.h> 14#include <linux/msi.h>
15#include <linux/log2.h>
15 16
16#include <asm/iommu.h> 17#include <asm/iommu.h>
17#include <asm/irq.h> 18#include <asm/irq.h>
@@ -26,6 +27,9 @@
26 27
27#include "pci_sun4v.h" 28#include "pci_sun4v.h"
28 29
30static unsigned long vpci_major = 1;
31static unsigned long vpci_minor = 1;
32
29#define PGLIST_NENTS (PAGE_SIZE / sizeof(u64)) 33#define PGLIST_NENTS (PAGE_SIZE / sizeof(u64))
30 34
31struct iommu_batch { 35struct iommu_batch {
@@ -638,9 +642,8 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
638{ 642{
639 struct iommu *iommu = pbm->iommu; 643 struct iommu *iommu = pbm->iommu;
640 struct property *prop; 644 struct property *prop;
641 unsigned long num_tsb_entries, sz; 645 unsigned long num_tsb_entries, sz, tsbsize;
642 u32 vdma[2], dma_mask, dma_offset; 646 u32 vdma[2], dma_mask, dma_offset;
643 int tsbsize;
644 647
645 prop = of_find_property(pbm->prom_node, "virtual-dma", NULL); 648 prop = of_find_property(pbm->prom_node, "virtual-dma", NULL);
646 if (prop) { 649 if (prop) {
@@ -654,31 +657,15 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
654 vdma[1] = 0x80000000; 657 vdma[1] = 0x80000000;
655 } 658 }
656 659
657 dma_mask = vdma[0]; 660 if ((vdma[0] | vdma[1]) & ~IO_PAGE_MASK) {
658 switch (vdma[1]) { 661 prom_printf("PCI-SUN4V: strange virtual-dma[%08x:%08x].\n",
659 case 0x20000000: 662 vdma[0], vdma[1]);
660 dma_mask |= 0x1fffffff; 663 prom_halt();
661 tsbsize = 64;
662 break;
663
664 case 0x40000000:
665 dma_mask |= 0x3fffffff;
666 tsbsize = 128;
667 break;
668
669 case 0x80000000:
670 dma_mask |= 0x7fffffff;
671 tsbsize = 256;
672 break;
673
674 default:
675 prom_printf("PCI-SUN4V: strange virtual-dma size.\n");
676 prom_halt();
677 }; 664 };
678 665
679 tsbsize *= (8 * 1024); 666 dma_mask = (roundup_pow_of_two(vdma[1]) - 1UL);
680 667 num_tsb_entries = vdma[1] / IO_PAGE_SIZE;
681 num_tsb_entries = tsbsize / sizeof(iopte_t); 668 tsbsize = num_tsb_entries * sizeof(iopte_t);
682 669
683 dma_offset = vdma[0]; 670 dma_offset = vdma[0];
684 671
@@ -689,7 +676,7 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
689 iommu->dma_addr_mask = dma_mask; 676 iommu->dma_addr_mask = dma_mask;
690 677
691 /* Allocate and initialize the free area map. */ 678 /* Allocate and initialize the free area map. */
692 sz = num_tsb_entries / 8; 679 sz = (num_tsb_entries + 7) / 8;
693 sz = (sz + 7UL) & ~7UL; 680 sz = (sz + 7UL) & ~7UL;
694 iommu->arena.map = kzalloc(sz, GFP_KERNEL); 681 iommu->arena.map = kzalloc(sz, GFP_KERNEL);
695 if (!iommu->arena.map) { 682 if (!iommu->arena.map) {
@@ -1178,6 +1165,7 @@ static void pci_sun4v_pbm_init(struct pci_controller_info *p, struct device_node
1178 1165
1179void sun4v_pci_init(struct device_node *dp, char *model_name) 1166void sun4v_pci_init(struct device_node *dp, char *model_name)
1180{ 1167{
1168 static int hvapi_negotiated = 0;
1181 struct pci_controller_info *p; 1169 struct pci_controller_info *p;
1182 struct pci_pbm_info *pbm; 1170 struct pci_pbm_info *pbm;
1183 struct iommu *iommu; 1171 struct iommu *iommu;
@@ -1186,6 +1174,20 @@ void sun4v_pci_init(struct device_node *dp, char *model_name)
1186 u32 devhandle; 1174 u32 devhandle;
1187 int i; 1175 int i;
1188 1176
1177 if (!hvapi_negotiated++) {
1178 int err = sun4v_hvapi_register(HV_GRP_PCI,
1179 vpci_major,
1180 &vpci_minor);
1181
1182 if (err) {
1183 prom_printf("SUN4V_PCI: Could not register hvapi, "
1184 "err=%d\n", err);
1185 prom_halt();
1186 }
1187 printk("SUN4V_PCI: Registered hvapi major[%lu] minor[%lu]\n",
1188 vpci_major, vpci_minor);
1189 }
1190
1189 prop = of_find_property(dp, "reg", NULL); 1191 prop = of_find_property(dp, "reg", NULL);
1190 regs = prop->value; 1192 regs = prop->value;
1191 1193
diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c
index 699b24b890df..5d6adea3967f 100644
--- a/arch/sparc64/kernel/power.c
+++ b/arch/sparc64/kernel/power.c
@@ -19,6 +19,7 @@
19#include <asm/prom.h> 19#include <asm/prom.h>
20#include <asm/of_device.h> 20#include <asm/of_device.h>
21#include <asm/io.h> 21#include <asm/io.h>
22#include <asm/sstate.h>
22 23
23#include <linux/unistd.h> 24#include <linux/unistd.h>
24 25
@@ -53,6 +54,7 @@ static void (*poweroff_method)(void) = machine_alt_power_off;
53 54
54void machine_power_off(void) 55void machine_power_off(void)
55{ 56{
57 sstate_poweroff();
56 if (!serial_console || scons_pwroff) { 58 if (!serial_console || scons_pwroff) {
57#ifdef CONFIG_PCI 59#ifdef CONFIG_PCI
58 if (power_reg) { 60 if (power_reg) {
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 952762bfb4c0..f5f97e2c669c 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -45,6 +45,7 @@
45#include <asm/mmu_context.h> 45#include <asm/mmu_context.h>
46#include <asm/unistd.h> 46#include <asm/unistd.h>
47#include <asm/hypervisor.h> 47#include <asm/hypervisor.h>
48#include <asm/sstate.h>
48 49
49/* #define VERBOSE_SHOWREGS */ 50/* #define VERBOSE_SHOWREGS */
50 51
@@ -106,6 +107,7 @@ extern void (*prom_keyboard)(void);
106 107
107void machine_halt(void) 108void machine_halt(void)
108{ 109{
110 sstate_halt();
109 if (!serial_console && prom_palette) 111 if (!serial_console && prom_palette)
110 prom_palette (1); 112 prom_palette (1);
111 if (prom_keyboard) 113 if (prom_keyboard)
@@ -116,6 +118,7 @@ void machine_halt(void)
116 118
117void machine_alt_power_off(void) 119void machine_alt_power_off(void)
118{ 120{
121 sstate_poweroff();
119 if (!serial_console && prom_palette) 122 if (!serial_console && prom_palette)
120 prom_palette(1); 123 prom_palette(1);
121 if (prom_keyboard) 124 if (prom_keyboard)
@@ -128,6 +131,7 @@ void machine_restart(char * cmd)
128{ 131{
129 char *p; 132 char *p;
130 133
134 sstate_reboot();
131 p = strchr (reboot_command, '\n'); 135 p = strchr (reboot_command, '\n');
132 if (p) *p = 0; 136 if (p) *p = 0;
133 if (!serial_console && prom_palette) 137 if (!serial_console && prom_palette)
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 02830e4671f5..dad4b3ba705f 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -28,6 +28,7 @@
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/asi.h> 29#include <asm/asi.h>
30#include <asm/upa.h> 30#include <asm/upa.h>
31#include <asm/smp.h>
31 32
32static struct device_node *allnodes; 33static struct device_node *allnodes;
33 34
@@ -1665,6 +1666,150 @@ static struct device_node * __init build_tree(struct device_node *parent, phandl
1665 return ret; 1666 return ret;
1666} 1667}
1667 1668
1669static const char *get_mid_prop(void)
1670{
1671 return (tlb_type == spitfire ? "upa-portid" : "portid");
1672}
1673
1674struct device_node *of_find_node_by_cpuid(int cpuid)
1675{
1676 struct device_node *dp;
1677 const char *mid_prop = get_mid_prop();
1678
1679 for_each_node_by_type(dp, "cpu") {
1680 int id = of_getintprop_default(dp, mid_prop, -1);
1681 const char *this_mid_prop = mid_prop;
1682
1683 if (id < 0) {
1684 this_mid_prop = "cpuid";
1685 id = of_getintprop_default(dp, this_mid_prop, -1);
1686 }
1687
1688 if (id < 0) {
1689 prom_printf("OF: Serious problem, cpu lacks "
1690 "%s property", this_mid_prop);
1691 prom_halt();
1692 }
1693 if (cpuid == id)
1694 return dp;
1695 }
1696 return NULL;
1697}
1698
1699static void __init of_fill_in_cpu_data(void)
1700{
1701 struct device_node *dp;
1702 const char *mid_prop = get_mid_prop();
1703
1704 ncpus_probed = 0;
1705 for_each_node_by_type(dp, "cpu") {
1706 int cpuid = of_getintprop_default(dp, mid_prop, -1);
1707 const char *this_mid_prop = mid_prop;
1708 struct device_node *portid_parent;
1709 int portid = -1;
1710
1711 portid_parent = NULL;
1712 if (cpuid < 0) {
1713 this_mid_prop = "cpuid";
1714 cpuid = of_getintprop_default(dp, this_mid_prop, -1);
1715 if (cpuid >= 0) {
1716 int limit = 2;
1717
1718 portid_parent = dp;
1719 while (limit--) {
1720 portid_parent = portid_parent->parent;
1721 if (!portid_parent)
1722 break;
1723 portid = of_getintprop_default(portid_parent,
1724 "portid", -1);
1725 if (portid >= 0)
1726 break;
1727 }
1728 }
1729 }
1730
1731 if (cpuid < 0) {
1732 prom_printf("OF: Serious problem, cpu lacks "
1733 "%s property", this_mid_prop);
1734 prom_halt();
1735 }
1736
1737 ncpus_probed++;
1738
1739#ifdef CONFIG_SMP
1740 if (cpuid >= NR_CPUS)
1741 continue;
1742#else
1743 /* On uniprocessor we only want the values for the
1744 * real physical cpu the kernel booted onto, however
1745 * cpu_data() only has one entry at index 0.
1746 */
1747 if (cpuid != real_hard_smp_processor_id())
1748 continue;
1749 cpuid = 0;
1750#endif
1751
1752 cpu_data(cpuid).clock_tick =
1753 of_getintprop_default(dp, "clock-frequency", 0);
1754
1755 if (portid_parent) {
1756 cpu_data(cpuid).dcache_size =
1757 of_getintprop_default(dp, "l1-dcache-size",
1758 16 * 1024);
1759 cpu_data(cpuid).dcache_line_size =
1760 of_getintprop_default(dp, "l1-dcache-line-size",
1761 32);
1762 cpu_data(cpuid).icache_size =
1763 of_getintprop_default(dp, "l1-icache-size",
1764 8 * 1024);
1765 cpu_data(cpuid).icache_line_size =
1766 of_getintprop_default(dp, "l1-icache-line-size",
1767 32);
1768 cpu_data(cpuid).ecache_size =
1769 of_getintprop_default(dp, "l2-cache-size", 0);
1770 cpu_data(cpuid).ecache_line_size =
1771 of_getintprop_default(dp, "l2-cache-line-size", 0);
1772 if (!cpu_data(cpuid).ecache_size ||
1773 !cpu_data(cpuid).ecache_line_size) {
1774 cpu_data(cpuid).ecache_size =
1775 of_getintprop_default(portid_parent,
1776 "l2-cache-size",
1777 (4 * 1024 * 1024));
1778 cpu_data(cpuid).ecache_line_size =
1779 of_getintprop_default(portid_parent,
1780 "l2-cache-line-size", 64);
1781 }
1782
1783 cpu_data(cpuid).core_id = portid + 1;
1784 } else {
1785 cpu_data(cpuid).dcache_size =
1786 of_getintprop_default(dp, "dcache-size", 16 * 1024);
1787 cpu_data(cpuid).dcache_line_size =
1788 of_getintprop_default(dp, "dcache-line-size", 32);
1789
1790 cpu_data(cpuid).icache_size =
1791 of_getintprop_default(dp, "icache-size", 16 * 1024);
1792 cpu_data(cpuid).icache_line_size =
1793 of_getintprop_default(dp, "icache-line-size", 32);
1794
1795 cpu_data(cpuid).ecache_size =
1796 of_getintprop_default(dp, "ecache-size",
1797 (4 * 1024 * 1024));
1798 cpu_data(cpuid).ecache_line_size =
1799 of_getintprop_default(dp, "ecache-line-size", 64);
1800
1801 cpu_data(cpuid).core_id = 0;
1802 }
1803
1804#ifdef CONFIG_SMP
1805 cpu_set(cpuid, cpu_present_map);
1806 cpu_set(cpuid, phys_cpu_present_map);
1807#endif
1808 }
1809
1810 smp_fill_in_sib_core_maps();
1811}
1812
1668void __init prom_build_devicetree(void) 1813void __init prom_build_devicetree(void)
1669{ 1814{
1670 struct device_node **nextp; 1815 struct device_node **nextp;
@@ -1679,4 +1824,7 @@ void __init prom_build_devicetree(void)
1679 &nextp); 1824 &nextp);
1680 printk("PROM: Built device tree with %u bytes of memory.\n", 1825 printk("PROM: Built device tree with %u bytes of memory.\n",
1681 prom_early_allocated); 1826 prom_early_allocated);
1827
1828 if (tlb_type != hypervisor)
1829 of_fill_in_cpu_data();
1682} 1830}
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index dea9c3c9ec5f..de9b4c13f1c7 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -46,11 +46,17 @@
46#include <asm/sections.h> 46#include <asm/sections.h>
47#include <asm/setup.h> 47#include <asm/setup.h>
48#include <asm/mmu.h> 48#include <asm/mmu.h>
49#include <asm/ns87303.h>
49 50
50#ifdef CONFIG_IP_PNP 51#ifdef CONFIG_IP_PNP
51#include <net/ipconfig.h> 52#include <net/ipconfig.h>
52#endif 53#endif
53 54
55/* Used to synchronize accesses to NatSemi SUPER I/O chip configure
56 * operations in asm/ns87303.h
57 */
58DEFINE_SPINLOCK(ns87303_lock);
59
54struct screen_info screen_info = { 60struct screen_info screen_info = {
55 0, 0, /* orig-x, orig-y */ 61 0, 0, /* orig-x, orig-y */
56 0, /* unused */ 62 0, /* unused */
@@ -370,8 +376,6 @@ void __init setup_arch(char **cmdline_p)
370 init_cur_cpu_trap(current_thread_info()); 376 init_cur_cpu_trap(current_thread_info());
371 377
372 paging_init(); 378 paging_init();
373
374 smp_setup_cpu_possible_map();
375} 379}
376 380
377static int __init set_preferred_console(void) 381static int __init set_preferred_console(void)
@@ -424,7 +428,7 @@ extern void mmu_info(struct seq_file *);
424unsigned int dcache_parity_tl1_occurred; 428unsigned int dcache_parity_tl1_occurred;
425unsigned int icache_parity_tl1_occurred; 429unsigned int icache_parity_tl1_occurred;
426 430
427static int ncpus_probed; 431int ncpus_probed;
428 432
429static int show_cpuinfo(struct seq_file *m, void *__unused) 433static int show_cpuinfo(struct seq_file *m, void *__unused)
430{ 434{
@@ -516,14 +520,6 @@ static int __init topology_init(void)
516 520
517 err = -ENOMEM; 521 err = -ENOMEM;
518 522
519 /* Count the number of physically present processors in
520 * the machine, even on uniprocessor, so that /proc/cpuinfo
521 * output is consistent with 2.4.x
522 */
523 ncpus_probed = 0;
524 while (!cpu_find_by_instance(ncpus_probed, NULL, NULL))
525 ncpus_probed++;
526
527 for_each_possible_cpu(i) { 523 for_each_possible_cpu(i) {
528 struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL); 524 struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
529 if (p) { 525 if (p) {
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 24fdf1d0adc5..c550bba3490a 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -40,6 +40,7 @@
40#include <asm/tlb.h> 40#include <asm/tlb.h>
41#include <asm/sections.h> 41#include <asm/sections.h>
42#include <asm/prom.h> 42#include <asm/prom.h>
43#include <asm/mdesc.h>
43 44
44extern void calibrate_delay(void); 45extern void calibrate_delay(void);
45 46
@@ -75,53 +76,6 @@ void smp_bogo(struct seq_file *m)
75 i, cpu_data(i).clock_tick); 76 i, cpu_data(i).clock_tick);
76} 77}
77 78
78void __init smp_store_cpu_info(int id)
79{
80 struct device_node *dp;
81 int def;
82
83 cpu_data(id).udelay_val = loops_per_jiffy;
84
85 cpu_find_by_mid(id, &dp);
86 cpu_data(id).clock_tick =
87 of_getintprop_default(dp, "clock-frequency", 0);
88
89 def = ((tlb_type == hypervisor) ? (8 * 1024) : (16 * 1024));
90 cpu_data(id).dcache_size =
91 of_getintprop_default(dp, "dcache-size", def);
92
93 def = 32;
94 cpu_data(id).dcache_line_size =
95 of_getintprop_default(dp, "dcache-line-size", def);
96
97 def = 16 * 1024;
98 cpu_data(id).icache_size =
99 of_getintprop_default(dp, "icache-size", def);
100
101 def = 32;
102 cpu_data(id).icache_line_size =
103 of_getintprop_default(dp, "icache-line-size", def);
104
105 def = ((tlb_type == hypervisor) ?
106 (3 * 1024 * 1024) :
107 (4 * 1024 * 1024));
108 cpu_data(id).ecache_size =
109 of_getintprop_default(dp, "ecache-size", def);
110
111 def = 64;
112 cpu_data(id).ecache_line_size =
113 of_getintprop_default(dp, "ecache-line-size", def);
114
115 printk("CPU[%d]: Caches "
116 "D[sz(%d):line_sz(%d)] "
117 "I[sz(%d):line_sz(%d)] "
118 "E[sz(%d):line_sz(%d)]\n",
119 id,
120 cpu_data(id).dcache_size, cpu_data(id).dcache_line_size,
121 cpu_data(id).icache_size, cpu_data(id).icache_line_size,
122 cpu_data(id).ecache_size, cpu_data(id).ecache_line_size);
123}
124
125extern void setup_sparc64_timer(void); 79extern void setup_sparc64_timer(void);
126 80
127static volatile unsigned long callin_flag = 0; 81static volatile unsigned long callin_flag = 0;
@@ -145,7 +99,7 @@ void __init smp_callin(void)
145 local_irq_enable(); 99 local_irq_enable();
146 100
147 calibrate_delay(); 101 calibrate_delay();
148 smp_store_cpu_info(cpuid); 102 cpu_data(cpuid).udelay_val = loops_per_jiffy;
149 callin_flag = 1; 103 callin_flag = 1;
150 __asm__ __volatile__("membar #Sync\n\t" 104 __asm__ __volatile__("membar #Sync\n\t"
151 "flush %%g6" : : : "memory"); 105 "flush %%g6" : : : "memory");
@@ -340,9 +294,8 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu)
340 294
341 prom_startcpu_cpuid(cpu, entry, cookie); 295 prom_startcpu_cpuid(cpu, entry, cookie);
342 } else { 296 } else {
343 struct device_node *dp; 297 struct device_node *dp = of_find_node_by_cpuid(cpu);
344 298
345 cpu_find_by_mid(cpu, &dp);
346 prom_startcpu(dp->node, entry, cookie); 299 prom_startcpu(dp->node, entry, cookie);
347 } 300 }
348 301
@@ -447,7 +400,7 @@ static __inline__ void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, c
447static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask) 400static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask)
448{ 401{
449 u64 pstate, ver; 402 u64 pstate, ver;
450 int nack_busy_id, is_jbus; 403 int nack_busy_id, is_jbus, need_more;
451 404
452 if (cpus_empty(mask)) 405 if (cpus_empty(mask))
453 return; 406 return;
@@ -463,6 +416,7 @@ static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mas
463 __asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate)); 416 __asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate));
464 417
465retry: 418retry:
419 need_more = 0;
466 __asm__ __volatile__("wrpr %0, %1, %%pstate\n\t" 420 __asm__ __volatile__("wrpr %0, %1, %%pstate\n\t"
467 : : "r" (pstate), "i" (PSTATE_IE)); 421 : : "r" (pstate), "i" (PSTATE_IE));
468 422
@@ -491,6 +445,10 @@ retry:
491 : /* no outputs */ 445 : /* no outputs */
492 : "r" (target), "i" (ASI_INTR_W)); 446 : "r" (target), "i" (ASI_INTR_W));
493 nack_busy_id++; 447 nack_busy_id++;
448 if (nack_busy_id == 32) {
449 need_more = 1;
450 break;
451 }
494 } 452 }
495 } 453 }
496 454
@@ -507,6 +465,16 @@ retry:
507 if (dispatch_stat == 0UL) { 465 if (dispatch_stat == 0UL) {
508 __asm__ __volatile__("wrpr %0, 0x0, %%pstate" 466 __asm__ __volatile__("wrpr %0, 0x0, %%pstate"
509 : : "r" (pstate)); 467 : : "r" (pstate));
468 if (unlikely(need_more)) {
469 int i, cnt = 0;
470 for_each_cpu_mask(i, mask) {
471 cpu_clear(i, mask);
472 cnt++;
473 if (cnt == 32)
474 break;
475 }
476 goto retry;
477 }
510 return; 478 return;
511 } 479 }
512 if (!--stuck) 480 if (!--stuck)
@@ -544,6 +512,8 @@ retry:
544 if ((dispatch_stat & check_mask) == 0) 512 if ((dispatch_stat & check_mask) == 0)
545 cpu_clear(i, mask); 513 cpu_clear(i, mask);
546 this_busy_nack += 2; 514 this_busy_nack += 2;
515 if (this_busy_nack == 64)
516 break;
547 } 517 }
548 518
549 goto retry; 519 goto retry;
@@ -1191,23 +1161,14 @@ int setup_profiling_timer(unsigned int multiplier)
1191 1161
1192static void __init smp_tune_scheduling(void) 1162static void __init smp_tune_scheduling(void)
1193{ 1163{
1194 struct device_node *dp; 1164 unsigned int smallest = ~0U;
1195 int instance; 1165 int i;
1196 unsigned int def, smallest = ~0U;
1197
1198 def = ((tlb_type == hypervisor) ?
1199 (3 * 1024 * 1024) :
1200 (4 * 1024 * 1024));
1201 1166
1202 instance = 0; 1167 for (i = 0; i < NR_CPUS; i++) {
1203 while (!cpu_find_by_instance(instance, &dp, NULL)) { 1168 unsigned int val = cpu_data(i).ecache_size;
1204 unsigned int val;
1205 1169
1206 val = of_getintprop_default(dp, "ecache-size", def); 1170 if (val && val < smallest)
1207 if (val < smallest)
1208 smallest = val; 1171 smallest = val;
1209
1210 instance++;
1211 } 1172 }
1212 1173
1213 /* Any value less than 256K is nonsense. */ 1174 /* Any value less than 256K is nonsense. */
@@ -1230,58 +1191,42 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
1230 int i; 1191 int i;
1231 1192
1232 if (num_possible_cpus() > max_cpus) { 1193 if (num_possible_cpus() > max_cpus) {
1233 int instance, mid; 1194 for_each_possible_cpu(i) {
1234 1195 if (i != boot_cpu_id) {
1235 instance = 0; 1196 cpu_clear(i, phys_cpu_present_map);
1236 while (!cpu_find_by_instance(instance, NULL, &mid)) { 1197 cpu_clear(i, cpu_present_map);
1237 if (mid != boot_cpu_id) {
1238 cpu_clear(mid, phys_cpu_present_map);
1239 cpu_clear(mid, cpu_present_map);
1240 if (num_possible_cpus() <= max_cpus) 1198 if (num_possible_cpus() <= max_cpus)
1241 break; 1199 break;
1242 } 1200 }
1243 instance++;
1244 } 1201 }
1245 } 1202 }
1246 1203
1247 for_each_possible_cpu(i) { 1204 cpu_data(boot_cpu_id).udelay_val = loops_per_jiffy;
1248 if (tlb_type == hypervisor) {
1249 int j;
1250
1251 /* XXX get this mapping from machine description */
1252 for_each_possible_cpu(j) {
1253 if ((j >> 2) == (i >> 2))
1254 cpu_set(j, cpu_sibling_map[i]);
1255 }
1256 } else {
1257 cpu_set(i, cpu_sibling_map[i]);
1258 }
1259 }
1260
1261 smp_store_cpu_info(boot_cpu_id);
1262 smp_tune_scheduling(); 1205 smp_tune_scheduling();
1263} 1206}
1264 1207
1265/* Set this up early so that things like the scheduler can init 1208void __devinit smp_prepare_boot_cpu(void)
1266 * properly. We use the same cpu mask for both the present and
1267 * possible cpu map.
1268 */
1269void __init smp_setup_cpu_possible_map(void)
1270{ 1209{
1271 int instance, mid;
1272
1273 instance = 0;
1274 while (!cpu_find_by_instance(instance, NULL, &mid)) {
1275 if (mid < NR_CPUS) {
1276 cpu_set(mid, phys_cpu_present_map);
1277 cpu_set(mid, cpu_present_map);
1278 }
1279 instance++;
1280 }
1281} 1210}
1282 1211
1283void __devinit smp_prepare_boot_cpu(void) 1212void __devinit smp_fill_in_sib_core_maps(void)
1284{ 1213{
1214 unsigned int i;
1215
1216 for_each_possible_cpu(i) {
1217 unsigned int j;
1218
1219 if (cpu_data(i).core_id == 0) {
1220 cpu_set(i, cpu_sibling_map[i]);
1221 continue;
1222 }
1223
1224 for_each_possible_cpu(j) {
1225 if (cpu_data(i).core_id ==
1226 cpu_data(j).core_id)
1227 cpu_set(j, cpu_sibling_map[i]);
1228 }
1229 }
1285} 1230}
1286 1231
1287int __cpuinit __cpu_up(unsigned int cpu) 1232int __cpuinit __cpu_up(unsigned int cpu)
@@ -1337,7 +1282,7 @@ unsigned long __per_cpu_shift __read_mostly;
1337EXPORT_SYMBOL(__per_cpu_base); 1282EXPORT_SYMBOL(__per_cpu_base);
1338EXPORT_SYMBOL(__per_cpu_shift); 1283EXPORT_SYMBOL(__per_cpu_shift);
1339 1284
1340void __init setup_per_cpu_areas(void) 1285void __init real_setup_per_cpu_areas(void)
1341{ 1286{
1342 unsigned long goal, size, i; 1287 unsigned long goal, size, i;
1343 char *ptr; 1288 char *ptr;
diff --git a/arch/sparc64/kernel/sstate.c b/arch/sparc64/kernel/sstate.c
new file mode 100644
index 000000000000..5b6e75b7f052
--- /dev/null
+++ b/arch/sparc64/kernel/sstate.c
@@ -0,0 +1,104 @@
1/* sstate.c: System soft state support.
2 *
3 * Copyright (C) 2007 David S. Miller <davem@davemloft.net>
4 */
5
6#include <linux/kernel.h>
7#include <linux/notifier.h>
8#include <linux/init.h>
9
10#include <asm/hypervisor.h>
11#include <asm/sstate.h>
12#include <asm/oplib.h>
13#include <asm/head.h>
14#include <asm/io.h>
15
16static int hv_supports_soft_state;
17
18static unsigned long kimage_addr_to_ra(const char *p)
19{
20 unsigned long val = (unsigned long) p;
21
22 return kern_base + (val - KERNBASE);
23}
24
25static void do_set_sstate(unsigned long state, const char *msg)
26{
27 unsigned long err;
28
29 if (!hv_supports_soft_state)
30 return;
31
32 err = sun4v_mach_set_soft_state(state, kimage_addr_to_ra(msg));
33 if (err) {
34 printk(KERN_WARNING "SSTATE: Failed to set soft-state to "
35 "state[%lx] msg[%s], err=%lu\n",
36 state, msg, err);
37 }
38}
39
40static const char booting_msg[32] __attribute__((aligned(32))) =
41 "Linux booting";
42static const char running_msg[32] __attribute__((aligned(32))) =
43 "Linux running";
44static const char halting_msg[32] __attribute__((aligned(32))) =
45 "Linux halting";
46static const char poweroff_msg[32] __attribute__((aligned(32))) =
47 "Linux powering off";
48static const char rebooting_msg[32] __attribute__((aligned(32))) =
49 "Linux rebooting";
50static const char panicing_msg[32] __attribute__((aligned(32))) =
51 "Linux panicing";
52
53void sstate_booting(void)
54{
55 do_set_sstate(HV_SOFT_STATE_TRANSITION, booting_msg);
56}
57
58void sstate_running(void)
59{
60 do_set_sstate(HV_SOFT_STATE_NORMAL, running_msg);
61}
62
63void sstate_halt(void)
64{
65 do_set_sstate(HV_SOFT_STATE_TRANSITION, halting_msg);
66}
67
68void sstate_poweroff(void)
69{
70 do_set_sstate(HV_SOFT_STATE_TRANSITION, poweroff_msg);
71}
72
73void sstate_reboot(void)
74{
75 do_set_sstate(HV_SOFT_STATE_TRANSITION, rebooting_msg);
76}
77
78static int sstate_panic_event(struct notifier_block *n, unsigned long event, void *ptr)
79{
80 do_set_sstate(HV_SOFT_STATE_TRANSITION, panicing_msg);
81
82 return NOTIFY_DONE;
83}
84
85static struct notifier_block sstate_panic_block = {
86 .notifier_call = sstate_panic_event,
87 .priority = INT_MAX,
88};
89
90void __init sun4v_sstate_init(void)
91{
92 unsigned long major, minor;
93
94 major = 1;
95 minor = 0;
96 if (sun4v_hvapi_register(HV_GRP_SOFT_STATE, major, &minor))
97 return;
98
99 hv_supports_soft_state = 1;
100
101 prom_sun4v_guest_soft_state();
102 atomic_notifier_chain_register(&panic_notifier_list,
103 &sstate_panic_block);
104}
diff --git a/arch/sparc64/kernel/sun4v_ivec.S b/arch/sparc64/kernel/sun4v_ivec.S
index 405855dd886b..574bc248bca6 100644
--- a/arch/sparc64/kernel/sun4v_ivec.S
+++ b/arch/sparc64/kernel/sun4v_ivec.S
@@ -22,12 +22,12 @@ sun4v_cpu_mondo:
22 be,pn %xcc, sun4v_cpu_mondo_queue_empty 22 be,pn %xcc, sun4v_cpu_mondo_queue_empty
23 nop 23 nop
24 24
25 /* Get &trap_block[smp_processor_id()] into %g3. */ 25 /* Get &trap_block[smp_processor_id()] into %g4. */
26 ldxa [%g0] ASI_SCRATCHPAD, %g3 26 ldxa [%g0] ASI_SCRATCHPAD, %g4
27 sub %g3, TRAP_PER_CPU_FAULT_INFO, %g3 27 sub %g4, TRAP_PER_CPU_FAULT_INFO, %g4
28 28
29 /* Get CPU mondo queue base phys address into %g7. */ 29 /* Get CPU mondo queue base phys address into %g7. */
30 ldx [%g3 + TRAP_PER_CPU_CPU_MONDO_PA], %g7 30 ldx [%g4 + TRAP_PER_CPU_CPU_MONDO_PA], %g7
31 31
32 /* Now get the cross-call arguments and handler PC, same 32 /* Now get the cross-call arguments and handler PC, same
33 * layout as sun4u: 33 * layout as sun4u:
@@ -47,8 +47,7 @@ sun4v_cpu_mondo:
47 add %g2, 0x40 - 0x8 - 0x8, %g2 47 add %g2, 0x40 - 0x8 - 0x8, %g2
48 48
49 /* Update queue head pointer. */ 49 /* Update queue head pointer. */
50 sethi %hi(8192 - 1), %g4 50 lduw [%g4 + TRAP_PER_CPU_CPU_MONDO_QMASK], %g4
51 or %g4, %lo(8192 - 1), %g4
52 and %g2, %g4, %g2 51 and %g2, %g4, %g2
53 52
54 mov INTRQ_CPU_MONDO_HEAD, %g4 53 mov INTRQ_CPU_MONDO_HEAD, %g4
@@ -71,12 +70,12 @@ sun4v_dev_mondo:
71 be,pn %xcc, sun4v_dev_mondo_queue_empty 70 be,pn %xcc, sun4v_dev_mondo_queue_empty
72 nop 71 nop
73 72
74 /* Get &trap_block[smp_processor_id()] into %g3. */ 73 /* Get &trap_block[smp_processor_id()] into %g4. */
75 ldxa [%g0] ASI_SCRATCHPAD, %g3 74 ldxa [%g0] ASI_SCRATCHPAD, %g4
76 sub %g3, TRAP_PER_CPU_FAULT_INFO, %g3 75 sub %g4, TRAP_PER_CPU_FAULT_INFO, %g4
77 76
78 /* Get DEV mondo queue base phys address into %g5. */ 77 /* Get DEV mondo queue base phys address into %g5. */
79 ldx [%g3 + TRAP_PER_CPU_DEV_MONDO_PA], %g5 78 ldx [%g4 + TRAP_PER_CPU_DEV_MONDO_PA], %g5
80 79
81 /* Load IVEC into %g3. */ 80 /* Load IVEC into %g3. */
82 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3 81 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
@@ -90,8 +89,7 @@ sun4v_dev_mondo:
90 */ 89 */
91 90
92 /* Update queue head pointer, this frees up some registers. */ 91 /* Update queue head pointer, this frees up some registers. */
93 sethi %hi(8192 - 1), %g4 92 lduw [%g4 + TRAP_PER_CPU_DEV_MONDO_QMASK], %g4
94 or %g4, %lo(8192 - 1), %g4
95 and %g2, %g4, %g2 93 and %g2, %g4, %g2
96 94
97 mov INTRQ_DEVICE_MONDO_HEAD, %g4 95 mov INTRQ_DEVICE_MONDO_HEAD, %g4
@@ -143,6 +141,8 @@ sun4v_res_mondo:
143 brnz,pn %g1, sun4v_res_mondo_queue_full 141 brnz,pn %g1, sun4v_res_mondo_queue_full
144 nop 142 nop
145 143
144 lduw [%g3 + TRAP_PER_CPU_RESUM_QMASK], %g4
145
146 /* Remember this entry's offset in %g1. */ 146 /* Remember this entry's offset in %g1. */
147 mov %g2, %g1 147 mov %g2, %g1
148 148
@@ -173,8 +173,6 @@ sun4v_res_mondo:
173 add %g2, 0x08, %g2 173 add %g2, 0x08, %g2
174 174
175 /* Update queue head pointer. */ 175 /* Update queue head pointer. */
176 sethi %hi(8192 - 1), %g4
177 or %g4, %lo(8192 - 1), %g4
178 and %g2, %g4, %g2 176 and %g2, %g4, %g2
179 177
180 mov INTRQ_RESUM_MONDO_HEAD, %g4 178 mov INTRQ_RESUM_MONDO_HEAD, %g4
@@ -254,6 +252,8 @@ sun4v_nonres_mondo:
254 brnz,pn %g1, sun4v_nonres_mondo_queue_full 252 brnz,pn %g1, sun4v_nonres_mondo_queue_full
255 nop 253 nop
256 254
255 lduw [%g3 + TRAP_PER_CPU_NONRESUM_QMASK], %g4
256
257 /* Remember this entry's offset in %g1. */ 257 /* Remember this entry's offset in %g1. */
258 mov %g2, %g1 258 mov %g2, %g1
259 259
@@ -284,8 +284,6 @@ sun4v_nonres_mondo:
284 add %g2, 0x08, %g2 284 add %g2, 0x08, %g2
285 285
286 /* Update queue head pointer. */ 286 /* Update queue head pointer. */
287 sethi %hi(8192 - 1), %g4
288 or %g4, %lo(8192 - 1), %g4
289 and %g2, %g4, %g2 287 and %g2, %g4, %g2
290 288
291 mov INTRQ_NONRESUM_MONDO_HEAD, %g4 289 mov INTRQ_NONRESUM_MONDO_HEAD, %g4
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 2d63d7689962..a31a0439244f 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -680,22 +680,14 @@ static int starfire_set_time(u32 val)
680 680
681static u32 hypervisor_get_time(void) 681static u32 hypervisor_get_time(void)
682{ 682{
683 register unsigned long func asm("%o5"); 683 unsigned long ret, time;
684 register unsigned long arg0 asm("%o0");
685 register unsigned long arg1 asm("%o1");
686 int retries = 10000; 684 int retries = 10000;
687 685
688retry: 686retry:
689 func = HV_FAST_TOD_GET; 687 ret = sun4v_tod_get(&time);
690 arg0 = 0; 688 if (ret == HV_EOK)
691 arg1 = 0; 689 return time;
692 __asm__ __volatile__("ta %6" 690 if (ret == HV_EWOULDBLOCK) {
693 : "=&r" (func), "=&r" (arg0), "=&r" (arg1)
694 : "0" (func), "1" (arg0), "2" (arg1),
695 "i" (HV_FAST_TRAP));
696 if (arg0 == HV_EOK)
697 return arg1;
698 if (arg0 == HV_EWOULDBLOCK) {
699 if (--retries > 0) { 691 if (--retries > 0) {
700 udelay(100); 692 udelay(100);
701 goto retry; 693 goto retry;
@@ -709,20 +701,14 @@ retry:
709 701
710static int hypervisor_set_time(u32 secs) 702static int hypervisor_set_time(u32 secs)
711{ 703{
712 register unsigned long func asm("%o5"); 704 unsigned long ret;
713 register unsigned long arg0 asm("%o0");
714 int retries = 10000; 705 int retries = 10000;
715 706
716retry: 707retry:
717 func = HV_FAST_TOD_SET; 708 ret = sun4v_tod_set(secs);
718 arg0 = secs; 709 if (ret == HV_EOK)
719 __asm__ __volatile__("ta %4"
720 : "=&r" (func), "=&r" (arg0)
721 : "0" (func), "1" (arg0),
722 "i" (HV_FAST_TRAP));
723 if (arg0 == HV_EOK)
724 return 0; 710 return 0;
725 if (arg0 == HV_EWOULDBLOCK) { 711 if (ret == HV_EWOULDBLOCK) {
726 if (--retries > 0) { 712 if (--retries > 0) {
727 udelay(100); 713 udelay(100);
728 goto retry; 714 goto retry;
@@ -862,7 +848,6 @@ fs_initcall(clock_init);
862static unsigned long sparc64_init_timers(void) 848static unsigned long sparc64_init_timers(void)
863{ 849{
864 struct device_node *dp; 850 struct device_node *dp;
865 struct property *prop;
866 unsigned long clock; 851 unsigned long clock;
867#ifdef CONFIG_SMP 852#ifdef CONFIG_SMP
868 extern void smp_tick_init(void); 853 extern void smp_tick_init(void);
@@ -879,17 +864,15 @@ static unsigned long sparc64_init_timers(void)
879 if (manuf == 0x17 && impl == 0x13) { 864 if (manuf == 0x17 && impl == 0x13) {
880 /* Hummingbird, aka Ultra-IIe */ 865 /* Hummingbird, aka Ultra-IIe */
881 tick_ops = &hbtick_operations; 866 tick_ops = &hbtick_operations;
882 prop = of_find_property(dp, "stick-frequency", NULL); 867 clock = of_getintprop_default(dp, "stick-frequency", 0);
883 } else { 868 } else {
884 tick_ops = &tick_operations; 869 tick_ops = &tick_operations;
885 cpu_find_by_instance(0, &dp, NULL); 870 clock = local_cpu_data().clock_tick;
886 prop = of_find_property(dp, "clock-frequency", NULL);
887 } 871 }
888 } else { 872 } else {
889 tick_ops = &stick_operations; 873 tick_ops = &stick_operations;
890 prop = of_find_property(dp, "stick-frequency", NULL); 874 clock = of_getintprop_default(dp, "stick-frequency", 0);
891 } 875 }
892 clock = *(unsigned int *) prop->value;
893 876
894#ifdef CONFIG_SMP 877#ifdef CONFIG_SMP
895 smp_tick_init(); 878 smp_tick_init();
@@ -1365,6 +1348,7 @@ static int hypervisor_set_rtc_time(struct rtc_time *time)
1365 return hypervisor_set_time(seconds); 1348 return hypervisor_set_time(seconds);
1366} 1349}
1367 1350
1351#ifdef CONFIG_PCI
1368static void bq4802_get_rtc_time(struct rtc_time *time) 1352static void bq4802_get_rtc_time(struct rtc_time *time)
1369{ 1353{
1370 unsigned char val = readb(bq4802_regs + 0x0e); 1354 unsigned char val = readb(bq4802_regs + 0x0e);
@@ -1436,6 +1420,7 @@ static int bq4802_set_rtc_time(struct rtc_time *time)
1436 1420
1437 return 0; 1421 return 0;
1438} 1422}
1423#endif /* CONFIG_PCI */
1439 1424
1440struct mini_rtc_ops { 1425struct mini_rtc_ops {
1441 void (*get_rtc_time)(struct rtc_time *); 1426 void (*get_rtc_time)(struct rtc_time *);
@@ -1452,10 +1437,12 @@ static struct mini_rtc_ops hypervisor_rtc_ops = {
1452 .set_rtc_time = hypervisor_set_rtc_time, 1437 .set_rtc_time = hypervisor_set_rtc_time,
1453}; 1438};
1454 1439
1440#ifdef CONFIG_PCI
1455static struct mini_rtc_ops bq4802_rtc_ops = { 1441static struct mini_rtc_ops bq4802_rtc_ops = {
1456 .get_rtc_time = bq4802_get_rtc_time, 1442 .get_rtc_time = bq4802_get_rtc_time,
1457 .set_rtc_time = bq4802_set_rtc_time, 1443 .set_rtc_time = bq4802_set_rtc_time,
1458}; 1444};
1445#endif /* CONFIG_PCI */
1459 1446
1460static struct mini_rtc_ops *mini_rtc_ops; 1447static struct mini_rtc_ops *mini_rtc_ops;
1461 1448
@@ -1579,8 +1566,10 @@ static int __init rtc_mini_init(void)
1579 mini_rtc_ops = &hypervisor_rtc_ops; 1566 mini_rtc_ops = &hypervisor_rtc_ops;
1580 else if (this_is_starfire) 1567 else if (this_is_starfire)
1581 mini_rtc_ops = &starfire_rtc_ops; 1568 mini_rtc_ops = &starfire_rtc_ops;
1569#ifdef CONFIG_PCI
1582 else if (bq4802_regs) 1570 else if (bq4802_regs)
1583 mini_rtc_ops = &bq4802_rtc_ops; 1571 mini_rtc_ops = &bq4802_rtc_ops;
1572#endif /* CONFIG_PCI */
1584 else 1573 else
1585 return -ENODEV; 1574 return -ENODEV;
1586 1575
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index d0fde36395b4..00a9e3286c83 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -795,8 +795,7 @@ extern unsigned int cheetah_deferred_trap_vector[], cheetah_deferred_trap_vector
795void __init cheetah_ecache_flush_init(void) 795void __init cheetah_ecache_flush_init(void)
796{ 796{
797 unsigned long largest_size, smallest_linesize, order, ver; 797 unsigned long largest_size, smallest_linesize, order, ver;
798 struct device_node *dp; 798 int i, sz;
799 int i, instance, sz;
800 799
801 /* Scan all cpu device tree nodes, note two values: 800 /* Scan all cpu device tree nodes, note two values:
802 * 1) largest E-cache size 801 * 1) largest E-cache size
@@ -805,18 +804,20 @@ void __init cheetah_ecache_flush_init(void)
805 largest_size = 0UL; 804 largest_size = 0UL;
806 smallest_linesize = ~0UL; 805 smallest_linesize = ~0UL;
807 806
808 instance = 0; 807 for (i = 0; i < NR_CPUS; i++) {
809 while (!cpu_find_by_instance(instance, &dp, NULL)) {
810 unsigned long val; 808 unsigned long val;
811 809
812 val = of_getintprop_default(dp, "ecache-size", 810 val = cpu_data(i).ecache_size;
813 (2 * 1024 * 1024)); 811 if (!val)
812 continue;
813
814 if (val > largest_size) 814 if (val > largest_size)
815 largest_size = val; 815 largest_size = val;
816 val = of_getintprop_default(dp, "ecache-line-size", 64); 816
817 val = cpu_data(i).ecache_line_size;
817 if (val < smallest_linesize) 818 if (val < smallest_linesize)
818 smallest_linesize = val; 819 smallest_linesize = val;
819 instance++; 820
820 } 821 }
821 822
822 if (largest_size == 0UL || smallest_linesize == ~0UL) { 823 if (largest_size == 0UL || smallest_linesize == ~0UL) {
@@ -2564,7 +2565,15 @@ void __init trap_init(void)
2564 (TRAP_PER_CPU_TSB_HUGE_TEMP != 2565 (TRAP_PER_CPU_TSB_HUGE_TEMP !=
2565 offsetof(struct trap_per_cpu, tsb_huge_temp)) || 2566 offsetof(struct trap_per_cpu, tsb_huge_temp)) ||
2566 (TRAP_PER_CPU_IRQ_WORKLIST != 2567 (TRAP_PER_CPU_IRQ_WORKLIST !=
2567 offsetof(struct trap_per_cpu, irq_worklist))) 2568 offsetof(struct trap_per_cpu, irq_worklist)) ||
2569 (TRAP_PER_CPU_CPU_MONDO_QMASK !=
2570 offsetof(struct trap_per_cpu, cpu_mondo_qmask)) ||
2571 (TRAP_PER_CPU_DEV_MONDO_QMASK !=
2572 offsetof(struct trap_per_cpu, dev_mondo_qmask)) ||
2573 (TRAP_PER_CPU_RESUM_QMASK !=
2574 offsetof(struct trap_per_cpu, resum_qmask)) ||
2575 (TRAP_PER_CPU_NONRESUM_QMASK !=
2576 offsetof(struct trap_per_cpu, nonresum_qmask)))
2568 trap_per_cpu_offsets_are_bolixed_dave(); 2577 trap_per_cpu_offsets_are_bolixed_dave();
2569 2578
2570 if ((TSB_CONFIG_TSB != 2579 if ((TSB_CONFIG_TSB !=
diff --git a/arch/sparc64/kernel/vmlinux.lds.S b/arch/sparc64/kernel/vmlinux.lds.S
index 13fa2a2e4513..3ad10f3027e4 100644
--- a/arch/sparc64/kernel/vmlinux.lds.S
+++ b/arch/sparc64/kernel/vmlinux.lds.S
@@ -1,5 +1,6 @@
1/* ld script to make UltraLinux kernel */ 1/* ld script to make UltraLinux kernel */
2 2
3#include <asm/page.h>
3#include <asm-generic/vmlinux.lds.h> 4#include <asm-generic/vmlinux.lds.h>
4 5
5OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc") 6OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc")
@@ -14,7 +15,7 @@ SECTIONS
14 .text 0x0000000000404000 : 15 .text 0x0000000000404000 :
15 { 16 {
16 _text = .; 17 _text = .;
17 *(.text) 18 TEXT_TEXT
18 SCHED_TEXT 19 SCHED_TEXT
19 LOCK_TEXT 20 LOCK_TEXT
20 KPROBES_TEXT 21 KPROBES_TEXT
@@ -23,11 +24,11 @@ SECTIONS
23 _etext = .; 24 _etext = .;
24 PROVIDE (etext = .); 25 PROVIDE (etext = .);
25 26
26 RODATA 27 RO_DATA(PAGE_SIZE)
27 28
28 .data : 29 .data :
29 { 30 {
30 *(.data) 31 DATA_DATA
31 CONSTRUCTORS 32 CONSTRUCTORS
32 } 33 }
33 .data1 : { *(.data1) } 34 .data1 : { *(.data1) }
@@ -44,7 +45,7 @@ SECTIONS
44 __ex_table : { *(__ex_table) } 45 __ex_table : { *(__ex_table) }
45 __stop___ex_table = .; 46 __stop___ex_table = .;
46 47
47 . = ALIGN(8192); 48 . = ALIGN(PAGE_SIZE);
48 __init_begin = .; 49 __init_begin = .;
49 .init.text : { 50 .init.text : {
50 _sinittext = .; 51 _sinittext = .;
@@ -83,17 +84,17 @@ SECTIONS
83 __sun4v_2insn_patch_end = .; 84 __sun4v_2insn_patch_end = .;
84 85
85#ifdef CONFIG_BLK_DEV_INITRD 86#ifdef CONFIG_BLK_DEV_INITRD
86 . = ALIGN(8192); 87 . = ALIGN(PAGE_SIZE);
87 __initramfs_start = .; 88 __initramfs_start = .;
88 .init.ramfs : { *(.init.ramfs) } 89 .init.ramfs : { *(.init.ramfs) }
89 __initramfs_end = .; 90 __initramfs_end = .;
90#endif 91#endif
91 92
92 . = ALIGN(8192); 93 . = ALIGN(PAGE_SIZE);
93 __per_cpu_start = .; 94 __per_cpu_start = .;
94 .data.percpu : { *(.data.percpu) } 95 .data.percpu : { *(.data.percpu) }
95 __per_cpu_end = .; 96 __per_cpu_end = .;
96 . = ALIGN(8192); 97 . = ALIGN(PAGE_SIZE);
97 __init_end = .; 98 __init_end = .;
98 __bss_start = .; 99 __bss_start = .;
99 .sbss : { *(.sbss) *(.scommon) } 100 .sbss : { *(.sbss) *(.scommon) }
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 6e5b01d779d2..3010227fe243 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -23,6 +23,7 @@
23#include <linux/kprobes.h> 23#include <linux/kprobes.h>
24#include <linux/cache.h> 24#include <linux/cache.h>
25#include <linux/sort.h> 25#include <linux/sort.h>
26#include <linux/percpu.h>
26 27
27#include <asm/head.h> 28#include <asm/head.h>
28#include <asm/system.h> 29#include <asm/system.h>
@@ -43,8 +44,8 @@
43#include <asm/tsb.h> 44#include <asm/tsb.h>
44#include <asm/hypervisor.h> 45#include <asm/hypervisor.h>
45#include <asm/prom.h> 46#include <asm/prom.h>
46 47#include <asm/sstate.h>
47extern void device_scan(void); 48#include <asm/mdesc.h>
48 49
49#define MAX_PHYS_ADDRESS (1UL << 42UL) 50#define MAX_PHYS_ADDRESS (1UL << 42UL)
50#define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL) 51#define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL)
@@ -60,8 +61,11 @@ unsigned long kern_linear_pte_xor[2] __read_mostly;
60unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)]; 61unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)];
61 62
62#ifndef CONFIG_DEBUG_PAGEALLOC 63#ifndef CONFIG_DEBUG_PAGEALLOC
63/* A special kernel TSB for 4MB and 256MB linear mappings. */ 64/* A special kernel TSB for 4MB and 256MB linear mappings.
64struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES]; 65 * Space is allocated for this right after the trap table
66 * in arch/sparc64/kernel/head.S
67 */
68extern struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES];
65#endif 69#endif
66 70
67#define MAX_BANKS 32 71#define MAX_BANKS 32
@@ -190,12 +194,9 @@ inline void flush_dcache_page_impl(struct page *page)
190} 194}
191 195
192#define PG_dcache_dirty PG_arch_1 196#define PG_dcache_dirty PG_arch_1
193#define PG_dcache_cpu_shift 24UL 197#define PG_dcache_cpu_shift 32UL
194#define PG_dcache_cpu_mask (256UL - 1UL) 198#define PG_dcache_cpu_mask \
195 199 ((1UL<<ilog2(roundup_pow_of_two(NR_CPUS)))-1UL)
196#if NR_CPUS > 256
197#error D-cache dirty tracking and thread_info->cpu need fixing for > 256 cpus
198#endif
199 200
200#define dcache_dirty_cpu(page) \ 201#define dcache_dirty_cpu(page) \
201 (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask) 202 (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask)
@@ -557,26 +558,11 @@ static void __init hypervisor_tlb_lock(unsigned long vaddr,
557 unsigned long pte, 558 unsigned long pte,
558 unsigned long mmu) 559 unsigned long mmu)
559{ 560{
560 register unsigned long func asm("%o5"); 561 unsigned long ret = sun4v_mmu_map_perm_addr(vaddr, 0, pte, mmu);
561 register unsigned long arg0 asm("%o0"); 562
562 register unsigned long arg1 asm("%o1"); 563 if (ret != 0) {
563 register unsigned long arg2 asm("%o2");
564 register unsigned long arg3 asm("%o3");
565
566 func = HV_FAST_MMU_MAP_PERM_ADDR;
567 arg0 = vaddr;
568 arg1 = 0;
569 arg2 = pte;
570 arg3 = mmu;
571 __asm__ __volatile__("ta 0x80"
572 : "=&r" (func), "=&r" (arg0),
573 "=&r" (arg1), "=&r" (arg2),
574 "=&r" (arg3)
575 : "0" (func), "1" (arg0), "2" (arg1),
576 "3" (arg2), "4" (arg3));
577 if (arg0 != 0) {
578 prom_printf("hypervisor_tlb_lock[%lx:%lx:%lx:%lx]: " 564 prom_printf("hypervisor_tlb_lock[%lx:%lx:%lx:%lx]: "
579 "errors with %lx\n", vaddr, 0, pte, mmu, arg0); 565 "errors with %lx\n", vaddr, 0, pte, mmu, ret);
580 prom_halt(); 566 prom_halt();
581 } 567 }
582} 568}
@@ -1313,20 +1299,16 @@ static void __init sun4v_ktsb_init(void)
1313 1299
1314void __cpuinit sun4v_ktsb_register(void) 1300void __cpuinit sun4v_ktsb_register(void)
1315{ 1301{
1316 register unsigned long func asm("%o5"); 1302 unsigned long pa, ret;
1317 register unsigned long arg0 asm("%o0");
1318 register unsigned long arg1 asm("%o1");
1319 unsigned long pa;
1320 1303
1321 pa = kern_base + ((unsigned long)&ktsb_descr[0] - KERNBASE); 1304 pa = kern_base + ((unsigned long)&ktsb_descr[0] - KERNBASE);
1322 1305
1323 func = HV_FAST_MMU_TSB_CTX0; 1306 ret = sun4v_mmu_tsb_ctx0(NUM_KTSB_DESCR, pa);
1324 arg0 = NUM_KTSB_DESCR; 1307 if (ret != 0) {
1325 arg1 = pa; 1308 prom_printf("hypervisor_mmu_tsb_ctx0[%lx]: "
1326 __asm__ __volatile__("ta %6" 1309 "errors with %lx\n", pa, ret);
1327 : "=&r" (func), "=&r" (arg0), "=&r" (arg1) 1310 prom_halt();
1328 : "0" (func), "1" (arg0), "2" (arg1), 1311 }
1329 "i" (HV_FAST_TRAP));
1330} 1312}
1331 1313
1332/* paging_init() sets up the page tables */ 1314/* paging_init() sets up the page tables */
@@ -1334,6 +1316,9 @@ void __cpuinit sun4v_ktsb_register(void)
1334extern void cheetah_ecache_flush_init(void); 1316extern void cheetah_ecache_flush_init(void);
1335extern void sun4v_patch_tlb_handlers(void); 1317extern void sun4v_patch_tlb_handlers(void);
1336 1318
1319extern void cpu_probe(void);
1320extern void central_probe(void);
1321
1337static unsigned long last_valid_pfn; 1322static unsigned long last_valid_pfn;
1338pgd_t swapper_pg_dir[2048]; 1323pgd_t swapper_pg_dir[2048];
1339 1324
@@ -1345,9 +1330,24 @@ void __init paging_init(void)
1345 unsigned long end_pfn, pages_avail, shift, phys_base; 1330 unsigned long end_pfn, pages_avail, shift, phys_base;
1346 unsigned long real_end, i; 1331 unsigned long real_end, i;
1347 1332
1333 /* These build time checkes make sure that the dcache_dirty_cpu()
1334 * page->flags usage will work.
1335 *
1336 * When a page gets marked as dcache-dirty, we store the
1337 * cpu number starting at bit 32 in the page->flags. Also,
1338 * functions like clear_dcache_dirty_cpu use the cpu mask
1339 * in 13-bit signed-immediate instruction fields.
1340 */
1341 BUILD_BUG_ON(FLAGS_RESERVED != 32);
1342 BUILD_BUG_ON(SECTIONS_WIDTH + NODES_WIDTH + ZONES_WIDTH +
1343 ilog2(roundup_pow_of_two(NR_CPUS)) > FLAGS_RESERVED);
1344 BUILD_BUG_ON(NR_CPUS > 4096);
1345
1348 kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL; 1346 kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL;
1349 kern_size = (unsigned long)&_end - (unsigned long)KERNBASE; 1347 kern_size = (unsigned long)&_end - (unsigned long)KERNBASE;
1350 1348
1349 sstate_booting();
1350
1351 /* Invalidate both kernel TSBs. */ 1351 /* Invalidate both kernel TSBs. */
1352 memset(swapper_tsb, 0x40, sizeof(swapper_tsb)); 1352 memset(swapper_tsb, 0x40, sizeof(swapper_tsb));
1353#ifndef CONFIG_DEBUG_PAGEALLOC 1353#ifndef CONFIG_DEBUG_PAGEALLOC
@@ -1416,8 +1416,13 @@ void __init paging_init(void)
1416 1416
1417 kernel_physical_mapping_init(); 1417 kernel_physical_mapping_init();
1418 1418
1419 real_setup_per_cpu_areas();
1420
1419 prom_build_devicetree(); 1421 prom_build_devicetree();
1420 1422
1423 if (tlb_type == hypervisor)
1424 sun4v_mdesc_init();
1425
1421 { 1426 {
1422 unsigned long zones_size[MAX_NR_ZONES]; 1427 unsigned long zones_size[MAX_NR_ZONES];
1423 unsigned long zholes_size[MAX_NR_ZONES]; 1428 unsigned long zholes_size[MAX_NR_ZONES];
@@ -1434,7 +1439,10 @@ void __init paging_init(void)
1434 zholes_size); 1439 zholes_size);
1435 } 1440 }
1436 1441
1437 device_scan(); 1442 prom_printf("Booting Linux...\n");
1443
1444 central_probe();
1445 cpu_probe();
1438} 1446}
1439 1447
1440static void __init taint_real_pages(void) 1448static void __init taint_real_pages(void)
diff --git a/arch/sparc64/prom/misc.c b/arch/sparc64/prom/misc.c
index 0b4213720d43..f3e0c14e9eef 100644
--- a/arch/sparc64/prom/misc.c
+++ b/arch/sparc64/prom/misc.c
@@ -15,6 +15,25 @@
15#include <asm/oplib.h> 15#include <asm/oplib.h>
16#include <asm/system.h> 16#include <asm/system.h>
17 17
18int prom_service_exists(const char *service_name)
19{
20 int err = p1275_cmd("test", P1275_ARG(0, P1275_ARG_IN_STRING) |
21 P1275_INOUT(1, 1), service_name);
22
23 if (err)
24 return 0;
25 return 1;
26}
27
28void prom_sun4v_guest_soft_state(void)
29{
30 const char *svc = "SUNW,soft-state-supported";
31
32 if (!prom_service_exists(svc))
33 return;
34 p1275_cmd(svc, P1275_INOUT(0, 0));
35}
36
18/* Reset and reboot the machine with the command 'bcommand'. */ 37/* Reset and reboot the machine with the command 'bcommand'. */
19void prom_reboot(const char *bcommand) 38void prom_reboot(const char *bcommand)
20{ 39{
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 87a4e4427d8d..24547741b205 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -62,7 +62,7 @@ SECTIONS
62 } =0x90909090 62 } =0x90909090
63 .plt : { *(.plt) } 63 .plt : { *(.plt) }
64 .text : { 64 .text : {
65 *(.text) 65 TEXT_TEXT
66 SCHED_TEXT 66 SCHED_TEXT
67 LOCK_TEXT 67 LOCK_TEXT
68 *(.fixup) 68 *(.fixup)
@@ -99,7 +99,8 @@ SECTIONS
99 *(.data.init_task) 99 *(.data.init_task)
100 . = ALIGN(KERNEL_STACK_SIZE); 100 . = ALIGN(KERNEL_STACK_SIZE);
101 *(.data.init_irqstack) 101 *(.data.init_irqstack)
102 *(.data .data.* .gnu.linkonce.d.*) 102 DATA_DATA
103 *(.data.* .gnu.linkonce.d.*)
103 SORT(CONSTRUCTORS) 104 SORT(CONSTRUCTORS)
104 } 105 }
105 .data1 : { *(.data1) } 106 .data1 : { *(.data1) }
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index bc59f97e34d0..307b9373676b 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -37,7 +37,7 @@ SECTIONS
37 37
38 .text : 38 .text :
39 { 39 {
40 *(.text) 40 TEXT_TEXT
41 SCHED_TEXT 41 SCHED_TEXT
42 LOCK_TEXT 42 LOCK_TEXT
43 *(.fixup) 43 *(.fixup)
@@ -61,7 +61,7 @@ SECTIONS
61 *(.data.init_task) 61 *(.data.init_task)
62 . = ALIGN(KERNEL_STACK_SIZE); 62 . = ALIGN(KERNEL_STACK_SIZE);
63 *(.data.init_irqstack) 63 *(.data.init_irqstack)
64 *(.data) 64 DATA_DATA
65 *(.gnu.linkonce.d*) 65 *(.gnu.linkonce.d*)
66 CONSTRUCTORS 66 CONSTRUCTORS
67 } 67 }
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 79471f85eb89..3fc13fa8729d 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -144,9 +144,7 @@ static int stop_ptraced_child(int pid, void *stack, int exitcode,
144 int exit_with = WEXITSTATUS(status); 144 int exit_with = WEXITSTATUS(status);
145 if (exit_with == 2) 145 if (exit_with == 2)
146 non_fatal("check_ptrace : child exited with status 2. " 146 non_fatal("check_ptrace : child exited with status 2. "
147 "Serious trouble happening! Try updating " 147 "\nDisabling SYSEMU support.\n");
148 "your host skas patch!\nDisabling SYSEMU "
149 "support.");
150 non_fatal("check_ptrace : child exited with exitcode %d, while " 148 non_fatal("check_ptrace : child exited with exitcode %d, while "
151 "expecting %d; status 0x%x\n", exit_with, 149 "expecting %d; status 0x%x\n", exit_with,
152 exitcode, status); 150 exitcode, status);
@@ -209,6 +207,7 @@ __uml_setup("nosysemu", nosysemu_cmd_param,
209static void __init check_sysemu(void) 207static void __init check_sysemu(void)
210{ 208{
211 void *stack; 209 void *stack;
210 unsigned long regs[MAX_REG_NR];
212 int pid, n, status, count=0; 211 int pid, n, status, count=0;
213 212
214 non_fatal("Checking syscall emulation patch for ptrace..."); 213 non_fatal("Checking syscall emulation patch for ptrace...");
@@ -225,11 +224,20 @@ static void __init check_sysemu(void)
225 fatal("check_sysemu : expected SIGTRAP, got status = %d", 224 fatal("check_sysemu : expected SIGTRAP, got status = %d",
226 status); 225 status);
227 226
228 n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET, 227 if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
229 os_getpid()); 228 fatal_perror("check_sysemu : PTRACE_GETREGS failed");
230 if(n < 0) 229 if(PT_SYSCALL_NR(regs) != __NR_getpid){
231 fatal_perror("check_sysemu : failed to modify system call " 230 non_fatal("check_sysemu got system call number %d, "
232 "return"); 231 "expected %d...", PT_SYSCALL_NR(regs), __NR_getpid);
232 goto fail;
233 }
234
235 n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET, os_getpid());
236 if(n < 0){
237 non_fatal("check_sysemu : failed to modify system call "
238 "return");
239 goto fail;
240 }
233 241
234 if (stop_ptraced_child(pid, stack, 0, 0) < 0) 242 if (stop_ptraced_child(pid, stack, 0, 0) < 0)
235 goto fail_stopped; 243 goto fail_stopped;
diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
index 356308221251..6172599b4ce2 100644
--- a/arch/v850/kernel/vmlinux.lds.S
+++ b/arch/v850/kernel/vmlinux.lds.S
@@ -92,7 +92,7 @@
92#define TEXT_CONTENTS \ 92#define TEXT_CONTENTS \
93 _text = .; \ 93 _text = .; \
94 __stext = . ; \ 94 __stext = . ; \
95 *(.text) \ 95 TEXT_TEXT \
96 SCHED_TEXT \ 96 SCHED_TEXT \
97 *(.exit.text) /* 2.5 convention */ \ 97 *(.exit.text) /* 2.5 convention */ \
98 *(.text.exit) /* 2.4 convention */ \ 98 *(.text.exit) /* 2.4 convention */ \
@@ -113,7 +113,7 @@
113/* Kernel data segment. */ 113/* Kernel data segment. */
114#define DATA_CONTENTS \ 114#define DATA_CONTENTS \
115 __sdata = . ; \ 115 __sdata = . ; \
116 *(.data) \ 116 DATA_DATA \
117 *(.exit.data) /* 2.5 convention */ \ 117 *(.exit.data) /* 2.5 convention */ \
118 *(.data.exit) /* 2.4 convention */ \ 118 *(.data.exit) /* 2.4 convention */ \
119 . = ALIGN (16) ; \ 119 . = ALIGN (16) ; \
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 145bb824b2a8..5ce94430c019 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -428,12 +428,15 @@ config NR_CPUS
428 memory in the static kernel configuration. 428 memory in the static kernel configuration.
429 429
430config HOTPLUG_CPU 430config HOTPLUG_CPU
431 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" 431 bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
432 depends on SMP && HOTPLUG && EXPERIMENTAL 432 depends on SMP && HOTPLUG && EXPERIMENTAL
433 help 433 help
434 Say Y here to experiment with turning CPUs off and on. CPUs 434 Say Y here to experiment with turning CPUs off and on. CPUs
435 can be controlled through /sys/devices/system/cpu/cpu#. 435 can be controlled through /sys/devices/system/cpu/cpu#.
436 Say N if you want to disable CPU hotplug. 436 This is also required for suspend/hibernation on SMP systems.
437
438 Say N if you want to disable CPU hotplug and don't need to
439 suspend.
437 440
438config ARCH_ENABLE_MEMORY_HOTPLUG 441config ARCH_ENABLE_MEMORY_HOTPLUG
439 def_bool y 442 def_bool y
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 941a7e3aa5fb..40178e5c3104 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21-git3 3# Linux kernel version: 2.6.22-rc2
4# Tue May 1 07:30:48 2007 4# Mon May 21 13:23:40 2007
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -53,6 +53,7 @@ CONFIG_POSIX_MQUEUE=y
53# CONFIG_AUDIT is not set 53# CONFIG_AUDIT is not set
54CONFIG_IKCONFIG=y 54CONFIG_IKCONFIG=y
55CONFIG_IKCONFIG_PROC=y 55CONFIG_IKCONFIG_PROC=y
56CONFIG_LOG_BUF_SHIFT=18
56# CONFIG_CPUSETS is not set 57# CONFIG_CPUSETS is not set
57CONFIG_SYSFS_DEPRECATED=y 58CONFIG_SYSFS_DEPRECATED=y
58# CONFIG_RELAY is not set 59# CONFIG_RELAY is not set
@@ -72,14 +73,19 @@ CONFIG_BUG=y
72CONFIG_ELF_CORE=y 73CONFIG_ELF_CORE=y
73CONFIG_BASE_FULL=y 74CONFIG_BASE_FULL=y
74CONFIG_FUTEX=y 75CONFIG_FUTEX=y
76CONFIG_ANON_INODES=y
75CONFIG_EPOLL=y 77CONFIG_EPOLL=y
78CONFIG_SIGNALFD=y
79CONFIG_TIMERFD=y
80CONFIG_EVENTFD=y
76CONFIG_SHMEM=y 81CONFIG_SHMEM=y
77CONFIG_SLAB=y
78CONFIG_VM_EVENT_COUNTERS=y 82CONFIG_VM_EVENT_COUNTERS=y
83CONFIG_SLAB=y
84# CONFIG_SLUB is not set
85# CONFIG_SLOB is not set
79CONFIG_RT_MUTEXES=y 86CONFIG_RT_MUTEXES=y
80# CONFIG_TINY_SHMEM is not set 87# CONFIG_TINY_SHMEM is not set
81CONFIG_BASE_SMALL=0 88CONFIG_BASE_SMALL=0
82# CONFIG_SLOB is not set
83 89
84# 90#
85# Loadable module support 91# Loadable module support
@@ -118,11 +124,11 @@ CONFIG_X86_PC=y
118# CONFIG_X86_VSMP is not set 124# CONFIG_X86_VSMP is not set
119# CONFIG_MK8 is not set 125# CONFIG_MK8 is not set
120# CONFIG_MPSC is not set 126# CONFIG_MPSC is not set
121CONFIG_MCORE2=y 127# CONFIG_MCORE2 is not set
122# CONFIG_GENERIC_CPU is not set 128CONFIG_GENERIC_CPU=y
123CONFIG_X86_L1_CACHE_BYTES=64 129CONFIG_X86_L1_CACHE_BYTES=128
124CONFIG_X86_L1_CACHE_SHIFT=6 130CONFIG_X86_L1_CACHE_SHIFT=7
125CONFIG_X86_INTERNODE_CACHE_BYTES=64 131CONFIG_X86_INTERNODE_CACHE_BYTES=128
126CONFIG_X86_TSC=y 132CONFIG_X86_TSC=y
127CONFIG_X86_GOOD_APIC=y 133CONFIG_X86_GOOD_APIC=y
128# CONFIG_MICROCODE is not set 134# CONFIG_MICROCODE is not set
@@ -174,7 +180,7 @@ CONFIG_X86_MCE_INTEL=y
174CONFIG_X86_MCE_AMD=y 180CONFIG_X86_MCE_AMD=y
175# CONFIG_KEXEC is not set 181# CONFIG_KEXEC is not set
176# CONFIG_CRASH_DUMP is not set 182# CONFIG_CRASH_DUMP is not set
177# CONFIG_RELOCATABLE is not set 183CONFIG_RELOCATABLE=y
178CONFIG_PHYSICAL_START=0x200000 184CONFIG_PHYSICAL_START=0x200000
179CONFIG_SECCOMP=y 185CONFIG_SECCOMP=y
180# CONFIG_CC_STACKPROTECTOR is not set 186# CONFIG_CC_STACKPROTECTOR is not set
@@ -242,7 +248,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
242# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 248# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
243CONFIG_CPU_FREQ_GOV_USERSPACE=y 249CONFIG_CPU_FREQ_GOV_USERSPACE=y
244CONFIG_CPU_FREQ_GOV_ONDEMAND=y 250CONFIG_CPU_FREQ_GOV_ONDEMAND=y
245CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y 251# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
246 252
247# 253#
248# CPUFreq processor drivers 254# CPUFreq processor drivers
@@ -266,6 +272,7 @@ CONFIG_PCI_DIRECT=y
266CONFIG_PCI_MMCONFIG=y 272CONFIG_PCI_MMCONFIG=y
267CONFIG_PCIEPORTBUS=y 273CONFIG_PCIEPORTBUS=y
268CONFIG_PCIEAER=y 274CONFIG_PCIEAER=y
275CONFIG_ARCH_SUPPORTS_MSI=y
269CONFIG_PCI_MSI=y 276CONFIG_PCI_MSI=y
270# CONFIG_PCI_DEBUG is not set 277# CONFIG_PCI_DEBUG is not set
271# CONFIG_HT_IRQ is not set 278# CONFIG_HT_IRQ is not set
@@ -274,10 +281,6 @@ CONFIG_PCI_MSI=y
274# PCCARD (PCMCIA/CardBus) support 281# PCCARD (PCMCIA/CardBus) support
275# 282#
276# CONFIG_PCCARD is not set 283# CONFIG_PCCARD is not set
277
278#
279# PCI Hotplug Support
280#
281# CONFIG_HOTPLUG_PCI is not set 284# CONFIG_HOTPLUG_PCI is not set
282 285
283# 286#
@@ -395,7 +398,9 @@ CONFIG_IPV6_SIT=y
395# 398#
396# CONFIG_CFG80211 is not set 399# CONFIG_CFG80211 is not set
397# CONFIG_WIRELESS_EXT is not set 400# CONFIG_WIRELESS_EXT is not set
401# CONFIG_MAC80211 is not set
398# CONFIG_IEEE80211 is not set 402# CONFIG_IEEE80211 is not set
403# CONFIG_RFKILL is not set
399 404
400# 405#
401# Device Drivers 406# Device Drivers
@@ -458,14 +463,12 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
458# Misc devices 463# Misc devices
459# 464#
460# CONFIG_IBM_ASM is not set 465# CONFIG_IBM_ASM is not set
466# CONFIG_PHANTOM is not set
461# CONFIG_SGI_IOC4 is not set 467# CONFIG_SGI_IOC4 is not set
462# CONFIG_TIFM_CORE is not set 468# CONFIG_TIFM_CORE is not set
463# CONFIG_SONY_LAPTOP is not set 469# CONFIG_SONY_LAPTOP is not set
464# CONFIG_THINKPAD_ACPI is not set 470# CONFIG_THINKPAD_ACPI is not set
465 471# CONFIG_BLINK is not set
466#
467# ATA/ATAPI/MFM/RLL support
468#
469CONFIG_IDE=y 472CONFIG_IDE=y
470CONFIG_BLK_DEV_IDE=y 473CONFIG_BLK_DEV_IDE=y
471 474
@@ -482,6 +485,7 @@ CONFIG_BLK_DEV_IDECD=y
482# CONFIG_BLK_DEV_IDESCSI is not set 485# CONFIG_BLK_DEV_IDESCSI is not set
483CONFIG_BLK_DEV_IDEACPI=y 486CONFIG_BLK_DEV_IDEACPI=y
484# CONFIG_IDE_TASK_IOCTL is not set 487# CONFIG_IDE_TASK_IOCTL is not set
488CONFIG_IDE_PROC_FS=y
485 489
486# 490#
487# IDE chipset support/bugfixes 491# IDE chipset support/bugfixes
@@ -491,6 +495,7 @@ CONFIG_IDE_GENERIC=y
491# CONFIG_BLK_DEV_IDEPNP is not set 495# CONFIG_BLK_DEV_IDEPNP is not set
492CONFIG_BLK_DEV_IDEPCI=y 496CONFIG_BLK_DEV_IDEPCI=y
493# CONFIG_IDEPCI_SHARE_IRQ is not set 497# CONFIG_IDEPCI_SHARE_IRQ is not set
498CONFIG_IDEPCI_PCIBUS_ORDER=y
494# CONFIG_BLK_DEV_OFFBOARD is not set 499# CONFIG_BLK_DEV_OFFBOARD is not set
495# CONFIG_BLK_DEV_GENERIC is not set 500# CONFIG_BLK_DEV_GENERIC is not set
496# CONFIG_BLK_DEV_OPTI621 is not set 501# CONFIG_BLK_DEV_OPTI621 is not set
@@ -556,6 +561,7 @@ CONFIG_CHR_DEV_SG=y
556CONFIG_SCSI_CONSTANTS=y 561CONFIG_SCSI_CONSTANTS=y
557# CONFIG_SCSI_LOGGING is not set 562# CONFIG_SCSI_LOGGING is not set
558# CONFIG_SCSI_SCAN_ASYNC is not set 563# CONFIG_SCSI_SCAN_ASYNC is not set
564CONFIG_SCSI_WAIT_SCAN=m
559 565
560# 566#
561# SCSI Transports 567# SCSI Transports
@@ -579,15 +585,16 @@ CONFIG_SCSI_SAS_ATTRS=y
579CONFIG_SCSI_AIC79XX=y 585CONFIG_SCSI_AIC79XX=y
580CONFIG_AIC79XX_CMDS_PER_DEVICE=32 586CONFIG_AIC79XX_CMDS_PER_DEVICE=32
581CONFIG_AIC79XX_RESET_DELAY_MS=4000 587CONFIG_AIC79XX_RESET_DELAY_MS=4000
582# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
583# CONFIG_AIC79XX_DEBUG_ENABLE is not set 588# CONFIG_AIC79XX_DEBUG_ENABLE is not set
584CONFIG_AIC79XX_DEBUG_MASK=0 589CONFIG_AIC79XX_DEBUG_MASK=0
585# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set 590# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
586# CONFIG_SCSI_AIC94XX is not set 591# CONFIG_SCSI_AIC94XX is not set
587# CONFIG_SCSI_ARCMSR is not set 592# CONFIG_SCSI_ARCMSR is not set
588# CONFIG_MEGARAID_NEWGEN is not set 593CONFIG_MEGARAID_NEWGEN=y
594CONFIG_MEGARAID_MM=y
595CONFIG_MEGARAID_MAILBOX=y
589# CONFIG_MEGARAID_LEGACY is not set 596# CONFIG_MEGARAID_LEGACY is not set
590# CONFIG_MEGARAID_SAS is not set 597CONFIG_MEGARAID_SAS=y
591# CONFIG_SCSI_HPTIOP is not set 598# CONFIG_SCSI_HPTIOP is not set
592# CONFIG_SCSI_BUSLOGIC is not set 599# CONFIG_SCSI_BUSLOGIC is not set
593# CONFIG_SCSI_DMX3191D is not set 600# CONFIG_SCSI_DMX3191D is not set
@@ -609,12 +616,9 @@ CONFIG_AIC79XX_DEBUG_MASK=0
609# CONFIG_SCSI_DEBUG is not set 616# CONFIG_SCSI_DEBUG is not set
610# CONFIG_SCSI_ESP_CORE is not set 617# CONFIG_SCSI_ESP_CORE is not set
611# CONFIG_SCSI_SRP is not set 618# CONFIG_SCSI_SRP is not set
612
613#
614# Serial ATA (prod) and Parallel ATA (experimental) drivers
615#
616CONFIG_ATA=y 619CONFIG_ATA=y
617# CONFIG_ATA_NONSTANDARD is not set 620# CONFIG_ATA_NONSTANDARD is not set
621CONFIG_ATA_ACPI=y
618CONFIG_SATA_AHCI=y 622CONFIG_SATA_AHCI=y
619CONFIG_SATA_SVW=y 623CONFIG_SATA_SVW=y
620CONFIG_ATA_PIIX=y 624CONFIG_ATA_PIIX=y
@@ -631,7 +635,6 @@ CONFIG_SATA_SIL=y
631CONFIG_SATA_VIA=y 635CONFIG_SATA_VIA=y
632# CONFIG_SATA_VITESSE is not set 636# CONFIG_SATA_VITESSE is not set
633# CONFIG_SATA_INIC162X is not set 637# CONFIG_SATA_INIC162X is not set
634CONFIG_SATA_ACPI=y
635# CONFIG_PATA_ALI is not set 638# CONFIG_PATA_ALI is not set
636# CONFIG_PATA_AMD is not set 639# CONFIG_PATA_AMD is not set
637# CONFIG_PATA_ARTOP is not set 640# CONFIG_PATA_ARTOP is not set
@@ -681,6 +684,7 @@ CONFIG_BLK_DEV_DM=y
681# CONFIG_DM_MIRROR is not set 684# CONFIG_DM_MIRROR is not set
682# CONFIG_DM_ZERO is not set 685# CONFIG_DM_ZERO is not set
683# CONFIG_DM_MULTIPATH is not set 686# CONFIG_DM_MULTIPATH is not set
687# CONFIG_DM_DELAY is not set
684 688
685# 689#
686# Fusion MPT device support 690# Fusion MPT device support
@@ -688,13 +692,14 @@ CONFIG_BLK_DEV_DM=y
688CONFIG_FUSION=y 692CONFIG_FUSION=y
689CONFIG_FUSION_SPI=y 693CONFIG_FUSION_SPI=y
690# CONFIG_FUSION_FC is not set 694# CONFIG_FUSION_FC is not set
691# CONFIG_FUSION_SAS is not set 695CONFIG_FUSION_SAS=y
692CONFIG_FUSION_MAX_SGE=128 696CONFIG_FUSION_MAX_SGE=128
693# CONFIG_FUSION_CTL is not set 697# CONFIG_FUSION_CTL is not set
694 698
695# 699#
696# IEEE 1394 (FireWire) support 700# IEEE 1394 (FireWire) support
697# 701#
702# CONFIG_FIREWIRE is not set
698CONFIG_IEEE1394=y 703CONFIG_IEEE1394=y
699 704
700# 705#
@@ -705,10 +710,7 @@ CONFIG_IEEE1394=y
705# 710#
706# Controllers 711# Controllers
707# 712#
708 713# CONFIG_IEEE1394_PCILYNX is not set
709#
710# Texas Instruments PCILynx requires I2C
711#
712CONFIG_IEEE1394_OHCI1394=y 714CONFIG_IEEE1394_OHCI1394=y
713 715
714# 716#
@@ -725,11 +727,7 @@ CONFIG_IEEE1394_RAWIO=y
725# I2O device support 727# I2O device support
726# 728#
727# CONFIG_I2O is not set 729# CONFIG_I2O is not set
728 730# CONFIG_MACINTOSH_DRIVERS is not set
729#
730# Macintosh device drivers
731#
732# CONFIG_MAC_EMUMOUSEBTN is not set
733 731
734# 732#
735# Network device support 733# Network device support
@@ -745,10 +743,6 @@ CONFIG_TUN=y
745# ARCnet devices 743# ARCnet devices
746# 744#
747# CONFIG_ARCNET is not set 745# CONFIG_ARCNET is not set
748
749#
750# PHY device support
751#
752# CONFIG_PHYLIB is not set 746# CONFIG_PHYLIB is not set
753 747
754# 748#
@@ -779,8 +773,7 @@ CONFIG_TULIP=y
779# CONFIG_HP100 is not set 773# CONFIG_HP100 is not set
780CONFIG_NET_PCI=y 774CONFIG_NET_PCI=y
781# CONFIG_PCNET32 is not set 775# CONFIG_PCNET32 is not set
782CONFIG_AMD8111_ETH=y 776# CONFIG_AMD8111_ETH is not set
783# CONFIG_AMD8111E_NAPI is not set
784# CONFIG_ADAPTEC_STARFIRE is not set 777# CONFIG_ADAPTEC_STARFIRE is not set
785CONFIG_B44=y 778CONFIG_B44=y
786CONFIG_FORCEDETH=y 779CONFIG_FORCEDETH=y
@@ -802,10 +795,7 @@ CONFIG_8139TOO=y
802# CONFIG_SUNDANCE is not set 795# CONFIG_SUNDANCE is not set
803# CONFIG_VIA_RHINE is not set 796# CONFIG_VIA_RHINE is not set
804# CONFIG_SC92031 is not set 797# CONFIG_SC92031 is not set
805 798CONFIG_NETDEV_1000=y
806#
807# Ethernet (1000 Mbit)
808#
809# CONFIG_ACENIC is not set 799# CONFIG_ACENIC is not set
810# CONFIG_DL2K is not set 800# CONFIG_DL2K is not set
811CONFIG_E1000=y 801CONFIG_E1000=y
@@ -824,10 +814,7 @@ CONFIG_TIGON3=y
824CONFIG_BNX2=y 814CONFIG_BNX2=y
825# CONFIG_QLA3XXX is not set 815# CONFIG_QLA3XXX is not set
826# CONFIG_ATL1 is not set 816# CONFIG_ATL1 is not set
827 817CONFIG_NETDEV_10000=y
828#
829# Ethernet (10000 Mbit)
830#
831# CONFIG_CHELSIO_T1 is not set 818# CONFIG_CHELSIO_T1 is not set
832# CONFIG_CHELSIO_T3 is not set 819# CONFIG_CHELSIO_T3 is not set
833# CONFIG_IXGB is not set 820# CONFIG_IXGB is not set
@@ -835,6 +822,7 @@ CONFIG_S2IO=m
835# CONFIG_S2IO_NAPI is not set 822# CONFIG_S2IO_NAPI is not set
836# CONFIG_MYRI10GE is not set 823# CONFIG_MYRI10GE is not set
837# CONFIG_NETXEN_NIC is not set 824# CONFIG_NETXEN_NIC is not set
825# CONFIG_MLX4_CORE is not set
838 826
839# 827#
840# Token Ring devices 828# Token Ring devices
@@ -848,8 +836,14 @@ CONFIG_S2IO=m
848# CONFIG_WLAN_80211 is not set 836# CONFIG_WLAN_80211 is not set
849 837
850# 838#
851# Wan interfaces 839# USB Network Adapters
852# 840#
841# CONFIG_USB_CATC is not set
842# CONFIG_USB_KAWETH is not set
843# CONFIG_USB_PEGASUS is not set
844# CONFIG_USB_RTL8150 is not set
845# CONFIG_USB_USBNET_MII is not set
846# CONFIG_USB_USBNET is not set
853# CONFIG_WAN is not set 847# CONFIG_WAN is not set
854# CONFIG_FDDI is not set 848# CONFIG_FDDI is not set
855# CONFIG_HIPPI is not set 849# CONFIG_HIPPI is not set
@@ -902,9 +896,17 @@ CONFIG_KEYBOARD_ATKBD=y
902# CONFIG_KEYBOARD_STOWAWAY is not set 896# CONFIG_KEYBOARD_STOWAWAY is not set
903CONFIG_INPUT_MOUSE=y 897CONFIG_INPUT_MOUSE=y
904CONFIG_MOUSE_PS2=y 898CONFIG_MOUSE_PS2=y
899CONFIG_MOUSE_PS2_ALPS=y
900CONFIG_MOUSE_PS2_LOGIPS2PP=y
901CONFIG_MOUSE_PS2_SYNAPTICS=y
902CONFIG_MOUSE_PS2_LIFEBOOK=y
903CONFIG_MOUSE_PS2_TRACKPOINT=y
904# CONFIG_MOUSE_PS2_TOUCHKIT is not set
905# CONFIG_MOUSE_SERIAL is not set 905# CONFIG_MOUSE_SERIAL is not set
906# CONFIG_MOUSE_APPLETOUCH is not set
906# CONFIG_MOUSE_VSXXXAA is not set 907# CONFIG_MOUSE_VSXXXAA is not set
907# CONFIG_INPUT_JOYSTICK is not set 908# CONFIG_INPUT_JOYSTICK is not set
909# CONFIG_INPUT_TABLET is not set
908# CONFIG_INPUT_TOUCHSCREEN is not set 910# CONFIG_INPUT_TOUCHSCREEN is not set
909# CONFIG_INPUT_MISC is not set 911# CONFIG_INPUT_MISC is not set
910 912
@@ -954,10 +956,6 @@ CONFIG_LEGACY_PTY_COUNT=256
954# IPMI 956# IPMI
955# 957#
956# CONFIG_IPMI_HANDLER is not set 958# CONFIG_IPMI_HANDLER is not set
957
958#
959# Watchdog Cards
960#
961# CONFIG_WATCHDOG is not set 959# CONFIG_WATCHDOG is not set
962CONFIG_HW_RANDOM=y 960CONFIG_HW_RANDOM=y
963CONFIG_HW_RANDOM_INTEL=y 961CONFIG_HW_RANDOM_INTEL=y
@@ -965,7 +963,6 @@ CONFIG_HW_RANDOM_AMD=y
965# CONFIG_HW_RANDOM_GEODE is not set 963# CONFIG_HW_RANDOM_GEODE is not set
966# CONFIG_NVRAM is not set 964# CONFIG_NVRAM is not set
967CONFIG_RTC=y 965CONFIG_RTC=y
968# CONFIG_DTLK is not set
969# CONFIG_R3964 is not set 966# CONFIG_R3964 is not set
970# CONFIG_APPLICOM is not set 967# CONFIG_APPLICOM is not set
971CONFIG_AGP=y 968CONFIG_AGP=y
@@ -988,11 +985,58 @@ CONFIG_HPET_MMAP=y
988# 985#
989# CONFIG_TCG_TPM is not set 986# CONFIG_TCG_TPM is not set
990# CONFIG_TELCLOCK is not set 987# CONFIG_TELCLOCK is not set
991 988CONFIG_DEVPORT=y
992# 989CONFIG_I2C=m
993# I2C support 990CONFIG_I2C_BOARDINFO=y
994# 991CONFIG_I2C_CHARDEV=m
995# CONFIG_I2C is not set 992
993#
994# I2C Algorithms
995#
996# CONFIG_I2C_ALGOBIT is not set
997# CONFIG_I2C_ALGOPCF is not set
998# CONFIG_I2C_ALGOPCA is not set
999
1000#
1001# I2C Hardware Bus support
1002#
1003# CONFIG_I2C_ALI1535 is not set
1004# CONFIG_I2C_ALI1563 is not set
1005# CONFIG_I2C_ALI15X3 is not set
1006# CONFIG_I2C_AMD756 is not set
1007# CONFIG_I2C_AMD8111 is not set
1008# CONFIG_I2C_I801 is not set
1009# CONFIG_I2C_I810 is not set
1010# CONFIG_I2C_PIIX4 is not set
1011# CONFIG_I2C_NFORCE2 is not set
1012# CONFIG_I2C_OCORES is not set
1013# CONFIG_I2C_PARPORT_LIGHT is not set
1014# CONFIG_I2C_PROSAVAGE is not set
1015# CONFIG_I2C_SAVAGE4 is not set
1016# CONFIG_I2C_SIMTEC is not set
1017# CONFIG_I2C_SIS5595 is not set
1018# CONFIG_I2C_SIS630 is not set
1019# CONFIG_I2C_SIS96X is not set
1020# CONFIG_I2C_STUB is not set
1021# CONFIG_I2C_TINY_USB is not set
1022# CONFIG_I2C_VIA is not set
1023# CONFIG_I2C_VIAPRO is not set
1024# CONFIG_I2C_VOODOO3 is not set
1025
1026#
1027# Miscellaneous I2C Chip support
1028#
1029# CONFIG_SENSORS_DS1337 is not set
1030# CONFIG_SENSORS_DS1374 is not set
1031# CONFIG_SENSORS_EEPROM is not set
1032# CONFIG_SENSORS_PCF8574 is not set
1033# CONFIG_SENSORS_PCA9539 is not set
1034# CONFIG_SENSORS_PCF8591 is not set
1035# CONFIG_SENSORS_MAX6875 is not set
1036# CONFIG_I2C_DEBUG_CORE is not set
1037# CONFIG_I2C_DEBUG_ALGO is not set
1038# CONFIG_I2C_DEBUG_BUS is not set
1039# CONFIG_I2C_DEBUG_CHIP is not set
996 1040
997# 1041#
998# SPI support 1042# SPI support
@@ -1004,12 +1048,58 @@ CONFIG_HPET_MMAP=y
1004# Dallas's 1-wire bus 1048# Dallas's 1-wire bus
1005# 1049#
1006# CONFIG_W1 is not set 1050# CONFIG_W1 is not set
1007 1051CONFIG_HWMON=y
1008#
1009# Hardware Monitoring support
1010#
1011# CONFIG_HWMON is not set
1012# CONFIG_HWMON_VID is not set 1052# CONFIG_HWMON_VID is not set
1053# CONFIG_SENSORS_ABITUGURU is not set
1054# CONFIG_SENSORS_AD7418 is not set
1055# CONFIG_SENSORS_ADM1021 is not set
1056# CONFIG_SENSORS_ADM1025 is not set
1057# CONFIG_SENSORS_ADM1026 is not set
1058# CONFIG_SENSORS_ADM1029 is not set
1059# CONFIG_SENSORS_ADM1031 is not set
1060# CONFIG_SENSORS_ADM9240 is not set
1061# CONFIG_SENSORS_K8TEMP is not set
1062# CONFIG_SENSORS_ASB100 is not set
1063# CONFIG_SENSORS_ATXP1 is not set
1064# CONFIG_SENSORS_DS1621 is not set
1065# CONFIG_SENSORS_F71805F is not set
1066# CONFIG_SENSORS_FSCHER is not set
1067# CONFIG_SENSORS_FSCPOS is not set
1068# CONFIG_SENSORS_GL518SM is not set
1069# CONFIG_SENSORS_GL520SM is not set
1070CONFIG_SENSORS_CORETEMP=y
1071# CONFIG_SENSORS_IT87 is not set
1072# CONFIG_SENSORS_LM63 is not set
1073# CONFIG_SENSORS_LM75 is not set
1074# CONFIG_SENSORS_LM77 is not set
1075# CONFIG_SENSORS_LM78 is not set
1076# CONFIG_SENSORS_LM80 is not set
1077# CONFIG_SENSORS_LM83 is not set
1078# CONFIG_SENSORS_LM85 is not set
1079# CONFIG_SENSORS_LM87 is not set
1080# CONFIG_SENSORS_LM90 is not set
1081# CONFIG_SENSORS_LM92 is not set
1082# CONFIG_SENSORS_MAX1619 is not set
1083# CONFIG_SENSORS_MAX6650 is not set
1084# CONFIG_SENSORS_PC87360 is not set
1085# CONFIG_SENSORS_PC87427 is not set
1086# CONFIG_SENSORS_SIS5595 is not set
1087# CONFIG_SENSORS_SMSC47M1 is not set
1088# CONFIG_SENSORS_SMSC47M192 is not set
1089CONFIG_SENSORS_SMSC47B397=m
1090# CONFIG_SENSORS_VIA686A is not set
1091# CONFIG_SENSORS_VT1211 is not set
1092# CONFIG_SENSORS_VT8231 is not set
1093# CONFIG_SENSORS_W83781D is not set
1094# CONFIG_SENSORS_W83791D is not set
1095# CONFIG_SENSORS_W83792D is not set
1096# CONFIG_SENSORS_W83793 is not set
1097# CONFIG_SENSORS_W83L785TS is not set
1098# CONFIG_SENSORS_W83627HF is not set
1099# CONFIG_SENSORS_W83627EHF is not set
1100# CONFIG_SENSORS_HDAPS is not set
1101# CONFIG_SENSORS_APPLESMC is not set
1102# CONFIG_HWMON_DEBUG_CHIP is not set
1013 1103
1014# 1104#
1015# Multifunction device drivers 1105# Multifunction device drivers
@@ -1020,17 +1110,20 @@ CONFIG_HPET_MMAP=y
1020# Multimedia devices 1110# Multimedia devices
1021# 1111#
1022# CONFIG_VIDEO_DEV is not set 1112# CONFIG_VIDEO_DEV is not set
1023 1113# CONFIG_DVB_CORE is not set
1024# 1114CONFIG_DAB=y
1025# Digital Video Broadcasting Devices
1026#
1027# CONFIG_DVB is not set
1028# CONFIG_USB_DABUSB is not set 1115# CONFIG_USB_DABUSB is not set
1029 1116
1030# 1117#
1031# Graphics support 1118# Graphics support
1032# 1119#
1033# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 1120# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1121
1122#
1123# Display device support
1124#
1125# CONFIG_DISPLAY_SUPPORT is not set
1126# CONFIG_VGASTATE is not set
1034# CONFIG_FB is not set 1127# CONFIG_FB is not set
1035 1128
1036# 1129#
@@ -1056,14 +1149,10 @@ CONFIG_SOUND=y
1056# Open Sound System 1149# Open Sound System
1057# 1150#
1058CONFIG_SOUND_PRIME=y 1151CONFIG_SOUND_PRIME=y
1059CONFIG_OBSOLETE_OSS=y 1152# CONFIG_OSS_OBSOLETE is not set
1060# CONFIG_SOUND_BT878 is not set
1061# CONFIG_SOUND_ES1371 is not set
1062CONFIG_SOUND_ICH=y
1063# CONFIG_SOUND_TRIDENT is not set 1153# CONFIG_SOUND_TRIDENT is not set
1064# CONFIG_SOUND_MSNDCLAS is not set 1154# CONFIG_SOUND_MSNDCLAS is not set
1065# CONFIG_SOUND_MSNDPIN is not set 1155# CONFIG_SOUND_MSNDPIN is not set
1066# CONFIG_SOUND_VIA82CXXX is not set
1067# CONFIG_SOUND_OSS is not set 1156# CONFIG_SOUND_OSS is not set
1068 1157
1069# 1158#
@@ -1142,37 +1231,10 @@ CONFIG_USB_STORAGE=y
1142# CONFIG_USB_LIBUSUAL is not set 1231# CONFIG_USB_LIBUSUAL is not set
1143 1232
1144# 1233#
1145# USB Input Devices
1146#
1147# CONFIG_USB_AIPTEK is not set
1148# CONFIG_USB_WACOM is not set
1149# CONFIG_USB_ACECAD is not set
1150# CONFIG_USB_KBTAB is not set
1151# CONFIG_USB_POWERMATE is not set
1152# CONFIG_USB_TOUCHSCREEN is not set
1153# CONFIG_USB_YEALINK is not set
1154# CONFIG_USB_XPAD is not set
1155# CONFIG_USB_ATI_REMOTE is not set
1156# CONFIG_USB_ATI_REMOTE2 is not set
1157# CONFIG_USB_KEYSPAN_REMOTE is not set
1158# CONFIG_USB_APPLETOUCH is not set
1159# CONFIG_USB_GTCO is not set
1160
1161#
1162# USB Imaging devices 1234# USB Imaging devices
1163# 1235#
1164# CONFIG_USB_MDC800 is not set 1236# CONFIG_USB_MDC800 is not set
1165# CONFIG_USB_MICROTEK is not set 1237# CONFIG_USB_MICROTEK is not set
1166
1167#
1168# USB Network Adapters
1169#
1170# CONFIG_USB_CATC is not set
1171# CONFIG_USB_KAWETH is not set
1172# CONFIG_USB_PEGASUS is not set
1173# CONFIG_USB_RTL8150 is not set
1174# CONFIG_USB_USBNET_MII is not set
1175# CONFIG_USB_USBNET is not set
1176CONFIG_USB_MON=y 1238CONFIG_USB_MON=y
1177 1239
1178# 1240#
@@ -1216,10 +1278,6 @@ CONFIG_USB_MON=y
1216# USB Gadget Support 1278# USB Gadget Support
1217# 1279#
1218# CONFIG_USB_GADGET is not set 1280# CONFIG_USB_GADGET is not set
1219
1220#
1221# MMC/SD Card support
1222#
1223# CONFIG_MMC is not set 1281# CONFIG_MMC is not set
1224 1282
1225# 1283#
@@ -1264,10 +1322,6 @@ CONFIG_USB_MON=y
1264# 1322#
1265 1323
1266# 1324#
1267# Auxiliary Display support
1268#
1269
1270#
1271# Virtualization 1325# Virtualization
1272# 1326#
1273# CONFIG_KVM is not set 1327# CONFIG_KVM is not set
@@ -1385,6 +1439,7 @@ CONFIG_LOCKD_V4=y
1385CONFIG_EXPORTFS=y 1439CONFIG_EXPORTFS=y
1386CONFIG_NFS_COMMON=y 1440CONFIG_NFS_COMMON=y
1387CONFIG_SUNRPC=y 1441CONFIG_SUNRPC=y
1442# CONFIG_SUNRPC_BIND34 is not set
1388# CONFIG_RPCSEC_GSS_KRB5 is not set 1443# CONFIG_RPCSEC_GSS_KRB5 is not set
1389# CONFIG_RPCSEC_GSS_SPKM3 is not set 1444# CONFIG_RPCSEC_GSS_SPKM3 is not set
1390# CONFIG_SMB_FS is not set 1445# CONFIG_SMB_FS is not set
@@ -1468,10 +1523,9 @@ CONFIG_DEBUG_FS=y
1468# CONFIG_HEADERS_CHECK is not set 1523# CONFIG_HEADERS_CHECK is not set
1469CONFIG_DEBUG_KERNEL=y 1524CONFIG_DEBUG_KERNEL=y
1470# CONFIG_DEBUG_SHIRQ is not set 1525# CONFIG_DEBUG_SHIRQ is not set
1471CONFIG_LOG_BUF_SHIFT=18
1472CONFIG_DETECT_SOFTLOCKUP=y 1526CONFIG_DETECT_SOFTLOCKUP=y
1473# CONFIG_SCHEDSTATS is not set 1527# CONFIG_SCHEDSTATS is not set
1474CONFIG_TIMER_STATS=y 1528# CONFIG_TIMER_STATS is not set
1475# CONFIG_DEBUG_SLAB is not set 1529# CONFIG_DEBUG_SLAB is not set
1476# CONFIG_DEBUG_RT_MUTEXES is not set 1530# CONFIG_DEBUG_RT_MUTEXES is not set
1477# CONFIG_RT_MUTEX_TESTER is not set 1531# CONFIG_RT_MUTEX_TESTER is not set
@@ -1487,6 +1541,8 @@ CONFIG_DEBUG_BUGVERBOSE=y
1487# CONFIG_DEBUG_VM is not set 1541# CONFIG_DEBUG_VM is not set
1488# CONFIG_DEBUG_LIST is not set 1542# CONFIG_DEBUG_LIST is not set
1489# CONFIG_FRAME_POINTER is not set 1543# CONFIG_FRAME_POINTER is not set
1544CONFIG_UNWIND_INFO=y
1545CONFIG_STACK_UNWIND=y
1490# CONFIG_FORCED_INLINING is not set 1546# CONFIG_FORCED_INLINING is not set
1491# CONFIG_RCU_TORTURE_TEST is not set 1547# CONFIG_RCU_TORTURE_TEST is not set
1492# CONFIG_LKDTM is not set 1548# CONFIG_LKDTM is not set
@@ -1513,9 +1569,11 @@ CONFIG_DEBUG_STACKOVERFLOW=y
1513CONFIG_BITREVERSE=y 1569CONFIG_BITREVERSE=y
1514# CONFIG_CRC_CCITT is not set 1570# CONFIG_CRC_CCITT is not set
1515# CONFIG_CRC16 is not set 1571# CONFIG_CRC16 is not set
1572# CONFIG_CRC_ITU_T is not set
1516CONFIG_CRC32=y 1573CONFIG_CRC32=y
1517# CONFIG_LIBCRC32C is not set 1574# CONFIG_LIBCRC32C is not set
1518CONFIG_ZLIB_INFLATE=y 1575CONFIG_ZLIB_INFLATE=y
1519CONFIG_PLIST=y 1576CONFIG_PLIST=y
1520CONFIG_HAS_IOMEM=y 1577CONFIG_HAS_IOMEM=y
1521CONFIG_HAS_IOPORT=y 1578CONFIG_HAS_IOPORT=y
1579CONFIG_HAS_DMA=y
diff --git a/arch/x86_64/ia32/mmap32.c b/arch/x86_64/ia32/mmap32.c
index 079f4132575c..e4b84b4a417a 100644
--- a/arch/x86_64/ia32/mmap32.c
+++ b/arch/x86_64/ia32/mmap32.c
@@ -29,6 +29,7 @@
29#include <linux/personality.h> 29#include <linux/personality.h>
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/random.h> 31#include <linux/random.h>
32#include <linux/sched.h>
32 33
33/* 34/*
34 * Top of mmap area (just below the process stack). 35 * Top of mmap area (just below the process stack).
diff --git a/arch/x86_64/kernel/early_printk.c b/arch/x86_64/kernel/early_printk.c
index 56eaa259782b..296d2b0c5d88 100644
--- a/arch/x86_64/kernel/early_printk.c
+++ b/arch/x86_64/kernel/early_printk.c
@@ -91,9 +91,9 @@ static int early_serial_putc(unsigned char ch)
91static void early_serial_write(struct console *con, const char *s, unsigned n) 91static void early_serial_write(struct console *con, const char *s, unsigned n)
92{ 92{
93 while (*s && n-- > 0) { 93 while (*s && n-- > 0) {
94 early_serial_putc(*s);
95 if (*s == '\n') 94 if (*s == '\n')
96 early_serial_putc('\r'); 95 early_serial_putc('\r');
96 early_serial_putc(*s);
97 s++; 97 s++;
98 } 98 }
99} 99}
diff --git a/arch/x86_64/kernel/k8.c b/arch/x86_64/kernel/k8.c
index bc11b32e8b4d..7377ccb21335 100644
--- a/arch/x86_64/kernel/k8.c
+++ b/arch/x86_64/kernel/k8.c
@@ -39,10 +39,10 @@ int cache_k8_northbridges(void)
39{ 39{
40 int i; 40 int i;
41 struct pci_dev *dev; 41 struct pci_dev *dev;
42
42 if (num_k8_northbridges) 43 if (num_k8_northbridges)
43 return 0; 44 return 0;
44 45
45 num_k8_northbridges = 0;
46 dev = NULL; 46 dev = NULL;
47 while ((dev = next_k8_northbridge(dev)) != NULL) 47 while ((dev = next_k8_northbridge(dev)) != NULL)
48 num_k8_northbridges++; 48 num_k8_northbridges++;
@@ -52,6 +52,11 @@ int cache_k8_northbridges(void)
52 if (!k8_northbridges) 52 if (!k8_northbridges)
53 return -ENOMEM; 53 return -ENOMEM;
54 54
55 if (!num_k8_northbridges) {
56 k8_northbridges[0] = NULL;
57 return 0;
58 }
59
55 flush_words = kmalloc(num_k8_northbridges * sizeof(u32), GFP_KERNEL); 60 flush_words = kmalloc(num_k8_northbridges * sizeof(u32), GFP_KERNEL);
56 if (!flush_words) { 61 if (!flush_words) {
57 kfree(k8_northbridges); 62 kfree(k8_northbridges);
diff --git a/arch/x86_64/kernel/reboot.c b/arch/x86_64/kernel/reboot.c
index c116b54d422e..7503068e788d 100644
--- a/arch/x86_64/kernel/reboot.c
+++ b/arch/x86_64/kernel/reboot.c
@@ -8,6 +8,7 @@
8#include <linux/string.h> 8#include <linux/string.h>
9#include <linux/pm.h> 9#include <linux/pm.h>
10#include <linux/kdebug.h> 10#include <linux/kdebug.h>
11#include <linux/sched.h>
11#include <asm/io.h> 12#include <asm/io.h>
12#include <asm/delay.h> 13#include <asm/delay.h>
13#include <asm/hw_irq.h> 14#include <asm/hw_irq.h>
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index 88cfa50b424d..dbccfda8364f 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -31,7 +31,7 @@ SECTIONS
31 *(.bootstrap.text) 31 *(.bootstrap.text)
32 _stext = .; 32 _stext = .;
33 /* Then the rest */ 33 /* Then the rest */
34 *(.text) 34 TEXT_TEXT
35 SCHED_TEXT 35 SCHED_TEXT
36 LOCK_TEXT 36 LOCK_TEXT
37 KPROBES_TEXT 37 KPROBES_TEXT
@@ -55,7 +55,7 @@ SECTIONS
55 . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */ 55 . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */
56 /* Data */ 56 /* Data */
57 .data : AT(ADDR(.data) - LOAD_OFFSET) { 57 .data : AT(ADDR(.data) - LOAD_OFFSET) {
58 *(.data) 58 DATA_DATA
59 CONSTRUCTORS 59 CONSTRUCTORS
60 } :data 60 } :data
61 61
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
index 51d4c6fa88c8..57660d58d500 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86_64/kernel/vsyscall.c
@@ -175,10 +175,13 @@ int __vsyscall(0) vgettimeofday(struct timeval * tv, struct timezone * tz)
175 * unlikely */ 175 * unlikely */
176time_t __vsyscall(1) vtime(time_t *t) 176time_t __vsyscall(1) vtime(time_t *t)
177{ 177{
178 struct timeval tv;
178 time_t result; 179 time_t result;
179 if (unlikely(!__vsyscall_gtod_data.sysctl_enabled)) 180 if (unlikely(!__vsyscall_gtod_data.sysctl_enabled))
180 return time_syscall(t); 181 return time_syscall(t);
181 result = __vsyscall_gtod_data.wall_time_sec; 182
183 vgettimeofday(&tv, 0);
184 result = tv.tv_sec;
182 if (t) 185 if (t)
183 *t = result; 186 *t = result;
184 return result; 187 return result;
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index 1336da8bdee1..1ad5111aec38 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -761,3 +761,9 @@ int in_gate_area_no_task(unsigned long addr)
761{ 761{
762 return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END); 762 return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END);
763} 763}
764
765void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
766{
767 return __alloc_bootmem_core(pgdat->bdata, size,
768 SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0);
769}
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index 4fbd66a52a88..4b7b4ff79973 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -84,7 +84,8 @@ SECTIONS
84 { 84 {
85 /* The .head.text section must be the first section! */ 85 /* The .head.text section must be the first section! */
86 *(.head.text) 86 *(.head.text)
87 *(.literal .text) 87 *(.literal)
88 TEXT_TEXT
88 *(.srom.text) 89 *(.srom.text)
89 VMLINUX_SYMBOL(__sched_text_start) = .; 90 VMLINUX_SYMBOL(__sched_text_start) = .;
90 *(.sched.literal .sched.text) 91 *(.sched.literal .sched.text)
@@ -144,7 +145,8 @@ SECTIONS
144 _fdata = .; 145 _fdata = .;
145 .data : 146 .data :
146 { 147 {
147 *(.data) CONSTRUCTORS 148 DATA_DATA
149 CONSTRUCTORS
148 . = ALIGN(XCHAL_ICACHE_LINESIZE); 150 . = ALIGN(XCHAL_ICACHE_LINESIZE);
149 *(.data.cacheline_aligned) 151 *(.data.cacheline_aligned)
150 } 152 }
diff --git a/block/genhd.c b/block/genhd.c
index 93a2cf654597..863a8c0623ed 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -423,7 +423,10 @@ static ssize_t disk_size_read(struct gendisk * disk, char *page)
423{ 423{
424 return sprintf(page, "%llu\n", (unsigned long long)get_capacity(disk)); 424 return sprintf(page, "%llu\n", (unsigned long long)get_capacity(disk));
425} 425}
426 426static ssize_t disk_capability_read(struct gendisk *disk, char *page)
427{
428 return sprintf(page, "%x\n", disk->flags);
429}
427static ssize_t disk_stats_read(struct gendisk * disk, char *page) 430static ssize_t disk_stats_read(struct gendisk * disk, char *page)
428{ 431{
429 preempt_disable(); 432 preempt_disable();
@@ -466,6 +469,10 @@ static struct disk_attribute disk_attr_size = {
466 .attr = {.name = "size", .mode = S_IRUGO }, 469 .attr = {.name = "size", .mode = S_IRUGO },
467 .show = disk_size_read 470 .show = disk_size_read
468}; 471};
472static struct disk_attribute disk_attr_capability = {
473 .attr = {.name = "capability", .mode = S_IRUGO },
474 .show = disk_capability_read
475};
469static struct disk_attribute disk_attr_stat = { 476static struct disk_attribute disk_attr_stat = {
470 .attr = {.name = "stat", .mode = S_IRUGO }, 477 .attr = {.name = "stat", .mode = S_IRUGO },
471 .show = disk_stats_read 478 .show = disk_stats_read
@@ -506,6 +513,7 @@ static struct attribute * default_attrs[] = {
506 &disk_attr_removable.attr, 513 &disk_attr_removable.attr,
507 &disk_attr_size.attr, 514 &disk_attr_size.attr,
508 &disk_attr_stat.attr, 515 &disk_attr_stat.attr,
516 &disk_attr_capability.attr,
509#ifdef CONFIG_FAIL_MAKE_REQUEST 517#ifdef CONFIG_FAIL_MAKE_REQUEST
510 &disk_attr_fail.attr, 518 &disk_attr_fail.attr,
511#endif 519#endif
@@ -688,6 +696,27 @@ struct seq_operations diskstats_op = {
688 .show = diskstats_show 696 .show = diskstats_show
689}; 697};
690 698
699static void media_change_notify_thread(struct work_struct *work)
700{
701 struct gendisk *gd = container_of(work, struct gendisk, async_notify);
702 char event[] = "MEDIA_CHANGE=1";
703 char *envp[] = { event, NULL };
704
705 /*
706 * set enviroment vars to indicate which event this is for
707 * so that user space will know to go check the media status.
708 */
709 kobject_uevent_env(&gd->kobj, KOBJ_CHANGE, envp);
710 put_device(gd->driverfs_dev);
711}
712
713void genhd_media_change_notify(struct gendisk *disk)
714{
715 get_device(disk->driverfs_dev);
716 schedule_work(&disk->async_notify);
717}
718EXPORT_SYMBOL_GPL(genhd_media_change_notify);
719
691struct gendisk *alloc_disk(int minors) 720struct gendisk *alloc_disk(int minors)
692{ 721{
693 return alloc_disk_node(minors, -1); 722 return alloc_disk_node(minors, -1);
@@ -717,6 +746,8 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
717 kobj_set_kset_s(disk,block_subsys); 746 kobj_set_kset_s(disk,block_subsys);
718 kobject_init(&disk->kobj); 747 kobject_init(&disk->kobj);
719 rand_initialize_disk(disk); 748 rand_initialize_disk(disk);
749 INIT_WORK(&disk->async_notify,
750 media_change_notify_thread);
720 } 751 }
721 return disk; 752 return disk;
722} 753}
diff --git a/crypto/api.c b/crypto/api.c
index 55af8bb0f050..33734fd9198f 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -48,8 +48,10 @@ EXPORT_SYMBOL_GPL(crypto_mod_get);
48 48
49void crypto_mod_put(struct crypto_alg *alg) 49void crypto_mod_put(struct crypto_alg *alg)
50{ 50{
51 struct module *module = alg->cra_module;
52
51 crypto_alg_put(alg); 53 crypto_alg_put(alg);
52 module_put(alg->cra_module); 54 module_put(module);
53} 55}
54EXPORT_SYMBOL_GPL(crypto_mod_put); 56EXPORT_SYMBOL_GPL(crypto_mod_put);
55 57
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
index 3ff4e1f0f032..ac6dce2e7596 100644
--- a/crypto/cryptd.c
+++ b/crypto/cryptd.c
@@ -298,7 +298,7 @@ static inline int cryptd_create_thread(struct cryptd_state *state,
298 mutex_init(&state->mutex); 298 mutex_init(&state->mutex);
299 crypto_init_queue(&state->queue, CRYPTD_MAX_QLEN); 299 crypto_init_queue(&state->queue, CRYPTD_MAX_QLEN);
300 300
301 state->task = kthread_create(fn, state, name); 301 state->task = kthread_run(fn, state, name);
302 if (IS_ERR(state->task)) 302 if (IS_ERR(state->task))
303 return PTR_ERR(state->task); 303 return PTR_ERR(state->task);
304 304
@@ -316,6 +316,8 @@ static int cryptd_thread(void *data)
316 struct cryptd_state *state = data; 316 struct cryptd_state *state = data;
317 int stop; 317 int stop;
318 318
319 current->flags |= PF_NOFREEZE;
320
319 do { 321 do {
320 struct crypto_async_request *req, *backlog; 322 struct crypto_async_request *req, *backlog;
321 323
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index b770deab968c..6d7d4157e049 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -1357,7 +1357,7 @@ static struct backlight_ops asus_backlight_data = {
1357 .update_status = set_brightness_status, 1357 .update_status = set_brightness_status,
1358}; 1358};
1359 1359
1360static void __exit asus_acpi_exit(void) 1360static void asus_acpi_exit(void)
1361{ 1361{
1362 if (asus_backlight_device) 1362 if (asus_backlight_device)
1363 backlight_device_unregister(asus_backlight_device); 1363 backlight_device_unregister(asus_backlight_device);
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index a2efae8a4c4e..0c9f15c54e8c 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -59,7 +59,7 @@ int node_to_pxm(int node)
59 return node_to_pxm_map[node]; 59 return node_to_pxm_map[node];
60} 60}
61 61
62int __cpuinit acpi_map_pxm_to_node(int pxm) 62int acpi_map_pxm_to_node(int pxm)
63{ 63{
64 int node = pxm_to_node_map[pxm]; 64 int node = pxm_to_node_map[pxm];
65 65
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index b998340e23d4..58ceb18ec997 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -33,6 +33,7 @@
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/kmod.h> 34#include <linux/kmod.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/dmi.h>
36#include <linux/workqueue.h> 37#include <linux/workqueue.h>
37#include <linux/nmi.h> 38#include <linux/nmi.h>
38#include <linux/acpi.h> 39#include <linux/acpi.h>
@@ -73,6 +74,21 @@ static void *acpi_irq_context;
73static struct workqueue_struct *kacpid_wq; 74static struct workqueue_struct *kacpid_wq;
74static struct workqueue_struct *kacpi_notify_wq; 75static struct workqueue_struct *kacpi_notify_wq;
75 76
77#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */
78static char osi_additional_string[OSI_STRING_LENGTH_MAX];
79
80#define OSI_LINUX_ENABLED
81#ifdef OSI_LINUX_ENABLED
82int osi_linux = 1; /* enable _OSI(Linux) by default */
83#else
84int osi_linux; /* disable _OSI(Linux) by default */
85#endif
86
87
88#ifdef CONFIG_DMI
89static struct __initdata dmi_system_id acpi_osl_dmi_table[];
90#endif
91
76static void __init acpi_request_region (struct acpi_generic_address *addr, 92static void __init acpi_request_region (struct acpi_generic_address *addr,
77 unsigned int length, char *desc) 93 unsigned int length, char *desc)
78{ 94{
@@ -121,8 +137,9 @@ static int __init acpi_reserve_resources(void)
121} 137}
122device_initcall(acpi_reserve_resources); 138device_initcall(acpi_reserve_resources);
123 139
124acpi_status acpi_os_initialize(void) 140acpi_status __init acpi_os_initialize(void)
125{ 141{
142 dmi_check_system(acpi_osl_dmi_table);
126 return AE_OK; 143 return AE_OK;
127} 144}
128 145
@@ -960,20 +977,38 @@ static int __init acpi_os_name_setup(char *str)
960 977
961__setup("acpi_os_name=", acpi_os_name_setup); 978__setup("acpi_os_name=", acpi_os_name_setup);
962 979
980static void enable_osi_linux(int enable) {
981
982 if (osi_linux != enable)
983 printk(KERN_INFO PREFIX "%sabled _OSI(Linux)\n",
984 enable ? "En": "Dis");
985
986 osi_linux = enable;
987 return;
988}
989
963/* 990/*
964 * _OSI control 991 * Modify the list of "OS Interfaces" reported to BIOS via _OSI
992 *
965 * empty string disables _OSI 993 * empty string disables _OSI
966 * TBD additional string adds to _OSI 994 * string starting with '!' disables that string
995 * otherwise string is added to list, augmenting built-in strings
967 */ 996 */
968static int __init acpi_osi_setup(char *str) 997static int __init acpi_osi_setup(char *str)
969{ 998{
970 if (str == NULL || *str == '\0') { 999 if (str == NULL || *str == '\0') {
971 printk(KERN_INFO PREFIX "_OSI method disabled\n"); 1000 printk(KERN_INFO PREFIX "_OSI method disabled\n");
972 acpi_gbl_create_osi_method = FALSE; 1001 acpi_gbl_create_osi_method = FALSE;
973 } else { 1002 } else if (*str == '!') {
974 /* TBD */ 1003 if (acpi_osi_invalidate(++str) == AE_OK)
975 printk(KERN_ERR PREFIX "_OSI additional string ignored -- %s\n", 1004 printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
976 str); 1005 } else if (!strcmp("!Linux", str)) {
1006 enable_osi_linux(0);
1007 } else if (!strcmp("Linux", str)) {
1008 enable_osi_linux(1);
1009 } else if (*osi_additional_string == '\0') {
1010 strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX);
1011 printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
977 } 1012 }
978 1013
979 return 1; 1014 return 1;
@@ -1143,11 +1178,28 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
1143acpi_status 1178acpi_status
1144acpi_os_validate_interface (char *interface) 1179acpi_os_validate_interface (char *interface)
1145{ 1180{
1146 1181 if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX))
1147 return AE_SUPPORT; 1182 return AE_OK;
1183 if (!strcmp("Linux", interface)) {
1184 printk(KERN_WARNING PREFIX
1185 "System BIOS is requesting _OSI(Linux)\n");
1186#ifdef OSI_LINUX_ENABLED
1187 printk(KERN_WARNING PREFIX
1188 "Please test with \"acpi_osi=!Linux\"\n"
1189 "Please send dmidecode "
1190 "to linux-acpi@vger.kernel.org\n");
1191#else
1192 printk(KERN_WARNING PREFIX
1193 "If \"acpi_osi=Linux\" works better,\n"
1194 "Please send dmidecode "
1195 "to linux-acpi@vger.kernel.org\n");
1196#endif
1197 if(osi_linux)
1198 return AE_OK;
1199 }
1200 return AE_SUPPORT;
1148} 1201}
1149 1202
1150
1151/****************************************************************************** 1203/******************************************************************************
1152 * 1204 *
1153 * FUNCTION: acpi_os_validate_address 1205 * FUNCTION: acpi_os_validate_address
@@ -1174,5 +1226,51 @@ acpi_os_validate_address (
1174 return AE_OK; 1226 return AE_OK;
1175} 1227}
1176 1228
1229#ifdef CONFIG_DMI
1230#ifdef OSI_LINUX_ENABLED
1231static int dmi_osi_not_linux(struct dmi_system_id *d)
1232{
1233 printk(KERN_NOTICE "%s detected: requires not _OSI(Linux)\n", d->ident);
1234 enable_osi_linux(0);
1235 return 0;
1236}
1237#else
1238static int dmi_osi_linux(struct dmi_system_id *d)
1239{
1240 printk(KERN_NOTICE "%s detected: requires _OSI(Linux)\n", d->ident);
1241 enable_osi_linux(1);
1242 return 0;
1243}
1244#endif
1245
1246static struct dmi_system_id acpi_osl_dmi_table[] __initdata = {
1247#ifdef OSI_LINUX_ENABLED
1248 /*
1249 * Boxes that need NOT _OSI(Linux)
1250 */
1251 {
1252 .callback = dmi_osi_not_linux,
1253 .ident = "Toshiba Satellite P100",
1254 .matches = {
1255 DMI_MATCH(DMI_BOARD_VENDOR, "TOSHIBA"),
1256 DMI_MATCH(DMI_BOARD_NAME, "Satellite P100"),
1257 },
1258 },
1259#else
1260 /*
1261 * Boxes that need _OSI(Linux)
1262 */
1263 {
1264 .callback = dmi_osi_linux,
1265 .ident = "Intel Napa CRB",
1266 .matches = {
1267 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
1268 DMI_MATCH(DMI_BOARD_NAME, "MPAD-MSAE Customer Reference Boards"),
1269 },
1270 },
1271#endif
1272 {}
1273};
1274#endif /* CONFIG_DMI */
1177 1275
1178#endif 1276#endif
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 0e7b121a99ce..3bc0c67a9283 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -123,14 +123,14 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc,
123 } 123 }
124 } 124 }
125 125
126 /* The table must be either an SSDT or a PSDT */ 126 /* The table must be either an SSDT or a PSDT or an OEMx */
127 127
128 if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT)) 128 if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT))
129 && 129 &&
130 (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))) 130 (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))
131 { 131 && (strncmp(table_desc->pointer->signature, "OEM", 3))) {
132 ACPI_ERROR((AE_INFO, 132 ACPI_ERROR((AE_INFO,
133 "Table has invalid signature [%4.4s], must be SSDT or PSDT", 133 "Table has invalid signature [%4.4s], must be SSDT, PSDT or OEMx",
134 table_desc->pointer->signature)); 134 table_desc->pointer->signature));
135 return_ACPI_STATUS(AE_BAD_SIGNATURE); 135 return_ACPI_STATUS(AE_BAD_SIGNATURE);
136 } 136 }
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 1ada017d01ef..194ecfe8b360 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -827,6 +827,7 @@ static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file)
827static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) 827static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
828{ 828{
829 struct acpi_thermal *tz = seq->private; 829 struct acpi_thermal *tz = seq->private;
830 struct acpi_device *device;
830 int i = 0; 831 int i = 0;
831 int j = 0; 832 int j = 0;
832 833
@@ -849,9 +850,8 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
849 tz->trips.passive.tc1, tz->trips.passive.tc2, 850 tz->trips.passive.tc1, tz->trips.passive.tc2,
850 tz->trips.passive.tsp); 851 tz->trips.passive.tsp);
851 for (j = 0; j < tz->trips.passive.devices.count; j++) { 852 for (j = 0; j < tz->trips.passive.devices.count; j++) {
852 853 acpi_bus_get_device(tz->trips.passive.devices.handles[j], &device);
853 seq_printf(seq, "0x%p ", 854 seq_printf(seq, "%4.4s ", acpi_device_bid(device));
854 tz->trips.passive.devices.handles[j]);
855 } 855 }
856 seq_puts(seq, "\n"); 856 seq_puts(seq, "\n");
857 } 857 }
@@ -862,9 +862,10 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
862 seq_printf(seq, "active[%d]: %ld C: devices=", 862 seq_printf(seq, "active[%d]: %ld C: devices=",
863 i, 863 i,
864 KELVIN_TO_CELSIUS(tz->trips.active[i].temperature)); 864 KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
865 for (j = 0; j < tz->trips.active[i].devices.count; j++) 865 for (j = 0; j < tz->trips.active[i].devices.count; j++){
866 seq_printf(seq, "0x%p ", 866 acpi_bus_get_device(tz->trips.active[i].devices.handles[j], &device);
867 tz->trips.active[i].devices.handles[j]); 867 seq_printf(seq, "%4.4s ", acpi_device_bid(device));
868 }
868 seq_puts(seq, "\n"); 869 seq_puts(seq, "\n");
869 } 870 }
870 871
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 3906d47b9783..1cfbecb0ac10 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -538,7 +538,7 @@ static struct backlight_ops toshiba_backlight_data = {
538 .update_status = set_lcd_status, 538 .update_status = set_lcd_status,
539}; 539};
540 540
541static void __exit toshiba_acpi_exit(void) 541static void toshiba_acpi_exit(void)
542{ 542{
543 if (toshiba_backlight_device) 543 if (toshiba_backlight_device)
544 backlight_device_unregister(toshiba_backlight_device); 544 backlight_device_unregister(toshiba_backlight_device);
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 4c1e00874dff..879eaa10d3ae 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -68,6 +68,10 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *user_obj,
68 union acpi_operand_object **return_obj); 68 union acpi_operand_object **return_obj);
69 69
70static acpi_status 70static acpi_status
71acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
72 union acpi_operand_object **internal_object);
73
74static acpi_status
71acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, 75acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
72 union acpi_operand_object *dest_desc); 76 union acpi_operand_object *dest_desc);
73 77
@@ -518,77 +522,73 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
518 return_ACPI_STATUS(AE_NO_MEMORY); 522 return_ACPI_STATUS(AE_NO_MEMORY);
519} 523}
520 524
521#ifdef ACPI_FUTURE_IMPLEMENTATION
522/* Code to convert packages that are parameters to control methods */
523
524/******************************************************************************* 525/*******************************************************************************
525 * 526 *
526 * FUNCTION: acpi_ut_copy_epackage_to_ipackage 527 * FUNCTION: acpi_ut_copy_epackage_to_ipackage
527 * 528 *
528 * PARAMETERS: *internal_object - Pointer to the object we are returning 529 * PARAMETERS: external_object - The external object to be converted
529 * *Buffer - Where the object is returned 530 * internal_object - Where the internal object is returned
530 * *space_used - Where the length of the object is returned
531 * 531 *
532 * RETURN: Status 532 * RETURN: Status
533 * 533 *
534 * DESCRIPTION: This function is called to place a package object in a user 534 * DESCRIPTION: Copy an external package object to an internal package.
535 * buffer. A package object by definition contains other objects. 535 * Handles nested packages.
536 *
537 * The buffer is assumed to have sufficient space for the object.
538 * The caller must have verified the buffer length needed using the
539 * acpi_ut_get_object_size function before calling this function.
540 * 536 *
541 ******************************************************************************/ 537 ******************************************************************************/
542 538
543static acpi_status 539static acpi_status
544acpi_ut_copy_epackage_to_ipackage(union acpi_operand_object *internal_object, 540acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
545 u8 * buffer, u32 * space_used) 541 union acpi_operand_object **internal_object)
546{ 542{
547 u8 *free_space; 543 acpi_status status = AE_OK;
548 union acpi_object *external_object; 544 union acpi_operand_object *package_object;
549 u32 length = 0; 545 union acpi_operand_object **package_elements;
550 u32 this_index; 546 acpi_native_uint i;
551 u32 object_space = 0;
552 union acpi_operand_object *this_internal_obj;
553 union acpi_object *this_external_obj;
554 547
555 ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage); 548 ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage);
556 549
557 /* 550 /* Create the package object */
558 * First package at head of the buffer
559 */
560 external_object = (union acpi_object *)buffer;
561 551
562 /* 552 package_object =
563 * Free space begins right after the first package 553 acpi_ut_create_package_object(external_object->package.count);
564 */ 554 if (!package_object) {
565 free_space = buffer + sizeof(union acpi_object); 555 return_ACPI_STATUS(AE_NO_MEMORY);
556 }
566 557
567 external_object->type = ACPI_GET_OBJECT_TYPE(internal_object); 558 package_elements = package_object->package.elements;
568 external_object->package.count = internal_object->package.count;
569 external_object->package.elements = (union acpi_object *)free_space;
570 559
571 /* 560 /*
572 * Build an array of ACPI_OBJECTS in the buffer 561 * Recursive implementation. Probably ok, since nested external packages
573 * and move the free space past it 562 * as parameters should be very rare.
574 */ 563 */
575 free_space += 564 for (i = 0; i < external_object->package.count; i++) {
576 external_object->package.count * sizeof(union acpi_object); 565 status =
566 acpi_ut_copy_eobject_to_iobject(&external_object->package.
567 elements[i],
568 &package_elements[i]);
569 if (ACPI_FAILURE(status)) {
577 570
578 /* Call walk_package */ 571 /* Truncate package and delete it */
579 572
580} 573 package_object->package.count = i;
574 package_elements[i] = NULL;
575 acpi_ut_remove_reference(package_object);
576 return_ACPI_STATUS(status);
577 }
578 }
581 579
582#endif /* Future implementation */ 580 *internal_object = package_object;
581 return_ACPI_STATUS(status);
582}
583 583
584/******************************************************************************* 584/*******************************************************************************
585 * 585 *
586 * FUNCTION: acpi_ut_copy_eobject_to_iobject 586 * FUNCTION: acpi_ut_copy_eobject_to_iobject
587 * 587 *
588 * PARAMETERS: *internal_object - The external object to be converted 588 * PARAMETERS: external_object - The external object to be converted
589 * *buffer_ptr - Where the internal object is returned 589 * internal_object - Where the internal object is returned
590 * 590 *
591 * RETURN: Status - the status of the call 591 * RETURN: Status - the status of the call
592 * 592 *
593 * DESCRIPTION: Converts an external object to an internal object. 593 * DESCRIPTION: Converts an external object to an internal object.
594 * 594 *
@@ -603,16 +603,10 @@ acpi_ut_copy_eobject_to_iobject(union acpi_object *external_object,
603 ACPI_FUNCTION_TRACE(ut_copy_eobject_to_iobject); 603 ACPI_FUNCTION_TRACE(ut_copy_eobject_to_iobject);
604 604
605 if (external_object->type == ACPI_TYPE_PACKAGE) { 605 if (external_object->type == ACPI_TYPE_PACKAGE) {
606 /* 606 status =
607 * Packages as external input to control methods are not supported, 607 acpi_ut_copy_epackage_to_ipackage(external_object,
608 */ 608 internal_object);
609 ACPI_ERROR((AE_INFO, 609 } else {
610 "Packages as parameters not implemented!"));
611
612 return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
613 }
614
615 else {
616 /* 610 /*
617 * Build a simple object (no nested objects) 611 * Build a simple object (no nested objects)
618 */ 612 */
@@ -803,33 +797,19 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type,
803 * Create and build the package object 797 * Create and build the package object
804 */ 798 */
805 target_object = 799 target_object =
806 acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE); 800 acpi_ut_create_package_object(source_object->package.count);
807 if (!target_object) { 801 if (!target_object) {
808 return (AE_NO_MEMORY); 802 return (AE_NO_MEMORY);
809 } 803 }
810 804
811 target_object->package.count = source_object->package.count;
812 target_object->common.flags = source_object->common.flags; 805 target_object->common.flags = source_object->common.flags;
813 806
814 /* 807 /* Pass the new package object back to the package walk routine */
815 * Create the object array
816 */
817 target_object->package.elements =
818 ACPI_ALLOCATE_ZEROED(((acpi_size) source_object->package.
819 count + 1) * sizeof(void *));
820 if (!target_object->package.elements) {
821 status = AE_NO_MEMORY;
822 goto error_exit;
823 }
824 808
825 /*
826 * Pass the new package object back to the package walk routine
827 */
828 state->pkg.this_target_obj = target_object; 809 state->pkg.this_target_obj = target_object;
829 810
830 /* 811 /* Store the object pointer in the parent package object */
831 * Store the object pointer in the parent package object 812
832 */
833 *this_target_ptr = target_object; 813 *this_target_ptr = target_object;
834 break; 814 break;
835 815
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index 13d5879cd98b..8ec6f8e48138 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -59,10 +59,9 @@ acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc,
59/* 59/*
60 * Strings supported by the _OSI predefined (internal) method. 60 * Strings supported by the _OSI predefined (internal) method.
61 */ 61 */
62static const char *acpi_interfaces_supported[] = { 62static char *acpi_interfaces_supported[] = {
63 /* Operating System Vendor Strings */ 63 /* Operating System Vendor Strings */
64 64
65 "Linux",
66 "Windows 2000", 65 "Windows 2000",
67 "Windows 2001", 66 "Windows 2001",
68 "Windows 2001 SP0", 67 "Windows 2001 SP0",
@@ -158,6 +157,31 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
158 157
159/******************************************************************************* 158/*******************************************************************************
160 * 159 *
160 * FUNCTION: acpi_osi_invalidate
161 *
162 * PARAMETERS: interface_string
163 *
164 * RETURN: Status
165 *
166 * DESCRIPTION: invalidate string in pre-defiend _OSI string list
167 *
168 ******************************************************************************/
169
170acpi_status acpi_osi_invalidate(char *interface)
171{
172 int i;
173
174 for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
175 if (!ACPI_STRCMP(interface, acpi_interfaces_supported[i])) {
176 *acpi_interfaces_supported[i] = '\0';
177 return AE_OK;
178 }
179 }
180 return AE_NOT_FOUND;
181}
182
183/*******************************************************************************
184 *
161 * FUNCTION: acpi_ut_evaluate_object 185 * FUNCTION: acpi_ut_evaluate_object
162 * 186 *
163 * PARAMETERS: prefix_node - Starting node 187 * PARAMETERS: prefix_node - Starting node
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 4696124759e1..db0b9bac7945 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -146,6 +146,48 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name,
146 146
147/******************************************************************************* 147/*******************************************************************************
148 * 148 *
149 * FUNCTION: acpi_ut_create_package_object
150 *
151 * PARAMETERS: Count - Number of package elements
152 *
153 * RETURN: Pointer to a new Package object, null on failure
154 *
155 * DESCRIPTION: Create a fully initialized package object
156 *
157 ******************************************************************************/
158
159union acpi_operand_object *acpi_ut_create_package_object(u32 count)
160{
161 union acpi_operand_object *package_desc;
162 union acpi_operand_object **package_elements;
163
164 ACPI_FUNCTION_TRACE_U32(ut_create_package_object, count);
165
166 /* Create a new Package object */
167
168 package_desc = acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE);
169 if (!package_desc) {
170 return_PTR(NULL);
171 }
172
173 /*
174 * Create the element array. Count+1 allows the array to be null
175 * terminated.
176 */
177 package_elements = ACPI_ALLOCATE_ZEROED((acpi_size)
178 (count + 1) * sizeof(void *));
179 if (!package_elements) {
180 ACPI_FREE(package_desc);
181 return_PTR(NULL);
182 }
183
184 package_desc->package.count = count;
185 package_desc->package.elements = package_elements;
186 return_PTR(package_desc);
187}
188
189/*******************************************************************************
190 *
149 * FUNCTION: acpi_ut_create_buffer_object 191 * FUNCTION: acpi_ut_create_buffer_object
150 * 192 *
151 * PARAMETERS: buffer_size - Size of buffer to be created 193 * PARAMETERS: buffer_size - Size of buffer to be created
diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
index e9a57806cd34..2d496918b3cd 100644
--- a/drivers/acpi/utilities/utxface.c
+++ b/drivers/acpi/utilities/utxface.c
@@ -61,7 +61,7 @@ ACPI_MODULE_NAME("utxface")
61 * called, so any early initialization belongs here. 61 * called, so any early initialization belongs here.
62 * 62 *
63 ******************************************************************************/ 63 ******************************************************************************/
64acpi_status acpi_initialize_subsystem(void) 64acpi_status __init acpi_initialize_subsystem(void)
65{ 65{
66 acpi_status status; 66 acpi_status status;
67 67
@@ -108,8 +108,6 @@ acpi_status acpi_initialize_subsystem(void)
108 return_ACPI_STATUS(status); 108 return_ACPI_STATUS(status);
109} 109}
110 110
111ACPI_EXPORT_SYMBOL(acpi_initialize_subsystem)
112
113/******************************************************************************* 111/*******************************************************************************
114 * 112 *
115 * FUNCTION: acpi_enable_subsystem 113 * FUNCTION: acpi_enable_subsystem
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index ad1f59c1b3fc..b4a8d6030e48 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -132,7 +132,7 @@ config SATA_SIS
132 depends on PCI 132 depends on PCI
133 select PATA_SIS 133 select PATA_SIS
134 help 134 help
135 This option enables support for SiS Serial ATA on 135 This option enables support for SiS Serial ATA on
136 SiS 964/965/966/180 and Parallel ATA on SiS 180. 136 SiS 964/965/966/180 and Parallel ATA on SiS 180.
137 The PATA support for SiS 180 requires additionally to 137 The PATA support for SiS 180 requires additionally to
138 enable the PATA_SIS driver in the config. 138 enable the PATA_SIS driver in the config.
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index e00e1b913d28..7baeaffefe7a 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -46,7 +46,7 @@
46#include <linux/libata.h> 46#include <linux/libata.h>
47 47
48#define DRV_NAME "ahci" 48#define DRV_NAME "ahci"
49#define DRV_VERSION "2.1" 49#define DRV_VERSION "2.2"
50 50
51 51
52enum { 52enum {
@@ -170,6 +170,7 @@ enum {
170 AHCI_FLAG_IGN_IRQ_IF_ERR = (1 << 25), /* ignore IRQ_IF_ERR */ 170 AHCI_FLAG_IGN_IRQ_IF_ERR = (1 << 25), /* ignore IRQ_IF_ERR */
171 AHCI_FLAG_HONOR_PI = (1 << 26), /* honor PORTS_IMPL */ 171 AHCI_FLAG_HONOR_PI = (1 << 26), /* honor PORTS_IMPL */
172 AHCI_FLAG_IGN_SERR_INTERNAL = (1 << 27), /* ignore SERR_INTERNAL */ 172 AHCI_FLAG_IGN_SERR_INTERNAL = (1 << 27), /* ignore SERR_INTERNAL */
173 AHCI_FLAG_32BIT_ONLY = (1 << 28), /* force 32bit */
173 174
174 AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 175 AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
175 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 176 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
@@ -354,7 +355,8 @@ static const struct ata_port_info ahci_port_info[] = {
354 /* board_ahci_sb600 */ 355 /* board_ahci_sb600 */
355 { 356 {
356 .flags = AHCI_FLAG_COMMON | 357 .flags = AHCI_FLAG_COMMON |
357 AHCI_FLAG_IGN_SERR_INTERNAL, 358 AHCI_FLAG_IGN_SERR_INTERNAL |
359 AHCI_FLAG_32BIT_ONLY,
358 .pio_mask = 0x1f, /* pio0-4 */ 360 .pio_mask = 0x1f, /* pio0-4 */
359 .udma_mask = 0x7f, /* udma0-6 ; FIXME */ 361 .udma_mask = 0x7f, /* udma0-6 ; FIXME */
360 .port_ops = &ahci_ops, 362 .port_ops = &ahci_ops,
@@ -492,6 +494,13 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
492 hpriv->saved_cap = cap = readl(mmio + HOST_CAP); 494 hpriv->saved_cap = cap = readl(mmio + HOST_CAP);
493 hpriv->saved_port_map = port_map = readl(mmio + HOST_PORTS_IMPL); 495 hpriv->saved_port_map = port_map = readl(mmio + HOST_PORTS_IMPL);
494 496
497 /* some chips lie about 64bit support */
498 if ((cap & HOST_CAP_64) && (pi->flags & AHCI_FLAG_32BIT_ONLY)) {
499 dev_printk(KERN_INFO, &pdev->dev,
500 "controller can't do 64bit DMA, forcing 32bit\n");
501 cap &= ~HOST_CAP_64;
502 }
503
495 /* fixup zero port_map */ 504 /* fixup zero port_map */
496 if (!port_map) { 505 if (!port_map) {
497 port_map = (1 << ahci_nr_ports(hpriv->cap)) - 1; 506 port_map = (1 << ahci_nr_ports(hpriv->cap)) - 1;
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
index c3d753296bc6..7565f022bd69 100644
--- a/drivers/ata/ata_generic.c
+++ b/drivers/ata/ata_generic.c
@@ -26,7 +26,7 @@
26#include <linux/libata.h> 26#include <linux/libata.h>
27 27
28#define DRV_NAME "ata_generic" 28#define DRV_NAME "ata_generic"
29#define DRV_VERSION "0.2.11" 29#define DRV_VERSION "0.2.12"
30 30
31/* 31/*
32 * A generic parallel ATA driver using libata 32 * A generic parallel ATA driver using libata
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 13b6b1df2ac4..9c07b88631be 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -155,7 +155,6 @@ struct piix_host_priv {
155static int piix_init_one (struct pci_dev *pdev, 155static int piix_init_one (struct pci_dev *pdev,
156 const struct pci_device_id *ent); 156 const struct pci_device_id *ent);
157static void piix_pata_error_handler(struct ata_port *ap); 157static void piix_pata_error_handler(struct ata_port *ap);
158static void piix_sata_error_handler(struct ata_port *ap);
159static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev); 158static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev);
160static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev); 159static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev);
161static void ich_set_dmamode (struct ata_port *ap, struct ata_device *adev); 160static void ich_set_dmamode (struct ata_port *ap, struct ata_device *adev);
@@ -364,7 +363,7 @@ static const struct ata_port_operations piix_sata_ops = {
364 363
365 .freeze = ata_bmdma_freeze, 364 .freeze = ata_bmdma_freeze,
366 .thaw = ata_bmdma_thaw, 365 .thaw = ata_bmdma_thaw,
367 .error_handler = piix_sata_error_handler, 366 .error_handler = ata_bmdma_error_handler,
368 .post_internal_cmd = ata_bmdma_post_internal_cmd, 367 .post_internal_cmd = ata_bmdma_post_internal_cmd,
369 368
370 .irq_handler = ata_interrupt, 369 .irq_handler = ata_interrupt,
@@ -579,6 +578,7 @@ static const struct ich_laptop ich_laptop[] = {
579 { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ 578 { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */
580 { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */ 579 { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */
581 { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */ 580 { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */
581 { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */
582 /* end marker */ 582 /* end marker */
583 { 0, } 583 { 0, }
584}; 584};
@@ -641,12 +641,6 @@ static void piix_pata_error_handler(struct ata_port *ap)
641 ata_std_postreset); 641 ata_std_postreset);
642} 642}
643 643
644static void piix_sata_error_handler(struct ata_port *ap)
645{
646 ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset, NULL,
647 ata_std_postreset);
648}
649
650/** 644/**
651 * piix_set_piomode - Initialize host controller PATA PIO timings 645 * piix_set_piomode - Initialize host controller PATA PIO timings
652 * @ap: Port whose timings we are configuring 646 * @ap: Port whose timings we are configuring
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d3ea7f55283c..af625147df62 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -59,7 +59,7 @@
59 59
60#include "libata.h" 60#include "libata.h"
61 61
62#define DRV_VERSION "2.20" /* must be exactly four chars */ 62#define DRV_VERSION "2.21" /* must be exactly four chars */
63 63
64 64
65/* debounce timing parameters in msecs { interval, duration, timeout } */ 65/* debounce timing parameters in msecs { interval, duration, timeout } */
@@ -977,7 +977,7 @@ static u64 ata_hpa_resize(struct ata_device *dev)
977{ 977{
978 u64 sectors = dev->n_sectors; 978 u64 sectors = dev->n_sectors;
979 u64 hpa_sectors; 979 u64 hpa_sectors;
980 980
981 if (ata_id_has_lba48(dev->id)) 981 if (ata_id_has_lba48(dev->id))
982 hpa_sectors = ata_read_native_max_address_ext(dev); 982 hpa_sectors = ata_read_native_max_address_ext(dev);
983 else 983 else
@@ -1588,7 +1588,7 @@ unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd)
1588 * Check if the current speed of the device requires IORDY. Used 1588 * Check if the current speed of the device requires IORDY. Used
1589 * by various controllers for chip configuration. 1589 * by various controllers for chip configuration.
1590 */ 1590 */
1591 1591
1592unsigned int ata_pio_need_iordy(const struct ata_device *adev) 1592unsigned int ata_pio_need_iordy(const struct ata_device *adev)
1593{ 1593{
1594 /* Controller doesn't support IORDY. Probably a pointless check 1594 /* Controller doesn't support IORDY. Probably a pointless check
@@ -1611,7 +1611,7 @@ unsigned int ata_pio_need_iordy(const struct ata_device *adev)
1611 * Compute the highest mode possible if we are not using iordy. Return 1611 * Compute the highest mode possible if we are not using iordy. Return
1612 * -1 if no iordy mode is available. 1612 * -1 if no iordy mode is available.
1613 */ 1613 */
1614 1614
1615static u32 ata_pio_mask_no_iordy(const struct ata_device *adev) 1615static u32 ata_pio_mask_no_iordy(const struct ata_device *adev)
1616{ 1616{
1617 /* If we have no drive specific rule, then PIO 2 is non IORDY */ 1617 /* If we have no drive specific rule, then PIO 2 is non IORDY */
@@ -2663,7 +2663,7 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed,
2663 t->active += (t->cycle - (t->active + t->recover)) / 2; 2663 t->active += (t->cycle - (t->active + t->recover)) / 2;
2664 t->recover = t->cycle - t->active; 2664 t->recover = t->cycle - t->active;
2665 } 2665 }
2666 2666
2667 /* In a few cases quantisation may produce enough errors to 2667 /* In a few cases quantisation may produce enough errors to
2668 leave t->cycle too low for the sum of active and recovery 2668 leave t->cycle too low for the sum of active and recovery
2669 if so we must correct this */ 2669 if so we must correct this */
@@ -2893,9 +2893,6 @@ int ata_do_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
2893 if (used_dma && (ap->host->flags & ATA_HOST_SIMPLEX)) 2893 if (used_dma && (ap->host->flags & ATA_HOST_SIMPLEX))
2894 ap->host->simplex_claimed = ap; 2894 ap->host->simplex_claimed = ap;
2895 2895
2896 /* step5: chip specific finalisation */
2897 if (ap->ops->post_set_mode)
2898 ap->ops->post_set_mode(ap);
2899 out: 2896 out:
2900 if (rc) 2897 if (rc)
2901 *r_failed_dev = dev; 2898 *r_failed_dev = dev;
@@ -3025,7 +3022,7 @@ int ata_wait_ready(struct ata_port *ap, unsigned long deadline)
3025 3022
3026 if (!(status & ATA_BUSY)) 3023 if (!(status & ATA_BUSY))
3027 return 0; 3024 return 0;
3028 if (status == 0xff) 3025 if (!ata_port_online(ap) && status == 0xff)
3029 return -ENODEV; 3026 return -ENODEV;
3030 if (time_after(now, deadline)) 3027 if (time_after(now, deadline))
3031 return -EBUSY; 3028 return -EBUSY;
@@ -3371,7 +3368,7 @@ int ata_std_prereset(struct ata_port *ap, unsigned long deadline)
3371 */ 3368 */
3372 if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_port_offline(ap)) { 3369 if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_port_offline(ap)) {
3373 rc = ata_wait_ready(ap, deadline); 3370 rc = ata_wait_ready(ap, deadline);
3374 if (rc) { 3371 if (rc && rc != -ENODEV) {
3375 ata_port_printk(ap, KERN_WARNING, "device not ready " 3372 ata_port_printk(ap, KERN_WARNING, "device not ready "
3376 "(errno=%d), forcing hardreset\n", rc); 3373 "(errno=%d), forcing hardreset\n", rc);
3377 ehc->i.action |= ATA_EH_HARDRESET; 3374 ehc->i.action |= ATA_EH_HARDRESET;
@@ -3771,6 +3768,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
3771 { "ATAPI CD-ROM DRIVE 40X MAXIMUM",NULL,ATA_HORKAGE_NODMA }, 3768 { "ATAPI CD-ROM DRIVE 40X MAXIMUM",NULL,ATA_HORKAGE_NODMA },
3772 { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA }, 3769 { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA },
3773 { "SAMSUNG CD-ROM SN-124","N001", ATA_HORKAGE_NODMA }, 3770 { "SAMSUNG CD-ROM SN-124","N001", ATA_HORKAGE_NODMA },
3771 { "Seagate STT20000A", NULL, ATA_HORKAGE_NODMA },
3774 3772
3775 /* Weird ATAPI devices */ 3773 /* Weird ATAPI devices */
3776 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 | 3774 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 |
@@ -3785,6 +3783,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
3785 { "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ }, 3783 { "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ },
3786 /* NCQ is broken */ 3784 /* NCQ is broken */
3787 { "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ }, 3785 { "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ },
3786 { "Maxtor 6B200M0", "BANC1B10", ATA_HORKAGE_NONCQ },
3788 /* NCQ hard hangs device under heavier load, needs hard power cycle */ 3787 /* NCQ hard hangs device under heavier load, needs hard power cycle */
3789 { "Maxtor 6B250S0", "BANC1B70", ATA_HORKAGE_NONCQ }, 3788 { "Maxtor 6B250S0", "BANC1B70", ATA_HORKAGE_NONCQ },
3790 /* Blacklist entries taken from Silicon Image 3124/3132 3789 /* Blacklist entries taken from Silicon Image 3124/3132
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 5309c312f517..d8070989a39f 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1009,7 +1009,7 @@ static unsigned int atapi_eh_request_sense(struct ata_queued_cmd *qc)
1009 sense_buf[0] = 0x70; 1009 sense_buf[0] = 0x70;
1010 sense_buf[2] = qc->result_tf.feature >> 4; 1010 sense_buf[2] = qc->result_tf.feature >> 4;
1011 1011
1012 /* some devices time out if garbage left in tf */ 1012 /* some devices time out if garbage left in tf */
1013 ata_tf_init(dev, &tf); 1013 ata_tf_init(dev, &tf);
1014 1014
1015 memset(cdb, 0, ATAPI_CDB_LEN); 1015 memset(cdb, 0, ATAPI_CDB_LEN);
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 242c43eef807..b3900cfbd880 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1050,14 +1050,15 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc)
1050static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen) 1050static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen)
1051{ 1051{
1052 u64 lba = 0; 1052 u64 lba = 0;
1053 u32 len = 0; 1053 u32 len;
1054 1054
1055 VPRINTK("six-byte command\n"); 1055 VPRINTK("six-byte command\n");
1056 1056
1057 lba |= ((u64)(cdb[1] & 0x1f)) << 16;
1057 lba |= ((u64)cdb[2]) << 8; 1058 lba |= ((u64)cdb[2]) << 8;
1058 lba |= ((u64)cdb[3]); 1059 lba |= ((u64)cdb[3]);
1059 1060
1060 len |= ((u32)cdb[4]); 1061 len = cdb[4];
1061 1062
1062 *plba = lba; 1063 *plba = lba;
1063 *plen = len; 1064 *plen = len;
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 9861059dd673..03b6ddd2abd2 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -28,7 +28,7 @@
28#include <linux/ata.h> 28#include <linux/ata.h>
29 29
30#define DRV_NAME "pata_artop" 30#define DRV_NAME "pata_artop"
31#define DRV_VERSION "0.4.2" 31#define DRV_VERSION "0.4.3"
32 32
33/* 33/*
34 * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we 34 * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we
@@ -97,9 +97,9 @@ static int artop6260_pre_reset(struct ata_port *ap, unsigned long deadline)
97 * artop6260_cable_detect - identify cable type 97 * artop6260_cable_detect - identify cable type
98 * @ap: Port 98 * @ap: Port
99 * 99 *
100 * Identify the cable type for the ARTOp interface in question 100 * Identify the cable type for the ARTOP interface in question
101 */ 101 */
102 102
103static int artop6260_cable_detect(struct ata_port *ap) 103static int artop6260_cable_detect(struct ata_port *ap)
104{ 104{
105 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 105 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
diff --git a/drivers/ata/pata_cmd640.c b/drivers/ata/pata_cmd640.c
index ed00fa9d53be..31cbf8daa299 100644
--- a/drivers/ata/pata_cmd640.c
+++ b/drivers/ata/pata_cmd640.c
@@ -107,7 +107,7 @@ static void cmd640_set_piomode(struct ata_port *ap, struct ata_device *adev)
107 pci_write_config_byte(pdev, arttim + 1, (t.active << 4) | t.recover); 107 pci_write_config_byte(pdev, arttim + 1, (t.active << 4) | t.recover);
108 } else { 108 } else {
109 /* Save the shared timings for channel, they will be loaded 109 /* Save the shared timings for channel, they will be loaded
110 by qc_issue_prot. Reloading the setup time is expensive 110 by qc_issue_prot. Reloading the setup time is expensive
111 so we keep a merged one loaded */ 111 so we keep a merged one loaded */
112 pci_read_config_byte(pdev, ARTIM23, &reg); 112 pci_read_config_byte(pdev, ARTIM23, &reg);
113 reg &= 0x3F; 113 reg &= 0x3F;
@@ -231,7 +231,7 @@ static void cmd640_hardware_init(struct pci_dev *pdev)
231 pci_write_config_byte(pdev, CMDTIM, 0); 231 pci_write_config_byte(pdev, CMDTIM, 0);
232 /* 512 byte bursts (sector) */ 232 /* 512 byte bursts (sector) */
233 pci_write_config_byte(pdev, BRST, 0x40); 233 pci_write_config_byte(pdev, BRST, 0x40);
234 /* 234 /*
235 * A reporter a long time ago 235 * A reporter a long time ago
236 * Had problems with the data fifo 236 * Had problems with the data fifo
237 * So don't run the risk 237 * So don't run the risk
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c
index 2a79b335cfcc..320a5b10aa98 100644
--- a/drivers/ata/pata_cmd64x.c
+++ b/drivers/ata/pata_cmd64x.c
@@ -31,7 +31,7 @@
31#include <linux/libata.h> 31#include <linux/libata.h>
32 32
33#define DRV_NAME "pata_cmd64x" 33#define DRV_NAME "pata_cmd64x"
34#define DRV_VERSION "0.2.2" 34#define DRV_VERSION "0.2.3"
35 35
36/* 36/*
37 * CMD64x specific registers definition. 37 * CMD64x specific registers definition.
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index 83bcc5b32597..1aabe15ad9d3 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -41,7 +41,7 @@
41#include <linux/libata.h> 41#include <linux/libata.h>
42 42
43#define DRV_NAME "pata_cs5520" 43#define DRV_NAME "pata_cs5520"
44#define DRV_VERSION "0.6.4" 44#define DRV_VERSION "0.6.5"
45 45
46struct pio_clocks 46struct pio_clocks
47{ 47{
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c
index 1b67923d7a4e..848f0309bf03 100644
--- a/drivers/ata/pata_cs5530.c
+++ b/drivers/ata/pata_cs5530.c
@@ -35,7 +35,7 @@
35#include <linux/dmi.h> 35#include <linux/dmi.h>
36 36
37#define DRV_NAME "pata_cs5530" 37#define DRV_NAME "pata_cs5530"
38#define DRV_VERSION "0.7.2" 38#define DRV_VERSION "0.7.3"
39 39
40static void __iomem *cs5530_port_base(struct ata_port *ap) 40static void __iomem *cs5530_port_base(struct ata_port *ap)
41{ 41{
diff --git a/drivers/ata/pata_cs5535.c b/drivers/ata/pata_cs5535.c
index f37d4cd812a1..aa3256fb9f7a 100644
--- a/drivers/ata/pata_cs5535.c
+++ b/drivers/ata/pata_cs5535.c
@@ -39,7 +39,7 @@
39#include <asm/msr.h> 39#include <asm/msr.h>
40 40
41#define DRV_NAME "cs5535" 41#define DRV_NAME "cs5535"
42#define DRV_VERSION "0.2.11" 42#define DRV_VERSION "0.2.12"
43 43
44/* 44/*
45 * The Geode (Aka Athlon GX now) uses an internal MSR based 45 * The Geode (Aka Athlon GX now) uses an internal MSR based
diff --git a/drivers/ata/pata_cypress.c b/drivers/ata/pata_cypress.c
index 27b9f29c01e3..d41a7691dd8e 100644
--- a/drivers/ata/pata_cypress.c
+++ b/drivers/ata/pata_cypress.c
@@ -18,7 +18,7 @@
18#include <linux/libata.h> 18#include <linux/libata.h>
19 19
20#define DRV_NAME "pata_cypress" 20#define DRV_NAME "pata_cypress"
21#define DRV_VERSION "0.1.4" 21#define DRV_VERSION "0.1.5"
22 22
23/* here are the offset definitions for the registers */ 23/* here are the offset definitions for the registers */
24 24
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
index c6c8a8bb06d0..0c9cb6090711 100644
--- a/drivers/ata/pata_hpt366.c
+++ b/drivers/ata/pata_hpt366.c
@@ -220,32 +220,6 @@ static int hpt36x_cable_detect(struct ata_port *ap)
220 return ATA_CBL_PATA80; 220 return ATA_CBL_PATA80;
221} 221}
222 222
223static int hpt36x_pre_reset(struct ata_port *ap, unsigned long deadline)
224{
225 static const struct pci_bits hpt36x_enable_bits[] = {
226 { 0x50, 1, 0x04, 0x04 },
227 { 0x54, 1, 0x04, 0x04 }
228 };
229 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
230
231 if (!pci_test_config_bits(pdev, &hpt36x_enable_bits[ap->port_no]))
232 return -ENOENT;
233
234 return ata_std_prereset(ap, deadline);
235}
236
237/**
238 * hpt36x_error_handler - reset the hpt36x bus
239 * @ap: ATA port to reset
240 *
241 * Perform the reset handling for the 366/368
242 */
243
244static void hpt36x_error_handler(struct ata_port *ap)
245{
246 ata_bmdma_drive_eh(ap, hpt36x_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
247}
248
249/** 223/**
250 * hpt366_set_piomode - PIO setup 224 * hpt366_set_piomode - PIO setup
251 * @ap: ATA interface 225 * @ap: ATA interface
@@ -351,7 +325,7 @@ static struct ata_port_operations hpt366_port_ops = {
351 325
352 .freeze = ata_bmdma_freeze, 326 .freeze = ata_bmdma_freeze,
353 .thaw = ata_bmdma_thaw, 327 .thaw = ata_bmdma_thaw,
354 .error_handler = hpt36x_error_handler, 328 .error_handler = ata_bmdma_error_handler,
355 .post_internal_cmd = ata_bmdma_post_internal_cmd, 329 .post_internal_cmd = ata_bmdma_post_internal_cmd,
356 .cable_detect = hpt36x_cable_detect, 330 .cable_detect = hpt36x_cable_detect,
357 331
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index 5a0a410654e2..6446735a46e0 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -26,7 +26,7 @@
26#include <linux/libata.h> 26#include <linux/libata.h>
27 27
28#define DRV_NAME "pata_hpt37x" 28#define DRV_NAME "pata_hpt37x"
29#define DRV_VERSION "0.6.5" 29#define DRV_VERSION "0.6.6"
30 30
31struct hpt_clock { 31struct hpt_clock {
32 u8 xfer_speed; 32 u8 xfer_speed;
@@ -931,15 +931,6 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
931 .udma_mask = 0x7f, 931 .udma_mask = 0x7f,
932 .port_ops = &hpt372_port_ops 932 .port_ops = &hpt372_port_ops
933 }; 933 };
934 /* HPT371, 372 and friends - UDMA100 at 50MHz clock */
935 static const struct ata_port_info info_hpt372_50 = {
936 .sht = &hpt37x_sht,
937 .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
938 .pio_mask = 0x1f,
939 .mwdma_mask = 0x07,
940 .udma_mask = 0x3f,
941 .port_ops = &hpt372_port_ops
942 };
943 /* HPT374 - UDMA133 */ 934 /* HPT374 - UDMA133 */
944 static const struct ata_port_info info_hpt374 = { 935 static const struct ata_port_info info_hpt374 = {
945 .sht = &hpt37x_sht, 936 .sht = &hpt37x_sht,
@@ -961,7 +952,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
961 u8 mcr1; 952 u8 mcr1;
962 u32 freq; 953 u32 freq;
963 int prefer_dpll = 1; 954 int prefer_dpll = 1;
964 955
965 unsigned long iobase = pci_resource_start(dev, 4); 956 unsigned long iobase = pci_resource_start(dev, 4);
966 957
967 const struct hpt_chip *chip_table; 958 const struct hpt_chip *chip_table;
@@ -1055,7 +1046,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1055 */ 1046 */
1056 1047
1057 pci_write_config_byte(dev, 0x5b, 0x23); 1048 pci_write_config_byte(dev, 0x5b, 0x23);
1058 1049
1059 /* 1050 /*
1060 * HighPoint does this for HPT372A. 1051 * HighPoint does this for HPT372A.
1061 * NOTE: This register is only writeable via I/O space. 1052 * NOTE: This register is only writeable via I/O space.
@@ -1088,7 +1079,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1088 * Turn the frequency check into a band and then find a timing 1079 * Turn the frequency check into a band and then find a timing
1089 * table to match it. 1080 * table to match it.
1090 */ 1081 */
1091 1082
1092 clock_slot = hpt37x_clock_slot(freq, chip_table->base); 1083 clock_slot = hpt37x_clock_slot(freq, chip_table->base);
1093 if (chip_table->clocks[clock_slot] == NULL || prefer_dpll) { 1084 if (chip_table->clocks[clock_slot] == NULL || prefer_dpll) {
1094 /* 1085 /*
@@ -1098,17 +1089,21 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1098 * use a 50MHz DPLL by choice 1089 * use a 50MHz DPLL by choice
1099 */ 1090 */
1100 unsigned int f_low, f_high; 1091 unsigned int f_low, f_high;
1101 int adjust; 1092 int dpll, adjust;
1102 1093
1103 clock_slot = 2; 1094 /* Compute DPLL */
1095 dpll = 2;
1104 if (port->udma_mask & 0xE0) 1096 if (port->udma_mask & 0xE0)
1105 clock_slot = 3; 1097 dpll = 3;
1106 1098
1107 f_low = (MHz[clock_slot] * chip_table->base) / 192; 1099 f_low = (MHz[clock_slot] * 48) / MHz[dpll];
1108 f_high = f_low + 2; 1100 f_high = f_low + 2;
1101 if (clock_slot > 1)
1102 f_high += 2;
1109 1103
1110 /* Select the DPLL clock. */ 1104 /* Select the DPLL clock. */
1111 pci_write_config_byte(dev, 0x5b, 0x21); 1105 pci_write_config_byte(dev, 0x5b, 0x21);
1106 pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
1112 1107
1113 for(adjust = 0; adjust < 8; adjust++) { 1108 for(adjust = 0; adjust < 8; adjust++) {
1114 if (hpt37x_calibrate_dpll(dev)) 1109 if (hpt37x_calibrate_dpll(dev))
@@ -1124,12 +1119,12 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1124 printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n"); 1119 printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n");
1125 return -ENODEV; 1120 return -ENODEV;
1126 } 1121 }
1127 if (clock_slot == 3) 1122 if (dpll == 3)
1128 private_data = (void *)hpt37x_timings_66; 1123 private_data = (void *)hpt37x_timings_66;
1129 else 1124 else
1130 private_data = (void *)hpt37x_timings_50; 1125 private_data = (void *)hpt37x_timings_50;
1131 1126
1132 printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[clock_slot]); 1127 printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[dpll]);
1133 } else { 1128 } else {
1134 private_data = (void *)chip_table->clocks[clock_slot]; 1129 private_data = (void *)chip_table->clocks[clock_slot];
1135 /* 1130 /*
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
index f25154aed75d..e947433cb37d 100644
--- a/drivers/ata/pata_hpt3x2n.c
+++ b/drivers/ata/pata_hpt3x2n.c
@@ -521,8 +521,8 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
521 /* 371N if rev > 1 */ 521 /* 371N if rev > 1 */
522 break; 522 break;
523 case PCI_DEVICE_ID_TTI_HPT372: 523 case PCI_DEVICE_ID_TTI_HPT372:
524 /* 372N if rev >= 1*/ 524 /* 372N if rev >= 2*/
525 if (class_rev == 0) 525 if (class_rev < 2)
526 return -ENODEV; 526 return -ENODEV;
527 break; 527 break;
528 case PCI_DEVICE_ID_TTI_HPT302: 528 case PCI_DEVICE_ID_TTI_HPT302:
diff --git a/drivers/ata/pata_hpt3x3.c b/drivers/ata/pata_hpt3x3.c
index bbabe7902fbb..8ce5e23a5f75 100644
--- a/drivers/ata/pata_hpt3x3.c
+++ b/drivers/ata/pata_hpt3x3.c
@@ -23,7 +23,7 @@
23#include <linux/libata.h> 23#include <linux/libata.h>
24 24
25#define DRV_NAME "pata_hpt3x3" 25#define DRV_NAME "pata_hpt3x3"
26#define DRV_VERSION "0.4.2" 26#define DRV_VERSION "0.4.3"
27 27
28/** 28/**
29 * hpt3x3_set_piomode - PIO setup 29 * hpt3x3_set_piomode - PIO setup
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c
index d042efdfbac4..1f647b648204 100644
--- a/drivers/ata/pata_isapnp.c
+++ b/drivers/ata/pata_isapnp.c
@@ -17,7 +17,7 @@
17#include <linux/libata.h> 17#include <linux/libata.h>
18 18
19#define DRV_NAME "pata_isapnp" 19#define DRV_NAME "pata_isapnp"
20#define DRV_VERSION "0.2.0" 20#define DRV_VERSION "0.2.1"
21 21
22static struct scsi_host_template isapnp_sht = { 22static struct scsi_host_template isapnp_sht = {
23 .module = THIS_MODULE, 23 .module = THIS_MODULE,
diff --git a/drivers/ata/pata_it8213.c b/drivers/ata/pata_it8213.c
index a769952646e1..95b0bb61788b 100644
--- a/drivers/ata/pata_it8213.c
+++ b/drivers/ata/pata_it8213.c
@@ -19,7 +19,7 @@
19#include <linux/ata.h> 19#include <linux/ata.h>
20 20
21#define DRV_NAME "pata_it8213" 21#define DRV_NAME "pata_it8213"
22#define DRV_VERSION "0.0.2" 22#define DRV_VERSION "0.0.3"
23 23
24/** 24/**
25 * it8213_pre_reset - check for 40/80 pin 25 * it8213_pre_reset - check for 40/80 pin
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index ff9a6fd36657..b3456d7a592c 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * ata-it821x.c - IT821x PATA for new ATA layer 2 * pata_it821x.c - IT821x PATA for new ATA layer
3 * (C) 2005 Red Hat Inc 3 * (C) 2005 Red Hat Inc
4 * Alan Cox <alan@redhat.com> 4 * Alan Cox <alan@redhat.com>
5 * 5 *
@@ -65,7 +65,6 @@
65 * 65 *
66 * TODO 66 * TODO
67 * - ATAPI and other speed filtering 67 * - ATAPI and other speed filtering
68 * - Command filter in smart mode
69 * - RAID configuration ioctls 68 * - RAID configuration ioctls
70 */ 69 */
71 70
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index b994351fbcd0..8d2bc1e9e871 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -23,7 +23,7 @@
23#include <scsi/scsi_host.h> 23#include <scsi/scsi_host.h>
24 24
25#define DRV_NAME "pata_ixp4xx_cf" 25#define DRV_NAME "pata_ixp4xx_cf"
26#define DRV_VERSION "0.1.2" 26#define DRV_VERSION "0.1.3"
27 27
28static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device **error) 28static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device **error)
29{ 29{
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c
index 8d799e87f752..2af7ff8256ca 100644
--- a/drivers/ata/pata_jmicron.c
+++ b/drivers/ata/pata_jmicron.c
@@ -19,7 +19,7 @@
19#include <linux/ata.h> 19#include <linux/ata.h>
20 20
21#define DRV_NAME "pata_jmicron" 21#define DRV_NAME "pata_jmicron"
22#define DRV_VERSION "0.1.4" 22#define DRV_VERSION "0.1.5"
23 23
24typedef enum { 24typedef enum {
25 PORT_PATA0 = 0, 25 PORT_PATA0 = 0,
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 707099291e01..edffc25d2d3f 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -64,7 +64,7 @@
64#include <linux/platform_device.h> 64#include <linux/platform_device.h>
65 65
66#define DRV_NAME "pata_legacy" 66#define DRV_NAME "pata_legacy"
67#define DRV_VERSION "0.5.4" 67#define DRV_VERSION "0.5.5"
68 68
69#define NR_HOST 6 69#define NR_HOST 6
70 70
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index 1f6384895a4f..cbb7866940d6 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -22,7 +22,7 @@
22#include <linux/pata_platform.h> 22#include <linux/pata_platform.h>
23 23
24#define DRV_NAME "pata_platform" 24#define DRV_NAME "pata_platform"
25#define DRV_VERSION "0.1.2" 25#define DRV_VERSION "1.0"
26 26
27static int pio_mask = 1; 27static int pio_mask = 1;
28 28
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c
index fb8c9e14b8d4..1998c19e8743 100644
--- a/drivers/ata/pata_qdi.c
+++ b/drivers/ata/pata_qdi.c
@@ -26,7 +26,7 @@
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27 27
28#define DRV_NAME "pata_qdi" 28#define DRV_NAME "pata_qdi"
29#define DRV_VERSION "0.3.0" 29#define DRV_VERSION "0.3.1"
30 30
31#define NR_HOST 4 /* Two 6580s */ 31#define NR_HOST 4 /* Two 6580s */
32 32
diff --git a/drivers/ata/pata_rz1000.c b/drivers/ata/pata_rz1000.c
index 2bfd7ef42af5..a3488b41ad26 100644
--- a/drivers/ata/pata_rz1000.c
+++ b/drivers/ata/pata_rz1000.c
@@ -21,7 +21,7 @@
21#include <linux/libata.h> 21#include <linux/libata.h>
22 22
23#define DRV_NAME "pata_rz1000" 23#define DRV_NAME "pata_rz1000"
24#define DRV_VERSION "0.2.3" 24#define DRV_VERSION "0.2.4"
25 25
26 26
27/** 27/**
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c
index 225013ecf4b6..1233063ab9a8 100644
--- a/drivers/ata/pata_sc1200.c
+++ b/drivers/ata/pata_sc1200.c
@@ -40,7 +40,7 @@
40#include <linux/libata.h> 40#include <linux/libata.h>
41 41
42#define DRV_NAME "sc1200" 42#define DRV_NAME "sc1200"
43#define DRV_VERSION "0.2.4" 43#define DRV_VERSION "0.2.5"
44 44
45#define SC1200_REV_A 0x00 45#define SC1200_REV_A 0x00
46#define SC1200_REV_B1 0x01 46#define SC1200_REV_B1 0x01
diff --git a/drivers/ata/pata_scc.c b/drivers/ata/pata_scc.c
index 844e53b280c7..61502bc7bf1d 100644
--- a/drivers/ata/pata_scc.c
+++ b/drivers/ata/pata_scc.c
@@ -43,7 +43,7 @@
43#include <linux/libata.h> 43#include <linux/libata.h>
44 44
45#define DRV_NAME "pata_scc" 45#define DRV_NAME "pata_scc"
46#define DRV_VERSION "0.1" 46#define DRV_VERSION "0.2"
47 47
48#define PCI_DEVICE_ID_TOSHIBA_SCC_ATA 0x01b4 48#define PCI_DEVICE_ID_TOSHIBA_SCC_ATA 0x01b4
49 49
@@ -489,23 +489,26 @@ static unsigned int scc_devchk (struct ata_port *ap,
489 * Note: Original code is ata_bus_post_reset(). 489 * Note: Original code is ata_bus_post_reset().
490 */ 490 */
491 491
492static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask) 492static int scc_bus_post_reset(struct ata_port *ap, unsigned int devmask,
493 unsigned long deadline)
493{ 494{
494 struct ata_ioports *ioaddr = &ap->ioaddr; 495 struct ata_ioports *ioaddr = &ap->ioaddr;
495 unsigned int dev0 = devmask & (1 << 0); 496 unsigned int dev0 = devmask & (1 << 0);
496 unsigned int dev1 = devmask & (1 << 1); 497 unsigned int dev1 = devmask & (1 << 1);
497 unsigned long timeout; 498 int rc;
498 499
499 /* if device 0 was found in ata_devchk, wait for its 500 /* if device 0 was found in ata_devchk, wait for its
500 * BSY bit to clear 501 * BSY bit to clear
501 */ 502 */
502 if (dev0) 503 if (dev0) {
503 ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); 504 rc = ata_wait_ready(ap, deadline);
505 if (rc && rc != -ENODEV)
506 return rc;
507 }
504 508
505 /* if device 1 was found in ata_devchk, wait for 509 /* if device 1 was found in ata_devchk, wait for
506 * register access, then wait for BSY to clear 510 * register access, then wait for BSY to clear
507 */ 511 */
508 timeout = jiffies + ATA_TMOUT_BOOT;
509 while (dev1) { 512 while (dev1) {
510 u8 nsect, lbal; 513 u8 nsect, lbal;
511 514
@@ -514,14 +517,15 @@ static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask)
514 lbal = in_be32(ioaddr->lbal_addr); 517 lbal = in_be32(ioaddr->lbal_addr);
515 if ((nsect == 1) && (lbal == 1)) 518 if ((nsect == 1) && (lbal == 1))
516 break; 519 break;
517 if (time_after(jiffies, timeout)) { 520 if (time_after(jiffies, deadline))
518 dev1 = 0; 521 return -EBUSY;
519 break;
520 }
521 msleep(50); /* give drive a breather */ 522 msleep(50); /* give drive a breather */
522 } 523 }
523 if (dev1) 524 if (dev1) {
524 ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); 525 rc = ata_wait_ready(ap, deadline);
526 if (rc && rc != -ENODEV)
527 return rc;
528 }
525 529
526 /* is all this really necessary? */ 530 /* is all this really necessary? */
527 ap->ops->dev_select(ap, 0); 531 ap->ops->dev_select(ap, 0);
@@ -529,6 +533,8 @@ static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask)
529 ap->ops->dev_select(ap, 1); 533 ap->ops->dev_select(ap, 1);
530 if (dev0) 534 if (dev0)
531 ap->ops->dev_select(ap, 0); 535 ap->ops->dev_select(ap, 0);
536
537 return 0;
532} 538}
533 539
534/** 540/**
@@ -537,8 +543,8 @@ static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask)
537 * Note: Original code is ata_bus_softreset(). 543 * Note: Original code is ata_bus_softreset().
538 */ 544 */
539 545
540static unsigned int scc_bus_softreset (struct ata_port *ap, 546static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
541 unsigned int devmask) 547 unsigned long deadline)
542{ 548{
543 struct ata_ioports *ioaddr = &ap->ioaddr; 549 struct ata_ioports *ioaddr = &ap->ioaddr;
544 550
@@ -570,7 +576,7 @@ static unsigned int scc_bus_softreset (struct ata_port *ap,
570 if (scc_check_status(ap) == 0xFF) 576 if (scc_check_status(ap) == 0xFF)
571 return 0; 577 return 0;
572 578
573 scc_bus_post_reset(ap, devmask); 579 scc_bus_post_reset(ap, devmask, deadline);
574 580
575 return 0; 581 return 0;
576} 582}
@@ -579,11 +585,13 @@ static unsigned int scc_bus_softreset (struct ata_port *ap,
579 * scc_std_softreset - reset host port via ATA SRST 585 * scc_std_softreset - reset host port via ATA SRST
580 * @ap: port to reset 586 * @ap: port to reset
581 * @classes: resulting classes of attached devices 587 * @classes: resulting classes of attached devices
588 * @deadline: deadline jiffies for the operation
582 * 589 *
583 * Note: Original code is ata_std_softreset(). 590 * Note: Original code is ata_std_softreset().
584 */ 591 */
585 592
586static int scc_std_softreset (struct ata_port *ap, unsigned int *classes) 593static int scc_std_softreset (struct ata_port *ap, unsigned int *classes,
594 unsigned long deadline)
587{ 595{
588 unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; 596 unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS;
589 unsigned int devmask = 0, err_mask; 597 unsigned int devmask = 0, err_mask;
@@ -607,7 +615,7 @@ static int scc_std_softreset (struct ata_port *ap, unsigned int *classes)
607 615
608 /* issue bus reset */ 616 /* issue bus reset */
609 DPRINTK("about to softreset, devmask=%x\n", devmask); 617 DPRINTK("about to softreset, devmask=%x\n", devmask);
610 err_mask = scc_bus_softreset(ap, devmask); 618 err_mask = scc_bus_softreset(ap, devmask, deadline);
611 if (err_mask) { 619 if (err_mask) {
612 ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n", 620 ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n",
613 err_mask); 621 err_mask);
@@ -676,10 +684,11 @@ static void scc_bmdma_stop (struct ata_queued_cmd *qc)
676 684
677 if (reg & INTSTS_BMSINT) { 685 if (reg & INTSTS_BMSINT) {
678 unsigned int classes; 686 unsigned int classes;
687 unsigned long deadline = jiffies + ATA_TMOUT_BOOT;
679 printk(KERN_WARNING "%s: Internal Bus Error\n", DRV_NAME); 688 printk(KERN_WARNING "%s: Internal Bus Error\n", DRV_NAME);
680 out_be32(bmid_base + SCC_DMA_INTST, INTSTS_BMSINT); 689 out_be32(bmid_base + SCC_DMA_INTST, INTSTS_BMSINT);
681 /* TBD: SW reset */ 690 /* TBD: SW reset */
682 scc_std_softreset(ap, &classes); 691 scc_std_softreset(ap, &classes, deadline);
683 continue; 692 continue;
684 } 693 }
685 694
@@ -862,9 +871,10 @@ static void scc_bmdma_freeze (struct ata_port *ap)
862/** 871/**
863 * scc_pata_prereset - prepare for reset 872 * scc_pata_prereset - prepare for reset
864 * @ap: ATA port to be reset 873 * @ap: ATA port to be reset
874 * @deadline: deadline jiffies for the operation
865 */ 875 */
866 876
867static int scc_pata_prereset (struct ata_port *ap, unsigned long deadline) 877static int scc_pata_prereset(struct ata_port *ap, unsigned long deadline)
868{ 878{
869 ap->cbl = ATA_CBL_PATA80; 879 ap->cbl = ATA_CBL_PATA80;
870 return ata_std_prereset(ap, deadline); 880 return ata_std_prereset(ap, deadline);
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index dee6e211949d..1e8f421963c7 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -41,7 +41,7 @@
41#include <linux/libata.h> 41#include <linux/libata.h>
42 42
43#define DRV_NAME "pata_serverworks" 43#define DRV_NAME "pata_serverworks"
44#define DRV_VERSION "0.4.0" 44#define DRV_VERSION "0.4.1"
45 45
46#define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */ 46#define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */
47#define SVWKS_CSB6_REVISION 0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */ 47#define SVWKS_CSB6_REVISION 0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index f2231267e011..ec3ae9375015 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -73,14 +73,14 @@ static int sis_short_ata40(struct pci_dev *dev)
73} 73}
74 74
75/** 75/**
76 * sis_port_base - return PCI configuration base for dev 76 * sis_old_port_base - return PCI configuration base for dev
77 * @adev: device 77 * @adev: device
78 * 78 *
79 * Returns the base of the PCI configuration registers for this port 79 * Returns the base of the PCI configuration registers for this port
80 * number. 80 * number.
81 */ 81 */
82 82
83static int sis_port_base(struct ata_device *adev) 83static int sis_old_port_base(struct ata_device *adev)
84{ 84{
85 return 0x40 + (4 * adev->ap->port_no) + (2 * adev->devno); 85 return 0x40 + (4 * adev->ap->port_no) + (2 * adev->devno);
86} 86}
@@ -211,7 +211,7 @@ static void sis_set_fifo(struct ata_port *ap, struct ata_device *adev)
211static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev) 211static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev)
212{ 212{
213 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 213 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
214 int port = sis_port_base(adev); 214 int port = sis_old_port_base(adev);
215 u8 t1, t2; 215 u8 t1, t2;
216 int speed = adev->pio_mode - XFER_PIO_0; 216 int speed = adev->pio_mode - XFER_PIO_0;
217 217
@@ -248,7 +248,7 @@ static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev)
248static void sis_100_set_piomode (struct ata_port *ap, struct ata_device *adev) 248static void sis_100_set_piomode (struct ata_port *ap, struct ata_device *adev)
249{ 249{
250 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 250 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
251 int port = sis_port_base(adev); 251 int port = sis_old_port_base(adev);
252 int speed = adev->pio_mode - XFER_PIO_0; 252 int speed = adev->pio_mode - XFER_PIO_0;
253 253
254 const u8 actrec[] = { 0x00, 0x67, 0x44, 0x33, 0x31 }; 254 const u8 actrec[] = { 0x00, 0x67, 0x44, 0x33, 0x31 };
@@ -328,7 +328,7 @@ static void sis_old_set_dmamode (struct ata_port *ap, struct ata_device *adev)
328{ 328{
329 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 329 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
330 int speed = adev->dma_mode - XFER_MW_DMA_0; 330 int speed = adev->dma_mode - XFER_MW_DMA_0;
331 int drive_pci = sis_port_base(adev); 331 int drive_pci = sis_old_port_base(adev);
332 u16 timing; 332 u16 timing;
333 333
334 const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 }; 334 const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 };
@@ -367,7 +367,7 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev)
367{ 367{
368 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 368 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
369 int speed = adev->dma_mode - XFER_MW_DMA_0; 369 int speed = adev->dma_mode - XFER_MW_DMA_0;
370 int drive_pci = sis_port_base(adev); 370 int drive_pci = sis_old_port_base(adev);
371 u16 timing; 371 u16 timing;
372 372
373 const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 }; 373 const u16 mwdma_bits[] = { 0x707, 0x202, 0x202 };
@@ -378,12 +378,12 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev)
378 if (adev->dma_mode < XFER_UDMA_0) { 378 if (adev->dma_mode < XFER_UDMA_0) {
379 /* bits 3-0 hold recovery timing bits 8-10 active timing and 379 /* bits 3-0 hold recovery timing bits 8-10 active timing and
380 the higer bits are dependant on the device, bit 15 udma */ 380 the higer bits are dependant on the device, bit 15 udma */
381 timing &= ~ 0x870F; 381 timing &= ~0x870F;
382 timing |= mwdma_bits[speed]; 382 timing |= mwdma_bits[speed];
383 } else { 383 } else {
384 /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */ 384 /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */
385 speed = adev->dma_mode - XFER_UDMA_0; 385 speed = adev->dma_mode - XFER_UDMA_0;
386 timing &= ~0x6000; 386 timing &= ~0xF000;
387 timing |= udma_bits[speed]; 387 timing |= udma_bits[speed];
388 } 388 }
389 pci_write_config_word(pdev, drive_pci, timing); 389 pci_write_config_word(pdev, drive_pci, timing);
@@ -405,22 +405,22 @@ static void sis_100_set_dmamode (struct ata_port *ap, struct ata_device *adev)
405{ 405{
406 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 406 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
407 int speed = adev->dma_mode - XFER_MW_DMA_0; 407 int speed = adev->dma_mode - XFER_MW_DMA_0;
408 int drive_pci = sis_port_base(adev); 408 int drive_pci = sis_old_port_base(adev);
409 u16 timing; 409 u8 timing;
410 410
411 const u16 udma_bits[] = { 0x8B00, 0x8700, 0x8500, 0x8300, 0x8200, 0x8100}; 411 const u8 udma_bits[] = { 0x8B, 0x87, 0x85, 0x83, 0x82, 0x81};
412 412
413 pci_read_config_word(pdev, drive_pci, &timing); 413 pci_read_config_byte(pdev, drive_pci + 1, &timing);
414 414
415 if (adev->dma_mode < XFER_UDMA_0) { 415 if (adev->dma_mode < XFER_UDMA_0) {
416 /* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */ 416 /* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */
417 } else { 417 } else {
418 /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */ 418 /* Bit 7 is UDMA on/off, bit 0-3 are cycle time */
419 speed = adev->dma_mode - XFER_UDMA_0; 419 speed = adev->dma_mode - XFER_UDMA_0;
420 timing &= ~0x0F00; 420 timing &= ~0x8F;
421 timing |= udma_bits[speed]; 421 timing |= udma_bits[speed];
422 } 422 }
423 pci_write_config_word(pdev, drive_pci, timing); 423 pci_write_config_byte(pdev, drive_pci + 1, timing);
424} 424}
425 425
426/** 426/**
@@ -440,22 +440,22 @@ static void sis_133_early_set_dmamode (struct ata_port *ap, struct ata_device *a
440{ 440{
441 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 441 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
442 int speed = adev->dma_mode - XFER_MW_DMA_0; 442 int speed = adev->dma_mode - XFER_MW_DMA_0;
443 int drive_pci = sis_port_base(adev); 443 int drive_pci = sis_old_port_base(adev);
444 u16 timing; 444 u8 timing;
445 445 /* Low 4 bits are timing */
446 static const u16 udma_bits[] = { 0x8F00, 0x8A00, 0x8700, 0x8500, 0x8300, 0x8200, 0x8100}; 446 static const u8 udma_bits[] = { 0x8F, 0x8A, 0x87, 0x85, 0x83, 0x82, 0x81};
447 447
448 pci_read_config_word(pdev, drive_pci, &timing); 448 pci_read_config_byte(pdev, drive_pci + 1, &timing);
449 449
450 if (adev->dma_mode < XFER_UDMA_0) { 450 if (adev->dma_mode < XFER_UDMA_0) {
451 /* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */ 451 /* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */
452 } else { 452 } else {
453 /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */ 453 /* Bit 7 is UDMA on/off, bit 0-3 are cycle time */
454 speed = adev->dma_mode - XFER_UDMA_0; 454 speed = adev->dma_mode - XFER_UDMA_0;
455 timing &= ~0x0F00; 455 timing &= ~0x8F;
456 timing |= udma_bits[speed]; 456 timing |= udma_bits[speed];
457 } 457 }
458 pci_write_config_word(pdev, drive_pci, timing); 458 pci_write_config_byte(pdev, drive_pci + 1, timing);
459} 459}
460 460
461/** 461/**
diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c
index f48491ad5f3a..e5aaec43694d 100644
--- a/drivers/ata/pata_sl82c105.c
+++ b/drivers/ata/pata_sl82c105.c
@@ -26,7 +26,7 @@
26#include <linux/libata.h> 26#include <linux/libata.h>
27 27
28#define DRV_NAME "pata_sl82c105" 28#define DRV_NAME "pata_sl82c105"
29#define DRV_VERSION "0.3.0" 29#define DRV_VERSION "0.3.1"
30 30
31enum { 31enum {
32 /* 32 /*
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index e4c71f76bd55..a8462f1e890b 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -60,6 +60,7 @@
60#include <linux/delay.h> 60#include <linux/delay.h>
61#include <scsi/scsi_host.h> 61#include <scsi/scsi_host.h>
62#include <linux/libata.h> 62#include <linux/libata.h>
63#include <linux/dmi.h>
63 64
64#define DRV_NAME "pata_via" 65#define DRV_NAME "pata_via"
65#define DRV_VERSION "0.3.1" 66#define DRV_VERSION "0.3.1"
@@ -122,6 +123,31 @@ static const struct via_isa_bridge {
122 { NULL } 123 { NULL }
123}; 124};
124 125
126
127/*
128 * Cable special cases
129 */
130
131static struct dmi_system_id cable_dmi_table[] = {
132 {
133 .ident = "Acer Ferrari 3400",
134 .matches = {
135 DMI_MATCH(DMI_BOARD_VENDOR, "Acer,Inc."),
136 DMI_MATCH(DMI_BOARD_NAME, "Ferrari 3400"),
137 },
138 },
139 { }
140};
141
142static int via_cable_override(struct pci_dev *pdev)
143{
144 /* Systems by DMI */
145 if (dmi_check_system(cable_dmi_table))
146 return 1;
147 return 0;
148}
149
150
125/** 151/**
126 * via_cable_detect - cable detection 152 * via_cable_detect - cable detection
127 * @ap: ATA port 153 * @ap: ATA port
@@ -139,6 +165,9 @@ static int via_cable_detect(struct ata_port *ap) {
139 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 165 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
140 u32 ata66; 166 u32 ata66;
141 167
168 if (via_cable_override(pdev))
169 return ATA_CBL_PATA40_SHORT;
170
142 /* Early chips are 40 wire */ 171 /* Early chips are 40 wire */
143 if ((config->flags & VIA_UDMA) < VIA_UDMA_66) 172 if ((config->flags & VIA_UDMA) < VIA_UDMA_66)
144 return ATA_CBL_PATA40; 173 return ATA_CBL_PATA40;
@@ -592,10 +621,11 @@ static int via_reinit_one(struct pci_dev *pdev)
592#endif 621#endif
593 622
594static const struct pci_device_id via[] = { 623static const struct pci_device_id via[] = {
595 { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C576_1), }, 624 { PCI_VDEVICE(VIA, 0x0571), },
596 { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C586_1), }, 625 { PCI_VDEVICE(VIA, 0x0581), },
597 { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_6410), }, 626 { PCI_VDEVICE(VIA, 0x1571), },
598 { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_SATA_EIDE), }, 627 { PCI_VDEVICE(VIA, 0x3164), },
628 { PCI_VDEVICE(VIA, 0x5324), },
599 629
600 { }, 630 { },
601}; 631};
diff --git a/drivers/ata/pata_winbond.c b/drivers/ata/pata_winbond.c
index cc4ad271afb5..83abfeca4057 100644
--- a/drivers/ata/pata_winbond.c
+++ b/drivers/ata/pata_winbond.c
@@ -16,7 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17 17
18#define DRV_NAME "pata_winbond" 18#define DRV_NAME "pata_winbond"
19#define DRV_VERSION "0.0.2" 19#define DRV_VERSION "0.0.3"
20 20
21#define NR_HOST 4 /* Two winbond controllers, two channels each */ 21#define NR_HOST 4 /* Two winbond controllers, two channels each */
22 22
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
index 52b69530ab29..f12c2b6ac08e 100644
--- a/drivers/ata/pdc_adma.c
+++ b/drivers/ata/pdc_adma.c
@@ -44,7 +44,7 @@
44#include <linux/libata.h> 44#include <linux/libata.h>
45 45
46#define DRV_NAME "pdc_adma" 46#define DRV_NAME "pdc_adma"
47#define DRV_VERSION "0.05" 47#define DRV_VERSION "0.06"
48 48
49/* macro to calculate base address for ATA regs */ 49/* macro to calculate base address for ATA regs */
50#define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40)) 50#define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40))
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index bda5e7747c21..2d80c9d95e95 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -28,7 +28,7 @@
28#include <scsi/scsi_device.h> 28#include <scsi/scsi_device.h>
29 29
30#define DRV_NAME "sata_inic162x" 30#define DRV_NAME "sata_inic162x"
31#define DRV_VERSION "0.1" 31#define DRV_VERSION "0.2"
32 32
33enum { 33enum {
34 MMIO_BAR = 5, 34 MMIO_BAR = 5,
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index cb9b9ac12b4c..c957e6e54ba1 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -21,6 +21,50 @@
21 * 21 *
22 */ 22 */
23 23
24/*
25 sata_mv TODO list:
26
27 1) Needs a full errata audit for all chipsets. I implemented most
28 of the errata workarounds found in the Marvell vendor driver, but
29 I distinctly remember a couple workarounds (one related to PCI-X)
30 are still needed.
31
32 2) Convert to LibATA new EH. Required for hotplug, NCQ, and sane
33 probing/error handling in general. MUST HAVE.
34
35 3) Add hotplug support (easy, once new-EH support appears)
36
37 4) Add NCQ support (easy to intermediate, once new-EH support appears)
38
39 5) Investigate problems with PCI Message Signalled Interrupts (MSI).
40
41 6) Add port multiplier support (intermediate)
42
43 7) Test and verify 3.0 Gbps support
44
45 8) Develop a low-power-consumption strategy, and implement it.
46
47 9) [Experiment, low priority] See if ATAPI can be supported using
48 "unknown FIS" or "vendor-specific FIS" support, or something creative
49 like that.
50
51 10) [Experiment, low priority] Investigate interrupt coalescing.
52 Quite often, especially with PCI Message Signalled Interrupts (MSI),
53 the overhead reduced by interrupt mitigation is quite often not
54 worth the latency cost.
55
56 11) [Experiment, Marvell value added] Is it possible to use target
57 mode to cross-connect two Linux boxes with Marvell cards? If so,
58 creating LibATA target mode support would be very interesting.
59
60 Target mode, for those without docs, is the ability to directly
61 connect two SATA controllers.
62
63 13) Verify that 7042 is fully supported. I only have a 6042.
64
65*/
66
67
24#include <linux/kernel.h> 68#include <linux/kernel.h>
25#include <linux/module.h> 69#include <linux/module.h>
26#include <linux/pci.h> 70#include <linux/pci.h>
@@ -35,7 +79,7 @@
35#include <linux/libata.h> 79#include <linux/libata.h>
36 80
37#define DRV_NAME "sata_mv" 81#define DRV_NAME "sata_mv"
38#define DRV_VERSION "0.8" 82#define DRV_VERSION "0.81"
39 83
40enum { 84enum {
41 /* BAR's are enumerated in terms of pci_resource_start() terms */ 85 /* BAR's are enumerated in terms of pci_resource_start() terms */
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 1a49c777fa6a..adfa693db53d 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -49,7 +49,7 @@
49#include <linux/libata.h> 49#include <linux/libata.h>
50 50
51#define DRV_NAME "sata_nv" 51#define DRV_NAME "sata_nv"
52#define DRV_VERSION "3.3" 52#define DRV_VERSION "3.4"
53 53
54#define NV_ADMA_DMA_BOUNDARY 0xffffffffUL 54#define NV_ADMA_DMA_BOUNDARY 0xffffffffUL
55 55
@@ -802,7 +802,7 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance)
802 u16 status; 802 u16 status;
803 u32 gen_ctl; 803 u32 gen_ctl;
804 u32 notifier, notifier_error; 804 u32 notifier, notifier_error;
805 805
806 /* if ADMA is disabled, use standard ata interrupt handler */ 806 /* if ADMA is disabled, use standard ata interrupt handler */
807 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) { 807 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) {
808 u8 irq_stat = readb(host->iomap[NV_MMIO_BAR] + NV_INT_STATUS_CK804) 808 u8 irq_stat = readb(host->iomap[NV_MMIO_BAR] + NV_INT_STATUS_CK804)
@@ -963,7 +963,7 @@ static void nv_adma_irq_clear(struct ata_port *ap)
963 963
964 /* clear ADMA status */ 964 /* clear ADMA status */
965 writew(0xffff, mmio + NV_ADMA_STAT); 965 writew(0xffff, mmio + NV_ADMA_STAT);
966 966
967 /* clear notifiers - note both ports need to be written with 967 /* clear notifiers - note both ports need to be written with
968 something even though we are only clearing on one */ 968 something even though we are only clearing on one */
969 if (ap->port_no == 0) { 969 if (ap->port_no == 0) {
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 3a7d9b5332af..2b924a69b365 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -297,7 +297,7 @@ static const struct ata_port_info pdc_port_info[] = {
297 297
298 /* board_2057x_pata */ 298 /* board_2057x_pata */
299 { 299 {
300 .flags = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS, 300 .flags = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS |
301 PDC_FLAG_GEN_II, 301 PDC_FLAG_GEN_II,
302 .pio_mask = 0x1f, /* pio0-4 */ 302 .pio_mask = 0x1f, /* pio0-4 */
303 .mwdma_mask = 0x07, /* mwdma0-2 */ 303 .mwdma_mask = 0x07, /* mwdma0-2 */
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c
index f5a05de0093d..6688ccb66320 100644
--- a/drivers/ata/sata_qstor.c
+++ b/drivers/ata/sata_qstor.c
@@ -39,7 +39,7 @@
39#include <linux/libata.h> 39#include <linux/libata.h>
40 40
41#define DRV_NAME "sata_qstor" 41#define DRV_NAME "sata_qstor"
42#define DRV_VERSION "0.07" 42#define DRV_VERSION "0.08"
43 43
44enum { 44enum {
45 QS_MMIO_BAR = 4, 45 QS_MMIO_BAR = 4,
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index e8483aadd11b..a3b339bcf3cf 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -305,7 +305,7 @@ static int sil_set_mode (struct ata_port *ap, struct ata_device **r_failed)
305 u32 tmp, dev_mode[2]; 305 u32 tmp, dev_mode[2];
306 unsigned int i; 306 unsigned int i;
307 int rc; 307 int rc;
308 308
309 rc = ata_do_set_mode(ap, r_failed); 309 rc = ata_do_set_mode(ap, r_failed);
310 if (rc) 310 if (rc)
311 return rc; 311 return rc;
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 0cb6618935b1..0ddfae9911cd 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -30,7 +30,7 @@
30#include <linux/libata.h> 30#include <linux/libata.h>
31 31
32#define DRV_NAME "sata_sil24" 32#define DRV_NAME "sata_sil24"
33#define DRV_VERSION "0.8" 33#define DRV_VERSION "0.9"
34 34
35/* 35/*
36 * Port request block (PRB) 32 bytes 36 * Port request block (PRB) 32 bytes
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index ee66c5fa7ac8..221099d1d08f 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -43,7 +43,7 @@
43#include "sis.h" 43#include "sis.h"
44 44
45#define DRV_NAME "sata_sis" 45#define DRV_NAME "sata_sis"
46#define DRV_VERSION "0.7" 46#define DRV_VERSION "0.8"
47 47
48enum { 48enum {
49 sis_180 = 0, 49 sis_180 = 0,
@@ -255,7 +255,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
255{ 255{
256 static int printed_version; 256 static int printed_version;
257 struct ata_port_info pi = sis_port_info; 257 struct ata_port_info pi = sis_port_info;
258 const struct ata_port_info *ppi[] = { &pi, NULL }; 258 const struct ata_port_info *ppi[] = { &pi, &pi };
259 struct ata_host *host; 259 struct ata_host *host;
260 u32 genctl, val; 260 u32 genctl, val;
261 u8 pmr; 261 u8 pmr;
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index 17246734fe76..bcb2cd8b063d 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -53,7 +53,7 @@
53#endif /* CONFIG_PPC_OF */ 53#endif /* CONFIG_PPC_OF */
54 54
55#define DRV_NAME "sata_svw" 55#define DRV_NAME "sata_svw"
56#define DRV_VERSION "2.1" 56#define DRV_VERSION "2.2"
57 57
58enum { 58enum {
59 /* ap->flags bits */ 59 /* ap->flags bits */
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index 3a4f44559d0a..2d14f3d56d92 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -44,7 +44,7 @@
44#include "sata_promise.h" 44#include "sata_promise.h"
45 45
46#define DRV_NAME "sata_sx4" 46#define DRV_NAME "sata_sx4"
47#define DRV_VERSION "0.10" 47#define DRV_VERSION "0.11"
48 48
49 49
50enum { 50enum {
diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c
index 006f5e352658..6815de7cca79 100644
--- a/drivers/ata/sata_uli.c
+++ b/drivers/ata/sata_uli.c
@@ -36,7 +36,7 @@
36#include <linux/libata.h> 36#include <linux/libata.h>
37 37
38#define DRV_NAME "sata_uli" 38#define DRV_NAME "sata_uli"
39#define DRV_VERSION "1.1" 39#define DRV_VERSION "1.2"
40 40
41enum { 41enum {
42 uli_5289 = 0, 42 uli_5289 = 0,
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index ac4f43c4993f..e8b90e7b42dd 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -46,7 +46,7 @@
46#include <linux/libata.h> 46#include <linux/libata.h>
47 47
48#define DRV_NAME "sata_via" 48#define DRV_NAME "sata_via"
49#define DRV_VERSION "2.1" 49#define DRV_VERSION "2.2"
50 50
51enum board_ids_enum { 51enum board_ids_enum {
52 vt6420, 52 vt6420,
@@ -85,6 +85,9 @@ static const struct pci_device_id svia_pci_tbl[] = {
85 { PCI_VDEVICE(VIA, 0x0591), vt6420 }, 85 { PCI_VDEVICE(VIA, 0x0591), vt6420 },
86 { PCI_VDEVICE(VIA, 0x3149), vt6420 }, 86 { PCI_VDEVICE(VIA, 0x3149), vt6420 },
87 { PCI_VDEVICE(VIA, 0x3249), vt6421 }, 87 { PCI_VDEVICE(VIA, 0x3249), vt6421 },
88 { PCI_VDEVICE(VIA, 0x5287), vt6420 },
89 { PCI_VDEVICE(VIA, 0x5372), vt6420 },
90 { PCI_VDEVICE(VIA, 0x7372), vt6420 },
88 91
89 { } /* terminate list */ 92 { } /* terminate list */
90}; 93};
diff --git a/drivers/ata/sata_vsc.c b/drivers/ata/sata_vsc.c
index 80126f835d32..81330175fc89 100644
--- a/drivers/ata/sata_vsc.c
+++ b/drivers/ata/sata_vsc.c
@@ -47,7 +47,7 @@
47#include <linux/libata.h> 47#include <linux/libata.h>
48 48
49#define DRV_NAME "sata_vsc" 49#define DRV_NAME "sata_vsc"
50#define DRV_VERSION "2.1" 50#define DRV_VERSION "2.2"
51 51
52enum { 52enum {
53 VSC_MMIO_BAR = 0, 53 VSC_MMIO_BAR = 0,
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index 057efbc55d38..3800bc0cb2ef 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -47,7 +47,8 @@ static char const rcsid[] =
47#include <linux/bitops.h> 47#include <linux/bitops.h>
48#include <linux/wait.h> 48#include <linux/wait.h>
49#include <linux/jiffies.h> 49#include <linux/jiffies.h>
50#include <asm/semaphore.h> 50#include <linux/mutex.h>
51
51#include <asm/io.h> 52#include <asm/io.h>
52#include <asm/uaccess.h> 53#include <asm/uaccess.h>
53#include <asm/atomic.h> 54#include <asm/atomic.h>
@@ -2435,7 +2436,7 @@ idt77252_open(struct atm_vcc *vcc)
2435 2436
2436 set_bit(ATM_VF_ADDR, &vcc->flags); 2437 set_bit(ATM_VF_ADDR, &vcc->flags);
2437 2438
2438 down(&card->mutex); 2439 mutex_lock(&card->mutex);
2439 2440
2440 OPRINTK("%s: opening vpi.vci: %d.%d\n", card->name, vpi, vci); 2441 OPRINTK("%s: opening vpi.vci: %d.%d\n", card->name, vpi, vci);
2441 2442
@@ -2446,7 +2447,7 @@ idt77252_open(struct atm_vcc *vcc)
2446 break; 2447 break;
2447 default: 2448 default:
2448 printk("%s: Unsupported AAL: %d\n", card->name, vcc->qos.aal); 2449 printk("%s: Unsupported AAL: %d\n", card->name, vcc->qos.aal);
2449 up(&card->mutex); 2450 mutex_unlock(&card->mutex);
2450 return -EPROTONOSUPPORT; 2451 return -EPROTONOSUPPORT;
2451 } 2452 }
2452 2453
@@ -2455,7 +2456,7 @@ idt77252_open(struct atm_vcc *vcc)
2455 card->vcs[index] = kzalloc(sizeof(struct vc_map), GFP_KERNEL); 2456 card->vcs[index] = kzalloc(sizeof(struct vc_map), GFP_KERNEL);
2456 if (!card->vcs[index]) { 2457 if (!card->vcs[index]) {
2457 printk("%s: can't alloc vc in open()\n", card->name); 2458 printk("%s: can't alloc vc in open()\n", card->name);
2458 up(&card->mutex); 2459 mutex_unlock(&card->mutex);
2459 return -ENOMEM; 2460 return -ENOMEM;
2460 } 2461 }
2461 card->vcs[index]->card = card; 2462 card->vcs[index]->card = card;
@@ -2484,14 +2485,14 @@ idt77252_open(struct atm_vcc *vcc)
2484 if (inuse) { 2485 if (inuse) {
2485 printk("%s: %s vci already in use.\n", card->name, 2486 printk("%s: %s vci already in use.\n", card->name,
2486 inuse == 1 ? "tx" : inuse == 2 ? "rx" : "tx and rx"); 2487 inuse == 1 ? "tx" : inuse == 2 ? "rx" : "tx and rx");
2487 up(&card->mutex); 2488 mutex_unlock(&card->mutex);
2488 return -EADDRINUSE; 2489 return -EADDRINUSE;
2489 } 2490 }
2490 2491
2491 if (vcc->qos.txtp.traffic_class != ATM_NONE) { 2492 if (vcc->qos.txtp.traffic_class != ATM_NONE) {
2492 error = idt77252_init_tx(card, vc, vcc, &vcc->qos); 2493 error = idt77252_init_tx(card, vc, vcc, &vcc->qos);
2493 if (error) { 2494 if (error) {
2494 up(&card->mutex); 2495 mutex_unlock(&card->mutex);
2495 return error; 2496 return error;
2496 } 2497 }
2497 } 2498 }
@@ -2499,14 +2500,14 @@ idt77252_open(struct atm_vcc *vcc)
2499 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { 2500 if (vcc->qos.rxtp.traffic_class != ATM_NONE) {
2500 error = idt77252_init_rx(card, vc, vcc, &vcc->qos); 2501 error = idt77252_init_rx(card, vc, vcc, &vcc->qos);
2501 if (error) { 2502 if (error) {
2502 up(&card->mutex); 2503 mutex_unlock(&card->mutex);
2503 return error; 2504 return error;
2504 } 2505 }
2505 } 2506 }
2506 2507
2507 set_bit(ATM_VF_READY, &vcc->flags); 2508 set_bit(ATM_VF_READY, &vcc->flags);
2508 2509
2509 up(&card->mutex); 2510 mutex_unlock(&card->mutex);
2510 return 0; 2511 return 0;
2511} 2512}
2512 2513
@@ -2520,7 +2521,7 @@ idt77252_close(struct atm_vcc *vcc)
2520 unsigned long addr; 2521 unsigned long addr;
2521 unsigned long timeout; 2522 unsigned long timeout;
2522 2523
2523 down(&card->mutex); 2524 mutex_lock(&card->mutex);
2524 2525
2525 IPRINTK("%s: idt77252_close: vc = %d (%d.%d)\n", 2526 IPRINTK("%s: idt77252_close: vc = %d (%d.%d)\n",
2526 card->name, vc->index, vcc->vpi, vcc->vci); 2527 card->name, vc->index, vcc->vpi, vcc->vci);
@@ -2591,7 +2592,7 @@ done:
2591 free_scq(card, vc->scq); 2592 free_scq(card, vc->scq);
2592 } 2593 }
2593 2594
2594 up(&card->mutex); 2595 mutex_unlock(&card->mutex);
2595} 2596}
2596 2597
2597static int 2598static int
@@ -2602,7 +2603,7 @@ idt77252_change_qos(struct atm_vcc *vcc, struct atm_qos *qos, int flags)
2602 struct vc_map *vc = vcc->dev_data; 2603 struct vc_map *vc = vcc->dev_data;
2603 int error = 0; 2604 int error = 0;
2604 2605
2605 down(&card->mutex); 2606 mutex_lock(&card->mutex);
2606 2607
2607 if (qos->txtp.traffic_class != ATM_NONE) { 2608 if (qos->txtp.traffic_class != ATM_NONE) {
2608 if (!test_bit(VCF_TX, &vc->flags)) { 2609 if (!test_bit(VCF_TX, &vc->flags)) {
@@ -2648,7 +2649,7 @@ idt77252_change_qos(struct atm_vcc *vcc, struct atm_qos *qos, int flags)
2648 set_bit(ATM_VF_HASQOS, &vcc->flags); 2649 set_bit(ATM_VF_HASQOS, &vcc->flags);
2649 2650
2650out: 2651out:
2651 up(&card->mutex); 2652 mutex_unlock(&card->mutex);
2652 return error; 2653 return error;
2653} 2654}
2654 2655
@@ -3709,7 +3710,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
3709 membase = pci_resource_start(pcidev, 1); 3710 membase = pci_resource_start(pcidev, 1);
3710 srambase = pci_resource_start(pcidev, 2); 3711 srambase = pci_resource_start(pcidev, 2);
3711 3712
3712 init_MUTEX(&card->mutex); 3713 mutex_init(&card->mutex);
3713 spin_lock_init(&card->cmd_lock); 3714 spin_lock_init(&card->cmd_lock);
3714 spin_lock_init(&card->tst_lock); 3715 spin_lock_init(&card->tst_lock);
3715 3716
diff --git a/drivers/atm/idt77252.h b/drivers/atm/idt77252.h
index 544b39738291..6f2b4a5875fb 100644
--- a/drivers/atm/idt77252.h
+++ b/drivers/atm/idt77252.h
@@ -37,7 +37,7 @@
37#include <linux/ptrace.h> 37#include <linux/ptrace.h>
38#include <linux/skbuff.h> 38#include <linux/skbuff.h>
39#include <linux/workqueue.h> 39#include <linux/workqueue.h>
40 40#include <linux/mutex.h>
41 41
42/*****************************************************************************/ 42/*****************************************************************************/
43/* */ 43/* */
@@ -359,7 +359,7 @@ struct idt77252_dev
359 unsigned long srambase; /* SAR's sram base address */ 359 unsigned long srambase; /* SAR's sram base address */
360 void __iomem *fbq[4]; /* FBQ fill addresses */ 360 void __iomem *fbq[4]; /* FBQ fill addresses */
361 361
362 struct semaphore mutex; 362 struct mutex mutex;
363 spinlock_t cmd_lock; /* for r/w utility/sram */ 363 spinlock_t cmd_lock; /* for r/w utility/sram */
364 364
365 unsigned long softstat; 365 unsigned long softstat;
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig
index 2e18a63ead36..ea4fe3e48f33 100644
--- a/drivers/auxdisplay/Kconfig
+++ b/drivers/auxdisplay/Kconfig
@@ -68,6 +68,10 @@ config CFAG12864B
68 depends on X86 68 depends on X86
69 depends on FB 69 depends on FB
70 depends on KS0108 70 depends on KS0108
71 select FB_SYS_FILLRECT
72 select FB_SYS_COPYAREA
73 select FB_SYS_IMAGEBLIT
74 select FB_SYS_FOPS
71 default n 75 default n
72 ---help--- 76 ---help---
73 If you have a Crystalfontz 128x64 2-color LCD, cfag12864b Series, 77 If you have a Crystalfontz 128x64 2-color LCD, cfag12864b Series,
diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c
index 66fafbb1d087..307c190699e0 100644
--- a/drivers/auxdisplay/cfag12864bfb.c
+++ b/drivers/auxdisplay/cfag12864bfb.c
@@ -73,9 +73,11 @@ static int cfag12864bfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
73 73
74static struct fb_ops cfag12864bfb_ops = { 74static struct fb_ops cfag12864bfb_ops = {
75 .owner = THIS_MODULE, 75 .owner = THIS_MODULE,
76 .fb_fillrect = cfb_fillrect, 76 .fb_read = fb_sys_read,
77 .fb_copyarea = cfb_copyarea, 77 .fb_write = fb_sys_write,
78 .fb_imageblit = cfb_imageblit, 78 .fb_fillrect = sys_fillrect,
79 .fb_copyarea = sys_copyarea,
80 .fb_imageblit = sys_imageblit,
79 .fb_mmap = cfag12864bfb_mmap, 81 .fb_mmap = cfag12864bfb_mmap,
80}; 82};
81 83
diff --git a/drivers/base/dmapool.c b/drivers/base/dmapool.c
index 9406259754ad..91970e9bb05e 100644
--- a/drivers/base/dmapool.c
+++ b/drivers/base/dmapool.c
@@ -8,6 +8,7 @@
8#include <linux/slab.h> 8#include <linux/slab.h>
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/poison.h> 10#include <linux/poison.h>
11#include <linux/sched.h>
11 12
12/* 13/*
13 * Pool allocator ... wraps the dma_alloc_coherent page allocator, so 14 * Pool allocator ... wraps the dma_alloc_coherent page allocator, so
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 3587cb434371..fe088045dd08 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -670,7 +670,7 @@ static void __reschedule_timeout(int drive, const char *message, int marg)
670 if (drive == current_reqD) 670 if (drive == current_reqD)
671 drive = current_drive; 671 drive = current_drive;
672 del_timer(&fd_timeout); 672 del_timer(&fd_timeout);
673 if (drive < 0 || drive > N_DRIVE) { 673 if (drive < 0 || drive >= N_DRIVE) {
674 fd_timeout.expires = jiffies + 20UL * HZ; 674 fd_timeout.expires = jiffies + 20UL * HZ;
675 drive = 0; 675 drive = 0;
676 } else 676 } else
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index b0238b46dded..7e04dd69f609 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -115,11 +115,11 @@ static struct usb_device_id blacklist_ids[] = {
115 { USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 }, 115 { USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },
116 116
117 /* Broadcom BCM2045 */ 117 /* Broadcom BCM2045 */
118 { USB_DEVICE(0x0a5c, 0x2101), .driver_info = HCI_WRONG_SCO_MTU }, 118 { USB_DEVICE(0x0a5c, 0x2101), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
119 119
120 /* IBM/Lenovo ThinkPad with Broadcom chip */ 120 /* IBM/Lenovo ThinkPad with Broadcom chip */
121 { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU }, 121 { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
122 { USB_DEVICE(0x0a5c, 0x2110), .driver_info = HCI_WRONG_SCO_MTU }, 122 { USB_DEVICE(0x0a5c, 0x2110), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
123 123
124 /* Targus ACB10US */ 124 /* Targus ACB10US */
125 { USB_DEVICE(0x0a5c, 0x2100), .driver_info = HCI_RESET }, 125 { USB_DEVICE(0x0a5c, 0x2100), .driver_info = HCI_RESET },
@@ -128,17 +128,17 @@ static struct usb_device_id blacklist_ids[] = {
128 { USB_DEVICE(0x0a5c, 0x2111), .driver_info = HCI_RESET }, 128 { USB_DEVICE(0x0a5c, 0x2111), .driver_info = HCI_RESET },
129 129
130 /* HP laptop with Broadcom chip */ 130 /* HP laptop with Broadcom chip */
131 { USB_DEVICE(0x03f0, 0x171d), .driver_info = HCI_WRONG_SCO_MTU }, 131 { USB_DEVICE(0x03f0, 0x171d), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
132 132
133 /* Dell laptop with Broadcom chip */ 133 /* Dell laptop with Broadcom chip */
134 { USB_DEVICE(0x413c, 0x8126), .driver_info = HCI_WRONG_SCO_MTU }, 134 { USB_DEVICE(0x413c, 0x8126), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
135 135
136 /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ 136 /* Microsoft Wireless Transceiver for Bluetooth 2.0 */
137 { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, 137 { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
138 138
139 /* Kensington Bluetooth USB adapter */ 139 /* Kensington Bluetooth USB adapter */
140 { USB_DEVICE(0x047d, 0x105d), .driver_info = HCI_RESET }, 140 { USB_DEVICE(0x047d, 0x105d), .driver_info = HCI_RESET },
141 { USB_DEVICE(0x047d, 0x105e), .driver_info = HCI_WRONG_SCO_MTU }, 141 { USB_DEVICE(0x047d, 0x105e), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
142 142
143 /* ISSC Bluetooth Adapter v3.1 */ 143 /* ISSC Bluetooth Adapter v3.1 */
144 { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET }, 144 { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET },
@@ -148,8 +148,8 @@ static struct usb_device_id blacklist_ids[] = {
148 { USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC }, 148 { USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC },
149 149
150 /* Belkin F8T012 and F8T013 devices */ 150 /* Belkin F8T012 and F8T013 devices */
151 { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_WRONG_SCO_MTU }, 151 { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
152 { USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_WRONG_SCO_MTU }, 152 { USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
153 153
154 /* Digianswer devices */ 154 /* Digianswer devices */
155 { USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER }, 155 { USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER },
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index abcafac64738..ef683ebd367c 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -815,7 +815,7 @@ config SGI_IP27_RTC
815 815
816config GEN_RTC 816config GEN_RTC
817 tristate "Generic /dev/rtc emulation" 817 tristate "Generic /dev/rtc emulation"
818 depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC && !FRV && !S390 818 depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC && !FRV && !S390 && !SUPERH
819 ---help--- 819 ---help---
820 If you say Y here and create a character special file /dev/rtc with 820 If you say Y here and create a character special file /dev/rtc with
821 major number 10 and minor number 135 using mknod ("man mknod"), you 821 major number 10 and minor number 135 using mknod ("man mknod"), you
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c
index 679d7f972439..c7ed617aa7ff 100644
--- a/drivers/char/agp/frontend.c
+++ b/drivers/char/agp/frontend.c
@@ -37,6 +37,7 @@
37#include <linux/agpgart.h> 37#include <linux/agpgart.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/mm.h> 39#include <linux/mm.h>
40#include <linux/sched.h>
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41#include <asm/pgtable.h> 42#include <asm/pgtable.h>
42#include "agp.h" 43#include "agp.h"
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index 45aeb917ec63..d535c406b319 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -37,6 +37,7 @@
37#include <linux/vmalloc.h> 37#include <linux/vmalloc.h>
38#include <linux/dma-mapping.h> 38#include <linux/dma-mapping.h>
39#include <linux/mm.h> 39#include <linux/mm.h>
40#include <linux/sched.h>
40#include <asm/io.h> 41#include <asm/io.h>
41#include <asm/cacheflush.h> 42#include <asm/cacheflush.h>
42#include <asm/pgtable.h> 43#include <asm/pgtable.h>
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index c72ee97d3892..ca376b92162c 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -1061,6 +1061,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
1061 1061
1062 if (data & info->ignore_status_mask) { 1062 if (data & info->ignore_status_mask) {
1063 info->icount.rx++; 1063 info->icount.rx++;
1064 spin_unlock(&cinfo->card_lock);
1064 return; 1065 return;
1065 } 1066 }
1066 if (tty_buffer_request_room(tty, 1)) { 1067 if (tty_buffer_request_room(tty, 1)) {
diff --git a/drivers/char/drm/Kconfig b/drivers/char/drm/Kconfig
index ef833a1c27eb..0b7ffa5191c6 100644
--- a/drivers/char/drm/Kconfig
+++ b/drivers/char/drm/Kconfig
@@ -6,7 +6,7 @@
6# 6#
7config DRM 7config DRM
8 tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)" 8 tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
9 depends on (AGP || AGP=n) && PCI 9 depends on (AGP || AGP=n) && PCI && !EMULATED_CMPXCHG
10 help 10 help
11 Kernel-level support for the Direct Rendering Infrastructure (DRI) 11 Kernel-level support for the Direct Rendering Infrastructure (DRI)
12 introduced in XFree86 4.0. If you say Y here, you need to select 12 introduced in XFree86 4.0. If you say Y here, you need to select
diff --git a/drivers/char/drm/drm_drawable.c b/drivers/char/drm/drm_drawable.c
index de37d5f74563..b33313be2547 100644
--- a/drivers/char/drm/drm_drawable.c
+++ b/drivers/char/drm/drm_drawable.c
@@ -172,38 +172,49 @@ int drm_rmdraw(DRM_IOCTL_ARGS)
172 172
173 bitfield_length = idx + 1; 173 bitfield_length = idx + 1;
174 174
175 if (idx != id / (8 * sizeof(*bitfield))) 175 bitfield = NULL;
176 bitfield = drm_alloc(bitfield_length *
177 sizeof(*bitfield), DRM_MEM_BUFS);
178 176
179 if (!bitfield && bitfield_length) { 177 if (bitfield_length) {
180 bitfield = dev->drw_bitfield; 178 if (bitfield_length != dev->drw_bitfield_length)
181 bitfield_length = dev->drw_bitfield_length; 179 bitfield = drm_alloc(bitfield_length *
180 sizeof(*bitfield),
181 DRM_MEM_BUFS);
182
183 if (!bitfield) {
184 bitfield = dev->drw_bitfield;
185 bitfield_length = dev->drw_bitfield_length;
186 }
182 } 187 }
183 } 188 }
184 189
185 if (bitfield != dev->drw_bitfield) { 190 if (bitfield != dev->drw_bitfield) {
186 info_length = 8 * sizeof(*bitfield) * bitfield_length; 191 info_length = 8 * sizeof(*bitfield) * bitfield_length;
187 192
188 info = drm_alloc(info_length * sizeof(*info), DRM_MEM_BUFS); 193 if (info_length) {
194 info = drm_alloc(info_length * sizeof(*info),
195 DRM_MEM_BUFS);
189 196
190 if (!info && info_length) { 197 if (!info) {
191 info = dev->drw_info; 198 info = dev->drw_info;
192 info_length = dev->drw_info_length; 199 info_length = dev->drw_info_length;
193 } 200 }
201 } else
202 info = NULL;
194 203
195 spin_lock_irqsave(&dev->drw_lock, irqflags); 204 spin_lock_irqsave(&dev->drw_lock, irqflags);
196 205
197 memcpy(bitfield, dev->drw_bitfield, bitfield_length * 206 if (bitfield)
198 sizeof(*bitfield)); 207 memcpy(bitfield, dev->drw_bitfield, bitfield_length *
208 sizeof(*bitfield));
199 drm_free(dev->drw_bitfield, sizeof(*bitfield) * 209 drm_free(dev->drw_bitfield, sizeof(*bitfield) *
200 dev->drw_bitfield_length, DRM_MEM_BUFS); 210 dev->drw_bitfield_length, DRM_MEM_BUFS);
201 dev->drw_bitfield = bitfield; 211 dev->drw_bitfield = bitfield;
202 dev->drw_bitfield_length = bitfield_length; 212 dev->drw_bitfield_length = bitfield_length;
203 213
204 if (info != dev->drw_info) { 214 if (info != dev->drw_info) {
205 memcpy(info, dev->drw_info, info_length * 215 if (info)
206 sizeof(*info)); 216 memcpy(info, dev->drw_info, info_length *
217 sizeof(*info));
207 drm_free(dev->drw_info, sizeof(*info) * 218 drm_free(dev->drw_info, sizeof(*info) *
208 dev->drw_info_length, DRM_MEM_BUFS); 219 dev->drw_info_length, DRM_MEM_BUFS);
209 dev->drw_info = info; 220 dev->drw_info = info;
diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h
index 31cdde83713b..177ccc07f968 100644
--- a/drivers/char/drm/drm_pciids.h
+++ b/drivers/char/drm/drm_pciids.h
@@ -102,13 +102,20 @@
102 {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 102 {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
103 {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \ 103 {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \
104 {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ 104 {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \
105 {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
105 {0x1002, 0x5955, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 106 {0x1002, 0x5955, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
107 {0x1002, 0x5974, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
108 {0x1002, 0x5975, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
106 {0x1002, 0x5960, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 109 {0x1002, 0x5960, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
107 {0x1002, 0x5961, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 110 {0x1002, 0x5961, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
108 {0x1002, 0x5962, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 111 {0x1002, 0x5962, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
109 {0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 112 {0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
110 {0x1002, 0x5965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 113 {0x1002, 0x5965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
111 {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \ 114 {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \
115 {0x1002, 0x5a41, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
116 {0x1002, 0x5a42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
117 {0x1002, 0x5a61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
118 {0x1002, 0x5a62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
112 {0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 119 {0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
113 {0x1002, 0x5b62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 120 {0x1002, 0x5b62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
114 {0x1002, 0x5b63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 121 {0x1002, 0x5b63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c
index 78c1ae28f17c..b92062a239f1 100644
--- a/drivers/char/drm/i915_irq.c
+++ b/drivers/char/drm/i915_irq.c
@@ -582,7 +582,7 @@ void i915_driver_irq_postinstall(drm_device_t * dev)
582{ 582{
583 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 583 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
584 584
585 dev_priv->swaps_lock = SPIN_LOCK_UNLOCKED; 585 spin_lock_init(&dev_priv->swaps_lock);
586 INIT_LIST_HEAD(&dev_priv->vbl_swaps.head); 586 INIT_LIST_HEAD(&dev_priv->vbl_swaps.head);
587 dev_priv->swaps_pending = 0; 587 dev_priv->swaps_pending = 0;
588 588
diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c
index f0e7263dfcde..0e8ceea5ea78 100644
--- a/drivers/char/hangcheck-timer.c
+++ b/drivers/char/hangcheck-timer.c
@@ -48,7 +48,7 @@
48#include <linux/delay.h> 48#include <linux/delay.h>
49#include <asm/uaccess.h> 49#include <asm/uaccess.h>
50#include <linux/sysrq.h> 50#include <linux/sysrq.h>
51 51#include <linux/timer.h>
52 52
53#define VERSION_STR "0.9.0" 53#define VERSION_STR "0.9.0"
54 54
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index b3d4ccc33a47..154f42203b05 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -1191,6 +1191,7 @@ static int job_control(struct tty_struct *tty, struct file *file)
1191 is_current_pgrp_orphaned()) 1191 is_current_pgrp_orphaned())
1192 return -EIO; 1192 return -EIO;
1193 kill_pgrp(task_pgrp(current), SIGTTIN, 1); 1193 kill_pgrp(task_pgrp(current), SIGTTIN, 1);
1194 set_thread_flag(TIF_SIGPENDING);
1194 return -ERESTARTSYS; 1195 return -ERESTARTSYS;
1195 } 1196 }
1196 } 1197 }
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 46c1b97748b6..0474cac4a84e 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -760,7 +760,7 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min,
760 760
761static void extract_buf(struct entropy_store *r, __u8 *out) 761static void extract_buf(struct entropy_store *r, __u8 *out)
762{ 762{
763 int i, x; 763 int i;
764 __u32 data[16], buf[5 + SHA_WORKSPACE_WORDS]; 764 __u32 data[16], buf[5 + SHA_WORKSPACE_WORDS];
765 765
766 sha_init(buf); 766 sha_init(buf);
@@ -772,9 +772,11 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
772 * attempts to find previous ouputs), unless the hash 772 * attempts to find previous ouputs), unless the hash
773 * function can be inverted. 773 * function can be inverted.
774 */ 774 */
775 for (i = 0, x = 0; i < r->poolinfo->poolwords; i += 16, x+=2) { 775 for (i = 0; i < r->poolinfo->poolwords; i += 16) {
776 sha_transform(buf, (__u8 *)r->pool+i, buf + 5); 776 /* hash blocks of 16 words = 512 bits */
777 add_entropy_words(r, &buf[x % 5], 1); 777 sha_transform(buf, (__u8 *)(r->pool + i), buf + 5);
778 /* feed back portion of the resulting hash */
779 add_entropy_words(r, &buf[i % 5], 1);
778 } 780 }
779 781
780 /* 782 /*
@@ -782,7 +784,7 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
782 * portion of the pool while mixing, and hash one 784 * portion of the pool while mixing, and hash one
783 * final time. 785 * final time.
784 */ 786 */
785 __add_entropy_words(r, &buf[x % 5], 1, data); 787 __add_entropy_words(r, &buf[i % 5], 1, data);
786 sha_transform(buf, (__u8 *)data, buf + 5); 788 sha_transform(buf, (__u8 *)data, buf + 5);
787 789
788 /* 790 /*
@@ -1018,37 +1020,44 @@ random_poll(struct file *file, poll_table * wait)
1018 return mask; 1020 return mask;
1019} 1021}
1020 1022
1021static ssize_t 1023static int
1022random_write(struct file * file, const char __user * buffer, 1024write_pool(struct entropy_store *r, const char __user *buffer, size_t count)
1023 size_t count, loff_t *ppos)
1024{ 1025{
1025 int ret = 0;
1026 size_t bytes; 1026 size_t bytes;
1027 __u32 buf[16]; 1027 __u32 buf[16];
1028 const char __user *p = buffer; 1028 const char __user *p = buffer;
1029 size_t c = count;
1030 1029
1031 while (c > 0) { 1030 while (count > 0) {
1032 bytes = min(c, sizeof(buf)); 1031 bytes = min(count, sizeof(buf));
1032 if (copy_from_user(&buf, p, bytes))
1033 return -EFAULT;
1033 1034
1034 bytes -= copy_from_user(&buf, p, bytes); 1035 count -= bytes;
1035 if (!bytes) {
1036 ret = -EFAULT;
1037 break;
1038 }
1039 c -= bytes;
1040 p += bytes; 1036 p += bytes;
1041 1037
1042 add_entropy_words(&input_pool, buf, (bytes + 3) / 4); 1038 add_entropy_words(r, buf, (bytes + 3) / 4);
1043 }
1044 if (p == buffer) {
1045 return (ssize_t)ret;
1046 } else {
1047 struct inode *inode = file->f_path.dentry->d_inode;
1048 inode->i_mtime = current_fs_time(inode->i_sb);
1049 mark_inode_dirty(inode);
1050 return (ssize_t)(p - buffer);
1051 } 1039 }
1040
1041 return 0;
1042}
1043
1044static ssize_t
1045random_write(struct file * file, const char __user * buffer,
1046 size_t count, loff_t *ppos)
1047{
1048 size_t ret;
1049 struct inode *inode = file->f_path.dentry->d_inode;
1050
1051 ret = write_pool(&blocking_pool, buffer, count);
1052 if (ret)
1053 return ret;
1054 ret = write_pool(&nonblocking_pool, buffer, count);
1055 if (ret)
1056 return ret;
1057
1058 inode->i_mtime = current_fs_time(inode->i_sb);
1059 mark_inode_dirty(inode);
1060 return (ssize_t)count;
1052} 1061}
1053 1062
1054static int 1063static int
@@ -1087,8 +1096,8 @@ random_ioctl(struct inode * inode, struct file * file,
1087 return -EINVAL; 1096 return -EINVAL;
1088 if (get_user(size, p++)) 1097 if (get_user(size, p++))
1089 return -EFAULT; 1098 return -EFAULT;
1090 retval = random_write(file, (const char __user *) p, 1099 retval = write_pool(&input_pool, (const char __user *)p,
1091 size, &file->f_pos); 1100 size);
1092 if (retval < 0) 1101 if (retval < 0)
1093 return retval; 1102 return retval;
1094 credit_entropy_store(&input_pool, ent_count); 1103 credit_entropy_store(&input_pool, ent_count);
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 75d2a46e106f..3752edc30c36 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1148,7 +1148,8 @@ int tty_check_change(struct tty_struct * tty)
1148 return 0; 1148 return 0;
1149 if (is_current_pgrp_orphaned()) 1149 if (is_current_pgrp_orphaned())
1150 return -EIO; 1150 return -EIO;
1151 (void) kill_pgrp(task_pgrp(current), SIGTTOU, 1); 1151 kill_pgrp(task_pgrp(current), SIGTTOU, 1);
1152 set_thread_flag(TIF_SIGPENDING);
1152 return -ERESTARTSYS; 1153 return -ERESTARTSYS;
1153} 1154}
1154 1155
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c
index fd955dbd588c..dc7548dcaf35 100644
--- a/drivers/char/watchdog/ixp2000_wdt.c
+++ b/drivers/char/watchdog/ixp2000_wdt.c
@@ -205,7 +205,7 @@ static void __exit ixp2000_wdt_exit(void)
205module_init(ixp2000_wdt_init); 205module_init(ixp2000_wdt_init);
206module_exit(ixp2000_wdt_exit); 206module_exit(ixp2000_wdt_exit);
207 207
208MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net">); 208MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
209MODULE_DESCRIPTION("IXP2000 Network Processor Watchdog"); 209MODULE_DESCRIPTION("IXP2000 Network Processor Watchdog");
210 210
211module_param(heartbeat, int, 0); 211module_param(heartbeat, int, 0);
diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index 6d3840e629de..6a86958b577f 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -102,10 +102,15 @@ geode_aes_crypt(struct geode_aes_op *op)
102 u32 flags = 0; 102 u32 flags = 0;
103 unsigned long iflags; 103 unsigned long iflags;
104 104
105 if (op->len == 0 || op->src == op->dst) 105 if (op->len == 0)
106 return 0; 106 return 0;
107 107
108 if (op->flags & AES_FLAGS_COHERENT) 108 /* If the source and destination is the same, then
109 * we need to turn on the coherent flags, otherwise
110 * we don't need to worry
111 */
112
113 if (op->src == op->dst)
109 flags |= (AES_CTRL_DCA | AES_CTRL_SCA); 114 flags |= (AES_CTRL_DCA | AES_CTRL_SCA);
110 115
111 if (op->dir == AES_DIR_ENCRYPT) 116 if (op->dir == AES_DIR_ENCRYPT)
@@ -120,7 +125,7 @@ geode_aes_crypt(struct geode_aes_op *op)
120 _writefield(AES_WRITEIV0_REG, op->iv); 125 _writefield(AES_WRITEIV0_REG, op->iv);
121 } 126 }
122 127
123 if (op->flags & AES_FLAGS_USRKEY) { 128 if (!(op->flags & AES_FLAGS_HIDDENKEY)) {
124 flags |= AES_CTRL_WRKEY; 129 flags |= AES_CTRL_WRKEY;
125 _writefield(AES_WRITEKEY0_REG, op->key); 130 _writefield(AES_WRITEKEY0_REG, op->key);
126 } 131 }
@@ -289,6 +294,7 @@ static struct crypto_alg geode_cbc_alg = {
289 .setkey = geode_setkey, 294 .setkey = geode_setkey,
290 .encrypt = geode_cbc_encrypt, 295 .encrypt = geode_cbc_encrypt,
291 .decrypt = geode_cbc_decrypt, 296 .decrypt = geode_cbc_decrypt,
297 .ivsize = AES_IV_LENGTH,
292 } 298 }
293 } 299 }
294}; 300};
diff --git a/drivers/crypto/geode-aes.h b/drivers/crypto/geode-aes.h
index 8003a36f3a83..f47968671ae7 100644
--- a/drivers/crypto/geode-aes.h
+++ b/drivers/crypto/geode-aes.h
@@ -20,8 +20,7 @@
20#define AES_DIR_DECRYPT 0 20#define AES_DIR_DECRYPT 0
21#define AES_DIR_ENCRYPT 1 21#define AES_DIR_ENCRYPT 1
22 22
23#define AES_FLAGS_USRKEY (1 << 0) 23#define AES_FLAGS_HIDDENKEY (1 << 0)
24#define AES_FLAGS_COHERENT (1 << 1)
25 24
26struct geode_aes_op { 25struct geode_aes_op {
27 26
diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig
index 5932c72f9e42..396dade731f9 100644
--- a/drivers/firewire/Kconfig
+++ b/drivers/firewire/Kconfig
@@ -18,7 +18,7 @@ config FIREWIRE
18 your IEEE 1394 adapter. 18 your IEEE 1394 adapter.
19 19
20 To compile this driver as a module, say M here: the module will be 20 To compile this driver as a module, say M here: the module will be
21 called fw-core. 21 called firewire-core.
22 22
23 This is the "JUJU" FireWire stack, an alternative implementation 23 This is the "JUJU" FireWire stack, an alternative implementation
24 designed for robustness and simplicity. You can build either this 24 designed for robustness and simplicity. You can build either this
@@ -34,11 +34,11 @@ config FIREWIRE_OHCI
34 is the only chipset in use, so say Y here. 34 is the only chipset in use, so say Y here.
35 35
36 To compile this driver as a module, say M here: The module will be 36 To compile this driver as a module, say M here: The module will be
37 called fw-ohci. 37 called firewire-ohci.
38 38
39 If you also build ohci1394 of the classic IEEE 1394 driver stack, 39 If you also build ohci1394 of the classic IEEE 1394 driver stack,
40 blacklist either ohci1394 or fw-ohci to let hotplug load the desired 40 blacklist either ohci1394 or firewire-ohci to let hotplug load the
41 driver. 41 desired driver.
42 42
43config FIREWIRE_SBP2 43config FIREWIRE_SBP2
44 tristate "Support for storage devices (SBP-2 protocol driver)" 44 tristate "Support for storage devices (SBP-2 protocol driver)"
@@ -50,12 +50,12 @@ config FIREWIRE_SBP2
50 like scanners. 50 like scanners.
51 51
52 To compile this driver as a module, say M here: The module will be 52 To compile this driver as a module, say M here: The module will be
53 called fw-sbp2. 53 called firewire-sbp2.
54 54
55 You should also enable support for disks, CD-ROMs, etc. in the SCSI 55 You should also enable support for disks, CD-ROMs, etc. in the SCSI
56 configuration section. 56 configuration section.
57 57
58 If you also build sbp2 of the classic IEEE 1394 driver stack, 58 If you also build sbp2 of the classic IEEE 1394 driver stack,
59 blacklist either sbp2 or fw-sbp2 to let hotplug load the desired 59 blacklist either sbp2 or firewire-sbp2 to let hotplug load the
60 driver. 60 desired driver.
61 61
diff --git a/drivers/firewire/Makefile b/drivers/firewire/Makefile
index fc7d59d4bce0..a7c31e9039c1 100644
--- a/drivers/firewire/Makefile
+++ b/drivers/firewire/Makefile
@@ -2,9 +2,11 @@
2# Makefile for the Linux IEEE 1394 implementation 2# Makefile for the Linux IEEE 1394 implementation
3# 3#
4 4
5fw-core-y += fw-card.o fw-topology.o fw-transaction.o fw-iso.o \ 5firewire-core-y += fw-card.o fw-topology.o fw-transaction.o fw-iso.o \
6 fw-device.o fw-cdev.o 6 fw-device.o fw-cdev.o
7firewire-ohci-y += fw-ohci.o
8firewire-sbp2-y += fw-sbp2.o
7 9
8obj-$(CONFIG_FIREWIRE) += fw-core.o 10obj-$(CONFIG_FIREWIRE) += firewire-core.o
9obj-$(CONFIG_FIREWIRE_OHCI) += fw-ohci.o 11obj-$(CONFIG_FIREWIRE_OHCI) += firewire-ohci.o
10obj-$(CONFIG_FIREWIRE_SBP2) += fw-sbp2.o 12obj-$(CONFIG_FIREWIRE_SBP2) += firewire-sbp2.o
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 636151a64add..9eb1edacd825 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -407,11 +407,6 @@ fw_card_add(struct fw_card *card,
407 card->link_speed = link_speed; 407 card->link_speed = link_speed;
408 card->guid = guid; 408 card->guid = guid;
409 409
410 /* Activate link_on bit and contender bit in our self ID packets.*/
411 if (card->driver->update_phy_reg(card, 4, 0,
412 PHY_LINK_ACTIVE | PHY_CONTENDER) < 0)
413 return -EIO;
414
415 /* 410 /*
416 * The subsystem grabs a reference when the card is added and 411 * The subsystem grabs a reference when the card is added and
417 * drops it when the driver calls fw_core_remove_card. 412 * drops it when the driver calls fw_core_remove_card.
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index 0fa5bd54c6a1..5d402d63799f 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -365,7 +365,7 @@ complete_transaction(struct fw_card *card, int rcode,
365 response->response.data, response->response.length); 365 response->response.data, response->response.length);
366} 366}
367 367
368static ssize_t ioctl_send_request(struct client *client, void *buffer) 368static int ioctl_send_request(struct client *client, void *buffer)
369{ 369{
370 struct fw_device *device = client->device; 370 struct fw_device *device = client->device;
371 struct fw_cdev_send_request *request = buffer; 371 struct fw_cdev_send_request *request = buffer;
@@ -677,12 +677,21 @@ static int ioctl_create_iso_context(struct client *client, void *buffer)
677 return 0; 677 return 0;
678} 678}
679 679
680/* Macros for decoding the iso packet control header. */
681#define GET_PAYLOAD_LENGTH(v) ((v) & 0xffff)
682#define GET_INTERRUPT(v) (((v) >> 16) & 0x01)
683#define GET_SKIP(v) (((v) >> 17) & 0x01)
684#define GET_TAG(v) (((v) >> 18) & 0x02)
685#define GET_SY(v) (((v) >> 20) & 0x04)
686#define GET_HEADER_LENGTH(v) (((v) >> 24) & 0xff)
687
680static int ioctl_queue_iso(struct client *client, void *buffer) 688static int ioctl_queue_iso(struct client *client, void *buffer)
681{ 689{
682 struct fw_cdev_queue_iso *request = buffer; 690 struct fw_cdev_queue_iso *request = buffer;
683 struct fw_cdev_iso_packet __user *p, *end, *next; 691 struct fw_cdev_iso_packet __user *p, *end, *next;
684 struct fw_iso_context *ctx = client->iso_context; 692 struct fw_iso_context *ctx = client->iso_context;
685 unsigned long payload, buffer_end, header_length; 693 unsigned long payload, buffer_end, header_length;
694 u32 control;
686 int count; 695 int count;
687 struct { 696 struct {
688 struct fw_iso_packet packet; 697 struct fw_iso_packet packet;
@@ -717,8 +726,14 @@ static int ioctl_queue_iso(struct client *client, void *buffer)
717 end = (void __user *)p + request->size; 726 end = (void __user *)p + request->size;
718 count = 0; 727 count = 0;
719 while (p < end) { 728 while (p < end) {
720 if (__copy_from_user(&u.packet, p, sizeof(*p))) 729 if (get_user(control, &p->control))
721 return -EFAULT; 730 return -EFAULT;
731 u.packet.payload_length = GET_PAYLOAD_LENGTH(control);
732 u.packet.interrupt = GET_INTERRUPT(control);
733 u.packet.skip = GET_SKIP(control);
734 u.packet.tag = GET_TAG(control);
735 u.packet.sy = GET_SY(control);
736 u.packet.header_length = GET_HEADER_LENGTH(control);
722 737
723 if (ctx->type == FW_ISO_CONTEXT_TRANSMIT) { 738 if (ctx->type == FW_ISO_CONTEXT_TRANSMIT) {
724 header_length = u.packet.header_length; 739 header_length = u.packet.header_length;
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h
index 0ba9d64ccf4c..af1723eae4ba 100644
--- a/drivers/firewire/fw-device.h
+++ b/drivers/firewire/fw-device.h
@@ -99,6 +99,7 @@ fw_unit(struct device *dev)
99#define CSR_DEPENDENT_INFO 0x14 99#define CSR_DEPENDENT_INFO 0x14
100#define CSR_MODEL 0x17 100#define CSR_MODEL 0x17
101#define CSR_INSTANCE 0x18 101#define CSR_INSTANCE 0x18
102#define CSR_DIRECTORY_ID 0x20
102 103
103#define SBP2_COMMAND_SET_SPECIFIER 0x38 104#define SBP2_COMMAND_SET_SPECIFIER 0x38
104#define SBP2_COMMAND_SET 0x39 105#define SBP2_COMMAND_SET 0x39
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index c17342d3e6fd..0d08bf9b78c2 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -268,7 +268,7 @@ static int ar_context_add_page(struct ar_context *ctx)
268 268
269 dma_sync_single_for_device(dev, ab_bus, PAGE_SIZE, DMA_BIDIRECTIONAL); 269 dma_sync_single_for_device(dev, ab_bus, PAGE_SIZE, DMA_BIDIRECTIONAL);
270 270
271 ctx->last_buffer->descriptor.branch_address = ab_bus | 1; 271 ctx->last_buffer->descriptor.branch_address = cpu_to_le32(ab_bus | 1);
272 ctx->last_buffer->next = ab; 272 ctx->last_buffer->next = ab;
273 ctx->last_buffer = ab; 273 ctx->last_buffer = ab;
274 274
@@ -417,11 +417,21 @@ ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, u32 regs)
417 ctx->current_buffer = ab.next; 417 ctx->current_buffer = ab.next;
418 ctx->pointer = ctx->current_buffer->data; 418 ctx->pointer = ctx->current_buffer->data;
419 419
420 reg_write(ctx->ohci, COMMAND_PTR(ctx->regs), ab.descriptor.branch_address); 420 return 0;
421}
422
423static void ar_context_run(struct ar_context *ctx)
424{
425 struct ar_buffer *ab = ctx->current_buffer;
426 dma_addr_t ab_bus;
427 size_t offset;
428
429 offset = offsetof(struct ar_buffer, data);
430 ab_bus = ab->descriptor.data_address - offset;
431
432 reg_write(ctx->ohci, COMMAND_PTR(ctx->regs), ab_bus | 1);
421 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN); 433 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN);
422 flush_writes(ctx->ohci); 434 flush_writes(ctx->ohci);
423
424 return 0;
425} 435}
426 436
427static void context_tasklet(unsigned long data) 437static void context_tasklet(unsigned long data)
@@ -1038,11 +1048,78 @@ static irqreturn_t irq_handler(int irq, void *data)
1038 return IRQ_HANDLED; 1048 return IRQ_HANDLED;
1039} 1049}
1040 1050
1051static int software_reset(struct fw_ohci *ohci)
1052{
1053 int i;
1054
1055 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_softReset);
1056
1057 for (i = 0; i < OHCI_LOOP_COUNT; i++) {
1058 if ((reg_read(ohci, OHCI1394_HCControlSet) &
1059 OHCI1394_HCControl_softReset) == 0)
1060 return 0;
1061 msleep(1);
1062 }
1063
1064 return -EBUSY;
1065}
1066
1041static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length) 1067static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length)
1042{ 1068{
1043 struct fw_ohci *ohci = fw_ohci(card); 1069 struct fw_ohci *ohci = fw_ohci(card);
1044 struct pci_dev *dev = to_pci_dev(card->device); 1070 struct pci_dev *dev = to_pci_dev(card->device);
1045 1071
1072 if (software_reset(ohci)) {
1073 fw_error("Failed to reset ohci card.\n");
1074 return -EBUSY;
1075 }
1076
1077 /*
1078 * Now enable LPS, which we need in order to start accessing
1079 * most of the registers. In fact, on some cards (ALI M5251),
1080 * accessing registers in the SClk domain without LPS enabled
1081 * will lock up the machine. Wait 50msec to make sure we have
1082 * full link enabled.
1083 */
1084 reg_write(ohci, OHCI1394_HCControlSet,
1085 OHCI1394_HCControl_LPS |
1086 OHCI1394_HCControl_postedWriteEnable);
1087 flush_writes(ohci);
1088 msleep(50);
1089
1090 reg_write(ohci, OHCI1394_HCControlClear,
1091 OHCI1394_HCControl_noByteSwapData);
1092
1093 reg_write(ohci, OHCI1394_LinkControlSet,
1094 OHCI1394_LinkControl_rcvSelfID |
1095 OHCI1394_LinkControl_cycleTimerEnable |
1096 OHCI1394_LinkControl_cycleMaster);
1097
1098 reg_write(ohci, OHCI1394_ATRetries,
1099 OHCI1394_MAX_AT_REQ_RETRIES |
1100 (OHCI1394_MAX_AT_RESP_RETRIES << 4) |
1101 (OHCI1394_MAX_PHYS_RESP_RETRIES << 8));
1102
1103 ar_context_run(&ohci->ar_request_ctx);
1104 ar_context_run(&ohci->ar_response_ctx);
1105
1106 reg_write(ohci, OHCI1394_SelfIDBuffer, ohci->self_id_bus);
1107 reg_write(ohci, OHCI1394_PhyUpperBound, 0x00010000);
1108 reg_write(ohci, OHCI1394_IntEventClear, ~0);
1109 reg_write(ohci, OHCI1394_IntMaskClear, ~0);
1110 reg_write(ohci, OHCI1394_IntMaskSet,
1111 OHCI1394_selfIDComplete |
1112 OHCI1394_RQPkt | OHCI1394_RSPkt |
1113 OHCI1394_reqTxComplete | OHCI1394_respTxComplete |
1114 OHCI1394_isochRx | OHCI1394_isochTx |
1115 OHCI1394_masterIntEnable |
1116 OHCI1394_cycle64Seconds);
1117
1118 /* Activate link_on bit and contender bit in our self ID packets.*/
1119 if (ohci_update_phy_reg(card, 4, 0,
1120 PHY_LINK_ACTIVE | PHY_CONTENDER) < 0)
1121 return -EIO;
1122
1046 /* 1123 /*
1047 * When the link is not yet enabled, the atomic config rom 1124 * When the link is not yet enabled, the atomic config rom
1048 * update mechanism described below in ohci_set_config_rom() 1125 * update mechanism described below in ohci_set_config_rom()
@@ -1700,22 +1777,6 @@ static const struct fw_card_driver ohci_driver = {
1700 .stop_iso = ohci_stop_iso, 1777 .stop_iso = ohci_stop_iso,
1701}; 1778};
1702 1779
1703static int software_reset(struct fw_ohci *ohci)
1704{
1705 int i;
1706
1707 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_softReset);
1708
1709 for (i = 0; i < OHCI_LOOP_COUNT; i++) {
1710 if ((reg_read(ohci, OHCI1394_HCControlSet) &
1711 OHCI1394_HCControl_softReset) == 0)
1712 return 0;
1713 msleep(1);
1714 }
1715
1716 return -EBUSY;
1717}
1718
1719static int __devinit 1780static int __devinit
1720pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) 1781pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1721{ 1782{
@@ -1761,33 +1822,6 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1761 goto fail_iomem; 1822 goto fail_iomem;
1762 } 1823 }
1763 1824
1764 if (software_reset(ohci)) {
1765 fw_error("Failed to reset ohci card.\n");
1766 err = -EBUSY;
1767 goto fail_registers;
1768 }
1769
1770 /*
1771 * Now enable LPS, which we need in order to start accessing
1772 * most of the registers. In fact, on some cards (ALI M5251),
1773 * accessing registers in the SClk domain without LPS enabled
1774 * will lock up the machine. Wait 50msec to make sure we have
1775 * full link enabled.
1776 */
1777 reg_write(ohci, OHCI1394_HCControlSet,
1778 OHCI1394_HCControl_LPS |
1779 OHCI1394_HCControl_postedWriteEnable);
1780 flush_writes(ohci);
1781 msleep(50);
1782
1783 reg_write(ohci, OHCI1394_HCControlClear,
1784 OHCI1394_HCControl_noByteSwapData);
1785
1786 reg_write(ohci, OHCI1394_LinkControlSet,
1787 OHCI1394_LinkControl_rcvSelfID |
1788 OHCI1394_LinkControl_cycleTimerEnable |
1789 OHCI1394_LinkControl_cycleMaster);
1790
1791 ar_context_init(&ohci->ar_request_ctx, ohci, 1825 ar_context_init(&ohci->ar_request_ctx, ohci,
1792 OHCI1394_AsReqRcvContextControlSet); 1826 OHCI1394_AsReqRcvContextControlSet);
1793 1827
@@ -1800,11 +1834,6 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1800 context_init(&ohci->at_response_ctx, ohci, AT_BUFFER_SIZE, 1834 context_init(&ohci->at_response_ctx, ohci, AT_BUFFER_SIZE,
1801 OHCI1394_AsRspTrContextControlSet, handle_at_packet); 1835 OHCI1394_AsRspTrContextControlSet, handle_at_packet);
1802 1836
1803 reg_write(ohci, OHCI1394_ATRetries,
1804 OHCI1394_MAX_AT_REQ_RETRIES |
1805 (OHCI1394_MAX_AT_RESP_RETRIES << 4) |
1806 (OHCI1394_MAX_PHYS_RESP_RETRIES << 8));
1807
1808 reg_write(ohci, OHCI1394_IsoRecvIntMaskSet, ~0); 1837 reg_write(ohci, OHCI1394_IsoRecvIntMaskSet, ~0);
1809 ohci->it_context_mask = reg_read(ohci, OHCI1394_IsoRecvIntMaskSet); 1838 ohci->it_context_mask = reg_read(ohci, OHCI1394_IsoRecvIntMaskSet);
1810 reg_write(ohci, OHCI1394_IsoRecvIntMaskClear, ~0); 1839 reg_write(ohci, OHCI1394_IsoRecvIntMaskClear, ~0);
@@ -1834,18 +1863,6 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1834 goto fail_registers; 1863 goto fail_registers;
1835 } 1864 }
1836 1865
1837 reg_write(ohci, OHCI1394_SelfIDBuffer, ohci->self_id_bus);
1838 reg_write(ohci, OHCI1394_PhyUpperBound, 0x00010000);
1839 reg_write(ohci, OHCI1394_IntEventClear, ~0);
1840 reg_write(ohci, OHCI1394_IntMaskClear, ~0);
1841 reg_write(ohci, OHCI1394_IntMaskSet,
1842 OHCI1394_selfIDComplete |
1843 OHCI1394_RQPkt | OHCI1394_RSPkt |
1844 OHCI1394_reqTxComplete | OHCI1394_respTxComplete |
1845 OHCI1394_isochRx | OHCI1394_isochTx |
1846 OHCI1394_masterIntEnable |
1847 OHCI1394_cycle64Seconds);
1848
1849 bus_options = reg_read(ohci, OHCI1394_BusOptions); 1866 bus_options = reg_read(ohci, OHCI1394_BusOptions);
1850 max_receive = (bus_options >> 12) & 0xf; 1867 max_receive = (bus_options >> 12) & 0xf;
1851 link_speed = bus_options & 0x7; 1868 link_speed = bus_options & 0x7;
@@ -1907,6 +1924,45 @@ static void pci_remove(struct pci_dev *dev)
1907 fw_notify("Removed fw-ohci device.\n"); 1924 fw_notify("Removed fw-ohci device.\n");
1908} 1925}
1909 1926
1927#ifdef CONFIG_PM
1928static int pci_suspend(struct pci_dev *pdev, pm_message_t state)
1929{
1930 struct fw_ohci *ohci = pci_get_drvdata(pdev);
1931 int err;
1932
1933 software_reset(ohci);
1934 free_irq(pdev->irq, ohci);
1935 err = pci_save_state(pdev);
1936 if (err) {
1937 fw_error("pci_save_state failed with %d", err);
1938 return err;
1939 }
1940 err = pci_set_power_state(pdev, pci_choose_state(pdev, state));
1941 if (err) {
1942 fw_error("pci_set_power_state failed with %d", err);
1943 return err;
1944 }
1945
1946 return 0;
1947}
1948
1949static int pci_resume(struct pci_dev *pdev)
1950{
1951 struct fw_ohci *ohci = pci_get_drvdata(pdev);
1952 int err;
1953
1954 pci_set_power_state(pdev, PCI_D0);
1955 pci_restore_state(pdev);
1956 err = pci_enable_device(pdev);
1957 if (err) {
1958 fw_error("pci_enable_device failed with %d", err);
1959 return err;
1960 }
1961
1962 return ohci_enable(&ohci->card, ohci->config_rom, CONFIG_ROM_SIZE);
1963}
1964#endif
1965
1910static struct pci_device_id pci_table[] = { 1966static struct pci_device_id pci_table[] = {
1911 { PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_FIREWIRE_OHCI, ~0) }, 1967 { PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_FIREWIRE_OHCI, ~0) },
1912 { } 1968 { }
@@ -1919,6 +1975,10 @@ static struct pci_driver fw_ohci_pci_driver = {
1919 .id_table = pci_table, 1975 .id_table = pci_table,
1920 .probe = pci_probe, 1976 .probe = pci_probe,
1921 .remove = pci_remove, 1977 .remove = pci_remove,
1978#ifdef CONFIG_PM
1979 .resume = pci_resume,
1980 .suspend = pci_suspend,
1981#endif
1922}; 1982};
1923 1983
1924MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>"); 1984MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 68300414e5f4..a98d3915e26f 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -1108,6 +1108,58 @@ static int sbp2_scsi_abort(struct scsi_cmnd *cmd)
1108 return SUCCESS; 1108 return SUCCESS;
1109} 1109}
1110 1110
1111/*
1112 * Format of /sys/bus/scsi/devices/.../ieee1394_id:
1113 * u64 EUI-64 : u24 directory_ID : u16 LUN (all printed in hexadecimal)
1114 *
1115 * This is the concatenation of target port identifier and logical unit
1116 * identifier as per SAM-2...SAM-4 annex A.
1117 */
1118static ssize_t
1119sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_attribute *attr,
1120 char *buf)
1121{
1122 struct scsi_device *sdev = to_scsi_device(dev);
1123 struct sbp2_device *sd;
1124 struct fw_unit *unit;
1125 struct fw_device *device;
1126 u32 directory_id;
1127 struct fw_csr_iterator ci;
1128 int key, value, lun;
1129
1130 if (!sdev)
1131 return 0;
1132 sd = (struct sbp2_device *)sdev->host->hostdata;
1133 unit = sd->unit;
1134 device = fw_device(unit->device.parent);
1135
1136 /* implicit directory ID */
1137 directory_id = ((unit->directory - device->config_rom) * 4
1138 + CSR_CONFIG_ROM) & 0xffffff;
1139
1140 /* explicit directory ID, overrides implicit ID if present */
1141 fw_csr_iterator_init(&ci, unit->directory);
1142 while (fw_csr_iterator_next(&ci, &key, &value))
1143 if (key == CSR_DIRECTORY_ID) {
1144 directory_id = value;
1145 break;
1146 }
1147
1148 /* FIXME: Make this work for multi-lun devices. */
1149 lun = 0;
1150
1151 return sprintf(buf, "%08x%08x:%06x:%04x\n",
1152 device->config_rom[3], device->config_rom[4],
1153 directory_id, lun);
1154}
1155
1156static DEVICE_ATTR(ieee1394_id, S_IRUGO, sbp2_sysfs_ieee1394_id_show, NULL);
1157
1158static struct device_attribute *sbp2_scsi_sysfs_attrs[] = {
1159 &dev_attr_ieee1394_id,
1160 NULL
1161};
1162
1111static struct scsi_host_template scsi_driver_template = { 1163static struct scsi_host_template scsi_driver_template = {
1112 .module = THIS_MODULE, 1164 .module = THIS_MODULE,
1113 .name = "SBP-2 IEEE-1394", 1165 .name = "SBP-2 IEEE-1394",
@@ -1121,6 +1173,7 @@ static struct scsi_host_template scsi_driver_template = {
1121 .use_clustering = ENABLE_CLUSTERING, 1173 .use_clustering = ENABLE_CLUSTERING,
1122 .cmd_per_lun = 1, 1174 .cmd_per_lun = 1,
1123 .can_queue = 1, 1175 .can_queue = 1,
1176 .sdev_attrs = sbp2_scsi_sysfs_attrs,
1124}; 1177};
1125 1178
1126MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>"); 1179MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 4d1cb5b855d1..13eea47dceb3 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -620,7 +620,7 @@ config SENSORS_HDAPS
620 620
621config SENSORS_APPLESMC 621config SENSORS_APPLESMC
622 tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)" 622 tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)"
623 depends on HWMON && INPUT && X86 623 depends on INPUT && X86
624 select NEW_LEDS 624 select NEW_LEDS
625 select LEDS_CLASS 625 select LEDS_CLASS
626 default n 626 default n
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 0c160675b3ac..fd1281f42209 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -491,6 +491,12 @@ out:
491 491
492/* Sysfs Files */ 492/* Sysfs Files */
493 493
494static ssize_t applesmc_name_show(struct device *dev,
495 struct device_attribute *attr, char *buf)
496{
497 return snprintf(buf, PAGE_SIZE, "applesmc\n");
498}
499
494static ssize_t applesmc_position_show(struct device *dev, 500static ssize_t applesmc_position_show(struct device *dev,
495 struct device_attribute *attr, char *buf) 501 struct device_attribute *attr, char *buf)
496{ 502{
@@ -913,6 +919,8 @@ static struct led_classdev applesmc_backlight = {
913 .brightness_set = applesmc_brightness_set, 919 .brightness_set = applesmc_brightness_set,
914}; 920};
915 921
922static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL);
923
916static DEVICE_ATTR(position, 0444, applesmc_position_show, NULL); 924static DEVICE_ATTR(position, 0444, applesmc_position_show, NULL);
917static DEVICE_ATTR(calibrate, 0644, 925static DEVICE_ATTR(calibrate, 0644,
918 applesmc_calibrate_show, applesmc_calibrate_store); 926 applesmc_calibrate_show, applesmc_calibrate_store);
@@ -1197,10 +1205,14 @@ static int __init applesmc_init(void)
1197 goto out_driver; 1205 goto out_driver;
1198 } 1206 }
1199 1207
1208 ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_name.attr);
1209 if (ret)
1210 goto out_device;
1211
1200 /* Create key enumeration sysfs files */ 1212 /* Create key enumeration sysfs files */
1201 ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group); 1213 ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group);
1202 if (ret) 1214 if (ret)
1203 goto out_device; 1215 goto out_name;
1204 1216
1205 /* create fan files */ 1217 /* create fan files */
1206 count = applesmc_get_fan_count(); 1218 count = applesmc_get_fan_count();
@@ -1300,6 +1312,8 @@ out_fan_1:
1300 sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); 1312 sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]);
1301out_key_enumeration: 1313out_key_enumeration:
1302 sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); 1314 sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group);
1315out_name:
1316 sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr);
1303out_device: 1317out_device:
1304 platform_device_unregister(pdev); 1318 platform_device_unregister(pdev);
1305out_driver: 1319out_driver:
@@ -1325,6 +1339,7 @@ static void __exit applesmc_exit(void)
1325 sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); 1339 sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]);
1326 sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); 1340 sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]);
1327 sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); 1341 sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group);
1342 sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr);
1328 platform_device_unregister(pdev); 1343 platform_device_unregister(pdev);
1329 platform_driver_unregister(&applesmc_driver); 1344 platform_driver_unregister(&applesmc_driver);
1330 release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS); 1345 release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 75e3911810a3..0328382df8fa 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -176,6 +176,22 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
176 goto exit_free; 176 goto exit_free;
177 } 177 }
178 178
179 /* Check if we have problem with errata AE18 of Core processors:
180 Readings might stop update when processor visited too deep sleep,
181 fixed for stepping D0 (6EC).
182 */
183
184 if ((c->x86_model == 0xe) && (c->x86_mask < 0xc)) {
185 /* check for microcode update */
186 rdmsr_on_cpu(data->id, MSR_IA32_UCODE_REV, &eax, &edx);
187 if (edx < 0x39) {
188 dev_err(&pdev->dev,
189 "Errata AE18 not fixed, update BIOS or "
190 "microcode of the CPU!\n");
191 goto exit_free;
192 }
193 }
194
179 /* Some processors have Tjmax 85 following magic should detect it 195 /* Some processors have Tjmax 85 following magic should detect it
180 Intel won't disclose the information without signed NDA, but 196 Intel won't disclose the information without signed NDA, but
181 individuals cannot sign it. Catch(ed) 22. 197 individuals cannot sign it. Catch(ed) 22.
@@ -193,6 +209,19 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
193 } 209 }
194 } 210 }
195 211
212 /* Intel says that above should not work for desktop Core2 processors,
213 but it seems to work. There is no other way how get the absolute
214 readings. Warn the user about this. First check if are desktop,
215 bit 50 of MSR_IA32_PLATFORM_ID should be 0.
216 */
217
218 rdmsr_safe_on_cpu(data->id, MSR_IA32_PLATFORM_ID, &eax, &edx);
219
220 if ((c->x86_model == 0xf) && (!(edx & 0x00040000))) {
221 dev_warn(&pdev->dev, "Using undocumented features, absolute "
222 "temperature might be wrong!\n");
223 }
224
196 platform_set_drvdata(pdev, data); 225 platform_set_drvdata(pdev, data);
197 226
198 if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group))) 227 if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
@@ -330,9 +359,6 @@ static int __init coretemp_init(void)
330 int i, err = -ENODEV; 359 int i, err = -ENODEV;
331 struct pdev_entry *p, *n; 360 struct pdev_entry *p, *n;
332 361
333 printk(KERN_NOTICE DRVNAME ": This driver uses undocumented features "
334 "of Core CPU. Temperature might be wrong!\n");
335
336 /* quick check if we run Intel */ 362 /* quick check if we run Intel */
337 if (cpu_data[0].x86_vendor != X86_VENDOR_INTEL) 363 if (cpu_data[0].x86_vendor != X86_VENDOR_INTEL)
338 goto exit; 364 goto exit;
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
index c849c0c6ee9c..d5ac422d73b2 100644
--- a/drivers/hwmon/ds1621.c
+++ b/drivers/hwmon/ds1621.c
@@ -53,8 +53,8 @@ MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low")
53 53
54/* The DS1621 registers */ 54/* The DS1621 registers */
55#define DS1621_REG_TEMP 0xAA /* word, RO */ 55#define DS1621_REG_TEMP 0xAA /* word, RO */
56#define DS1621_REG_TEMP_MIN 0xA1 /* word, RW */ 56#define DS1621_REG_TEMP_MIN 0xA2 /* word, RW */
57#define DS1621_REG_TEMP_MAX 0xA2 /* word, RW */ 57#define DS1621_REG_TEMP_MAX 0xA1 /* word, RW */
58#define DS1621_REG_CONF 0xAC /* byte, RW */ 58#define DS1621_REG_CONF 0xAC /* byte, RW */
59#define DS1621_COM_START 0xEE /* no data */ 59#define DS1621_COM_START 0xEE /* no data */
60#define DS1621_COM_STOP 0x22 /* no data */ 60#define DS1621_COM_STOP 0x22 /* no data */
@@ -328,9 +328,9 @@ static struct ds1621_data *ds1621_update_client(struct device *dev)
328 328
329 /* reset alarms if necessary */ 329 /* reset alarms if necessary */
330 new_conf = data->conf; 330 new_conf = data->conf;
331 if (data->temp < data->temp_min) 331 if (data->temp > data->temp_min)
332 new_conf &= ~DS1621_ALARM_TEMP_LOW; 332 new_conf &= ~DS1621_ALARM_TEMP_LOW;
333 if (data->temp > data->temp_max) 333 if (data->temp < data->temp_max)
334 new_conf &= ~DS1621_ALARM_TEMP_HIGH; 334 new_conf &= ~DS1621_ALARM_TEMP_HIGH;
335 if (data->conf != new_conf) 335 if (data->conf != new_conf)
336 ds1621_write_value(client, DS1621_REG_CONF, 336 ds1621_write_value(client, DS1621_REG_CONF,
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
index 5aab23b93e24..f17e771e42f8 100644
--- a/drivers/hwmon/hwmon-vid.c
+++ b/drivers/hwmon/hwmon-vid.c
@@ -132,7 +132,9 @@ int vid_from_reg(int val, u8 vrm)
132 val &= 0x7f; 132 val &= 0x7f;
133 return(val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000); 133 return(val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000);
134 default: /* report 0 for unknown */ 134 default: /* report 0 for unknown */
135 printk(KERN_INFO "hwmon-vid: requested unknown VRM version\n"); 135 if (vrm)
136 printk(KERN_WARNING "hwmon-vid: Requested unsupported "
137 "VRM version (%u)\n", (unsigned int)vrm);
136 return 0; 138 return 0;
137 } 139 }
138} 140}
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
index a5b774b07cbd..12cb40a975de 100644
--- a/drivers/hwmon/w83627hf.c
+++ b/drivers/hwmon/w83627hf.c
@@ -965,8 +965,10 @@ static int __init w83627hf_find(int sioaddr, unsigned short *addr,
965 case W687THF_DEVID: 965 case W687THF_DEVID:
966 sio_data->type = w83687thf; 966 sio_data->type = w83687thf;
967 break; 967 break;
968 case 0xff: /* No device at all */
969 goto exit;
968 default: 970 default:
969 pr_debug(DRVNAME ": Unsupported chip (DEVID=0x%x)\n", val); 971 pr_debug(DRVNAME ": Unsupported chip (DEVID=0x%02x)\n", val);
970 goto exit; 972 goto exit;
971 } 973 }
972 974
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 8a0a99b93641..28e7b91a4553 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -837,20 +837,10 @@ static const struct i2c_algorithm i2c_pxa_algorithm = {
837 .functionality = i2c_pxa_functionality, 837 .functionality = i2c_pxa_functionality,
838}; 838};
839 839
840static struct pxa_i2c i2c_pxa = {
841 .lock = __SPIN_LOCK_UNLOCKED(i2c_pxa.lock),
842 .adap = {
843 .owner = THIS_MODULE,
844 .algo = &i2c_pxa_algorithm,
845 .name = "pxa2xx-i2c.0",
846 .retries = 5,
847 },
848};
849
850#define res_len(r) ((r)->end - (r)->start + 1) 840#define res_len(r) ((r)->end - (r)->start + 1)
851static int i2c_pxa_probe(struct platform_device *dev) 841static int i2c_pxa_probe(struct platform_device *dev)
852{ 842{
853 struct pxa_i2c *i2c = &i2c_pxa; 843 struct pxa_i2c *i2c;
854 struct resource *res; 844 struct resource *res;
855 struct i2c_pxa_platform_data *plat = dev->dev.platform_data; 845 struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
856 int ret; 846 int ret;
@@ -864,15 +854,20 @@ static int i2c_pxa_probe(struct platform_device *dev)
864 if (!request_mem_region(res->start, res_len(res), res->name)) 854 if (!request_mem_region(res->start, res_len(res), res->name))
865 return -ENOMEM; 855 return -ENOMEM;
866 856
867 i2c = kmalloc(sizeof(struct pxa_i2c), GFP_KERNEL); 857 i2c = kzalloc(sizeof(struct pxa_i2c), GFP_KERNEL);
868 if (!i2c) { 858 if (!i2c) {
869 ret = -ENOMEM; 859 ret = -ENOMEM;
870 goto emalloc; 860 goto emalloc;
871 } 861 }
872 862
873 memcpy(i2c, &i2c_pxa, sizeof(struct pxa_i2c)); 863 i2c->adap.owner = THIS_MODULE;
864 i2c->adap.algo = &i2c_pxa_algorithm;
865 i2c->adap.retries = 5;
866
867 spin_lock_init(&i2c->lock);
874 init_waitqueue_head(&i2c->wait); 868 init_waitqueue_head(&i2c->wait);
875 i2c->adap.name[strlen(i2c->adap.name) - 1] = '0' + dev->id % 10; 869
870 sprintf(i2c->adap.name, "pxa_i2c-i2c.%u", dev->id);
876 871
877 i2c->reg_base = ioremap(res->start, res_len(res)); 872 i2c->reg_base = ioremap(res->start, res_len(res));
878 if (!i2c->reg_base) { 873 if (!i2c->reg_base) {
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index e68a96f589fd..e4540fcf6476 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -830,7 +830,8 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
830 830
831 i2c->irq = res; 831 i2c->irq = res;
832 832
833 dev_dbg(&pdev->dev, "irq resource %p (%ld)\n", res, res->start); 833 dev_dbg(&pdev->dev, "irq resource %p (%lu)\n", res,
834 (unsigned long)res->start);
834 835
835 ret = i2c_add_adapter(&i2c->adap); 836 ret = i2c_add_adapter(&i2c->adap);
836 if (ret < 0) { 837 if (ret < 0) {
diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c
index 907999049d50..cb9abe7565a7 100644
--- a/drivers/i2c/busses/i2c-tiny-usb.c
+++ b/drivers/i2c/busses/i2c-tiny-usb.c
@@ -208,7 +208,7 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface,
208 dev->adapter.class = I2C_CLASS_HWMON; 208 dev->adapter.class = I2C_CLASS_HWMON;
209 dev->adapter.algo = &usb_algorithm; 209 dev->adapter.algo = &usb_algorithm;
210 dev->adapter.algo_data = dev; 210 dev->adapter.algo_data = dev;
211 snprintf(dev->adapter.name, I2C_NAME_SIZE, 211 snprintf(dev->adapter.name, sizeof(dev->adapter.name),
212 "i2c-tiny-usb at bus %03d device %03d", 212 "i2c-tiny-usb at bus %03d device %03d",
213 dev->usb_dev->bus->busnum, dev->usb_dev->devnum); 213 dev->usb_dev->bus->busnum, dev->usb_dev->devnum);
214 214
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 64f8e56d300e..435925eba437 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -697,9 +697,10 @@ int i2c_attach_client(struct i2c_client *client)
697 if (client->driver) 697 if (client->driver)
698 client->dev.driver = &client->driver->driver; 698 client->dev.driver = &client->driver->driver;
699 699
700 if (client->driver && !is_newstyle_driver(client->driver)) 700 if (client->driver && !is_newstyle_driver(client->driver)) {
701 client->dev.release = i2c_client_release; 701 client->dev.release = i2c_client_release;
702 else 702 client->dev.uevent_suppress = 1;
703 } else
703 client->dev.release = i2c_client_dev_release; 704 client->dev.release = i2c_client_dev_release;
704 705
705 snprintf(&client->dev.bus_id[0], sizeof(client->dev.bus_id), 706 snprintf(&client->dev.bus_id[0], sizeof(client->dev.bus_id),
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index b77b7d138c49..ead141e2db9e 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -119,15 +119,17 @@ static const struct drive_list_entry drive_blacklist [] = {
119 { "HITACHI CDR-8335" , "ALL" }, 119 { "HITACHI CDR-8335" , "ALL" },
120 { "HITACHI CDR-8435" , "ALL" }, 120 { "HITACHI CDR-8435" , "ALL" },
121 { "Toshiba CD-ROM XM-6202B" , "ALL" }, 121 { "Toshiba CD-ROM XM-6202B" , "ALL" },
122 { "TOSHIBA CD-ROM XM-1702BC", "ALL" },
122 { "CD-532E-A" , "ALL" }, 123 { "CD-532E-A" , "ALL" },
123 { "E-IDE CD-ROM CR-840", "ALL" }, 124 { "E-IDE CD-ROM CR-840", "ALL" },
124 { "CD-ROM Drive/F5A", "ALL" }, 125 { "CD-ROM Drive/F5A", "ALL" },
125 { "WPI CDD-820", "ALL" }, 126 { "WPI CDD-820", "ALL" },
126 { "SAMSUNG CD-ROM SC-148C", "ALL" }, 127 { "SAMSUNG CD-ROM SC-148C", "ALL" },
127 { "SAMSUNG CD-ROM SC", "ALL" }, 128 { "SAMSUNG CD-ROM SC", "ALL" },
128 { "SanDisk SDP3B-64" , "ALL" },
129 { "ATAPI CD-ROM DRIVE 40X MAXIMUM", "ALL" }, 129 { "ATAPI CD-ROM DRIVE 40X MAXIMUM", "ALL" },
130 { "_NEC DV5800A", "ALL" }, 130 { "_NEC DV5800A", "ALL" },
131 { "SAMSUNG CD-ROM SN-124", "N001" },
132 { "Seagate STT20000A", "ALL" },
131 { NULL , NULL } 133 { NULL , NULL }
132 134
133}; 135};
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index d50bd996ff22..ea94c9aa1220 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -67,6 +67,8 @@ static int proc_ide_read_imodel
67 case ide_4drives: name = "4drives"; break; 67 case ide_4drives: name = "4drives"; break;
68 case ide_pmac: name = "mac-io"; break; 68 case ide_pmac: name = "mac-io"; break;
69 case ide_au1xxx: name = "au1xxx"; break; 69 case ide_au1xxx: name = "au1xxx"; break;
70 case ide_etrax100: name = "etrax100"; break;
71 case ide_acorn: name = "acorn"; break;
70 default: name = "(unknown)"; break; 72 default: name = "(unknown)"; break;
71 } 73 }
72 len = sprintf(page, "%s\n", name); 74 len = sprintf(page, "%s\n", name);
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 0e52ad722a72..8ab33faf6f76 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -317,6 +317,7 @@ static struct pci_device_id atiixp_pci_tbl[] = {
317 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 317 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
318 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 318 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
319 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 319 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
320 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
320 { 0, }, 321 { 0, },
321}; 322};
322MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); 323MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index 6234f806c6b5..47bcd91c9b5f 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -158,6 +158,12 @@ static int svwks_tune_chipset (ide_drive_t *drive, u8 xferspeed)
158 pci_read_config_word(dev, 0x4A, &csb5_pio); 158 pci_read_config_word(dev, 0x4A, &csb5_pio);
159 pci_read_config_byte(dev, 0x54, &ultra_enable); 159 pci_read_config_byte(dev, 0x54, &ultra_enable);
160 160
161 /* If we are in RAID mode (eg AMI MegaIDE) then we can't it
162 turns out trust the firmware configuration */
163
164 if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
165 goto oem_setup_failed;
166
161 /* Per Specified Design by OEM, and ASIC Architect */ 167 /* Per Specified Design by OEM, and ASIC Architect */
162 if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || 168 if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) ||
163 (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) { 169 (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) {
@@ -173,7 +179,7 @@ dma_pio:
173 ((dma_stat&(1<<(5+unit)))==(1<<(5+unit)))) { 179 ((dma_stat&(1<<(5+unit)))==(1<<(5+unit)))) {
174 u8 dmaspeed = dma_timing; 180 u8 dmaspeed = dma_timing;
175 181
176 dma_timing &= ~0xFF; 182 dma_timing &= ~0xFFU;
177 if ((dmaspeed & 0x20) == 0x20) 183 if ((dmaspeed & 0x20) == 0x20)
178 dmaspeed = XFER_MW_DMA_2; 184 dmaspeed = XFER_MW_DMA_2;
179 else if ((dmaspeed & 0x21) == 0x21) 185 else if ((dmaspeed & 0x21) == 0x21)
@@ -187,7 +193,7 @@ dma_pio:
187 } else if (pio_timing) { 193 } else if (pio_timing) {
188 u8 piospeed = pio_timing; 194 u8 piospeed = pio_timing;
189 195
190 pio_timing &= ~0xFF; 196 pio_timing &= ~0xFFU;
191 if ((piospeed & 0x20) == 0x20) 197 if ((piospeed & 0x20) == 0x20)
192 piospeed = XFER_PIO_4; 198 piospeed = XFER_PIO_4;
193 else if ((piospeed & 0x22) == 0x22) 199 else if ((piospeed & 0x22) == 0x22)
@@ -208,8 +214,8 @@ dma_pio:
208 214
209oem_setup_failed: 215oem_setup_failed:
210 216
211 pio_timing &= ~0xFF; 217 pio_timing &= ~0xFFU;
212 dma_timing &= ~0xFF; 218 dma_timing &= ~0xFFU;
213 ultra_timing &= ~(0x0F << (4*unit)); 219 ultra_timing &= ~(0x0F << (4*unit));
214 ultra_enable &= ~(0x01 << drive->dn); 220 ultra_enable &= ~(0x01 << drive->dn);
215 csb5_pio &= ~(0x0F << (4*drive->dn)); 221 csb5_pio &= ~(0x0F << (4*drive->dn));
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index 2296d43a2414..5f026b5d7857 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -47,6 +47,7 @@
47#include <linux/types.h> 47#include <linux/types.h>
48#include <linux/delay.h> 48#include <linux/delay.h>
49#include <linux/init.h> 49#include <linux/init.h>
50#include <linux/workqueue.h>
50 51
51#include <linux/netdevice.h> 52#include <linux/netdevice.h>
52#include <linux/inetdevice.h> 53#include <linux/inetdevice.h>
@@ -235,6 +236,9 @@ static int ether1394_open(struct net_device *dev)
235/* This is called after an "ifdown" */ 236/* This is called after an "ifdown" */
236static int ether1394_stop(struct net_device *dev) 237static int ether1394_stop(struct net_device *dev)
237{ 238{
239 /* flush priv->wake */
240 flush_scheduled_work();
241
238 netif_stop_queue(dev); 242 netif_stop_queue(dev);
239 return 0; 243 return 0;
240} 244}
@@ -531,6 +535,37 @@ static void ether1394_init_dev(struct net_device *dev)
531} 535}
532 536
533/* 537/*
538 * Wake the queue up after commonly encountered transmit failure conditions are
539 * hopefully over. Currently only tlabel exhaustion is accounted for.
540 */
541static void ether1394_wake_queue(struct work_struct *work)
542{
543 struct eth1394_priv *priv;
544 struct hpsb_packet *packet;
545
546 priv = container_of(work, struct eth1394_priv, wake);
547 packet = hpsb_alloc_packet(0);
548
549 /* This is really bad, but unjam the queue anyway. */
550 if (!packet)
551 goto out;
552
553 packet->host = priv->host;
554 packet->node_id = priv->wake_node;
555 /*
556 * A transaction label is all we really want. If we get one, it almost
557 * always means we can get a lot more because the ieee1394 core recycled
558 * a whole batch of tlabels, at last.
559 */
560 if (hpsb_get_tlabel(packet) == 0)
561 hpsb_free_tlabel(packet);
562
563 hpsb_free_packet(packet);
564out:
565 netif_wake_queue(priv->wake_dev);
566}
567
568/*
534 * This function is called every time a card is found. It is generally called 569 * This function is called every time a card is found. It is generally called
535 * when the module is installed. This is where we add all of our ethernet 570 * when the module is installed. This is where we add all of our ethernet
536 * devices. One for each host. 571 * devices. One for each host.
@@ -564,16 +599,17 @@ static void ether1394_add_host(struct hpsb_host *host)
564 } 599 }
565 600
566 SET_MODULE_OWNER(dev); 601 SET_MODULE_OWNER(dev);
567#if 0 602
568 /* FIXME - Is this the correct parent device anyway? */ 603 /* This used to be &host->device in Linux 2.6.20 and before. */
569 SET_NETDEV_DEV(dev, &host->device); 604 SET_NETDEV_DEV(dev, host->device.parent);
570#endif
571 605
572 priv = netdev_priv(dev); 606 priv = netdev_priv(dev);
573 INIT_LIST_HEAD(&priv->ip_node_list); 607 INIT_LIST_HEAD(&priv->ip_node_list);
574 spin_lock_init(&priv->lock); 608 spin_lock_init(&priv->lock);
575 priv->host = host; 609 priv->host = host;
576 priv->local_fifo = fifo_addr; 610 priv->local_fifo = fifo_addr;
611 INIT_WORK(&priv->wake, ether1394_wake_queue);
612 priv->wake_dev = dev;
577 613
578 hi = hpsb_create_hostinfo(&eth1394_highlevel, host, sizeof(*hi)); 614 hi = hpsb_create_hostinfo(&eth1394_highlevel, host, sizeof(*hi));
579 if (hi == NULL) { 615 if (hi == NULL) {
@@ -1390,22 +1426,17 @@ static int ether1394_prep_write_packet(struct hpsb_packet *p,
1390 u64 addr, void *data, int tx_len) 1426 u64 addr, void *data, int tx_len)
1391{ 1427{
1392 p->node_id = node; 1428 p->node_id = node;
1393 p->data = NULL;
1394 1429
1395 p->tcode = TCODE_WRITEB; 1430 if (hpsb_get_tlabel(p))
1396 p->header[1] = host->node_id << 16 | addr >> 32; 1431 return -EAGAIN;
1397 p->header[2] = addr & 0xffffffff;
1398 1432
1433 p->tcode = TCODE_WRITEB;
1399 p->header_size = 16; 1434 p->header_size = 16;
1400 p->expect_response = 1; 1435 p->expect_response = 1;
1401
1402 if (hpsb_get_tlabel(p)) {
1403 ETH1394_PRINT_G(KERN_ERR, "Out of tlabels\n");
1404 return -1;
1405 }
1406 p->header[0] = 1436 p->header[0] =
1407 p->node_id << 16 | p->tlabel << 10 | 1 << 8 | TCODE_WRITEB << 4; 1437 p->node_id << 16 | p->tlabel << 10 | 1 << 8 | TCODE_WRITEB << 4;
1408 1438 p->header[1] = host->node_id << 16 | addr >> 32;
1439 p->header[2] = addr & 0xffffffff;
1409 p->header[3] = tx_len << 16; 1440 p->header[3] = tx_len << 16;
1410 p->data_size = (tx_len + 3) & ~3; 1441 p->data_size = (tx_len + 3) & ~3;
1411 p->data = data; 1442 p->data = data;
@@ -1451,7 +1482,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
1451 1482
1452 packet = ether1394_alloc_common_packet(priv->host); 1483 packet = ether1394_alloc_common_packet(priv->host);
1453 if (!packet) 1484 if (!packet)
1454 return -1; 1485 return -ENOMEM;
1455 1486
1456 if (ptask->tx_type == ETH1394_GASP) { 1487 if (ptask->tx_type == ETH1394_GASP) {
1457 int length = tx_len + 2 * sizeof(quadlet_t); 1488 int length = tx_len + 2 * sizeof(quadlet_t);
@@ -1462,7 +1493,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
1462 ptask->addr, ptask->skb->data, 1493 ptask->addr, ptask->skb->data,
1463 tx_len)) { 1494 tx_len)) {
1464 hpsb_free_packet(packet); 1495 hpsb_free_packet(packet);
1465 return -1; 1496 return -EAGAIN;
1466 } 1497 }
1467 1498
1468 ptask->packet = packet; 1499 ptask->packet = packet;
@@ -1471,7 +1502,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
1471 1502
1472 if (hpsb_send_packet(packet) < 0) { 1503 if (hpsb_send_packet(packet) < 0) {
1473 ether1394_free_packet(packet); 1504 ether1394_free_packet(packet);
1474 return -1; 1505 return -EIO;
1475 } 1506 }
1476 1507
1477 return 0; 1508 return 0;
@@ -1514,13 +1545,18 @@ static void ether1394_complete_cb(void *__ptask)
1514 1545
1515 ptask->outstanding_pkts--; 1546 ptask->outstanding_pkts--;
1516 if (ptask->outstanding_pkts > 0 && !fail) { 1547 if (ptask->outstanding_pkts > 0 && !fail) {
1517 int tx_len; 1548 int tx_len, err;
1518 1549
1519 /* Add the encapsulation header to the fragment */ 1550 /* Add the encapsulation header to the fragment */
1520 tx_len = ether1394_encapsulate(ptask->skb, ptask->max_payload, 1551 tx_len = ether1394_encapsulate(ptask->skb, ptask->max_payload,
1521 &ptask->hdr); 1552 &ptask->hdr);
1522 if (ether1394_send_packet(ptask, tx_len)) 1553 err = ether1394_send_packet(ptask, tx_len);
1554 if (err) {
1555 if (err == -EAGAIN)
1556 ETH1394_PRINT_G(KERN_ERR, "Out of tlabels\n");
1557
1523 ether1394_dg_complete(ptask, 1); 1558 ether1394_dg_complete(ptask, 1);
1559 }
1524 } else { 1560 } else {
1525 ether1394_dg_complete(ptask, fail); 1561 ether1394_dg_complete(ptask, fail);
1526 } 1562 }
@@ -1633,10 +1669,18 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
1633 /* Add the encapsulation header to the fragment */ 1669 /* Add the encapsulation header to the fragment */
1634 tx_len = ether1394_encapsulate(skb, max_payload, &ptask->hdr); 1670 tx_len = ether1394_encapsulate(skb, max_payload, &ptask->hdr);
1635 dev->trans_start = jiffies; 1671 dev->trans_start = jiffies;
1636 if (ether1394_send_packet(ptask, tx_len)) 1672 if (ether1394_send_packet(ptask, tx_len)) {
1637 goto fail; 1673 if (dest_node == (LOCAL_BUS | ALL_NODES))
1674 goto fail;
1675
1676 /* Most failures of ether1394_send_packet are recoverable. */
1677 netif_stop_queue(dev);
1678 priv->wake_node = dest_node;
1679 schedule_work(&priv->wake);
1680 kmem_cache_free(packet_task_cache, ptask);
1681 return NETDEV_TX_BUSY;
1682 }
1638 1683
1639 netif_wake_queue(dev);
1640 return NETDEV_TX_OK; 1684 return NETDEV_TX_OK;
1641fail: 1685fail:
1642 if (ptask) 1686 if (ptask)
@@ -1650,9 +1694,6 @@ fail:
1650 priv->stats.tx_errors++; 1694 priv->stats.tx_errors++;
1651 spin_unlock_irqrestore(&priv->lock, flags); 1695 spin_unlock_irqrestore(&priv->lock, flags);
1652 1696
1653 if (netif_queue_stopped(dev))
1654 netif_wake_queue(dev);
1655
1656 /* 1697 /*
1657 * FIXME: According to a patch from 2003-02-26, "returning non-zero 1698 * FIXME: According to a patch from 2003-02-26, "returning non-zero
1658 * causes serious problems" here, allegedly. Before that patch, 1699 * causes serious problems" here, allegedly. Before that patch,
diff --git a/drivers/ieee1394/eth1394.h b/drivers/ieee1394/eth1394.h
index a3439ee7cb4e..4f3e2dd46f00 100644
--- a/drivers/ieee1394/eth1394.h
+++ b/drivers/ieee1394/eth1394.h
@@ -66,6 +66,10 @@ struct eth1394_priv {
66 int bc_dgl; /* Outgoing broadcast datagram label */ 66 int bc_dgl; /* Outgoing broadcast datagram label */
67 struct list_head ip_node_list; /* List of IP capable nodes */ 67 struct list_head ip_node_list; /* List of IP capable nodes */
68 struct unit_directory *ud_list[ALL_NODES]; /* Cached unit dir list */ 68 struct unit_directory *ud_list[ALL_NODES]; /* Cached unit dir list */
69
70 struct work_struct wake; /* Wake up after xmit failure */
71 struct net_device *wake_dev; /* Stupid backlink for .wake */
72 nodeid_t wake_node; /* Destination of failed xmit */
69}; 73};
70 74
71 75
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 835937e38529..81b3864d2ba7 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -976,7 +976,8 @@ static struct unit_directory *nodemgr_process_unit_directory
976 976
977 ud->ne = ne; 977 ud->ne = ne;
978 ud->ignore_driver = ignore_drivers; 978 ud->ignore_driver = ignore_drivers;
979 ud->address = ud_kv->offset + CSR1212_CONFIG_ROM_SPACE_BASE; 979 ud->address = ud_kv->offset + CSR1212_REGISTER_SPACE_BASE;
980 ud->directory_id = ud->address & 0xffffff;
980 ud->ud_kv = ud_kv; 981 ud->ud_kv = ud_kv;
981 ud->id = (*id)++; 982 ud->id = (*id)++;
982 983
@@ -1085,6 +1086,10 @@ static struct unit_directory *nodemgr_process_unit_directory
1085 1086
1086 break; 1087 break;
1087 1088
1089 case CSR1212_KV_ID_DIRECTORY_ID:
1090 ud->directory_id = kv->value.immediate;
1091 break;
1092
1088 default: 1093 default:
1089 break; 1094 break;
1090 } 1095 }
diff --git a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h
index e7ac683c72c7..4530b29d941c 100644
--- a/drivers/ieee1394/nodemgr.h
+++ b/drivers/ieee1394/nodemgr.h
@@ -75,6 +75,7 @@ struct unit_directory {
75 struct csr1212_keyval *model_name_kv; 75 struct csr1212_keyval *model_name_kv;
76 quadlet_t specifier_id; 76 quadlet_t specifier_id;
77 quadlet_t version; 77 quadlet_t version;
78 quadlet_t directory_id;
78 79
79 unsigned int id; 80 unsigned int id;
80 81
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index d382500f4210..f1d05eeb9f51 100644
--- a/drivers/ieee1394/raw1394.c
+++ b/drivers/ieee1394/raw1394.c
@@ -936,6 +936,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
936 struct hpsb_packet *packet; 936 struct hpsb_packet *packet;
937 int header_length = req->req.misc & 0xffff; 937 int header_length = req->req.misc & 0xffff;
938 int expect_response = req->req.misc >> 16; 938 int expect_response = req->req.misc >> 16;
939 size_t data_size;
939 940
940 if (header_length > req->req.length || header_length < 12 || 941 if (header_length > req->req.length || header_length < 12 ||
941 header_length > FIELD_SIZEOF(struct hpsb_packet, header)) { 942 header_length > FIELD_SIZEOF(struct hpsb_packet, header)) {
@@ -945,7 +946,8 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
945 return sizeof(struct raw1394_request); 946 return sizeof(struct raw1394_request);
946 } 947 }
947 948
948 packet = hpsb_alloc_packet(req->req.length - header_length); 949 data_size = req->req.length - header_length;
950 packet = hpsb_alloc_packet(data_size);
949 req->packet = packet; 951 req->packet = packet;
950 if (!packet) 952 if (!packet)
951 return -ENOMEM; 953 return -ENOMEM;
@@ -960,7 +962,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
960 962
961 if (copy_from_user 963 if (copy_from_user
962 (packet->data, int2ptr(req->req.sendb) + header_length, 964 (packet->data, int2ptr(req->req.sendb) + header_length,
963 packet->data_size)) { 965 data_size)) {
964 req->req.error = RAW1394_ERROR_MEMFAULT; 966 req->req.error = RAW1394_ERROR_MEMFAULT;
965 req->req.length = 0; 967 req->req.length = 0;
966 queue_complete_req(req); 968 queue_complete_req(req);
@@ -974,7 +976,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
974 packet->host = fi->host; 976 packet->host = fi->host;
975 packet->expect_response = expect_response; 977 packet->expect_response = expect_response;
976 packet->header_size = header_length; 978 packet->header_size = header_length;
977 packet->data_size = req->req.length - header_length; 979 packet->data_size = data_size;
978 980
979 req->req.length = 0; 981 req->req.length = 0;
980 hpsb_set_packet_complete_task(packet, 982 hpsb_set_packet_complete_task(packet,
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 4cb6fa2bcfb7..3f873cc7e247 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -70,6 +70,7 @@
70#include <linux/stringify.h> 70#include <linux/stringify.h>
71#include <linux/types.h> 71#include <linux/types.h>
72#include <linux/wait.h> 72#include <linux/wait.h>
73#include <linux/workqueue.h>
73 74
74#include <asm/byteorder.h> 75#include <asm/byteorder.h>
75#include <asm/errno.h> 76#include <asm/errno.h>
@@ -193,6 +194,27 @@ MODULE_PARM_DESC(workarounds, "Work around device bugs (default = 0"
193 ", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE) 194 ", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE)
194 ", or a combination)"); 195 ", or a combination)");
195 196
197/*
198 * This influences the format of the sysfs attribute
199 * /sys/bus/scsi/devices/.../ieee1394_id.
200 *
201 * The default format is like in older kernels: %016Lx:%d:%d
202 * It contains the target's EUI-64, a number given to the logical unit by
203 * the ieee1394 driver's nodemgr (starting at 0), and the LUN.
204 *
205 * The long format is: %016Lx:%06x:%04x
206 * It contains the target's EUI-64, the unit directory's directory_ID as per
207 * IEEE 1212 clause 7.7.19, and the LUN. This format comes closest to the
208 * format of SBP(-3) target port and logical unit identifier as per SAM (SCSI
209 * Architecture Model) rev.2 to 4 annex A. Therefore and because it is
210 * independent of the implementation of the ieee1394 nodemgr, the longer format
211 * is recommended for future use.
212 */
213static int sbp2_long_sysfs_ieee1394_id;
214module_param_named(long_ieee1394_id, sbp2_long_sysfs_ieee1394_id, bool, 0644);
215MODULE_PARM_DESC(long_ieee1394_id, "8+3+2 bytes format of ieee1394_id in sysfs "
216 "(default = backwards-compatible = N, SAM-conforming = Y)");
217
196 218
197#define SBP2_INFO(fmt, args...) HPSB_INFO("sbp2: "fmt, ## args) 219#define SBP2_INFO(fmt, args...) HPSB_INFO("sbp2: "fmt, ## args)
198#define SBP2_ERR(fmt, args...) HPSB_ERR("sbp2: "fmt, ## args) 220#define SBP2_ERR(fmt, args...) HPSB_ERR("sbp2: "fmt, ## args)
@@ -2099,8 +2121,14 @@ static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev,
2099 if (!(lu = (struct sbp2_lu *)sdev->host->hostdata[0])) 2121 if (!(lu = (struct sbp2_lu *)sdev->host->hostdata[0]))
2100 return 0; 2122 return 0;
2101 2123
2102 return sprintf(buf, "%016Lx:%d:%d\n", (unsigned long long)lu->ne->guid, 2124 if (sbp2_long_sysfs_ieee1394_id)
2103 lu->ud->id, ORB_SET_LUN(lu->lun)); 2125 return sprintf(buf, "%016Lx:%06x:%04x\n",
2126 (unsigned long long)lu->ne->guid,
2127 lu->ud->directory_id, ORB_SET_LUN(lu->lun));
2128 else
2129 return sprintf(buf, "%016Lx:%d:%d\n",
2130 (unsigned long long)lu->ne->guid,
2131 lu->ud->id, ORB_SET_LUN(lu->lun));
2104} 2132}
2105 2133
2106MODULE_AUTHOR("Ben Collins <bcollins@debian.org>"); 2134MODULE_AUTHOR("Ben Collins <bcollins@debian.org>");
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 558c9a0fc8b9..e85f7013de57 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -38,6 +38,7 @@
38#include <linux/module.h> 38#include <linux/module.h>
39#include <linux/errno.h> 39#include <linux/errno.h>
40#include <linux/slab.h> 40#include <linux/slab.h>
41#include <linux/workqueue.h>
41 42
42#include <rdma/ib_cache.h> 43#include <rdma/ib_cache.h>
43 44
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index eff591deeb46..40c004a2697e 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -306,7 +306,9 @@ static int cm_alloc_id(struct cm_id_private *cm_id_priv)
306 do { 306 do {
307 spin_lock_irqsave(&cm.lock, flags); 307 spin_lock_irqsave(&cm.lock, flags);
308 ret = idr_get_new_above(&cm.local_id_table, cm_id_priv, 308 ret = idr_get_new_above(&cm.local_id_table, cm_id_priv,
309 next_id++, &id); 309 next_id, &id);
310 if (!ret)
311 next_id = ((unsigned) id + 1) & MAX_ID_MASK;
310 spin_unlock_irqrestore(&cm.lock, flags); 312 spin_unlock_irqrestore(&cm.lock, flags);
311 } while( (ret == -EAGAIN) && idr_pre_get(&cm.local_id_table, GFP_KERNEL) ); 313 } while( (ret == -EAGAIN) && idr_pre_get(&cm.local_id_table, GFP_KERNEL) );
312 314
@@ -1295,26 +1297,29 @@ static struct cm_id_private * cm_match_req(struct cm_work *work,
1295 1297
1296 req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad; 1298 req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad;
1297 1299
1298 /* Check for duplicate REQ and stale connections. */ 1300 /* Check for possible duplicate REQ. */
1299 spin_lock_irqsave(&cm.lock, flags); 1301 spin_lock_irqsave(&cm.lock, flags);
1300 timewait_info = cm_insert_remote_id(cm_id_priv->timewait_info); 1302 timewait_info = cm_insert_remote_id(cm_id_priv->timewait_info);
1301 if (!timewait_info)
1302 timewait_info = cm_insert_remote_qpn(cm_id_priv->timewait_info);
1303
1304 if (timewait_info) { 1303 if (timewait_info) {
1305 cur_cm_id_priv = cm_get_id(timewait_info->work.local_id, 1304 cur_cm_id_priv = cm_get_id(timewait_info->work.local_id,
1306 timewait_info->work.remote_id); 1305 timewait_info->work.remote_id);
1307 cm_cleanup_timewait(cm_id_priv->timewait_info);
1308 spin_unlock_irqrestore(&cm.lock, flags); 1306 spin_unlock_irqrestore(&cm.lock, flags);
1309 if (cur_cm_id_priv) { 1307 if (cur_cm_id_priv) {
1310 cm_dup_req_handler(work, cur_cm_id_priv); 1308 cm_dup_req_handler(work, cur_cm_id_priv);
1311 cm_deref_id(cur_cm_id_priv); 1309 cm_deref_id(cur_cm_id_priv);
1312 } else 1310 }
1313 cm_issue_rej(work->port, work->mad_recv_wc, 1311 return NULL;
1314 IB_CM_REJ_STALE_CONN, CM_MSG_RESPONSE_REQ, 1312 }
1315 NULL, 0); 1313
1316 listen_cm_id_priv = NULL; 1314 /* Check for stale connections. */
1317 goto out; 1315 timewait_info = cm_insert_remote_qpn(cm_id_priv->timewait_info);
1316 if (timewait_info) {
1317 cm_cleanup_timewait(cm_id_priv->timewait_info);
1318 spin_unlock_irqrestore(&cm.lock, flags);
1319 cm_issue_rej(work->port, work->mad_recv_wc,
1320 IB_CM_REJ_STALE_CONN, CM_MSG_RESPONSE_REQ,
1321 NULL, 0);
1322 return NULL;
1318 } 1323 }
1319 1324
1320 /* Find matching listen request. */ 1325 /* Find matching listen request. */
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 592c90aa3183..3ada17c0f239 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -40,6 +40,7 @@
40#include <linux/slab.h> 40#include <linux/slab.h>
41#include <linux/init.h> 41#include <linux/init.h>
42#include <linux/mutex.h> 42#include <linux/mutex.h>
43#include <linux/workqueue.h>
43 44
44#include "core_priv.h" 45#include "core_priv.h"
45 46
@@ -149,6 +150,18 @@ static int alloc_name(char *name)
149 return 0; 150 return 0;
150} 151}
151 152
153static int start_port(struct ib_device *device)
154{
155 return (device->node_type == RDMA_NODE_IB_SWITCH) ? 0 : 1;
156}
157
158
159static int end_port(struct ib_device *device)
160{
161 return (device->node_type == RDMA_NODE_IB_SWITCH) ?
162 0 : device->phys_port_cnt;
163}
164
152/** 165/**
153 * ib_alloc_device - allocate an IB device struct 166 * ib_alloc_device - allocate an IB device struct
154 * @size:size of structure to allocate 167 * @size:size of structure to allocate
@@ -208,6 +221,45 @@ static int add_client_context(struct ib_device *device, struct ib_client *client
208 return 0; 221 return 0;
209} 222}
210 223
224static int read_port_table_lengths(struct ib_device *device)
225{
226 struct ib_port_attr *tprops = NULL;
227 int num_ports, ret = -ENOMEM;
228 u8 port_index;
229
230 tprops = kmalloc(sizeof *tprops, GFP_KERNEL);
231 if (!tprops)
232 goto out;
233
234 num_ports = end_port(device) - start_port(device) + 1;
235
236 device->pkey_tbl_len = kmalloc(sizeof *device->pkey_tbl_len * num_ports,
237 GFP_KERNEL);
238 device->gid_tbl_len = kmalloc(sizeof *device->gid_tbl_len * num_ports,
239 GFP_KERNEL);
240 if (!device->pkey_tbl_len || !device->gid_tbl_len)
241 goto err;
242
243 for (port_index = 0; port_index < num_ports; ++port_index) {
244 ret = ib_query_port(device, port_index + start_port(device),
245 tprops);
246 if (ret)
247 goto err;
248 device->pkey_tbl_len[port_index] = tprops->pkey_tbl_len;
249 device->gid_tbl_len[port_index] = tprops->gid_tbl_len;
250 }
251
252 ret = 0;
253 goto out;
254
255err:
256 kfree(device->gid_tbl_len);
257 kfree(device->pkey_tbl_len);
258out:
259 kfree(tprops);
260 return ret;
261}
262
211/** 263/**
212 * ib_register_device - Register an IB device with IB core 264 * ib_register_device - Register an IB device with IB core
213 * @device:Device to register 265 * @device:Device to register
@@ -239,10 +291,19 @@ int ib_register_device(struct ib_device *device)
239 spin_lock_init(&device->event_handler_lock); 291 spin_lock_init(&device->event_handler_lock);
240 spin_lock_init(&device->client_data_lock); 292 spin_lock_init(&device->client_data_lock);
241 293
294 ret = read_port_table_lengths(device);
295 if (ret) {
296 printk(KERN_WARNING "Couldn't create table lengths cache for device %s\n",
297 device->name);
298 goto out;
299 }
300
242 ret = ib_device_register_sysfs(device); 301 ret = ib_device_register_sysfs(device);
243 if (ret) { 302 if (ret) {
244 printk(KERN_WARNING "Couldn't register device %s with driver model\n", 303 printk(KERN_WARNING "Couldn't register device %s with driver model\n",
245 device->name); 304 device->name);
305 kfree(device->gid_tbl_len);
306 kfree(device->pkey_tbl_len);
246 goto out; 307 goto out;
247 } 308 }
248 309
@@ -284,6 +345,9 @@ void ib_unregister_device(struct ib_device *device)
284 345
285 list_del(&device->core_list); 346 list_del(&device->core_list);
286 347
348 kfree(device->gid_tbl_len);
349 kfree(device->pkey_tbl_len);
350
287 mutex_unlock(&device_mutex); 351 mutex_unlock(&device_mutex);
288 352
289 spin_lock_irqsave(&device->client_data_lock, flags); 353 spin_lock_irqsave(&device->client_data_lock, flags);
@@ -506,10 +570,7 @@ int ib_query_port(struct ib_device *device,
506 u8 port_num, 570 u8 port_num,
507 struct ib_port_attr *port_attr) 571 struct ib_port_attr *port_attr)
508{ 572{
509 if (device->node_type == RDMA_NODE_IB_SWITCH) { 573 if (port_num < start_port(device) || port_num > end_port(device))
510 if (port_num)
511 return -EINVAL;
512 } else if (port_num < 1 || port_num > device->phys_port_cnt)
513 return -EINVAL; 574 return -EINVAL;
514 575
515 return device->query_port(device, port_num, port_attr); 576 return device->query_port(device, port_num, port_attr);
@@ -581,10 +642,7 @@ int ib_modify_port(struct ib_device *device,
581 u8 port_num, int port_modify_mask, 642 u8 port_num, int port_modify_mask,
582 struct ib_port_modify *port_modify) 643 struct ib_port_modify *port_modify)
583{ 644{
584 if (device->node_type == RDMA_NODE_IB_SWITCH) { 645 if (port_num < start_port(device) || port_num > end_port(device))
585 if (port_num)
586 return -EINVAL;
587 } else if (port_num < 1 || port_num > device->phys_port_cnt)
588 return -EINVAL; 646 return -EINVAL;
589 647
590 return device->modify_port(device, port_num, port_modify_mask, 648 return device->modify_port(device, port_num, port_modify_mask,
@@ -592,6 +650,68 @@ int ib_modify_port(struct ib_device *device,
592} 650}
593EXPORT_SYMBOL(ib_modify_port); 651EXPORT_SYMBOL(ib_modify_port);
594 652
653/**
654 * ib_find_gid - Returns the port number and GID table index where
655 * a specified GID value occurs.
656 * @device: The device to query.
657 * @gid: The GID value to search for.
658 * @port_num: The port number of the device where the GID value was found.
659 * @index: The index into the GID table where the GID was found. This
660 * parameter may be NULL.
661 */
662int ib_find_gid(struct ib_device *device, union ib_gid *gid,
663 u8 *port_num, u16 *index)
664{
665 union ib_gid tmp_gid;
666 int ret, port, i;
667
668 for (port = start_port(device); port <= end_port(device); ++port) {
669 for (i = 0; i < device->gid_tbl_len[port - start_port(device)]; ++i) {
670 ret = ib_query_gid(device, port, i, &tmp_gid);
671 if (ret)
672 return ret;
673 if (!memcmp(&tmp_gid, gid, sizeof *gid)) {
674 *port_num = port;
675 if (index)
676 *index = i;
677 return 0;
678 }
679 }
680 }
681
682 return -ENOENT;
683}
684EXPORT_SYMBOL(ib_find_gid);
685
686/**
687 * ib_find_pkey - Returns the PKey table index where a specified
688 * PKey value occurs.
689 * @device: The device to query.
690 * @port_num: The port number of the device to search for the PKey.
691 * @pkey: The PKey value to search for.
692 * @index: The index into the PKey table where the PKey was found.
693 */
694int ib_find_pkey(struct ib_device *device,
695 u8 port_num, u16 pkey, u16 *index)
696{
697 int ret, i;
698 u16 tmp_pkey;
699
700 for (i = 0; i < device->pkey_tbl_len[port_num - start_port(device)]; ++i) {
701 ret = ib_query_pkey(device, port_num, i, &tmp_pkey);
702 if (ret)
703 return ret;
704
705 if (pkey == tmp_pkey) {
706 *index = i;
707 return 0;
708 }
709 }
710
711 return -ENOENT;
712}
713EXPORT_SYMBOL(ib_find_pkey);
714
595static int __init ib_core_init(void) 715static int __init ib_core_init(void)
596{ 716{
597 int ret; 717 int ret;
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index f32ca5fbb26b..b4aec5103c99 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -36,6 +36,7 @@
36 36
37#include <linux/mm.h> 37#include <linux/mm.h>
38#include <linux/dma-mapping.h> 38#include <linux/dma-mapping.h>
39#include <linux/sched.h>
39 40
40#include "uverbs.h" 41#include "uverbs.h"
41 42
@@ -209,8 +210,10 @@ void ib_umem_release(struct ib_umem *umem)
209 __ib_umem_release(umem->context->device, umem, 1); 210 __ib_umem_release(umem->context->device, umem, 1);
210 211
211 mm = get_task_mm(current); 212 mm = get_task_mm(current);
212 if (!mm) 213 if (!mm) {
214 kfree(umem);
213 return; 215 return;
216 }
214 217
215 diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT; 218 diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT;
216 219
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c
index 84c5bb498563..add79bd44e39 100644
--- a/drivers/infiniband/hw/ehca/ehca_mrmw.c
+++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c
@@ -2050,13 +2050,10 @@ int ehca_mrmw_map_hrc_alloc(const u64 hipz_rc)
2050 switch (hipz_rc) { 2050 switch (hipz_rc) {
2051 case H_SUCCESS: /* successful completion */ 2051 case H_SUCCESS: /* successful completion */
2052 return 0; 2052 return 0;
2053 case H_ADAPTER_PARM: /* invalid adapter handle */
2054 case H_RT_PARM: /* invalid resource type */
2055 case H_NOT_ENOUGH_RESOURCES: /* insufficient resources */ 2053 case H_NOT_ENOUGH_RESOURCES: /* insufficient resources */
2056 case H_MLENGTH_PARM: /* invalid memory length */
2057 case H_MEM_ACCESS_PARM: /* invalid access controls */
2058 case H_CONSTRAINED: /* resource constraint */ 2054 case H_CONSTRAINED: /* resource constraint */
2059 return -EINVAL; 2055 case H_NO_MEM:
2056 return -ENOMEM;
2060 case H_BUSY: /* long busy */ 2057 case H_BUSY: /* long busy */
2061 return -EBUSY; 2058 return -EBUSY;
2062 default: 2059 default:
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c
index 7f0beec74f70..5766ae3a2029 100644
--- a/drivers/infiniband/hw/ehca/hcp_if.c
+++ b/drivers/infiniband/hw/ehca/hcp_if.c
@@ -331,7 +331,7 @@ u64 hipz_h_alloc_resource_qp(const struct ipz_adapter_handle adapter_handle,
331 0); 331 0);
332 qp->ipz_qp_handle.handle = outs[0]; 332 qp->ipz_qp_handle.handle = outs[0];
333 qp->real_qp_num = (u32)outs[1]; 333 qp->real_qp_num = (u32)outs[1];
334 parms->act_nr_send_sges = 334 parms->act_nr_send_wqes =
335 (u16)EHCA_BMASK_GET(H_ALL_RES_QP_ACT_OUTST_SEND_WR, outs[2]); 335 (u16)EHCA_BMASK_GET(H_ALL_RES_QP_ACT_OUTST_SEND_WR, outs[2]);
336 parms->act_nr_recv_wqes = 336 parms->act_nr_recv_wqes =
337 (u16)EHCA_BMASK_GET(H_ALL_RES_QP_ACT_OUTST_RECV_WR, outs[2]); 337 (u16)EHCA_BMASK_GET(H_ALL_RES_QP_ACT_OUTST_RECV_WR, outs[2]);
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c b/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c
index 085e28b939ec..dd691cfa5079 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c
@@ -165,10 +165,9 @@ static int ipath_mcast_add(struct ipath_ibdev *dev,
165{ 165{
166 struct rb_node **n = &mcast_tree.rb_node; 166 struct rb_node **n = &mcast_tree.rb_node;
167 struct rb_node *pn = NULL; 167 struct rb_node *pn = NULL;
168 unsigned long flags;
169 int ret; 168 int ret;
170 169
171 spin_lock_irqsave(&mcast_lock, flags); 170 spin_lock_irq(&mcast_lock);
172 171
173 while (*n) { 172 while (*n) {
174 struct ipath_mcast *tmcast; 173 struct ipath_mcast *tmcast;
@@ -228,7 +227,7 @@ static int ipath_mcast_add(struct ipath_ibdev *dev,
228 ret = 0; 227 ret = 0;
229 228
230bail: 229bail:
231 spin_unlock_irqrestore(&mcast_lock, flags); 230 spin_unlock_irq(&mcast_lock);
232 231
233 return ret; 232 return ret;
234} 233}
@@ -289,17 +288,16 @@ int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
289 struct ipath_mcast *mcast = NULL; 288 struct ipath_mcast *mcast = NULL;
290 struct ipath_mcast_qp *p, *tmp; 289 struct ipath_mcast_qp *p, *tmp;
291 struct rb_node *n; 290 struct rb_node *n;
292 unsigned long flags;
293 int last = 0; 291 int last = 0;
294 int ret; 292 int ret;
295 293
296 spin_lock_irqsave(&mcast_lock, flags); 294 spin_lock_irq(&mcast_lock);
297 295
298 /* Find the GID in the mcast table. */ 296 /* Find the GID in the mcast table. */
299 n = mcast_tree.rb_node; 297 n = mcast_tree.rb_node;
300 while (1) { 298 while (1) {
301 if (n == NULL) { 299 if (n == NULL) {
302 spin_unlock_irqrestore(&mcast_lock, flags); 300 spin_unlock_irq(&mcast_lock);
303 ret = -EINVAL; 301 ret = -EINVAL;
304 goto bail; 302 goto bail;
305 } 303 }
@@ -334,7 +332,7 @@ int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
334 break; 332 break;
335 } 333 }
336 334
337 spin_unlock_irqrestore(&mcast_lock, flags); 335 spin_unlock_irq(&mcast_lock);
338 336
339 if (p) { 337 if (p) {
340 /* 338 /*
@@ -348,9 +346,9 @@ int ipath_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
348 atomic_dec(&mcast->refcount); 346 atomic_dec(&mcast->refcount);
349 wait_event(mcast->wait, !atomic_read(&mcast->refcount)); 347 wait_event(mcast->wait, !atomic_read(&mcast->refcount));
350 ipath_mcast_free(mcast); 348 ipath_mcast_free(mcast);
351 spin_lock(&dev->n_mcast_grps_lock); 349 spin_lock_irq(&dev->n_mcast_grps_lock);
352 dev->n_mcast_grps_allocated--; 350 dev->n_mcast_grps_allocated--;
353 spin_unlock(&dev->n_mcast_grps_lock); 351 spin_unlock_irq(&dev->n_mcast_grps_lock);
354 } 352 }
355 353
356 ret = 0; 354 ret = 0;
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 5cd706908450..dc137dec2308 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -188,14 +188,32 @@ static int send_wqe_overhead(enum ib_qp_type type)
188 } 188 }
189} 189}
190 190
191static int set_qp_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap, 191static int set_rq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
192 enum ib_qp_type type, struct mlx4_ib_qp *qp) 192 struct mlx4_ib_qp *qp)
193{ 193{
194 /* Sanity check QP size before proceeding */ 194 /* Sanity check RQ size before proceeding */
195 if (cap->max_recv_wr > dev->dev->caps.max_wqes ||
196 cap->max_recv_sge > dev->dev->caps.max_rq_sg)
197 return -EINVAL;
198
199 qp->rq.max = cap->max_recv_wr ? roundup_pow_of_two(cap->max_recv_wr) : 0;
200
201 qp->rq.wqe_shift = ilog2(roundup_pow_of_two(cap->max_recv_sge *
202 sizeof (struct mlx4_wqe_data_seg)));
203 qp->rq.max_gs = (1 << qp->rq.wqe_shift) / sizeof (struct mlx4_wqe_data_seg);
204
205 cap->max_recv_wr = qp->rq.max;
206 cap->max_recv_sge = qp->rq.max_gs;
207
208 return 0;
209}
210
211static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
212 enum ib_qp_type type, struct mlx4_ib_qp *qp)
213{
214 /* Sanity check SQ size before proceeding */
195 if (cap->max_send_wr > dev->dev->caps.max_wqes || 215 if (cap->max_send_wr > dev->dev->caps.max_wqes ||
196 cap->max_recv_wr > dev->dev->caps.max_wqes ||
197 cap->max_send_sge > dev->dev->caps.max_sq_sg || 216 cap->max_send_sge > dev->dev->caps.max_sq_sg ||
198 cap->max_recv_sge > dev->dev->caps.max_rq_sg ||
199 cap->max_inline_data + send_wqe_overhead(type) + 217 cap->max_inline_data + send_wqe_overhead(type) +
200 sizeof (struct mlx4_wqe_inline_seg) > dev->dev->caps.max_sq_desc_sz) 218 sizeof (struct mlx4_wqe_inline_seg) > dev->dev->caps.max_sq_desc_sz)
201 return -EINVAL; 219 return -EINVAL;
@@ -208,12 +226,7 @@ static int set_qp_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
208 cap->max_send_sge + 2 > dev->dev->caps.max_sq_sg) 226 cap->max_send_sge + 2 > dev->dev->caps.max_sq_sg)
209 return -EINVAL; 227 return -EINVAL;
210 228
211 qp->rq.max = cap->max_recv_wr ? roundup_pow_of_two(cap->max_recv_wr) : 0; 229 qp->sq.max = cap->max_send_wr ? roundup_pow_of_two(cap->max_send_wr) : 1;
212 qp->sq.max = cap->max_send_wr ? roundup_pow_of_two(cap->max_send_wr) : 0;
213
214 qp->rq.wqe_shift = ilog2(roundup_pow_of_two(cap->max_recv_sge *
215 sizeof (struct mlx4_wqe_data_seg)));
216 qp->rq.max_gs = (1 << qp->rq.wqe_shift) / sizeof (struct mlx4_wqe_data_seg);
217 230
218 qp->sq.wqe_shift = ilog2(roundup_pow_of_two(max(cap->max_send_sge * 231 qp->sq.wqe_shift = ilog2(roundup_pow_of_two(max(cap->max_send_sge *
219 sizeof (struct mlx4_wqe_data_seg), 232 sizeof (struct mlx4_wqe_data_seg),
@@ -233,23 +246,31 @@ static int set_qp_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
233 qp->sq.offset = 0; 246 qp->sq.offset = 0;
234 } 247 }
235 248
236 cap->max_send_wr = qp->sq.max; 249 cap->max_send_wr = qp->sq.max;
237 cap->max_recv_wr = qp->rq.max; 250 cap->max_send_sge = qp->sq.max_gs;
238 cap->max_send_sge = qp->sq.max_gs;
239 cap->max_recv_sge = qp->rq.max_gs;
240 cap->max_inline_data = (1 << qp->sq.wqe_shift) - send_wqe_overhead(type) - 251 cap->max_inline_data = (1 << qp->sq.wqe_shift) - send_wqe_overhead(type) -
241 sizeof (struct mlx4_wqe_inline_seg); 252 sizeof (struct mlx4_wqe_inline_seg);
242 253
243 return 0; 254 return 0;
244} 255}
245 256
257static int set_user_sq_size(struct mlx4_ib_qp *qp,
258 struct mlx4_ib_create_qp *ucmd)
259{
260 qp->sq.max = 1 << ucmd->log_sq_bb_count;
261 qp->sq.wqe_shift = ucmd->log_sq_stride;
262
263 qp->buf_size = (qp->rq.max << qp->rq.wqe_shift) +
264 (qp->sq.max << qp->sq.wqe_shift);
265
266 return 0;
267}
268
246static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd, 269static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
247 struct ib_qp_init_attr *init_attr, 270 struct ib_qp_init_attr *init_attr,
248 struct ib_udata *udata, int sqpn, struct mlx4_ib_qp *qp) 271 struct ib_udata *udata, int sqpn, struct mlx4_ib_qp *qp)
249{ 272{
250 struct mlx4_wqe_ctrl_seg *ctrl;
251 int err; 273 int err;
252 int i;
253 274
254 mutex_init(&qp->mutex); 275 mutex_init(&qp->mutex);
255 spin_lock_init(&qp->sq.lock); 276 spin_lock_init(&qp->sq.lock);
@@ -264,7 +285,7 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
264 qp->sq.head = 0; 285 qp->sq.head = 0;
265 qp->sq.tail = 0; 286 qp->sq.tail = 0;
266 287
267 err = set_qp_size(dev, &init_attr->cap, init_attr->qp_type, qp); 288 err = set_rq_size(dev, &init_attr->cap, qp);
268 if (err) 289 if (err)
269 goto err; 290 goto err;
270 291
@@ -276,6 +297,10 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
276 goto err; 297 goto err;
277 } 298 }
278 299
300 err = set_user_sq_size(qp, &ucmd);
301 if (err)
302 goto err;
303
279 qp->umem = ib_umem_get(pd->uobject->context, ucmd.buf_addr, 304 qp->umem = ib_umem_get(pd->uobject->context, ucmd.buf_addr,
280 qp->buf_size, 0); 305 qp->buf_size, 0);
281 if (IS_ERR(qp->umem)) { 306 if (IS_ERR(qp->umem)) {
@@ -292,16 +317,24 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
292 if (err) 317 if (err)
293 goto err_mtt; 318 goto err_mtt;
294 319
295 err = mlx4_ib_db_map_user(to_mucontext(pd->uobject->context), 320 if (!init_attr->srq) {
296 ucmd.db_addr, &qp->db); 321 err = mlx4_ib_db_map_user(to_mucontext(pd->uobject->context),
297 if (err) 322 ucmd.db_addr, &qp->db);
298 goto err_mtt; 323 if (err)
324 goto err_mtt;
325 }
299 } else { 326 } else {
300 err = mlx4_ib_db_alloc(dev, &qp->db, 0); 327 err = set_kernel_sq_size(dev, &init_attr->cap, init_attr->qp_type, qp);
301 if (err) 328 if (err)
302 goto err; 329 goto err;
303 330
304 *qp->db.db = 0; 331 if (!init_attr->srq) {
332 err = mlx4_ib_db_alloc(dev, &qp->db, 0);
333 if (err)
334 goto err;
335
336 *qp->db.db = 0;
337 }
305 338
306 if (mlx4_buf_alloc(dev->dev, qp->buf_size, PAGE_SIZE * 2, &qp->buf)) { 339 if (mlx4_buf_alloc(dev->dev, qp->buf_size, PAGE_SIZE * 2, &qp->buf)) {
307 err = -ENOMEM; 340 err = -ENOMEM;
@@ -317,11 +350,6 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
317 if (err) 350 if (err)
318 goto err_mtt; 351 goto err_mtt;
319 352
320 for (i = 0; i < qp->sq.max; ++i) {
321 ctrl = get_send_wqe(qp, i);
322 ctrl->owner_opcode = cpu_to_be32(1 << 31);
323 }
324
325 qp->sq.wrid = kmalloc(qp->sq.max * sizeof (u64), GFP_KERNEL); 353 qp->sq.wrid = kmalloc(qp->sq.max * sizeof (u64), GFP_KERNEL);
326 qp->rq.wrid = kmalloc(qp->rq.max * sizeof (u64), GFP_KERNEL); 354 qp->rq.wrid = kmalloc(qp->rq.max * sizeof (u64), GFP_KERNEL);
327 355
@@ -355,7 +383,7 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
355 return 0; 383 return 0;
356 384
357err_wrid: 385err_wrid:
358 if (pd->uobject) 386 if (pd->uobject && !init_attr->srq)
359 mlx4_ib_db_unmap_user(to_mucontext(pd->uobject->context), &qp->db); 387 mlx4_ib_db_unmap_user(to_mucontext(pd->uobject->context), &qp->db);
360 else { 388 else {
361 kfree(qp->sq.wrid); 389 kfree(qp->sq.wrid);
@@ -372,7 +400,7 @@ err_buf:
372 mlx4_buf_free(dev->dev, qp->buf_size, &qp->buf); 400 mlx4_buf_free(dev->dev, qp->buf_size, &qp->buf);
373 401
374err_db: 402err_db:
375 if (!pd->uobject) 403 if (!pd->uobject && !init_attr->srq)
376 mlx4_ib_db_free(dev, &qp->db); 404 mlx4_ib_db_free(dev, &qp->db);
377 405
378err: 406err:
@@ -450,14 +478,16 @@ static void destroy_qp_common(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp,
450 mlx4_mtt_cleanup(dev->dev, &qp->mtt); 478 mlx4_mtt_cleanup(dev->dev, &qp->mtt);
451 479
452 if (is_user) { 480 if (is_user) {
453 mlx4_ib_db_unmap_user(to_mucontext(qp->ibqp.uobject->context), 481 if (!qp->ibqp.srq)
454 &qp->db); 482 mlx4_ib_db_unmap_user(to_mucontext(qp->ibqp.uobject->context),
483 &qp->db);
455 ib_umem_release(qp->umem); 484 ib_umem_release(qp->umem);
456 } else { 485 } else {
457 kfree(qp->sq.wrid); 486 kfree(qp->sq.wrid);
458 kfree(qp->rq.wrid); 487 kfree(qp->rq.wrid);
459 mlx4_buf_free(dev->dev, qp->buf_size, &qp->buf); 488 mlx4_buf_free(dev->dev, qp->buf_size, &qp->buf);
460 mlx4_ib_db_free(dev, &qp->db); 489 if (!qp->ibqp.srq)
490 mlx4_ib_db_free(dev, &qp->db);
461 } 491 }
462} 492}
463 493
@@ -573,7 +603,7 @@ static int to_mlx4_st(enum ib_qp_type type)
573 } 603 }
574} 604}
575 605
576static __be32 to_mlx4_access_flags(struct mlx4_ib_qp *qp, struct ib_qp_attr *attr, 606static __be32 to_mlx4_access_flags(struct mlx4_ib_qp *qp, const struct ib_qp_attr *attr,
577 int attr_mask) 607 int attr_mask)
578{ 608{
579 u8 dest_rd_atomic; 609 u8 dest_rd_atomic;
@@ -603,7 +633,7 @@ static __be32 to_mlx4_access_flags(struct mlx4_ib_qp *qp, struct ib_qp_attr *att
603 return cpu_to_be32(hw_access_flags); 633 return cpu_to_be32(hw_access_flags);
604} 634}
605 635
606static void store_sqp_attrs(struct mlx4_ib_sqp *sqp, struct ib_qp_attr *attr, 636static void store_sqp_attrs(struct mlx4_ib_sqp *sqp, const struct ib_qp_attr *attr,
607 int attr_mask) 637 int attr_mask)
608{ 638{
609 if (attr_mask & IB_QP_PKEY_INDEX) 639 if (attr_mask & IB_QP_PKEY_INDEX)
@@ -619,7 +649,7 @@ static void mlx4_set_sched(struct mlx4_qp_path *path, u8 port)
619 path->sched_queue = (path->sched_queue & 0xbf) | ((port - 1) << 6); 649 path->sched_queue = (path->sched_queue & 0xbf) | ((port - 1) << 6);
620} 650}
621 651
622static int mlx4_set_path(struct mlx4_ib_dev *dev, struct ib_ah_attr *ah, 652static int mlx4_set_path(struct mlx4_ib_dev *dev, const struct ib_ah_attr *ah,
623 struct mlx4_qp_path *path, u8 port) 653 struct mlx4_qp_path *path, u8 port)
624{ 654{
625 path->grh_mylmc = ah->src_path_bits & 0x7f; 655 path->grh_mylmc = ah->src_path_bits & 0x7f;
@@ -655,14 +685,14 @@ static int mlx4_set_path(struct mlx4_ib_dev *dev, struct ib_ah_attr *ah,
655 return 0; 685 return 0;
656} 686}
657 687
658int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, 688static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
659 int attr_mask, struct ib_udata *udata) 689 const struct ib_qp_attr *attr, int attr_mask,
690 enum ib_qp_state cur_state, enum ib_qp_state new_state)
660{ 691{
661 struct mlx4_ib_dev *dev = to_mdev(ibqp->device); 692 struct mlx4_ib_dev *dev = to_mdev(ibqp->device);
662 struct mlx4_ib_qp *qp = to_mqp(ibqp); 693 struct mlx4_ib_qp *qp = to_mqp(ibqp);
663 struct mlx4_qp_context *context; 694 struct mlx4_qp_context *context;
664 enum mlx4_qp_optpar optpar = 0; 695 enum mlx4_qp_optpar optpar = 0;
665 enum ib_qp_state cur_state, new_state;
666 int sqd_event; 696 int sqd_event;
667 int err = -EINVAL; 697 int err = -EINVAL;
668 698
@@ -670,34 +700,6 @@ int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
670 if (!context) 700 if (!context)
671 return -ENOMEM; 701 return -ENOMEM;
672 702
673 mutex_lock(&qp->mutex);
674
675 cur_state = attr_mask & IB_QP_CUR_STATE ? attr->cur_qp_state : qp->state;
676 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
677
678 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask))
679 goto out;
680
681 if ((attr_mask & IB_QP_PKEY_INDEX) &&
682 attr->pkey_index >= dev->dev->caps.pkey_table_len) {
683 goto out;
684 }
685
686 if ((attr_mask & IB_QP_PORT) &&
687 (attr->port_num == 0 || attr->port_num > dev->dev->caps.num_ports)) {
688 goto out;
689 }
690
691 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC &&
692 attr->max_rd_atomic > dev->dev->caps.max_qp_init_rdma) {
693 goto out;
694 }
695
696 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC &&
697 attr->max_dest_rd_atomic > 1 << dev->dev->caps.max_qp_dest_rdma) {
698 goto out;
699 }
700
701 context->flags = cpu_to_be32((to_mlx4_state(new_state) << 28) | 703 context->flags = cpu_to_be32((to_mlx4_state(new_state) << 28) |
702 (to_mlx4_st(ibqp->qp_type) << 16)); 704 (to_mlx4_st(ibqp->qp_type) << 16));
703 context->flags |= cpu_to_be32(1 << 8); /* DE? */ 705 context->flags |= cpu_to_be32(1 << 8); /* DE? */
@@ -849,7 +851,7 @@ int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
849 if (ibqp->srq) 851 if (ibqp->srq)
850 context->srqn = cpu_to_be32(1 << 24 | to_msrq(ibqp->srq)->msrq.srqn); 852 context->srqn = cpu_to_be32(1 << 24 | to_msrq(ibqp->srq)->msrq.srqn);
851 853
852 if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) 854 if (!ibqp->srq && cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT)
853 context->db_rec_addr = cpu_to_be64(qp->db.dma); 855 context->db_rec_addr = cpu_to_be64(qp->db.dma);
854 856
855 if (cur_state == IB_QPS_INIT && 857 if (cur_state == IB_QPS_INIT &&
@@ -869,6 +871,21 @@ int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
869 else 871 else
870 sqd_event = 0; 872 sqd_event = 0;
871 873
874 /*
875 * Before passing a kernel QP to the HW, make sure that the
876 * ownership bits of the send queue are set so that the
877 * hardware doesn't start processing stale work requests.
878 */
879 if (!ibqp->uobject && cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) {
880 struct mlx4_wqe_ctrl_seg *ctrl;
881 int i;
882
883 for (i = 0; i < qp->sq.max; ++i) {
884 ctrl = get_send_wqe(qp, i);
885 ctrl->owner_opcode = cpu_to_be32(1 << 31);
886 }
887 }
888
872 err = mlx4_qp_modify(dev->dev, &qp->mtt, to_mlx4_state(cur_state), 889 err = mlx4_qp_modify(dev->dev, &qp->mtt, to_mlx4_state(cur_state),
873 to_mlx4_state(new_state), context, optpar, 890 to_mlx4_state(new_state), context, optpar,
874 sqd_event, &qp->mqp); 891 sqd_event, &qp->mqp);
@@ -916,15 +933,89 @@ int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
916 qp->rq.tail = 0; 933 qp->rq.tail = 0;
917 qp->sq.head = 0; 934 qp->sq.head = 0;
918 qp->sq.tail = 0; 935 qp->sq.tail = 0;
919 *qp->db.db = 0; 936 if (!ibqp->srq)
937 *qp->db.db = 0;
920 } 938 }
921 939
922out: 940out:
923 mutex_unlock(&qp->mutex);
924 kfree(context); 941 kfree(context);
925 return err; 942 return err;
926} 943}
927 944
945static const struct ib_qp_attr mlx4_ib_qp_attr = { .port_num = 1 };
946static const int mlx4_ib_qp_attr_mask_table[IB_QPT_UD + 1] = {
947 [IB_QPT_UD] = (IB_QP_PKEY_INDEX |
948 IB_QP_PORT |
949 IB_QP_QKEY),
950 [IB_QPT_UC] = (IB_QP_PKEY_INDEX |
951 IB_QP_PORT |
952 IB_QP_ACCESS_FLAGS),
953 [IB_QPT_RC] = (IB_QP_PKEY_INDEX |
954 IB_QP_PORT |
955 IB_QP_ACCESS_FLAGS),
956 [IB_QPT_SMI] = (IB_QP_PKEY_INDEX |
957 IB_QP_QKEY),
958 [IB_QPT_GSI] = (IB_QP_PKEY_INDEX |
959 IB_QP_QKEY),
960};
961
962int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
963 int attr_mask, struct ib_udata *udata)
964{
965 struct mlx4_ib_dev *dev = to_mdev(ibqp->device);
966 struct mlx4_ib_qp *qp = to_mqp(ibqp);
967 enum ib_qp_state cur_state, new_state;
968 int err = -EINVAL;
969
970 mutex_lock(&qp->mutex);
971
972 cur_state = attr_mask & IB_QP_CUR_STATE ? attr->cur_qp_state : qp->state;
973 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
974
975 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask))
976 goto out;
977
978 if ((attr_mask & IB_QP_PKEY_INDEX) &&
979 attr->pkey_index >= dev->dev->caps.pkey_table_len) {
980 goto out;
981 }
982
983 if ((attr_mask & IB_QP_PORT) &&
984 (attr->port_num == 0 || attr->port_num > dev->dev->caps.num_ports)) {
985 goto out;
986 }
987
988 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC &&
989 attr->max_rd_atomic > dev->dev->caps.max_qp_init_rdma) {
990 goto out;
991 }
992
993 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC &&
994 attr->max_dest_rd_atomic > dev->dev->caps.max_qp_dest_rdma) {
995 goto out;
996 }
997
998 if (cur_state == new_state && cur_state == IB_QPS_RESET) {
999 err = 0;
1000 goto out;
1001 }
1002
1003 if (cur_state == IB_QPS_RESET && new_state == IB_QPS_ERR) {
1004 err = __mlx4_ib_modify_qp(ibqp, &mlx4_ib_qp_attr,
1005 mlx4_ib_qp_attr_mask_table[ibqp->qp_type],
1006 IB_QPS_RESET, IB_QPS_INIT);
1007 if (err)
1008 goto out;
1009 cur_state = IB_QPS_INIT;
1010 }
1011
1012 err = __mlx4_ib_modify_qp(ibqp, attr, attr_mask, cur_state, new_state);
1013
1014out:
1015 mutex_unlock(&qp->mutex);
1016 return err;
1017}
1018
928static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr, 1019static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
929 void *wqe) 1020 void *wqe)
930{ 1021{
@@ -952,6 +1043,7 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
952 (be32_to_cpu(ah->av.sl_tclass_flowlabel) >> 20) & 0xff; 1043 (be32_to_cpu(ah->av.sl_tclass_flowlabel) >> 20) & 0xff;
953 sqp->ud_header.grh.flow_label = 1044 sqp->ud_header.grh.flow_label =
954 ah->av.sl_tclass_flowlabel & cpu_to_be32(0xfffff); 1045 ah->av.sl_tclass_flowlabel & cpu_to_be32(0xfffff);
1046 sqp->ud_header.grh.hop_limit = ah->av.hop_limit;
955 ib_get_cached_gid(ib_dev, be32_to_cpu(ah->av.port_pd) >> 24, 1047 ib_get_cached_gid(ib_dev, be32_to_cpu(ah->av.port_pd) >> 24,
956 ah->av.gid_index, &sqp->ud_header.grh.source_gid); 1048 ah->av.gid_index, &sqp->ud_header.grh.source_gid);
957 memcpy(sqp->ud_header.grh.destination_gid.raw, 1049 memcpy(sqp->ud_header.grh.destination_gid.raw,
@@ -1192,7 +1284,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1192 */ 1284 */
1193 wmb(); 1285 wmb();
1194 1286
1195 if (wr->opcode < 0 || wr->opcode > ARRAY_SIZE(mlx4_ib_opcode)) { 1287 if (wr->opcode < 0 || wr->opcode >= ARRAY_SIZE(mlx4_ib_opcode)) {
1196 err = -EINVAL; 1288 err = -EINVAL;
1197 goto out; 1289 goto out;
1198 } 1290 }
diff --git a/drivers/infiniband/hw/mlx4/srq.c b/drivers/infiniband/hw/mlx4/srq.c
index 42ab4a801d6a..12fac1c8989d 100644
--- a/drivers/infiniband/hw/mlx4/srq.c
+++ b/drivers/infiniband/hw/mlx4/srq.c
@@ -297,6 +297,12 @@ int mlx4_ib_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
297 break; 297 break;
298 } 298 }
299 299
300 if (unlikely(srq->head == srq->tail)) {
301 err = -ENOMEM;
302 *bad_wr = wr;
303 break;
304 }
305
300 srq->wrid[srq->head] = wr->wr_id; 306 srq->wrid[srq->head] = wr->wr_id;
301 307
302 next = get_wqe(srq, srq->head); 308 next = get_wqe(srq, srq->head);
diff --git a/drivers/infiniband/hw/mlx4/user.h b/drivers/infiniband/hw/mlx4/user.h
index 5b8eddc9fa83..88c72d56368b 100644
--- a/drivers/infiniband/hw/mlx4/user.h
+++ b/drivers/infiniband/hw/mlx4/user.h
@@ -39,7 +39,7 @@
39 * Increment this value if any changes that break userspace ABI 39 * Increment this value if any changes that break userspace ABI
40 * compatibility are made. 40 * compatibility are made.
41 */ 41 */
42#define MLX4_IB_UVERBS_ABI_VERSION 1 42#define MLX4_IB_UVERBS_ABI_VERSION 2
43 43
44/* 44/*
45 * Make sure that all structs defined in this file remain laid out so 45 * Make sure that all structs defined in this file remain laid out so
@@ -87,6 +87,9 @@ struct mlx4_ib_create_srq_resp {
87struct mlx4_ib_create_qp { 87struct mlx4_ib_create_qp {
88 __u64 buf_addr; 88 __u64 buf_addr;
89 __u64 db_addr; 89 __u64 db_addr;
90 __u8 log_sq_bb_count;
91 __u8 log_sq_stride;
92 __u8 reserved[6];
90}; 93};
91 94
92#endif /* MLX4_IB_USER_H */ 95#endif /* MLX4_IB_USER_H */
diff --git a/drivers/infiniband/hw/mthca/mthca_av.c b/drivers/infiniband/hw/mthca/mthca_av.c
index 27caf3b0648a..4b111a852ff6 100644
--- a/drivers/infiniband/hw/mthca/mthca_av.c
+++ b/drivers/infiniband/hw/mthca/mthca_av.c
@@ -279,6 +279,7 @@ int mthca_read_ah(struct mthca_dev *dev, struct mthca_ah *ah,
279 (be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 20) & 0xff; 279 (be32_to_cpu(ah->av->sl_tclass_flowlabel) >> 20) & 0xff;
280 header->grh.flow_label = 280 header->grh.flow_label =
281 ah->av->sl_tclass_flowlabel & cpu_to_be32(0xfffff); 281 ah->av->sl_tclass_flowlabel & cpu_to_be32(0xfffff);
282 header->grh.hop_limit = ah->av->hop_limit;
282 ib_get_cached_gid(&dev->ib_dev, 283 ib_get_cached_gid(&dev->ib_dev,
283 be32_to_cpu(ah->av->port_pd) >> 24, 284 be32_to_cpu(ah->av->port_pd) >> 24,
284 ah->av->gid_index % dev->limits.gid_table_len, 285 ah->av->gid_index % dev->limits.gid_table_len,
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
index 71314460b11e..38102520ffb3 100644
--- a/drivers/infiniband/hw/mthca/mthca_cmd.c
+++ b/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -37,6 +37,7 @@
37#include <linux/completion.h> 37#include <linux/completion.h>
38#include <linux/pci.h> 38#include <linux/pci.h>
39#include <linux/errno.h> 39#include <linux/errno.h>
40#include <linux/sched.h>
40#include <asm/io.h> 41#include <asm/io.h>
41#include <rdma/ib_mad.h> 42#include <rdma/ib_mad.h>
42 43
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c
index ca224d018af2..be6e1e03bdab 100644
--- a/drivers/infiniband/hw/mthca/mthca_cq.c
+++ b/drivers/infiniband/hw/mthca/mthca_cq.c
@@ -37,6 +37,7 @@
37 */ 37 */
38 38
39#include <linux/hardirq.h> 39#include <linux/hardirq.h>
40#include <linux/sched.h>
40 41
41#include <asm/io.h> 42#include <asm/io.h>
42 43
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index 773145e29947..aa563e61de65 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -1250,12 +1250,14 @@ static void __mthca_remove_one(struct pci_dev *pdev)
1250int __mthca_restart_one(struct pci_dev *pdev) 1250int __mthca_restart_one(struct pci_dev *pdev)
1251{ 1251{
1252 struct mthca_dev *mdev; 1252 struct mthca_dev *mdev;
1253 int hca_type;
1253 1254
1254 mdev = pci_get_drvdata(pdev); 1255 mdev = pci_get_drvdata(pdev);
1255 if (!mdev) 1256 if (!mdev)
1256 return -ENODEV; 1257 return -ENODEV;
1258 hca_type = mdev->hca_type;
1257 __mthca_remove_one(pdev); 1259 __mthca_remove_one(pdev);
1258 return __mthca_init_one(pdev, mdev->hca_type); 1260 return __mthca_init_one(pdev, hca_type);
1259} 1261}
1260 1262
1261static int __devinit mthca_init_one(struct pci_dev *pdev, 1263static int __devinit mthca_init_one(struct pci_dev *pdev,
diff --git a/drivers/infiniband/hw/mthca/mthca_memfree.c b/drivers/infiniband/hw/mthca/mthca_memfree.c
index 48f7c65e9aed..e61f3e626980 100644
--- a/drivers/infiniband/hw/mthca/mthca_memfree.c
+++ b/drivers/infiniband/hw/mthca/mthca_memfree.c
@@ -36,6 +36,7 @@
36 36
37#include <linux/mm.h> 37#include <linux/mm.h>
38#include <linux/scatterlist.h> 38#include <linux/scatterlist.h>
39#include <linux/sched.h>
39 40
40#include <asm/page.h> 41#include <asm/page.h>
41 42
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index 72fabb822f1c..eef415b12b2e 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -37,6 +37,7 @@
37 37
38#include <linux/string.h> 38#include <linux/string.h>
39#include <linux/slab.h> 39#include <linux/slab.h>
40#include <linux/sched.h>
40 41
41#include <asm/io.h> 42#include <asm/io.h>
42 43
@@ -295,7 +296,7 @@ static int to_mthca_st(int transport)
295 } 296 }
296} 297}
297 298
298static void store_attrs(struct mthca_sqp *sqp, struct ib_qp_attr *attr, 299static void store_attrs(struct mthca_sqp *sqp, const struct ib_qp_attr *attr,
299 int attr_mask) 300 int attr_mask)
300{ 301{
301 if (attr_mask & IB_QP_PKEY_INDEX) 302 if (attr_mask & IB_QP_PKEY_INDEX)
@@ -327,7 +328,7 @@ static void init_port(struct mthca_dev *dev, int port)
327 mthca_warn(dev, "INIT_IB returned status %02x.\n", status); 328 mthca_warn(dev, "INIT_IB returned status %02x.\n", status);
328} 329}
329 330
330static __be32 get_hw_access_flags(struct mthca_qp *qp, struct ib_qp_attr *attr, 331static __be32 get_hw_access_flags(struct mthca_qp *qp, const struct ib_qp_attr *attr,
331 int attr_mask) 332 int attr_mask)
332{ 333{
333 u8 dest_rd_atomic; 334 u8 dest_rd_atomic;
@@ -510,7 +511,7 @@ out:
510 return err; 511 return err;
511} 512}
512 513
513static int mthca_path_set(struct mthca_dev *dev, struct ib_ah_attr *ah, 514static int mthca_path_set(struct mthca_dev *dev, const struct ib_ah_attr *ah,
514 struct mthca_qp_path *path, u8 port) 515 struct mthca_qp_path *path, u8 port)
515{ 516{
516 path->g_mylmc = ah->src_path_bits & 0x7f; 517 path->g_mylmc = ah->src_path_bits & 0x7f;
@@ -538,12 +539,12 @@ static int mthca_path_set(struct mthca_dev *dev, struct ib_ah_attr *ah,
538 return 0; 539 return 0;
539} 540}
540 541
541int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask, 542static int __mthca_modify_qp(struct ib_qp *ibqp,
542 struct ib_udata *udata) 543 const struct ib_qp_attr *attr, int attr_mask,
544 enum ib_qp_state cur_state, enum ib_qp_state new_state)
543{ 545{
544 struct mthca_dev *dev = to_mdev(ibqp->device); 546 struct mthca_dev *dev = to_mdev(ibqp->device);
545 struct mthca_qp *qp = to_mqp(ibqp); 547 struct mthca_qp *qp = to_mqp(ibqp);
546 enum ib_qp_state cur_state, new_state;
547 struct mthca_mailbox *mailbox; 548 struct mthca_mailbox *mailbox;
548 struct mthca_qp_param *qp_param; 549 struct mthca_qp_param *qp_param;
549 struct mthca_qp_context *qp_context; 550 struct mthca_qp_context *qp_context;
@@ -551,60 +552,6 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
551 u8 status; 552 u8 status;
552 int err = -EINVAL; 553 int err = -EINVAL;
553 554
554 mutex_lock(&qp->mutex);
555
556 if (attr_mask & IB_QP_CUR_STATE) {
557 cur_state = attr->cur_qp_state;
558 } else {
559 spin_lock_irq(&qp->sq.lock);
560 spin_lock(&qp->rq.lock);
561 cur_state = qp->state;
562 spin_unlock(&qp->rq.lock);
563 spin_unlock_irq(&qp->sq.lock);
564 }
565
566 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
567
568 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask)) {
569 mthca_dbg(dev, "Bad QP transition (transport %d) "
570 "%d->%d with attr 0x%08x\n",
571 qp->transport, cur_state, new_state,
572 attr_mask);
573 goto out;
574 }
575
576 if (cur_state == new_state && cur_state == IB_QPS_RESET) {
577 err = 0;
578 goto out;
579 }
580
581 if ((attr_mask & IB_QP_PKEY_INDEX) &&
582 attr->pkey_index >= dev->limits.pkey_table_len) {
583 mthca_dbg(dev, "P_Key index (%u) too large. max is %d\n",
584 attr->pkey_index, dev->limits.pkey_table_len-1);
585 goto out;
586 }
587
588 if ((attr_mask & IB_QP_PORT) &&
589 (attr->port_num == 0 || attr->port_num > dev->limits.num_ports)) {
590 mthca_dbg(dev, "Port number (%u) is invalid\n", attr->port_num);
591 goto out;
592 }
593
594 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC &&
595 attr->max_rd_atomic > dev->limits.max_qp_init_rdma) {
596 mthca_dbg(dev, "Max rdma_atomic as initiator %u too large (max is %d)\n",
597 attr->max_rd_atomic, dev->limits.max_qp_init_rdma);
598 goto out;
599 }
600
601 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC &&
602 attr->max_dest_rd_atomic > 1 << dev->qp_table.rdb_shift) {
603 mthca_dbg(dev, "Max rdma_atomic as responder %u too large (max %d)\n",
604 attr->max_dest_rd_atomic, 1 << dev->qp_table.rdb_shift);
605 goto out;
606 }
607
608 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); 555 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
609 if (IS_ERR(mailbox)) { 556 if (IS_ERR(mailbox)) {
610 err = PTR_ERR(mailbox); 557 err = PTR_ERR(mailbox);
@@ -891,6 +838,98 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
891 838
892out_mailbox: 839out_mailbox:
893 mthca_free_mailbox(dev, mailbox); 840 mthca_free_mailbox(dev, mailbox);
841out:
842 return err;
843}
844
845static const struct ib_qp_attr dummy_init_attr = { .port_num = 1 };
846static const int dummy_init_attr_mask[] = {
847 [IB_QPT_UD] = (IB_QP_PKEY_INDEX |
848 IB_QP_PORT |
849 IB_QP_QKEY),
850 [IB_QPT_UC] = (IB_QP_PKEY_INDEX |
851 IB_QP_PORT |
852 IB_QP_ACCESS_FLAGS),
853 [IB_QPT_RC] = (IB_QP_PKEY_INDEX |
854 IB_QP_PORT |
855 IB_QP_ACCESS_FLAGS),
856 [IB_QPT_SMI] = (IB_QP_PKEY_INDEX |
857 IB_QP_QKEY),
858 [IB_QPT_GSI] = (IB_QP_PKEY_INDEX |
859 IB_QP_QKEY),
860};
861
862int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
863 struct ib_udata *udata)
864{
865 struct mthca_dev *dev = to_mdev(ibqp->device);
866 struct mthca_qp *qp = to_mqp(ibqp);
867 enum ib_qp_state cur_state, new_state;
868 int err = -EINVAL;
869
870 mutex_lock(&qp->mutex);
871 if (attr_mask & IB_QP_CUR_STATE) {
872 cur_state = attr->cur_qp_state;
873 } else {
874 spin_lock_irq(&qp->sq.lock);
875 spin_lock(&qp->rq.lock);
876 cur_state = qp->state;
877 spin_unlock(&qp->rq.lock);
878 spin_unlock_irq(&qp->sq.lock);
879 }
880
881 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
882
883 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask)) {
884 mthca_dbg(dev, "Bad QP transition (transport %d) "
885 "%d->%d with attr 0x%08x\n",
886 qp->transport, cur_state, new_state,
887 attr_mask);
888 goto out;
889 }
890
891 if ((attr_mask & IB_QP_PKEY_INDEX) &&
892 attr->pkey_index >= dev->limits.pkey_table_len) {
893 mthca_dbg(dev, "P_Key index (%u) too large. max is %d\n",
894 attr->pkey_index, dev->limits.pkey_table_len-1);
895 goto out;
896 }
897
898 if ((attr_mask & IB_QP_PORT) &&
899 (attr->port_num == 0 || attr->port_num > dev->limits.num_ports)) {
900 mthca_dbg(dev, "Port number (%u) is invalid\n", attr->port_num);
901 goto out;
902 }
903
904 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC &&
905 attr->max_rd_atomic > dev->limits.max_qp_init_rdma) {
906 mthca_dbg(dev, "Max rdma_atomic as initiator %u too large (max is %d)\n",
907 attr->max_rd_atomic, dev->limits.max_qp_init_rdma);
908 goto out;
909 }
910
911 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC &&
912 attr->max_dest_rd_atomic > 1 << dev->qp_table.rdb_shift) {
913 mthca_dbg(dev, "Max rdma_atomic as responder %u too large (max %d)\n",
914 attr->max_dest_rd_atomic, 1 << dev->qp_table.rdb_shift);
915 goto out;
916 }
917
918 if (cur_state == new_state && cur_state == IB_QPS_RESET) {
919 err = 0;
920 goto out;
921 }
922
923 if (cur_state == IB_QPS_RESET && new_state == IB_QPS_ERR) {
924 err = __mthca_modify_qp(ibqp, &dummy_init_attr,
925 dummy_init_attr_mask[ibqp->qp_type],
926 IB_QPS_RESET, IB_QPS_INIT);
927 if (err)
928 goto out;
929 cur_state = IB_QPS_INIT;
930 }
931
932 err = __mthca_modify_qp(ibqp, attr, attr_mask, cur_state, new_state);
894 933
895out: 934out:
896 mutex_unlock(&qp->mutex); 935 mutex_unlock(&qp->mutex);
@@ -2245,10 +2284,10 @@ void mthca_free_err_wqe(struct mthca_dev *dev, struct mthca_qp *qp, int is_send,
2245 struct mthca_next_seg *next; 2284 struct mthca_next_seg *next;
2246 2285
2247 /* 2286 /*
2248 * For SRQs, all WQEs generate a CQE, so we're always at the 2287 * For SRQs, all receive WQEs generate a CQE, so we're always
2249 * end of the doorbell chain. 2288 * at the end of the doorbell chain.
2250 */ 2289 */
2251 if (qp->ibqp.srq) { 2290 if (qp->ibqp.srq && !is_send) {
2252 *new_wqe = 0; 2291 *new_wqe = 0;
2253 return; 2292 return;
2254 } 2293 }
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c
index 61974b0296ca..b8f05a526673 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -34,6 +34,7 @@
34 34
35#include <linux/slab.h> 35#include <linux/slab.h>
36#include <linux/string.h> 36#include <linux/string.h>
37#include <linux/sched.h>
37 38
38#include <asm/io.h> 39#include <asm/io.h>
39 40
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index 87310eeb6df0..285c143115cc 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -132,12 +132,46 @@ struct ipoib_cm_data {
132 __be32 mtu; 132 __be32 mtu;
133}; 133};
134 134
135/*
136 * Quoting 10.3.1 Queue Pair and EE Context States:
137 *
138 * Note, for QPs that are associated with an SRQ, the Consumer should take the
139 * QP through the Error State before invoking a Destroy QP or a Modify QP to the
140 * Reset State. The Consumer may invoke the Destroy QP without first performing
141 * a Modify QP to the Error State and waiting for the Affiliated Asynchronous
142 * Last WQE Reached Event. However, if the Consumer does not wait for the
143 * Affiliated Asynchronous Last WQE Reached Event, then WQE and Data Segment
144 * leakage may occur. Therefore, it is good programming practice to tear down a
145 * QP that is associated with an SRQ by using the following process:
146 *
147 * - Put the QP in the Error State
148 * - Wait for the Affiliated Asynchronous Last WQE Reached Event;
149 * - either:
150 * drain the CQ by invoking the Poll CQ verb and either wait for CQ
151 * to be empty or the number of Poll CQ operations has exceeded
152 * CQ capacity size;
153 * - or
154 * post another WR that completes on the same CQ and wait for this
155 * WR to return as a WC;
156 * - and then invoke a Destroy QP or Reset QP.
157 *
158 * We use the second option and wait for a completion on the
159 * same CQ before destroying QPs attached to our SRQ.
160 */
161
162enum ipoib_cm_state {
163 IPOIB_CM_RX_LIVE,
164 IPOIB_CM_RX_ERROR, /* Ignored by stale task */
165 IPOIB_CM_RX_FLUSH /* Last WQE Reached event observed */
166};
167
135struct ipoib_cm_rx { 168struct ipoib_cm_rx {
136 struct ib_cm_id *id; 169 struct ib_cm_id *id;
137 struct ib_qp *qp; 170 struct ib_qp *qp;
138 struct list_head list; 171 struct list_head list;
139 struct net_device *dev; 172 struct net_device *dev;
140 unsigned long jiffies; 173 unsigned long jiffies;
174 enum ipoib_cm_state state;
141}; 175};
142 176
143struct ipoib_cm_tx { 177struct ipoib_cm_tx {
@@ -165,10 +199,15 @@ struct ipoib_cm_dev_priv {
165 struct ib_srq *srq; 199 struct ib_srq *srq;
166 struct ipoib_cm_rx_buf *srq_ring; 200 struct ipoib_cm_rx_buf *srq_ring;
167 struct ib_cm_id *id; 201 struct ib_cm_id *id;
168 struct list_head passive_ids; 202 struct list_head passive_ids; /* state: LIVE */
203 struct list_head rx_error_list; /* state: ERROR */
204 struct list_head rx_flush_list; /* state: FLUSH, drain not started */
205 struct list_head rx_drain_list; /* state: FLUSH, drain started */
206 struct list_head rx_reap_list; /* state: FLUSH, drain done */
169 struct work_struct start_task; 207 struct work_struct start_task;
170 struct work_struct reap_task; 208 struct work_struct reap_task;
171 struct work_struct skb_task; 209 struct work_struct skb_task;
210 struct work_struct rx_reap_task;
172 struct delayed_work stale_task; 211 struct delayed_work stale_task;
173 struct sk_buff_head skb_queue; 212 struct sk_buff_head skb_queue;
174 struct list_head start_list; 213 struct list_head start_list;
@@ -201,15 +240,17 @@ struct ipoib_dev_priv {
201 struct list_head multicast_list; 240 struct list_head multicast_list;
202 struct rb_root multicast_tree; 241 struct rb_root multicast_tree;
203 242
204 struct delayed_work pkey_task; 243 struct delayed_work pkey_poll_task;
205 struct delayed_work mcast_task; 244 struct delayed_work mcast_task;
206 struct work_struct flush_task; 245 struct work_struct flush_task;
207 struct work_struct restart_task; 246 struct work_struct restart_task;
208 struct delayed_work ah_reap_task; 247 struct delayed_work ah_reap_task;
248 struct work_struct pkey_event_task;
209 249
210 struct ib_device *ca; 250 struct ib_device *ca;
211 u8 port; 251 u8 port;
212 u16 pkey; 252 u16 pkey;
253 u16 pkey_index;
213 struct ib_pd *pd; 254 struct ib_pd *pd;
214 struct ib_mr *mr; 255 struct ib_mr *mr;
215 struct ib_cq *cq; 256 struct ib_cq *cq;
@@ -333,12 +374,13 @@ struct ipoib_dev_priv *ipoib_intf_alloc(const char *format);
333 374
334int ipoib_ib_dev_init(struct net_device *dev, struct ib_device *ca, int port); 375int ipoib_ib_dev_init(struct net_device *dev, struct ib_device *ca, int port);
335void ipoib_ib_dev_flush(struct work_struct *work); 376void ipoib_ib_dev_flush(struct work_struct *work);
377void ipoib_pkey_event(struct work_struct *work);
336void ipoib_ib_dev_cleanup(struct net_device *dev); 378void ipoib_ib_dev_cleanup(struct net_device *dev);
337 379
338int ipoib_ib_dev_open(struct net_device *dev); 380int ipoib_ib_dev_open(struct net_device *dev);
339int ipoib_ib_dev_up(struct net_device *dev); 381int ipoib_ib_dev_up(struct net_device *dev);
340int ipoib_ib_dev_down(struct net_device *dev, int flush); 382int ipoib_ib_dev_down(struct net_device *dev, int flush);
341int ipoib_ib_dev_stop(struct net_device *dev); 383int ipoib_ib_dev_stop(struct net_device *dev, int flush);
342 384
343int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port); 385int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port);
344void ipoib_dev_cleanup(struct net_device *dev); 386void ipoib_dev_cleanup(struct net_device *dev);
@@ -386,6 +428,7 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey);
386 428
387void ipoib_pkey_poll(struct work_struct *work); 429void ipoib_pkey_poll(struct work_struct *work);
388int ipoib_pkey_dev_delay_open(struct net_device *dev); 430int ipoib_pkey_dev_delay_open(struct net_device *dev);
431void ipoib_drain_cq(struct net_device *dev);
389 432
390#ifdef CONFIG_INFINIBAND_IPOIB_CM 433#ifdef CONFIG_INFINIBAND_IPOIB_CM
391 434
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index eec833b81e9b..076a0bbb63d7 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -37,6 +37,7 @@
37#include <net/dst.h> 37#include <net/dst.h>
38#include <net/icmp.h> 38#include <net/icmp.h>
39#include <linux/icmpv6.h> 39#include <linux/icmpv6.h>
40#include <linux/delay.h>
40 41
41#ifdef CONFIG_INFINIBAND_IPOIB_DEBUG_DATA 42#ifdef CONFIG_INFINIBAND_IPOIB_DEBUG_DATA
42static int data_debug_level; 43static int data_debug_level;
@@ -62,6 +63,17 @@ struct ipoib_cm_id {
62 u32 remote_mtu; 63 u32 remote_mtu;
63}; 64};
64 65
66static struct ib_qp_attr ipoib_cm_err_attr = {
67 .qp_state = IB_QPS_ERR
68};
69
70#define IPOIB_CM_RX_DRAIN_WRID 0x7fffffff
71
72static struct ib_send_wr ipoib_cm_rx_drain_wr = {
73 .wr_id = IPOIB_CM_RX_DRAIN_WRID,
74 .opcode = IB_WR_SEND,
75};
76
65static int ipoib_cm_tx_handler(struct ib_cm_id *cm_id, 77static int ipoib_cm_tx_handler(struct ib_cm_id *cm_id,
66 struct ib_cm_event *event); 78 struct ib_cm_event *event);
67 79
@@ -150,15 +162,54 @@ partial_error:
150 return NULL; 162 return NULL;
151} 163}
152 164
165static void ipoib_cm_start_rx_drain(struct ipoib_dev_priv* priv)
166{
167 struct ib_send_wr *bad_wr;
168 struct ipoib_cm_rx *p;
169
170 /* We only reserved 1 extra slot in CQ for drain WRs, so
171 * make sure we have at most 1 outstanding WR. */
172 if (list_empty(&priv->cm.rx_flush_list) ||
173 !list_empty(&priv->cm.rx_drain_list))
174 return;
175
176 /*
177 * QPs on flush list are error state. This way, a "flush
178 * error" WC will be immediately generated for each WR we post.
179 */
180 p = list_entry(priv->cm.rx_flush_list.next, typeof(*p), list);
181 if (ib_post_send(p->qp, &ipoib_cm_rx_drain_wr, &bad_wr))
182 ipoib_warn(priv, "failed to post drain wr\n");
183
184 list_splice_init(&priv->cm.rx_flush_list, &priv->cm.rx_drain_list);
185}
186
187static void ipoib_cm_rx_event_handler(struct ib_event *event, void *ctx)
188{
189 struct ipoib_cm_rx *p = ctx;
190 struct ipoib_dev_priv *priv = netdev_priv(p->dev);
191 unsigned long flags;
192
193 if (event->event != IB_EVENT_QP_LAST_WQE_REACHED)
194 return;
195
196 spin_lock_irqsave(&priv->lock, flags);
197 list_move(&p->list, &priv->cm.rx_flush_list);
198 p->state = IPOIB_CM_RX_FLUSH;
199 ipoib_cm_start_rx_drain(priv);
200 spin_unlock_irqrestore(&priv->lock, flags);
201}
202
153static struct ib_qp *ipoib_cm_create_rx_qp(struct net_device *dev, 203static struct ib_qp *ipoib_cm_create_rx_qp(struct net_device *dev,
154 struct ipoib_cm_rx *p) 204 struct ipoib_cm_rx *p)
155{ 205{
156 struct ipoib_dev_priv *priv = netdev_priv(dev); 206 struct ipoib_dev_priv *priv = netdev_priv(dev);
157 struct ib_qp_init_attr attr = { 207 struct ib_qp_init_attr attr = {
158 .send_cq = priv->cq, /* does not matter, we never send anything */ 208 .event_handler = ipoib_cm_rx_event_handler,
209 .send_cq = priv->cq, /* For drain WR */
159 .recv_cq = priv->cq, 210 .recv_cq = priv->cq,
160 .srq = priv->cm.srq, 211 .srq = priv->cm.srq,
161 .cap.max_send_wr = 1, /* FIXME: 0 Seems not to work */ 212 .cap.max_send_wr = 1, /* For drain WR */
162 .cap.max_send_sge = 1, /* FIXME: 0 Seems not to work */ 213 .cap.max_send_sge = 1, /* FIXME: 0 Seems not to work */
163 .sq_sig_type = IB_SIGNAL_ALL_WR, 214 .sq_sig_type = IB_SIGNAL_ALL_WR,
164 .qp_type = IB_QPT_RC, 215 .qp_type = IB_QPT_RC,
@@ -198,6 +249,27 @@ static int ipoib_cm_modify_rx_qp(struct net_device *dev,
198 ipoib_warn(priv, "failed to modify QP to RTR: %d\n", ret); 249 ipoib_warn(priv, "failed to modify QP to RTR: %d\n", ret);
199 return ret; 250 return ret;
200 } 251 }
252
253 /*
254 * Current Mellanox HCA firmware won't generate completions
255 * with error for drain WRs unless the QP has been moved to
256 * RTS first. This work-around leaves a window where a QP has
257 * moved to error asynchronously, but this will eventually get
258 * fixed in firmware, so let's not error out if modify QP
259 * fails.
260 */
261 qp_attr.qp_state = IB_QPS_RTS;
262 ret = ib_cm_init_qp_attr(cm_id, &qp_attr, &qp_attr_mask);
263 if (ret) {
264 ipoib_warn(priv, "failed to init QP attr for RTS: %d\n", ret);
265 return 0;
266 }
267 ret = ib_modify_qp(qp, &qp_attr, qp_attr_mask);
268 if (ret) {
269 ipoib_warn(priv, "failed to modify QP to RTS: %d\n", ret);
270 return 0;
271 }
272
201 return 0; 273 return 0;
202} 274}
203 275
@@ -256,6 +328,7 @@ static int ipoib_cm_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *even
256 328
257 cm_id->context = p; 329 cm_id->context = p;
258 p->jiffies = jiffies; 330 p->jiffies = jiffies;
331 p->state = IPOIB_CM_RX_LIVE;
259 spin_lock_irq(&priv->lock); 332 spin_lock_irq(&priv->lock);
260 if (list_empty(&priv->cm.passive_ids)) 333 if (list_empty(&priv->cm.passive_ids))
261 queue_delayed_work(ipoib_workqueue, 334 queue_delayed_work(ipoib_workqueue,
@@ -277,7 +350,6 @@ static int ipoib_cm_rx_handler(struct ib_cm_id *cm_id,
277{ 350{
278 struct ipoib_cm_rx *p; 351 struct ipoib_cm_rx *p;
279 struct ipoib_dev_priv *priv; 352 struct ipoib_dev_priv *priv;
280 int ret;
281 353
282 switch (event->event) { 354 switch (event->event) {
283 case IB_CM_REQ_RECEIVED: 355 case IB_CM_REQ_RECEIVED:
@@ -289,20 +361,9 @@ static int ipoib_cm_rx_handler(struct ib_cm_id *cm_id,
289 case IB_CM_REJ_RECEIVED: 361 case IB_CM_REJ_RECEIVED:
290 p = cm_id->context; 362 p = cm_id->context;
291 priv = netdev_priv(p->dev); 363 priv = netdev_priv(p->dev);
292 spin_lock_irq(&priv->lock); 364 if (ib_modify_qp(p->qp, &ipoib_cm_err_attr, IB_QP_STATE))
293 if (list_empty(&p->list)) 365 ipoib_warn(priv, "unable to move qp to error state\n");
294 ret = 0; /* Connection is going away already. */ 366 /* Fall through */
295 else {
296 list_del_init(&p->list);
297 ret = -ECONNRESET;
298 }
299 spin_unlock_irq(&priv->lock);
300 if (ret) {
301 ib_destroy_qp(p->qp);
302 kfree(p);
303 return ret;
304 }
305 return 0;
306 default: 367 default:
307 return 0; 368 return 0;
308 } 369 }
@@ -354,8 +415,15 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
354 wr_id, wc->status); 415 wr_id, wc->status);
355 416
356 if (unlikely(wr_id >= ipoib_recvq_size)) { 417 if (unlikely(wr_id >= ipoib_recvq_size)) {
357 ipoib_warn(priv, "cm recv completion event with wrid %d (> %d)\n", 418 if (wr_id == (IPOIB_CM_RX_DRAIN_WRID & ~IPOIB_CM_OP_SRQ)) {
358 wr_id, ipoib_recvq_size); 419 spin_lock_irqsave(&priv->lock, flags);
420 list_splice_init(&priv->cm.rx_drain_list, &priv->cm.rx_reap_list);
421 ipoib_cm_start_rx_drain(priv);
422 queue_work(ipoib_workqueue, &priv->cm.rx_reap_task);
423 spin_unlock_irqrestore(&priv->lock, flags);
424 } else
425 ipoib_warn(priv, "cm recv completion event with wrid %d (> %d)\n",
426 wr_id, ipoib_recvq_size);
359 return; 427 return;
360 } 428 }
361 429
@@ -374,9 +442,9 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
374 if (p && time_after_eq(jiffies, p->jiffies + IPOIB_CM_RX_UPDATE_TIME)) { 442 if (p && time_after_eq(jiffies, p->jiffies + IPOIB_CM_RX_UPDATE_TIME)) {
375 spin_lock_irqsave(&priv->lock, flags); 443 spin_lock_irqsave(&priv->lock, flags);
376 p->jiffies = jiffies; 444 p->jiffies = jiffies;
377 /* Move this entry to list head, but do 445 /* Move this entry to list head, but do not re-add it
378 * not re-add it if it has been removed. */ 446 * if it has been moved out of list. */
379 if (!list_empty(&p->list)) 447 if (p->state == IPOIB_CM_RX_LIVE)
380 list_move(&p->list, &priv->cm.passive_ids); 448 list_move(&p->list, &priv->cm.passive_ids);
381 spin_unlock_irqrestore(&priv->lock, flags); 449 spin_unlock_irqrestore(&priv->lock, flags);
382 } 450 }
@@ -592,8 +660,7 @@ int ipoib_cm_dev_open(struct net_device *dev)
592 if (IS_ERR(priv->cm.id)) { 660 if (IS_ERR(priv->cm.id)) {
593 printk(KERN_WARNING "%s: failed to create CM ID\n", priv->ca->name); 661 printk(KERN_WARNING "%s: failed to create CM ID\n", priv->ca->name);
594 ret = PTR_ERR(priv->cm.id); 662 ret = PTR_ERR(priv->cm.id);
595 priv->cm.id = NULL; 663 goto err_cm;
596 return ret;
597 } 664 }
598 665
599 ret = ib_cm_listen(priv->cm.id, cpu_to_be64(IPOIB_CM_IETF_ID | priv->qp->qp_num), 666 ret = ib_cm_listen(priv->cm.id, cpu_to_be64(IPOIB_CM_IETF_ID | priv->qp->qp_num),
@@ -601,34 +668,76 @@ int ipoib_cm_dev_open(struct net_device *dev)
601 if (ret) { 668 if (ret) {
602 printk(KERN_WARNING "%s: failed to listen on ID 0x%llx\n", priv->ca->name, 669 printk(KERN_WARNING "%s: failed to listen on ID 0x%llx\n", priv->ca->name,
603 IPOIB_CM_IETF_ID | priv->qp->qp_num); 670 IPOIB_CM_IETF_ID | priv->qp->qp_num);
604 ib_destroy_cm_id(priv->cm.id); 671 goto err_listen;
605 priv->cm.id = NULL;
606 return ret;
607 } 672 }
673
608 return 0; 674 return 0;
675
676err_listen:
677 ib_destroy_cm_id(priv->cm.id);
678err_cm:
679 priv->cm.id = NULL;
680 return ret;
609} 681}
610 682
611void ipoib_cm_dev_stop(struct net_device *dev) 683void ipoib_cm_dev_stop(struct net_device *dev)
612{ 684{
613 struct ipoib_dev_priv *priv = netdev_priv(dev); 685 struct ipoib_dev_priv *priv = netdev_priv(dev);
614 struct ipoib_cm_rx *p; 686 struct ipoib_cm_rx *p, *n;
687 unsigned long begin;
688 LIST_HEAD(list);
689 int ret;
615 690
616 if (!IPOIB_CM_SUPPORTED(dev->dev_addr) || !priv->cm.id) 691 if (!IPOIB_CM_SUPPORTED(dev->dev_addr) || !priv->cm.id)
617 return; 692 return;
618 693
619 ib_destroy_cm_id(priv->cm.id); 694 ib_destroy_cm_id(priv->cm.id);
620 priv->cm.id = NULL; 695 priv->cm.id = NULL;
696
621 spin_lock_irq(&priv->lock); 697 spin_lock_irq(&priv->lock);
622 while (!list_empty(&priv->cm.passive_ids)) { 698 while (!list_empty(&priv->cm.passive_ids)) {
623 p = list_entry(priv->cm.passive_ids.next, typeof(*p), list); 699 p = list_entry(priv->cm.passive_ids.next, typeof(*p), list);
624 list_del_init(&p->list); 700 list_move(&p->list, &priv->cm.rx_error_list);
701 p->state = IPOIB_CM_RX_ERROR;
702 spin_unlock_irq(&priv->lock);
703 ret = ib_modify_qp(p->qp, &ipoib_cm_err_attr, IB_QP_STATE);
704 if (ret)
705 ipoib_warn(priv, "unable to move qp to error state: %d\n", ret);
706 spin_lock_irq(&priv->lock);
707 }
708
709 /* Wait for all RX to be drained */
710 begin = jiffies;
711
712 while (!list_empty(&priv->cm.rx_error_list) ||
713 !list_empty(&priv->cm.rx_flush_list) ||
714 !list_empty(&priv->cm.rx_drain_list)) {
715 if (time_after(jiffies, begin + 5 * HZ)) {
716 ipoib_warn(priv, "RX drain timing out\n");
717
718 /*
719 * assume the HW is wedged and just free up everything.
720 */
721 list_splice_init(&priv->cm.rx_flush_list, &list);
722 list_splice_init(&priv->cm.rx_error_list, &list);
723 list_splice_init(&priv->cm.rx_drain_list, &list);
724 break;
725 }
625 spin_unlock_irq(&priv->lock); 726 spin_unlock_irq(&priv->lock);
727 msleep(1);
728 ipoib_drain_cq(dev);
729 spin_lock_irq(&priv->lock);
730 }
731
732 list_splice_init(&priv->cm.rx_reap_list, &list);
733
734 spin_unlock_irq(&priv->lock);
735
736 list_for_each_entry_safe(p, n, &list, list) {
626 ib_destroy_cm_id(p->id); 737 ib_destroy_cm_id(p->id);
627 ib_destroy_qp(p->qp); 738 ib_destroy_qp(p->qp);
628 kfree(p); 739 kfree(p);
629 spin_lock_irq(&priv->lock);
630 } 740 }
631 spin_unlock_irq(&priv->lock);
632 741
633 cancel_delayed_work(&priv->cm.stale_task); 742 cancel_delayed_work(&priv->cm.stale_task);
634} 743}
@@ -1079,24 +1188,44 @@ void ipoib_cm_skb_too_long(struct net_device* dev, struct sk_buff *skb,
1079 queue_work(ipoib_workqueue, &priv->cm.skb_task); 1188 queue_work(ipoib_workqueue, &priv->cm.skb_task);
1080} 1189}
1081 1190
1191static void ipoib_cm_rx_reap(struct work_struct *work)
1192{
1193 struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv,
1194 cm.rx_reap_task);
1195 struct ipoib_cm_rx *p, *n;
1196 LIST_HEAD(list);
1197
1198 spin_lock_irq(&priv->lock);
1199 list_splice_init(&priv->cm.rx_reap_list, &list);
1200 spin_unlock_irq(&priv->lock);
1201
1202 list_for_each_entry_safe(p, n, &list, list) {
1203 ib_destroy_cm_id(p->id);
1204 ib_destroy_qp(p->qp);
1205 kfree(p);
1206 }
1207}
1208
1082static void ipoib_cm_stale_task(struct work_struct *work) 1209static void ipoib_cm_stale_task(struct work_struct *work)
1083{ 1210{
1084 struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv, 1211 struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv,
1085 cm.stale_task.work); 1212 cm.stale_task.work);
1086 struct ipoib_cm_rx *p; 1213 struct ipoib_cm_rx *p;
1214 int ret;
1087 1215
1088 spin_lock_irq(&priv->lock); 1216 spin_lock_irq(&priv->lock);
1089 while (!list_empty(&priv->cm.passive_ids)) { 1217 while (!list_empty(&priv->cm.passive_ids)) {
1090 /* List if sorted by LRU, start from tail, 1218 /* List is sorted by LRU, start from tail,
1091 * stop when we see a recently used entry */ 1219 * stop when we see a recently used entry */
1092 p = list_entry(priv->cm.passive_ids.prev, typeof(*p), list); 1220 p = list_entry(priv->cm.passive_ids.prev, typeof(*p), list);
1093 if (time_before_eq(jiffies, p->jiffies + IPOIB_CM_RX_TIMEOUT)) 1221 if (time_before_eq(jiffies, p->jiffies + IPOIB_CM_RX_TIMEOUT))
1094 break; 1222 break;
1095 list_del_init(&p->list); 1223 list_move(&p->list, &priv->cm.rx_error_list);
1224 p->state = IPOIB_CM_RX_ERROR;
1096 spin_unlock_irq(&priv->lock); 1225 spin_unlock_irq(&priv->lock);
1097 ib_destroy_cm_id(p->id); 1226 ret = ib_modify_qp(p->qp, &ipoib_cm_err_attr, IB_QP_STATE);
1098 ib_destroy_qp(p->qp); 1227 if (ret)
1099 kfree(p); 1228 ipoib_warn(priv, "unable to move qp to error state: %d\n", ret);
1100 spin_lock_irq(&priv->lock); 1229 spin_lock_irq(&priv->lock);
1101 } 1230 }
1102 1231
@@ -1164,9 +1293,14 @@ int ipoib_cm_dev_init(struct net_device *dev)
1164 INIT_LIST_HEAD(&priv->cm.passive_ids); 1293 INIT_LIST_HEAD(&priv->cm.passive_ids);
1165 INIT_LIST_HEAD(&priv->cm.reap_list); 1294 INIT_LIST_HEAD(&priv->cm.reap_list);
1166 INIT_LIST_HEAD(&priv->cm.start_list); 1295 INIT_LIST_HEAD(&priv->cm.start_list);
1296 INIT_LIST_HEAD(&priv->cm.rx_error_list);
1297 INIT_LIST_HEAD(&priv->cm.rx_flush_list);
1298 INIT_LIST_HEAD(&priv->cm.rx_drain_list);
1299 INIT_LIST_HEAD(&priv->cm.rx_reap_list);
1167 INIT_WORK(&priv->cm.start_task, ipoib_cm_tx_start); 1300 INIT_WORK(&priv->cm.start_task, ipoib_cm_tx_start);
1168 INIT_WORK(&priv->cm.reap_task, ipoib_cm_tx_reap); 1301 INIT_WORK(&priv->cm.reap_task, ipoib_cm_tx_reap);
1169 INIT_WORK(&priv->cm.skb_task, ipoib_cm_skb_reap); 1302 INIT_WORK(&priv->cm.skb_task, ipoib_cm_skb_reap);
1303 INIT_WORK(&priv->cm.rx_reap_task, ipoib_cm_rx_reap);
1170 INIT_DELAYED_WORK(&priv->cm.stale_task, ipoib_cm_stale_task); 1304 INIT_DELAYED_WORK(&priv->cm.stale_task, ipoib_cm_stale_task);
1171 1305
1172 skb_queue_head_init(&priv->cm.skb_queue); 1306 skb_queue_head_init(&priv->cm.skb_queue);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 68d72c6f7ffb..8404f05b2b6e 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -448,6 +448,13 @@ int ipoib_ib_dev_open(struct net_device *dev)
448 struct ipoib_dev_priv *priv = netdev_priv(dev); 448 struct ipoib_dev_priv *priv = netdev_priv(dev);
449 int ret; 449 int ret;
450 450
451 if (ib_find_pkey(priv->ca, priv->port, priv->pkey, &priv->pkey_index)) {
452 ipoib_warn(priv, "P_Key 0x%04x not found\n", priv->pkey);
453 clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
454 return -1;
455 }
456 set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
457
451 ret = ipoib_init_qp(dev); 458 ret = ipoib_init_qp(dev);
452 if (ret) { 459 if (ret) {
453 ipoib_warn(priv, "ipoib_init_qp returned %d\n", ret); 460 ipoib_warn(priv, "ipoib_init_qp returned %d\n", ret);
@@ -457,14 +464,14 @@ int ipoib_ib_dev_open(struct net_device *dev)
457 ret = ipoib_ib_post_receives(dev); 464 ret = ipoib_ib_post_receives(dev);
458 if (ret) { 465 if (ret) {
459 ipoib_warn(priv, "ipoib_ib_post_receives returned %d\n", ret); 466 ipoib_warn(priv, "ipoib_ib_post_receives returned %d\n", ret);
460 ipoib_ib_dev_stop(dev); 467 ipoib_ib_dev_stop(dev, 1);
461 return -1; 468 return -1;
462 } 469 }
463 470
464 ret = ipoib_cm_dev_open(dev); 471 ret = ipoib_cm_dev_open(dev);
465 if (ret) { 472 if (ret) {
466 ipoib_warn(priv, "ipoib_ib_post_receives returned %d\n", ret); 473 ipoib_warn(priv, "ipoib_cm_dev_open returned %d\n", ret);
467 ipoib_ib_dev_stop(dev); 474 ipoib_ib_dev_stop(dev, 1);
468 return -1; 475 return -1;
469 } 476 }
470 477
@@ -516,7 +523,7 @@ int ipoib_ib_dev_down(struct net_device *dev, int flush)
516 if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) { 523 if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) {
517 mutex_lock(&pkey_mutex); 524 mutex_lock(&pkey_mutex);
518 set_bit(IPOIB_PKEY_STOP, &priv->flags); 525 set_bit(IPOIB_PKEY_STOP, &priv->flags);
519 cancel_delayed_work(&priv->pkey_task); 526 cancel_delayed_work(&priv->pkey_poll_task);
520 mutex_unlock(&pkey_mutex); 527 mutex_unlock(&pkey_mutex);
521 if (flush) 528 if (flush)
522 flush_workqueue(ipoib_workqueue); 529 flush_workqueue(ipoib_workqueue);
@@ -543,13 +550,30 @@ static int recvs_pending(struct net_device *dev)
543 return pending; 550 return pending;
544} 551}
545 552
546int ipoib_ib_dev_stop(struct net_device *dev) 553void ipoib_drain_cq(struct net_device *dev)
554{
555 struct ipoib_dev_priv *priv = netdev_priv(dev);
556 int i, n;
557 do {
558 n = ib_poll_cq(priv->cq, IPOIB_NUM_WC, priv->ibwc);
559 for (i = 0; i < n; ++i) {
560 if (priv->ibwc[i].wr_id & IPOIB_CM_OP_SRQ)
561 ipoib_cm_handle_rx_wc(dev, priv->ibwc + i);
562 else if (priv->ibwc[i].wr_id & IPOIB_OP_RECV)
563 ipoib_ib_handle_rx_wc(dev, priv->ibwc + i);
564 else
565 ipoib_ib_handle_tx_wc(dev, priv->ibwc + i);
566 }
567 } while (n == IPOIB_NUM_WC);
568}
569
570int ipoib_ib_dev_stop(struct net_device *dev, int flush)
547{ 571{
548 struct ipoib_dev_priv *priv = netdev_priv(dev); 572 struct ipoib_dev_priv *priv = netdev_priv(dev);
549 struct ib_qp_attr qp_attr; 573 struct ib_qp_attr qp_attr;
550 unsigned long begin; 574 unsigned long begin;
551 struct ipoib_tx_buf *tx_req; 575 struct ipoib_tx_buf *tx_req;
552 int i, n; 576 int i;
553 577
554 clear_bit(IPOIB_FLAG_INITIALIZED, &priv->flags); 578 clear_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);
555 netif_poll_disable(dev); 579 netif_poll_disable(dev);
@@ -604,17 +628,7 @@ int ipoib_ib_dev_stop(struct net_device *dev)
604 goto timeout; 628 goto timeout;
605 } 629 }
606 630
607 do { 631 ipoib_drain_cq(dev);
608 n = ib_poll_cq(priv->cq, IPOIB_NUM_WC, priv->ibwc);
609 for (i = 0; i < n; ++i) {
610 if (priv->ibwc[i].wr_id & IPOIB_CM_OP_SRQ)
611 ipoib_cm_handle_rx_wc(dev, priv->ibwc + i);
612 else if (priv->ibwc[i].wr_id & IPOIB_OP_RECV)
613 ipoib_ib_handle_rx_wc(dev, priv->ibwc + i);
614 else
615 ipoib_ib_handle_tx_wc(dev, priv->ibwc + i);
616 }
617 } while (n == IPOIB_NUM_WC);
618 632
619 msleep(1); 633 msleep(1);
620 } 634 }
@@ -629,7 +643,8 @@ timeout:
629 /* Wait for all AHs to be reaped */ 643 /* Wait for all AHs to be reaped */
630 set_bit(IPOIB_STOP_REAPER, &priv->flags); 644 set_bit(IPOIB_STOP_REAPER, &priv->flags);
631 cancel_delayed_work(&priv->ah_reap_task); 645 cancel_delayed_work(&priv->ah_reap_task);
632 flush_workqueue(ipoib_workqueue); 646 if (flush)
647 flush_workqueue(ipoib_workqueue);
633 648
634 begin = jiffies; 649 begin = jiffies;
635 650
@@ -673,13 +688,24 @@ int ipoib_ib_dev_init(struct net_device *dev, struct ib_device *ca, int port)
673 return 0; 688 return 0;
674} 689}
675 690
676void ipoib_ib_dev_flush(struct work_struct *work) 691static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv, int pkey_event)
677{ 692{
678 struct ipoib_dev_priv *cpriv, *priv = 693 struct ipoib_dev_priv *cpriv;
679 container_of(work, struct ipoib_dev_priv, flush_task);
680 struct net_device *dev = priv->dev; 694 struct net_device *dev = priv->dev;
695 u16 new_index;
696
697 mutex_lock(&priv->vlan_mutex);
698
699 /*
700 * Flush any child interfaces too -- they might be up even if
701 * the parent is down.
702 */
703 list_for_each_entry(cpriv, &priv->child_intfs, list)
704 __ipoib_ib_dev_flush(cpriv, pkey_event);
681 705
682 if (!test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags) ) { 706 mutex_unlock(&priv->vlan_mutex);
707
708 if (!test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags)) {
683 ipoib_dbg(priv, "Not flushing - IPOIB_FLAG_INITIALIZED not set.\n"); 709 ipoib_dbg(priv, "Not flushing - IPOIB_FLAG_INITIALIZED not set.\n");
684 return; 710 return;
685 } 711 }
@@ -689,10 +715,32 @@ void ipoib_ib_dev_flush(struct work_struct *work)
689 return; 715 return;
690 } 716 }
691 717
718 if (pkey_event) {
719 if (ib_find_pkey(priv->ca, priv->port, priv->pkey, &new_index)) {
720 clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
721 ipoib_ib_dev_down(dev, 0);
722 ipoib_pkey_dev_delay_open(dev);
723 return;
724 }
725 set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
726
727 /* restart QP only if P_Key index is changed */
728 if (new_index == priv->pkey_index) {
729 ipoib_dbg(priv, "Not flushing - P_Key index not changed.\n");
730 return;
731 }
732 priv->pkey_index = new_index;
733 }
734
692 ipoib_dbg(priv, "flushing\n"); 735 ipoib_dbg(priv, "flushing\n");
693 736
694 ipoib_ib_dev_down(dev, 0); 737 ipoib_ib_dev_down(dev, 0);
695 738
739 if (pkey_event) {
740 ipoib_ib_dev_stop(dev, 0);
741 ipoib_ib_dev_open(dev);
742 }
743
696 /* 744 /*
697 * The device could have been brought down between the start and when 745 * The device could have been brought down between the start and when
698 * we get here, don't bring it back up if it's not configured up 746 * we get here, don't bring it back up if it's not configured up
@@ -701,14 +749,24 @@ void ipoib_ib_dev_flush(struct work_struct *work)
701 ipoib_ib_dev_up(dev); 749 ipoib_ib_dev_up(dev);
702 ipoib_mcast_restart_task(&priv->restart_task); 750 ipoib_mcast_restart_task(&priv->restart_task);
703 } 751 }
752}
704 753
705 mutex_lock(&priv->vlan_mutex); 754void ipoib_ib_dev_flush(struct work_struct *work)
755{
756 struct ipoib_dev_priv *priv =
757 container_of(work, struct ipoib_dev_priv, flush_task);
706 758
707 /* Flush any child interfaces too */ 759 ipoib_dbg(priv, "Flushing %s\n", priv->dev->name);
708 list_for_each_entry(cpriv, &priv->child_intfs, list) 760 __ipoib_ib_dev_flush(priv, 0);
709 ipoib_ib_dev_flush(&cpriv->flush_task); 761}
710 762
711 mutex_unlock(&priv->vlan_mutex); 763void ipoib_pkey_event(struct work_struct *work)
764{
765 struct ipoib_dev_priv *priv =
766 container_of(work, struct ipoib_dev_priv, pkey_event_task);
767
768 ipoib_dbg(priv, "Flushing %s and restarting its QP\n", priv->dev->name);
769 __ipoib_ib_dev_flush(priv, 1);
712} 770}
713 771
714void ipoib_ib_dev_cleanup(struct net_device *dev) 772void ipoib_ib_dev_cleanup(struct net_device *dev)
@@ -736,7 +794,7 @@ void ipoib_ib_dev_cleanup(struct net_device *dev)
736void ipoib_pkey_poll(struct work_struct *work) 794void ipoib_pkey_poll(struct work_struct *work)
737{ 795{
738 struct ipoib_dev_priv *priv = 796 struct ipoib_dev_priv *priv =
739 container_of(work, struct ipoib_dev_priv, pkey_task.work); 797 container_of(work, struct ipoib_dev_priv, pkey_poll_task.work);
740 struct net_device *dev = priv->dev; 798 struct net_device *dev = priv->dev;
741 799
742 ipoib_pkey_dev_check_presence(dev); 800 ipoib_pkey_dev_check_presence(dev);
@@ -747,7 +805,7 @@ void ipoib_pkey_poll(struct work_struct *work)
747 mutex_lock(&pkey_mutex); 805 mutex_lock(&pkey_mutex);
748 if (!test_bit(IPOIB_PKEY_STOP, &priv->flags)) 806 if (!test_bit(IPOIB_PKEY_STOP, &priv->flags))
749 queue_delayed_work(ipoib_workqueue, 807 queue_delayed_work(ipoib_workqueue,
750 &priv->pkey_task, 808 &priv->pkey_poll_task,
751 HZ); 809 HZ);
752 mutex_unlock(&pkey_mutex); 810 mutex_unlock(&pkey_mutex);
753 } 811 }
@@ -766,7 +824,7 @@ int ipoib_pkey_dev_delay_open(struct net_device *dev)
766 mutex_lock(&pkey_mutex); 824 mutex_lock(&pkey_mutex);
767 clear_bit(IPOIB_PKEY_STOP, &priv->flags); 825 clear_bit(IPOIB_PKEY_STOP, &priv->flags);
768 queue_delayed_work(ipoib_workqueue, 826 queue_delayed_work(ipoib_workqueue,
769 &priv->pkey_task, 827 &priv->pkey_poll_task,
770 HZ); 828 HZ);
771 mutex_unlock(&pkey_mutex); 829 mutex_unlock(&pkey_mutex);
772 return 1; 830 return 1;
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 0a428f2b05c7..894b1dcdf3eb 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -107,7 +107,7 @@ int ipoib_open(struct net_device *dev)
107 return -EINVAL; 107 return -EINVAL;
108 108
109 if (ipoib_ib_dev_up(dev)) { 109 if (ipoib_ib_dev_up(dev)) {
110 ipoib_ib_dev_stop(dev); 110 ipoib_ib_dev_stop(dev, 1);
111 return -EINVAL; 111 return -EINVAL;
112 } 112 }
113 113
@@ -152,7 +152,7 @@ static int ipoib_stop(struct net_device *dev)
152 flush_workqueue(ipoib_workqueue); 152 flush_workqueue(ipoib_workqueue);
153 153
154 ipoib_ib_dev_down(dev, 1); 154 ipoib_ib_dev_down(dev, 1);
155 ipoib_ib_dev_stop(dev); 155 ipoib_ib_dev_stop(dev, 1);
156 156
157 if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) { 157 if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) {
158 struct ipoib_dev_priv *cpriv; 158 struct ipoib_dev_priv *cpriv;
@@ -988,7 +988,8 @@ static void ipoib_setup(struct net_device *dev)
988 INIT_LIST_HEAD(&priv->dead_ahs); 988 INIT_LIST_HEAD(&priv->dead_ahs);
989 INIT_LIST_HEAD(&priv->multicast_list); 989 INIT_LIST_HEAD(&priv->multicast_list);
990 990
991 INIT_DELAYED_WORK(&priv->pkey_task, ipoib_pkey_poll); 991 INIT_DELAYED_WORK(&priv->pkey_poll_task, ipoib_pkey_poll);
992 INIT_WORK(&priv->pkey_event_task, ipoib_pkey_event);
992 INIT_DELAYED_WORK(&priv->mcast_task, ipoib_mcast_join_task); 993 INIT_DELAYED_WORK(&priv->mcast_task, ipoib_mcast_join_task);
993 INIT_WORK(&priv->flush_task, ipoib_ib_dev_flush); 994 INIT_WORK(&priv->flush_task, ipoib_ib_dev_flush);
994 INIT_WORK(&priv->restart_task, ipoib_mcast_restart_task); 995 INIT_WORK(&priv->restart_task, ipoib_mcast_restart_task);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 54fbead4de01..aae367057a56 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -524,7 +524,7 @@ void ipoib_mcast_join_task(struct work_struct *work)
524 return; 524 return;
525 525
526 if (ib_query_gid(priv->ca, priv->port, 0, &priv->local_gid)) 526 if (ib_query_gid(priv->ca, priv->port, 0, &priv->local_gid))
527 ipoib_warn(priv, "ib_gid_entry_get() failed\n"); 527 ipoib_warn(priv, "ib_query_gid() failed\n");
528 else 528 else
529 memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw, sizeof (union ib_gid)); 529 memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw, sizeof (union ib_gid));
530 530
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
index 5c3c6a43a52b..982eb88e27ec 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
@@ -33,8 +33,6 @@
33 * $Id: ipoib_verbs.c 1349 2004-12-16 21:09:43Z roland $ 33 * $Id: ipoib_verbs.c 1349 2004-12-16 21:09:43Z roland $
34 */ 34 */
35 35
36#include <rdma/ib_cache.h>
37
38#include "ipoib.h" 36#include "ipoib.h"
39 37
40int ipoib_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid) 38int ipoib_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid)
@@ -49,7 +47,7 @@ int ipoib_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid)
49 if (!qp_attr) 47 if (!qp_attr)
50 goto out; 48 goto out;
51 49
52 if (ib_find_cached_pkey(priv->ca, priv->port, priv->pkey, &pkey_index)) { 50 if (ib_find_pkey(priv->ca, priv->port, priv->pkey, &pkey_index)) {
53 clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags); 51 clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
54 ret = -ENXIO; 52 ret = -ENXIO;
55 goto out; 53 goto out;
@@ -94,26 +92,16 @@ int ipoib_init_qp(struct net_device *dev)
94{ 92{
95 struct ipoib_dev_priv *priv = netdev_priv(dev); 93 struct ipoib_dev_priv *priv = netdev_priv(dev);
96 int ret; 94 int ret;
97 u16 pkey_index;
98 struct ib_qp_attr qp_attr; 95 struct ib_qp_attr qp_attr;
99 int attr_mask; 96 int attr_mask;
100 97
101 /* 98 if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags))
102 * Search through the port P_Key table for the requested pkey value. 99 return -1;
103 * The port has to be assigned to the respective IB partition in
104 * advance.
105 */
106 ret = ib_find_cached_pkey(priv->ca, priv->port, priv->pkey, &pkey_index);
107 if (ret) {
108 clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
109 return ret;
110 }
111 set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
112 100
113 qp_attr.qp_state = IB_QPS_INIT; 101 qp_attr.qp_state = IB_QPS_INIT;
114 qp_attr.qkey = 0; 102 qp_attr.qkey = 0;
115 qp_attr.port_num = priv->port; 103 qp_attr.port_num = priv->port;
116 qp_attr.pkey_index = pkey_index; 104 qp_attr.pkey_index = priv->pkey_index;
117 attr_mask = 105 attr_mask =
118 IB_QP_QKEY | 106 IB_QP_QKEY |
119 IB_QP_PORT | 107 IB_QP_PORT |
@@ -185,7 +173,7 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
185 size = ipoib_sendq_size + ipoib_recvq_size + 1; 173 size = ipoib_sendq_size + ipoib_recvq_size + 1;
186 ret = ipoib_cm_dev_init(dev); 174 ret = ipoib_cm_dev_init(dev);
187 if (!ret) 175 if (!ret)
188 size += ipoib_recvq_size; 176 size += ipoib_recvq_size + 1 /* 1 extra for rx_drain_qp */;
189 177
190 priv->cq = ib_create_cq(priv->ca, ipoib_ib_completion, NULL, dev, size, 0); 178 priv->cq = ib_create_cq(priv->ca, ipoib_ib_completion, NULL, dev, size, 0);
191 if (IS_ERR(priv->cq)) { 179 if (IS_ERR(priv->cq)) {
@@ -259,14 +247,18 @@ void ipoib_event(struct ib_event_handler *handler,
259 struct ipoib_dev_priv *priv = 247 struct ipoib_dev_priv *priv =
260 container_of(handler, struct ipoib_dev_priv, event_handler); 248 container_of(handler, struct ipoib_dev_priv, event_handler);
261 249
262 if ((record->event == IB_EVENT_PORT_ERR || 250 if (record->element.port_num != priv->port)
263 record->event == IB_EVENT_PKEY_CHANGE || 251 return;
264 record->event == IB_EVENT_PORT_ACTIVE || 252
265 record->event == IB_EVENT_LID_CHANGE || 253 if (record->event == IB_EVENT_PORT_ERR ||
266 record->event == IB_EVENT_SM_CHANGE || 254 record->event == IB_EVENT_PORT_ACTIVE ||
267 record->event == IB_EVENT_CLIENT_REREGISTER) && 255 record->event == IB_EVENT_LID_CHANGE ||
268 record->element.port_num == priv->port) { 256 record->event == IB_EVENT_SM_CHANGE ||
257 record->event == IB_EVENT_CLIENT_REREGISTER) {
269 ipoib_dbg(priv, "Port state change event\n"); 258 ipoib_dbg(priv, "Port state change event\n");
270 queue_work(ipoib_workqueue, &priv->flush_task); 259 queue_work(ipoib_workqueue, &priv->flush_task);
260 } else if (record->event == IB_EVENT_PKEY_CHANGE) {
261 ipoib_dbg(priv, "P_Key change event on port:%d\n", priv->port);
262 queue_work(ipoib_workqueue, &priv->pkey_event_task);
271 } 263 }
272} 264}
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c
index fb129c479a66..682244b1c042 100644
--- a/drivers/input/joystick/iforce/iforce-main.c
+++ b/drivers/input/joystick/iforce/iforce-main.c
@@ -370,10 +370,8 @@ int iforce_init_device(struct iforce *iforce)
370 370
371/* 371/*
372 * Disable spring, enable force feedback. 372 * Disable spring, enable force feedback.
373 * FIXME: We should use iforce_set_autocenter() et al here.
374 */ 373 */
375 374 iforce_set_autocenter(input_dev, 0);
376 iforce_send_packet(iforce, FF_CMD_AUTOCENTER, "\004\000");
377 375
378/* 376/*
379 * Find appropriate device entry 377 * Find appropriate device entry
diff --git a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c
index 21c4e13d3a50..3154ccd74000 100644
--- a/drivers/input/joystick/iforce/iforce-packets.c
+++ b/drivers/input/joystick/iforce/iforce-packets.c
@@ -246,6 +246,8 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
246 246
247int iforce_get_id_packet(struct iforce *iforce, char *packet) 247int iforce_get_id_packet(struct iforce *iforce, char *packet)
248{ 248{
249 int status;
250
249 switch (iforce->bus) { 251 switch (iforce->bus) {
250 252
251 case IFORCE_USB: 253 case IFORCE_USB:
@@ -254,18 +256,22 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
254 iforce->cr.bRequest = packet[0]; 256 iforce->cr.bRequest = packet[0];
255 iforce->ctrl->dev = iforce->usbdev; 257 iforce->ctrl->dev = iforce->usbdev;
256 258
257 if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC)) 259 status = usb_submit_urb(iforce->ctrl, GFP_ATOMIC);
260 if (status) {
261 err("usb_submit_urb failed %d", status);
258 return -1; 262 return -1;
263 }
259 264
260 wait_event_interruptible_timeout(iforce->wait, 265 wait_event_interruptible_timeout(iforce->wait,
261 iforce->ctrl->status != -EINPROGRESS, HZ); 266 iforce->ctrl->status != -EINPROGRESS, HZ);
262 267
263 if (iforce->ctrl->status) { 268 if (iforce->ctrl->status) {
269 dbg("iforce->ctrl->status = %d", iforce->ctrl->status);
264 usb_unlink_urb(iforce->ctrl); 270 usb_unlink_urb(iforce->ctrl);
265 return -1; 271 return -1;
266 } 272 }
267#else 273#else
268 err("iforce_get_id_packet: iforce->bus = USB!"); 274 dbg("iforce_get_id_packet: iforce->bus = USB!");
269#endif 275#endif
270 break; 276 break;
271 277
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
index 750099d8e3c6..1457b73850e7 100644
--- a/drivers/input/joystick/iforce/iforce-usb.c
+++ b/drivers/input/joystick/iforce/iforce-usb.c
@@ -65,6 +65,7 @@ void iforce_usb_xmit(struct iforce *iforce)
65 XMIT_INC(iforce->xmit.tail, n); 65 XMIT_INC(iforce->xmit.tail, n);
66 66
67 if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) { 67 if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) {
68 clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
68 warn("usb_submit_urb failed %d\n", n); 69 warn("usb_submit_urb failed %d\n", n);
69 } 70 }
70 71
@@ -163,8 +164,8 @@ static int iforce_usb_probe(struct usb_interface *intf,
163 usb_fill_int_urb(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress), 164 usb_fill_int_urb(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress),
164 iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval); 165 iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval);
165 166
166 usb_fill_bulk_urb(iforce->out, dev, usb_sndbulkpipe(dev, epout->bEndpointAddress), 167 usb_fill_int_urb(iforce->out, dev, usb_sndintpipe(dev, epout->bEndpointAddress),
167 iforce + 1, 32, iforce_usb_out, iforce); 168 iforce + 1, 32, iforce_usb_out, iforce, epout->bInterval);
168 169
169 usb_fill_control_urb(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0), 170 usb_fill_control_urb(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0),
170 (void*) &iforce->cr, iforce->edata, 16, iforce_usb_ctrl, iforce); 171 (void*) &iforce->cr, iforce->edata, 16, iforce_usb_ctrl, iforce);
diff --git a/drivers/input/misc/input-polldev.c b/drivers/input/misc/input-polldev.c
index 1b2b9c9c5d88..b773d4c756a6 100644
--- a/drivers/input/misc/input-polldev.c
+++ b/drivers/input/misc/input-polldev.c
@@ -12,6 +12,11 @@
12#include <linux/mutex.h> 12#include <linux/mutex.h>
13#include <linux/input-polldev.h> 13#include <linux/input-polldev.h>
14 14
15MODULE_AUTHOR("Dmitry Torokhov <dtor@mail.ru>");
16MODULE_DESCRIPTION("Generic implementation of a polled input device");
17MODULE_LICENSE("GPL v2");
18MODULE_VERSION("0.1");
19
15static DEFINE_MUTEX(polldev_mutex); 20static DEFINE_MUTEX(polldev_mutex);
16static int polldev_users; 21static int polldev_users;
17static struct workqueue_struct *polldev_wq; 22static struct workqueue_struct *polldev_wq;
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index cf3e4664e72b..2c5f11a4f6b4 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -251,11 +251,15 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
251 251
252 dbg("E7 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]); 252 dbg("E7 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]);
253 253
254 for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++); 254 if (version) {
255 *version = (param[0] << 8) | (param[1] << 4) | i; 255 for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++)
256 /* empty */;
257 *version = (param[0] << 8) | (param[1] << 4) | i;
258 }
256 259
257 for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) 260 for (i = 0; i < ARRAY_SIZE(alps_model_data); i++)
258 if (!memcmp(param, alps_model_data[i].signature, sizeof(alps_model_data[i].signature))) 261 if (!memcmp(param, alps_model_data[i].signature,
262 sizeof(alps_model_data[i].signature)))
259 return alps_model_data + i; 263 return alps_model_data + i;
260 264
261 return NULL; 265 return NULL;
@@ -380,32 +384,46 @@ static int alps_poll(struct psmouse *psmouse)
380 return 0; 384 return 0;
381} 385}
382 386
383static int alps_reconnect(struct psmouse *psmouse) 387static int alps_hw_init(struct psmouse *psmouse, int *version)
384{ 388{
385 struct alps_data *priv = psmouse->private; 389 struct alps_data *priv = psmouse->private;
386 int version;
387
388 psmouse_reset(psmouse);
389 390
390 if (!(priv->i = alps_get_model(psmouse, &version))) 391 priv->i = alps_get_model(psmouse, version);
392 if (!priv->i)
391 return -1; 393 return -1;
392 394
393 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1)) 395 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1))
394 return -1; 396 return -1;
395 397
396 if (alps_tap_mode(psmouse, 1)) { 398 if (alps_tap_mode(psmouse, 1)) {
397 printk(KERN_WARNING "alps.c: Failed to reenable hardware tapping\n"); 399 printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n");
398 return -1; 400 return -1;
399 } 401 }
400 402
401 if (alps_absolute_mode(psmouse)) { 403 if (alps_absolute_mode(psmouse)) {
402 printk(KERN_ERR "alps.c: Failed to reenable absolute mode\n"); 404 printk(KERN_ERR "alps.c: Failed to enable absolute mode\n");
403 return -1; 405 return -1;
404 } 406 }
405 407
406 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0)) 408 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0))
407 return -1; 409 return -1;
408 410
411 /* ALPS needs stream mode, otherwise it won't report any data */
412 if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSTREAM)) {
413 printk(KERN_ERR "alps.c: Failed to enable stream mode\n");
414 return -1;
415 }
416
417 return 0;
418}
419
420static int alps_reconnect(struct psmouse *psmouse)
421{
422 psmouse_reset(psmouse);
423
424 if (alps_hw_init(psmouse, NULL))
425 return -1;
426
409 return 0; 427 return 0;
410} 428}
411 429
@@ -430,23 +448,9 @@ int alps_init(struct psmouse *psmouse)
430 goto init_fail; 448 goto init_fail;
431 449
432 priv->dev2 = dev2; 450 priv->dev2 = dev2;
451 psmouse->private = priv;
433 452
434 priv->i = alps_get_model(psmouse, &version); 453 if (alps_hw_init(psmouse, &version))
435 if (!priv->i)
436 goto init_fail;
437
438 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1))
439 goto init_fail;
440
441 if (alps_tap_mode(psmouse, 1))
442 printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n");
443
444 if (alps_absolute_mode(psmouse)) {
445 printk(KERN_ERR "alps.c: Failed to enable absolute mode\n");
446 goto init_fail;
447 }
448
449 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0))
450 goto init_fail; 454 goto init_fail;
451 455
452 dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY); 456 dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY);
@@ -493,13 +497,13 @@ int alps_init(struct psmouse *psmouse)
493 /* We are having trouble resyncing ALPS touchpads so disable it for now */ 497 /* We are having trouble resyncing ALPS touchpads so disable it for now */
494 psmouse->resync_time = 0; 498 psmouse->resync_time = 0;
495 499
496 psmouse->private = priv;
497 return 0; 500 return 0;
498 501
499init_fail: 502init_fail:
500 psmouse_reset(psmouse); 503 psmouse_reset(psmouse);
501 input_free_device(dev2); 504 input_free_device(dev2);
502 kfree(priv); 505 kfree(priv);
506 psmouse->private = NULL;
503 return -1; 507 return -1;
504} 508}
505 509
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c
index 9df74b72e6c4..0c5660d28caa 100644
--- a/drivers/input/mouse/logips2pp.c
+++ b/drivers/input/mouse/logips2pp.c
@@ -221,6 +221,7 @@ static const struct ps2pp_info *get_model_info(unsigned char model)
221 { 66, PS2PP_KIND_MX, /* MX3100 reciver */ 221 { 66, PS2PP_KIND_MX, /* MX3100 reciver */
222 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | 222 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
223 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL }, 223 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL },
224 { 72, PS2PP_KIND_TRACKMAN, 0 }, /* T-CH11: TrackMan Marble */
224 { 73, 0, PS2PP_SIDE_BTN }, 225 { 73, 0, PS2PP_SIDE_BTN },
225 { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, 226 { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
226 { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, 227 { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c
index 559508795af1..d31ece8f68e9 100644
--- a/drivers/input/serio/sa1111ps2.c
+++ b/drivers/input/serio/sa1111ps2.c
@@ -170,7 +170,7 @@ static void ps2_close(struct serio *io)
170/* 170/*
171 * Clear the input buffer. 171 * Clear the input buffer.
172 */ 172 */
173static void __init ps2_clear_input(struct ps2if *ps2if) 173static void __devinit ps2_clear_input(struct ps2if *ps2if)
174{ 174{
175 int maxread = 100; 175 int maxread = 100;
176 176
@@ -228,7 +228,7 @@ static int __init ps2_test(struct ps2if *ps2if)
228/* 228/*
229 * Add one device to this driver. 229 * Add one device to this driver.
230 */ 230 */
231static int ps2_probe(struct sa1111_dev *dev) 231static int __devinit ps2_probe(struct sa1111_dev *dev)
232{ 232{
233 struct ps2if *ps2if; 233 struct ps2if *ps2if;
234 struct serio *serio; 234 struct serio *serio;
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 4f091800bfeb..e5cca9bd0406 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -12,17 +12,17 @@ menuconfig INPUT_TOUCHSCREEN
12if INPUT_TOUCHSCREEN 12if INPUT_TOUCHSCREEN
13 13
14config TOUCHSCREEN_ADS7846 14config TOUCHSCREEN_ADS7846
15 tristate "ADS 7846/7843 based touchscreens" 15 tristate "ADS7846/TSC2046 and ADS7843 based touchscreens"
16 depends on SPI_MASTER 16 depends on SPI_MASTER
17 depends on HWMON = n || HWMON 17 depends on HWMON = n || HWMON
18 help 18 help
19 Say Y here if you have a touchscreen interface using the 19 Say Y here if you have a touchscreen interface using the
20 ADS7846 or ADS7843 controller, and your board-specific setup 20 ADS7846/TSC2046 or ADS7843 controller, and your board-specific
21 code includes that in its table of SPI devices. 21 setup code includes that in its table of SPI devices.
22 22
23 If HWMON is selected, and the driver is told the reference voltage 23 If HWMON is selected, and the driver is told the reference voltage
24 on your board, you will also get hwmon interfaces for the voltage 24 on your board, you will also get hwmon interfaces for the voltage
25 (and on ads7846, temperature) sensors of this chip. 25 (and on ads7846/tsc2046, temperature) sensors of this chip.
26 26
27 If unsure, say N (but it's safe to say "Y"). 27 If unsure, say N (but it's safe to say "Y").
28 28
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 693e3b2a65a3..1c9069cd3bae 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -39,6 +39,7 @@
39/* 39/*
40 * This code has been heavily tested on a Nokia 770, and lightly 40 * This code has been heavily tested on a Nokia 770, and lightly
41 * tested on other ads7846 devices (OSK/Mistral, Lubbock). 41 * tested on other ads7846 devices (OSK/Mistral, Lubbock).
42 * TSC2046 is just newer ads7846 silicon.
42 * Support for ads7843 tested on Atmel at91sam926x-EK. 43 * Support for ads7843 tested on Atmel at91sam926x-EK.
43 * Support for ads7845 has only been stubbed in. 44 * Support for ads7845 has only been stubbed in.
44 * 45 *
@@ -847,7 +848,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
847 * may not. So we stick to very-portable 8 bit words, both RX and TX. 848 * may not. So we stick to very-portable 8 bit words, both RX and TX.
848 */ 849 */
849 spi->bits_per_word = 8; 850 spi->bits_per_word = 8;
850 spi->mode = SPI_MODE_1; 851 spi->mode = SPI_MODE_0;
851 err = spi_setup(spi); 852 err = spi_setup(spi);
852 if (err < 0) 853 if (err < 0)
853 return err; 854 return err;
diff --git a/drivers/input/touchscreen/hp680_ts_input.c b/drivers/input/touchscreen/hp680_ts_input.c
index 61c15024c2a0..1a15475aedfc 100644
--- a/drivers/input/touchscreen/hp680_ts_input.c
+++ b/drivers/input/touchscreen/hp680_ts_input.c
@@ -1,7 +1,6 @@
1#include <linux/input.h> 1#include <linux/input.h>
2#include <linux/module.h> 2#include <linux/module.h>
3#include <linux/init.h> 3#include <linux/init.h>
4
5#include <linux/interrupt.h> 4#include <linux/interrupt.h>
6#include <asm/io.h> 5#include <asm/io.h>
7#include <asm/delay.h> 6#include <asm/delay.h>
@@ -18,12 +17,12 @@
18#define PHDR 0xa400012e 17#define PHDR 0xa400012e
19#define SCPDR 0xa4000136 18#define SCPDR 0xa4000136
20 19
21static void do_softint(void *data); 20static void do_softint(struct work_struct *work);
22 21
23static struct input_dev *hp680_ts_dev; 22static struct input_dev *hp680_ts_dev;
24static DECLARE_WORK(work, do_softint); 23static DECLARE_DELAYED_WORK(work, do_softint);
25 24
26static void do_softint(void *data) 25static void do_softint(struct work_struct *work)
27{ 26{
28 int absx = 0, absy = 0; 27 int absx = 0, absy = 0;
29 u8 scpdr; 28 u8 scpdr;
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
index 6582816a0477..f0cbcdb008ed 100644
--- a/drivers/input/touchscreen/ucb1400_ts.c
+++ b/drivers/input/touchscreen/ucb1400_ts.c
@@ -288,9 +288,9 @@ static int ucb1400_ts_thread(void *_ucb)
288 struct ucb1400 *ucb = _ucb; 288 struct ucb1400 *ucb = _ucb;
289 struct task_struct *tsk = current; 289 struct task_struct *tsk = current;
290 int valid = 0; 290 int valid = 0;
291 struct sched_param param = { .sched_priority = 1 };
291 292
292 tsk->policy = SCHED_FIFO; 293 sched_setscheduler(tsk, SCHED_FIFO, &param);
293 tsk->rt_priority = 1;
294 294
295 while (!kthread_should_stop()) { 295 while (!kthread_should_stop()) {
296 unsigned int x, y, p; 296 unsigned int x, y, p;
diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig
index d42fe89cddf6..3e088c42b222 100644
--- a/drivers/isdn/Kconfig
+++ b/drivers/isdn/Kconfig
@@ -26,9 +26,9 @@ menu "Old ISDN4Linux"
26 depends on NET && ISDN 26 depends on NET && ISDN
27 27
28config ISDN_I4L 28config ISDN_I4L
29 tristate "Old ISDN4Linux (obsolete)" 29 tristate "Old ISDN4Linux (deprecated)"
30 ---help--- 30 ---help---
31 This driver allows you to use an ISDN-card for networking 31 This driver allows you to use an ISDN adapter for networking
32 connections and as dialin/out device. The isdn-tty's have a built 32 connections and as dialin/out device. The isdn-tty's have a built
33 in AT-compatible modem emulator. Network devices support autodial, 33 in AT-compatible modem emulator. Network devices support autodial,
34 channel-bundling, callback and caller-authentication without having 34 channel-bundling, callback and caller-authentication without having
@@ -39,8 +39,9 @@ config ISDN_I4L
39 39
40 ISDN support in the linux kernel is moving towards a new API, 40 ISDN support in the linux kernel is moving towards a new API,
41 called CAPI (Common ISDN Application Programming Interface). 41 called CAPI (Common ISDN Application Programming Interface).
42 Therefore the old ISDN4Linux layer is becoming obsolete. It is 42 Therefore the old ISDN4Linux layer will eventually become obsolete.
43 still usable, though, if you select this option. 43 It is still available, though, for use with adapters that are not
44 supported by the new CAPI subsystem yet.
44 45
45if ISDN_I4L 46if ISDN_I4L
46source "drivers/isdn/i4l/Kconfig" 47source "drivers/isdn/i4l/Kconfig"
diff --git a/drivers/isdn/hardware/eicon/capifunc.c b/drivers/isdn/hardware/eicon/capifunc.c
index ff284aeb8fbb..82edc1c1db7a 100644
--- a/drivers/isdn/hardware/eicon/capifunc.c
+++ b/drivers/isdn/hardware/eicon/capifunc.c
@@ -189,21 +189,21 @@ void *TransmitBufferSet(APPL * appl, dword ref)
189{ 189{
190 appl->xbuffer_used[ref] = true; 190 appl->xbuffer_used[ref] = true;
191 DBG_PRV1(("%d:xbuf_used(%d)", appl->Id, ref + 1)) 191 DBG_PRV1(("%d:xbuf_used(%d)", appl->Id, ref + 1))
192 return (void *) ref; 192 return (void *)(long)ref;
193} 193}
194 194
195void *TransmitBufferGet(APPL * appl, void *p) 195void *TransmitBufferGet(APPL * appl, void *p)
196{ 196{
197 if (appl->xbuffer_internal[(dword) p]) 197 if (appl->xbuffer_internal[(dword)(long)p])
198 return appl->xbuffer_internal[(dword) p]; 198 return appl->xbuffer_internal[(dword)(long)p];
199 199
200 return appl->xbuffer_ptr[(dword) p]; 200 return appl->xbuffer_ptr[(dword)(long)p];
201} 201}
202 202
203void TransmitBufferFree(APPL * appl, void *p) 203void TransmitBufferFree(APPL * appl, void *p)
204{ 204{
205 appl->xbuffer_used[(dword) p] = false; 205 appl->xbuffer_used[(dword)(long)p] = false;
206 DBG_PRV1(("%d:xbuf_free(%d)", appl->Id, ((dword) p) + 1)) 206 DBG_PRV1(("%d:xbuf_free(%d)", appl->Id, ((dword)(long)p) + 1))
207} 207}
208 208
209void *ReceiveBufferGet(APPL * appl, int Num) 209void *ReceiveBufferGet(APPL * appl, int Num)
@@ -301,7 +301,7 @@ void sendf(APPL * appl, word command, dword Id, word Number, byte * format, ...)
301 /* if DATA_B3_IND, copy data too */ 301 /* if DATA_B3_IND, copy data too */
302 if (command == _DATA_B3_I) { 302 if (command == _DATA_B3_I) {
303 dword data = GET_DWORD(&msg.info.data_b3_ind.Data); 303 dword data = GET_DWORD(&msg.info.data_b3_ind.Data);
304 memcpy(write + length, (void *) data, dlength); 304 memcpy(write + length, (void *)(long)data, dlength);
305 } 305 }
306 306
307#ifndef DIVA_NO_DEBUGLIB 307#ifndef DIVA_NO_DEBUGLIB
@@ -318,7 +318,7 @@ void sendf(APPL * appl, word command, dword Id, word Number, byte * format, ...)
318 if (myDriverDebugHandle.dbgMask & DL_BLK) { 318 if (myDriverDebugHandle.dbgMask & DL_BLK) {
319 xlog("\x00\x02", &msg, 0x81, length); 319 xlog("\x00\x02", &msg, 0x81, length);
320 for (i = 0; i < dlength; i += 256) { 320 for (i = 0; i < dlength; i += 256) {
321 DBG_BLK((((char *) GET_DWORD(&msg.info.data_b3_ind.Data)) + i, 321 DBG_BLK((((char *)(long)GET_DWORD(&msg.info.data_b3_ind.Data)) + i,
322 ((dlength - i) < 256) ? (dlength - i) : 256)) 322 ((dlength - i) < 256) ? (dlength - i) : 256))
323 if (!(myDriverDebugHandle.dbgMask & DL_PRV0)) 323 if (!(myDriverDebugHandle.dbgMask & DL_PRV0))
324 break; /* not more if not explicitely requested */ 324 break; /* not more if not explicitely requested */
diff --git a/drivers/isdn/hardware/eicon/diva_didd.c b/drivers/isdn/hardware/eicon/diva_didd.c
index 14298b8c835f..d755d904e62c 100644
--- a/drivers/isdn/hardware/eicon/diva_didd.c
+++ b/drivers/isdn/hardware/eicon/diva_didd.c
@@ -99,7 +99,7 @@ static int DIVA_INIT_FUNCTION create_proc(void)
99 return (0); 99 return (0);
100} 100}
101 101
102static void DIVA_EXIT_FUNCTION remove_proc(void) 102static void remove_proc(void)
103{ 103{
104 remove_proc_entry(DRIVERLNAME, proc_net_eicon); 104 remove_proc_entry(DRIVERLNAME, proc_net_eicon);
105 remove_proc_entry("net/eicon", NULL); 105 remove_proc_entry("net/eicon", NULL);
diff --git a/drivers/isdn/hardware/eicon/divasfunc.c b/drivers/isdn/hardware/eicon/divasfunc.c
index df61e510a28b..46fc21a3f8ff 100644
--- a/drivers/isdn/hardware/eicon/divasfunc.c
+++ b/drivers/isdn/hardware/eicon/divasfunc.c
@@ -231,7 +231,7 @@ int DIVA_INIT_FUNCTION divasfunc_init(int dbgmask)
231/* 231/*
232 * exit 232 * exit
233 */ 233 */
234void DIVA_EXIT_FUNCTION divasfunc_exit(void) 234void divasfunc_exit(void)
235{ 235{
236 divasa_xdi_driver_unload(); 236 divasa_xdi_driver_unload();
237 disconnect_didd(); 237 disconnect_didd();
diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
index 784232a144c8..ccd35d047ec8 100644
--- a/drivers/isdn/hardware/eicon/message.c
+++ b/drivers/isdn/hardware/eicon/message.c
@@ -1,4 +1,3 @@
1
2/* 1/*
3 * 2 *
4 Copyright (c) Eicon Networks, 2002. 3 Copyright (c) Eicon Networks, 2002.
@@ -533,7 +532,7 @@ word api_put(APPL * appl, CAPI_MSG * msg)
533 if (m->header.command == _DATA_B3_R) 532 if (m->header.command == _DATA_B3_R)
534 { 533 {
535 534
536 m->info.data_b3_req.Data = (dword)(TransmitBufferSet (appl, m->info.data_b3_req.Data)); 535 m->info.data_b3_req.Data = (dword)(long)(TransmitBufferSet (appl, m->info.data_b3_req.Data));
537 536
538 } 537 }
539 538
@@ -1032,7 +1031,7 @@ static void plci_free_msg_in_queue (PLCI *plci)
1032 { 1031 {
1033 1032
1034 TransmitBufferFree (plci->appl, 1033 TransmitBufferFree (plci->appl,
1035 (byte *)(((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[i]))->info.data_b3_req.Data)); 1034 (byte *)(long)(((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[i]))->info.data_b3_req.Data));
1036 1035
1037 } 1036 }
1038 1037
@@ -3118,7 +3117,7 @@ byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci,
3118 && (((byte *)(parms[0].info)) < ((byte *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue))) 3117 && (((byte *)(parms[0].info)) < ((byte *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue)))
3119 { 3118 {
3120 3119
3121 data->P = (byte *)(*((dword *)(parms[0].info))); 3120 data->P = (byte *)(long)(*((dword *)(parms[0].info)));
3122 3121
3123 } 3122 }
3124 else 3123 else
@@ -3151,7 +3150,7 @@ byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci,
3151 && (((byte *)(parms[0].info)) < ((byte *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue))) 3150 && (((byte *)(parms[0].info)) < ((byte *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue)))
3152 { 3151 {
3153 3152
3154 TransmitBufferFree (appl, (byte *)(*((dword *)(parms[0].info)))); 3153 TransmitBufferFree (appl, (byte *)(long)(*((dword *)(parms[0].info))));
3155 3154
3156 } 3155 }
3157 } 3156 }
@@ -4057,7 +4056,7 @@ capi_callback_suffix:
4057 { 4056 {
4058 if (m->header.command == _DATA_B3_R) 4057 if (m->header.command == _DATA_B3_R)
4059 4058
4060 TransmitBufferFree (appl, (byte *)(m->info.data_b3_req.Data)); 4059 TransmitBufferFree (appl, (byte *)(long)(m->info.data_b3_req.Data));
4061 4060
4062 dbug(1,dprintf("Error 0x%04x from msg(0x%04x)", i, m->header.command)); 4061 dbug(1,dprintf("Error 0x%04x from msg(0x%04x)", i, m->header.command));
4063 break; 4062 break;
@@ -7134,7 +7133,7 @@ void nl_ind(PLCI * plci)
7134 case N_UDATA: 7133 case N_UDATA:
7135 if (!(udata_forwarding_table[plci->NL.RBuffer->P[0] >> 5] & (1L << (plci->NL.RBuffer->P[0] & 0x1f)))) 7134 if (!(udata_forwarding_table[plci->NL.RBuffer->P[0] >> 5] & (1L << (plci->NL.RBuffer->P[0] & 0x1f))))
7136 { 7135 {
7137 plci->RData[0].P = plci->internal_ind_buffer + (-((int)(plci->internal_ind_buffer)) & 3); 7136 plci->RData[0].P = plci->internal_ind_buffer + (-((int)(long)(plci->internal_ind_buffer)) & 3);
7138 plci->RData[0].PLength = INTERNAL_IND_BUFFER_SIZE; 7137 plci->RData[0].PLength = INTERNAL_IND_BUFFER_SIZE;
7139 plci->NL.R = plci->RData; 7138 plci->NL.R = plci->RData;
7140 plci->NL.RNum = 1; 7139 plci->NL.RNum = 1;
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index da4196f21e0f..8d53a7fd2671 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -1551,7 +1551,7 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
1551 if (retval == 0) { // yuck 1551 if (retval == 0) { // yuck
1552 cards[i].typ = 0; 1552 cards[i].typ = 0;
1553 nrcards--; 1553 nrcards--;
1554 return retval; 1554 return -EINVAL;
1555 } 1555 }
1556 cs = cards[i].cs; 1556 cs = cards[i].cs;
1557 hisax_d_if->cs = cs; 1557 hisax_d_if->cs = cs;
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index 1f18f1993387..b1a26e02df02 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -485,7 +485,6 @@ fill_isoc_urb(struct urb *urb, struct usb_device *dev, unsigned int pipe,
485{ 485{
486 int k; 486 int k;
487 487
488 spin_lock_init(&urb->lock);
489 urb->dev = dev; 488 urb->dev = dev;
490 urb->pipe = pipe; 489 urb->pipe = pipe;
491 urb->complete = complete; 490 urb->complete = complete;
@@ -578,16 +577,14 @@ stop_isoc_chain(usb_fifo * fifo)
578 "HFC-S USB: Stopping iso chain for fifo %i.%i", 577 "HFC-S USB: Stopping iso chain for fifo %i.%i",
579 fifo->fifonum, i); 578 fifo->fifonum, i);
580#endif 579#endif
581 usb_unlink_urb(fifo->iso[i].purb); 580 usb_kill_urb(fifo->iso[i].purb);
582 usb_free_urb(fifo->iso[i].purb); 581 usb_free_urb(fifo->iso[i].purb);
583 fifo->iso[i].purb = NULL; 582 fifo->iso[i].purb = NULL;
584 } 583 }
585 } 584 }
586 if (fifo->urb) { 585 usb_kill_urb(fifo->urb);
587 usb_unlink_urb(fifo->urb); 586 usb_free_urb(fifo->urb);
588 usb_free_urb(fifo->urb); 587 fifo->urb = NULL;
589 fifo->urb = NULL;
590 }
591 fifo->active = 0; 588 fifo->active = 0;
592} 589}
593 590
@@ -1305,7 +1302,11 @@ usb_init(hfcusb_data * hfc)
1305 } 1302 }
1306 /* default Prot: EURO ISDN, should be a module_param */ 1303 /* default Prot: EURO ISDN, should be a module_param */
1307 hfc->protocol = 2; 1304 hfc->protocol = 2;
1308 hisax_register(&hfc->d_if, p_b_if, "hfc_usb", hfc->protocol); 1305 i = hisax_register(&hfc->d_if, p_b_if, "hfc_usb", hfc->protocol);
1306 if (i) {
1307 printk(KERN_INFO "HFC-S USB: hisax_register -> %d\n", i);
1308 return i;
1309 }
1309 1310
1310#ifdef CONFIG_HISAX_DEBUG 1311#ifdef CONFIG_HISAX_DEBUG
1311 hfc_debug = debug; 1312 hfc_debug = debug;
@@ -1626,11 +1627,9 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
1626#endif 1627#endif
1627 /* init the chip and register the driver */ 1628 /* init the chip and register the driver */
1628 if (usb_init(context)) { 1629 if (usb_init(context)) {
1629 if (context->ctrl_urb) { 1630 usb_kill_urb(context->ctrl_urb);
1630 usb_unlink_urb(context->ctrl_urb); 1631 usb_free_urb(context->ctrl_urb);
1631 usb_free_urb(context->ctrl_urb); 1632 context->ctrl_urb = NULL;
1632 context->ctrl_urb = NULL;
1633 }
1634 kfree(context); 1633 kfree(context);
1635 return (-EIO); 1634 return (-EIO);
1636 } 1635 }
@@ -1682,21 +1681,15 @@ hfc_usb_disconnect(struct usb_interface
1682 i); 1681 i);
1683#endif 1682#endif
1684 } 1683 }
1685 if (context->fifos[i].urb) { 1684 usb_kill_urb(context->fifos[i].urb);
1686 usb_unlink_urb(context->fifos[i].urb); 1685 usb_free_urb(context->fifos[i].urb);
1687 usb_free_urb(context->fifos[i].urb); 1686 context->fifos[i].urb = NULL;
1688 context->fifos[i].urb = NULL;
1689 }
1690 } 1687 }
1691 context->fifos[i].active = 0; 1688 context->fifos[i].active = 0;
1692 } 1689 }
1693 /* wait for all URBS to terminate */ 1690 usb_kill_urb(context->ctrl_urb);
1694 mdelay(10); 1691 usb_free_urb(context->ctrl_urb);
1695 if (context->ctrl_urb) { 1692 context->ctrl_urb = NULL;
1696 usb_unlink_urb(context->ctrl_urb);
1697 usb_free_urb(context->ctrl_urb);
1698 context->ctrl_urb = NULL;
1699 }
1700 hisax_unregister(&context->d_if); 1693 hisax_unregister(&context->d_if);
1701 kfree(context); /* free our structure again */ 1694 kfree(context); /* free our structure again */
1702} /* hfc_usb_disconnect */ 1695} /* hfc_usb_disconnect */
diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c
index 9e088fce8c3a..7993e01f9fc5 100644
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -859,7 +859,11 @@ new_adapter(void)
859 for (i = 0; i < 2; i++) 859 for (i = 0; i < 2; i++)
860 b_if[i] = &adapter->bcs[i].b_if; 860 b_if[i] = &adapter->bcs[i].b_if;
861 861
862 hisax_register(&adapter->isac.hisax_d_if, b_if, "fcpcipnp", protocol); 862 if (hisax_register(&adapter->isac.hisax_d_if, b_if, "fcpcipnp",
863 protocol) != 0) {
864 kfree(adapter);
865 adapter = NULL;
866 }
863 867
864 return adapter; 868 return adapter;
865} 869}
diff --git a/drivers/isdn/hisax/st5481_init.c b/drivers/isdn/hisax/st5481_init.c
index bb3a28a53ff4..13751237bfcd 100644
--- a/drivers/isdn/hisax/st5481_init.c
+++ b/drivers/isdn/hisax/st5481_init.c
@@ -107,12 +107,17 @@ static int probe_st5481(struct usb_interface *intf,
107 for (i = 0; i < 2; i++) 107 for (i = 0; i < 2; i++)
108 b_if[i] = &adapter->bcs[i].b_if; 108 b_if[i] = &adapter->bcs[i].b_if;
109 109
110 hisax_register(&adapter->hisax_d_if, b_if, "st5481_usb", protocol); 110 if (hisax_register(&adapter->hisax_d_if, b_if, "st5481_usb",
111 protocol) != 0)
112 goto err_b1;
113
111 st5481_start(adapter); 114 st5481_start(adapter);
112 115
113 usb_set_intfdata(intf, adapter); 116 usb_set_intfdata(intf, adapter);
114 return 0; 117 return 0;
115 118
119 err_b1:
120 st5481_release_b(&adapter->bcs[1]);
116 err_b: 121 err_b:
117 st5481_release_b(&adapter->bcs[0]); 122 st5481_release_b(&adapter->bcs[0]);
118 err_d: 123 err_d:
diff --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c
index ff1595122048..4ada66b8b679 100644
--- a/drivers/isdn/hisax/st5481_usb.c
+++ b/drivers/isdn/hisax/st5481_usb.c
@@ -407,7 +407,6 @@ fill_isoc_urb(struct urb *urb, struct usb_device *dev,
407{ 407{
408 int k; 408 int k;
409 409
410 spin_lock_init(&urb->lock);
411 urb->dev=dev; 410 urb->dev=dev;
412 urb->pipe=pipe; 411 urb->pipe=pipe;
413 urb->interval = 1; 412 urb->interval = 1;
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index ea5f30d4a5a2..4e5f87c1e714 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -2693,8 +2693,9 @@ isdn_tty_getdial(char *p, char *q,int cnt)
2693 int limit = ISDN_MSNLEN - 1; /* MUST match the size of interface var to avoid 2693 int limit = ISDN_MSNLEN - 1; /* MUST match the size of interface var to avoid
2694 buffer overflow */ 2694 buffer overflow */
2695 2695
2696 while (strchr(" 0123456789,#.*WPTS-", *p) && *p && --cnt>0) { 2696 while (strchr(" 0123456789,#.*WPTSR-", *p) && *p && --cnt>0) {
2697 if ((*p >= '0' && *p <= '9') || ((*p == 'S') && first) || 2697 if ((*p >= '0' && *p <= '9') || ((*p == 'S') && first) ||
2698 ((*p == 'R') && first) ||
2698 (*p == '*') || (*p == '#')) { 2699 (*p == '*') || (*p == '#')) {
2699 *q++ = *p; 2700 *q++ = *p;
2700 limit--; 2701 limit--;
diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c
index 1e699bcaba0f..82d957bde299 100644
--- a/drivers/isdn/icn/icn.c
+++ b/drivers/isdn/icn/icn.c
@@ -12,6 +12,7 @@
12#include "icn.h" 12#include "icn.h"
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/sched.h>
15 16
16static int portbase = ICN_BASEADDR; 17static int portbase = ICN_BASEADDR;
17static unsigned long membase = ICN_MEMADDR; 18static unsigned long membase = ICN_MEMADDR;
diff --git a/drivers/isdn/sc/message.c b/drivers/isdn/sc/message.c
index c5a307e3c496..0b4c4f15abdd 100644
--- a/drivers/isdn/sc/message.c
+++ b/drivers/isdn/sc/message.c
@@ -16,7 +16,7 @@
16 * +1 (416) 297-8565 16 * +1 (416) 297-8565
17 * +1 (416) 297-6433 Facsimile 17 * +1 (416) 297-6433 Facsimile
18 */ 18 */
19 19#include <linux/sched.h>
20#include "includes.h" 20#include "includes.h"
21#include "hardware.h" 21#include "hardware.h"
22#include "message.h" 22#include "message.h"
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 41634fde8e13..1c040d80c641 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -11,6 +11,7 @@
11#include <linux/mutex.h> 11#include <linux/mutex.h>
12#include <linux/spinlock.h> 12#include <linux/spinlock.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <asm/signal.h>
14 15
15#include "vmx.h" 16#include "vmx.h"
16#include <linux/kvm.h> 17#include <linux/kvm.h>
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 0d892600ff00..da985b31b17e 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -40,6 +40,7 @@
40#include <linux/file.h> 40#include <linux/file.h>
41#include <linux/fs.h> 41#include <linux/fs.h>
42#include <linux/mount.h> 42#include <linux/mount.h>
43#include <linux/sched.h>
43 44
44#include "x86_emulate.h" 45#include "x86_emulate.h"
45#include "segment_descriptor.h" 46#include "segment_descriptor.h"
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 9c15f32eea18..fa17d6d4f0cb 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -19,6 +19,7 @@
19#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
20#include <linux/highmem.h> 20#include <linux/highmem.h>
21#include <linux/profile.h> 21#include <linux/profile.h>
22#include <linux/sched.h>
22#include <asm/desc.h> 23#include <asm/desc.h>
23 24
24#include "kvm_svm.h" 25#include "kvm_svm.h"
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 724db0027f00..184238e2ece4 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -22,6 +22,7 @@
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/highmem.h> 23#include <linux/highmem.h>
24#include <linux/profile.h> 24#include <linux/profile.h>
25#include <linux/sched.h>
25#include <asm/io.h> 26#include <asm/io.h>
26#include <asm/desc.h> 27#include <asm/desc.h>
27 28
@@ -638,7 +639,7 @@ static void free_vmcs(struct vmcs *vmcs)
638 free_pages((unsigned long)vmcs, vmcs_descriptor.order); 639 free_pages((unsigned long)vmcs, vmcs_descriptor.order);
639} 640}
640 641
641static __exit void free_kvm_area(void) 642static void free_kvm_area(void)
642{ 643{
643 int cpu; 644 int cpu;
644 645
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index 58926da0ae18..ee699a7d6214 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -113,9 +113,8 @@ config PMAC_SMU
113 113
114config PMAC_APM_EMU 114config PMAC_APM_EMU
115 tristate "APM emulation" 115 tristate "APM emulation"
116 select SYS_SUPPORTS_APM_EMULATION
117 select APM_EMULATION 116 select APM_EMULATION
118 depends on ADB_PMU && PM 117 depends on ADB_PMU && PM && PPC32
119 118
120config PMAC_MEDIABAY 119config PMAC_MEDIABAY
121 bool "Support PowerBook hotswap media bay" 120 bool "Support PowerBook hotswap media bay"
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index b77ef5187d6d..b46817f699f1 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -628,16 +628,16 @@ static void real_leds(unsigned char leds, int device)
628 */ 628 */
629static int adbhid_kbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 629static int adbhid_kbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
630{ 630{
631 struct adbhid *adbhid = dev->private; 631 struct adbhid *adbhid = input_get_drvdata(dev);
632 unsigned char leds; 632 unsigned char leds;
633 633
634 switch (type) { 634 switch (type) {
635 case EV_LED: 635 case EV_LED:
636 leds = (test_bit(LED_SCROLLL, dev->led) ? 4 : 0) 636 leds = (test_bit(LED_SCROLLL, dev->led) ? 4 : 0) |
637 | (test_bit(LED_NUML, dev->led) ? 1 : 0) 637 (test_bit(LED_NUML, dev->led) ? 1 : 0) |
638 | (test_bit(LED_CAPSL, dev->led) ? 2 : 0); 638 (test_bit(LED_CAPSL, dev->led) ? 2 : 0);
639 real_leds(leds, adbhid->id); 639 real_leds(leds, adbhid->id);
640 return 0; 640 return 0;
641 } 641 }
642 642
643 return -1; 643 return -1;
@@ -649,7 +649,7 @@ adb_message_handler(struct notifier_block *this, unsigned long code, void *x)
649 switch (code) { 649 switch (code) {
650 case ADB_MSG_PRE_RESET: 650 case ADB_MSG_PRE_RESET:
651 case ADB_MSG_POWERDOWN: 651 case ADB_MSG_POWERDOWN:
652 /* Stop the repeat timer. Autopoll is already off at this point */ 652 /* Stop the repeat timer. Autopoll is already off at this point */
653 { 653 {
654 int i; 654 int i;
655 for (i = 1; i < 16; i++) { 655 for (i = 1; i < 16; i++) {
@@ -699,7 +699,7 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
699 hid->current_handler_id = current_handler_id; 699 hid->current_handler_id = current_handler_id;
700 hid->mouse_kind = mouse_kind; 700 hid->mouse_kind = mouse_kind;
701 hid->flags = 0; 701 hid->flags = 0;
702 input_dev->private = hid; 702 input_set_drvdata(input_dev, hid);
703 input_dev->name = hid->name; 703 input_dev->name = hid->name;
704 input_dev->phys = hid->phys; 704 input_dev->phys = hid->phys;
705 input_dev->id.bustype = BUS_ADB; 705 input_dev->id.bustype = BUS_ADB;
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 5a4a74c1097c..9620d452d030 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -255,19 +255,25 @@ static struct page *read_sb_page(mddev_t *mddev, long offset, unsigned long inde
255 255
256} 256}
257 257
258static int write_sb_page(mddev_t *mddev, long offset, struct page *page, int wait) 258static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait)
259{ 259{
260 mdk_rdev_t *rdev; 260 mdk_rdev_t *rdev;
261 struct list_head *tmp; 261 struct list_head *tmp;
262 mddev_t *mddev = bitmap->mddev;
262 263
263 ITERATE_RDEV(mddev, rdev, tmp) 264 ITERATE_RDEV(mddev, rdev, tmp)
264 if (test_bit(In_sync, &rdev->flags) 265 if (test_bit(In_sync, &rdev->flags)
265 && !test_bit(Faulty, &rdev->flags)) 266 && !test_bit(Faulty, &rdev->flags)) {
267 int size = PAGE_SIZE;
268 if (page->index == bitmap->file_pages-1)
269 size = roundup(bitmap->last_page_size,
270 bdev_hardsect_size(rdev->bdev));
266 md_super_write(mddev, rdev, 271 md_super_write(mddev, rdev,
267 (rdev->sb_offset<<1) + offset 272 (rdev->sb_offset<<1) + bitmap->offset
268 + page->index * (PAGE_SIZE/512), 273 + page->index * (PAGE_SIZE/512),
269 PAGE_SIZE, 274 size,
270 page); 275 page);
276 }
271 277
272 if (wait) 278 if (wait)
273 md_super_wait(mddev); 279 md_super_wait(mddev);
@@ -282,7 +288,7 @@ static int write_page(struct bitmap *bitmap, struct page *page, int wait)
282 struct buffer_head *bh; 288 struct buffer_head *bh;
283 289
284 if (bitmap->file == NULL) 290 if (bitmap->file == NULL)
285 return write_sb_page(bitmap->mddev, bitmap->offset, page, wait); 291 return write_sb_page(bitmap, page, wait);
286 292
287 bh = page_buffers(page); 293 bh = page_buffers(page);
288 294
@@ -923,6 +929,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
923 } 929 }
924 930
925 bitmap->filemap[bitmap->file_pages++] = page; 931 bitmap->filemap[bitmap->file_pages++] = page;
932 bitmap->last_page_size = count;
926 } 933 }
927 paddr = kmap_atomic(page, KM_USER0); 934 paddr = kmap_atomic(page, KM_USER0);
928 if (bitmap->flags & BITMAP_HOSTENDIAN) 935 if (bitmap->flags & BITMAP_HOSTENDIAN)
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index d5ecd2d53046..192741083196 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -139,8 +139,6 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
139 if (!conf) 139 if (!conf)
140 return NULL; 140 return NULL;
141 141
142 mddev->private = conf;
143
144 cnt = 0; 142 cnt = 0;
145 conf->array_size = 0; 143 conf->array_size = 0;
146 144
@@ -232,7 +230,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
232 * First calculate the device offsets. 230 * First calculate the device offsets.
233 */ 231 */
234 conf->disks[0].offset = 0; 232 conf->disks[0].offset = 0;
235 for (i=1; i<mddev->raid_disks; i++) 233 for (i = 1; i < raid_disks; i++)
236 conf->disks[i].offset = 234 conf->disks[i].offset =
237 conf->disks[i-1].offset + 235 conf->disks[i-1].offset +
238 conf->disks[i-1].size; 236 conf->disks[i-1].size;
@@ -244,7 +242,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
244 curr_offset < conf->array_size; 242 curr_offset < conf->array_size;
245 curr_offset += conf->hash_spacing) { 243 curr_offset += conf->hash_spacing) {
246 244
247 while (i < mddev->raid_disks-1 && 245 while (i < raid_disks-1 &&
248 curr_offset >= conf->disks[i+1].offset) 246 curr_offset >= conf->disks[i+1].offset)
249 i++; 247 i++;
250 248
@@ -299,9 +297,11 @@ static int linear_add(mddev_t *mddev, mdk_rdev_t *rdev)
299 */ 297 */
300 linear_conf_t *newconf; 298 linear_conf_t *newconf;
301 299
302 if (rdev->raid_disk != mddev->raid_disks) 300 if (rdev->saved_raid_disk != mddev->raid_disks)
303 return -EINVAL; 301 return -EINVAL;
304 302
303 rdev->raid_disk = rdev->saved_raid_disk;
304
305 newconf = linear_conf(mddev,mddev->raid_disks+1); 305 newconf = linear_conf(mddev,mddev->raid_disks+1);
306 306
307 if (!newconf) 307 if (!newconf)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c10ce91b64e9..1c54f3c1cca7 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1298,8 +1298,9 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
1298 ITERATE_RDEV(mddev,rdev2,tmp) 1298 ITERATE_RDEV(mddev,rdev2,tmp)
1299 if (rdev2->desc_nr+1 > max_dev) 1299 if (rdev2->desc_nr+1 > max_dev)
1300 max_dev = rdev2->desc_nr+1; 1300 max_dev = rdev2->desc_nr+1;
1301 1301
1302 sb->max_dev = cpu_to_le32(max_dev); 1302 if (max_dev > le32_to_cpu(sb->max_dev))
1303 sb->max_dev = cpu_to_le32(max_dev);
1303 for (i=0; i<max_dev;i++) 1304 for (i=0; i<max_dev;i++)
1304 sb->dev_roles[i] = cpu_to_le16(0xfffe); 1305 sb->dev_roles[i] = cpu_to_le16(0xfffe);
1305 1306
@@ -1365,10 +1366,14 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1365 } 1366 }
1366 /* make sure rdev->size exceeds mddev->size */ 1367 /* make sure rdev->size exceeds mddev->size */
1367 if (rdev->size && (mddev->size == 0 || rdev->size < mddev->size)) { 1368 if (rdev->size && (mddev->size == 0 || rdev->size < mddev->size)) {
1368 if (mddev->pers) 1369 if (mddev->pers) {
1369 /* Cannot change size, so fail */ 1370 /* Cannot change size, so fail
1370 return -ENOSPC; 1371 * If mddev->level <= 0, then we don't care
1371 else 1372 * about aligning sizes (e.g. linear)
1373 */
1374 if (mddev->level > 0)
1375 return -ENOSPC;
1376 } else
1372 mddev->size = rdev->size; 1377 mddev->size = rdev->size;
1373 } 1378 }
1374 1379
@@ -2142,6 +2147,9 @@ static void analyze_sbs(mddev_t * mddev)
2142 rdev->desc_nr = i++; 2147 rdev->desc_nr = i++;
2143 rdev->raid_disk = rdev->desc_nr; 2148 rdev->raid_disk = rdev->desc_nr;
2144 set_bit(In_sync, &rdev->flags); 2149 set_bit(In_sync, &rdev->flags);
2150 } else if (rdev->raid_disk >= mddev->raid_disks) {
2151 rdev->raid_disk = -1;
2152 clear_bit(In_sync, &rdev->flags);
2145 } 2153 }
2146 } 2154 }
2147 2155
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index dfe32149ad3a..2c404f73a377 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -415,7 +415,7 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio)
415 raid0_conf_t *conf = mddev_to_conf(mddev); 415 raid0_conf_t *conf = mddev_to_conf(mddev);
416 struct strip_zone *zone; 416 struct strip_zone *zone;
417 mdk_rdev_t *tmp_dev; 417 mdk_rdev_t *tmp_dev;
418 unsigned long chunk; 418 sector_t chunk;
419 sector_t block, rsect; 419 sector_t block, rsect;
420 const int rw = bio_data_dir(bio); 420 const int rw = bio_data_dir(bio);
421 421
@@ -470,7 +470,6 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio)
470 470
471 sector_div(x, zone->nb_dev); 471 sector_div(x, zone->nb_dev);
472 chunk = x; 472 chunk = x;
473 BUG_ON(x != (sector_t)chunk);
474 473
475 x = block >> chunksize_bits; 474 x = block >> chunksize_bits;
476 tmp_dev = zone->dev[sector_div(x, zone->nb_dev)]; 475 tmp_dev = zone->dev[sector_div(x, zone->nb_dev)];
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c
index 0393a3d19920..e908e3cf1e50 100644
--- a/drivers/media/dvb/bt8xx/dst.c
+++ b/drivers/media/dvb/bt8xx/dst.c
@@ -1721,9 +1721,6 @@ static void dst_release(struct dvb_frontend *fe)
1721 symbol_put(dst_ca_attach); 1721 symbol_put(dst_ca_attach);
1722#endif 1722#endif
1723 } 1723 }
1724#ifdef CONFIG_DVB_CORE_ATTACH
1725 symbol_put(dst_attach);
1726#endif
1727 kfree(state); 1724 kfree(state);
1728} 1725}
1729 1726
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index e23d8a0ea1d3..a9fa3337dd81 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -200,7 +200,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
200{ 200{
201 struct dvb_device *dvbdev; 201 struct dvb_device *dvbdev;
202 struct file_operations *dvbdevfops; 202 struct file_operations *dvbdevfops;
203 203 struct class_device *clsdev;
204 int id; 204 int id;
205 205
206 mutex_lock(&dvbdev_register_lock); 206 mutex_lock(&dvbdev_register_lock);
@@ -242,8 +242,15 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
242 242
243 mutex_unlock(&dvbdev_register_lock); 243 mutex_unlock(&dvbdev_register_lock);
244 244
245 class_device_create(dvb_class, NULL, MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), 245 clsdev = class_device_create(dvb_class, NULL, MKDEV(DVB_MAJOR,
246 adap->device, "dvb%d.%s%d", adap->num, dnames[type], id); 246 nums2minor(adap->num, type, id)),
247 adap->device, "dvb%d.%s%d", adap->num,
248 dnames[type], id);
249 if (IS_ERR(clsdev)) {
250 printk(KERN_ERR "%s: failed to create device dvb%d.%s%d (%ld)\n",
251 __FUNCTION__, adap->num, dnames[type], id, PTR_ERR(clsdev));
252 return PTR_ERR(clsdev);
253 }
247 254
248 dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n", 255 dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n",
249 adap->num, dnames[type], id, nums2minor(adap->num, type, id), 256 adap->num, dnames[type], id, nums2minor(adap->num, type, id),
@@ -431,7 +438,7 @@ static void __exit exit_dvbdev(void)
431 unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS); 438 unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS);
432} 439}
433 440
434module_init(init_dvbdev); 441subsys_initcall(init_dvbdev);
435module_exit(exit_dvbdev); 442module_exit(exit_dvbdev);
436 443
437MODULE_DESCRIPTION("DVB Core Driver"); 444MODULE_DESCRIPTION("DVB Core Driver");
diff --git a/drivers/media/video/cafe_ccic-regs.h b/drivers/media/video/cafe_ccic-regs.h
index b2c22a0d6643..8e2a87cdc791 100644
--- a/drivers/media/video/cafe_ccic-regs.h
+++ b/drivers/media/video/cafe_ccic-regs.h
@@ -150,6 +150,12 @@
150#define REG_GL_IMASK 0x300c /* Interrupt mask register */ 150#define REG_GL_IMASK 0x300c /* Interrupt mask register */
151#define GIMSK_CCIC_EN 0x00000004 /* CCIC Interrupt enable */ 151#define GIMSK_CCIC_EN 0x00000004 /* CCIC Interrupt enable */
152 152
153#define REG_GL_FCR 0x3038 /* GPIO functional control register */
154#define GFCR_GPIO_ON 0x08 /* Camera GPIO enabled */
155#define REG_GL_GPIOR 0x315c /* GPIO register */
156#define GGPIO_OUT 0x80000 /* GPIO output */
157#define GGPIO_VAL 0x00008 /* Output pin value */
158
153#define REG_LEN REG_GL_IMASK + 4 159#define REG_LEN REG_GL_IMASK + 4
154 160
155 161
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 96254dbaf625..c08f650df423 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -775,6 +775,12 @@ static void cafe_ctlr_power_up(struct cafe_camera *cam)
775 spin_lock_irqsave(&cam->dev_lock, flags); 775 spin_lock_irqsave(&cam->dev_lock, flags);
776 cafe_reg_clear_bit(cam, REG_CTRL1, C1_PWRDWN); 776 cafe_reg_clear_bit(cam, REG_CTRL1, C1_PWRDWN);
777 /* 777 /*
778 * Part one of the sensor dance: turn the global
779 * GPIO signal on.
780 */
781 cafe_reg_write(cam, REG_GL_FCR, GFCR_GPIO_ON);
782 cafe_reg_write(cam, REG_GL_GPIOR, GGPIO_OUT|GGPIO_VAL);
783 /*
778 * Put the sensor into operational mode (assumes OLPC-style 784 * Put the sensor into operational mode (assumes OLPC-style
779 * wiring). Control 0 is reset - set to 1 to operate. 785 * wiring). Control 0 is reset - set to 1 to operate.
780 * Control 1 is power down, set to 0 to operate. 786 * Control 1 is power down, set to 0 to operate.
@@ -784,6 +790,7 @@ static void cafe_ctlr_power_up(struct cafe_camera *cam)
784 cafe_reg_write(cam, REG_GPR, GPR_C1EN|GPR_C0EN|GPR_C0); 790 cafe_reg_write(cam, REG_GPR, GPR_C1EN|GPR_C0EN|GPR_C0);
785// mdelay(1); /* Enough? */ 791// mdelay(1); /* Enough? */
786 spin_unlock_irqrestore(&cam->dev_lock, flags); 792 spin_unlock_irqrestore(&cam->dev_lock, flags);
793 msleep(5); /* Just to be sure */
787} 794}
788 795
789static void cafe_ctlr_power_down(struct cafe_camera *cam) 796static void cafe_ctlr_power_down(struct cafe_camera *cam)
@@ -792,6 +799,8 @@ static void cafe_ctlr_power_down(struct cafe_camera *cam)
792 799
793 spin_lock_irqsave(&cam->dev_lock, flags); 800 spin_lock_irqsave(&cam->dev_lock, flags);
794 cafe_reg_write(cam, REG_GPR, GPR_C1EN|GPR_C0EN|GPR_C1); 801 cafe_reg_write(cam, REG_GPR, GPR_C1EN|GPR_C0EN|GPR_C1);
802 cafe_reg_write(cam, REG_GL_FCR, GFCR_GPIO_ON);
803 cafe_reg_write(cam, REG_GL_GPIOR, GGPIO_OUT);
795 cafe_reg_set_bit(cam, REG_CTRL1, C1_PWRDWN); 804 cafe_reg_set_bit(cam, REG_CTRL1, C1_PWRDWN);
796 spin_unlock_irqrestore(&cam->dev_lock, flags); 805 spin_unlock_irqrestore(&cam->dev_lock, flags);
797} 806}
@@ -851,6 +860,7 @@ static int cafe_cam_init(struct cafe_camera *cam)
851 ret = 0; 860 ret = 0;
852 cam->state = S_IDLE; 861 cam->state = S_IDLE;
853 out: 862 out:
863 cafe_ctlr_power_down(cam);
854 mutex_unlock(&cam->s_mutex); 864 mutex_unlock(&cam->s_mutex);
855 return ret; 865 return ret;
856} 866}
@@ -2103,10 +2113,16 @@ static int cafe_pci_probe(struct pci_dev *pdev,
2103 ret = request_irq(pdev->irq, cafe_irq, IRQF_SHARED, "cafe-ccic", cam); 2113 ret = request_irq(pdev->irq, cafe_irq, IRQF_SHARED, "cafe-ccic", cam);
2104 if (ret) 2114 if (ret)
2105 goto out_iounmap; 2115 goto out_iounmap;
2116 /*
2117 * Initialize the controller and leave it powered up. It will
2118 * stay that way until the sensor driver shows up.
2119 */
2106 cafe_ctlr_init(cam); 2120 cafe_ctlr_init(cam);
2107 cafe_ctlr_power_up(cam); 2121 cafe_ctlr_power_up(cam);
2108 /* 2122 /*
2109 * Set up I2C/SMBUS communications 2123 * Set up I2C/SMBUS communications. We have to drop the mutex here
2124 * because the sensor could attach in this call chain, leading to
2125 * unsightly deadlocks.
2110 */ 2126 */
2111 mutex_unlock(&cam->s_mutex); /* attach can deadlock */ 2127 mutex_unlock(&cam->s_mutex); /* attach can deadlock */
2112 ret = cafe_smbus_setup(cam); 2128 ret = cafe_smbus_setup(cam);
diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig
index 2c450bd05af5..5b6a40371602 100644
--- a/drivers/media/video/em28xx/Kconfig
+++ b/drivers/media/video/em28xx/Kconfig
@@ -1,7 +1,6 @@
1config VIDEO_EM28XX 1config VIDEO_EM28XX
2 tristate "Empia EM2800/2820/2840 USB video capture support" 2 tristate "Empia EM2800/2820/2840 USB video capture support"
3 depends on VIDEO_V4L1 && I2C && PCI 3 depends on VIDEO_V4L1 && I2C
4 select VIDEO_BUF
5 select VIDEO_TUNER 4 select VIDEO_TUNER
6 select VIDEO_TVEEPROM 5 select VIDEO_TVEEPROM
7 select VIDEO_IR 6 select VIDEO_IR
diff --git a/drivers/media/video/ivtv/Kconfig b/drivers/media/video/ivtv/Kconfig
index 0cc98a0e2496..1aaeaa02f158 100644
--- a/drivers/media/video/ivtv/Kconfig
+++ b/drivers/media/video/ivtv/Kconfig
@@ -1,6 +1,6 @@
1config VIDEO_IVTV 1config VIDEO_IVTV
2 tristate "Conexant cx23416/cx23415 MPEG encoder/decoder support" 2 tristate "Conexant cx23416/cx23415 MPEG encoder/decoder support"
3 depends on VIDEO_V4L1 && VIDEO_V4L2 && USB && I2C && EXPERIMENTAL && PCI 3 depends on VIDEO_V4L1 && VIDEO_V4L2 && PCI && I2C && EXPERIMENTAL
4 select FW_LOADER 4 select FW_LOADER
5 select VIDEO_TUNER 5 select VIDEO_TUNER
6 select VIDEO_TVEEPROM 6 select VIDEO_TVEEPROM
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h
index 9a412d6c6d06..552f04511ead 100644
--- a/drivers/media/video/ivtv/ivtv-driver.h
+++ b/drivers/media/video/ivtv/ivtv-driver.h
@@ -67,14 +67,6 @@
67 67
68#include <media/ivtv.h> 68#include <media/ivtv.h>
69 69
70#ifdef CONFIG_LIRC_I2C
71# error "This driver is not compatible with the LIRC I2C kernel configuration option."
72#endif /* CONFIG_LIRC_I2C */
73
74#ifndef CONFIG_PCI
75# error "This driver requires kernel PCI support."
76#endif /* CONFIG_PCI */
77
78#define IVTV_ENCODER_OFFSET 0x00000000 70#define IVTV_ENCODER_OFFSET 0x00000000
79#define IVTV_ENCODER_SIZE 0x00800000 /* Last half isn't needed 0x01000000 */ 71#define IVTV_ENCODER_SIZE 0x00800000 /* Last half isn't needed 0x01000000 */
80 72
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 794a6a02f82f..1989ec1cb973 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -362,8 +362,6 @@ static int ivtv_get_fmt(struct ivtv *itv, int streamtype, struct v4l2_format *fm
362 case V4L2_BUF_TYPE_VIDEO_OUTPUT: 362 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
363 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) 363 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT))
364 return -EINVAL; 364 return -EINVAL;
365 fmt->fmt.pix.left = itv->main_rect.left;
366 fmt->fmt.pix.top = itv->main_rect.top;
367 fmt->fmt.pix.width = itv->main_rect.width; 365 fmt->fmt.pix.width = itv->main_rect.width;
368 fmt->fmt.pix.height = itv->main_rect.height; 366 fmt->fmt.pix.height = itv->main_rect.height;
369 fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; 367 fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
@@ -402,8 +400,6 @@ static int ivtv_get_fmt(struct ivtv *itv, int streamtype, struct v4l2_format *fm
402 break; 400 break;
403 401
404 case V4L2_BUF_TYPE_VIDEO_CAPTURE: 402 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
405 fmt->fmt.pix.left = 0;
406 fmt->fmt.pix.top = 0;
407 fmt->fmt.pix.width = itv->params.width; 403 fmt->fmt.pix.width = itv->params.width;
408 fmt->fmt.pix.height = itv->params.height; 404 fmt->fmt.pix.height = itv->params.height;
409 fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; 405 fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
@@ -498,15 +494,13 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype,
498 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) 494 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT))
499 return -EINVAL; 495 return -EINVAL;
500 field = fmt->fmt.pix.field; 496 field = fmt->fmt.pix.field;
501 r.top = fmt->fmt.pix.top; 497 r.top = 0;
502 r.left = fmt->fmt.pix.left; 498 r.left = 0;
503 r.width = fmt->fmt.pix.width; 499 r.width = fmt->fmt.pix.width;
504 r.height = fmt->fmt.pix.height; 500 r.height = fmt->fmt.pix.height;
505 ivtv_get_fmt(itv, streamtype, fmt); 501 ivtv_get_fmt(itv, streamtype, fmt);
506 if (itv->output_mode != OUT_UDMA_YUV) { 502 if (itv->output_mode != OUT_UDMA_YUV) {
507 /* TODO: would setting the rect also be valid for this mode? */ 503 /* TODO: would setting the rect also be valid for this mode? */
508 fmt->fmt.pix.top = r.top;
509 fmt->fmt.pix.left = r.left;
510 fmt->fmt.pix.width = r.width; 504 fmt->fmt.pix.width = r.width;
511 fmt->fmt.pix.height = r.height; 505 fmt->fmt.pix.height = r.height;
512 } 506 }
@@ -1141,8 +1135,6 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void
1141 fb->fmt.pixelformat = itv->osd_pixelformat; 1135 fb->fmt.pixelformat = itv->osd_pixelformat;
1142 fb->fmt.width = itv->osd_rect.width; 1136 fb->fmt.width = itv->osd_rect.width;
1143 fb->fmt.height = itv->osd_rect.height; 1137 fb->fmt.height = itv->osd_rect.height;
1144 fb->fmt.left = itv->osd_rect.left;
1145 fb->fmt.top = itv->osd_rect.top;
1146 fb->base = (void *)itv->osd_video_pbase; 1138 fb->base = (void *)itv->osd_video_pbase;
1147 if (itv->osd_global_alpha_state) 1139 if (itv->osd_global_alpha_state)
1148 fb->flags |= V4L2_FBUF_FLAG_GLOBAL_ALPHA; 1140 fb->flags |= V4L2_FBUF_FLAG_GLOBAL_ALPHA;
diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c
index 03bc369a9e49..3ceb8a6249dd 100644
--- a/drivers/media/video/ov7670.c
+++ b/drivers/media/video/ov7670.c
@@ -720,12 +720,22 @@ static int ov7670_s_fmt(struct i2c_client *c, struct v4l2_format *fmt)
720 struct ov7670_format_struct *ovfmt; 720 struct ov7670_format_struct *ovfmt;
721 struct ov7670_win_size *wsize; 721 struct ov7670_win_size *wsize;
722 struct ov7670_info *info = i2c_get_clientdata(c); 722 struct ov7670_info *info = i2c_get_clientdata(c);
723 unsigned char com7; 723 unsigned char com7, clkrc;
724 724
725 ret = ov7670_try_fmt(c, fmt, &ovfmt, &wsize); 725 ret = ov7670_try_fmt(c, fmt, &ovfmt, &wsize);
726 if (ret) 726 if (ret)
727 return ret; 727 return ret;
728 /* 728 /*
729 * HACK: if we're running rgb565 we need to grab then rewrite
730 * CLKRC. If we're *not*, however, then rewriting clkrc hoses
731 * the colors.
732 */
733 if (fmt->fmt.pix.pixelformat == V4L2_PIX_FMT_RGB565) {
734 ret = ov7670_read(c, REG_CLKRC, &clkrc);
735 if (ret)
736 return ret;
737 }
738 /*
729 * COM7 is a pain in the ass, it doesn't like to be read then 739 * COM7 is a pain in the ass, it doesn't like to be read then
730 * quickly written afterward. But we have everything we need 740 * quickly written afterward. But we have everything we need
731 * to set it absolutely here, as long as the format-specific 741 * to set it absolutely here, as long as the format-specific
@@ -744,7 +754,10 @@ static int ov7670_s_fmt(struct i2c_client *c, struct v4l2_format *fmt)
744 if (wsize->regs) 754 if (wsize->regs)
745 ret = ov7670_write_array(c, wsize->regs); 755 ret = ov7670_write_array(c, wsize->regs);
746 info->fmt = ovfmt; 756 info->fmt = ovfmt;
747 return 0; 757
758 if (fmt->fmt.pix.pixelformat == V4L2_PIX_FMT_RGB565 && ret == 0)
759 ret = ov7670_write(c, REG_CLKRC, clkrc);
760 return ret;
748} 761}
749 762
750/* 763/*
@@ -1267,7 +1280,9 @@ static int ov7670_attach(struct i2c_adapter *adapter)
1267 ret = ov7670_detect(client); 1280 ret = ov7670_detect(client);
1268 if (ret) 1281 if (ret)
1269 goto out_free_info; 1282 goto out_free_info;
1270 i2c_attach_client(client); 1283 ret = i2c_attach_client(client);
1284 if (ret)
1285 goto out_free_info;
1271 return 0; 1286 return 0;
1272 1287
1273 out_free_info: 1288 out_free_info:
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index 1b9b0742f753..c40b92ce1fad 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -205,9 +205,13 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
205 /* 0x01 -> ??? no change ??? */ 205 /* 0x01 -> ??? no change ??? */
206 /* 0x02 -> PAL BDGHI / SECAM L */ 206 /* 0x02 -> PAL BDGHI / SECAM L */
207 /* 0x04 -> ??? PAL others / SECAM others ??? */ 207 /* 0x04 -> ??? PAL others / SECAM others ??? */
208 cb &= ~0x02; 208 cb &= ~0x03;
209 if (t->std & V4L2_STD_SECAM) 209 if (t->std & V4L2_STD_SECAM_L) //also valid for V4L2_STD_SECAM
210 cb |= 0x02; 210 cb |= PHILIPS_MF_SET_PAL_L;
211 else if (t->std & V4L2_STD_SECAM_LC)
212 cb |= PHILIPS_MF_SET_PAL_L2;
213 else /* V4L2_STD_B|V4L2_STD_GH */
214 cb |= PHILIPS_MF_SET_BG;
211 break; 215 break;
212 216
213 case TUNER_TEMIC_4046FM5: 217 case TUNER_TEMIC_4046FM5:
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index d25d3be8fcd2..165f81d16d00 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -436,7 +436,7 @@ typedef struct _MPT_SAS_MGMT {
436typedef struct _mpt_ioctl_events { 436typedef struct _mpt_ioctl_events {
437 u32 event; /* Specified by define above */ 437 u32 event; /* Specified by define above */
438 u32 eventContext; /* Index or counter */ 438 u32 eventContext; /* Index or counter */
439 int data[2]; /* First 8 bytes of Event Data */ 439 u32 data[2]; /* First 8 bytes of Event Data */
440} MPT_IOCTL_EVENTS; 440} MPT_IOCTL_EVENTS;
441 441
442/* 442/*
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index fa0f7761652a..3bd94f11e7d6 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -2463,11 +2463,11 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
2463 ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE; 2463 ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE;
2464 ioc->events[idx].eventContext = ioc->eventContext; 2464 ioc->events[idx].eventContext = ioc->eventContext;
2465 2465
2466 ioc->events[idx].data[0] = (pReq->LUN[1] << 24) || 2466 ioc->events[idx].data[0] = (pReq->LUN[1] << 24) |
2467 (MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) || 2467 (MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) |
2468 (sc->device->channel << 8) || sc->device->id; 2468 (sc->device->channel << 8) | sc->device->id;
2469 2469
2470 ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12]; 2470 ioc->events[idx].data[1] = (sense_data[13] << 8) | sense_data[12];
2471 2471
2472 ioc->eventContext++; 2472 ioc->eventContext++;
2473 if (hd->ioc->pcidev->vendor == 2473 if (hd->ioc->pcidev->vendor ==
diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c
index d3235f213c89..e0d474b17433 100644
--- a/drivers/message/i2o/driver.c
+++ b/drivers/message/i2o/driver.c
@@ -123,8 +123,12 @@ int i2o_driver_register(struct i2o_driver *drv)
123 } 123 }
124 124
125 rc = driver_register(&drv->driver); 125 rc = driver_register(&drv->driver);
126 if (rc) 126 if (rc) {
127 destroy_workqueue(drv->event_queue); 127 if (drv->event) {
128 destroy_workqueue(drv->event_queue);
129 drv->event_queue = NULL;
130 }
131 }
128 132
129 return rc; 133 return rc;
130}; 134};
@@ -256,7 +260,7 @@ void i2o_driver_notify_controller_add_all(struct i2o_controller *c)
256 int i; 260 int i;
257 struct i2o_driver *drv; 261 struct i2o_driver *drv;
258 262
259 for (i = 0; i < I2O_MAX_DRIVERS; i++) { 263 for (i = 0; i < i2o_max_drivers; i++) {
260 drv = i2o_drivers[i]; 264 drv = i2o_drivers[i];
261 265
262 if (drv) 266 if (drv)
@@ -276,7 +280,7 @@ void i2o_driver_notify_controller_remove_all(struct i2o_controller *c)
276 int i; 280 int i;
277 struct i2o_driver *drv; 281 struct i2o_driver *drv;
278 282
279 for (i = 0; i < I2O_MAX_DRIVERS; i++) { 283 for (i = 0; i < i2o_max_drivers; i++) {
280 drv = i2o_drivers[i]; 284 drv = i2o_drivers[i];
281 285
282 if (drv) 286 if (drv)
@@ -295,7 +299,7 @@ void i2o_driver_notify_device_add_all(struct i2o_device *i2o_dev)
295 int i; 299 int i;
296 struct i2o_driver *drv; 300 struct i2o_driver *drv;
297 301
298 for (i = 0; i < I2O_MAX_DRIVERS; i++) { 302 for (i = 0; i < i2o_max_drivers; i++) {
299 drv = i2o_drivers[i]; 303 drv = i2o_drivers[i];
300 304
301 if (drv) 305 if (drv)
@@ -314,7 +318,7 @@ void i2o_driver_notify_device_remove_all(struct i2o_device *i2o_dev)
314 int i; 318 int i;
315 struct i2o_driver *drv; 319 struct i2o_driver *drv;
316 320
317 for (i = 0; i < I2O_MAX_DRIVERS; i++) { 321 for (i = 0; i < i2o_max_drivers; i++) {
318 drv = i2o_drivers[i]; 322 drv = i2o_drivers[i];
319 323
320 if (drv) 324 if (drv)
@@ -335,17 +339,15 @@ int __init i2o_driver_init(void)
335 339
336 spin_lock_init(&i2o_drivers_lock); 340 spin_lock_init(&i2o_drivers_lock);
337 341
338 if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64) || 342 if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64)) {
339 ((i2o_max_drivers ^ (i2o_max_drivers - 1)) != 343 osm_warn("max_drivers set to %d, but must be >=2 and <= 64\n",
340 (2 * i2o_max_drivers - 1))) { 344 i2o_max_drivers);
341 osm_warn("max_drivers set to %d, but must be >=2 and <= 64 and "
342 "a power of 2\n", i2o_max_drivers);
343 i2o_max_drivers = I2O_MAX_DRIVERS; 345 i2o_max_drivers = I2O_MAX_DRIVERS;
344 } 346 }
345 osm_info("max drivers = %d\n", i2o_max_drivers); 347 osm_info("max drivers = %d\n", i2o_max_drivers);
346 348
347 i2o_drivers = 349 i2o_drivers =
348 kzalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL); 350 kcalloc(i2o_max_drivers, sizeof(*i2o_drivers), GFP_KERNEL);
349 if (!i2o_drivers) 351 if (!i2o_drivers)
350 return -ENOMEM; 352 return -ENOMEM;
351 353
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c
index cb8c264eaff0..7772bd1d92b4 100644
--- a/drivers/mfd/ucb1x00-ts.c
+++ b/drivers/mfd/ucb1x00-ts.c
@@ -207,16 +207,7 @@ static int ucb1x00_thread(void *_ts)
207 struct ucb1x00_ts *ts = _ts; 207 struct ucb1x00_ts *ts = _ts;
208 struct task_struct *tsk = current; 208 struct task_struct *tsk = current;
209 DECLARE_WAITQUEUE(wait, tsk); 209 DECLARE_WAITQUEUE(wait, tsk);
210 int valid; 210 int valid = 0;
211
212 /*
213 * We could run as a real-time thread. However, thus far
214 * this doesn't seem to be necessary.
215 */
216// tsk->policy = SCHED_FIFO;
217// tsk->rt_priority = 1;
218
219 valid = 0;
220 211
221 add_wait_queue(&ts->irq_wait, &wait); 212 add_wait_queue(&ts->irq_wait, &wait);
222 while (!kthread_should_stop()) { 213 while (!kthread_should_stop()) {
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
index 35b139b0e5f2..5108b7c576df 100644
--- a/drivers/misc/phantom.c
+++ b/drivers/misc/phantom.c
@@ -47,6 +47,7 @@ struct phantom_device {
47 struct cdev cdev; 47 struct cdev cdev;
48 48
49 struct mutex open_lock; 49 struct mutex open_lock;
50 spinlock_t ioctl_lock;
50}; 51};
51 52
52static unsigned char phantom_devices[PHANTOM_MAX_MINORS]; 53static unsigned char phantom_devices[PHANTOM_MAX_MINORS];
@@ -59,8 +60,11 @@ static int phantom_status(struct phantom_device *dev, unsigned long newstat)
59 atomic_set(&dev->counter, 0); 60 atomic_set(&dev->counter, 0);
60 iowrite32(PHN_CTL_IRQ, dev->iaddr + PHN_CONTROL); 61 iowrite32(PHN_CTL_IRQ, dev->iaddr + PHN_CONTROL);
61 iowrite32(0x43, dev->caddr + PHN_IRQCTL); 62 iowrite32(0x43, dev->caddr + PHN_IRQCTL);
62 } else if ((dev->status & PHB_RUNNING) && !(newstat & PHB_RUNNING)) 63 ioread32(dev->caddr + PHN_IRQCTL); /* PCI posting */
64 } else if ((dev->status & PHB_RUNNING) && !(newstat & PHB_RUNNING)) {
63 iowrite32(0, dev->caddr + PHN_IRQCTL); 65 iowrite32(0, dev->caddr + PHN_IRQCTL);
66 ioread32(dev->caddr + PHN_IRQCTL); /* PCI posting */
67 }
64 68
65 dev->status = newstat; 69 dev->status = newstat;
66 70
@@ -71,8 +75,8 @@ static int phantom_status(struct phantom_device *dev, unsigned long newstat)
71 * File ops 75 * File ops
72 */ 76 */
73 77
74static int phantom_ioctl(struct inode *inode, struct file *file, u_int cmd, 78static long phantom_ioctl(struct file *file, unsigned int cmd,
75 u_long arg) 79 unsigned long arg)
76{ 80{
77 struct phantom_device *dev = file->private_data; 81 struct phantom_device *dev = file->private_data;
78 struct phm_regs rs; 82 struct phm_regs rs;
@@ -92,24 +96,32 @@ static int phantom_ioctl(struct inode *inode, struct file *file, u_int cmd,
92 if (r.reg > 7) 96 if (r.reg > 7)
93 return -EINVAL; 97 return -EINVAL;
94 98
99 spin_lock(&dev->ioctl_lock);
95 if (r.reg == PHN_CONTROL && (r.value & PHN_CTL_IRQ) && 100 if (r.reg == PHN_CONTROL && (r.value & PHN_CTL_IRQ) &&
96 phantom_status(dev, dev->status | PHB_RUNNING)) 101 phantom_status(dev, dev->status | PHB_RUNNING)){
102 spin_unlock(&dev->ioctl_lock);
97 return -ENODEV; 103 return -ENODEV;
104 }
98 105
99 pr_debug("phantom: writing %x to %u\n", r.value, r.reg); 106 pr_debug("phantom: writing %x to %u\n", r.value, r.reg);
100 iowrite32(r.value, dev->iaddr + r.reg); 107 iowrite32(r.value, dev->iaddr + r.reg);
108 ioread32(dev->iaddr); /* PCI posting */
101 109
102 if (r.reg == PHN_CONTROL && !(r.value & PHN_CTL_IRQ)) 110 if (r.reg == PHN_CONTROL && !(r.value & PHN_CTL_IRQ))
103 phantom_status(dev, dev->status & ~PHB_RUNNING); 111 phantom_status(dev, dev->status & ~PHB_RUNNING);
112 spin_unlock(&dev->ioctl_lock);
104 break; 113 break;
105 case PHN_SET_REGS: 114 case PHN_SET_REGS:
106 if (copy_from_user(&rs, argp, sizeof(rs))) 115 if (copy_from_user(&rs, argp, sizeof(rs)))
107 return -EFAULT; 116 return -EFAULT;
108 117
109 pr_debug("phantom: SRS %u regs %x\n", rs.count, rs.mask); 118 pr_debug("phantom: SRS %u regs %x\n", rs.count, rs.mask);
119 spin_lock(&dev->ioctl_lock);
110 for (i = 0; i < min(rs.count, 8U); i++) 120 for (i = 0; i < min(rs.count, 8U); i++)
111 if ((1 << i) & rs.mask) 121 if ((1 << i) & rs.mask)
112 iowrite32(rs.values[i], dev->oaddr + i); 122 iowrite32(rs.values[i], dev->oaddr + i);
123 ioread32(dev->iaddr); /* PCI posting */
124 spin_unlock(&dev->ioctl_lock);
113 break; 125 break;
114 case PHN_GET_REG: 126 case PHN_GET_REG:
115 if (copy_from_user(&r, argp, sizeof(r))) 127 if (copy_from_user(&r, argp, sizeof(r)))
@@ -128,9 +140,11 @@ static int phantom_ioctl(struct inode *inode, struct file *file, u_int cmd,
128 return -EFAULT; 140 return -EFAULT;
129 141
130 pr_debug("phantom: GRS %u regs %x\n", rs.count, rs.mask); 142 pr_debug("phantom: GRS %u regs %x\n", rs.count, rs.mask);
143 spin_lock(&dev->ioctl_lock);
131 for (i = 0; i < min(rs.count, 8U); i++) 144 for (i = 0; i < min(rs.count, 8U); i++)
132 if ((1 << i) & rs.mask) 145 if ((1 << i) & rs.mask)
133 rs.values[i] = ioread32(dev->iaddr + i); 146 rs.values[i] = ioread32(dev->iaddr + i);
147 spin_unlock(&dev->ioctl_lock);
134 148
135 if (copy_to_user(argp, &rs, sizeof(rs))) 149 if (copy_to_user(argp, &rs, sizeof(rs)))
136 return -EFAULT; 150 return -EFAULT;
@@ -199,7 +213,7 @@ static unsigned int phantom_poll(struct file *file, poll_table *wait)
199static struct file_operations phantom_file_ops = { 213static struct file_operations phantom_file_ops = {
200 .open = phantom_open, 214 .open = phantom_open,
201 .release = phantom_release, 215 .release = phantom_release,
202 .ioctl = phantom_ioctl, 216 .unlocked_ioctl = phantom_ioctl,
203 .poll = phantom_poll, 217 .poll = phantom_poll,
204}; 218};
205 219
@@ -212,6 +226,7 @@ static irqreturn_t phantom_isr(int irq, void *data)
212 226
213 iowrite32(0, dev->iaddr); 227 iowrite32(0, dev->iaddr);
214 iowrite32(0xc0, dev->iaddr); 228 iowrite32(0xc0, dev->iaddr);
229 ioread32(dev->iaddr); /* PCI posting */
215 230
216 atomic_inc(&dev->counter); 231 atomic_inc(&dev->counter);
217 wake_up_interruptible(&dev->wait); 232 wake_up_interruptible(&dev->wait);
@@ -282,11 +297,13 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
282 } 297 }
283 298
284 mutex_init(&pht->open_lock); 299 mutex_init(&pht->open_lock);
300 spin_lock_init(&pht->ioctl_lock);
285 init_waitqueue_head(&pht->wait); 301 init_waitqueue_head(&pht->wait);
286 cdev_init(&pht->cdev, &phantom_file_ops); 302 cdev_init(&pht->cdev, &phantom_file_ops);
287 pht->cdev.owner = THIS_MODULE; 303 pht->cdev.owner = THIS_MODULE;
288 304
289 iowrite32(0, pht->caddr + PHN_IRQCTL); 305 iowrite32(0, pht->caddr + PHN_IRQCTL);
306 ioread32(pht->caddr + PHN_IRQCTL); /* PCI posting */
290 retval = request_irq(pdev->irq, phantom_isr, 307 retval = request_irq(pdev->irq, phantom_isr,
291 IRQF_SHARED | IRQF_DISABLED, "phantom", pht); 308 IRQF_SHARED | IRQF_DISABLED, "phantom", pht);
292 if (retval) { 309 if (retval) {
@@ -337,6 +354,7 @@ static void __devexit phantom_remove(struct pci_dev *pdev)
337 cdev_del(&pht->cdev); 354 cdev_del(&pht->cdev);
338 355
339 iowrite32(0, pht->caddr + PHN_IRQCTL); 356 iowrite32(0, pht->caddr + PHN_IRQCTL);
357 ioread32(pht->caddr + PHN_IRQCTL); /* PCI posting */
340 free_irq(pdev->irq, pht); 358 free_irq(pdev->irq, pht);
341 359
342 pci_iounmap(pdev, pht->oaddr); 360 pci_iounmap(pdev, pht->oaddr);
@@ -358,6 +376,7 @@ static int phantom_suspend(struct pci_dev *pdev, pm_message_t state)
358 struct phantom_device *dev = pci_get_drvdata(pdev); 376 struct phantom_device *dev = pci_get_drvdata(pdev);
359 377
360 iowrite32(0, dev->caddr + PHN_IRQCTL); 378 iowrite32(0, dev->caddr + PHN_IRQCTL);
379 ioread32(dev->caddr + PHN_IRQCTL); /* PCI posting */
361 380
362 return 0; 381 return 0;
363} 382}
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 6c36a55cb3d1..95c0b96e83f2 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -740,7 +740,7 @@ static ssize_t hotkey_enable_store(struct device *dev,
740} 740}
741 741
742static struct device_attribute dev_attr_hotkey_enable = 742static struct device_attribute dev_attr_hotkey_enable =
743 __ATTR(enable, S_IWUSR | S_IRUGO, 743 __ATTR(hotkey_enable, S_IWUSR | S_IRUGO,
744 hotkey_enable_show, hotkey_enable_store); 744 hotkey_enable_show, hotkey_enable_store);
745 745
746/* sysfs hotkey mask --------------------------------------------------- */ 746/* sysfs hotkey mask --------------------------------------------------- */
@@ -775,7 +775,7 @@ static ssize_t hotkey_mask_store(struct device *dev,
775} 775}
776 776
777static struct device_attribute dev_attr_hotkey_mask = 777static struct device_attribute dev_attr_hotkey_mask =
778 __ATTR(mask, S_IWUSR | S_IRUGO, 778 __ATTR(hotkey_mask, S_IWUSR | S_IRUGO,
779 hotkey_mask_show, hotkey_mask_store); 779 hotkey_mask_show, hotkey_mask_store);
780 780
781/* sysfs hotkey bios_enabled ------------------------------------------- */ 781/* sysfs hotkey bios_enabled ------------------------------------------- */
@@ -787,7 +787,7 @@ static ssize_t hotkey_bios_enabled_show(struct device *dev,
787} 787}
788 788
789static struct device_attribute dev_attr_hotkey_bios_enabled = 789static struct device_attribute dev_attr_hotkey_bios_enabled =
790 __ATTR(bios_enabled, S_IRUGO, hotkey_bios_enabled_show, NULL); 790 __ATTR(hotkey_bios_enabled, S_IRUGO, hotkey_bios_enabled_show, NULL);
791 791
792/* sysfs hotkey bios_mask ---------------------------------------------- */ 792/* sysfs hotkey bios_mask ---------------------------------------------- */
793static ssize_t hotkey_bios_mask_show(struct device *dev, 793static ssize_t hotkey_bios_mask_show(struct device *dev,
@@ -798,7 +798,7 @@ static ssize_t hotkey_bios_mask_show(struct device *dev,
798} 798}
799 799
800static struct device_attribute dev_attr_hotkey_bios_mask = 800static struct device_attribute dev_attr_hotkey_bios_mask =
801 __ATTR(bios_mask, S_IRUGO, hotkey_bios_mask_show, NULL); 801 __ATTR(hotkey_bios_mask, S_IRUGO, hotkey_bios_mask_show, NULL);
802 802
803/* --------------------------------------------------------------------- */ 803/* --------------------------------------------------------------------- */
804 804
@@ -824,8 +824,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
824 str_supported(tp_features.hotkey)); 824 str_supported(tp_features.hotkey));
825 825
826 if (tp_features.hotkey) { 826 if (tp_features.hotkey) {
827 hotkey_dev_attributes = create_attr_set(4, 827 hotkey_dev_attributes = create_attr_set(4, NULL);
828 TPACPI_HOTKEY_SYSFS_GROUP);
829 if (!hotkey_dev_attributes) 828 if (!hotkey_dev_attributes)
830 return -ENOMEM; 829 return -ENOMEM;
831 res = add_to_attr_set(hotkey_dev_attributes, 830 res = add_to_attr_set(hotkey_dev_attributes,
@@ -1050,7 +1049,7 @@ static ssize_t bluetooth_enable_store(struct device *dev,
1050} 1049}
1051 1050
1052static struct device_attribute dev_attr_bluetooth_enable = 1051static struct device_attribute dev_attr_bluetooth_enable =
1053 __ATTR(enable, S_IWUSR | S_IRUGO, 1052 __ATTR(bluetooth_enable, S_IWUSR | S_IRUGO,
1054 bluetooth_enable_show, bluetooth_enable_store); 1053 bluetooth_enable_show, bluetooth_enable_store);
1055 1054
1056/* --------------------------------------------------------------------- */ 1055/* --------------------------------------------------------------------- */
@@ -1061,7 +1060,6 @@ static struct attribute *bluetooth_attributes[] = {
1061}; 1060};
1062 1061
1063static const struct attribute_group bluetooth_attr_group = { 1062static const struct attribute_group bluetooth_attr_group = {
1064 .name = TPACPI_BLUETH_SYSFS_GROUP,
1065 .attrs = bluetooth_attributes, 1063 .attrs = bluetooth_attributes,
1066}; 1064};
1067 1065
@@ -1215,7 +1213,7 @@ static ssize_t wan_enable_store(struct device *dev,
1215} 1213}
1216 1214
1217static struct device_attribute dev_attr_wan_enable = 1215static struct device_attribute dev_attr_wan_enable =
1218 __ATTR(enable, S_IWUSR | S_IRUGO, 1216 __ATTR(wwan_enable, S_IWUSR | S_IRUGO,
1219 wan_enable_show, wan_enable_store); 1217 wan_enable_show, wan_enable_store);
1220 1218
1221/* --------------------------------------------------------------------- */ 1219/* --------------------------------------------------------------------- */
@@ -1226,7 +1224,6 @@ static struct attribute *wan_attributes[] = {
1226}; 1224};
1227 1225
1228static const struct attribute_group wan_attr_group = { 1226static const struct attribute_group wan_attr_group = {
1229 .name = TPACPI_WAN_SYSFS_GROUP,
1230 .attrs = wan_attributes, 1227 .attrs = wan_attributes,
1231}; 1228};
1232 1229
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
index 440145a02617..72d62f2dabb9 100644
--- a/drivers/misc/thinkpad_acpi.h
+++ b/drivers/misc/thinkpad_acpi.h
@@ -278,8 +278,6 @@ static int beep_write(char *buf);
278 * Bluetooth subdriver 278 * Bluetooth subdriver
279 */ 279 */
280 280
281#define TPACPI_BLUETH_SYSFS_GROUP "bluetooth"
282
283enum { 281enum {
284 /* ACPI GBDC/SBDC bits */ 282 /* ACPI GBDC/SBDC bits */
285 TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */ 283 TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */
@@ -416,8 +414,6 @@ static int fan_write_cmd_watchdog(const char *cmd, int *rc);
416 * Hotkey subdriver 414 * Hotkey subdriver
417 */ 415 */
418 416
419#define TPACPI_HOTKEY_SYSFS_GROUP "hotkey"
420
421static int hotkey_orig_status; 417static int hotkey_orig_status;
422static int hotkey_orig_mask; 418static int hotkey_orig_mask;
423 419
@@ -553,8 +549,6 @@ static int volume_write(char *buf);
553 * Wan subdriver 549 * Wan subdriver
554 */ 550 */
555 551
556#define TPACPI_WAN_SYSFS_GROUP "wwan"
557
558enum { 552enum {
559 /* ACPI GWAN/SWAN bits */ 553 /* ACPI GWAN/SWAN bits */
560 TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */ 554 TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
index c08ad8f823d2..2d1b3df95c5b 100644
--- a/drivers/misc/tifm_7xx1.c
+++ b/drivers/misc/tifm_7xx1.c
@@ -343,7 +343,7 @@ static int tifm_7xx1_probe(struct pci_dev *dev,
343 if (!fm->addr) 343 if (!fm->addr)
344 goto err_out_free; 344 goto err_out_free;
345 345
346 rc = request_irq(dev->irq, tifm_7xx1_isr, SA_SHIRQ, DRIVER_NAME, fm); 346 rc = request_irq(dev->irq, tifm_7xx1_isr, IRQF_SHARED, DRIVER_NAME, fm);
347 if (rc) 347 if (rc)
348 goto err_out_unmap; 348 goto err_out_unmap;
349 349
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index a7562f7fc0b3..540ff4bea54c 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -135,23 +135,6 @@ struct mmc_blk_request {
135 struct mmc_data data; 135 struct mmc_data data;
136}; 136};
137 137
138static int mmc_blk_prep_rq(struct mmc_queue *mq, struct request *req)
139{
140 struct mmc_blk_data *md = mq->data;
141 int stat = BLKPREP_OK;
142
143 /*
144 * If we have no device, we haven't finished initialising.
145 */
146 if (!md || !mq->card) {
147 printk(KERN_ERR "%s: killing request - no device/host\n",
148 req->rq_disk->disk_name);
149 stat = BLKPREP_KILL;
150 }
151
152 return stat;
153}
154
155static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) 138static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
156{ 139{
157 int err; 140 int err;
@@ -460,7 +443,6 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
460 if (ret) 443 if (ret)
461 goto err_putdisk; 444 goto err_putdisk;
462 445
463 md->queue.prep_fn = mmc_blk_prep_rq;
464 md->queue.issue_fn = mmc_blk_issue_rq; 446 md->queue.issue_fn = mmc_blk_issue_rq;
465 md->queue.data = md; 447 md->queue.data = md;
466 448
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 2e77963db334..dd97bc798409 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -20,40 +20,21 @@
20#define MMC_QUEUE_SUSPENDED (1 << 0) 20#define MMC_QUEUE_SUSPENDED (1 << 0)
21 21
22/* 22/*
23 * Prepare a MMC request. Essentially, this means passing the 23 * Prepare a MMC request. This just filters out odd stuff.
24 * preparation off to the media driver. The media driver will
25 * create a mmc_io_request in req->special.
26 */ 24 */
27static int mmc_prep_request(struct request_queue *q, struct request *req) 25static int mmc_prep_request(struct request_queue *q, struct request *req)
28{ 26{
29 struct mmc_queue *mq = q->queuedata; 27 /*
30 int ret = BLKPREP_KILL; 28 * We only like normal block requests.
31 29 */
32 if (blk_special_request(req)) { 30 if (!blk_fs_request(req) && !blk_pc_request(req)) {
33 /*
34 * Special commands already have the command
35 * blocks already setup in req->special.
36 */
37 BUG_ON(!req->special);
38
39 ret = BLKPREP_OK;
40 } else if (blk_fs_request(req) || blk_pc_request(req)) {
41 /*
42 * Block I/O requests need translating according
43 * to the protocol.
44 */
45 ret = mq->prep_fn(mq, req);
46 } else {
47 /*
48 * Everything else is invalid.
49 */
50 blk_dump_rq_flags(req, "MMC bad request"); 31 blk_dump_rq_flags(req, "MMC bad request");
32 return BLKPREP_KILL;
51 } 33 }
52 34
53 if (ret == BLKPREP_OK) 35 req->cmd_flags |= REQ_DONTPREP;
54 req->cmd_flags |= REQ_DONTPREP;
55 36
56 return ret; 37 return BLKPREP_OK;
57} 38}
58 39
59static int mmc_queue_thread(void *d) 40static int mmc_queue_thread(void *d)
diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
index c9f139e764f6..1590b3f3f1f7 100644
--- a/drivers/mmc/card/queue.h
+++ b/drivers/mmc/card/queue.h
@@ -10,20 +10,12 @@ struct mmc_queue {
10 struct semaphore thread_sem; 10 struct semaphore thread_sem;
11 unsigned int flags; 11 unsigned int flags;
12 struct request *req; 12 struct request *req;
13 int (*prep_fn)(struct mmc_queue *, struct request *);
14 int (*issue_fn)(struct mmc_queue *, struct request *); 13 int (*issue_fn)(struct mmc_queue *, struct request *);
15 void *data; 14 void *data;
16 struct request_queue *queue; 15 struct request_queue *queue;
17 struct scatterlist *sg; 16 struct scatterlist *sg;
18}; 17};
19 18
20struct mmc_io_request {
21 struct request *rq;
22 int num;
23 struct mmc_command selcmd; /* mmc_queue private */
24 struct mmc_command cmd[4]; /* max 4 commands */
25};
26
27extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *); 19extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *);
28extern void mmc_cleanup_queue(struct mmc_queue *); 20extern void mmc_cleanup_queue(struct mmc_queue *);
29extern void mmc_queue_suspend(struct mmc_queue *); 21extern void mmc_queue_suspend(struct mmc_queue *);
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
index a4873ab84e6b..e8f686f7a357 100644
--- a/drivers/mtd/devices/pmc551.c
+++ b/drivers/mtd/devices/pmc551.c
@@ -650,7 +650,7 @@ MODULE_DESCRIPTION(PMC551_VERSION);
650 */ 650 */
651static int msize = 0; 651static int msize = 0;
652#if defined(CONFIG_MTD_PMC551_APERTURE_SIZE) 652#if defined(CONFIG_MTD_PMC551_APERTURE_SIZE)
653static int asize = CONFIG_MTD_PMC551_APERTURE_SIZE 653static int asize = CONFIG_MTD_PMC551_APERTURE_SIZE;
654#else 654#else
655static int asize = 0; 655static int asize = 0;
656#endif 656#endif
diff --git a/drivers/mtd/nand/autcpu12.c b/drivers/mtd/nand/autcpu12.c
index fe94ae9ae1f2..e3744eb8eccb 100644
--- a/drivers/mtd/nand/autcpu12.c
+++ b/drivers/mtd/nand/autcpu12.c
@@ -101,7 +101,7 @@ static void autcpu12_hwcontrol(struct mtd_info *mtd, int cmd,
101 struct nand_chip *chip = mtd->priv; 101 struct nand_chip *chip = mtd->priv;
102 102
103 if (ctrl & NAND_CTRL_CHANGE) { 103 if (ctrl & NAND_CTRL_CHANGE) {
104 void __iomem *addr 104 void __iomem *addr;
105 unsigned char bits; 105 unsigned char bits;
106 106
107 addr = CS89712_VIRT_BASE + AUTCPU12_SMC_PORT_OFFSET; 107 addr = CS89712_VIRT_BASE + AUTCPU12_SMC_PORT_OFFSET;
diff --git a/drivers/mtd/nand/ppchameleonevb.c b/drivers/mtd/nand/ppchameleonevb.c
index eb7d4d443deb..082073acf20f 100644
--- a/drivers/mtd/nand/ppchameleonevb.c
+++ b/drivers/mtd/nand/ppchameleonevb.c
@@ -81,7 +81,7 @@ __setup("ppchameleonevb_fio_pbase=", ppchameleonevb_fio_pbase);
81 */ 81 */
82static struct mtd_partition partition_info_hi[] = { 82static struct mtd_partition partition_info_hi[] = {
83 { .name = "PPChameleon HI Nand Flash", 83 { .name = "PPChameleon HI Nand Flash",
84 offset = 0, 84 .offset = 0,
85 .size = 128 * 1024 * 1024 85 .size = 128 * 1024 * 1024
86 } 86 }
87}; 87};
@@ -424,9 +424,9 @@ static void __exit ppchameleonevb_cleanup(void)
424 424
425 /* Release iomaps */ 425 /* Release iomaps */
426 this = (struct nand_chip *) &ppchameleon_mtd[1]; 426 this = (struct nand_chip *) &ppchameleon_mtd[1];
427 iounmap((void *) this->IO_ADDR_R; 427 iounmap((void *) this->IO_ADDR_R);
428 this = (struct nand_chip *) &ppchameleonevb_mtd[1]; 428 this = (struct nand_chip *) &ppchameleonevb_mtd[1];
429 iounmap((void *) this->IO_ADDR_R; 429 iounmap((void *) this->IO_ADDR_R);
430 430
431 /* Free the MTD device structure */ 431 /* Free the MTD device structure */
432 kfree (ppchameleon_mtd); 432 kfree (ppchameleon_mtd);
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index c5baa197bc08..7d57f4a25dc1 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2218,7 +2218,7 @@ config SK98LIN
2218 2218
2219config VIA_VELOCITY 2219config VIA_VELOCITY
2220 tristate "VIA Velocity support" 2220 tristate "VIA Velocity support"
2221 depends on NET_PCI && PCI 2221 depends on PCI
2222 select CRC32 2222 select CRC32
2223 select CRC_CCITT 2223 select CRC_CCITT
2224 select MII 2224 select MII
@@ -2280,7 +2280,7 @@ config GFAR_NAPI
2280config UCC_GETH 2280config UCC_GETH
2281 tristate "Freescale QE Gigabit Ethernet" 2281 tristate "Freescale QE Gigabit Ethernet"
2282 depends on QUICC_ENGINE 2282 depends on QUICC_ENGINE
2283 select UCC_FAST 2283 select PHYLIB
2284 help 2284 help
2285 This driver supports the Gigabit Ethernet mode of the QUICC Engine, 2285 This driver supports the Gigabit Ethernet mode of the QUICC Engine,
2286 which is available on some Freescale SOCs. 2286 which is available on some Freescale SOCs.
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index 675fe918421b..84b81642011c 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -155,7 +155,7 @@ This function will write into PHY registers.
155*/ 155*/
156static int amd8111e_write_phy(struct amd8111e_priv* lp,int phy_id, int reg, u32 val) 156static int amd8111e_write_phy(struct amd8111e_priv* lp,int phy_id, int reg, u32 val)
157{ 157{
158 unsigned int repeat = REPEAT_CNT 158 unsigned int repeat = REPEAT_CNT;
159 void __iomem *mmio = lp->mmio; 159 void __iomem *mmio = lp->mmio;
160 unsigned int reg_val; 160 unsigned int reg_val;
161 161
diff --git a/drivers/net/amd8111e.h b/drivers/net/amd8111e.h
index 2007510c4eb6..e65080a5994a 100644
--- a/drivers/net/amd8111e.h
+++ b/drivers/net/amd8111e.h
@@ -615,7 +615,7 @@ typedef enum {
615#define SSTATE 2 615#define SSTATE 2
616 616
617/* Assume contoller gets data 10 times the maximum processing time */ 617/* Assume contoller gets data 10 times the maximum processing time */
618#define REPEAT_CNT 10; 618#define REPEAT_CNT 10
619 619
620/* amd8111e decriptor flag definitions */ 620/* amd8111e decriptor flag definitions */
621typedef enum { 621typedef enum {
diff --git a/drivers/net/arcnet/Kconfig b/drivers/net/arcnet/Kconfig
index 7284ccad0b91..4030274fe788 100644
--- a/drivers/net/arcnet/Kconfig
+++ b/drivers/net/arcnet/Kconfig
@@ -2,10 +2,8 @@
2# Arcnet configuration 2# Arcnet configuration
3# 3#
4 4
5menu "ARCnet devices" 5menuconfig ARCNET
6 depends on NETDEVICES && (ISA || PCI) 6 depends on NETDEVICES && (ISA || PCI)
7
8config ARCNET
9 tristate "ARCnet support" 7 tristate "ARCnet support"
10 ---help--- 8 ---help---
11 If you have a network card of this type, say Y and check out the 9 If you have a network card of this type, say Y and check out the
@@ -25,9 +23,10 @@ config ARCNET
25 <file:Documentation/networking/net-modules.txt>. The module will 23 <file:Documentation/networking/net-modules.txt>. The module will
26 be called arcnet. 24 be called arcnet.
27 25
26if ARCNET
27
28config ARCNET_1201 28config ARCNET_1201
29 tristate "Enable standard ARCNet packet format (RFC 1201)" 29 tristate "Enable standard ARCNet packet format (RFC 1201)"
30 depends on ARCNET
31 help 30 help
32 This allows you to use RFC1201 with your ARCnet card via the virtual 31 This allows you to use RFC1201 with your ARCnet card via the virtual
33 arc0 device. You need to say Y here to communicate with 32 arc0 device. You need to say Y here to communicate with
@@ -38,7 +37,6 @@ config ARCNET_1201
38 37
39config ARCNET_1051 38config ARCNET_1051
40 tristate "Enable old ARCNet packet format (RFC 1051)" 39 tristate "Enable old ARCNet packet format (RFC 1051)"
41 depends on ARCNET
42 ---help--- 40 ---help---
43 This allows you to use RFC1051 with your ARCnet card via the virtual 41 This allows you to use RFC1051 with your ARCnet card via the virtual
44 arc0s device. You only need arc0s if you want to talk to ARCnet 42 arc0s device. You only need arc0s if you want to talk to ARCnet
@@ -53,7 +51,6 @@ config ARCNET_1051
53 51
54config ARCNET_RAW 52config ARCNET_RAW
55 tristate "Enable raw mode packet interface" 53 tristate "Enable raw mode packet interface"
56 depends on ARCNET
57 help 54 help
58 ARCnet "raw mode" packet encapsulation, no soft headers. Unlikely 55 ARCnet "raw mode" packet encapsulation, no soft headers. Unlikely
59 to work unless talking to a copy of the same Linux arcnet driver, 56 to work unless talking to a copy of the same Linux arcnet driver,
@@ -61,7 +58,6 @@ config ARCNET_RAW
61 58
62config ARCNET_CAP 59config ARCNET_CAP
63 tristate "Enable CAP mode packet interface" 60 tristate "Enable CAP mode packet interface"
64 depends on ARCNET
65 help 61 help
66 ARCnet "cap mode" packet encapsulation. Used to get the hardware 62 ARCnet "cap mode" packet encapsulation. Used to get the hardware
67 acknowledge back to userspace. After the initial protocol byte every 63 acknowledge back to userspace. After the initial protocol byte every
@@ -80,7 +76,6 @@ config ARCNET_CAP
80 76
81config ARCNET_COM90xx 77config ARCNET_COM90xx
82 tristate "ARCnet COM90xx (normal) chipset driver" 78 tristate "ARCnet COM90xx (normal) chipset driver"
83 depends on ARCNET
84 help 79 help
85 This is the chipset driver for the standard COM90xx cards. If you 80 This is the chipset driver for the standard COM90xx cards. If you
86 have always used the old ARCnet driver without knowing what type of 81 have always used the old ARCnet driver without knowing what type of
@@ -92,7 +87,6 @@ config ARCNET_COM90xx
92 87
93config ARCNET_COM90xxIO 88config ARCNET_COM90xxIO
94 tristate "ARCnet COM90xx (IO mapped) chipset driver" 89 tristate "ARCnet COM90xx (IO mapped) chipset driver"
95 depends on ARCNET
96 ---help--- 90 ---help---
97 This is the chipset driver for the COM90xx cards, using them in 91 This is the chipset driver for the COM90xx cards, using them in
98 IO-mapped mode instead of memory-mapped mode. This is slower than 92 IO-mapped mode instead of memory-mapped mode. This is slower than
@@ -105,7 +99,6 @@ config ARCNET_COM90xxIO
105 99
106config ARCNET_RIM_I 100config ARCNET_RIM_I
107 tristate "ARCnet COM90xx (RIM I) chipset driver" 101 tristate "ARCnet COM90xx (RIM I) chipset driver"
108 depends on ARCNET
109 ---help--- 102 ---help---
110 This is yet another chipset driver for the COM90xx cards, but this 103 This is yet another chipset driver for the COM90xx cards, but this
111 time only using memory-mapped mode, and no IO ports at all. This 104 time only using memory-mapped mode, and no IO ports at all. This
@@ -118,7 +111,6 @@ config ARCNET_RIM_I
118 111
119config ARCNET_COM20020 112config ARCNET_COM20020
120 tristate "ARCnet COM20020 chipset driver" 113 tristate "ARCnet COM20020 chipset driver"
121 depends on ARCNET
122 help 114 help
123 This is the driver for the new COM20020 chipset. It supports such 115 This is the driver for the new COM20020 chipset. It supports such
124 things as promiscuous mode, so packet sniffing is possible, and 116 things as promiscuous mode, so packet sniffing is possible, and
@@ -136,5 +128,4 @@ config ARCNET_COM20020_PCI
136 tristate "Support for COM20020 on PCI" 128 tristate "Support for COM20020 on PCI"
137 depends on ARCNET_COM20020 && PCI 129 depends on ARCNET_COM20020 && PCI
138 130
139endmenu 131endif # ARCNET
140
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 4aec747d9e43..59b9943b077d 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -4919,7 +4919,10 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4919 pci_cmd &= ~PCI_COMMAND_SERR; 4919 pci_cmd &= ~PCI_COMMAND_SERR;
4920 pci_cmd |= PCI_COMMAND_PARITY; 4920 pci_cmd |= PCI_COMMAND_PARITY;
4921 pci_write_config_word(pdev, PCI_COMMAND, pci_cmd); 4921 pci_write_config_word(pdev, PCI_COMMAND, pci_cmd);
4922 pci_set_mwi(pdev); 4922 if (pci_set_mwi(pdev))
4923 printk(KERN_WARNING PFX "Could not enable MWI for %s\n",
4924 pci_name(pdev));
4925
4923 /* 4926 /*
4924 * On some architectures, the default cache line size set 4927 * On some architectures, the default cache line size set
4925 * by pci_set_mwi reduces perforamnce. We have to increase 4928 * by pci_set_mwi reduces perforamnce. We have to increase
diff --git a/drivers/net/chelsio/suni1x10gexp_regs.h b/drivers/net/chelsio/suni1x10gexp_regs.h
index 269d097dd927..d0f87d82566a 100644
--- a/drivers/net/chelsio/suni1x10gexp_regs.h
+++ b/drivers/net/chelsio/suni1x10gexp_regs.h
@@ -105,7 +105,7 @@
105#define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_LOW(filterId) (0x204A + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId)) 105#define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_LOW(filterId) (0x204A + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId))
106#define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_MID(filterId) (0x204B + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId)) 106#define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_MID(filterId) (0x204B + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId))
107#define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_HIGH(filterId)(0x204C + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId)) 107#define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_HIGH(filterId)(0x204C + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId))
108#define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_VID(filterId) (0x2062 + mSUNI1x10GEXP_MAC_VID_FILTER_OFFSET(filterId) 108#define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_VID(filterId) (0x2062 + mSUNI1x10GEXP_MAC_VID_FILTER_OFFSET(filterId))
109#define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_LOW 0x204A 109#define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_LOW 0x204A
110#define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_MID 0x204B 110#define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_MID 0x204B
111#define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_HIGH 0x204C 111#define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_HIGH 0x204C
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index 95d854e2295c..b2577f40124e 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -932,8 +932,6 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
932 /* Kick the lance: transmit now */ 932 /* Kick the lance: transmit now */
933 writereg(&ll->rdp, LE_C0_INEA | LE_C0_TDMD); 933 writereg(&ll->rdp, LE_C0_INEA | LE_C0_TDMD);
934 934
935 spin_unlock_irq(&lp->lock);
936
937 dev->trans_start = jiffies; 935 dev->trans_start = jiffies;
938 dev_kfree_skb(skb); 936 dev_kfree_skb(skb);
939 937
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c
index 571d82f8008c..7df23dc28190 100644
--- a/drivers/net/defxx.c
+++ b/drivers/net/defxx.c
@@ -566,6 +566,7 @@ static int __devinit dfx_register(struct device *bdev)
566 bp->base.mem = ioremap_nocache(bar_start, bar_len); 566 bp->base.mem = ioremap_nocache(bar_start, bar_len);
567 if (!bp->base.mem) { 567 if (!bp->base.mem) {
568 printk(KERN_ERR "%s: Cannot map MMIO\n", print_name); 568 printk(KERN_ERR "%s: Cannot map MMIO\n", print_name);
569 err = -ENOMEM;
569 goto err_out_region; 570 goto err_out_region;
570 } 571 }
571 } else { 572 } else {
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 49be393e1c1d..9ec35b7a8207 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1325,7 +1325,10 @@ e1000_sw_init(struct e1000_adapter *adapter)
1325 spin_lock_init(&adapter->tx_queue_lock); 1325 spin_lock_init(&adapter->tx_queue_lock);
1326#endif 1326#endif
1327 1327
1328 atomic_set(&adapter->irq_sem, 1); 1328 /* Explicitly disable IRQ since the NIC can be in any state. */
1329 atomic_set(&adapter->irq_sem, 0);
1330 e1000_irq_disable(adapter);
1331
1329 spin_lock_init(&adapter->stats_lock); 1332 spin_lock_init(&adapter->stats_lock);
1330 1333
1331 set_bit(__E1000_DOWN, &adapter->flags); 1334 set_bit(__E1000_DOWN, &adapter->flags);
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 602872dbe15f..e85a933a4762 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
39#include <asm/io.h> 39#include <asm/io.h>
40 40
41#define DRV_NAME "ehea" 41#define DRV_NAME "ehea"
42#define DRV_VERSION "EHEA_0058" 42#define DRV_VERSION "EHEA_0061"
43 43
44#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ 44#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
45 | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) 45 | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index f6e0cb1ada1f..152bb2016a2c 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -428,7 +428,7 @@ static struct ehea_cqe *ehea_proc_rwqes(struct net_device *dev,
428 } 428 }
429 skb_copy_to_linear_data(skb, ((char*)cqe) + 64, 429 skb_copy_to_linear_data(skb, ((char*)cqe) + 64,
430 cqe->num_bytes_transfered - 4); 430 cqe->num_bytes_transfered - 4);
431 ehea_fill_skb(dev, skb, cqe); 431 ehea_fill_skb(port->netdev, skb, cqe);
432 } else if (rq == 2) { /* RQ2 */ 432 } else if (rq == 2) { /* RQ2 */
433 skb = get_skb_by_index(skb_arr_rq2, 433 skb = get_skb_by_index(skb_arr_rq2,
434 skb_arr_rq2_len, cqe); 434 skb_arr_rq2_len, cqe);
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c
index 88efe9731bab..e5502af5b8e2 100644
--- a/drivers/net/fec_8xx/fec_main.c
+++ b/drivers/net/fec_8xx/fec_main.c
@@ -550,7 +550,7 @@ static int fec_enet_rx_common(struct net_device *dev, int *budget)
550 skbn = dev_alloc_skb(pkt_len + 2); 550 skbn = dev_alloc_skb(pkt_len + 2);
551 if (skbn != NULL) { 551 if (skbn != NULL) {
552 skb_reserve(skbn, 2); /* align IP header */ 552 skb_reserve(skbn, 2); /* align IP header */
553 skb_copy_from_linear_data(skb 553 skb_copy_from_linear_data(skb,
554 skbn->data, 554 skbn->data,
555 pkt_len); 555 pkt_len);
556 /* swap */ 556 /* swap */
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 7a018027fcc0..4154fd000746 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -195,7 +195,7 @@ enum {
195#define NVREG_IRQ_TX_FORCED 0x0100 195#define NVREG_IRQ_TX_FORCED 0x0100
196#define NVREG_IRQ_RECOVER_ERROR 0x8000 196#define NVREG_IRQ_RECOVER_ERROR 0x8000
197#define NVREG_IRQMASK_THROUGHPUT 0x00df 197#define NVREG_IRQMASK_THROUGHPUT 0x00df
198#define NVREG_IRQMASK_CPU 0x0040 198#define NVREG_IRQMASK_CPU 0x0060
199#define NVREG_IRQ_TX_ALL (NVREG_IRQ_TX_ERR|NVREG_IRQ_TX_OK|NVREG_IRQ_TX_FORCED) 199#define NVREG_IRQ_TX_ALL (NVREG_IRQ_TX_ERR|NVREG_IRQ_TX_OK|NVREG_IRQ_TX_FORCED)
200#define NVREG_IRQ_RX_ALL (NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_RX_FORCED) 200#define NVREG_IRQ_RX_ALL (NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_RX_FORCED)
201#define NVREG_IRQ_OTHER (NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_RECOVER_ERROR) 201#define NVREG_IRQ_OTHER (NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_RECOVER_ERROR)
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index 8118a6750b61..8caa591c5649 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -3005,7 +3005,7 @@ static int __init hp100_isa_init(void)
3005 return cards > 0 ? 0 : -ENODEV; 3005 return cards > 0 ? 0 : -ENODEV;
3006} 3006}
3007 3007
3008static void __exit hp100_isa_cleanup(void) 3008static void hp100_isa_cleanup(void)
3009{ 3009{
3010 int i; 3010 int i;
3011 3011
diff --git a/drivers/net/meth.c b/drivers/net/meth.c
index 0343ea12b299..92b403bf38b0 100644
--- a/drivers/net/meth.c
+++ b/drivers/net/meth.c
@@ -8,15 +8,16 @@
8 * as published by the Free Software Foundation; either version 8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11#include <linux/module.h>
12#include <linux/init.h>
13
14#include <linux/kernel.h> /* printk() */
15#include <linux/delay.h> 11#include <linux/delay.h>
12#include <linux/dma-mapping.h>
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/module.h>
16#include <linux/platform_device.h>
16#include <linux/slab.h> 17#include <linux/slab.h>
17#include <linux/errno.h> /* error codes */ 18#include <linux/errno.h>
18#include <linux/types.h> /* size_t */ 19#include <linux/types.h>
19#include <linux/interrupt.h> /* mark_bh */ 20#include <linux/interrupt.h>
20 21
21#include <linux/in.h> 22#include <linux/in.h>
22#include <linux/in6.h> 23#include <linux/in6.h>
@@ -33,7 +34,6 @@
33 34
34#include <asm/io.h> 35#include <asm/io.h>
35#include <asm/scatterlist.h> 36#include <asm/scatterlist.h>
36#include <linux/dma-mapping.h>
37 37
38#include "meth.h" 38#include "meth.h"
39 39
@@ -51,8 +51,6 @@
51 51
52 52
53static const char *meth_str="SGI O2 Fast Ethernet"; 53static const char *meth_str="SGI O2 Fast Ethernet";
54MODULE_AUTHOR("Ilya Volynets <ilya@theIlya.com>");
55MODULE_DESCRIPTION("SGI O2 Builtin Fast Ethernet driver");
56 54
57#define HAVE_TX_TIMEOUT 55#define HAVE_TX_TIMEOUT
58/* The maximum time waited (in jiffies) before assuming a Tx failed. (400ms) */ 56/* The maximum time waited (in jiffies) before assuming a Tx failed. (400ms) */
@@ -784,15 +782,15 @@ static struct net_device_stats *meth_stats(struct net_device *dev)
784/* 782/*
785 * The init function. 783 * The init function.
786 */ 784 */
787static struct net_device *meth_init(void) 785static int __init meth_probe(struct platform_device *pdev)
788{ 786{
789 struct net_device *dev; 787 struct net_device *dev;
790 struct meth_private *priv; 788 struct meth_private *priv;
791 int ret; 789 int err;
792 790
793 dev = alloc_etherdev(sizeof(struct meth_private)); 791 dev = alloc_etherdev(sizeof(struct meth_private));
794 if (!dev) 792 if (!dev)
795 return ERR_PTR(-ENOMEM); 793 return -ENOMEM;
796 794
797 dev->open = meth_open; 795 dev->open = meth_open;
798 dev->stop = meth_release; 796 dev->stop = meth_release;
@@ -808,11 +806,12 @@ static struct net_device *meth_init(void)
808 806
809 priv = netdev_priv(dev); 807 priv = netdev_priv(dev);
810 spin_lock_init(&priv->meth_lock); 808 spin_lock_init(&priv->meth_lock);
809 SET_NETDEV_DEV(dev, &pdev->dev);
811 810
812 ret = register_netdev(dev); 811 err = register_netdev(dev);
813 if (ret) { 812 if (err) {
814 free_netdev(dev); 813 free_netdev(dev);
815 return ERR_PTR(ret); 814 return err;
816 } 815 }
817 816
818 printk(KERN_INFO "%s: SGI MACE Ethernet rev. %d\n", 817 printk(KERN_INFO "%s: SGI MACE Ethernet rev. %d\n",
@@ -820,21 +819,44 @@ static struct net_device *meth_init(void)
820 return 0; 819 return 0;
821} 820}
822 821
823static struct net_device *meth_dev; 822static int __exit meth_remove(struct platform_device *pdev)
823{
824 struct net_device *dev = platform_get_drvdata(pdev);
825
826 unregister_netdev(dev);
827 free_netdev(dev);
828 platform_set_drvdata(pdev, NULL);
829
830 return 0;
831}
832
833static struct platform_driver meth_driver = {
834 .probe = meth_probe,
835 .remove = __devexit_p(meth_remove),
836 .driver = {
837 .name = "meth",
838 }
839};
824 840
825static int __init meth_init_module(void) 841static int __init meth_init_module(void)
826{ 842{
827 meth_dev = meth_init(); 843 int err;
828 if (IS_ERR(meth_dev)) 844
829 return PTR_ERR(meth_dev); 845 err = platform_driver_register(&meth_driver);
830 return 0; 846 if (err)
847 printk(KERN_ERR "Driver registration failed\n");
848
849 return err;
831} 850}
832 851
833static void __exit meth_exit_module(void) 852static void __exit meth_exit_module(void)
834{ 853{
835 unregister_netdev(meth_dev); 854 platform_driver_unregister(&meth_driver);
836 free_netdev(meth_dev);
837} 855}
838 856
839module_init(meth_init_module); 857module_init(meth_init_module);
840module_exit(meth_exit_module); 858module_exit(meth_exit_module);
859
860MODULE_AUTHOR("Ilya Volynets <ilya@theIlya.com>");
861MODULE_DESCRIPTION("SGI O2 Builtin Fast Ethernet driver");
862MODULE_LICENSE("GPL");
diff --git a/drivers/net/mlx4/alloc.c b/drivers/net/mlx4/alloc.c
index dfbd5809d744..f8d63d39f592 100644
--- a/drivers/net/mlx4/alloc.c
+++ b/drivers/net/mlx4/alloc.c
@@ -51,8 +51,8 @@ u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap)
51 51
52 if (obj < bitmap->max) { 52 if (obj < bitmap->max) {
53 set_bit(obj, bitmap->table); 53 set_bit(obj, bitmap->table);
54 bitmap->last = (obj + 1) & (bitmap->max - 1);
54 obj |= bitmap->top; 55 obj |= bitmap->top;
55 bitmap->last = obj + 1;
56 } else 56 } else
57 obj = -1; 57 obj = -1;
58 58
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c
index c42717313663..cfa5cc072339 100644
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -90,7 +90,7 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u32 flags)
90 int i; 90 int i;
91 91
92 mlx4_dbg(dev, "DEV_CAP flags:\n"); 92 mlx4_dbg(dev, "DEV_CAP flags:\n");
93 for (i = 0; i < 32; ++i) 93 for (i = 0; i < ARRAY_SIZE(fname); ++i)
94 if (fname[i] && (flags & (1 << i))) 94 if (fname[i] && (flags & (1 << i)))
95 mlx4_dbg(dev, " %s\n", fname[i]); 95 mlx4_dbg(dev, " %s\n", fname[i]);
96} 96}
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 68c99b4c5255..bb966911a137 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -89,6 +89,7 @@ EXPORT_SYMBOL(fixed_mdio_set_link_update);
89/*----------------------------------------------------------------------------- 89/*-----------------------------------------------------------------------------
90 * This is used for updating internal mii regs from the status 90 * This is used for updating internal mii regs from the status
91 *-----------------------------------------------------------------------------*/ 91 *-----------------------------------------------------------------------------*/
92#if defined(CONFIG_FIXED_MII_100_FDX) || defined(CONFIG_FIXED_MII_10_FDX)
92static int fixed_mdio_update_regs(struct fixed_info *fixed) 93static int fixed_mdio_update_regs(struct fixed_info *fixed)
93{ 94{
94 u16 *regs = fixed->regs; 95 u16 *regs = fixed->regs;
@@ -165,6 +166,7 @@ static int fixed_mii_reset(struct mii_bus *bus)
165 /*nothing here - no way/need to reset it*/ 166 /*nothing here - no way/need to reset it*/
166 return 0; 167 return 0;
167} 168}
169#endif
168 170
169static int fixed_config_aneg(struct phy_device *phydev) 171static int fixed_config_aneg(struct phy_device *phydev)
170{ 172{
@@ -194,6 +196,7 @@ static struct phy_driver fixed_mdio_driver = {
194 * number is used to create multiple fixed PHYs, so that several devices can 196 * number is used to create multiple fixed PHYs, so that several devices can
195 * utilize them simultaneously. 197 * utilize them simultaneously.
196 *-----------------------------------------------------------------------------*/ 198 *-----------------------------------------------------------------------------*/
199#if defined(CONFIG_FIXED_MII_100_FDX) || defined(CONFIG_FIXED_MII_10_FDX)
197static int fixed_mdio_register_device(int number, int speed, int duplex) 200static int fixed_mdio_register_device(int number, int speed, int duplex)
198{ 201{
199 struct mii_bus *new_bus; 202 struct mii_bus *new_bus;
@@ -301,6 +304,7 @@ device_create_fail:
301 304
302 return err; 305 return err;
303} 306}
307#endif
304 308
305 309
306MODULE_DESCRIPTION("Fixed PHY device & driver for PAL"); 310MODULE_DESCRIPTION("Fixed PHY device & driver for PAL");
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c
index fe847800acdc..75afc1f07ba0 100644
--- a/drivers/net/skfp/smt.c
+++ b/drivers/net/skfp/smt.c
@@ -1748,7 +1748,7 @@ char *addr_to_string(struct fddi_addr *addr)
1748#endif 1748#endif
1749 1749
1750#ifdef AM29K 1750#ifdef AM29K
1751smt_ifconfig(int argc, char *argv[]) 1751int smt_ifconfig(int argc, char *argv[])
1752{ 1752{
1753 if (argc >= 2 && !strcmp(argv[0],"opt_bypass") && 1753 if (argc >= 2 && !strcmp(argv[0],"opt_bypass") &&
1754 !strcmp(argv[1],"yes")) { 1754 !strcmp(argv[1],"yes")) {
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 832fd69a0e59..adfbe81693a6 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -364,7 +364,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
364 /* for SFP-module set SIGDET polarity to low */ 364 /* for SFP-module set SIGDET polarity to low */
365 ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL); 365 ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
366 ctrl |= PHY_M_FIB_SIGD_POL; 366 ctrl |= PHY_M_FIB_SIGD_POL;
367 gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); 367 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ctrl);
368 } 368 }
369 369
370 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); 370 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
@@ -658,7 +658,7 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
658 const u8 *addr = hw->dev[port]->dev_addr; 658 const u8 *addr = hw->dev[port]->dev_addr;
659 659
660 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); 660 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET);
661 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR|GPC_ENA_PAUSE); 661 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR);
662 662
663 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR); 663 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR);
664 664
@@ -1432,7 +1432,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1432 tcpsum = offset << 16; /* sum start */ 1432 tcpsum = offset << 16; /* sum start */
1433 tcpsum |= offset + skb->csum_offset; /* sum write */ 1433 tcpsum |= offset + skb->csum_offset; /* sum write */
1434 1434
1435 ctrl = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM; 1435 ctrl |= CALSUM | WR_SUM | INIT_SUM | LOCK_SUM;
1436 if (ip_hdr(skb)->protocol == IPPROTO_UDP) 1436 if (ip_hdr(skb)->protocol == IPPROTO_UDP)
1437 ctrl |= UDPTCP; 1437 ctrl |= UDPTCP;
1438 1438
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 5efb5afc45ba..b8c4a3b5eadf 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -1149,7 +1149,7 @@ enum {
1149 PHY_M_IS_JABBER = 1<<0, /* Jabber */ 1149 PHY_M_IS_JABBER = 1<<0, /* Jabber */
1150 1150
1151 PHY_M_DEF_MSK = PHY_M_IS_LSP_CHANGE | PHY_M_IS_LST_CHANGE 1151 PHY_M_DEF_MSK = PHY_M_IS_LSP_CHANGE | PHY_M_IS_LST_CHANGE
1152 | PHY_M_IS_FIFO_ERROR, 1152 | PHY_M_IS_DUP_CHANGE,
1153 PHY_M_AN_MSK = PHY_M_IS_AN_ERROR | PHY_M_IS_AN_COMPL, 1153 PHY_M_AN_MSK = PHY_M_IS_AN_ERROR | PHY_M_IS_AN_COMPL,
1154}; 1154};
1155 1155
@@ -1732,28 +1732,6 @@ enum {
1732 1732
1733/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */ 1733/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */
1734enum { 1734enum {
1735 GPC_SEL_BDT = 1<<28, /* Select Bi-Dir. Transfer for MDC/MDIO */
1736 GPC_INT_POL_HI = 1<<27, /* IRQ Polarity is Active HIGH */
1737 GPC_75_OHM = 1<<26, /* Use 75 Ohm Termination instead of 50 */
1738 GPC_DIS_FC = 1<<25, /* Disable Automatic Fiber/Copper Detection */
1739 GPC_DIS_SLEEP = 1<<24, /* Disable Energy Detect */
1740 GPC_HWCFG_M_3 = 1<<23, /* HWCFG_MODE[3] */
1741 GPC_HWCFG_M_2 = 1<<22, /* HWCFG_MODE[2] */
1742 GPC_HWCFG_M_1 = 1<<21, /* HWCFG_MODE[1] */
1743 GPC_HWCFG_M_0 = 1<<20, /* HWCFG_MODE[0] */
1744 GPC_ANEG_0 = 1<<19, /* ANEG[0] */
1745 GPC_ENA_XC = 1<<18, /* Enable MDI crossover */
1746 GPC_DIS_125 = 1<<17, /* Disable 125 MHz clock */
1747 GPC_ANEG_3 = 1<<16, /* ANEG[3] */
1748 GPC_ANEG_2 = 1<<15, /* ANEG[2] */
1749 GPC_ANEG_1 = 1<<14, /* ANEG[1] */
1750 GPC_ENA_PAUSE = 1<<13, /* Enable Pause (SYM_OR_REM) */
1751 GPC_PHYADDR_4 = 1<<12, /* Bit 4 of Phy Addr */
1752 GPC_PHYADDR_3 = 1<<11, /* Bit 3 of Phy Addr */
1753 GPC_PHYADDR_2 = 1<<10, /* Bit 2 of Phy Addr */
1754 GPC_PHYADDR_1 = 1<<9, /* Bit 1 of Phy Addr */
1755 GPC_PHYADDR_0 = 1<<8, /* Bit 0 of Phy Addr */
1756 /* Bits 7..2: reserved */
1757 GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */ 1735 GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */
1758 GPC_RST_SET = 1<<0, /* Set GPHY Reset */ 1736 GPC_RST_SET = 1<<0, /* Set GPHY Reset */
1759}; 1737};
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index c3964c3d89d9..ef84d7c757a0 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1014,12 +1014,12 @@ spider_net_pass_skb_up(struct spider_net_descr *descr,
1014 */ 1014 */
1015 } 1015 }
1016 1016
1017 /* pass skb up to stack */
1018 netif_receive_skb(skb);
1019
1020 /* update netdevice statistics */ 1017 /* update netdevice statistics */
1021 card->netdev_stats.rx_packets++; 1018 card->netdev_stats.rx_packets++;
1022 card->netdev_stats.rx_bytes += skb->len; 1019 card->netdev_stats.rx_bytes += skb->len;
1020
1021 /* pass skb up to stack */
1022 netif_receive_skb(skb);
1023} 1023}
1024 1024
1025#ifdef DEBUG 1025#ifdef DEBUG
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
index 99c4c1922f19..e6b2e06493e7 100644
--- a/drivers/net/tokenring/Kconfig
+++ b/drivers/net/tokenring/Kconfig
@@ -2,12 +2,10 @@
2# Token Ring driver configuration 2# Token Ring driver configuration
3# 3#
4 4
5menu "Token Ring devices"
6 depends on NETDEVICES && !UML
7
8# So far, we only have PCI, ISA, and MCA token ring devices 5# So far, we only have PCI, ISA, and MCA token ring devices
9config TR 6menuconfig TR
10 bool "Token Ring driver support" 7 bool "Token Ring driver support"
8 depends on NETDEVICES && !UML
11 depends on (PCI || ISA || MCA || CCW) 9 depends on (PCI || ISA || MCA || CCW)
12 select LLC 10 select LLC
13 help 11 help
@@ -20,9 +18,11 @@ config TR
20 from <http://www.tldp.org/docs.html#howto>. Most people can 18 from <http://www.tldp.org/docs.html#howto>. Most people can
21 say N here. 19 say N here.
22 20
21if TR
22
23config IBMTR 23config IBMTR
24 tristate "IBM Tropic chipset based adapter support" 24 tristate "IBM Tropic chipset based adapter support"
25 depends on TR && (ISA || MCA) 25 depends on ISA || MCA
26 ---help--- 26 ---help---
27 This is support for all IBM Token Ring cards that don't use DMA. If 27 This is support for all IBM Token Ring cards that don't use DMA. If
28 you have such a beast, say Y and read the Token-Ring mini-HOWTO, 28 you have such a beast, say Y and read the Token-Ring mini-HOWTO,
@@ -36,7 +36,7 @@ config IBMTR
36 36
37config IBMOL 37config IBMOL
38 tristate "IBM Olympic chipset PCI adapter support" 38 tristate "IBM Olympic chipset PCI adapter support"
39 depends on TR && PCI 39 depends on PCI
40 ---help--- 40 ---help---
41 This is support for all non-Lanstreamer IBM PCI Token Ring Cards. 41 This is support for all non-Lanstreamer IBM PCI Token Ring Cards.
42 Specifically this is all IBM PCI, PCI Wake On Lan, PCI II, PCI II 42 Specifically this is all IBM PCI, PCI Wake On Lan, PCI II, PCI II
@@ -54,7 +54,7 @@ config IBMOL
54 54
55config IBMLS 55config IBMLS
56 tristate "IBM Lanstreamer chipset PCI adapter support" 56 tristate "IBM Lanstreamer chipset PCI adapter support"
57 depends on TR && PCI && !64BIT 57 depends on PCI && !64BIT
58 help 58 help
59 This is support for IBM Lanstreamer PCI Token Ring Cards. 59 This is support for IBM Lanstreamer PCI Token Ring Cards.
60 60
@@ -66,7 +66,7 @@ config IBMLS
66 66
67config 3C359 67config 3C359
68 tristate "3Com 3C359 Token Link Velocity XL adapter support" 68 tristate "3Com 3C359 Token Link Velocity XL adapter support"
69 depends on TR && PCI 69 depends on PCI
70 ---help--- 70 ---help---
71 This is support for the 3Com PCI Velocity XL cards, specifically 71 This is support for the 3Com PCI Velocity XL cards, specifically
72 the 3Com 3C359, please note this is not for the 3C339 cards, you 72 the 3Com 3C359, please note this is not for the 3C339 cards, you
@@ -84,7 +84,7 @@ config 3C359
84 84
85config TMS380TR 85config TMS380TR
86 tristate "Generic TMS380 Token Ring ISA/PCI adapter support" 86 tristate "Generic TMS380 Token Ring ISA/PCI adapter support"
87 depends on TR && (PCI || ISA && ISA_DMA_API || MCA) 87 depends on PCI || ISA && ISA_DMA_API || MCA
88 select FW_LOADER 88 select FW_LOADER
89 ---help--- 89 ---help---
90 This driver provides generic support for token ring adapters 90 This driver provides generic support for token ring adapters
@@ -108,7 +108,7 @@ config TMS380TR
108 108
109config TMSPCI 109config TMSPCI
110 tristate "Generic TMS380 PCI support" 110 tristate "Generic TMS380 PCI support"
111 depends on TR && TMS380TR && PCI 111 depends on TMS380TR && PCI
112 ---help--- 112 ---help---
113 This tms380 module supports generic TMS380-based PCI cards. 113 This tms380 module supports generic TMS380-based PCI cards.
114 114
@@ -123,7 +123,7 @@ config TMSPCI
123 123
124config SKISA 124config SKISA
125 tristate "SysKonnect TR4/16 ISA support" 125 tristate "SysKonnect TR4/16 ISA support"
126 depends on TR && TMS380TR && ISA 126 depends on TMS380TR && ISA
127 help 127 help
128 This tms380 module supports SysKonnect TR4/16 ISA cards. 128 This tms380 module supports SysKonnect TR4/16 ISA cards.
129 129
@@ -135,7 +135,7 @@ config SKISA
135 135
136config PROTEON 136config PROTEON
137 tristate "Proteon ISA support" 137 tristate "Proteon ISA support"
138 depends on TR && TMS380TR && ISA 138 depends on TMS380TR && ISA
139 help 139 help
140 This tms380 module supports Proteon ISA cards. 140 This tms380 module supports Proteon ISA cards.
141 141
@@ -148,7 +148,7 @@ config PROTEON
148 148
149config ABYSS 149config ABYSS
150 tristate "Madge Smart 16/4 PCI Mk2 support" 150 tristate "Madge Smart 16/4 PCI Mk2 support"
151 depends on TR && TMS380TR && PCI 151 depends on TMS380TR && PCI
152 help 152 help
153 This tms380 module supports the Madge Smart 16/4 PCI Mk2 153 This tms380 module supports the Madge Smart 16/4 PCI Mk2
154 cards (51-02). 154 cards (51-02).
@@ -158,7 +158,7 @@ config ABYSS
158 158
159config MADGEMC 159config MADGEMC
160 tristate "Madge Smart 16/4 Ringnode MicroChannel" 160 tristate "Madge Smart 16/4 Ringnode MicroChannel"
161 depends on TR && TMS380TR && MCA 161 depends on TMS380TR && MCA
162 help 162 help
163 This tms380 module supports the Madge Smart 16/4 MC16 and MC32 163 This tms380 module supports the Madge Smart 16/4 MC16 and MC32
164 MicroChannel adapters. 164 MicroChannel adapters.
@@ -168,7 +168,7 @@ config MADGEMC
168 168
169config SMCTR 169config SMCTR
170 tristate "SMC ISA/MCA adapter support" 170 tristate "SMC ISA/MCA adapter support"
171 depends on TR && (ISA || MCA_LEGACY) && (BROKEN || !64BIT) 171 depends on (ISA || MCA_LEGACY) && (BROKEN || !64BIT)
172 ---help--- 172 ---help---
173 This is support for the ISA and MCA SMC Token Ring cards, 173 This is support for the ISA and MCA SMC Token Ring cards,
174 specifically SMC TokenCard Elite (8115T) and SMC TokenCard Elite/A 174 specifically SMC TokenCard Elite (8115T) and SMC TokenCard Elite/A
@@ -182,5 +182,4 @@ config SMCTR
182 To compile this driver as a module, choose M here: the module will be 182 To compile this driver as a module, choose M here: the module will be
183 called smctr. 183 called smctr.
184 184
185endmenu 185endif # TR
186
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index c2ccbd098f53..18b731bb4da1 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -23,11 +23,8 @@
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/mm.h> 25#include <linux/mm.h>
26#include <linux/ethtool.h>
27#include <linux/delay.h>
28#include <linux/dma-mapping.h> 26#include <linux/dma-mapping.h>
29#include <linux/fsl_devices.h> 27#include <linux/fsl_devices.h>
30#include <linux/ethtool.h>
31#include <linux/mii.h> 28#include <linux/mii.h>
32#include <linux/phy.h> 29#include <linux/phy.h>
33#include <linux/workqueue.h> 30#include <linux/workqueue.h>
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index f96966d4bcc2..7bcb82f50cf7 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -260,8 +260,6 @@ static struct of_device_id uec_mdio_match[] = {
260 {}, 260 {},
261}; 261};
262 262
263MODULE_DEVICE_TABLE(of, uec_mdio_match);
264
265static struct of_platform_driver uec_mdio_driver = { 263static struct of_platform_driver uec_mdio_driver = {
266 .name = DRV_NAME, 264 .name = DRV_NAME,
267 .probe = uec_mdio_probe, 265 .probe = uec_mdio_probe,
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index d5ef97bc4d01..6d95cacd5284 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -1458,6 +1458,10 @@ static const struct usb_device_id products [] = {
1458 // IO-DATA ETG-US2 1458 // IO-DATA ETG-US2
1459 USB_DEVICE (0x04bb, 0x0930), 1459 USB_DEVICE (0x04bb, 0x0930),
1460 .driver_info = (unsigned long) &ax88178_info, 1460 .driver_info = (unsigned long) &ax88178_info,
1461}, {
1462 // Belkin F5D5055
1463 USB_DEVICE(0x050d, 0x5055),
1464 .driver_info = (unsigned long) &ax88178_info,
1461}, 1465},
1462 { }, // END 1466 { }, // END
1463}; 1467};
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 5a21f06bf8a5..675ac99a79c6 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -91,6 +91,22 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
91 "CDC descriptors on config\n"); 91 "CDC descriptors on config\n");
92 } 92 }
93 93
94 /* Maybe CDC descriptors are after the endpoint? This bug has
95 * been seen on some 2Wire Inc RNDIS-ish products.
96 */
97 if (len == 0) {
98 struct usb_host_endpoint *hep;
99
100 hep = intf->cur_altsetting->endpoint;
101 if (hep) {
102 buf = hep->extra;
103 len = hep->extralen;
104 }
105 if (len)
106 dev_dbg(&intf->dev,
107 "CDC descriptors on endpoint\n");
108 }
109
94 /* this assumes that if there's a non-RNDIS vendor variant 110 /* this assumes that if there's a non-RNDIS vendor variant
95 * of cdc-acm, it'll fail RNDIS requests cleanly. 111 * of cdc-acm, it'll fail RNDIS requests cleanly.
96 */ 112 */
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index 980e4aaa97aa..cd991a0f75bb 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -515,6 +515,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
515 dev_err(&intf->dev, 515 dev_err(&intf->dev,
516 "dev can't take %u byte packets (max %u)\n", 516 "dev can't take %u byte packets (max %u)\n",
517 dev->hard_mtu, tmp); 517 dev->hard_mtu, tmp);
518 retval = -EINVAL;
518 goto fail_and_release; 519 goto fail_and_release;
519 } 520 }
520 521
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index f9cd42d058b0..5b16d9a1269a 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1252,20 +1252,23 @@ EXPORT_SYMBOL_GPL(usbnet_probe);
1252 1252
1253/*-------------------------------------------------------------------------*/ 1253/*-------------------------------------------------------------------------*/
1254 1254
1255/* FIXME these suspend/resume methods assume non-CDC style 1255/*
1256 * devices, with only one interface. 1256 * suspend the whole driver as soon as the first interface is suspended
1257 * resume only when the last interface is resumed
1257 */ 1258 */
1258 1259
1259int usbnet_suspend (struct usb_interface *intf, pm_message_t message) 1260int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
1260{ 1261{
1261 struct usbnet *dev = usb_get_intfdata(intf); 1262 struct usbnet *dev = usb_get_intfdata(intf);
1262 1263
1263 /* accelerate emptying of the rx and queues, to avoid 1264 if (!dev->suspend_count++) {
1264 * having everything error out. 1265 /* accelerate emptying of the rx and queues, to avoid
1265 */ 1266 * having everything error out.
1266 netif_device_detach (dev->net); 1267 */
1267 (void) unlink_urbs (dev, &dev->rxq); 1268 netif_device_detach (dev->net);
1268 (void) unlink_urbs (dev, &dev->txq); 1269 (void) unlink_urbs (dev, &dev->rxq);
1270 (void) unlink_urbs (dev, &dev->txq);
1271 }
1269 return 0; 1272 return 0;
1270} 1273}
1271EXPORT_SYMBOL_GPL(usbnet_suspend); 1274EXPORT_SYMBOL_GPL(usbnet_suspend);
@@ -1274,8 +1277,10 @@ int usbnet_resume (struct usb_interface *intf)
1274{ 1277{
1275 struct usbnet *dev = usb_get_intfdata(intf); 1278 struct usbnet *dev = usb_get_intfdata(intf);
1276 1279
1277 netif_device_attach (dev->net); 1280 if (!--dev->suspend_count) {
1278 tasklet_schedule (&dev->bh); 1281 netif_device_attach (dev->net);
1282 tasklet_schedule (&dev->bh);
1283 }
1279 return 0; 1284 return 0;
1280} 1285}
1281EXPORT_SYMBOL_GPL(usbnet_resume); 1286EXPORT_SYMBOL_GPL(usbnet_resume);
diff --git a/drivers/net/usb/usbnet.h b/drivers/net/usb/usbnet.h
index 82db5a8e528e..a3f8b9e7bc00 100644
--- a/drivers/net/usb/usbnet.h
+++ b/drivers/net/usb/usbnet.h
@@ -32,6 +32,7 @@ struct usbnet {
32 const char *driver_name; 32 const char *driver_name;
33 wait_queue_head_t *wait; 33 wait_queue_head_t *wait;
34 struct mutex phy_mutex; 34 struct mutex phy_mutex;
35 unsigned char suspend_count;
35 36
36 /* i/o info: pipes etc */ 37 /* i/o info: pipes etc */
37 unsigned in, out; 38 unsigned in, out;
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
index 246fac0e8001..3df3c60263d4 100644
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -311,7 +311,7 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
311 local_info_t *local; 311 local_info_t *local;
312 struct ieee80211_hdr_4addr *hdr; 312 struct ieee80211_hdr_4addr *hdr;
313 u16 fc; 313 u16 fc;
314 int hdr_len, res; 314 int prefix_len, postfix_len, hdr_len, res;
315 315
316 iface = netdev_priv(skb->dev); 316 iface = netdev_priv(skb->dev);
317 local = iface->local; 317 local = iface->local;
@@ -337,10 +337,13 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
337 if (skb == NULL) 337 if (skb == NULL)
338 return NULL; 338 return NULL;
339 339
340 if ((skb_headroom(skb) < crypt->ops->extra_mpdu_prefix_len || 340 prefix_len = crypt->ops->extra_mpdu_prefix_len +
341 skb_tailroom(skb) < crypt->ops->extra_mpdu_postfix_len) && 341 crypt->ops->extra_msdu_prefix_len;
342 pskb_expand_head(skb, crypt->ops->extra_mpdu_prefix_len, 342 postfix_len = crypt->ops->extra_mpdu_postfix_len +
343 crypt->ops->extra_mpdu_postfix_len, GFP_ATOMIC)) { 343 crypt->ops->extra_msdu_postfix_len;
344 if ((skb_headroom(skb) < prefix_len ||
345 skb_tailroom(skb) < postfix_len) &&
346 pskb_expand_head(skb, prefix_len, postfix_len, GFP_ATOMIC)) {
344 kfree_skb(skb); 347 kfree_skb(skb);
345 return NULL; 348 return NULL;
346 } 349 }
diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h
index 606bdd002be7..dfe27642322c 100644
--- a/drivers/net/wireless/libertas/decl.h
+++ b/drivers/net/wireless/libertas/decl.h
@@ -46,7 +46,7 @@ u32 libertas_index_to_data_rate(u8 index);
46u8 libertas_data_rate_to_index(u32 rate); 46u8 libertas_data_rate_to_index(u32 rate);
47void libertas_get_fwversion(wlan_adapter * adapter, char *fwversion, int maxlen); 47void libertas_get_fwversion(wlan_adapter * adapter, char *fwversion, int maxlen);
48 48
49int libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb); 49void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb);
50 50
51/** The proc fs interface */ 51/** The proc fs interface */
52int libertas_process_rx_command(wlan_private * priv); 52int libertas_process_rx_command(wlan_private * priv);
diff --git a/drivers/net/wireless/libertas/fw.c b/drivers/net/wireless/libertas/fw.c
index 441123c85e62..5c63c9b1659c 100644
--- a/drivers/net/wireless/libertas/fw.c
+++ b/drivers/net/wireless/libertas/fw.c
@@ -333,18 +333,22 @@ static void command_timer_fn(unsigned long data)
333 unsigned long flags; 333 unsigned long flags;
334 334
335 ptempnode = adapter->cur_cmd; 335 ptempnode = adapter->cur_cmd;
336 if (ptempnode == NULL) {
337 lbs_pr_debug(1, "PTempnode Empty\n");
338 return;
339 }
340
336 cmd = (struct cmd_ds_command *)ptempnode->bufvirtualaddr; 341 cmd = (struct cmd_ds_command *)ptempnode->bufvirtualaddr;
342 if (!cmd) {
343 lbs_pr_debug(1, "cmd is NULL\n");
344 return;
345 }
337 346
338 lbs_pr_info("command_timer_fn fired (%x)\n", cmd->command); 347 lbs_pr_info("command_timer_fn fired (%x)\n", cmd->command);
339 348
340 if (!adapter->fw_ready) 349 if (!adapter->fw_ready)
341 return; 350 return;
342 351
343 if (ptempnode == NULL) {
344 lbs_pr_debug(1, "PTempnode Empty\n");
345 return;
346 }
347
348 spin_lock_irqsave(&adapter->driver_lock, flags); 352 spin_lock_irqsave(&adapter->driver_lock, flags);
349 adapter->cur_cmd = NULL; 353 adapter->cur_cmd = NULL;
350 spin_unlock_irqrestore(&adapter->driver_lock, flags); 354 spin_unlock_irqrestore(&adapter->driver_lock, flags);
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index d17924f764e5..96619a32951b 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -136,7 +136,7 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd)
136 LEAVE(); 136 LEAVE();
137} 137}
138 138
139int libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb) 139void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb)
140{ 140{
141 lbs_pr_debug(1, "skb->data=%p\n", skb->data); 141 lbs_pr_debug(1, "skb->data=%p\n", skb->data);
142 142
@@ -148,8 +148,6 @@ int libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb)
148 skb->ip_summed = CHECKSUM_UNNECESSARY; 148 skb->ip_summed = CHECKSUM_UNNECESSARY;
149 149
150 netif_rx(skb); 150 netif_rx(skb);
151
152 return 0;
153} 151}
154 152
155/** 153/**
@@ -269,15 +267,11 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
269 wlan_compute_rssi(priv, p_rx_pd); 267 wlan_compute_rssi(priv, p_rx_pd);
270 268
271 lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); 269 lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len);
272 if (libertas_upload_rx_packet(priv, skb)) {
273 lbs_pr_debug(1, "RX error: libertas_upload_rx_packet"
274 " returns failure\n");
275 ret = -1;
276 goto done;
277 }
278 priv->stats.rx_bytes += skb->len; 270 priv->stats.rx_bytes += skb->len;
279 priv->stats.rx_packets++; 271 priv->stats.rx_packets++;
280 272
273 libertas_upload_rx_packet(priv, skb);
274
281 ret = 0; 275 ret = 0;
282done: 276done:
283 LEAVE(); 277 LEAVE();
@@ -438,22 +432,14 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
438 wlan_compute_rssi(priv, prxpd); 432 wlan_compute_rssi(priv, prxpd);
439 433
440 lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); 434 lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len);
441
442 if (libertas_upload_rx_packet(priv, skb)) {
443 lbs_pr_debug(1, "RX error: libertas_upload_rx_packet "
444 "returns failure\n");
445 ret = -1;
446 goto done;
447 }
448
449 priv->stats.rx_bytes += skb->len; 435 priv->stats.rx_bytes += skb->len;
450 priv->stats.rx_packets++; 436 priv->stats.rx_packets++;
451 437
438 libertas_upload_rx_packet(priv, skb);
439
452 ret = 0; 440 ret = 0;
453done: 441done:
454 LEAVE(); 442 LEAVE();
455 443
456 skb->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */
457
458 return (ret); 444 return (ret);
459} 445}
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index dd070cccf324..f49eb068c7d0 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -378,9 +378,10 @@ islpci_eth_receive(islpci_private *priv)
378 display_buffer((char *) skb->data, skb->len); 378 display_buffer((char *) skb->data, skb->len);
379#endif 379#endif
380 /* take care of monitor mode and spy monitoring. */ 380 /* take care of monitor mode and spy monitoring. */
381 if (unlikely(priv->iw_mode == IW_MODE_MONITOR)) 381 if (unlikely(priv->iw_mode == IW_MODE_MONITOR)) {
382 skb->dev = ndev;
382 discard = islpci_monitor_rx(priv, &skb); 383 discard = islpci_monitor_rx(priv, &skb);
383 else { 384 } else {
384 if (unlikely(skb->data[2 * ETH_ALEN] == 0)) { 385 if (unlikely(skb->data[2 * ETH_ALEN] == 0)) {
385 /* The packet has a rx_annex. Read it for spy monitoring, Then 386 /* The packet has a rx_annex. Read it for spy monitoring, Then
386 * remove it, while keeping the 2 leading MAC addr. 387 * remove it, while keeping the 2 leading MAC addr.
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 78c2e6e4b42e..edd6de995726 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -26,6 +26,7 @@
26#include <linux/profile.h> 26#include <linux/profile.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/fs.h> 28#include <linux/fs.h>
29#include <linux/sched.h>
29 30
30#include "oprofile_stats.h" 31#include "oprofile_stats.h"
31#include "event_buffer.h" 32#include "event_buffer.h"
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c
index 46abaa8c41f1..d06ccb69e411 100644
--- a/drivers/pci/hotplug/ibmphp_hpc.c
+++ b/drivers/pci/hotplug/ibmphp_hpc.c
@@ -34,6 +34,7 @@
34#include <linux/pci.h> 34#include <linux/pci.h>
35#include <linux/init.h> 35#include <linux/init.h>
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37#include <linux/sched.h>
37 38
38#include "ibmphp.h" 39#include "ibmphp.h"
39 40
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index d9cbd586ae4b..be1df85e5e2d 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -15,10 +15,10 @@
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <linux/proc_fs.h> 16#include <linux/proc_fs.h>
17#include <linux/msi.h> 17#include <linux/msi.h>
18#include <linux/smp.h>
18 19
19#include <asm/errno.h> 20#include <asm/errno.h>
20#include <asm/io.h> 21#include <asm/io.h>
21#include <asm/smp.h>
22 22
23#include "pci.h" 23#include "pci.h"
24#include "msi.h" 24#include "msi.h"
@@ -333,7 +333,7 @@ static int msi_capability_init(struct pci_dev *dev)
333 msi_mask_bits_reg(pos, is_64bit_address(control)), 333 msi_mask_bits_reg(pos, is_64bit_address(control)),
334 maskbits); 334 maskbits);
335 } 335 }
336 list_add(&entry->list, &dev->msi_list); 336 list_add_tail(&entry->list, &dev->msi_list);
337 337
338 /* Configure MSI capability structure */ 338 /* Configure MSI capability structure */
339 ret = arch_setup_msi_irqs(dev, 1, PCI_CAP_ID_MSI); 339 ret = arch_setup_msi_irqs(dev, 1, PCI_CAP_ID_MSI);
@@ -404,7 +404,7 @@ static int msix_capability_init(struct pci_dev *dev,
404 entry->dev = dev; 404 entry->dev = dev;
405 entry->mask_base = base; 405 entry->mask_base = base;
406 406
407 list_add(&entry->list, &dev->msi_list); 407 list_add_tail(&entry->list, &dev->msi_list);
408 } 408 }
409 409
410 ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX); 410 ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);
@@ -558,12 +558,12 @@ static int msi_free_irqs(struct pci_dev* dev)
558 558
559 list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) { 559 list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) {
560 if (entry->msi_attrib.type == PCI_CAP_ID_MSIX) { 560 if (entry->msi_attrib.type == PCI_CAP_ID_MSIX) {
561 if (list_is_last(&entry->list, &dev->msi_list))
562 iounmap(entry->mask_base);
563
564 writel(1, entry->mask_base + entry->msi_attrib.entry_nr 561 writel(1, entry->mask_base + entry->msi_attrib.entry_nr
565 * PCI_MSIX_ENTRY_SIZE 562 * PCI_MSIX_ENTRY_SIZE
566 + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET); 563 + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
564
565 if (list_is_last(&entry->list, &dev->msi_list))
566 iounmap(entry->mask_base);
567 } 567 }
568 list_del(&entry->list); 568 list_del(&entry->list);
569 kfree(entry); 569 kfree(entry);
diff --git a/drivers/pci/pcie/aer/aerdrv.h b/drivers/pci/pcie/aer/aerdrv.h
index bf655dbaf8e2..5cca394d5999 100644
--- a/drivers/pci/pcie/aer/aerdrv.h
+++ b/drivers/pci/pcie/aer/aerdrv.h
@@ -8,6 +8,7 @@
8#ifndef _AERDRV_H_ 8#ifndef _AERDRV_H_
9#define _AERDRV_H_ 9#define _AERDRV_H_
10 10
11#include <linux/workqueue.h>
11#include <linux/pcieport_if.h> 12#include <linux/pcieport_if.h>
12#include <linux/aer.h> 13#include <linux/aer.h>
13 14
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 6ccc2e95930a..01d8f8a8843c 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1625,18 +1625,22 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
1625 quirk_nvidia_ck804_pcie_aer_ext_cap); 1625 quirk_nvidia_ck804_pcie_aer_ext_cap);
1626 1626
1627#ifdef CONFIG_PCI_MSI 1627#ifdef CONFIG_PCI_MSI
1628/* The Serverworks PCI-X chipset does not support MSI. We cannot easily rely 1628/* Some chipsets do not support MSI. We cannot easily rely on setting
1629 * on setting PCI_BUS_FLAGS_NO_MSI in its bus flags because there are actually 1629 * PCI_BUS_FLAGS_NO_MSI in its bus flags because there are actually
1630 * some other busses controlled by the chipset even if Linux is not aware of it. 1630 * some other busses controlled by the chipset even if Linux is not
1631 * Instead of setting the flag on all busses in the machine, simply disable MSI 1631 * aware of it. Instead of setting the flag on all busses in the
1632 * globally. 1632 * machine, simply disable MSI globally.
1633 */ 1633 */
1634static void __init quirk_svw_msi(struct pci_dev *dev) 1634static void __init quirk_disable_all_msi(struct pci_dev *dev)
1635{ 1635{
1636 pci_no_msi(); 1636 pci_no_msi();
1637 printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n"); 1637 printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n");
1638} 1638}
1639DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_svw_msi); 1639DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi);
1640DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX, quirk_disable_all_msi);
1641DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi);
1642DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi);
1643DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi);
1640 1644
1641/* Disable MSI on chipsets that are known to not support it */ 1645/* Disable MSI on chipsets that are known to not support it */
1642static void __devinit quirk_disable_msi(struct pci_dev *dev) 1646static void __devinit quirk_disable_msi(struct pci_dev *dev)
@@ -1649,8 +1653,6 @@ static void __devinit quirk_disable_msi(struct pci_dev *dev)
1649 } 1653 }
1650} 1654}
1651DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi); 1655DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi);
1652DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_msi);
1653DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_msi);
1654 1656
1655/* Go through the list of Hypertransport capabilities and 1657/* Go through the list of Hypertransport capabilities and
1656 * return 1 if a HT MSI capability is found and enabled */ 1658 * return 1 if a HT MSI capability is found and enabled */
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index b137a27472c7..c13232435dc0 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -403,10 +403,11 @@ const struct pci_device_id *pci_find_present(const struct pci_device_id *ids)
403 while (ids->vendor || ids->subvendor || ids->class_mask) { 403 while (ids->vendor || ids->subvendor || ids->class_mask) {
404 list_for_each_entry(dev, &pci_devices, global_list) { 404 list_for_each_entry(dev, &pci_devices, global_list) {
405 if ((found = pci_match_one_device(ids, dev)) != NULL) 405 if ((found = pci_match_one_device(ids, dev)) != NULL)
406 break; 406 goto exit;
407 } 407 }
408 ids++; 408 ids++;
409 } 409 }
410exit:
410 up_read(&pci_bus_sem); 411 up_read(&pci_bus_sem);
411 return found; 412 return found;
412} 413}
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 948efc775a78..eb6abd3f9221 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -336,16 +336,21 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
336 enable_irq_wake(board->det_pin); 336 enable_irq_wake(board->det_pin);
337 if (board->irq_pin) 337 if (board->irq_pin)
338 enable_irq_wake(board->irq_pin); 338 enable_irq_wake(board->irq_pin);
339 } else {
340 disable_irq_wake(board->det_pin);
341 if (board->irq_pin)
342 disable_irq_wake(board->irq_pin);
343 } 339 }
344 return 0; 340 return 0;
345} 341}
346 342
347static int at91_cf_resume(struct platform_device *pdev) 343static int at91_cf_resume(struct platform_device *pdev)
348{ 344{
345 struct at91_cf_socket *cf = platform_get_drvdata(pdev);
346 struct at91_cf_data *board = cf->board;
347
348 if (device_may_wakeup(&pdev->dev)) {
349 disable_irq_wake(board->det_pin);
350 if (board->irq_pin)
351 disable_irq_wake(board->irq_pin);
352 }
353
349 pcmcia_socket_dev_resume(&pdev->dev); 354 pcmcia_socket_dev_resume(&pdev->dev);
350 return 0; 355 return 0;
351} 356}
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 6085261aa2c1..e24ea82dc35b 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -641,9 +641,16 @@ cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
641 * drivers can't provide shutdown() methods to disable IRQs. 641 * drivers can't provide shutdown() methods to disable IRQs.
642 * Or better yet, fix PNP to allow those methods... 642 * Or better yet, fix PNP to allow those methods...
643 */ 643 */
644 return cmos_do_probe(&pnp->dev, 644 if (pnp_port_start(pnp,0) == 0x70 && !pnp_irq_valid(pnp,0))
645 &pnp->res.port_resource[0], 645 /* Some machines contain a PNP entry for the RTC, but
646 pnp->res.irq_resource[0].start); 646 * don't define the IRQ. It should always be safe to
647 * hardcode it in these cases
648 */
649 return cmos_do_probe(&pnp->dev, &pnp->res.port_resource[0], 8);
650 else
651 return cmos_do_probe(&pnp->dev,
652 &pnp->res.port_resource[0],
653 pnp->res.irq_resource[0].start);
647} 654}
648 655
649static void __exit cmos_pnp_remove(struct pnp_dev *pnp) 656static void __exit cmos_pnp_remove(struct pnp_dev *pnp)
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
index a1dc8c466ec9..0c081a664ee8 100644
--- a/drivers/s390/block/dasd_eer.c
+++ b/drivers/s390/block/dasd_eer.c
@@ -14,9 +14,9 @@
14#include <linux/moduleparam.h> 14#include <linux/moduleparam.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/poll.h> 16#include <linux/poll.h>
17#include <linux/mutex.h>
17 18
18#include <asm/uaccess.h> 19#include <asm/uaccess.h>
19#include <asm/semaphore.h>
20#include <asm/atomic.h> 20#include <asm/atomic.h>
21#include <asm/ebcdic.h> 21#include <asm/ebcdic.h>
22 22
@@ -514,7 +514,7 @@ void dasd_eer_disable(struct dasd_device *device)
514 * to transfer in a readbuffer, which is protected by the readbuffer_mutex. 514 * to transfer in a readbuffer, which is protected by the readbuffer_mutex.
515 */ 515 */
516static char readbuffer[PAGE_SIZE]; 516static char readbuffer[PAGE_SIZE];
517static DECLARE_MUTEX(readbuffer_mutex); 517static DEFINE_MUTEX(readbuffer_mutex);
518 518
519static int dasd_eer_open(struct inode *inp, struct file *filp) 519static int dasd_eer_open(struct inode *inp, struct file *filp)
520{ 520{
@@ -579,7 +579,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
579 struct eerbuffer *eerb; 579 struct eerbuffer *eerb;
580 580
581 eerb = (struct eerbuffer *) filp->private_data; 581 eerb = (struct eerbuffer *) filp->private_data;
582 if (down_interruptible(&readbuffer_mutex)) 582 if (mutex_lock_interruptible(&readbuffer_mutex))
583 return -ERESTARTSYS; 583 return -ERESTARTSYS;
584 584
585 spin_lock_irqsave(&bufferlock, flags); 585 spin_lock_irqsave(&bufferlock, flags);
@@ -588,7 +588,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
588 /* has been deleted */ 588 /* has been deleted */
589 eerb->residual = 0; 589 eerb->residual = 0;
590 spin_unlock_irqrestore(&bufferlock, flags); 590 spin_unlock_irqrestore(&bufferlock, flags);
591 up(&readbuffer_mutex); 591 mutex_unlock(&readbuffer_mutex);
592 return -EIO; 592 return -EIO;
593 } else if (eerb->residual > 0) { 593 } else if (eerb->residual > 0) {
594 /* OK we still have a second half of a record to deliver */ 594 /* OK we still have a second half of a record to deliver */
@@ -602,7 +602,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
602 if (!tc) { 602 if (!tc) {
603 /* no data available */ 603 /* no data available */
604 spin_unlock_irqrestore(&bufferlock, flags); 604 spin_unlock_irqrestore(&bufferlock, flags);
605 up(&readbuffer_mutex); 605 mutex_unlock(&readbuffer_mutex);
606 if (filp->f_flags & O_NONBLOCK) 606 if (filp->f_flags & O_NONBLOCK)
607 return -EAGAIN; 607 return -EAGAIN;
608 rc = wait_event_interruptible( 608 rc = wait_event_interruptible(
@@ -610,7 +610,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
610 eerb->head != eerb->tail); 610 eerb->head != eerb->tail);
611 if (rc) 611 if (rc)
612 return rc; 612 return rc;
613 if (down_interruptible(&readbuffer_mutex)) 613 if (mutex_lock_interruptible(&readbuffer_mutex))
614 return -ERESTARTSYS; 614 return -ERESTARTSYS;
615 spin_lock_irqsave(&bufferlock, flags); 615 spin_lock_irqsave(&bufferlock, flags);
616 } 616 }
@@ -626,11 +626,11 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
626 spin_unlock_irqrestore(&bufferlock, flags); 626 spin_unlock_irqrestore(&bufferlock, flags);
627 627
628 if (copy_to_user(buf, readbuffer, effective_count)) { 628 if (copy_to_user(buf, readbuffer, effective_count)) {
629 up(&readbuffer_mutex); 629 mutex_unlock(&readbuffer_mutex);
630 return -EFAULT; 630 return -EFAULT;
631 } 631 }
632 632
633 up(&readbuffer_mutex); 633 mutex_unlock(&readbuffer_mutex);
634 return effective_count; 634 return effective_count;
635} 635}
636 636
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index f6ef90ee3e7d..743944ad61ec 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -487,7 +487,7 @@ struct raw3270_ua { /* Query Reply structure for Usable Area */
487} __attribute__ ((packed)); 487} __attribute__ ((packed));
488 488
489static struct diag210 raw3270_init_diag210; 489static struct diag210 raw3270_init_diag210;
490static DECLARE_MUTEX(raw3270_init_sem); 490static DEFINE_MUTEX(raw3270_init_mutex);
491 491
492static int 492static int
493raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq, 493raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq,
@@ -713,7 +713,7 @@ raw3270_size_device(struct raw3270 *rp)
713{ 713{
714 int rc; 714 int rc;
715 715
716 down(&raw3270_init_sem); 716 mutex_lock(&raw3270_init_mutex);
717 rp->view = &raw3270_init_view; 717 rp->view = &raw3270_init_view;
718 raw3270_init_view.dev = rp; 718 raw3270_init_view.dev = rp;
719 if (MACHINE_IS_VM) 719 if (MACHINE_IS_VM)
@@ -722,7 +722,7 @@ raw3270_size_device(struct raw3270 *rp)
722 rc = __raw3270_size_device(rp); 722 rc = __raw3270_size_device(rp);
723 raw3270_init_view.dev = NULL; 723 raw3270_init_view.dev = NULL;
724 rp->view = NULL; 724 rp->view = NULL;
725 up(&raw3270_init_sem); 725 mutex_unlock(&raw3270_init_mutex);
726 if (rc == 0) { /* Found something. */ 726 if (rc == 0) { /* Found something. */
727 /* Try to find a model. */ 727 /* Try to find a model. */
728 rp->model = 0; 728 rp->model = 0;
@@ -749,7 +749,7 @@ raw3270_reset_device(struct raw3270 *rp)
749{ 749{
750 int rc; 750 int rc;
751 751
752 down(&raw3270_init_sem); 752 mutex_lock(&raw3270_init_mutex);
753 memset(&rp->init_request, 0, sizeof(rp->init_request)); 753 memset(&rp->init_request, 0, sizeof(rp->init_request));
754 memset(&rp->init_data, 0, sizeof(rp->init_data)); 754 memset(&rp->init_data, 0, sizeof(rp->init_data));
755 /* Store reset data stream to init_data/init_request */ 755 /* Store reset data stream to init_data/init_request */
@@ -764,7 +764,7 @@ raw3270_reset_device(struct raw3270 *rp)
764 rc = raw3270_start_init(rp, &raw3270_init_view, &rp->init_request); 764 rc = raw3270_start_init(rp, &raw3270_init_view, &rp->init_request);
765 raw3270_init_view.dev = NULL; 765 raw3270_init_view.dev = NULL;
766 rp->view = NULL; 766 rp->view = NULL;
767 up(&raw3270_init_sem); 767 mutex_unlock(&raw3270_init_mutex);
768 return rc; 768 return rc;
769} 769}
770 770
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index a8b373f69cf0..6b264bdb5bfb 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -296,30 +296,57 @@ static void ccw_device_unregister(struct ccw_device *cdev)
296 device_del(&cdev->dev); 296 device_del(&cdev->dev);
297} 297}
298 298
299static void ccw_device_remove_orphan_cb(struct device *dev)
300{
301 struct ccw_device *cdev = to_ccwdev(dev);
302
303 ccw_device_unregister(cdev);
304 put_device(&cdev->dev);
305}
306
307static void ccw_device_remove_sch_cb(struct device *dev)
308{
309 struct subchannel *sch;
310
311 sch = to_subchannel(dev);
312 css_sch_device_unregister(sch);
313 /* Reset intparm to zeroes. */
314 sch->schib.pmcw.intparm = 0;
315 cio_modify(sch);
316 put_device(&sch->dev);
317}
318
299static void 319static void
300ccw_device_remove_disconnected(struct ccw_device *cdev) 320ccw_device_remove_disconnected(struct ccw_device *cdev)
301{ 321{
302 struct subchannel *sch;
303 unsigned long flags; 322 unsigned long flags;
323 int rc;
324
304 /* 325 /*
305 * Forced offline in disconnected state means 326 * Forced offline in disconnected state means
306 * 'throw away device'. 327 * 'throw away device'.
307 */ 328 */
308 if (ccw_device_is_orphan(cdev)) { 329 if (ccw_device_is_orphan(cdev)) {
309 /* Deregister ccw device. */ 330 /*
331 * Deregister ccw device.
332 * Unfortunately, we cannot do this directly from the
333 * attribute method.
334 */
310 spin_lock_irqsave(cdev->ccwlock, flags); 335 spin_lock_irqsave(cdev->ccwlock, flags);
311 cdev->private->state = DEV_STATE_NOT_OPER; 336 cdev->private->state = DEV_STATE_NOT_OPER;
312 spin_unlock_irqrestore(cdev->ccwlock, flags); 337 spin_unlock_irqrestore(cdev->ccwlock, flags);
313 ccw_device_unregister(cdev); 338 rc = device_schedule_callback(&cdev->dev,
314 put_device(&cdev->dev); 339 ccw_device_remove_orphan_cb);
315 return ; 340 if (rc)
341 dev_info(&cdev->dev, "Couldn't unregister orphan\n");
342 return;
316 } 343 }
317 sch = to_subchannel(cdev->dev.parent); 344 /* Deregister subchannel, which will kill the ccw device. */
318 css_sch_device_unregister(sch); 345 rc = device_schedule_callback(cdev->dev.parent,
319 /* Reset intparm to zeroes. */ 346 ccw_device_remove_sch_cb);
320 sch->schib.pmcw.intparm = 0; 347 if (rc)
321 cio_modify(sch); 348 dev_info(&cdev->dev,
322 put_device(&sch->dev); 349 "Couldn't unregister disconnected device\n");
323} 350}
324 351
325int 352int
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 898ec3b2bebb..6bba80929577 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -688,6 +688,12 @@ ccw_device_disband_done(struct ccw_device *cdev, int err)
688 ccw_device_done(cdev, DEV_STATE_BOXED); 688 ccw_device_done(cdev, DEV_STATE_BOXED);
689 break; 689 break;
690 default: 690 default:
691 cdev->private->flags.donotify = 0;
692 if (get_device(&cdev->dev)) {
693 PREPARE_WORK(&cdev->private->kick_work,
694 ccw_device_call_sch_unregister);
695 queue_work(ccw_device_work, &cdev->private->kick_work);
696 }
691 ccw_device_done(cdev, DEV_STATE_NOT_OPER); 697 ccw_device_done(cdev, DEV_STATE_NOT_OPER);
692 break; 698 break;
693 } 699 }
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index ddff40c4212c..821cde65e369 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -1127,6 +1127,7 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
1127 int retval = 0; 1127 int retval = 0;
1128 unsigned long flags; 1128 unsigned long flags;
1129 1129
1130 zfcp_adapter_scsi_unregister(adapter);
1130 device_unregister(&adapter->generic_services); 1131 device_unregister(&adapter->generic_services);
1131 zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev); 1132 zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev);
1132 dev_set_drvdata(&adapter->ccw_device->dev, NULL); 1133 dev_set_drvdata(&adapter->ccw_device->dev, NULL);
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index 81680efa1721..1c8f71a59855 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -189,9 +189,7 @@ zfcp_ccw_set_online(struct ccw_device *ccw_device)
189 * @ccw_device: pointer to belonging ccw device 189 * @ccw_device: pointer to belonging ccw device
190 * 190 *
191 * This function gets called by the common i/o layer and sets an adapter 191 * This function gets called by the common i/o layer and sets an adapter
192 * into state offline. Setting an fcp device offline means that it will be 192 * into state offline.
193 * unregistered from the SCSI stack and that the adapter will be shut down
194 * asynchronously.
195 */ 193 */
196static int 194static int
197zfcp_ccw_set_offline(struct ccw_device *ccw_device) 195zfcp_ccw_set_offline(struct ccw_device *ccw_device)
@@ -202,7 +200,6 @@ zfcp_ccw_set_offline(struct ccw_device *ccw_device)
202 adapter = dev_get_drvdata(&ccw_device->dev); 200 adapter = dev_get_drvdata(&ccw_device->dev);
203 zfcp_erp_adapter_shutdown(adapter, 0); 201 zfcp_erp_adapter_shutdown(adapter, 0);
204 zfcp_erp_wait(adapter); 202 zfcp_erp_wait(adapter);
205 zfcp_adapter_scsi_unregister(adapter);
206 zfcp_erp_thread_kill(adapter); 203 zfcp_erp_thread_kill(adapter);
207 zfcp_adapter_debug_unregister(adapter); 204 zfcp_adapter_debug_unregister(adapter);
208 up(&zfcp_data.config_sema); 205 up(&zfcp_data.config_sema);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index a8b02542ac2d..0eb31e162b15 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -156,44 +156,30 @@ zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req)
156 kfree(fsf_req); 156 kfree(fsf_req);
157} 157}
158 158
159/** 159/*
160 * zfcp_fsf_req_dismiss - dismiss a single fsf request 160 * Never ever call this without shutting down the adapter first.
161 */ 161 * Otherwise the adapter would continue using and corrupting s390 storage.
162static void zfcp_fsf_req_dismiss(struct zfcp_adapter *adapter, 162 * Included BUG_ON() call to ensure this is done.
163 struct zfcp_fsf_req *fsf_req, 163 * ERP is supposed to be the only user of this function.
164 unsigned int counter)
165{
166 u64 dbg_tmp[2];
167
168 dbg_tmp[0] = (u64) atomic_read(&adapter->reqs_active);
169 dbg_tmp[1] = (u64) counter;
170 debug_event(adapter->erp_dbf, 4, (void *) dbg_tmp, 16);
171 list_del(&fsf_req->list);
172 fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
173 zfcp_fsf_req_complete(fsf_req);
174}
175
176/**
177 * zfcp_fsf_req_dismiss_all - dismiss all remaining fsf requests
178 */ 164 */
179void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) 165void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter)
180{ 166{
181 struct zfcp_fsf_req *request, *tmp; 167 struct zfcp_fsf_req *fsf_req, *tmp;
182 unsigned long flags; 168 unsigned long flags;
183 LIST_HEAD(remove_queue); 169 LIST_HEAD(remove_queue);
184 unsigned int i, counter; 170 unsigned int i;
185 171
172 BUG_ON(atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status));
186 spin_lock_irqsave(&adapter->req_list_lock, flags); 173 spin_lock_irqsave(&adapter->req_list_lock, flags);
187 atomic_set(&adapter->reqs_active, 0); 174 atomic_set(&adapter->reqs_active, 0);
188 for (i=0; i<REQUEST_LIST_SIZE; i++) 175 for (i = 0; i < REQUEST_LIST_SIZE; i++)
189 list_splice_init(&adapter->req_list[i], &remove_queue); 176 list_splice_init(&adapter->req_list[i], &remove_queue);
190
191 spin_unlock_irqrestore(&adapter->req_list_lock, flags); 177 spin_unlock_irqrestore(&adapter->req_list_lock, flags);
192 178
193 counter = 0; 179 list_for_each_entry_safe(fsf_req, tmp, &remove_queue, list) {
194 list_for_each_entry_safe(request, tmp, &remove_queue, list) { 180 list_del(&fsf_req->list);
195 zfcp_fsf_req_dismiss(adapter, request, counter); 181 fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
196 counter++; 182 zfcp_fsf_req_complete(fsf_req);
197 } 183 }
198} 184}
199 185
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 16e2d64658af..0acf6db0a08d 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -569,6 +569,9 @@ zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
569 int retval = 0; 569 int retval = 0;
570 static unsigned int unique_id = 0; 570 static unsigned int unique_id = 0;
571 571
572 if (adapter->scsi_host)
573 goto out;
574
572 /* register adapter as SCSI host with mid layer of SCSI stack */ 575 /* register adapter as SCSI host with mid layer of SCSI stack */
573 adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template, 576 adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template,
574 sizeof (struct zfcp_adapter *)); 577 sizeof (struct zfcp_adapter *));
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 262f01e68592..44e039865aa9 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/smp_lock.h> 15#include <linux/smp_lock.h>
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/mm.h>
17 18
18#include <asm/system.h> 19#include <asm/system.h>
19#include <asm/uaccess.h> 20#include <asm/uaccess.h>
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index d28c14e23c32..572034ceb143 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1753,23 +1753,9 @@ config SUN3X_ESP
1753 The ESP was an on-board SCSI controller used on Sun 3/80 1753 The ESP was an on-board SCSI controller used on Sun 3/80
1754 machines. Say Y here to compile in support for it. 1754 machines. Say Y here to compile in support for it.
1755 1755
1756config SCSI_ESP_CORE
1757 tristate "ESP Scsi Driver Core"
1758 depends on SCSI
1759 select SCSI_SPI_ATTRS
1760 help
1761 This is a core driver for NCR53c9x based scsi chipsets,
1762 also known as "ESP" for Emulex Scsi Processor or
1763 Enhanced Scsi Processor. This driver does not exist by
1764 itself, there are front-end drivers which, when enabled,
1765 select and enable this driver. One example is SCSI_SUNESP.
1766 These front-end drivers provide probing, DMA, and register
1767 access support for the core driver.
1768
1769config SCSI_SUNESP 1756config SCSI_SUNESP
1770 tristate "Sparc ESP Scsi Driver" 1757 tristate "Sparc ESP Scsi Driver"
1771 depends on SBUS && SCSI 1758 depends on SBUS && SCSI
1772 select SCSI_ESP_CORE
1773 help 1759 help
1774 This is the driver for the Sun ESP SCSI host adapter. The ESP 1760 This is the driver for the Sun ESP SCSI host adapter. The ESP
1775 chipset is present in most SPARC SBUS-based computers. 1761 chipset is present in most SPARC SBUS-based computers.
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index 51e884fa10b0..b1b632791580 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -106,8 +106,7 @@ obj-$(CONFIG_MEGARAID_LEGACY) += megaraid.o
106obj-$(CONFIG_MEGARAID_NEWGEN) += megaraid/ 106obj-$(CONFIG_MEGARAID_NEWGEN) += megaraid/
107obj-$(CONFIG_MEGARAID_SAS) += megaraid/ 107obj-$(CONFIG_MEGARAID_SAS) += megaraid/
108obj-$(CONFIG_SCSI_ACARD) += atp870u.o 108obj-$(CONFIG_SCSI_ACARD) += atp870u.o
109obj-$(CONFIG_SCSI_ESP_CORE) += esp_scsi.o 109obj-$(CONFIG_SCSI_SUNESP) += esp_scsi.o sun_esp.o
110obj-$(CONFIG_SCSI_SUNESP) += sun_esp.o
111obj-$(CONFIG_SCSI_GDTH) += gdth.o 110obj-$(CONFIG_SCSI_GDTH) += gdth.o
112obj-$(CONFIG_SCSI_INITIO) += initio.o 111obj-$(CONFIG_SCSI_INITIO) += initio.o
113obj-$(CONFIG_SCSI_INIA100) += a100u2w.o 112obj-$(CONFIG_SCSI_INIA100) += a100u2w.o
@@ -121,7 +120,7 @@ obj-$(CONFIG_BLK_DEV_3W_XXXX_RAID) += 3w-xxxx.o
121obj-$(CONFIG_SCSI_3W_9XXX) += 3w-9xxx.o 120obj-$(CONFIG_SCSI_3W_9XXX) += 3w-9xxx.o
122obj-$(CONFIG_SCSI_PPA) += ppa.o 121obj-$(CONFIG_SCSI_PPA) += ppa.o
123obj-$(CONFIG_SCSI_IMM) += imm.o 122obj-$(CONFIG_SCSI_IMM) += imm.o
124obj-$(CONFIG_JAZZ_ESP) += NCR53C9x.o jazz_esp.o 123obj-$(CONFIG_JAZZ_ESP) += esp_scsi.o jazz_esp.o
125obj-$(CONFIG_SUN3X_ESP) += NCR53C9x.o sun3x_esp.o 124obj-$(CONFIG_SUN3X_ESP) += NCR53C9x.o sun3x_esp.o
126obj-$(CONFIG_SCSI_FCAL) += fcal.o 125obj-$(CONFIG_SCSI_FCAL) += fcal.o
127obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o 126obj-$(CONFIG_SCSI_LASI700) += 53c700.o lasi700.o
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index bb3cb3360541..88ea5a1fb606 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -2625,7 +2625,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
2625#ifdef REAL_DMA 2625#ifdef REAL_DMA
2626static void NCR5380_dma_complete(NCR5380_instance * instance) { 2626static void NCR5380_dma_complete(NCR5380_instance * instance) {
2627 NCR5380_local_declare(); 2627 NCR5380_local_declare();
2628 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata * instance->hostdata); 2628 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
2629 int transferred; 2629 int transferred;
2630 NCR5380_setup(instance); 2630 NCR5380_setup(instance);
2631 2631
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 1e82c69b36b0..8dcfe4ec35c2 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -146,7 +146,7 @@ static char *aac_get_status_string(u32 status);
146static int nondasd = -1; 146static int nondasd = -1;
147static int dacmode = -1; 147static int dacmode = -1;
148 148
149static int commit = -1; 149int aac_commit = -1;
150int startup_timeout = 180; 150int startup_timeout = 180;
151int aif_timeout = 120; 151int aif_timeout = 120;
152 152
@@ -154,7 +154,7 @@ module_param(nondasd, int, S_IRUGO|S_IWUSR);
154MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on"); 154MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on");
155module_param(dacmode, int, S_IRUGO|S_IWUSR); 155module_param(dacmode, int, S_IRUGO|S_IWUSR);
156MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on"); 156MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on");
157module_param(commit, int, S_IRUGO|S_IWUSR); 157module_param_named(commit, aac_commit, int, S_IRUGO|S_IWUSR);
158MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays.\nThis is typically needed in systems that do not have a BIOS. 0=off, 1=on"); 158MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays.\nThis is typically needed in systems that do not have a BIOS. 0=off, 1=on");
159module_param(startup_timeout, int, S_IRUGO|S_IWUSR); 159module_param(startup_timeout, int, S_IRUGO|S_IWUSR);
160MODULE_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for adapter to have it's kernel up and\nrunning. This is typically adjusted for large systems that do not have a BIOS."); 160MODULE_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for adapter to have it's kernel up and\nrunning. This is typically adjusted for large systems that do not have a BIOS.");
@@ -173,6 +173,9 @@ int expose_physicals = -1;
173module_param(expose_physicals, int, S_IRUGO|S_IWUSR); 173module_param(expose_physicals, int, S_IRUGO|S_IWUSR);
174MODULE_PARM_DESC(expose_physicals, "Expose physical components of the arrays. -1=protect 0=off, 1=on"); 174MODULE_PARM_DESC(expose_physicals, "Expose physical components of the arrays. -1=protect 0=off, 1=on");
175 175
176int aac_reset_devices = 0;
177module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR);
178MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization.");
176 179
177static inline int aac_valid_context(struct scsi_cmnd *scsicmd, 180static inline int aac_valid_context(struct scsi_cmnd *scsicmd,
178 struct fib *fibptr) { 181 struct fib *fibptr) {
@@ -246,7 +249,7 @@ int aac_get_config_status(struct aac_dev *dev, int commit_flag)
246 aac_fib_complete(fibptr); 249 aac_fib_complete(fibptr);
247 /* Send a CT_COMMIT_CONFIG to enable discovery of devices */ 250 /* Send a CT_COMMIT_CONFIG to enable discovery of devices */
248 if (status >= 0) { 251 if (status >= 0) {
249 if ((commit == 1) || commit_flag) { 252 if ((aac_commit == 1) || commit_flag) {
250 struct aac_commit_config * dinfo; 253 struct aac_commit_config * dinfo;
251 aac_fib_init(fibptr); 254 aac_fib_init(fibptr);
252 dinfo = (struct aac_commit_config *) fib_data(fibptr); 255 dinfo = (struct aac_commit_config *) fib_data(fibptr);
@@ -261,7 +264,7 @@ int aac_get_config_status(struct aac_dev *dev, int commit_flag)
261 1, 1, 264 1, 1,
262 NULL, NULL); 265 NULL, NULL);
263 aac_fib_complete(fibptr); 266 aac_fib_complete(fibptr);
264 } else if (commit == 0) { 267 } else if (aac_commit == 0) {
265 printk(KERN_WARNING 268 printk(KERN_WARNING
266 "aac_get_config_status: Foreign device configurations are being ignored\n"); 269 "aac_get_config_status: Foreign device configurations are being ignored\n");
267 } 270 }
@@ -340,7 +343,7 @@ int aac_get_containers(struct aac_dev *dev)
340static void aac_internal_transfer(struct scsi_cmnd *scsicmd, void *data, unsigned int offset, unsigned int len) 343static void aac_internal_transfer(struct scsi_cmnd *scsicmd, void *data, unsigned int offset, unsigned int len)
341{ 344{
342 void *buf; 345 void *buf;
343 unsigned int transfer_len; 346 int transfer_len;
344 struct scatterlist *sg = scsicmd->request_buffer; 347 struct scatterlist *sg = scsicmd->request_buffer;
345 348
346 if (scsicmd->use_sg) { 349 if (scsicmd->use_sg) {
@@ -351,7 +354,7 @@ static void aac_internal_transfer(struct scsi_cmnd *scsicmd, void *data, unsigne
351 transfer_len = min(scsicmd->request_bufflen, len + offset); 354 transfer_len = min(scsicmd->request_bufflen, len + offset);
352 } 355 }
353 transfer_len -= offset; 356 transfer_len -= offset;
354 if (buf && transfer_len) 357 if (buf && transfer_len > 0)
355 memcpy(buf + offset, data, transfer_len); 358 memcpy(buf + offset, data, transfer_len);
356 359
357 if (scsicmd->use_sg) 360 if (scsicmd->use_sg)
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 45ca3e801619..c81edf36913f 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1823,9 +1823,12 @@ int aac_send_shutdown(struct aac_dev *dev);
1823int aac_probe_container(struct aac_dev *dev, int cid); 1823int aac_probe_container(struct aac_dev *dev, int cid);
1824int _aac_rx_init(struct aac_dev *dev); 1824int _aac_rx_init(struct aac_dev *dev);
1825int aac_rx_select_comm(struct aac_dev *dev, int comm); 1825int aac_rx_select_comm(struct aac_dev *dev, int comm);
1826int aac_rx_deliver_producer(struct fib * fib);
1826extern int numacb; 1827extern int numacb;
1827extern int acbsize; 1828extern int acbsize;
1828extern char aac_driver_version[]; 1829extern char aac_driver_version[];
1829extern int startup_timeout; 1830extern int startup_timeout;
1830extern int aif_timeout; 1831extern int aif_timeout;
1831extern int expose_physicals; 1832extern int expose_physicals;
1833extern int aac_reset_devices;
1834extern int aac_commit;
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index 291cd14f4e98..ae978a373c56 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -378,7 +378,7 @@ static int aac_rx_check_health(struct aac_dev *dev)
378 * 378 *
379 * Will send a fib, returning 0 if successful. 379 * Will send a fib, returning 0 if successful.
380 */ 380 */
381static int aac_rx_deliver_producer(struct fib * fib) 381int aac_rx_deliver_producer(struct fib * fib)
382{ 382{
383 struct aac_dev *dev = fib->dev; 383 struct aac_dev *dev = fib->dev;
384 struct aac_queue *q = &dev->queues->queue[AdapNormCmdQueue]; 384 struct aac_queue *q = &dev->queues->queue[AdapNormCmdQueue];
@@ -488,6 +488,8 @@ static int aac_rx_restart_adapter(struct aac_dev *dev, int bled)
488 return -EINVAL; 488 return -EINVAL;
489 if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) 489 if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC)
490 return -ENODEV; 490 return -ENODEV;
491 if (startup_timeout < 300)
492 startup_timeout = 300;
491 return 0; 493 return 0;
492} 494}
493 495
@@ -542,7 +544,7 @@ int _aac_rx_init(struct aac_dev *dev)
542 dev->a_ops.adapter_sync_cmd = rx_sync_cmd; 544 dev->a_ops.adapter_sync_cmd = rx_sync_cmd;
543 dev->a_ops.adapter_enable_int = aac_rx_disable_interrupt; 545 dev->a_ops.adapter_enable_int = aac_rx_disable_interrupt;
544 dev->OIMR = status = rx_readb (dev, MUnit.OIMR); 546 dev->OIMR = status = rx_readb (dev, MUnit.OIMR);
545 if ((((status & 0x0c) != 0x0c) || reset_devices) && 547 if ((((status & 0x0c) != 0x0c) || aac_reset_devices || reset_devices) &&
546 !aac_rx_restart_adapter(dev, 0)) 548 !aac_rx_restart_adapter(dev, 0))
547 ++restart; 549 ++restart;
548 /* 550 /*
@@ -594,6 +596,8 @@ int _aac_rx_init(struct aac_dev *dev)
594 } 596 }
595 msleep(1); 597 msleep(1);
596 } 598 }
599 if (restart)
600 aac_commit = 1;
597 /* 601 /*
598 * Fill in the common function dispatch table. 602 * Fill in the common function dispatch table.
599 */ 603 */
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
index f4b5e9742ab0..85b91bc578c9 100644
--- a/drivers/scsi/aacraid/sa.c
+++ b/drivers/scsi/aacraid/sa.c
@@ -5,7 +5,7 @@
5 * based on the old aacraid driver that is.. 5 * based on the old aacraid driver that is..
6 * Adaptec aacraid device driver for Linux. 6 * Adaptec aacraid device driver for Linux.
7 * 7 *
8 * Copyright (c) 2000 Adaptec, Inc. (aacraid@adaptec.com) 8 * Copyright (c) 2000-2007 Adaptec, Inc. (aacraid@adaptec.com)
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 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 11 * it under the terms of the GNU General Public License as published by
@@ -257,6 +257,11 @@ static void aac_sa_start_adapter(struct aac_dev *dev)
257 NULL, NULL, NULL, NULL, NULL); 257 NULL, NULL, NULL, NULL, NULL);
258} 258}
259 259
260static int aac_sa_restart_adapter(struct aac_dev *dev, int bled)
261{
262 return -EINVAL;
263}
264
260/** 265/**
261 * aac_sa_check_health 266 * aac_sa_check_health
262 * @dev: device to check if healthy 267 * @dev: device to check if healthy
@@ -366,7 +371,9 @@ int aac_sa_init(struct aac_dev *dev)
366 dev->a_ops.adapter_notify = aac_sa_notify_adapter; 371 dev->a_ops.adapter_notify = aac_sa_notify_adapter;
367 dev->a_ops.adapter_sync_cmd = sa_sync_cmd; 372 dev->a_ops.adapter_sync_cmd = sa_sync_cmd;
368 dev->a_ops.adapter_check_health = aac_sa_check_health; 373 dev->a_ops.adapter_check_health = aac_sa_check_health;
374 dev->a_ops.adapter_restart = aac_sa_restart_adapter;
369 dev->a_ops.adapter_intr = aac_sa_intr; 375 dev->a_ops.adapter_intr = aac_sa_intr;
376 dev->a_ops.adapter_deliver = aac_rx_deliver_producer;
370 dev->a_ops.adapter_ioremap = aac_sa_ioremap; 377 dev->a_ops.adapter_ioremap = aac_sa_ioremap;
371 378
372 /* 379 /*
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 9ddc6e4a74b0..05f692bd0adc 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -5180,7 +5180,7 @@ ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
5180 cur_lun = lun; 5180 cur_lun = lun;
5181 max_lun = lun; 5181 max_lun = lun;
5182 } 5182 }
5183 for (cur_lun <= max_lun; cur_lun++) { 5183 for (;cur_lun <= max_lun; cur_lun++) {
5184 struct ahd_tmode_lstate* lstate; 5184 struct ahd_tmode_lstate* lstate;
5185 5185
5186 lstate = tstate->enabled_luns[cur_lun]; 5186 lstate = tstate->enabled_luns[cur_lun];
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
index c328596def3c..6066998ed562 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
@@ -106,6 +106,7 @@ static void make_expression(expression_t *immed, int value);
106static void add_conditional(symbol_t *symbol); 106static void add_conditional(symbol_t *symbol);
107static void add_version(const char *verstring); 107static void add_version(const char *verstring);
108static int is_download_const(expression_t *immed); 108static int is_download_const(expression_t *immed);
109void yyerror(const char *string);
109 110
110#define SRAM_SYMNAME "SRAM_BASE" 111#define SRAM_SYMNAME "SRAM_BASE"
111#define SCB_SYMNAME "SCB_BASE" 112#define SCB_SYMNAME "SCB_BASE"
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
index 439f760b34b5..ff46aa6801bf 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
@@ -65,6 +65,7 @@
65static symbol_t *macro_symbol; 65static symbol_t *macro_symbol;
66 66
67static void add_macro_arg(const char *argtext, int position); 67static void add_macro_arg(const char *argtext, int position);
68void mmerror(const char *string);
68 69
69%} 70%}
70 71
diff --git a/drivers/scsi/aic94xx/aic94xx_tmf.c b/drivers/scsi/aic94xx/aic94xx_tmf.c
index 9a14a6d97275..c0d0b7d7a8ce 100644
--- a/drivers/scsi/aic94xx/aic94xx_tmf.c
+++ b/drivers/scsi/aic94xx/aic94xx_tmf.c
@@ -290,6 +290,7 @@ static void asd_tmf_tasklet_complete(struct asd_ascb *ascb,
290static inline int asd_clear_nexus(struct sas_task *task) 290static inline int asd_clear_nexus(struct sas_task *task)
291{ 291{
292 int res = TMF_RESP_FUNC_FAILED; 292 int res = TMF_RESP_FUNC_FAILED;
293 int leftover;
293 struct asd_ascb *tascb = task->lldd_task; 294 struct asd_ascb *tascb = task->lldd_task;
294 unsigned long flags; 295 unsigned long flags;
295 296
@@ -298,10 +299,12 @@ static inline int asd_clear_nexus(struct sas_task *task)
298 res = asd_clear_nexus_tag(task); 299 res = asd_clear_nexus_tag(task);
299 else 300 else
300 res = asd_clear_nexus_index(task); 301 res = asd_clear_nexus_index(task);
301 wait_for_completion_timeout(&tascb->completion, 302 leftover = wait_for_completion_timeout(&tascb->completion,
302 AIC94XX_SCB_TIMEOUT); 303 AIC94XX_SCB_TIMEOUT);
303 ASD_DPRINTK("came back from clear nexus\n"); 304 ASD_DPRINTK("came back from clear nexus\n");
304 spin_lock_irqsave(&task->task_state_lock, flags); 305 spin_lock_irqsave(&task->task_state_lock, flags);
306 if (leftover < 1)
307 res = TMF_RESP_FUNC_FAILED;
305 if (task->task_state_flags & SAS_TASK_STATE_DONE) 308 if (task->task_state_flags & SAS_TASK_STATE_DONE)
306 res = TMF_RESP_FUNC_COMPLETE; 309 res = TMF_RESP_FUNC_COMPLETE;
307 spin_unlock_irqrestore(&task->task_state_lock, flags); 310 spin_unlock_irqrestore(&task->task_state_lock, flags);
@@ -350,6 +353,7 @@ int asd_abort_task(struct sas_task *task)
350 unsigned long flags; 353 unsigned long flags;
351 struct asd_ascb *ascb = NULL; 354 struct asd_ascb *ascb = NULL;
352 struct scb *scb; 355 struct scb *scb;
356 int leftover;
353 357
354 spin_lock_irqsave(&task->task_state_lock, flags); 358 spin_lock_irqsave(&task->task_state_lock, flags);
355 if (task->task_state_flags & SAS_TASK_STATE_DONE) { 359 if (task->task_state_flags & SAS_TASK_STATE_DONE) {
@@ -455,9 +459,11 @@ int asd_abort_task(struct sas_task *task)
455 break; 459 break;
456 case TF_TMF_TASK_DONE + 0xFF00: /* done but not reported yet */ 460 case TF_TMF_TASK_DONE + 0xFF00: /* done but not reported yet */
457 res = TMF_RESP_FUNC_FAILED; 461 res = TMF_RESP_FUNC_FAILED;
458 wait_for_completion_timeout(&tascb->completion, 462 leftover = wait_for_completion_timeout(&tascb->completion,
459 AIC94XX_SCB_TIMEOUT); 463 AIC94XX_SCB_TIMEOUT);
460 spin_lock_irqsave(&task->task_state_lock, flags); 464 spin_lock_irqsave(&task->task_state_lock, flags);
465 if (leftover < 1)
466 res = TMF_RESP_FUNC_FAILED;
461 if (task->task_state_flags & SAS_TASK_STATE_DONE) 467 if (task->task_state_flags & SAS_TASK_STATE_DONE)
462 res = TMF_RESP_FUNC_COMPLETE; 468 res = TMF_RESP_FUNC_COMPLETE;
463 spin_unlock_irqrestore(&task->task_state_lock, flags); 469 spin_unlock_irqrestore(&task->task_state_lock, flags);
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 4baa79e68679..fa6ff295e568 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3954,6 +3954,13 @@ static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
3954 spin_unlock_irq(scsi_cmd->device->host->host_lock); 3954 spin_unlock_irq(scsi_cmd->device->host->host_lock);
3955 ata_do_eh(ap, NULL, NULL, ipr_sata_reset, NULL); 3955 ata_do_eh(ap, NULL, NULL, ipr_sata_reset, NULL);
3956 spin_lock_irq(scsi_cmd->device->host->host_lock); 3956 spin_lock_irq(scsi_cmd->device->host->host_lock);
3957
3958 list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) {
3959 if (ipr_cmd->ioarcb.res_handle == res->cfgte.res_handle) {
3960 rc = -EIO;
3961 break;
3962 }
3963 }
3957 } else 3964 } else
3958 rc = ipr_device_reset(ioa_cfg, res); 3965 rc = ipr_device_reset(ioa_cfg, res);
3959 res->resetting_device = 0; 3966 res->resetting_device = 0;
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index 19dd4b962e18..81e497d9eae0 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -1,307 +1,244 @@
1/* 1/* jazz_esp.c: ESP front-end for MIPS JAZZ systems.
2 * jazz_esp.c: Driver for SCSI chip on Mips Magnum Boards (JAZZ architecture)
3 * 2 *
4 * Copyright (C) 1997 Thomas Bogendoerfer (tsbogend@alpha.franken.de) 3 * Copyright (C) 2007 Thomas Bogendörfer (tsbogend@alpha.frankende)
5 *
6 * jazz_esp is based on David S. Miller's ESP driver and cyber_esp
7 */ 4 */
8 5
9#include <linux/init.h>
10#include <linux/kernel.h> 6#include <linux/kernel.h>
11#include <linux/delay.h>
12#include <linux/types.h> 7#include <linux/types.h>
13#include <linux/string.h> 8#include <linux/module.h>
14#include <linux/slab.h> 9#include <linux/init.h>
15#include <linux/blkdev.h> 10#include <linux/interrupt.h>
16#include <linux/proc_fs.h> 11#include <linux/platform_device.h>
17#include <linux/stat.h> 12#include <linux/dma-mapping.h>
18
19#include "scsi.h"
20#include <scsi/scsi_host.h>
21#include "NCR53C9x.h"
22 13
23#include <asm/irq.h> 14#include <asm/irq.h>
15#include <asm/io.h>
16#include <asm/dma.h>
17
24#include <asm/jazz.h> 18#include <asm/jazz.h>
25#include <asm/jazzdma.h> 19#include <asm/jazzdma.h>
26#include <asm/dma.h>
27 20
28#include <asm/pgtable.h> 21#include <scsi/scsi_host.h>
29
30static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
31static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp);
32static void dma_dump_state(struct NCR_ESP *esp);
33static void dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length);
34static void dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length);
35static void dma_ints_off(struct NCR_ESP *esp);
36static void dma_ints_on(struct NCR_ESP *esp);
37static int dma_irq_p(struct NCR_ESP *esp);
38static int dma_ports_p(struct NCR_ESP *esp);
39static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write);
40static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, struct scsi_cmnd *sp);
41static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, struct scsi_cmnd *sp);
42static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, struct scsi_cmnd *sp);
43static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, struct scsi_cmnd *sp);
44static void dma_advance_sg (struct scsi_cmnd *sp);
45static void dma_led_off(struct NCR_ESP *);
46static void dma_led_on(struct NCR_ESP *);
47
48
49static volatile unsigned char cmd_buffer[16];
50 /* This is where all commands are put
51 * before they are trasfered to the ESP chip
52 * via PIO.
53 */
54
55static int jazz_esp_release(struct Scsi_Host *shost)
56{
57 if (shost->irq)
58 free_irq(shost->irq, NULL);
59 if (shost->dma_channel != 0xff)
60 free_dma(shost->dma_channel);
61 if (shost->io_port && shost->n_io_port)
62 release_region(shost->io_port, shost->n_io_port);
63 scsi_unregister(shost);
64 return 0;
65}
66 22
67/***************************************************************** Detection */ 23#include "esp_scsi.h"
68static int jazz_esp_detect(struct scsi_host_template *tpnt)
69{
70 struct NCR_ESP *esp;
71 struct ConfigDev *esp_dev;
72
73 /*
74 * first assumption it is there:-)
75 */
76 if (1) {
77 esp_dev = NULL;
78 esp = esp_allocate(tpnt, esp_dev, 0);
79
80 /* Do command transfer with programmed I/O */
81 esp->do_pio_cmds = 1;
82
83 /* Required functions */
84 esp->dma_bytes_sent = &dma_bytes_sent;
85 esp->dma_can_transfer = &dma_can_transfer;
86 esp->dma_dump_state = &dma_dump_state;
87 esp->dma_init_read = &dma_init_read;
88 esp->dma_init_write = &dma_init_write;
89 esp->dma_ints_off = &dma_ints_off;
90 esp->dma_ints_on = &dma_ints_on;
91 esp->dma_irq_p = &dma_irq_p;
92 esp->dma_ports_p = &dma_ports_p;
93 esp->dma_setup = &dma_setup;
94
95 /* Optional functions */
96 esp->dma_barrier = NULL;
97 esp->dma_drain = NULL;
98 esp->dma_invalidate = NULL;
99 esp->dma_irq_entry = NULL;
100 esp->dma_irq_exit = NULL;
101 esp->dma_poll = NULL;
102 esp->dma_reset = NULL;
103 esp->dma_led_off = &dma_led_off;
104 esp->dma_led_on = &dma_led_on;
105
106 /* virtual DMA functions */
107 esp->dma_mmu_get_scsi_one = &dma_mmu_get_scsi_one;
108 esp->dma_mmu_get_scsi_sgl = &dma_mmu_get_scsi_sgl;
109 esp->dma_mmu_release_scsi_one = &dma_mmu_release_scsi_one;
110 esp->dma_mmu_release_scsi_sgl = &dma_mmu_release_scsi_sgl;
111 esp->dma_advance_sg = &dma_advance_sg;
112
113
114 /* SCSI chip speed */
115 esp->cfreq = 40000000;
116 24
117 /* 25#define DRV_MODULE_NAME "jazz_esp"
118 * we don't give the address of DMA channel, but the number 26#define PFX DRV_MODULE_NAME ": "
119 * of DMA channel, so we can use the jazz DMA functions 27#define DRV_VERSION "1.000"
120 * 28#define DRV_MODULE_RELDATE "May 19, 2007"
121 */
122 esp->dregs = (void *) JAZZ_SCSI_DMA;
123
124 /* ESP register base */
125 esp->eregs = (struct ESP_regs *)(JAZZ_SCSI_BASE);
126
127 /* Set the command buffer */
128 esp->esp_command = (volatile unsigned char *)cmd_buffer;
129
130 /* get virtual dma address for command buffer */
131 esp->esp_command_dvma = vdma_alloc(CPHYSADDR(cmd_buffer), sizeof (cmd_buffer));
132
133 esp->irq = JAZZ_SCSI_IRQ;
134 request_irq(JAZZ_SCSI_IRQ, esp_intr, IRQF_DISABLED, "JAZZ SCSI",
135 esp->ehost);
136
137 /*
138 * FIXME, look if the scsi id is available from NVRAM
139 */
140 esp->scsi_id = 7;
141
142 /* Check for differential SCSI-bus */
143 /* What is this stuff? */
144 esp->diff = 0;
145
146 esp_initialize(esp);
147
148 printk("ESP: Total of %d ESP hosts found, %d actually in use.\n", nesps,esps_in_use);
149 esps_running = esps_in_use;
150 return esps_in_use;
151 }
152 return 0;
153}
154 29
155/************************************************************* DMA Functions */ 30static void jazz_esp_write8(struct esp *esp, u8 val, unsigned long reg)
156static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count)
157{ 31{
158 return fifo_count; 32 *(volatile u8 *)(esp->regs + reg) = val;
159} 33}
160 34
161static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp) 35static u8 jazz_esp_read8(struct esp *esp, unsigned long reg)
162{ 36{
163 /* 37 return *(volatile u8 *)(esp->regs + reg);
164 * maximum DMA size is 1MB
165 */
166 unsigned long sz = sp->SCp.this_residual;
167 if(sz > 0x100000)
168 sz = 0x100000;
169 return sz;
170} 38}
171 39
172static void dma_dump_state(struct NCR_ESP *esp) 40static dma_addr_t jazz_esp_map_single(struct esp *esp, void *buf,
41 size_t sz, int dir)
173{ 42{
174 43 return dma_map_single(esp->dev, buf, sz, dir);
175 ESPLOG(("esp%d: dma -- enable <%08x> residue <%08x\n",
176 esp->esp_id, vdma_get_enable((int)esp->dregs), vdma_get_residue((int)esp->dregs)));
177} 44}
178 45
179static void dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length) 46static int jazz_esp_map_sg(struct esp *esp, struct scatterlist *sg,
47 int num_sg, int dir)
180{ 48{
181 dma_cache_wback_inv ((unsigned long)phys_to_virt(vdma_log2phys(vaddress)), length); 49 return dma_map_sg(esp->dev, sg, num_sg, dir);
182 vdma_disable ((int)esp->dregs);
183 vdma_set_mode ((int)esp->dregs, DMA_MODE_READ);
184 vdma_set_addr ((int)esp->dregs, vaddress);
185 vdma_set_count ((int)esp->dregs, length);
186 vdma_enable ((int)esp->dregs);
187} 50}
188 51
189static void dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length) 52static void jazz_esp_unmap_single(struct esp *esp, dma_addr_t addr,
53 size_t sz, int dir)
190{ 54{
191 dma_cache_wback_inv ((unsigned long)phys_to_virt(vdma_log2phys(vaddress)), length); 55 dma_unmap_single(esp->dev, addr, sz, dir);
192 vdma_disable ((int)esp->dregs);
193 vdma_set_mode ((int)esp->dregs, DMA_MODE_WRITE);
194 vdma_set_addr ((int)esp->dregs, vaddress);
195 vdma_set_count ((int)esp->dregs, length);
196 vdma_enable ((int)esp->dregs);
197} 56}
198 57
199static void dma_ints_off(struct NCR_ESP *esp) 58static void jazz_esp_unmap_sg(struct esp *esp, struct scatterlist *sg,
59 int num_sg, int dir)
200{ 60{
201 disable_irq(esp->irq); 61 dma_unmap_sg(esp->dev, sg, num_sg, dir);
202} 62}
203 63
204static void dma_ints_on(struct NCR_ESP *esp) 64static int jazz_esp_irq_pending(struct esp *esp)
205{ 65{
206 enable_irq(esp->irq); 66 if (jazz_esp_read8(esp, ESP_STATUS) & ESP_STAT_INTR)
67 return 1;
68 return 0;
207} 69}
208 70
209static int dma_irq_p(struct NCR_ESP *esp) 71static void jazz_esp_reset_dma(struct esp *esp)
210{ 72{
211 return (esp_read(esp->eregs->esp_status) & ESP_STAT_INTR); 73 vdma_disable ((int)esp->dma_regs);
212} 74}
213 75
214static int dma_ports_p(struct NCR_ESP *esp) 76static void jazz_esp_dma_drain(struct esp *esp)
215{ 77{
216 int enable = vdma_get_enable((int)esp->dregs); 78 /* nothing to do */
217
218 return (enable & R4030_CHNL_ENABLE);
219} 79}
220 80
221static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) 81static void jazz_esp_dma_invalidate(struct esp *esp)
222{ 82{
223 /* 83 vdma_disable ((int)esp->dma_regs);
224 * On the Sparc, DMA_ST_WRITE means "move data from device to memory"
225 * so when (write) is true, it actually means READ!
226 */
227 if(write){
228 dma_init_read(esp, addr, count);
229 } else {
230 dma_init_write(esp, addr, count);
231 }
232} 84}
233 85
234static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, struct scsi_cmnd *sp) 86static void jazz_esp_send_dma_cmd(struct esp *esp, u32 addr, u32 esp_count,
87 u32 dma_count, int write, u8 cmd)
235{ 88{
236 sp->SCp.have_data_in = vdma_alloc(CPHYSADDR(sp->SCp.buffer), sp->SCp.this_residual); 89 BUG_ON(!(cmd & ESP_CMD_DMA));
237 sp->SCp.ptr = (char *)((unsigned long)sp->SCp.have_data_in); 90
91 jazz_esp_write8(esp, (esp_count >> 0) & 0xff, ESP_TCLOW);
92 jazz_esp_write8(esp, (esp_count >> 8) & 0xff, ESP_TCMED);
93 vdma_disable ((int)esp->dma_regs);
94 if (write)
95 vdma_set_mode ((int)esp->dma_regs, DMA_MODE_READ);
96 else
97 vdma_set_mode ((int)esp->dma_regs, DMA_MODE_WRITE);
98
99 vdma_set_addr ((int)esp->dma_regs, addr);
100 vdma_set_count ((int)esp->dma_regs, dma_count);
101 vdma_enable ((int)esp->dma_regs);
102
103 scsi_esp_cmd(esp, cmd);
238} 104}
239 105
240static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, struct scsi_cmnd *sp) 106static int jazz_esp_dma_error(struct esp *esp)
241{
242 int sz = sp->SCp.buffers_residual;
243 struct scatterlist *sg = (struct scatterlist *) sp->SCp.buffer;
244
245 while (sz >= 0) {
246 sg[sz].dma_address = vdma_alloc(CPHYSADDR(page_address(sg[sz].page) + sg[sz].offset), sg[sz].length);
247 sz--;
248 }
249 sp->SCp.ptr=(char *)(sp->SCp.buffer->dma_address);
250}
251
252static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, struct scsi_cmnd *sp)
253{ 107{
254 vdma_free(sp->SCp.have_data_in); 108 u32 enable = vdma_get_enable((int)esp->dma_regs);
109
110 if (enable & (R4030_MEM_INTR|R4030_ADDR_INTR))
111 return 1;
112
113 return 0;
255} 114}
256 115
257static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, struct scsi_cmnd *sp) 116static const struct esp_driver_ops jazz_esp_ops = {
117 .esp_write8 = jazz_esp_write8,
118 .esp_read8 = jazz_esp_read8,
119 .map_single = jazz_esp_map_single,
120 .map_sg = jazz_esp_map_sg,
121 .unmap_single = jazz_esp_unmap_single,
122 .unmap_sg = jazz_esp_unmap_sg,
123 .irq_pending = jazz_esp_irq_pending,
124 .reset_dma = jazz_esp_reset_dma,
125 .dma_drain = jazz_esp_dma_drain,
126 .dma_invalidate = jazz_esp_dma_invalidate,
127 .send_dma_cmd = jazz_esp_send_dma_cmd,
128 .dma_error = jazz_esp_dma_error,
129};
130
131static int __devinit esp_jazz_probe(struct platform_device *dev)
258{ 132{
259 int sz = sp->use_sg - 1; 133 struct scsi_host_template *tpnt = &scsi_esp_template;
260 struct scatterlist *sg = (struct scatterlist *)sp->request_buffer; 134 struct Scsi_Host *host;
261 135 struct esp *esp;
262 while(sz >= 0) { 136 struct resource *res;
263 vdma_free(sg[sz].dma_address); 137 int err;
264 sz--; 138
265 } 139 host = scsi_host_alloc(tpnt, sizeof(struct esp));
140
141 err = -ENOMEM;
142 if (!host)
143 goto fail;
144
145 host->max_id = 8;
146 esp = host_to_esp(host);
147
148 esp->host = host;
149 esp->dev = dev;
150 esp->ops = &jazz_esp_ops;
151
152 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
153 if (!res)
154 goto fail_unlink;
155
156 esp->regs = (void __iomem *)res->start;
157 if (!esp->regs)
158 goto fail_unlink;
159
160 res = platform_get_resource(dev, IORESOURCE_MEM, 1);
161 if (!res)
162 goto fail_unlink;
163
164 esp->dma_regs = (void __iomem *)res->start;
165
166 esp->command_block = dma_alloc_coherent(esp->dev, 16,
167 &esp->command_block_dma,
168 GFP_KERNEL);
169 if (!esp->command_block)
170 goto fail_unmap_regs;
171
172 host->irq = platform_get_irq(dev, 0);
173 err = request_irq(host->irq, scsi_esp_intr, IRQF_SHARED, "ESP", esp);
174 if (err < 0)
175 goto fail_unmap_command_block;
176
177 esp->scsi_id = 7;
178 esp->host->this_id = esp->scsi_id;
179 esp->scsi_id_mask = (1 << esp->scsi_id);
180 esp->cfreq = 40000000;
181
182 dev_set_drvdata(&dev->dev, esp);
183
184 err = scsi_esp_register(esp, &dev->dev);
185 if (err)
186 goto fail_free_irq;
187
188 return 0;
189
190fail_free_irq:
191 free_irq(host->irq, esp);
192fail_unmap_command_block:
193 dma_free_coherent(esp->dev, 16,
194 esp->command_block,
195 esp->command_block_dma);
196fail_unmap_regs:
197fail_unlink:
198 scsi_host_put(host);
199fail:
200 return err;
266} 201}
267 202
268static void dma_advance_sg (struct scsi_cmnd *sp) 203static int __devexit esp_jazz_remove(struct platform_device *dev)
269{ 204{
270 sp->SCp.ptr = (char *)(sp->SCp.buffer->dma_address); 205 struct esp *esp = dev_get_drvdata(&dev->dev);
206 unsigned int irq = esp->host->irq;
207
208 scsi_esp_unregister(esp);
209
210 free_irq(irq, esp);
211 dma_free_coherent(esp->dev, 16,
212 esp->command_block,
213 esp->command_block_dma);
214
215 scsi_host_put(esp->host);
216
217 return 0;
271} 218}
272 219
273#define JAZZ_HDC_LED 0xe000d100 /* FIXME, find correct address */ 220static struct platform_driver esp_jazz_driver = {
221 .probe = esp_jazz_probe,
222 .remove = __devexit_p(esp_jazz_remove),
223 .driver = {
224 .name = "jazz_esp",
225 },
226};
274 227
275static void dma_led_off(struct NCR_ESP *esp) 228static int __init jazz_esp_init(void)
276{ 229{
277#if 0 230 return platform_driver_register(&esp_jazz_driver);
278 *(unsigned char *)JAZZ_HDC_LED = 0;
279#endif
280} 231}
281 232
282static void dma_led_on(struct NCR_ESP *esp) 233static void __exit jazz_esp_exit(void)
283{ 234{
284#if 0 235 platform_driver_unregister(&esp_jazz_driver);
285 *(unsigned char *)JAZZ_HDC_LED = 1;
286#endif
287} 236}
288 237
289static struct scsi_host_template driver_template = { 238MODULE_DESCRIPTION("JAZZ ESP SCSI driver");
290 .proc_name = "jazz_esp", 239MODULE_AUTHOR("Thomas Bogendoerfer (tsbogend@alpha.franken.de)");
291 .proc_info = esp_proc_info, 240MODULE_LICENSE("GPL");
292 .name = "ESP 100/100a/200", 241MODULE_VERSION(DRV_VERSION);
293 .detect = jazz_esp_detect, 242
294 .slave_alloc = esp_slave_alloc, 243module_init(jazz_esp_init);
295 .slave_destroy = esp_slave_destroy, 244module_exit(jazz_esp_exit);
296 .release = jazz_esp_release,
297 .info = esp_info,
298 .queuecommand = esp_queue,
299 .eh_abort_handler = esp_abort,
300 .eh_bus_reset_handler = esp_reset,
301 .can_queue = 7,
302 .this_id = 7,
303 .sg_tablesize = SG_ALL,
304 .cmd_per_lun = 1,
305 .use_clustering = DISABLE_CLUSTERING,
306};
307#include "scsi_module.c"
diff --git a/drivers/scsi/libsrp.c b/drivers/scsi/libsrp.c
index 5631c199a8eb..732446e63963 100644
--- a/drivers/scsi/libsrp.c
+++ b/drivers/scsi/libsrp.c
@@ -254,6 +254,7 @@ static int srp_indirect_data(struct scsi_cmnd *sc, struct srp_cmd *cmd,
254 254
255 sg_init_one(&dummy, md, id->table_desc.len); 255 sg_init_one(&dummy, md, id->table_desc.len);
256 sg_dma_address(&dummy) = token; 256 sg_dma_address(&dummy) = token;
257 sg_dma_len(&dummy) = id->table_desc.len;
257 err = rdma_io(sc, &dummy, 1, &id->table_desc, 1, DMA_TO_DEVICE, 258 err = rdma_io(sc, &dummy, 1, &id->table_desc, 1, DMA_TO_DEVICE,
258 id->table_desc.len); 259 id->table_desc.len);
259 if (err) { 260 if (err) {
diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c
index e075a52ac104..84d9c27133d4 100644
--- a/drivers/scsi/megaraid/megaraid_mm.c
+++ b/drivers/scsi/megaraid/megaraid_mm.c
@@ -14,7 +14,7 @@
14 * 14 *
15 * Common management module 15 * Common management module
16 */ 16 */
17 17#include <linux/sched.h>
18#include "megaraid_mm.h" 18#include "megaraid_mm.h"
19 19
20 20
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 7a812677ff8a..e2cf12ef3688 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -10,7 +10,7 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 * 11 *
12 * FILE : megaraid_sas.c 12 * FILE : megaraid_sas.c
13 * Version : v00.00.03.10-rc1 13 * Version : v00.00.03.10-rc5
14 * 14 *
15 * Authors: 15 * Authors:
16 * (email-id : megaraidlinux@lsi.com) 16 * (email-id : megaraidlinux@lsi.com)
@@ -886,6 +886,7 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *))
886 goto out_return_cmd; 886 goto out_return_cmd;
887 887
888 cmd->scmd = scmd; 888 cmd->scmd = scmd;
889 scmd->SCp.ptr = (char *)cmd;
889 890
890 /* 891 /*
891 * Issue the command to the FW 892 * Issue the command to the FW
@@ -919,7 +920,7 @@ static int megasas_slave_configure(struct scsi_device *sdev)
919 * The RAID firmware may require extended timeouts. 920 * The RAID firmware may require extended timeouts.
920 */ 921 */
921 if (sdev->channel >= MEGASAS_MAX_PD_CHANNELS) 922 if (sdev->channel >= MEGASAS_MAX_PD_CHANNELS)
922 sdev->timeout = 90 * HZ; 923 sdev->timeout = MEGASAS_DEFAULT_CMD_TIMEOUT * HZ;
923 return 0; 924 return 0;
924} 925}
925 926
@@ -981,8 +982,8 @@ static int megasas_generic_reset(struct scsi_cmnd *scmd)
981 982
982 instance = (struct megasas_instance *)scmd->device->host->hostdata; 983 instance = (struct megasas_instance *)scmd->device->host->hostdata;
983 984
984 scmd_printk(KERN_NOTICE, scmd, "megasas: RESET -%ld cmd=%x\n", 985 scmd_printk(KERN_NOTICE, scmd, "megasas: RESET -%ld cmd=%x retries=%x\n",
985 scmd->serial_number, scmd->cmnd[0]); 986 scmd->serial_number, scmd->cmnd[0], scmd->retries);
986 987
987 if (instance->hw_crit_error) { 988 if (instance->hw_crit_error) {
988 printk(KERN_ERR "megasas: cannot recover from previous reset " 989 printk(KERN_ERR "megasas: cannot recover from previous reset "
@@ -1000,6 +1001,39 @@ static int megasas_generic_reset(struct scsi_cmnd *scmd)
1000} 1001}
1001 1002
1002/** 1003/**
1004 * megasas_reset_timer - quiesce the adapter if required
1005 * @scmd: scsi cmnd
1006 *
1007 * Sets the FW busy flag and reduces the host->can_queue if the
1008 * cmd has not been completed within the timeout period.
1009 */
1010static enum
1011scsi_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd)
1012{
1013 struct megasas_cmd *cmd = (struct megasas_cmd *)scmd->SCp.ptr;
1014 struct megasas_instance *instance;
1015 unsigned long flags;
1016
1017 if (time_after(jiffies, scmd->jiffies_at_alloc +
1018 (MEGASAS_DEFAULT_CMD_TIMEOUT * 2) * HZ)) {
1019 return EH_NOT_HANDLED;
1020 }
1021
1022 instance = cmd->instance;
1023 if (!(instance->flag & MEGASAS_FW_BUSY)) {
1024 /* FW is busy, throttle IO */
1025 spin_lock_irqsave(instance->host->host_lock, flags);
1026
1027 instance->host->can_queue = 16;
1028 instance->last_time = jiffies;
1029 instance->flag |= MEGASAS_FW_BUSY;
1030
1031 spin_unlock_irqrestore(instance->host->host_lock, flags);
1032 }
1033 return EH_RESET_TIMER;
1034}
1035
1036/**
1003 * megasas_reset_device - Device reset handler entry point 1037 * megasas_reset_device - Device reset handler entry point
1004 */ 1038 */
1005static int megasas_reset_device(struct scsi_cmnd *scmd) 1039static int megasas_reset_device(struct scsi_cmnd *scmd)
@@ -1112,6 +1146,7 @@ static struct scsi_host_template megasas_template = {
1112 .eh_device_reset_handler = megasas_reset_device, 1146 .eh_device_reset_handler = megasas_reset_device,
1113 .eh_bus_reset_handler = megasas_reset_bus_host, 1147 .eh_bus_reset_handler = megasas_reset_bus_host,
1114 .eh_host_reset_handler = megasas_reset_bus_host, 1148 .eh_host_reset_handler = megasas_reset_bus_host,
1149 .eh_timed_out = megasas_reset_timer,
1115 .bios_param = megasas_bios_param, 1150 .bios_param = megasas_bios_param,
1116 .use_clustering = ENABLE_CLUSTERING, 1151 .use_clustering = ENABLE_CLUSTERING,
1117}; 1152};
@@ -1215,9 +1250,8 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
1215 int exception = 0; 1250 int exception = 0;
1216 struct megasas_header *hdr = &cmd->frame->hdr; 1251 struct megasas_header *hdr = &cmd->frame->hdr;
1217 1252
1218 if (cmd->scmd) { 1253 if (cmd->scmd)
1219 cmd->scmd->SCp.ptr = (char *)0; 1254 cmd->scmd->SCp.ptr = NULL;
1220 }
1221 1255
1222 switch (hdr->cmd) { 1256 switch (hdr->cmd) {
1223 1257
@@ -1806,6 +1840,7 @@ static void megasas_complete_cmd_dpc(unsigned long instance_addr)
1806 u32 context; 1840 u32 context;
1807 struct megasas_cmd *cmd; 1841 struct megasas_cmd *cmd;
1808 struct megasas_instance *instance = (struct megasas_instance *)instance_addr; 1842 struct megasas_instance *instance = (struct megasas_instance *)instance_addr;
1843 unsigned long flags;
1809 1844
1810 /* If we have already declared adapter dead, donot complete cmds */ 1845 /* If we have already declared adapter dead, donot complete cmds */
1811 if (instance->hw_crit_error) 1846 if (instance->hw_crit_error)
@@ -1828,6 +1863,22 @@ static void megasas_complete_cmd_dpc(unsigned long instance_addr)
1828 } 1863 }
1829 1864
1830 *instance->consumer = producer; 1865 *instance->consumer = producer;
1866
1867 /*
1868 * Check if we can restore can_queue
1869 */
1870 if (instance->flag & MEGASAS_FW_BUSY
1871 && time_after(jiffies, instance->last_time + 5 * HZ)
1872 && atomic_read(&instance->fw_outstanding) < 17) {
1873
1874 spin_lock_irqsave(instance->host->host_lock, flags);
1875 instance->flag &= ~MEGASAS_FW_BUSY;
1876 instance->host->can_queue =
1877 instance->max_fw_cmds - MEGASAS_INT_CMDS;
1878
1879 spin_unlock_irqrestore(instance->host->host_lock, flags);
1880 }
1881
1831} 1882}
1832 1883
1833/** 1884/**
@@ -2398,6 +2449,8 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
2398 instance->init_id = MEGASAS_DEFAULT_INIT_ID; 2449 instance->init_id = MEGASAS_DEFAULT_INIT_ID;
2399 2450
2400 megasas_dbg_lvl = 0; 2451 megasas_dbg_lvl = 0;
2452 instance->flag = 0;
2453 instance->last_time = 0;
2401 2454
2402 /* 2455 /*
2403 * Initialize MFI Firmware 2456 * Initialize MFI Firmware
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index e862992ee377..4dffc918a414 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -18,9 +18,9 @@
18/* 18/*
19 * MegaRAID SAS Driver meta data 19 * MegaRAID SAS Driver meta data
20 */ 20 */
21#define MEGASAS_VERSION "00.00.03.10-rc1" 21#define MEGASAS_VERSION "00.00.03.10-rc5"
22#define MEGASAS_RELDATE "Feb 14, 2007" 22#define MEGASAS_RELDATE "May 17, 2007"
23#define MEGASAS_EXT_VERSION "Wed Feb 14 10:14:25 PST 2007" 23#define MEGASAS_EXT_VERSION "Thu May 17 10:09:32 PDT 2007"
24 24
25/* 25/*
26 * Device IDs 26 * Device IDs
@@ -539,6 +539,8 @@ struct megasas_ctrl_info {
539 539
540#define MEGASAS_DBG_LVL 1 540#define MEGASAS_DBG_LVL 1
541 541
542#define MEGASAS_FW_BUSY 1
543
542/* 544/*
543 * When SCSI mid-layer calls driver's reset routine, driver waits for 545 * When SCSI mid-layer calls driver's reset routine, driver waits for
544 * MEGASAS_RESET_WAIT_TIME seconds for all outstanding IO to complete. Note 546 * MEGASAS_RESET_WAIT_TIME seconds for all outstanding IO to complete. Note
@@ -549,8 +551,8 @@ struct megasas_ctrl_info {
549#define MEGASAS_RESET_WAIT_TIME 180 551#define MEGASAS_RESET_WAIT_TIME 180
550#define MEGASAS_INTERNAL_CMD_WAIT_TIME 180 552#define MEGASAS_INTERNAL_CMD_WAIT_TIME 180
551#define MEGASAS_RESET_NOTICE_INTERVAL 5 553#define MEGASAS_RESET_NOTICE_INTERVAL 5
552
553#define MEGASAS_IOCTL_CMD 0 554#define MEGASAS_IOCTL_CMD 0
555#define MEGASAS_DEFAULT_CMD_TIMEOUT 90
554 556
555/* 557/*
556 * FW reports the maximum of number of commands that it can accept (maximum 558 * FW reports the maximum of number of commands that it can accept (maximum
@@ -1073,7 +1075,6 @@ struct megasas_instance {
1073 struct megasas_register_set __iomem *reg_set; 1075 struct megasas_register_set __iomem *reg_set;
1074 1076
1075 s8 init_id; 1077 s8 init_id;
1076 u8 reserved[3];
1077 1078
1078 u16 max_num_sge; 1079 u16 max_num_sge;
1079 u16 max_fw_cmds; 1080 u16 max_fw_cmds;
@@ -1104,6 +1105,9 @@ struct megasas_instance {
1104 1105
1105 struct megasas_instance_template *instancet; 1106 struct megasas_instance_template *instancet;
1106 struct tasklet_struct isr_tasklet; 1107 struct tasklet_struct isr_tasklet;
1108
1109 u8 flag;
1110 unsigned long last_time;
1107}; 1111};
1108 1112
1109#define MEGASAS_IS_LOGICAL(scp) \ 1113#define MEGASAS_IS_LOGICAL(scp) \
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
index 3b2e1a53e6e2..d953d43fe2e6 100644
--- a/drivers/scsi/pluto.c
+++ b/drivers/scsi/pluto.c
@@ -4,6 +4,7 @@
4 * 4 *
5 */ 5 */
6 6
7#include <linux/completion.h>
7#include <linux/kernel.h> 8#include <linux/kernel.h>
8#include <linux/delay.h> 9#include <linux/delay.h>
9#include <linux/types.h> 10#include <linux/types.h>
@@ -50,16 +51,10 @@ static struct ctrl_inquiry {
50} *fcs __initdata; 51} *fcs __initdata;
51static int fcscount __initdata = 0; 52static int fcscount __initdata = 0;
52static atomic_t fcss __initdata = ATOMIC_INIT(0); 53static atomic_t fcss __initdata = ATOMIC_INIT(0);
53DECLARE_MUTEX_LOCKED(fc_sem); 54static DECLARE_COMPLETION(fc_detect_complete);
54 55
55static int pluto_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd); 56static int pluto_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd);
56 57
57static void __init pluto_detect_timeout(unsigned long data)
58{
59 PLND(("Timeout\n"))
60 up(&fc_sem);
61}
62
63static void __init pluto_detect_done(Scsi_Cmnd *SCpnt) 58static void __init pluto_detect_done(Scsi_Cmnd *SCpnt)
64{ 59{
65 /* Do nothing */ 60 /* Do nothing */
@@ -69,7 +64,7 @@ static void __init pluto_detect_scsi_done(Scsi_Cmnd *SCpnt)
69{ 64{
70 PLND(("Detect done %08lx\n", (long)SCpnt)) 65 PLND(("Detect done %08lx\n", (long)SCpnt))
71 if (atomic_dec_and_test (&fcss)) 66 if (atomic_dec_and_test (&fcss))
72 up(&fc_sem); 67 complete(&fc_detect_complete);
73} 68}
74 69
75int pluto_slave_configure(struct scsi_device *device) 70int pluto_slave_configure(struct scsi_device *device)
@@ -96,7 +91,6 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
96 int i, retry, nplutos; 91 int i, retry, nplutos;
97 fc_channel *fc; 92 fc_channel *fc;
98 struct scsi_device dev; 93 struct scsi_device dev;
99 DEFINE_TIMER(fc_timer, pluto_detect_timeout, 0, 0);
100 94
101 tpnt->proc_name = "pluto"; 95 tpnt->proc_name = "pluto";
102 fcscount = 0; 96 fcscount = 0;
@@ -187,15 +181,11 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
187 } 181 }
188 } 182 }
189 183
190 fc_timer.expires = jiffies + 10 * HZ; 184 wait_for_completion_timeout(&fc_detect_complete, 10 * HZ);
191 add_timer(&fc_timer);
192
193 down(&fc_sem);
194 PLND(("Woken up\n")) 185 PLND(("Woken up\n"))
195 if (!atomic_read(&fcss)) 186 if (!atomic_read(&fcss))
196 break; /* All fc channels have answered us */ 187 break; /* All fc channels have answered us */
197 } 188 }
198 del_timer_sync(&fc_timer);
199 189
200 PLND(("Finished search\n")) 190 PLND(("Finished search\n"))
201 for (i = 0, nplutos = 0; i < fcscount; i++) { 191 for (i = 0, nplutos = 0; i < fcscount; i++) {
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index ce63044b1ec8..18dd5cc4d7c6 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -209,6 +209,7 @@ static struct {
209 {"PIONEER", "CD-ROM DRM-602X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, 209 {"PIONEER", "CD-ROM DRM-602X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
210 {"PIONEER", "CD-ROM DRM-604X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, 210 {"PIONEER", "CD-ROM DRM-604X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
211 {"PIONEER", "CD-ROM DRM-624X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, 211 {"PIONEER", "CD-ROM DRM-624X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
212 {"Promise", "", NULL, BLIST_SPARSELUN},
212 {"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN}, 213 {"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN},
213 {"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN}, 214 {"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN},
214 {"SEAGATE", "ST34555N", "0930", BLIST_NOTQ}, /* Chokes on tagged INQUIRY */ 215 {"SEAGATE", "ST34555N", "0930", BLIST_NOTQ}, /* Chokes on tagged INQUIRY */
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 00e46662296f..3d8c9cb24f91 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1789,7 +1789,7 @@ static void sd_shutdown(struct device *dev)
1789static int sd_suspend(struct device *dev, pm_message_t mesg) 1789static int sd_suspend(struct device *dev, pm_message_t mesg)
1790{ 1790{
1791 struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); 1791 struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev);
1792 int ret; 1792 int ret = 0;
1793 1793
1794 if (!sdkp) 1794 if (!sdkp)
1795 return 0; /* this can happen */ 1795 return 0; /* this can happen */
@@ -1798,30 +1798,34 @@ static int sd_suspend(struct device *dev, pm_message_t mesg)
1798 sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n"); 1798 sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n");
1799 ret = sd_sync_cache(sdkp); 1799 ret = sd_sync_cache(sdkp);
1800 if (ret) 1800 if (ret)
1801 return ret; 1801 goto done;
1802 } 1802 }
1803 1803
1804 if (mesg.event == PM_EVENT_SUSPEND && 1804 if (mesg.event == PM_EVENT_SUSPEND &&
1805 sdkp->device->manage_start_stop) { 1805 sdkp->device->manage_start_stop) {
1806 sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); 1806 sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n");
1807 ret = sd_start_stop_device(sdkp, 0); 1807 ret = sd_start_stop_device(sdkp, 0);
1808 if (ret)
1809 return ret;
1810 } 1808 }
1811 1809
1812 return 0; 1810done:
1811 scsi_disk_put(sdkp);
1812 return ret;
1813} 1813}
1814 1814
1815static int sd_resume(struct device *dev) 1815static int sd_resume(struct device *dev)
1816{ 1816{
1817 struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); 1817 struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev);
1818 int ret = 0;
1818 1819
1819 if (!sdkp->device->manage_start_stop) 1820 if (!sdkp->device->manage_start_stop)
1820 return 0; 1821 goto done;
1821 1822
1822 sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); 1823 sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
1824 ret = sd_start_stop_device(sdkp, 1);
1823 1825
1824 return sd_start_stop_device(sdkp, 1); 1826done:
1827 scsi_disk_put(sdkp);
1828 return ret;
1825} 1829}
1826 1830
1827/** 1831/**
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 69be1324b114..9ac83abc4028 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -32,11 +32,12 @@
32#include <scsi/scsi_cmnd.h> 32#include <scsi/scsi_cmnd.h>
33#include <scsi/scsi_host.h> 33#include <scsi/scsi_host.h>
34#include <scsi/scsi_tcq.h> 34#include <scsi/scsi_tcq.h>
35#include <scsi/scsi_dbg.h>
35 36
36#define DRV_NAME "stex" 37#define DRV_NAME "stex"
37#define ST_DRIVER_VERSION "3.1.0.1" 38#define ST_DRIVER_VERSION "3.6.0000.1"
38#define ST_VER_MAJOR 3 39#define ST_VER_MAJOR 3
39#define ST_VER_MINOR 1 40#define ST_VER_MINOR 6
40#define ST_OEM 0 41#define ST_OEM 0
41#define ST_BUILD_VER 1 42#define ST_BUILD_VER 1
42 43
@@ -113,10 +114,6 @@ enum {
113 SG_CF_64B = 0x40, /* 64 bit item */ 114 SG_CF_64B = 0x40, /* 64 bit item */
114 SG_CF_HOST = 0x20, /* sg in host memory */ 115 SG_CF_HOST = 0x20, /* sg in host memory */
115 116
116 ST_MAX_ARRAY_SUPPORTED = 16,
117 ST_MAX_TARGET_NUM = (ST_MAX_ARRAY_SUPPORTED+1),
118 ST_MAX_LUN_PER_TARGET = 16,
119
120 st_shasta = 0, 117 st_shasta = 0,
121 st_vsc = 1, 118 st_vsc = 1,
122 st_vsc1 = 2, 119 st_vsc1 = 2,
@@ -586,7 +583,7 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
586 u16 tag; 583 u16 tag;
587 host = cmd->device->host; 584 host = cmd->device->host;
588 id = cmd->device->id; 585 id = cmd->device->id;
589 lun = cmd->device->channel; /* firmware lun issue work around */ 586 lun = cmd->device->lun;
590 hba = (struct st_hba *) &host->hostdata[0]; 587 hba = (struct st_hba *) &host->hostdata[0];
591 588
592 switch (cmd->cmnd[0]) { 589 switch (cmd->cmnd[0]) {
@@ -605,8 +602,26 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
605 stex_invalid_field(cmd, done); 602 stex_invalid_field(cmd, done);
606 return 0; 603 return 0;
607 } 604 }
605 case REPORT_LUNS:
606 /*
607 * The shasta firmware does not report actual luns in the
608 * target, so fail the command to force sequential lun scan.
609 * Also, the console device does not support this command.
610 */
611 if (hba->cardtype == st_shasta || id == host->max_id - 1) {
612 stex_invalid_field(cmd, done);
613 return 0;
614 }
615 break;
616 case TEST_UNIT_READY:
617 if (id == host->max_id - 1) {
618 cmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
619 done(cmd);
620 return 0;
621 }
622 break;
608 case INQUIRY: 623 case INQUIRY:
609 if (id != ST_MAX_ARRAY_SUPPORTED) 624 if (id != host->max_id - 1)
610 break; 625 break;
611 if (lun == 0 && (cmd->cmnd[1] & INQUIRY_EVPD) == 0) { 626 if (lun == 0 && (cmd->cmnd[1] & INQUIRY_EVPD) == 0) {
612 stex_direct_copy(cmd, console_inq_page, 627 stex_direct_copy(cmd, console_inq_page,
@@ -624,7 +639,7 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
624 ver.oem = ST_OEM; 639 ver.oem = ST_OEM;
625 ver.build = ST_BUILD_VER; 640 ver.build = ST_BUILD_VER;
626 ver.signature[0] = PASSTHRU_SIGNATURE; 641 ver.signature[0] = PASSTHRU_SIGNATURE;
627 ver.console_id = ST_MAX_ARRAY_SUPPORTED; 642 ver.console_id = host->max_id - 1;
628 ver.host_no = hba->host->host_no; 643 ver.host_no = hba->host->host_no;
629 cmd->result = stex_direct_copy(cmd, &ver, sizeof(ver)) ? 644 cmd->result = stex_direct_copy(cmd, &ver, sizeof(ver)) ?
630 DID_OK << 16 | COMMAND_COMPLETE << 8 : 645 DID_OK << 16 | COMMAND_COMPLETE << 8 :
@@ -645,13 +660,8 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
645 660
646 req = stex_alloc_req(hba); 661 req = stex_alloc_req(hba);
647 662
648 if (hba->cardtype == st_yosemite) { 663 req->lun = lun;
649 req->lun = lun * (ST_MAX_TARGET_NUM - 1) + id; 664 req->target = id;
650 req->target = 0;
651 } else {
652 req->lun = lun;
653 req->target = id;
654 }
655 665
656 /* cdb */ 666 /* cdb */
657 memcpy(req->cdb, cmd->cmnd, STEX_CDB_LENGTH); 667 memcpy(req->cdb, cmd->cmnd, STEX_CDB_LENGTH);
@@ -767,18 +777,6 @@ static void stex_ys_commands(struct st_hba *hba,
767 ccb->srb_status = SRB_STATUS_SELECTION_TIMEOUT; 777 ccb->srb_status = SRB_STATUS_SELECTION_TIMEOUT;
768 else 778 else
769 ccb->srb_status = SRB_STATUS_SUCCESS; 779 ccb->srb_status = SRB_STATUS_SUCCESS;
770 } else if (ccb->cmd->cmnd[0] == REPORT_LUNS) {
771 u8 *report_lun_data = (u8 *)hba->copy_buffer;
772
773 count = STEX_EXTRA_SIZE;
774 stex_internal_copy(ccb->cmd, report_lun_data,
775 &count, ccb->sg_count, ST_FROM_CMD);
776 if (report_lun_data[2] || report_lun_data[3]) {
777 report_lun_data[2] = 0x00;
778 report_lun_data[3] = 0x08;
779 stex_internal_copy(ccb->cmd, report_lun_data,
780 &count, ccb->sg_count, ST_TO_CMD);
781 }
782 } 780 }
783} 781}
784 782
@@ -995,6 +993,11 @@ static int stex_abort(struct scsi_cmnd *cmd)
995 u32 data; 993 u32 data;
996 int result = SUCCESS; 994 int result = SUCCESS;
997 unsigned long flags; 995 unsigned long flags;
996
997 printk(KERN_INFO DRV_NAME
998 "(%s): aborting command\n", pci_name(hba->pdev));
999 scsi_print_command(cmd);
1000
998 base = hba->mmio_base; 1001 base = hba->mmio_base;
999 spin_lock_irqsave(host->host_lock, flags); 1002 spin_lock_irqsave(host->host_lock, flags);
1000 if (tag < host->can_queue && hba->ccb[tag].cmd == cmd) 1003 if (tag < host->can_queue && hba->ccb[tag].cmd == cmd)
@@ -1051,7 +1054,12 @@ static void stex_hard_reset(struct st_hba *hba)
1051 pci_read_config_byte(bus->self, PCI_BRIDGE_CONTROL, &pci_bctl); 1054 pci_read_config_byte(bus->self, PCI_BRIDGE_CONTROL, &pci_bctl);
1052 pci_bctl |= PCI_BRIDGE_CTL_BUS_RESET; 1055 pci_bctl |= PCI_BRIDGE_CTL_BUS_RESET;
1053 pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl); 1056 pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl);
1054 msleep(1); 1057
1058 /*
1059 * 1 ms may be enough for 8-port controllers. But 16-port controllers
1060 * require more time to finish bus reset. Use 100 ms here for safety
1061 */
1062 msleep(100);
1055 pci_bctl &= ~PCI_BRIDGE_CTL_BUS_RESET; 1063 pci_bctl &= ~PCI_BRIDGE_CTL_BUS_RESET;
1056 pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl); 1064 pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl);
1057 1065
@@ -1075,6 +1083,10 @@ static int stex_reset(struct scsi_cmnd *cmd)
1075 unsigned long before; 1083 unsigned long before;
1076 hba = (struct st_hba *) &cmd->device->host->hostdata[0]; 1084 hba = (struct st_hba *) &cmd->device->host->hostdata[0];
1077 1085
1086 printk(KERN_INFO DRV_NAME
1087 "(%s): resetting host\n", pci_name(hba->pdev));
1088 scsi_print_command(cmd);
1089
1078 hba->mu_status = MU_STATE_RESETTING; 1090 hba->mu_status = MU_STATE_RESETTING;
1079 1091
1080 if (hba->cardtype == st_shasta) 1092 if (hba->cardtype == st_shasta)
@@ -1194,7 +1206,7 @@ stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1194 goto out_scsi_host_put; 1206 goto out_scsi_host_put;
1195 } 1207 }
1196 1208
1197 hba->mmio_base = ioremap(pci_resource_start(pdev, 0), 1209 hba->mmio_base = ioremap_nocache(pci_resource_start(pdev, 0),
1198 pci_resource_len(pdev, 0)); 1210 pci_resource_len(pdev, 0));
1199 if ( !hba->mmio_base) { 1211 if ( !hba->mmio_base) {
1200 printk(KERN_ERR DRV_NAME "(%s): memory map failed\n", 1212 printk(KERN_ERR DRV_NAME "(%s): memory map failed\n",
@@ -1229,12 +1241,18 @@ stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1229 hba->copy_buffer = hba->dma_mem + MU_BUFFER_SIZE; 1241 hba->copy_buffer = hba->dma_mem + MU_BUFFER_SIZE;
1230 hba->mu_status = MU_STATE_STARTING; 1242 hba->mu_status = MU_STATE_STARTING;
1231 1243
1232 /* firmware uses id/lun pair for a logical drive, but lun would be 1244 if (hba->cardtype == st_shasta) {
1233 always 0 if CONFIG_SCSI_MULTI_LUN not configured, so we use 1245 host->max_lun = 8;
1234 channel to map lun here */ 1246 host->max_id = 16 + 1;
1235 host->max_channel = ST_MAX_LUN_PER_TARGET - 1; 1247 } else if (hba->cardtype == st_yosemite) {
1236 host->max_id = ST_MAX_TARGET_NUM; 1248 host->max_lun = 128;
1237 host->max_lun = 1; 1249 host->max_id = 1 + 1;
1250 } else {
1251 /* st_vsc and st_vsc1 */
1252 host->max_lun = 1;
1253 host->max_id = 128 + 1;
1254 }
1255 host->max_channel = 0;
1238 host->unique_id = host->host_no; 1256 host->unique_id = host->host_no;
1239 host->max_cmd_len = STEX_CDB_LENGTH; 1257 host->max_cmd_len = STEX_CDB_LENGTH;
1240 1258
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index 1a9a24b82636..00d1255e4c12 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -167,8 +167,9 @@ static void pl010_rx_chars(struct uart_amba_port *uap)
167 ignore_char: 167 ignore_char:
168 status = readb(uap->port.membase + UART01x_FR); 168 status = readb(uap->port.membase + UART01x_FR);
169 } 169 }
170 spin_unlock(&port->lock);
170 tty_flip_buffer_push(tty); 171 tty_flip_buffer_push(tty);
171 return; 172 spin_lock(&port->lock);
172} 173}
173 174
174static void pl010_tx_chars(struct uart_amba_port *uap) 175static void pl010_tx_chars(struct uart_amba_port *uap)
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 44639e71372a..954073c6ce3a 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -153,8 +153,9 @@ static void pl011_rx_chars(struct uart_amba_port *uap)
153 ignore_char: 153 ignore_char:
154 status = readw(uap->port.membase + UART01x_FR); 154 status = readw(uap->port.membase + UART01x_FR);
155 } 155 }
156 spin_unlock(&uap->port.lock);
156 tty_flip_buffer_push(tty); 157 tty_flip_buffer_push(tty);
157 return; 158 spin_lock(&uap->port.lock);
158} 159}
159 160
160static void pl011_tx_chars(struct uart_amba_port *uap) 161static void pl011_tx_chars(struct uart_amba_port *uap)
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 408390f93db9..787dc7168f3e 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -6,8 +6,6 @@
6 * Created: 6 * Created:
7 * Description: Driver for blackfin 5xx serial ports 7 * Description: Driver for blackfin 5xx serial ports
8 * 8 *
9 * Rev: $Id: bfin_5xx.c,v 1.19 2006/09/24 02:33:53 aubrey Exp $
10 *
11 * Modified: 9 * Modified:
12 * Copyright 2006 Analog Devices Inc. 10 * Copyright 2006 Analog Devices Inc.
13 * 11 *
@@ -152,7 +150,7 @@ static void local_put_char(struct bfin_serial_port *uart, char ch)
152 150
153static void bfin_serial_rx_chars(struct bfin_serial_port *uart) 151static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
154{ 152{
155 struct tty_struct *tty = uart->port.info?uart->port.info->tty:0; 153 struct tty_struct *tty = uart->port.info->tty;
156 unsigned int status, ch, flg; 154 unsigned int status, ch, flg;
157#ifdef BF533_FAMILY 155#ifdef BF533_FAMILY
158 static int in_break = 0; 156 static int in_break = 0;
@@ -173,8 +171,10 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
173 if (ch != 0) { 171 if (ch != 0) {
174 in_break = 0; 172 in_break = 0;
175 ch = UART_GET_CHAR(uart); 173 ch = UART_GET_CHAR(uart);
176 } 174 if (bfin_revid() < 5)
177 return; 175 return;
176 } else
177 return;
178 } 178 }
179#endif 179#endif
180 180
@@ -185,27 +185,32 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
185 uart->port.icount.brk++; 185 uart->port.icount.brk++;
186 if (uart_handle_break(&uart->port)) 186 if (uart_handle_break(&uart->port))
187 goto ignore_char; 187 goto ignore_char;
188 flg = TTY_BREAK; 188 }
189 } else if (status & PE) { 189 if (status & PE)
190 flg = TTY_PARITY;
191 uart->port.icount.parity++; 190 uart->port.icount.parity++;
192 } else if (status & OE) { 191 if (status & OE)
193 flg = TTY_OVERRUN;
194 uart->port.icount.overrun++; 192 uart->port.icount.overrun++;
195 } else if (status & FE) { 193 if (status & FE)
196 flg = TTY_FRAME;
197 uart->port.icount.frame++; 194 uart->port.icount.frame++;
198 } else 195
196 status &= uart->port.read_status_mask;
197
198 if (status & BI)
199 flg = TTY_BREAK;
200 else if (status & PE)
201 flg = TTY_PARITY;
202 else if (status & FE)
203 flg = TTY_FRAME;
204 else
199 flg = TTY_NORMAL; 205 flg = TTY_NORMAL;
200 206
201 if (uart_handle_sysrq_char(&uart->port, ch)) 207 if (uart_handle_sysrq_char(&uart->port, ch))
202 goto ignore_char; 208 goto ignore_char;
203 if (tty)
204 uart_insert_char(&uart->port, status, 2, ch, flg);
205 209
206ignore_char: 210 uart_insert_char(&uart->port, status, OE, ch, flg);
207 if (tty) 211
208 tty_flip_buffer_push(tty); 212 ignore_char:
213 tty_flip_buffer_push(tty);
209} 214}
210 215
211static void bfin_serial_tx_chars(struct bfin_serial_port *uart) 216static void bfin_serial_tx_chars(struct bfin_serial_port *uart)
@@ -240,24 +245,29 @@ static void bfin_serial_tx_chars(struct bfin_serial_port *uart)
240 bfin_serial_stop_tx(&uart->port); 245 bfin_serial_stop_tx(&uart->port);
241} 246}
242 247
243static irqreturn_t bfin_serial_int(int irq, void *dev_id) 248static irqreturn_t bfin_serial_rx_int(int irq, void *dev_id)
244{ 249{
245 struct bfin_serial_port *uart = dev_id; 250 struct bfin_serial_port *uart = dev_id;
246 unsigned short status;
247 251
248 spin_lock(&uart->port.lock); 252 spin_lock(&uart->port.lock);
249 status = UART_GET_IIR(uart); 253 while ((UART_GET_IIR(uart) & IIR_STATUS) == IIR_RX_READY)
250 do { 254 bfin_serial_rx_chars(uart);
251 if ((status & IIR_STATUS) == IIR_TX_READY)
252 bfin_serial_tx_chars(uart);
253 if ((status & IIR_STATUS) == IIR_RX_READY)
254 bfin_serial_rx_chars(uart);
255 status = UART_GET_IIR(uart);
256 } while (status & (IIR_TX_READY | IIR_RX_READY));
257 spin_unlock(&uart->port.lock); 255 spin_unlock(&uart->port.lock);
258 return IRQ_HANDLED; 256 return IRQ_HANDLED;
259} 257}
260 258
259static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id)
260{
261 struct bfin_serial_port *uart = dev_id;
262
263 spin_lock(&uart->port.lock);
264 while ((UART_GET_IIR(uart) & IIR_STATUS) == IIR_TX_READY)
265 bfin_serial_tx_chars(uart);
266 spin_unlock(&uart->port.lock);
267 return IRQ_HANDLED;
268}
269
270
261static void bfin_serial_do_work(struct work_struct *work) 271static void bfin_serial_do_work(struct work_struct *work)
262{ 272{
263 struct bfin_serial_port *uart = container_of(work, struct bfin_serial_port, cts_workqueue); 273 struct bfin_serial_port *uart = container_of(work, struct bfin_serial_port, cts_workqueue);
@@ -319,7 +329,7 @@ static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart)
319 spin_unlock_irqrestore(&uart->port.lock, flags); 329 spin_unlock_irqrestore(&uart->port.lock, flags);
320} 330}
321 331
322static void bfin_serial_dma_rx_chars(struct bfin_serial_port * uart) 332static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart)
323{ 333{
324 struct tty_struct *tty = uart->port.info->tty; 334 struct tty_struct *tty = uart->port.info->tty;
325 int i, flg, status; 335 int i, flg, status;
@@ -331,25 +341,32 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port * uart)
331 uart->port.icount.brk++; 341 uart->port.icount.brk++;
332 if (uart_handle_break(&uart->port)) 342 if (uart_handle_break(&uart->port))
333 goto dma_ignore_char; 343 goto dma_ignore_char;
334 flg = TTY_BREAK; 344 }
335 } else if (status & PE) { 345 if (status & PE)
336 flg = TTY_PARITY;
337 uart->port.icount.parity++; 346 uart->port.icount.parity++;
338 } else if (status & OE) { 347 if (status & OE)
339 flg = TTY_OVERRUN;
340 uart->port.icount.overrun++; 348 uart->port.icount.overrun++;
341 } else if (status & FE) { 349 if (status & FE)
342 flg = TTY_FRAME;
343 uart->port.icount.frame++; 350 uart->port.icount.frame++;
344 } else 351
352 status &= uart->port.read_status_mask;
353
354 if (status & BI)
355 flg = TTY_BREAK;
356 else if (status & PE)
357 flg = TTY_PARITY;
358 else if (status & FE)
359 flg = TTY_FRAME;
360 else
345 flg = TTY_NORMAL; 361 flg = TTY_NORMAL;
346 362
347 for (i = uart->rx_dma_buf.head; i < uart->rx_dma_buf.tail; i++) { 363 for (i = uart->rx_dma_buf.head; i < uart->rx_dma_buf.tail; i++) {
348 if (uart_handle_sysrq_char(&uart->port, uart->rx_dma_buf.buf[i])) 364 if (uart_handle_sysrq_char(&uart->port, uart->rx_dma_buf.buf[i]))
349 goto dma_ignore_char; 365 goto dma_ignore_char;
350 uart_insert_char(&uart->port, status, 2, uart->rx_dma_buf.buf[i], flg); 366 uart_insert_char(&uart->port, status, OE, uart->rx_dma_buf.buf[i], flg);
351 } 367 }
352dma_ignore_char: 368
369 dma_ignore_char:
353 tty_flip_buffer_push(tty); 370 tty_flip_buffer_push(tty);
354} 371}
355 372
@@ -545,14 +562,14 @@ static int bfin_serial_startup(struct uart_port *port)
545 add_timer(&(uart->rx_dma_timer)); 562 add_timer(&(uart->rx_dma_timer));
546#else 563#else
547 if (request_irq 564 if (request_irq
548 (uart->port.irq, bfin_serial_int, IRQF_DISABLED, 565 (uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED,
549 "BFIN_UART_RX", uart)) { 566 "BFIN_UART_RX", uart)) {
550 printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n"); 567 printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n");
551 return -EBUSY; 568 return -EBUSY;
552 } 569 }
553 570
554 if (request_irq 571 if (request_irq
555 (uart->port.irq+1, bfin_serial_int, IRQF_DISABLED, 572 (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED,
556 "BFIN_UART_TX", uart)) { 573 "BFIN_UART_TX", uart)) {
557 printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n"); 574 printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n");
558 free_irq(uart->port.irq, uart); 575 free_irq(uart->port.irq, uart);
@@ -614,13 +631,27 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
614 lcr |= EPS; 631 lcr |= EPS;
615 } 632 }
616 633
617 /* These controls are not implemented for this port */ 634 port->read_status_mask = OE;
618 termios->c_iflag |= INPCK | BRKINT | PARMRK; 635 if (termios->c_iflag & INPCK)
619 termios->c_iflag &= ~(IGNPAR | IGNBRK); 636 port->read_status_mask |= (FE | PE);
637 if (termios->c_iflag & (BRKINT | PARMRK))
638 port->read_status_mask |= BI;
620 639
621 /* These controls are not implemented for this port */ 640 /*
622 termios->c_iflag |= INPCK | BRKINT | PARMRK; 641 * Characters to ignore
623 termios->c_iflag &= ~(IGNPAR | IGNBRK); 642 */
643 port->ignore_status_mask = 0;
644 if (termios->c_iflag & IGNPAR)
645 port->ignore_status_mask |= FE | PE;
646 if (termios->c_iflag & IGNBRK) {
647 port->ignore_status_mask |= BI;
648 /*
649 * If we're ignoring parity and break indicators,
650 * ignore overruns too (for real raw support).
651 */
652 if (termios->c_iflag & IGNPAR)
653 port->ignore_status_mask |= OE;
654 }
624 655
625 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); 656 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
626 quot = uart_get_divisor(port, baud); 657 quot = uart_get_divisor(port, baud);
diff --git a/drivers/serial/serial_ks8695.c b/drivers/serial/serial_ks8695.c
index c5346d677315..8721afe1ae4f 100644
--- a/drivers/serial/serial_ks8695.c
+++ b/drivers/serial/serial_ks8695.c
@@ -301,11 +301,11 @@ static int ks8695uart_startup(struct uart_port *port)
301 301
302 retval = request_irq(KS8695_IRQ_UART_LINE_STATUS, ks8695uart_rx_chars, IRQF_DISABLED, "UART LineStatus", port); 302 retval = request_irq(KS8695_IRQ_UART_LINE_STATUS, ks8695uart_rx_chars, IRQF_DISABLED, "UART LineStatus", port);
303 if (retval) 303 if (retval)
304 return err_ls; 304 goto err_ls;
305 305
306 retval = request_irq(KS8695_IRQ_UART_MODEM_STATUS, ks8695uart_modem_status, IRQF_DISABLED, "UART ModemStatus", port); 306 retval = request_irq(KS8695_IRQ_UART_MODEM_STATUS, ks8695uart_modem_status, IRQF_DISABLED, "UART ModemStatus", port);
307 if (retval) 307 if (retval)
308 return err_ms; 308 goto err_ms;
309 309
310 return 0; 310 return 0;
311 311
@@ -589,7 +589,7 @@ static int __init ks8695_console_setup(struct console *co, char *options)
589 return uart_set_options(port, co, baud, parity, bits, flow); 589 return uart_set_options(port, co, baud, parity, bits, flow);
590} 590}
591 591
592extern struct uart_driver ks8695_reg; 592static struct uart_driver ks8695_reg;
593 593
594static struct console ks8695_console = { 594static struct console ks8695_console = {
595 .name = SERIAL_KS8695_DEVNAME, 595 .name = SERIAL_KS8695_DEVNAME,
diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
index e35d9ab359f1..b45ba5392dd3 100644
--- a/drivers/serial/suncore.c
+++ b/drivers/serial/suncore.c
@@ -30,9 +30,9 @@ void
30sunserial_console_termios(struct console *con) 30sunserial_console_termios(struct console *con)
31{ 31{
32 char mode[16], buf[16], *s; 32 char mode[16], buf[16], *s;
33 char *mode_prop = "ttyX-mode"; 33 char mode_prop[] = "ttyX-mode";
34 char *cd_prop = "ttyX-ignore-cd"; 34 char cd_prop[] = "ttyX-ignore-cd";
35 char *dtr_prop = "ttyX-rts-dtr-off"; 35 char dtr_prop[] = "ttyX-rts-dtr-off";
36 char *ssp_console_modes_prop = "ssp-console-modes"; 36 char *ssp_console_modes_prop = "ssp-console-modes";
37 int baud, bits, stop, cflag; 37 int baud, bits, stop, cflag;
38 char parity; 38 char parity;
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 0985193dc57d..15b6e1cb040b 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1239,7 +1239,7 @@ static inline struct console *SUNZILOG_CONSOLE(void)
1239#define SUNZILOG_CONSOLE() (NULL) 1239#define SUNZILOG_CONSOLE() (NULL)
1240#endif 1240#endif
1241 1241
1242static void __init sunzilog_init_kbdms(struct uart_sunzilog_port *up, int channel) 1242static void __devinit sunzilog_init_kbdms(struct uart_sunzilog_port *up, int channel)
1243{ 1243{
1244 int baud, brg; 1244 int baud, brg;
1245 1245
@@ -1259,7 +1259,7 @@ static void __init sunzilog_init_kbdms(struct uart_sunzilog_port *up, int channe
1259} 1259}
1260 1260
1261#ifdef CONFIG_SERIO 1261#ifdef CONFIG_SERIO
1262static void __init sunzilog_register_serio(struct uart_sunzilog_port *up) 1262static void __devinit sunzilog_register_serio(struct uart_sunzilog_port *up)
1263{ 1263{
1264 struct serio *serio = &up->serio; 1264 struct serio *serio = &up->serio;
1265 1265
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 1d8a2f6bb8eb..8b2601de3630 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -113,16 +113,16 @@ static void atmel_spi_next_xfer(struct spi_master *master,
113 113
114 len = as->remaining_bytes; 114 len = as->remaining_bytes;
115 115
116 tx_dma = xfer->tx_dma; 116 tx_dma = xfer->tx_dma + xfer->len - len;
117 rx_dma = xfer->rx_dma; 117 rx_dma = xfer->rx_dma + xfer->len - len;
118 118
119 /* use scratch buffer only when rx or tx data is unspecified */ 119 /* use scratch buffer only when rx or tx data is unspecified */
120 if (rx_dma == INVALID_DMA_ADDRESS) { 120 if (!xfer->rx_buf) {
121 rx_dma = as->buffer_dma; 121 rx_dma = as->buffer_dma;
122 if (len > BUFFER_SIZE) 122 if (len > BUFFER_SIZE)
123 len = BUFFER_SIZE; 123 len = BUFFER_SIZE;
124 } 124 }
125 if (tx_dma == INVALID_DMA_ADDRESS) { 125 if (!xfer->tx_buf) {
126 tx_dma = as->buffer_dma; 126 tx_dma = as->buffer_dma;
127 if (len > BUFFER_SIZE) 127 if (len > BUFFER_SIZE)
128 len = BUFFER_SIZE; 128 len = BUFFER_SIZE;
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index 052359fc41ee..11f36bef3057 100644
--- a/drivers/spi/mpc52xx_psc_spi.c
+++ b/drivers/spi/mpc52xx_psc_spi.c
@@ -329,8 +329,8 @@ static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
329 int ret = 0; 329 int ret = 0;
330 330
331#if defined(CONFIG_PPC_MERGE) 331#if defined(CONFIG_PPC_MERGE)
332 cdm = mpc52xx_find_and_map("mpc52xx-cdm"); 332 cdm = mpc52xx_find_and_map("mpc5200-cdm");
333 gpio = mpc52xx_find_and_map("mpc52xx-gpio"); 333 gpio = mpc52xx_find_and_map("mpc5200-gpio");
334#else 334#else
335 cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE); 335 cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
336 gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE); 336 gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
@@ -445,9 +445,6 @@ static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
445 struct spi_master *master; 445 struct spi_master *master;
446 int ret; 446 int ret;
447 447
448 if (pdata == NULL)
449 return -ENODEV;
450
451 master = spi_alloc_master(dev, sizeof *mps); 448 master = spi_alloc_master(dev, sizeof *mps);
452 if (master == NULL) 449 if (master == NULL)
453 return -ENOMEM; 450 return -ENOMEM;
@@ -594,17 +591,17 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op,
594 } 591 }
595 regaddr64 = of_translate_address(op->node, regaddr_p); 592 regaddr64 = of_translate_address(op->node, regaddr_p);
596 593
594 /* get PSC id (1..6, used by port_config) */
597 if (op->dev.platform_data == NULL) { 595 if (op->dev.platform_data == NULL) {
598 struct device_node *np; 596 const u32 *psc_nump;
599 int i = 0;
600 597
601 for_each_node_by_type(np, "spi") { 598 psc_nump = of_get_property(op->node, "cell-index", NULL);
602 if (of_find_device_by_node(np) == op) { 599 if (!psc_nump || *psc_nump > 5) {
603 id = i; 600 printk(KERN_ERR "mpc52xx_psc_spi: Device node %s has invalid "
604 break; 601 "cell-index property\n", op->node->full_name);
605 } 602 return -EINVAL;
606 i++;
607 } 603 }
604 id = *psc_nump + 1;
608 } 605 }
609 606
610 return mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64, 607 return mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64,
@@ -617,7 +614,7 @@ static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op)
617} 614}
618 615
619static struct of_device_id mpc52xx_psc_spi_of_match[] = { 616static struct of_device_id mpc52xx_psc_spi_of_match[] = {
620 { .type = "spi", .compatible = "mpc52xx-psc-spi", }, 617 { .type = "spi", .compatible = "mpc5200-psc-spi", },
621 {}, 618 {},
622}; 619};
623 620
diff --git a/drivers/spi/omap_uwire.c b/drivers/spi/omap_uwire.c
index 96f62b2df300..95183e1df525 100644
--- a/drivers/spi/omap_uwire.c
+++ b/drivers/spi/omap_uwire.c
@@ -358,11 +358,11 @@ static int uwire_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
358 switch (spi->mode & (SPI_CPOL | SPI_CPHA)) { 358 switch (spi->mode & (SPI_CPOL | SPI_CPHA)) {
359 case SPI_MODE_0: 359 case SPI_MODE_0:
360 case SPI_MODE_3: 360 case SPI_MODE_3:
361 flags |= UWIRE_WRITE_RISING_EDGE | UWIRE_READ_FALLING_EDGE; 361 flags |= UWIRE_WRITE_FALLING_EDGE | UWIRE_READ_RISING_EDGE;
362 break; 362 break;
363 case SPI_MODE_1: 363 case SPI_MODE_1:
364 case SPI_MODE_2: 364 case SPI_MODE_2:
365 flags |= UWIRE_WRITE_FALLING_EDGE | UWIRE_READ_RISING_EDGE; 365 flags |= UWIRE_WRITE_RISING_EDGE | UWIRE_READ_FALLING_EDGE;
366 break; 366 break;
367 } 367 }
368 368
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index ce3c0ce2316e..7d2d9ec6cac3 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -126,7 +126,7 @@ struct chip_data {
126 126
127 u8 chip_select_num; 127 u8 chip_select_num;
128 u8 n_bytes; 128 u8 n_bytes;
129 u32 width; /* 0 or 1 */ 129 u8 width; /* 0 or 1 */
130 u8 enable_dma; 130 u8 enable_dma;
131 u8 bits_per_word; /* 8 or 16 */ 131 u8 bits_per_word; /* 8 or 16 */
132 u8 cs_change_per_word; 132 u8 cs_change_per_word;
@@ -136,7 +136,7 @@ struct chip_data {
136 void (*duplex) (struct driver_data *); 136 void (*duplex) (struct driver_data *);
137}; 137};
138 138
139void bfin_spi_enable(struct driver_data *drv_data) 139static void bfin_spi_enable(struct driver_data *drv_data)
140{ 140{
141 u16 cr; 141 u16 cr;
142 142
@@ -145,7 +145,7 @@ void bfin_spi_enable(struct driver_data *drv_data)
145 SSYNC(); 145 SSYNC();
146} 146}
147 147
148void bfin_spi_disable(struct driver_data *drv_data) 148static void bfin_spi_disable(struct driver_data *drv_data)
149{ 149{
150 u16 cr; 150 u16 cr;
151 151
@@ -163,9 +163,6 @@ static u16 hz_to_spi_baud(u32 speed_hz)
163 if ((sclk % (2 * speed_hz)) > 0) 163 if ((sclk % (2 * speed_hz)) > 0)
164 spi_baud++; 164 spi_baud++;
165 165
166 pr_debug("sclk = %ld, speed_hz = %d, spi_baud = %d\n", sclk, speed_hz,
167 spi_baud);
168
169 return spi_baud; 166 return spi_baud;
170} 167}
171 168
@@ -190,11 +187,12 @@ static void restore_state(struct driver_data *drv_data)
190 /* Clear status and disable clock */ 187 /* Clear status and disable clock */
191 write_STAT(BIT_STAT_CLR); 188 write_STAT(BIT_STAT_CLR);
192 bfin_spi_disable(drv_data); 189 bfin_spi_disable(drv_data);
193 pr_debug("restoring spi ctl state\n"); 190 dev_dbg(&drv_data->pdev->dev, "restoring spi ctl state\n");
194 191
195#if defined(CONFIG_BF534) || defined(CONFIG_BF536) || defined(CONFIG_BF537) 192#if defined(CONFIG_BF534) || defined(CONFIG_BF536) || defined(CONFIG_BF537)
196 pr_debug("chip select number is %d\n", chip->chip_select_num); 193 dev_dbg(&drv_data->pdev->dev,
197 194 "chip select number is %d\n", chip->chip_select_num);
195
198 switch (chip->chip_select_num) { 196 switch (chip->chip_select_num) {
199 case 1: 197 case 1:
200 bfin_write_PORTF_FER(bfin_read_PORTF_FER() | 0x3c00); 198 bfin_write_PORTF_FER(bfin_read_PORTF_FER() | 0x3c00);
@@ -280,7 +278,8 @@ static void null_reader(struct driver_data *drv_data)
280 278
281static void u8_writer(struct driver_data *drv_data) 279static void u8_writer(struct driver_data *drv_data)
282{ 280{
283 pr_debug("cr8-s is 0x%x\n", read_STAT()); 281 dev_dbg(&drv_data->pdev->dev,
282 "cr8-s is 0x%x\n", read_STAT());
284 while (drv_data->tx < drv_data->tx_end) { 283 while (drv_data->tx < drv_data->tx_end) {
285 write_TDBR(*(u8 *) (drv_data->tx)); 284 write_TDBR(*(u8 *) (drv_data->tx));
286 while (read_STAT() & BIT_STAT_TXS) 285 while (read_STAT() & BIT_STAT_TXS)
@@ -318,7 +317,8 @@ static void u8_cs_chg_writer(struct driver_data *drv_data)
318 317
319static void u8_reader(struct driver_data *drv_data) 318static void u8_reader(struct driver_data *drv_data)
320{ 319{
321 pr_debug("cr-8 is 0x%x\n", read_STAT()); 320 dev_dbg(&drv_data->pdev->dev,
321 "cr-8 is 0x%x\n", read_STAT());
322 322
323 /* clear TDBR buffer before read(else it will be shifted out) */ 323 /* clear TDBR buffer before read(else it will be shifted out) */
324 write_TDBR(0xFFFF); 324 write_TDBR(0xFFFF);
@@ -404,7 +404,9 @@ static void u8_cs_chg_duplex(struct driver_data *drv_data)
404 404
405static void u16_writer(struct driver_data *drv_data) 405static void u16_writer(struct driver_data *drv_data)
406{ 406{
407 pr_debug("cr16 is 0x%x\n", read_STAT()); 407 dev_dbg(&drv_data->pdev->dev,
408 "cr16 is 0x%x\n", read_STAT());
409
408 while (drv_data->tx < drv_data->tx_end) { 410 while (drv_data->tx < drv_data->tx_end) {
409 write_TDBR(*(u16 *) (drv_data->tx)); 411 write_TDBR(*(u16 *) (drv_data->tx));
410 while ((read_STAT() & BIT_STAT_TXS)) 412 while ((read_STAT() & BIT_STAT_TXS))
@@ -442,7 +444,8 @@ static void u16_cs_chg_writer(struct driver_data *drv_data)
442 444
443static void u16_reader(struct driver_data *drv_data) 445static void u16_reader(struct driver_data *drv_data)
444{ 446{
445 pr_debug("cr-16 is 0x%x\n", read_STAT()); 447 dev_dbg(&drv_data->pdev->dev,
448 "cr-16 is 0x%x\n", read_STAT());
446 dummy_read(); 449 dummy_read();
447 450
448 while (drv_data->rx < (drv_data->rx_end - 2)) { 451 while (drv_data->rx < (drv_data->rx_end - 2)) {
@@ -571,12 +574,12 @@ static void giveback(struct driver_data *drv_data)
571 msg->complete(msg->context); 574 msg->complete(msg->context);
572} 575}
573 576
574static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs) 577static irqreturn_t dma_irq_handler(int irq, void *dev_id)
575{ 578{
576 struct driver_data *drv_data = (struct driver_data *)dev_id; 579 struct driver_data *drv_data = (struct driver_data *)dev_id;
577 struct spi_message *msg = drv_data->cur_msg; 580 struct spi_message *msg = drv_data->cur_msg;
578 581
579 pr_debug("in dma_irq_handler\n"); 582 dev_dbg(&drv_data->pdev->dev, "in dma_irq_handler\n");
580 clear_dma_irqstat(CH_SPI); 583 clear_dma_irqstat(CH_SPI);
581 584
582 /* 585 /*
@@ -604,7 +607,9 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
604 tasklet_schedule(&drv_data->pump_transfers); 607 tasklet_schedule(&drv_data->pump_transfers);
605 608
606 /* free the irq handler before next transfer */ 609 /* free the irq handler before next transfer */
607 pr_debug("disable dma channel irq%d\n", CH_SPI); 610 dev_dbg(&drv_data->pdev->dev,
611 "disable dma channel irq%d\n",
612 CH_SPI);
608 dma_disable_irq(CH_SPI); 613 dma_disable_irq(CH_SPI);
609 614
610 return IRQ_HANDLED; 615 return IRQ_HANDLED;
@@ -617,7 +622,8 @@ static void pump_transfers(unsigned long data)
617 struct spi_transfer *transfer = NULL; 622 struct spi_transfer *transfer = NULL;
618 struct spi_transfer *previous = NULL; 623 struct spi_transfer *previous = NULL;
619 struct chip_data *chip = NULL; 624 struct chip_data *chip = NULL;
620 u16 cr, width, dma_width, dma_config; 625 u8 width;
626 u16 cr, dma_width, dma_config;
621 u32 tranf_success = 1; 627 u32 tranf_success = 1;
622 628
623 /* Get current state information */ 629 /* Get current state information */
@@ -662,8 +668,8 @@ static void pump_transfers(unsigned long data)
662 if (transfer->tx_buf != NULL) { 668 if (transfer->tx_buf != NULL) {
663 drv_data->tx = (void *)transfer->tx_buf; 669 drv_data->tx = (void *)transfer->tx_buf;
664 drv_data->tx_end = drv_data->tx + transfer->len; 670 drv_data->tx_end = drv_data->tx + transfer->len;
665 pr_debug("tx_buf is %p, tx_end is %p\n", transfer->tx_buf, 671 dev_dbg(&drv_data->pdev->dev, "tx_buf is %p, tx_end is %p\n",
666 drv_data->tx_end); 672 transfer->tx_buf, drv_data->tx_end);
667 } else { 673 } else {
668 drv_data->tx = NULL; 674 drv_data->tx = NULL;
669 } 675 }
@@ -671,8 +677,8 @@ static void pump_transfers(unsigned long data)
671 if (transfer->rx_buf != NULL) { 677 if (transfer->rx_buf != NULL) {
672 drv_data->rx = transfer->rx_buf; 678 drv_data->rx = transfer->rx_buf;
673 drv_data->rx_end = drv_data->rx + transfer->len; 679 drv_data->rx_end = drv_data->rx + transfer->len;
674 pr_debug("rx_buf is %p, rx_end is %p\n", transfer->rx_buf, 680 dev_dbg(&drv_data->pdev->dev, "rx_buf is %p, rx_end is %p\n",
675 drv_data->rx_end); 681 transfer->rx_buf, drv_data->rx_end);
676 } else { 682 } else {
677 drv_data->rx = NULL; 683 drv_data->rx = NULL;
678 } 684 }
@@ -690,9 +696,9 @@ static void pump_transfers(unsigned long data)
690 drv_data->write = drv_data->tx ? chip->write : null_writer; 696 drv_data->write = drv_data->tx ? chip->write : null_writer;
691 drv_data->read = drv_data->rx ? chip->read : null_reader; 697 drv_data->read = drv_data->rx ? chip->read : null_reader;
692 drv_data->duplex = chip->duplex ? chip->duplex : null_writer; 698 drv_data->duplex = chip->duplex ? chip->duplex : null_writer;
693 pr_debug 699 dev_dbg(&drv_data->pdev->dev,
694 ("transfer: drv_data->write is %p, chip->write is %p, null_wr is %p\n", 700 "transfer: drv_data->write is %p, chip->write is %p, null_wr is %p\n",
695 drv_data->write, chip->write, null_writer); 701 drv_data->write, chip->write, null_writer);
696 702
697 /* speed and width has been set on per message */ 703 /* speed and width has been set on per message */
698 message->state = RUNNING_STATE; 704 message->state = RUNNING_STATE;
@@ -706,8 +712,9 @@ static void pump_transfers(unsigned long data)
706 } 712 }
707 write_FLAG(chip->flag); 713 write_FLAG(chip->flag);
708 714
709 pr_debug("now pumping a transfer: width is %d, len is %d\n", width, 715 dev_dbg(&drv_data->pdev->dev,
710 transfer->len); 716 "now pumping a transfer: width is %d, len is %d\n",
717 width, transfer->len);
711 718
712 /* 719 /*
713 * Try to map dma buffer and do a dma transfer if 720 * Try to map dma buffer and do a dma transfer if
@@ -722,7 +729,7 @@ static void pump_transfers(unsigned long data)
722 bfin_spi_disable(drv_data); 729 bfin_spi_disable(drv_data);
723 730
724 /* config dma channel */ 731 /* config dma channel */
725 pr_debug("doing dma transfer\n"); 732 dev_dbg(&drv_data->pdev->dev, "doing dma transfer\n");
726 if (width == CFG_SPI_WORDSIZE16) { 733 if (width == CFG_SPI_WORDSIZE16) {
727 set_dma_x_count(CH_SPI, drv_data->len); 734 set_dma_x_count(CH_SPI, drv_data->len);
728 set_dma_x_modify(CH_SPI, 2); 735 set_dma_x_modify(CH_SPI, 2);
@@ -738,7 +745,8 @@ static void pump_transfers(unsigned long data)
738 745
739 /* dirty hack for autobuffer DMA mode */ 746 /* dirty hack for autobuffer DMA mode */
740 if (drv_data->tx_dma == 0xFFFF) { 747 if (drv_data->tx_dma == 0xFFFF) {
741 pr_debug("doing autobuffer DMA out.\n"); 748 dev_dbg(&drv_data->pdev->dev,
749 "doing autobuffer DMA out.\n");
742 750
743 /* no irq in autobuffer mode */ 751 /* no irq in autobuffer mode */
744 dma_config = 752 dma_config =
@@ -758,7 +766,7 @@ static void pump_transfers(unsigned long data)
758 /* In dma mode, rx or tx must be NULL in one transfer */ 766 /* In dma mode, rx or tx must be NULL in one transfer */
759 if (drv_data->rx != NULL) { 767 if (drv_data->rx != NULL) {
760 /* set transfer mode, and enable SPI */ 768 /* set transfer mode, and enable SPI */
761 pr_debug("doing DMA in.\n"); 769 dev_dbg(&drv_data->pdev->dev, "doing DMA in.\n");
762 770
763 /* disable SPI before write to TDBR */ 771 /* disable SPI before write to TDBR */
764 write_CTRL(cr & ~BIT_CTL_ENABLE); 772 write_CTRL(cr & ~BIT_CTL_ENABLE);
@@ -781,7 +789,7 @@ static void pump_transfers(unsigned long data)
781 /* set transfer mode, and enable SPI */ 789 /* set transfer mode, and enable SPI */
782 write_CTRL(cr); 790 write_CTRL(cr);
783 } else if (drv_data->tx != NULL) { 791 } else if (drv_data->tx != NULL) {
784 pr_debug("doing DMA out.\n"); 792 dev_dbg(&drv_data->pdev->dev, "doing DMA out.\n");
785 793
786 /* start dma */ 794 /* start dma */
787 dma_enable_irq(CH_SPI); 795 dma_enable_irq(CH_SPI);
@@ -796,7 +804,7 @@ static void pump_transfers(unsigned long data)
796 } 804 }
797 } else { 805 } else {
798 /* IO mode write then read */ 806 /* IO mode write then read */
799 pr_debug("doing IO transfer\n"); 807 dev_dbg(&drv_data->pdev->dev, "doing IO transfer\n");
800 808
801 write_STAT(BIT_STAT_CLR); 809 write_STAT(BIT_STAT_CLR);
802 810
@@ -804,11 +812,11 @@ static void pump_transfers(unsigned long data)
804 /* full duplex mode */ 812 /* full duplex mode */
805 BUG_ON((drv_data->tx_end - drv_data->tx) != 813 BUG_ON((drv_data->tx_end - drv_data->tx) !=
806 (drv_data->rx_end - drv_data->rx)); 814 (drv_data->rx_end - drv_data->rx));
807 cr = (read_CTRL() & (~BIT_CTL_TIMOD)); /* clear the TIMOD bits */ 815 cr = (read_CTRL() & (~BIT_CTL_TIMOD));
808 cr |= 816 cr |= CFG_SPI_WRITE | (width << 8) |
809 CFG_SPI_WRITE | (width << 8) | (CFG_SPI_ENABLE << 817 (CFG_SPI_ENABLE << 14);
810 14); 818 dev_dbg(&drv_data->pdev->dev,
811 pr_debug("IO duplex: cr is 0x%x\n", cr); 819 "IO duplex: cr is 0x%x\n", cr);
812 820
813 write_CTRL(cr); 821 write_CTRL(cr);
814 SSYNC(); 822 SSYNC();
@@ -819,11 +827,11 @@ static void pump_transfers(unsigned long data)
819 tranf_success = 0; 827 tranf_success = 0;
820 } else if (drv_data->tx != NULL) { 828 } else if (drv_data->tx != NULL) {
821 /* write only half duplex */ 829 /* write only half duplex */
822 cr = (read_CTRL() & (~BIT_CTL_TIMOD)); /* clear the TIMOD bits */ 830 cr = (read_CTRL() & (~BIT_CTL_TIMOD));
823 cr |= 831 cr |= CFG_SPI_WRITE | (width << 8) |
824 CFG_SPI_WRITE | (width << 8) | (CFG_SPI_ENABLE << 832 (CFG_SPI_ENABLE << 14);
825 14); 833 dev_dbg(&drv_data->pdev->dev,
826 pr_debug("IO write: cr is 0x%x\n", cr); 834 "IO write: cr is 0x%x\n", cr);
827 835
828 write_CTRL(cr); 836 write_CTRL(cr);
829 SSYNC(); 837 SSYNC();
@@ -834,11 +842,11 @@ static void pump_transfers(unsigned long data)
834 tranf_success = 0; 842 tranf_success = 0;
835 } else if (drv_data->rx != NULL) { 843 } else if (drv_data->rx != NULL) {
836 /* read only half duplex */ 844 /* read only half duplex */
837 cr = (read_CTRL() & (~BIT_CTL_TIMOD)); /* cleare the TIMOD bits */ 845 cr = (read_CTRL() & (~BIT_CTL_TIMOD));
838 cr |= 846 cr |= CFG_SPI_READ | (width << 8) |
839 CFG_SPI_READ | (width << 8) | (CFG_SPI_ENABLE << 847 (CFG_SPI_ENABLE << 14);
840 14); 848 dev_dbg(&drv_data->pdev->dev,
841 pr_debug("IO read: cr is 0x%x\n", cr); 849 "IO read: cr is 0x%x\n", cr);
842 850
843 write_CTRL(cr); 851 write_CTRL(cr);
844 SSYNC(); 852 SSYNC();
@@ -849,7 +857,8 @@ static void pump_transfers(unsigned long data)
849 } 857 }
850 858
851 if (!tranf_success) { 859 if (!tranf_success) {
852 pr_debug("IO write error!\n"); 860 dev_dbg(&drv_data->pdev->dev,
861 "IO write error!\n");
853 message->state = ERROR_STATE; 862 message->state = ERROR_STATE;
854 } else { 863 } else {
855 /* Update total byte transfered */ 864 /* Update total byte transfered */
@@ -899,11 +908,14 @@ static void pump_messages(struct work_struct *work)
899 /* Setup the SSP using the per chip configuration */ 908 /* Setup the SSP using the per chip configuration */
900 drv_data->cur_chip = spi_get_ctldata(drv_data->cur_msg->spi); 909 drv_data->cur_chip = spi_get_ctldata(drv_data->cur_msg->spi);
901 restore_state(drv_data); 910 restore_state(drv_data);
902 pr_debug 911 dev_dbg(&drv_data->pdev->dev,
903 ("got a message to pump, state is set to: baud %d, flag 0x%x, ctl 0x%x\n", 912 "got a message to pump, state is set to: baud %d, flag 0x%x, ctl 0x%x\n",
904 drv_data->cur_chip->baud, drv_data->cur_chip->flag, 913 drv_data->cur_chip->baud, drv_data->cur_chip->flag,
905 drv_data->cur_chip->ctl_reg); 914 drv_data->cur_chip->ctl_reg);
906 pr_debug("the first transfer len is %d\n", drv_data->cur_transfer->len); 915
916 dev_dbg(&drv_data->pdev->dev,
917 "the first transfer len is %d\n",
918 drv_data->cur_transfer->len);
907 919
908 /* Mark as busy and launch transfers */ 920 /* Mark as busy and launch transfers */
909 tasklet_schedule(&drv_data->pump_transfers); 921 tasklet_schedule(&drv_data->pump_transfers);
@@ -932,7 +944,7 @@ static int transfer(struct spi_device *spi, struct spi_message *msg)
932 msg->status = -EINPROGRESS; 944 msg->status = -EINPROGRESS;
933 msg->state = START_STATE; 945 msg->state = START_STATE;
934 946
935 pr_debug("adding an msg in transfer() \n"); 947 dev_dbg(&spi->dev, "adding an msg in transfer() \n");
936 list_add_tail(&msg->queue, &drv_data->queue); 948 list_add_tail(&msg->queue, &drv_data->queue);
937 949
938 if (drv_data->run == QUEUE_RUNNING && !drv_data->busy) 950 if (drv_data->run == QUEUE_RUNNING && !drv_data->busy)
@@ -1002,13 +1014,13 @@ static int setup(struct spi_device *spi)
1002 if (chip->enable_dma && !dma_requested) { 1014 if (chip->enable_dma && !dma_requested) {
1003 /* register dma irq handler */ 1015 /* register dma irq handler */
1004 if (request_dma(CH_SPI, "BF53x_SPI_DMA") < 0) { 1016 if (request_dma(CH_SPI, "BF53x_SPI_DMA") < 0) {
1005 pr_debug 1017 dev_dbg(&spi->dev,
1006 ("Unable to request BlackFin SPI DMA channel\n"); 1018 "Unable to request BlackFin SPI DMA channel\n");
1007 return -ENODEV; 1019 return -ENODEV;
1008 } 1020 }
1009 if (set_dma_callback(CH_SPI, (void *)dma_irq_handler, drv_data) 1021 if (set_dma_callback(CH_SPI, (void *)dma_irq_handler, drv_data)
1010 < 0) { 1022 < 0) {
1011 pr_debug("Unable to set dma callback\n"); 1023 dev_dbg(&spi->dev, "Unable to set dma callback\n");
1012 return -EPERM; 1024 return -EPERM;
1013 } 1025 }
1014 dma_disable_irq(CH_SPI); 1026 dma_disable_irq(CH_SPI);
@@ -1054,9 +1066,9 @@ static int setup(struct spi_device *spi)
1054 return -ENODEV; 1066 return -ENODEV;
1055 } 1067 }
1056 1068
1057 pr_debug("setup spi chip %s, width is %d, dma is %d,", 1069 dev_dbg(&spi->dev, "setup spi chip %s, width is %d, dma is %d,",
1058 spi->modalias, chip->width, chip->enable_dma); 1070 spi->modalias, chip->width, chip->enable_dma);
1059 pr_debug("ctl_reg is 0x%x, flag_reg is 0x%x\n", 1071 dev_dbg(&spi->dev, "ctl_reg is 0x%x, flag_reg is 0x%x\n",
1060 chip->ctl_reg, chip->flag); 1072 chip->ctl_reg, chip->flag);
1061 1073
1062 spi_set_ctldata(spi, chip); 1074 spi_set_ctldata(spi, chip);
@@ -1068,7 +1080,7 @@ static int setup(struct spi_device *spi)
1068 * callback for spi framework. 1080 * callback for spi framework.
1069 * clean driver specific data 1081 * clean driver specific data
1070 */ 1082 */
1071static void cleanup(const struct spi_device *spi) 1083static void cleanup(struct spi_device *spi)
1072{ 1084{
1073 struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi); 1085 struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi);
1074 1086
@@ -1207,7 +1219,7 @@ static int __init bfin5xx_spi_probe(struct platform_device *pdev)
1207 dev_err(&pdev->dev, "problem registering spi master\n"); 1219 dev_err(&pdev->dev, "problem registering spi master\n");
1208 goto out_error_queue_alloc; 1220 goto out_error_queue_alloc;
1209 } 1221 }
1210 pr_debug("controller probe successfully\n"); 1222 dev_dbg(&pdev->dev, "controller probe successfully\n");
1211 return status; 1223 return status;
1212 1224
1213 out_error_queue_alloc: 1225 out_error_queue_alloc:
@@ -1287,27 +1299,23 @@ static int bfin5xx_spi_resume(struct platform_device *pdev)
1287#endif /* CONFIG_PM */ 1299#endif /* CONFIG_PM */
1288 1300
1289static struct platform_driver bfin5xx_spi_driver = { 1301static struct platform_driver bfin5xx_spi_driver = {
1290 .driver = { 1302 .driver = {
1291 .name = "bfin-spi-master", 1303 .name = "bfin-spi-master",
1292 .bus = &platform_bus_type, 1304 .owner = THIS_MODULE,
1293 .owner = THIS_MODULE, 1305 },
1294 }, 1306 .suspend = bfin5xx_spi_suspend,
1295 .probe = bfin5xx_spi_probe, 1307 .resume = bfin5xx_spi_resume,
1296 .remove = __devexit_p(bfin5xx_spi_remove), 1308 .remove = __devexit_p(bfin5xx_spi_remove),
1297 .suspend = bfin5xx_spi_suspend,
1298 .resume = bfin5xx_spi_resume,
1299}; 1309};
1300 1310
1301static int __init bfin5xx_spi_init(void) 1311static int __init bfin5xx_spi_init(void)
1302{ 1312{
1303 return platform_driver_register(&bfin5xx_spi_driver); 1313 return platform_driver_probe(&bfin5xx_spi_driver, bfin5xx_spi_probe);
1304} 1314}
1305
1306module_init(bfin5xx_spi_init); 1315module_init(bfin5xx_spi_init);
1307 1316
1308static void __exit bfin5xx_spi_exit(void) 1317static void __exit bfin5xx_spi_exit(void)
1309{ 1318{
1310 platform_driver_unregister(&bfin5xx_spi_driver); 1319 platform_driver_unregister(&bfin5xx_spi_driver);
1311} 1320}
1312
1313module_exit(bfin5xx_spi_exit); 1321module_exit(bfin5xx_spi_exit);
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index 51daa212c6b7..656be4a5094a 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -121,7 +121,7 @@
121 32.768 KHz Clock */ 121 32.768 KHz Clock */
122 122
123/* SPI DMA Register Bit Fields & Masks */ 123/* SPI DMA Register Bit Fields & Masks */
124#define SPI_DMA_RHDMA (0xF << 4) /* RXFIFO Half Status */ 124#define SPI_DMA_RHDMA (0x1 << 4) /* RXFIFO Half Status */
125#define SPI_DMA_RFDMA (0x1 << 5) /* RXFIFO Full Status */ 125#define SPI_DMA_RFDMA (0x1 << 5) /* RXFIFO Full Status */
126#define SPI_DMA_TEDMA (0x1 << 6) /* TXFIFO Empty Status */ 126#define SPI_DMA_TEDMA (0x1 << 6) /* TXFIFO Empty Status */
127#define SPI_DMA_THDMA (0x1 << 7) /* TXFIFO Half Status */ 127#define SPI_DMA_THDMA (0x1 << 7) /* TXFIFO Half Status */
@@ -1355,6 +1355,7 @@ static int setup(struct spi_device *spi)
1355 spi->bits_per_word, 1355 spi->bits_per_word,
1356 spi_speed_hz(SPI_CONTROL_DATARATE_MIN), 1356 spi_speed_hz(SPI_CONTROL_DATARATE_MIN),
1357 spi->max_speed_hz); 1357 spi->max_speed_hz);
1358 return status;
1358 1359
1359err_first_setup: 1360err_first_setup:
1360 kfree(chip); 1361 kfree(chip);
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 225d6b2f82dd..d04242aee40d 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -168,6 +168,12 @@ static int spidev_message(struct spidev_data *spidev,
168 n--, k_tmp++, u_tmp++) { 168 n--, k_tmp++, u_tmp++) {
169 k_tmp->len = u_tmp->len; 169 k_tmp->len = u_tmp->len;
170 170
171 total += k_tmp->len;
172 if (total > bufsiz) {
173 status = -EMSGSIZE;
174 goto done;
175 }
176
171 if (u_tmp->rx_buf) { 177 if (u_tmp->rx_buf) {
172 k_tmp->rx_buf = buf; 178 k_tmp->rx_buf = buf;
173 if (!access_ok(VERIFY_WRITE, u_tmp->rx_buf, u_tmp->len)) 179 if (!access_ok(VERIFY_WRITE, u_tmp->rx_buf, u_tmp->len))
@@ -179,12 +185,6 @@ static int spidev_message(struct spidev_data *spidev,
179 u_tmp->len)) 185 u_tmp->len))
180 goto done; 186 goto done;
181 } 187 }
182
183 total += k_tmp->len;
184 if (total > bufsiz) {
185 status = -EMSGSIZE;
186 goto done;
187 }
188 buf += k_tmp->len; 188 buf += k_tmp->len;
189 189
190 k_tmp->cs_change = !!u_tmp->cs_change; 190 k_tmp->cs_change = !!u_tmp->cs_change;
@@ -364,6 +364,7 @@ spidev_ioctl(struct inode *inode, struct file *filp,
364 break; 364 break;
365 } 365 }
366 if (__copy_from_user(ioc, (void __user *)arg, tmp)) { 366 if (__copy_from_user(ioc, (void __user *)arg, tmp)) {
367 kfree(ioc);
367 retval = -EFAULT; 368 retval = -EFAULT;
368 break; 369 break;
369 } 370 }
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 15e740e3a5c4..7b1edfe46b28 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -1003,7 +1003,7 @@ abort:
1003 usblp->writebuf, usblp->writeurb->transfer_dma); 1003 usblp->writebuf, usblp->writeurb->transfer_dma);
1004 if (usblp->readbuf) 1004 if (usblp->readbuf)
1005 usb_buffer_free (usblp->dev, USBLP_BUF_SIZE, 1005 usb_buffer_free (usblp->dev, USBLP_BUF_SIZE,
1006 usblp->readbuf, usblp->writeurb->transfer_dma); 1006 usblp->readbuf, usblp->readurb->transfer_dma);
1007 kfree(usblp->statusbuf); 1007 kfree(usblp->statusbuf);
1008 kfree(usblp->device_id_string); 1008 kfree(usblp->device_id_string);
1009 usb_free_urb(usblp->writeurb); 1009 usb_free_urb(usblp->writeurb);
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index bfb3731d42db..2d4fd530e5e4 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -185,10 +185,12 @@ static int usb_parse_interface(struct device *ddev, int cfgno,
185 num_ep = USB_MAXENDPOINTS; 185 num_ep = USB_MAXENDPOINTS;
186 } 186 }
187 187
188 len = sizeof(struct usb_host_endpoint) * num_ep; 188 if (num_ep > 0) { /* Can't allocate 0 bytes */
189 alt->endpoint = kzalloc(len, GFP_KERNEL); 189 len = sizeof(struct usb_host_endpoint) * num_ep;
190 if (!alt->endpoint) 190 alt->endpoint = kzalloc(len, GFP_KERNEL);
191 return -ENOMEM; 191 if (!alt->endpoint)
192 return -ENOMEM;
193 }
192 194
193 /* Parse all the endpoint descriptors */ 195 /* Parse all the endpoint descriptors */
194 n = 0; 196 n = 0;
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index b9f7f90aef82..2619986e5300 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -983,7 +983,10 @@ static int autosuspend_check(struct usb_device *udev)
983 983
984#else 984#else
985 985
986#define autosuspend_check(udev) 0 986static inline int autosuspend_check(struct usb_device *udev)
987{
988 return 0;
989}
987 990
988#endif /* CONFIG_USB_SUSPEND */ 991#endif /* CONFIG_USB_SUSPEND */
989 992
@@ -1041,7 +1044,6 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
1041 if (status < 0) 1044 if (status < 0)
1042 goto done; 1045 goto done;
1043 } 1046 }
1044 cancel_delayed_work(&udev->autosuspend);
1045 1047
1046 /* Suspend all the interfaces and then udev itself */ 1048 /* Suspend all the interfaces and then udev itself */
1047 if (udev->actconfig) { 1049 if (udev->actconfig) {
@@ -1062,9 +1064,16 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
1062 usb_resume_interface(intf); 1064 usb_resume_interface(intf);
1063 } 1065 }
1064 1066
1067 /* Try another autosuspend when the interfaces aren't busy */
1068 if (udev->auto_pm)
1069 autosuspend_check(udev);
1070
1065 /* If the suspend succeeded, propagate it up the tree */ 1071 /* If the suspend succeeded, propagate it up the tree */
1066 } else if (parent) 1072 } else {
1067 usb_autosuspend_device(parent); 1073 cancel_delayed_work(&udev->autosuspend);
1074 if (parent)
1075 usb_autosuspend_device(parent);
1076 }
1068 1077
1069 done: 1078 done:
1070 // dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); 1079 // dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status);
@@ -1475,6 +1484,7 @@ int usb_external_resume_device(struct usb_device *udev)
1475 usb_pm_lock(udev); 1484 usb_pm_lock(udev);
1476 udev->auto_pm = 0; 1485 udev->auto_pm = 0;
1477 status = usb_resume_both(udev); 1486 status = usb_resume_both(udev);
1487 udev->last_busy = jiffies;
1478 usb_pm_unlock(udev); 1488 usb_pm_unlock(udev);
1479 1489
1480 /* Now that the device is awake, we can start trying to autosuspend 1490 /* Now that the device is awake, we can start trying to autosuspend
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 40cf882293e6..8969e42434b9 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1018,8 +1018,8 @@ done:
1018 atomic_dec (&urb->use_count); 1018 atomic_dec (&urb->use_count);
1019 if (urb->reject) 1019 if (urb->reject)
1020 wake_up (&usb_kill_urb_queue); 1020 wake_up (&usb_kill_urb_queue);
1021 usb_put_urb (urb);
1022 usbmon_urb_submit_error(&hcd->self, urb, status); 1021 usbmon_urb_submit_error(&hcd->self, urb, status);
1022 usb_put_urb (urb);
1023 } 1023 }
1024 return status; 1024 return status;
1025} 1025}
@@ -1175,10 +1175,6 @@ void usb_hcd_endpoint_disable (struct usb_device *udev,
1175 struct urb *urb; 1175 struct urb *urb;
1176 1176
1177 hcd = bus_to_hcd(udev->bus); 1177 hcd = bus_to_hcd(udev->bus);
1178
1179 WARN_ON (!HC_IS_RUNNING (hcd->state) && hcd->state != HC_STATE_HALT &&
1180 udev->state != USB_STATE_NOTATTACHED);
1181
1182 local_irq_disable (); 1178 local_irq_disable ();
1183 1179
1184 /* ep is already gone from udev->ep_{in,out}[]; no more submits */ 1180 /* ep is already gone from udev->ep_{in,out}[]; no more submits */
@@ -1685,7 +1681,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
1685 spin_unlock_irq (&hcd_root_hub_lock); 1681 spin_unlock_irq (&hcd_root_hub_lock);
1686 1682
1687#ifdef CONFIG_PM 1683#ifdef CONFIG_PM
1688 flush_workqueue(ksuspend_usb_wq); 1684 cancel_work_sync(&hcd->wakeup_work);
1689#endif 1685#endif
1690 1686
1691 mutex_lock(&usb_bus_list_lock); 1687 mutex_lock(&usb_bus_list_lock);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index f6b74a678de5..24f10a19dbdb 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1158,6 +1158,30 @@ static void release_address(struct usb_device *udev)
1158 } 1158 }
1159} 1159}
1160 1160
1161#ifdef CONFIG_USB_SUSPEND
1162
1163static void usb_stop_pm(struct usb_device *udev)
1164{
1165 /* Synchronize with the ksuspend thread to prevent any more
1166 * autosuspend requests from being submitted, and decrement
1167 * the parent's count of unsuspended children.
1168 */
1169 usb_pm_lock(udev);
1170 if (udev->parent && !udev->discon_suspended)
1171 usb_autosuspend_device(udev->parent);
1172 usb_pm_unlock(udev);
1173
1174 /* Stop any autosuspend requests already submitted */
1175 cancel_rearming_delayed_work(&udev->autosuspend);
1176}
1177
1178#else
1179
1180static inline void usb_stop_pm(struct usb_device *udev)
1181{ }
1182
1183#endif
1184
1161/** 1185/**
1162 * usb_disconnect - disconnect a device (usbcore-internal) 1186 * usb_disconnect - disconnect a device (usbcore-internal)
1163 * @pdev: pointer to device being disconnected 1187 * @pdev: pointer to device being disconnected
@@ -1224,13 +1248,7 @@ void usb_disconnect(struct usb_device **pdev)
1224 *pdev = NULL; 1248 *pdev = NULL;
1225 spin_unlock_irq(&device_state_lock); 1249 spin_unlock_irq(&device_state_lock);
1226 1250
1227 /* Decrement the parent's count of unsuspended children */ 1251 usb_stop_pm(udev);
1228 if (udev->parent) {
1229 usb_pm_lock(udev);
1230 if (!udev->discon_suspended)
1231 usb_autosuspend_device(udev->parent);
1232 usb_pm_unlock(udev);
1233 }
1234 1252
1235 put_device(&udev->dev); 1253 put_device(&udev->dev);
1236} 1254}
@@ -2201,14 +2219,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
2201 continue; 2219 continue;
2202 } 2220 }
2203 2221
2204 /* Use a short timeout the first time through, 2222 /* Retry on all errors; some devices are flakey.
2205 * so that recalcitrant full-speed devices with 2223 * 255 is for WUSB devices, we actually need to use
2206 * 8- or 16-byte ep0-maxpackets won't slow things 2224 * 512 (WUSB1.0[4.8.1]).
2207 * down tremendously by NAKing the unexpectedly
2208 * early status stage. Also, retry on all errors;
2209 * some devices are flakey.
2210 * 255 is for WUSB devices, we actually need to use 512.
2211 * WUSB1.0[4.8.1].
2212 */ 2225 */
2213 for (j = 0; j < 3; ++j) { 2226 for (j = 0; j < 3; ++j) {
2214 buf->bMaxPacketSize0 = 0; 2227 buf->bMaxPacketSize0 = 0;
@@ -2216,7 +2229,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
2216 USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, 2229 USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
2217 USB_DT_DEVICE << 8, 0, 2230 USB_DT_DEVICE << 8, 0,
2218 buf, GET_DESCRIPTOR_BUFSIZE, 2231 buf, GET_DESCRIPTOR_BUFSIZE,
2219 (i ? USB_CTRL_GET_TIMEOUT : 1000)); 2232 USB_CTRL_GET_TIMEOUT);
2220 switch (buf->bMaxPacketSize0) { 2233 switch (buf->bMaxPacketSize0) {
2221 case 8: case 16: case 32: case 64: case 255: 2234 case 8: case 16: case 32: case 64: case 255:
2222 if (buf->bDescriptorType == 2235 if (buf->bDescriptorType ==
@@ -2426,10 +2439,10 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
2426 2439
2427 if (portchange & USB_PORT_STAT_C_CONNECTION) { 2440 if (portchange & USB_PORT_STAT_C_CONNECTION) {
2428 status = hub_port_debounce(hub, port1); 2441 status = hub_port_debounce(hub, port1);
2429 if (status < 0 && printk_ratelimit()) { 2442 if (status < 0) {
2430 dev_err (hub_dev, 2443 if (printk_ratelimit())
2431 "connect-debounce failed, port %d disabled\n", 2444 dev_err (hub_dev, "connect-debounce failed, "
2432 port1); 2445 "port %d disabled\n", port1);
2433 goto done; 2446 goto done;
2434 } 2447 }
2435 portstatus = status; 2448 portstatus = status;
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index b7434787db5f..f9fed34bf7d8 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -221,15 +221,10 @@ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
221 221
222 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == 222 if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
223 USB_ENDPOINT_XFER_INT) { 223 USB_ENDPOINT_XFER_INT) {
224 int interval;
225
226 if (usb_dev->speed == USB_SPEED_HIGH)
227 interval = 1 << min(15, ep->desc.bInterval - 1);
228 else
229 interval = ep->desc.bInterval;
230 pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30); 224 pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30);
231 usb_fill_int_urb(urb, usb_dev, pipe, data, len, 225 usb_fill_int_urb(urb, usb_dev, pipe, data, len,
232 usb_api_blocking_completion, NULL, interval); 226 usb_api_blocking_completion, NULL,
227 ep->desc.bInterval);
233 } else 228 } else
234 usb_fill_bulk_urb(urb, usb_dev, pipe, data, len, 229 usb_fill_bulk_urb(urb, usb_dev, pipe, data, len,
235 usb_api_blocking_completion, NULL); 230 usb_api_blocking_completion, NULL);
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index e7c982377488..be37c863fdfb 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -232,12 +232,15 @@ set_level(struct device *dev, struct device_attribute *attr,
232 int len = count; 232 int len = count;
233 char *cp; 233 char *cp;
234 int rc = 0; 234 int rc = 0;
235 int old_autosuspend_disabled, old_autoresume_disabled;
235 236
236 cp = memchr(buf, '\n', count); 237 cp = memchr(buf, '\n', count);
237 if (cp) 238 if (cp)
238 len = cp - buf; 239 len = cp - buf;
239 240
240 usb_lock_device(udev); 241 usb_lock_device(udev);
242 old_autosuspend_disabled = udev->autosuspend_disabled;
243 old_autoresume_disabled = udev->autoresume_disabled;
241 244
242 /* Setting the flags without calling usb_pm_lock is a subject to 245 /* Setting the flags without calling usb_pm_lock is a subject to
243 * races, but who cares... 246 * races, but who cares...
@@ -263,6 +266,10 @@ set_level(struct device *dev, struct device_attribute *attr,
263 } else 266 } else
264 rc = -EINVAL; 267 rc = -EINVAL;
265 268
269 if (rc) {
270 udev->autosuspend_disabled = old_autosuspend_disabled;
271 udev->autoresume_disabled = old_autoresume_disabled;
272 }
266 usb_unlock_device(udev); 273 usb_unlock_device(udev);
267 return (rc < 0 ? rc : count); 274 return (rc < 0 ? rc : count);
268} 275}
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 18ddc5e67e39..4a6299bd0047 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -184,10 +184,6 @@ static void usb_release_dev(struct device *dev)
184 184
185 udev = to_usb_device(dev); 185 udev = to_usb_device(dev);
186 186
187#ifdef CONFIG_USB_SUSPEND
188 cancel_delayed_work(&udev->autosuspend);
189 flush_workqueue(ksuspend_usb_wq);
190#endif
191 usb_destroy_configuration(udev); 187 usb_destroy_configuration(udev);
192 usb_put_hcd(bus_to_hcd(udev->bus)); 188 usb_put_hcd(bus_to_hcd(udev->bus));
193 kfree(udev->product); 189 kfree(udev->product);
@@ -205,7 +201,11 @@ struct device_type usb_device_type = {
205 201
206static int ksuspend_usb_init(void) 202static int ksuspend_usb_init(void)
207{ 203{
208 ksuspend_usb_wq = create_singlethread_workqueue("ksuspend_usbd"); 204 /* This workqueue is supposed to be both freezable and
205 * singlethreaded. Its job doesn't justify running on more
206 * than one CPU.
207 */
208 ksuspend_usb_wq = create_freezeable_workqueue("ksuspend_usbd");
209 if (!ksuspend_usb_wq) 209 if (!ksuspend_usb_wq)
210 return -ENOMEM; 210 return -ENOMEM;
211 return 0; 211 return 0;
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c
index 157054ea3978..3ca2b3159f00 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -228,13 +228,15 @@ static int dr_controller_setup(struct fsl_udc *udc)
228 228
229 /* Config PHY interface */ 229 /* Config PHY interface */
230 portctrl = fsl_readl(&dr_regs->portsc1); 230 portctrl = fsl_readl(&dr_regs->portsc1);
231 portctrl &= ~PORTSCX_PHY_TYPE_SEL; 231 portctrl &= ~(PORTSCX_PHY_TYPE_SEL & PORTSCX_PORT_WIDTH);
232 switch (udc->phy_mode) { 232 switch (udc->phy_mode) {
233 case FSL_USB2_PHY_ULPI: 233 case FSL_USB2_PHY_ULPI:
234 portctrl |= PORTSCX_PTS_ULPI; 234 portctrl |= PORTSCX_PTS_ULPI;
235 break; 235 break;
236 case FSL_USB2_PHY_UTMI:
237 case FSL_USB2_PHY_UTMI_WIDE: 236 case FSL_USB2_PHY_UTMI_WIDE:
237 portctrl |= PORTSCX_PTW_16BIT;
238 /* fall through */
239 case FSL_USB2_PHY_UTMI:
238 portctrl |= PORTSCX_PTS_UTMI; 240 portctrl |= PORTSCX_PTS_UTMI;
239 break; 241 break;
240 case FSL_USB2_PHY_SERIAL: 242 case FSL_USB2_PHY_SERIAL:
@@ -625,7 +627,7 @@ static void fsl_free_buffer(struct usb_ep *_ep, void *buf,
625 struct fsl_ep *ep; 627 struct fsl_ep *ep;
626 628
627 if (!_ep) 629 if (!_ep)
628 return NULL; 630 return;
629 631
630 ep = container_of(_ep, struct fsl_ep, ep); 632 ep = container_of(_ep, struct fsl_ep, ep);
631 633
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index a52480505f78..c7a7c590426f 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -193,6 +193,19 @@ static void mpc83xx_usb_setup(struct usb_hcd *hcd)
193 out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x00000004); 193 out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x00000004);
194 out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x0000001b); 194 out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x0000001b);
195 195
196#if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
197 /*
198 * Turn on cache snooping hardware, since some PowerPC platforms
199 * wholly rely on hardware to deal with cache coherent
200 */
201
202 /* Setup Snooping for all the 4GB space */
203 /* SNOOP1 starts from 0x0, size 2G */
204 out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x0 | SNOOP_SIZE_2GB);
205 /* SNOOP2 starts from 0x80000000, size 2G */
206 out_be32(non_ehci + FSL_SOC_USB_SNOOP2, 0x80000000 | SNOOP_SIZE_2GB);
207#endif
208
196 if (pdata->operating_mode == FSL_USB2_DR_HOST) 209 if (pdata->operating_mode == FSL_USB2_DR_HOST)
197 mpc83xx_setup_phy(ehci, pdata->phy_mode, 0); 210 mpc83xx_setup_phy(ehci, pdata->phy_mode, 0);
198 211
diff --git a/drivers/usb/host/ehci-fsl.h b/drivers/usb/host/ehci-fsl.h
index f28736a917e4..b5e59db53347 100644
--- a/drivers/usb/host/ehci-fsl.h
+++ b/drivers/usb/host/ehci-fsl.h
@@ -34,4 +34,5 @@
34#define FSL_SOC_USB_PRICTRL 0x40c /* NOTE: big-endian */ 34#define FSL_SOC_USB_PRICTRL 0x40c /* NOTE: big-endian */
35#define FSL_SOC_USB_SICTRL 0x410 /* NOTE: big-endian */ 35#define FSL_SOC_USB_SICTRL 0x410 /* NOTE: big-endian */
36#define FSL_SOC_USB_CTRL 0x500 /* NOTE: big-endian */ 36#define FSL_SOC_USB_CTRL 0x500 /* NOTE: big-endian */
37#define SNOOP_SIZE_2GB 0x1e
37#endif /* _EHCI_FSL_H */ 38#endif /* _EHCI_FSL_H */
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index 79705609fd0c..ca62cb583221 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -137,7 +137,7 @@ static const struct pci_device_id ohci_pci_quirks[] = {
137 /* Toshiba portege 4000 */ 137 /* Toshiba portege 4000 */
138 .vendor = PCI_VENDOR_ID_AL, 138 .vendor = PCI_VENDOR_ID_AL,
139 .device = 0x5237, 139 .device = 0x5237,
140 .subvendor = PCI_VENDOR_ID_TOSHIBA_2, 140 .subvendor = PCI_VENDOR_ID_TOSHIBA,
141 .subdevice = 0x0004, 141 .subdevice = 0x0004,
142 .driver_data = (unsigned long) broken_suspend, 142 .driver_data = (unsigned long) broken_suspend,
143 }, 143 },
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 20861650905e..c225159ca3d3 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -44,6 +44,7 @@
44#define EHCI_USBSTS 4 /* status register */ 44#define EHCI_USBSTS 4 /* status register */
45#define EHCI_USBSTS_HALTED (1 << 12) /* HCHalted bit */ 45#define EHCI_USBSTS_HALTED (1 << 12) /* HCHalted bit */
46#define EHCI_USBINTR 8 /* interrupt register */ 46#define EHCI_USBINTR 8 /* interrupt register */
47#define EHCI_CONFIGFLAG 0x40 /* configured flag register */
47#define EHCI_USBLEGSUP 0 /* legacy support register */ 48#define EHCI_USBLEGSUP 0 /* legacy support register */
48#define EHCI_USBLEGSUP_BIOS (1 << 16) /* BIOS semaphore */ 49#define EHCI_USBLEGSUP_BIOS (1 << 16) /* BIOS semaphore */
49#define EHCI_USBLEGSUP_OS (1 << 24) /* OS semaphore */ 50#define EHCI_USBLEGSUP_OS (1 << 24) /* OS semaphore */
@@ -216,6 +217,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
216 u32 hcc_params, val; 217 u32 hcc_params, val;
217 u8 offset, cap_length; 218 u8 offset, cap_length;
218 int count = 256/4; 219 int count = 256/4;
220 int tried_handoff = 0;
219 221
220 if (!mmio_resource_enabled(pdev, 0)) 222 if (!mmio_resource_enabled(pdev, 0))
221 return; 223 return;
@@ -273,6 +275,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
273 */ 275 */
274 msec = 5000; 276 msec = 5000;
275 while ((cap & EHCI_USBLEGSUP_BIOS) && (msec > 0)) { 277 while ((cap & EHCI_USBLEGSUP_BIOS) && (msec > 0)) {
278 tried_handoff = 1;
276 msleep(10); 279 msleep(10);
277 msec -= 10; 280 msec -= 10;
278 pci_read_config_dword(pdev, offset, &cap); 281 pci_read_config_dword(pdev, offset, &cap);
@@ -292,6 +295,12 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
292 pci_write_config_dword(pdev, 295 pci_write_config_dword(pdev,
293 offset + EHCI_USBLEGCTLSTS, 296 offset + EHCI_USBLEGCTLSTS,
294 0); 297 0);
298
299 /* If the BIOS ever owned the controller then we
300 * can't expect any power sessions to remain intact.
301 */
302 if (tried_handoff)
303 writel(0, op_reg_base + EHCI_CONFIGFLAG);
295 break; 304 break;
296 case 0: /* illegal reserved capability */ 305 case 0: /* illegal reserved capability */
297 cap = 0; 306 cap = 0;
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index ff0dba01f1c7..e98df2ee9901 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -57,6 +57,13 @@
57#include <asm/system.h> 57#include <asm/system.h>
58#include <asm/byteorder.h> 58#include <asm/byteorder.h>
59#include "../core/hcd.h" 59#include "../core/hcd.h"
60
61 /* FIXME ohci.h is ONLY for internal use by the OHCI driver.
62 * If you're going to try stuff like this, you need to split
63 * out shareable stuff (register declarations?) into its own
64 * file, maybe name <linux/usb/ohci.h>
65 */
66
60#include "ohci.h" 67#include "ohci.h"
61#define OHCI_CONTROL_INIT OHCI_CTRL_CBSR 68#define OHCI_CONTROL_INIT OHCI_CTRL_CBSR
62#define OHCI_INTR_INIT (OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | \ 69#define OHCI_INTR_INIT (OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | \
@@ -173,11 +180,6 @@ struct u132_ring {
173 struct u132_endp *curr_endp; 180 struct u132_endp *curr_endp;
174 struct delayed_work scheduler; 181 struct delayed_work scheduler;
175}; 182};
176#define OHCI_QUIRK_AMD756 0x01
177#define OHCI_QUIRK_SUPERIO 0x02
178#define OHCI_QUIRK_INITRESET 0x04
179#define OHCI_BIG_ENDIAN 0x08
180#define OHCI_QUIRK_ZFMICRO 0x10
181struct u132 { 183struct u132 {
182 struct kref kref; 184 struct kref kref;
183 struct list_head u132_list; 185 struct list_head u132_list;
diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
index 88fb56d5db8f..cac1500cba62 100644
--- a/drivers/usb/misc/auerswald.c
+++ b/drivers/usb/misc/auerswald.c
@@ -1822,16 +1822,10 @@ static int auerchar_release (struct inode *inode, struct file *file)
1822 pauerswald_t cp; 1822 pauerswald_t cp;
1823 dbg("release"); 1823 dbg("release");
1824 1824
1825 /* get the mutexes */ 1825 down(&ccp->mutex);
1826 if (down_interruptible (&ccp->mutex)) {
1827 return -ERESTARTSYS;
1828 }
1829 cp = ccp->auerdev; 1826 cp = ccp->auerdev;
1830 if (cp) { 1827 if (cp) {
1831 if (down_interruptible (&cp->mutex)) { 1828 down(&cp->mutex);
1832 up (&ccp->mutex);
1833 return -ERESTARTSYS;
1834 }
1835 /* remove an open service */ 1829 /* remove an open service */
1836 auerswald_removeservice (cp, &ccp->scontext); 1830 auerswald_removeservice (cp, &ccp->scontext);
1837 /* detach from device */ 1831 /* detach from device */
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index e2172e5cf152..e0f122e131d7 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -73,6 +73,13 @@ static struct list_head ftdi_static_list;
73#include "usb_u132.h" 73#include "usb_u132.h"
74#include <asm/io.h> 74#include <asm/io.h>
75#include "../core/hcd.h" 75#include "../core/hcd.h"
76
77 /* FIXME ohci.h is ONLY for internal use by the OHCI driver.
78 * If you're going to try stuff like this, you need to split
79 * out shareable stuff (register declarations?) into its own
80 * file, maybe name <linux/usb/ohci.h>
81 */
82
76#include "../host/ohci.h" 83#include "../host/ohci.h"
77/* Define these values to match your devices*/ 84/* Define these values to match your devices*/
78#define USB_FTDI_ELAN_VENDOR_ID 0x0403 85#define USB_FTDI_ELAN_VENDOR_ID 0x0403
@@ -2300,10 +2307,7 @@ static int ftdi_elan_checkingPCI(struct usb_ftdi *ftdi)
2300 offsetof(struct ohci_regs, member), 0, data); 2307 offsetof(struct ohci_regs, member), 0, data);
2301#define ftdi_write_pcimem(ftdi, member, data) ftdi_elan_write_pcimem(ftdi, \ 2308#define ftdi_write_pcimem(ftdi, member, data) ftdi_elan_write_pcimem(ftdi, \
2302 offsetof(struct ohci_regs, member), 0, data); 2309 offsetof(struct ohci_regs, member), 0, data);
2303#define OHCI_QUIRK_AMD756 0x01 2310
2304#define OHCI_QUIRK_SUPERIO 0x02
2305#define OHCI_QUIRK_INITRESET 0x04
2306#define OHCI_BIG_ENDIAN 0x08
2307#define OHCI_CONTROL_INIT OHCI_CTRL_CBSR 2311#define OHCI_CONTROL_INIT OHCI_CTRL_CBSR
2308#define OHCI_INTR_INIT (OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | \ 2312#define OHCI_INTR_INIT (OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | \
2309 OHCI_INTR_WDH) 2313 OHCI_INTR_WDH)
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 11555bde655b..7bad49404762 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -165,6 +165,8 @@ struct ld_usb {
165 size_t interrupt_in_endpoint_size; 165 size_t interrupt_in_endpoint_size;
166 int interrupt_in_running; 166 int interrupt_in_running;
167 int interrupt_in_done; 167 int interrupt_in_done;
168 int buffer_overflow;
169 spinlock_t rbsl;
168 170
169 char* interrupt_out_buffer; 171 char* interrupt_out_buffer;
170 struct usb_endpoint_descriptor* interrupt_out_endpoint; 172 struct usb_endpoint_descriptor* interrupt_out_endpoint;
@@ -230,10 +232,12 @@ static void ld_usb_interrupt_in_callback(struct urb *urb)
230 } else { 232 } else {
231 dbg_info(&dev->intf->dev, "%s: nonzero status received: %d\n", 233 dbg_info(&dev->intf->dev, "%s: nonzero status received: %d\n",
232 __FUNCTION__, urb->status); 234 __FUNCTION__, urb->status);
235 spin_lock(&dev->rbsl);
233 goto resubmit; /* maybe we can recover */ 236 goto resubmit; /* maybe we can recover */
234 } 237 }
235 } 238 }
236 239
240 spin_lock(&dev->rbsl);
237 if (urb->actual_length > 0) { 241 if (urb->actual_length > 0) {
238 next_ring_head = (dev->ring_head+1) % ring_buffer_size; 242 next_ring_head = (dev->ring_head+1) % ring_buffer_size;
239 if (next_ring_head != dev->ring_tail) { 243 if (next_ring_head != dev->ring_tail) {
@@ -244,21 +248,25 @@ static void ld_usb_interrupt_in_callback(struct urb *urb)
244 dev->ring_head = next_ring_head; 248 dev->ring_head = next_ring_head;
245 dbg_info(&dev->intf->dev, "%s: received %d bytes\n", 249 dbg_info(&dev->intf->dev, "%s: received %d bytes\n",
246 __FUNCTION__, urb->actual_length); 250 __FUNCTION__, urb->actual_length);
247 } else 251 } else {
248 dev_warn(&dev->intf->dev, 252 dev_warn(&dev->intf->dev,
249 "Ring buffer overflow, %d bytes dropped\n", 253 "Ring buffer overflow, %d bytes dropped\n",
250 urb->actual_length); 254 urb->actual_length);
255 dev->buffer_overflow = 1;
256 }
251 } 257 }
252 258
253resubmit: 259resubmit:
254 /* resubmit if we're still running */ 260 /* resubmit if we're still running */
255 if (dev->interrupt_in_running && dev->intf) { 261 if (dev->interrupt_in_running && !dev->buffer_overflow && dev->intf) {
256 retval = usb_submit_urb(dev->interrupt_in_urb, GFP_ATOMIC); 262 retval = usb_submit_urb(dev->interrupt_in_urb, GFP_ATOMIC);
257 if (retval) 263 if (retval) {
258 dev_err(&dev->intf->dev, 264 dev_err(&dev->intf->dev,
259 "usb_submit_urb failed (%d)\n", retval); 265 "usb_submit_urb failed (%d)\n", retval);
266 dev->buffer_overflow = 1;
267 }
260 } 268 }
261 269 spin_unlock(&dev->rbsl);
262exit: 270exit:
263 dev->interrupt_in_done = 1; 271 dev->interrupt_in_done = 1;
264 wake_up_interruptible(&dev->read_wait); 272 wake_up_interruptible(&dev->read_wait);
@@ -330,6 +338,7 @@ static int ld_usb_open(struct inode *inode, struct file *file)
330 /* initialize in direction */ 338 /* initialize in direction */
331 dev->ring_head = 0; 339 dev->ring_head = 0;
332 dev->ring_tail = 0; 340 dev->ring_tail = 0;
341 dev->buffer_overflow = 0;
333 usb_fill_int_urb(dev->interrupt_in_urb, 342 usb_fill_int_urb(dev->interrupt_in_urb,
334 interface_to_usbdev(interface), 343 interface_to_usbdev(interface),
335 usb_rcvintpipe(interface_to_usbdev(interface), 344 usb_rcvintpipe(interface_to_usbdev(interface),
@@ -439,6 +448,7 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,
439 size_t *actual_buffer; 448 size_t *actual_buffer;
440 size_t bytes_to_read; 449 size_t bytes_to_read;
441 int retval = 0; 450 int retval = 0;
451 int rv;
442 452
443 dev = file->private_data; 453 dev = file->private_data;
444 454
@@ -460,7 +470,10 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,
460 } 470 }
461 471
462 /* wait for data */ 472 /* wait for data */
473 spin_lock_irq(&dev->rbsl);
463 if (dev->ring_head == dev->ring_tail) { 474 if (dev->ring_head == dev->ring_tail) {
475 dev->interrupt_in_done = 0;
476 spin_unlock_irq(&dev->rbsl);
464 if (file->f_flags & O_NONBLOCK) { 477 if (file->f_flags & O_NONBLOCK) {
465 retval = -EAGAIN; 478 retval = -EAGAIN;
466 goto unlock_exit; 479 goto unlock_exit;
@@ -468,6 +481,8 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,
468 retval = wait_event_interruptible(dev->read_wait, dev->interrupt_in_done); 481 retval = wait_event_interruptible(dev->read_wait, dev->interrupt_in_done);
469 if (retval < 0) 482 if (retval < 0)
470 goto unlock_exit; 483 goto unlock_exit;
484 } else {
485 spin_unlock_irq(&dev->rbsl);
471 } 486 }
472 487
473 /* actual_buffer contains actual_length + interrupt_in_buffer */ 488 /* actual_buffer contains actual_length + interrupt_in_buffer */
@@ -486,6 +501,17 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,
486 501
487 retval = bytes_to_read; 502 retval = bytes_to_read;
488 503
504 spin_lock_irq(&dev->rbsl);
505 if (dev->buffer_overflow) {
506 dev->buffer_overflow = 0;
507 spin_unlock_irq(&dev->rbsl);
508 rv = usb_submit_urb(dev->interrupt_in_urb, GFP_KERNEL);
509 if (rv < 0)
510 dev->buffer_overflow = 1;
511 } else {
512 spin_unlock_irq(&dev->rbsl);
513 }
514
489unlock_exit: 515unlock_exit:
490 /* unlock the device */ 516 /* unlock the device */
491 up(&dev->sem); 517 up(&dev->sem);
@@ -635,6 +661,7 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id *
635 goto exit; 661 goto exit;
636 } 662 }
637 init_MUTEX(&dev->sem); 663 init_MUTEX(&dev->sem);
664 spin_lock_init(&dev->rbsl);
638 dev->intf = intf; 665 dev->intf = intf;
639 init_waitqueue_head(&dev->read_wait); 666 init_waitqueue_head(&dev->read_wait);
640 init_waitqueue_head(&dev->write_wait); 667 init_waitqueue_head(&dev->write_wait);
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index ea2175bb2274..fe437125f14b 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -63,7 +63,8 @@ static inline void ARK3116_RCV(struct usb_serial *serial, int seq,
63 request, requesttype, value, index, 63 request, requesttype, value, index,
64 buf, 0x0000001, 1000); 64 buf, 0x0000001, 1000);
65 if (result) 65 if (result)
66 dbg("%03d < %d bytes [0x%02X]", seq, result, buf[0]); 66 dbg("%03d < %d bytes [0x%02X]", seq, result,
67 ((unsigned char *)buf)[0]);
67 else 68 else
68 dbg("%03d < 0 bytes", seq); 69 dbg("%03d < 0 bytes", seq);
69} 70}
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 95a1805b064f..2353679f601e 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -273,12 +273,18 @@ static __u16 product;
273 273
274/* struct ftdi_sio_quirk is used by devices requiring special attention. */ 274/* struct ftdi_sio_quirk is used by devices requiring special attention. */
275struct ftdi_sio_quirk { 275struct ftdi_sio_quirk {
276 int (*probe)(struct usb_serial *);
276 void (*setup)(struct usb_serial *); /* Special settings during startup. */ 277 void (*setup)(struct usb_serial *); /* Special settings during startup. */
277}; 278};
278 279
280static int ftdi_olimex_probe (struct usb_serial *serial);
279static void ftdi_USB_UIRT_setup (struct usb_serial *serial); 281static void ftdi_USB_UIRT_setup (struct usb_serial *serial);
280static void ftdi_HE_TIRA1_setup (struct usb_serial *serial); 282static void ftdi_HE_TIRA1_setup (struct usb_serial *serial);
281 283
284static struct ftdi_sio_quirk ftdi_olimex_quirk = {
285 .probe = ftdi_olimex_probe,
286};
287
282static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { 288static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
283 .setup = ftdi_USB_UIRT_setup, 289 .setup = ftdi_USB_UIRT_setup,
284}; 290};
@@ -319,6 +325,7 @@ static struct usb_device_id id_table_combined [] = {
319 { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, 325 { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) },
320 { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, 326 { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) },
321 { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, 327 { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) },
328 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) },
322 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, 329 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
323 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, 330 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
324 { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, 331 { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) },
@@ -525,6 +532,9 @@ static struct usb_device_id id_table_combined [] = {
525 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, 532 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) },
526 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 533 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) },
527 { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 534 { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
535 { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) },
536 { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID),
537 .driver_info = (kernel_ulong_t)&ftdi_olimex_quirk },
528 { }, /* Optional parameter entry */ 538 { }, /* Optional parameter entry */
529 { } /* Terminating entry */ 539 { } /* Terminating entry */
530}; 540};
@@ -669,7 +679,7 @@ static struct usb_serial_driver ftdi_sio_device = {
669 679
670/* 680/*
671 * *************************************************************************** 681 * ***************************************************************************
672 * Utlity functions 682 * Utility functions
673 * *************************************************************************** 683 * ***************************************************************************
674 */ 684 */
675 685
@@ -1171,9 +1181,17 @@ static void remove_sysfs_attrs(struct usb_serial_port *port)
1171/* Probe function to check for special devices */ 1181/* Probe function to check for special devices */
1172static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id) 1182static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id)
1173{ 1183{
1184 struct ftdi_sio_quirk *quirk = (struct ftdi_sio_quirk *)id->driver_info;
1185
1186 if (quirk && quirk->probe) {
1187 int ret = quirk->probe(serial);
1188 if (ret != 0)
1189 return ret;
1190 }
1191
1174 usb_set_serial_data(serial, (void *)id->driver_info); 1192 usb_set_serial_data(serial, (void *)id->driver_info);
1175 1193
1176 return (0); 1194 return 0;
1177} 1195}
1178 1196
1179static int ftdi_sio_port_probe(struct usb_serial_port *port) 1197static int ftdi_sio_port_probe(struct usb_serial_port *port)
@@ -1268,6 +1286,24 @@ static void ftdi_HE_TIRA1_setup (struct usb_serial *serial)
1268 priv->force_rtscts = 1; 1286 priv->force_rtscts = 1;
1269} /* ftdi_HE_TIRA1_setup */ 1287} /* ftdi_HE_TIRA1_setup */
1270 1288
1289/*
1290 * First port on Olimex arm-usb-ocd is reserved for JTAG interface
1291 * and can be accessed from userspace using openocd.
1292 */
1293static int ftdi_olimex_probe(struct usb_serial *serial)
1294{
1295 struct usb_device *udev = serial->dev;
1296 struct usb_interface *interface = serial->interface;
1297
1298 dbg("%s",__FUNCTION__);
1299
1300 if (interface == udev->actconfig->interface[0]) {
1301 info("Ignoring reserved serial port on Olimex arm-usb-ocd\n");
1302 return -ENODEV;
1303 }
1304
1305 return 0;
1306}
1271 1307
1272/* ftdi_shutdown is called from usbserial:usb_serial_disconnect 1308/* ftdi_shutdown is called from usbserial:usb_serial_disconnect
1273 * it is called when the usb device is disconnected 1309 * it is called when the usb device is disconnected
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index 77ad0a09b384..33aee9047242 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -60,6 +60,9 @@
60/* DMX4ALL DMX Interfaces */ 60/* DMX4ALL DMX Interfaces */
61#define FTDI_DMX4ALL 0xC850 61#define FTDI_DMX4ALL 0xC850
62 62
63/* OpenDCC (www.opendcc.de) product id */
64#define FTDI_OPENDCC_PID 0xBFD8
65
63/* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */ 66/* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */
64/* they use the ftdi chipset for the USB interface and the vendor id is the same */ 67/* they use the ftdi chipset for the USB interface and the vendor id is the same */
65#define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */ 68#define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */
@@ -518,6 +521,15 @@
518#define FTDI_IBS_PEDO_PID 0xff3e /* IBS PEDO-Modem (RF modem 868.35 MHz) */ 521#define FTDI_IBS_PEDO_PID 0xff3e /* IBS PEDO-Modem (RF modem 868.35 MHz) */
519#define FTDI_IBS_PROD_PID 0xff3f /* future device */ 522#define FTDI_IBS_PROD_PID 0xff3f /* future device */
520 523
524/*
525 * MaxStream devices www.maxstream.net
526 */
527#define FTDI_MAXSTREAM_PID 0xEE18 /* Xbee PKG-U Module */
528
529/* Olimex */
530#define OLIMEX_VID 0x15BA
531#define OLIMEX_ARM_USB_OCD_PID 0x0003
532
521/* Commands */ 533/* Commands */
522#define FTDI_SIO_RESET 0 /* Reset the port */ 534#define FTDI_SIO_RESET 0 /* Reset the port */
523#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ 535#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 2366e7b63ece..36620c651079 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -769,11 +769,6 @@ static void mos7840_bulk_out_data_callback(struct urb *urb)
769 return; 769 return;
770 } 770 }
771 771
772 if (!mos7840_port) {
773 dbg("%s", "NULL mos7840_port pointer \n");
774 return;
775 }
776
777 if (mos7840_port_paranoia_check(mos7840_port->port, __FUNCTION__)) { 772 if (mos7840_port_paranoia_check(mos7840_port->port, __FUNCTION__)) {
778 dbg("%s", "Port Paranoia failed \n"); 773 dbg("%s", "Port Paranoia failed \n");
779 return; 774 return;
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 4adfab988e86..00afc1712c39 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -165,12 +165,10 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
165{ 165{
166 struct usb_serial *serial = port->serial; 166 struct usb_serial *serial = port->serial;
167 struct usb_serial_port *wport; 167 struct usb_serial_port *wport;
168 struct omninet_data *od = usb_get_serial_port_data(port);
169 int result = 0; 168 int result = 0;
170 169
171 dbg("%s - port %d", __FUNCTION__, port->number); 170 dbg("%s - port %d", __FUNCTION__, port->number);
172 171
173 od = kmalloc( sizeof(struct omninet_data), GFP_KERNEL );
174 wport = serial->port[1]; 172 wport = serial->port[1];
175 wport->tty = port->tty; 173 wport->tty = port->tty;
176 174
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 8c3f55b080b4..89f067d95076 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -165,7 +165,6 @@ static struct usb_device_id option_ids[] = {
165 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1410) }, /* Novatel U740 */ 165 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1410) }, /* Novatel U740 */
166 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1420) }, /* Novatel EU870 */ 166 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1420) }, /* Novatel EU870 */
167 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */ 167 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */
168 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel XU870 */
169 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2100) }, /* Novatel EV620 CDMA/EV-DO */ 168 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2100) }, /* Novatel EV620 CDMA/EV-DO */
170 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ 169 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */
171 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ 170 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 644607de4c11..ac1829c6e8f0 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -35,6 +35,7 @@ static struct usb_device_id id_table [] = {
35 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ 35 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
36 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ 36 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
37 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ 37 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
38 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless AirCard 595U */
38 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ 39 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
39 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ 40 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
40 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ 41 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
@@ -60,6 +61,7 @@ static struct usb_device_id id_table_3port [] = {
60 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ 61 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
61 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ 62 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
62 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ 63 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
64 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless AirCard 595U */
63 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ 65 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
64 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ 66 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
65 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ 67 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
index 6d3dad3d1dae..d35369392fed 100644
--- a/drivers/usb/storage/onetouch.c
+++ b/drivers/usb/storage/onetouch.c
@@ -84,7 +84,7 @@ resubmit:
84 84
85static int usb_onetouch_open(struct input_dev *dev) 85static int usb_onetouch_open(struct input_dev *dev)
86{ 86{
87 struct usb_onetouch *onetouch = dev->private; 87 struct usb_onetouch *onetouch = input_get_drvdata(dev);
88 88
89 onetouch->is_open = 1; 89 onetouch->is_open = 1;
90 onetouch->irq->dev = onetouch->udev; 90 onetouch->irq->dev = onetouch->udev;
@@ -98,7 +98,7 @@ static int usb_onetouch_open(struct input_dev *dev)
98 98
99static void usb_onetouch_close(struct input_dev *dev) 99static void usb_onetouch_close(struct input_dev *dev)
100{ 100{
101 struct usb_onetouch *onetouch = dev->private; 101 struct usb_onetouch *onetouch = input_get_drvdata(dev);
102 102
103 usb_kill_urb(onetouch->irq); 103 usb_kill_urb(onetouch->irq);
104 onetouch->is_open = 0; 104 onetouch->is_open = 0;
@@ -185,13 +185,14 @@ int onetouch_connect_input(struct us_data *ss)
185 input_dev->name = onetouch->name; 185 input_dev->name = onetouch->name;
186 input_dev->phys = onetouch->phys; 186 input_dev->phys = onetouch->phys;
187 usb_to_input_id(udev, &input_dev->id); 187 usb_to_input_id(udev, &input_dev->id);
188 input_dev->cdev.dev = &udev->dev; 188 input_dev->dev.parent = &udev->dev;
189 189
190 set_bit(EV_KEY, input_dev->evbit); 190 set_bit(EV_KEY, input_dev->evbit);
191 set_bit(ONETOUCH_BUTTON, input_dev->keybit); 191 set_bit(ONETOUCH_BUTTON, input_dev->keybit);
192 clear_bit(0, input_dev->keybit); 192 clear_bit(0, input_dev->keybit);
193 193
194 input_dev->private = onetouch; 194 input_set_drvdata(input_dev, onetouch);
195
195 input_dev->open = usb_onetouch_open; 196 input_dev->open = usb_onetouch_open;
196 input_dev->close = usb_onetouch_close; 197 input_dev->close = usb_onetouch_close;
197 198
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 8b3145ab7757..d230ee72f9cd 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1179,14 +1179,20 @@ UNUSUAL_DEV( 0x0a17, 0x006, 0x0000, 0xffff,
1179 US_SC_DEVICE, US_PR_DEVICE, NULL, 1179 US_SC_DEVICE, US_PR_DEVICE, NULL,
1180 US_FL_FIX_INQUIRY ), 1180 US_FL_FIX_INQUIRY ),
1181 1181
1182/* This is a virtual windows driver CD, which the zd1211rw driver automatically 1182/* These are virtual windows driver CDs, which the zd1211rw driver automatically
1183 * converts into a WLAN device. */ 1183 * converts into a WLAN devices. */
1184UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101, 1184UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101,
1185 "ZyXEL", 1185 "ZyXEL",
1186 "G-220F USB-WLAN Install", 1186 "G-220F USB-WLAN Install",
1187 US_SC_DEVICE, US_PR_DEVICE, NULL, 1187 US_SC_DEVICE, US_PR_DEVICE, NULL,
1188 US_FL_IGNORE_DEVICE ), 1188 US_FL_IGNORE_DEVICE ),
1189 1189
1190UNUSUAL_DEV( 0x0ace, 0x20ff, 0x0101, 0x0101,
1191 "SiteCom",
1192 "WL-117 USB-WLAN Install",
1193 US_SC_DEVICE, US_PR_DEVICE, NULL,
1194 US_FL_IGNORE_DEVICE ),
1195
1190#ifdef CONFIG_USB_STORAGE_ISD200 1196#ifdef CONFIG_USB_STORAGE_ISD200
1191UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, 1197UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110,
1192 "ATI", 1198 "ATI",
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 4d7485fa553f..6e1f1ea21b38 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -704,6 +704,91 @@ config FB_CG6
704 This is the frame buffer device driver for the CGsix (GX, TurboGX) 704 This is the frame buffer device driver for the CGsix (GX, TurboGX)
705 frame buffer. 705 frame buffer.
706 706
707config FB_FFB
708 bool "Creator/Creator3D/Elite3D support"
709 depends on FB_SBUS && SPARC64
710 select FB_CFB_COPYAREA
711 select FB_CFB_IMAGEBLIT
712 help
713 This is the frame buffer device driver for the Creator, Creator3D,
714 and Elite3D graphics boards.
715
716config FB_TCX
717 bool "TCX (SS4/SS5 only) support"
718 depends on FB_SBUS
719 select FB_CFB_FILLRECT
720 select FB_CFB_COPYAREA
721 select FB_CFB_IMAGEBLIT
722 help
723 This is the frame buffer device driver for the TCX 24/8bit frame
724 buffer.
725
726config FB_CG14
727 bool "CGfourteen (SX) support"
728 depends on FB_SBUS
729 select FB_CFB_FILLRECT
730 select FB_CFB_COPYAREA
731 select FB_CFB_IMAGEBLIT
732 help
733 This is the frame buffer device driver for the CGfourteen frame
734 buffer on Desktop SPARCsystems with the SX graphics option.
735
736config FB_P9100
737 bool "P9100 (Sparcbook 3 only) support"
738 depends on FB_SBUS
739 select FB_CFB_FILLRECT
740 select FB_CFB_COPYAREA
741 select FB_CFB_IMAGEBLIT
742 help
743 This is the frame buffer device driver for the P9100 card
744 supported on Sparcbook 3 machines.
745
746config FB_LEO
747 bool "Leo (ZX) support"
748 depends on FB_SBUS
749 select FB_CFB_FILLRECT
750 select FB_CFB_COPYAREA
751 select FB_CFB_IMAGEBLIT
752 help
753 This is the frame buffer device driver for the SBUS-based Sun ZX
754 (leo) frame buffer cards.
755
756config FB_IGA
757 bool "IGA 168x display support"
758 depends on FB && SPARC32
759 select FB_CFB_FILLRECT
760 select FB_CFB_COPYAREA
761 select FB_CFB_IMAGEBLIT
762 help
763 This is the framebuffer device for the INTERGRAPHICS 1680 and
764 successor frame buffer cards.
765
766config FB_XVR500
767 bool "Sun XVR-500 3DLABS Wildcat support"
768 depends on FB && PCI && SPARC64
769 select FB_CFB_FILLRECT
770 select FB_CFB_COPYAREA
771 select FB_CFB_IMAGEBLIT
772 help
773 This is the framebuffer device for the Sun XVR-500 and similar
774 graphics cards based upon the 3DLABS Wildcat chipset. The driver
775 only works on sparc64 systems where the system firwmare has
776 mostly initialized the card already. It is treated as a
777 completely dumb framebuffer device.
778
779config FB_XVR2500
780 bool "Sun XVR-2500 3DLABS Wildcat support"
781 depends on FB && PCI && SPARC64
782 select FB_CFB_FILLRECT
783 select FB_CFB_COPYAREA
784 select FB_CFB_IMAGEBLIT
785 help
786 This is the framebuffer device for the Sun XVR-2500 and similar
787 graphics cards based upon the 3DLABS Wildcat chipset. The driver
788 only works on sparc64 systems where the system firwmare has
789 mostly initialized the card already. It is treated as a
790 completely dumb framebuffer device.
791
707config FB_PVR2 792config FB_PVR2
708 tristate "NEC PowerVR 2 display support" 793 tristate "NEC PowerVR 2 display support"
709 depends on FB && SH_DREAMCAST 794 depends on FB && SH_DREAMCAST
@@ -1195,7 +1280,7 @@ config FB_ATY
1195config FB_ATY_CT 1280config FB_ATY_CT
1196 bool "Mach64 CT/VT/GT/LT (incl. 3D RAGE) support" 1281 bool "Mach64 CT/VT/GT/LT (incl. 3D RAGE) support"
1197 depends on PCI && FB_ATY 1282 depends on PCI && FB_ATY
1198 default y if SPARC64 && FB_PCI 1283 default y if SPARC64 && PCI
1199 help 1284 help
1200 Say Y here to support use of ATI's 64-bit Rage boards (or other 1285 Say Y here to support use of ATI's 64-bit Rage boards (or other
1201 boards based on the Mach64 CT, VT, GT, and LT chipsets) as a 1286 boards based on the Mach64 CT, VT, GT, and LT chipsets) as a
@@ -1484,95 +1569,6 @@ config FB_AU1200
1484 1569
1485source "drivers/video/geode/Kconfig" 1570source "drivers/video/geode/Kconfig"
1486 1571
1487config FB_FFB
1488 bool "Creator/Creator3D/Elite3D support"
1489 depends on FB_SBUS && SPARC64
1490 select FB_CFB_COPYAREA
1491 select FB_CFB_IMAGEBLIT
1492 help
1493 This is the frame buffer device driver for the Creator, Creator3D,
1494 and Elite3D graphics boards.
1495
1496config FB_TCX
1497 bool "TCX (SS4/SS5 only) support"
1498 depends on FB_SBUS
1499 select FB_CFB_FILLRECT
1500 select FB_CFB_COPYAREA
1501 select FB_CFB_IMAGEBLIT
1502 help
1503 This is the frame buffer device driver for the TCX 24/8bit frame
1504 buffer.
1505
1506config FB_CG14
1507 bool "CGfourteen (SX) support"
1508 depends on FB_SBUS
1509 select FB_CFB_FILLRECT
1510 select FB_CFB_COPYAREA
1511 select FB_CFB_IMAGEBLIT
1512 help
1513 This is the frame buffer device driver for the CGfourteen frame
1514 buffer on Desktop SPARCsystems with the SX graphics option.
1515
1516config FB_P9100
1517 bool "P9100 (Sparcbook 3 only) support"
1518 depends on FB_SBUS
1519 select FB_CFB_FILLRECT
1520 select FB_CFB_COPYAREA
1521 select FB_CFB_IMAGEBLIT
1522 help
1523 This is the frame buffer device driver for the P9100 card
1524 supported on Sparcbook 3 machines.
1525
1526config FB_LEO
1527 bool "Leo (ZX) support"
1528 depends on FB_SBUS
1529 select FB_CFB_FILLRECT
1530 select FB_CFB_COPYAREA
1531 select FB_CFB_IMAGEBLIT
1532 help
1533 This is the frame buffer device driver for the SBUS-based Sun ZX
1534 (leo) frame buffer cards.
1535
1536config FB_XVR500
1537 bool "Sun XVR-500 3DLABS Wildcat support"
1538 depends on (FB = y) && PCI && SPARC64
1539 select FB_CFB_FILLRECT
1540 select FB_CFB_COPYAREA
1541 select FB_CFB_IMAGEBLIT
1542 help
1543 This is the framebuffer device for the Sun XVR-500 and similar
1544 graphics cards based upon the 3DLABS Wildcat chipset. The driver
1545 only works on sparc64 systems where the system firwmare has
1546 mostly initialized the card already. It is treated as a
1547 completely dumb framebuffer device.
1548
1549config FB_XVR2500
1550 bool "Sun XVR-2500 3DLABS Wildcat support"
1551 depends on (FB = y) && PCI && SPARC64
1552 select FB_CFB_FILLRECT
1553 select FB_CFB_COPYAREA
1554 select FB_CFB_IMAGEBLIT
1555 help
1556 This is the framebuffer device for the Sun XVR-2500 and similar
1557 graphics cards based upon the 3DLABS Wildcat chipset. The driver
1558 only works on sparc64 systems where the system firwmare has
1559 mostly initialized the card already. It is treated as a
1560 completely dumb framebuffer device.
1561
1562config FB_PCI
1563 bool "PCI framebuffers"
1564 depends on (FB = y) && PCI && SPARC
1565
1566config FB_IGA
1567 bool "IGA 168x display support"
1568 depends on SPARC32 && FB_PCI
1569 select FB_CFB_FILLRECT
1570 select FB_CFB_COPYAREA
1571 select FB_CFB_IMAGEBLIT
1572 help
1573 This is the framebuffer device for the INTERGRAPHICS 1680 and
1574 successor frame buffer cards.
1575
1576config FB_HIT 1572config FB_HIT
1577 tristate "HD64461 Frame Buffer support" 1573 tristate "HD64461 Frame Buffer support"
1578 depends on FB && HD64461 1574 depends on FB && HD64461
@@ -1796,9 +1792,10 @@ config FB_IBM_GXT4500
1796config FB_PS3 1792config FB_PS3
1797 bool "PS3 GPU framebuffer driver" 1793 bool "PS3 GPU framebuffer driver"
1798 depends on (FB = y) && PS3_PS3AV 1794 depends on (FB = y) && PS3_PS3AV
1799 select FB_CFB_FILLRECT 1795 select FB_SYS_FILLRECT
1800 select FB_CFB_COPYAREA 1796 select FB_SYS_COPYAREA
1801 select FB_CFB_IMAGEBLIT 1797 select FB_SYS_IMAGEBLIT
1798 select FB_SYS_FOPS
1802 ---help--- 1799 ---help---
1803 Include support for the virtual frame buffer in the PS3 platform. 1800 Include support for the virtual frame buffer in the PS3 platform.
1804 1801
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c
index ba6fede5c466..8a1b07c74394 100644
--- a/drivers/video/arkfb.c
+++ b/drivers/video/arkfb.c
@@ -1055,9 +1055,10 @@ err_enable_device:
1055static void __devexit ark_pci_remove(struct pci_dev *dev) 1055static void __devexit ark_pci_remove(struct pci_dev *dev)
1056{ 1056{
1057 struct fb_info *info = pci_get_drvdata(dev); 1057 struct fb_info *info = pci_get_drvdata(dev);
1058 struct arkfb_info *par = info->par;
1059 1058
1060 if (info) { 1059 if (info) {
1060 struct arkfb_info *par = info->par;
1061
1061#ifdef CONFIG_MTRR 1062#ifdef CONFIG_MTRR
1062 if (par->mtrr_reg >= 0) { 1063 if (par->mtrr_reg >= 0) {
1063 mtrr_del(par->mtrr_reg, 0, 0); 1064 mtrr_del(par->mtrr_reg, 0, 0);
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 71f24e00fcd0..8e6ef4bc7a5c 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -176,7 +176,6 @@ extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info);
176#endif 176#endif
177extern void fbcon_set_bitops(struct fbcon_ops *ops); 177extern void fbcon_set_bitops(struct fbcon_ops *ops);
178extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); 178extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor);
179extern struct class *fb_class;
180 179
181#define FBCON_ATTRIBUTE_UNDERLINE 1 180#define FBCON_ATTRIBUTE_UNDERLINE 1
182#define FBCON_ATTRIBUTE_REVERSE 2 181#define FBCON_ATTRIBUTE_REVERSE 2
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 267c1ff9ebd9..a12589898597 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -394,26 +394,18 @@ static void imxfb_setup_gpio(struct imxfb_info *fbi)
394 394
395 /* initialize GPIOs */ 395 /* initialize GPIOs */
396 imx_gpio_mode(PD6_PF_LSCLK); 396 imx_gpio_mode(PD6_PF_LSCLK);
397 imx_gpio_mode(PD10_PF_SPL_SPR);
398 imx_gpio_mode(PD11_PF_CONTRAST); 397 imx_gpio_mode(PD11_PF_CONTRAST);
399 imx_gpio_mode(PD14_PF_FLM_VSYNC); 398 imx_gpio_mode(PD14_PF_FLM_VSYNC);
400 imx_gpio_mode(PD13_PF_LP_HSYNC); 399 imx_gpio_mode(PD13_PF_LP_HSYNC);
401 imx_gpio_mode(PD7_PF_REV);
402 imx_gpio_mode(PD8_PF_CLS);
403
404#ifndef CONFIG_MACH_PIMX1
405 /* on PiMX1 used as buffers enable signal
406 */
407 imx_gpio_mode(PD9_PF_PS);
408#endif
409
410#ifndef CONFIG_MACH_MX1FS2
411 /* on mx1fs2 this pin is used to (de)activate the display, so we need
412 * it as a normal gpio
413 */
414 imx_gpio_mode(PD12_PF_ACD_OE); 400 imx_gpio_mode(PD12_PF_ACD_OE);
415#endif
416 401
402 /* These are only needed for Sharp HR TFT displays */
403 if (fbi->pcr & PCR_SHARP) {
404 imx_gpio_mode(PD7_PF_REV);
405 imx_gpio_mode(PD8_PF_CLS);
406 imx_gpio_mode(PD9_PF_PS);
407 imx_gpio_mode(PD10_PF_SPL_SPR);
408 }
417} 409}
418 410
419#ifdef CONFIG_PM 411#ifdef CONFIG_PM
@@ -476,7 +468,6 @@ static int __init imxfb_init_fbinfo(struct device *dev)
476 468
477 info->fbops = &imxfb_ops; 469 info->fbops = &imxfb_ops;
478 info->flags = FBINFO_FLAG_DEFAULT; 470 info->flags = FBINFO_FLAG_DEFAULT;
479 info->pseudo_palette = (fbi + 1);
480 471
481 fbi->rgb[RGB_16] = &def_rgb_16; 472 fbi->rgb[RGB_16] = &def_rgb_16;
482 fbi->rgb[RGB_8] = &def_rgb_8; 473 fbi->rgb[RGB_8] = &def_rgb_8;
@@ -499,6 +490,7 @@ static int __init imxfb_init_fbinfo(struct device *dev)
499 info->var.sync = inf->sync; 490 info->var.sync = inf->sync;
500 info->var.grayscale = inf->cmap_greyscale; 491 info->var.grayscale = inf->cmap_greyscale;
501 fbi->cmap_inverse = inf->cmap_inverse; 492 fbi->cmap_inverse = inf->cmap_inverse;
493 fbi->cmap_static = inf->cmap_static;
502 fbi->pcr = inf->pcr; 494 fbi->pcr = inf->pcr;
503 fbi->lscr1 = inf->lscr1; 495 fbi->lscr1 = inf->lscr1;
504 fbi->dmacr = inf->dmacr; 496 fbi->dmacr = inf->dmacr;
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index bd30aba242d0..731d7a5c5aa2 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -1286,34 +1286,36 @@ static int neofb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
1286 if (regno >= fb->cmap.len || regno > 255) 1286 if (regno >= fb->cmap.len || regno > 255)
1287 return -EINVAL; 1287 return -EINVAL;
1288 1288
1289 switch (fb->var.bits_per_pixel) { 1289 if (fb->var.bits_per_pixel <= 8) {
1290 case 8:
1291 outb(regno, 0x3c8); 1290 outb(regno, 0x3c8);
1292 1291
1293 outb(red >> 10, 0x3c9); 1292 outb(red >> 10, 0x3c9);
1294 outb(green >> 10, 0x3c9); 1293 outb(green >> 10, 0x3c9);
1295 outb(blue >> 10, 0x3c9); 1294 outb(blue >> 10, 0x3c9);
1296 break; 1295 } else if (regno < 16) {
1297 case 16: 1296 switch (fb->var.bits_per_pixel) {
1298 ((u32 *) fb->pseudo_palette)[regno] = 1297 case 16:
1298 ((u32 *) fb->pseudo_palette)[regno] =
1299 ((red & 0xf800)) | ((green & 0xfc00) >> 5) | 1299 ((red & 0xf800)) | ((green & 0xfc00) >> 5) |
1300 ((blue & 0xf800) >> 11); 1300 ((blue & 0xf800) >> 11);
1301 break; 1301 break;
1302 case 24: 1302 case 24:
1303 ((u32 *) fb->pseudo_palette)[regno] = 1303 ((u32 *) fb->pseudo_palette)[regno] =
1304 ((red & 0xff00) << 8) | ((green & 0xff00)) | 1304 ((red & 0xff00) << 8) | ((green & 0xff00)) |
1305 ((blue & 0xff00) >> 8); 1305 ((blue & 0xff00) >> 8);
1306 break; 1306 break;
1307#ifdef NO_32BIT_SUPPORT_YET 1307#ifdef NO_32BIT_SUPPORT_YET
1308 case 32: 1308 case 32:
1309 ((u32 *) fb->pseudo_palette)[regno] = 1309 ((u32 *) fb->pseudo_palette)[regno] =
1310 ((transp & 0xff00) << 16) | ((red & 0xff00) << 8) | 1310 ((transp & 0xff00) << 16) | ((red & 0xff00) << 8) |
1311 ((green & 0xff00)) | ((blue & 0xff00) >> 8); 1311 ((green & 0xff00)) | ((blue & 0xff00) >> 8);
1312 break; 1312 break;
1313#endif 1313#endif
1314 default: 1314 default:
1315 return 1; 1315 return 1;
1316 }
1316 } 1317 }
1318
1317 return 0; 1319 return 0;
1318} 1320}
1319 1321
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index ab5e66890e4e..0a04483aa3e0 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -183,15 +183,17 @@ static inline void pm2_RDAC_WR(struct pm2fb_par* p, s32 idx, u32 v)
183 index = PM2VR_RD_INDEXED_DATA; 183 index = PM2VR_RD_INDEXED_DATA;
184 break; 184 break;
185 } 185 }
186 mb(); 186 wmb();
187 pm2_WR(p, index, v); 187 pm2_WR(p, index, v);
188 wmb();
188} 189}
189 190
190static inline void pm2v_RDAC_WR(struct pm2fb_par* p, s32 idx, u32 v) 191static inline void pm2v_RDAC_WR(struct pm2fb_par* p, s32 idx, u32 v)
191{ 192{
192 pm2_WR(p, PM2VR_RD_INDEX_LOW, idx & 0xff); 193 pm2_WR(p, PM2VR_RD_INDEX_LOW, idx & 0xff);
193 mb(); 194 wmb();
194 pm2_WR(p, PM2VR_RD_INDEXED_DATA, v); 195 pm2_WR(p, PM2VR_RD_INDEXED_DATA, v);
196 wmb();
195} 197}
196 198
197#ifdef CONFIG_FB_PM2_FIFO_DISCONNECT 199#ifdef CONFIG_FB_PM2_FIFO_DISCONNECT
@@ -466,11 +468,9 @@ static void set_memclock(struct pm2fb_par* par, u32 clk)
466 WAIT_FIFO(par, 8); 468 WAIT_FIFO(par, 8);
467 pm2_WR(par, PM2VR_RD_INDEX_HIGH, PM2VI_RD_MCLK_CONTROL >> 8); 469 pm2_WR(par, PM2VR_RD_INDEX_HIGH, PM2VI_RD_MCLK_CONTROL >> 8);
468 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_CONTROL, 0); 470 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_CONTROL, 0);
469 wmb();
470 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_PRESCALE, m); 471 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_PRESCALE, m);
471 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_FEEDBACK, n); 472 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_FEEDBACK, n);
472 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_POSTSCALE, p); 473 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_POSTSCALE, p);
473 wmb();
474 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_CONTROL, 1); 474 pm2v_RDAC_WR(par, PM2VI_RD_MCLK_CONTROL, 1);
475 rmb(); 475 rmb();
476 for (i = 256; 476 for (i = 256;
@@ -483,12 +483,9 @@ static void set_memclock(struct pm2fb_par* par, u32 clk)
483 pm2_mnp(clk, &m, &n, &p); 483 pm2_mnp(clk, &m, &n, &p);
484 WAIT_FIFO(par, 10); 484 WAIT_FIFO(par, 10);
485 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_3, 6); 485 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_3, 6);
486 wmb();
487 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_1, m); 486 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_1, m);
488 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_2, n); 487 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_2, n);
489 wmb();
490 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_3, 8|p); 488 pm2_RDAC_WR(par, PM2I_RD_MEMORY_CLOCK_3, 8|p);
491 wmb();
492 pm2_RDAC_RD(par, PM2I_RD_MEMORY_CLOCK_STATUS); 489 pm2_RDAC_RD(par, PM2I_RD_MEMORY_CLOCK_STATUS);
493 rmb(); 490 rmb();
494 for (i = 256; 491 for (i = 256;
@@ -509,12 +506,9 @@ static void set_pixclock(struct pm2fb_par* par, u32 clk)
509 pm2_mnp(clk, &m, &n, &p); 506 pm2_mnp(clk, &m, &n, &p);
510 WAIT_FIFO(par, 8); 507 WAIT_FIFO(par, 8);
511 pm2_RDAC_WR(par, PM2I_RD_PIXEL_CLOCK_A3, 0); 508 pm2_RDAC_WR(par, PM2I_RD_PIXEL_CLOCK_A3, 0);
512 wmb();
513 pm2_RDAC_WR(par, PM2I_RD_PIXEL_CLOCK_A1, m); 509 pm2_RDAC_WR(par, PM2I_RD_PIXEL_CLOCK_A1, m);
514 pm2_RDAC_WR(par, PM2I_RD_PIXEL_CLOCK_A2, n); 510 pm2_RDAC_WR(par, PM2I_RD_PIXEL_CLOCK_A2, n);
515 wmb();
516 pm2_RDAC_WR(par, PM2I_RD_PIXEL_CLOCK_A3, 8|p); 511 pm2_RDAC_WR(par, PM2I_RD_PIXEL_CLOCK_A3, 8|p);
517 wmb();
518 pm2_RDAC_RD(par, PM2I_RD_PIXEL_CLOCK_STATUS); 512 pm2_RDAC_RD(par, PM2I_RD_PIXEL_CLOCK_STATUS);
519 rmb(); 513 rmb();
520 for (i = 256; 514 for (i = 256;
@@ -1066,10 +1060,9 @@ static void pm2fb_block_op(struct fb_info* info, int copy,
1066 1060
1067 if (!w || !h) 1061 if (!w || !h)
1068 return; 1062 return;
1069 WAIT_FIFO(par, 6); 1063 WAIT_FIFO(par, 5);
1070 pm2_WR(par, PM2R_CONFIG, PM2F_CONFIG_FB_WRITE_ENABLE | 1064 pm2_WR(par, PM2R_CONFIG, PM2F_CONFIG_FB_WRITE_ENABLE |
1071 PM2F_CONFIG_FB_READ_SOURCE_ENABLE); 1065 PM2F_CONFIG_FB_READ_SOURCE_ENABLE);
1072 pm2_WR(par, PM2R_FB_PIXEL_OFFSET, 0);
1073 if (copy) 1066 if (copy)
1074 pm2_WR(par, PM2R_FB_SOURCE_DELTA, 1067 pm2_WR(par, PM2R_FB_SOURCE_DELTA,
1075 ((ysrc-y) & 0xfff) << 16 | ((xsrc-x) & 0xfff)); 1068 ((ysrc-y) & 0xfff) << 16 | ((xsrc-x) & 0xfff));
diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
index c77a1a1fd46b..b52e883f0a52 100644
--- a/drivers/video/pm3fb.c
+++ b/drivers/video/pm3fb.c
@@ -52,11 +52,6 @@
52static char *mode_option __devinitdata; 52static char *mode_option __devinitdata;
53 53
54/* 54/*
55 * If your driver supports multiple boards, you should make the
56 * below data types arrays, or allocate them dynamically (using kmalloc()).
57 */
58
59/*
60 * This structure defines the hardware state of the graphics card. Normally 55 * This structure defines the hardware state of the graphics card. Normally
61 * you place this in a header file in linux/include/video. This file usually 56 * you place this in a header file in linux/include/video. This file usually
62 * also includes register information. That allows other driver subsystems 57 * also includes register information. That allows other driver subsystems
@@ -67,7 +62,7 @@ struct pm3_par {
67 unsigned char __iomem *v_regs;/* virtual address of p_regs */ 62 unsigned char __iomem *v_regs;/* virtual address of p_regs */
68 u32 video; /* video flags before blanking */ 63 u32 video; /* video flags before blanking */
69 u32 base; /* screen base (xoffset+yoffset) in 128 bits unit */ 64 u32 base; /* screen base (xoffset+yoffset) in 128 bits unit */
70 u32 palette[16]; 65 u32 palette[16];
71}; 66};
72 67
73/* 68/*
@@ -104,36 +99,28 @@ static inline void PM3_WAIT(struct pm3_par *par, u32 n)
104 while (PM3_READ_REG(par, PM3InFIFOSpace) < n); 99 while (PM3_READ_REG(par, PM3InFIFOSpace) < n);
105} 100}
106 101
107static inline void PM3_SLOW_WRITE_REG(struct pm3_par *par, s32 off, u32 v)
108{
109 if (par->v_regs) {
110 mb();
111 PM3_WAIT(par, 1);
112 wmb();
113 PM3_WRITE_REG(par, off, v);
114 }
115}
116
117static inline void PM3_SET_INDEX(struct pm3_par *par, unsigned index)
118{
119 PM3_SLOW_WRITE_REG(par, PM3RD_IndexHigh, (index >> 8) & 0xff);
120 PM3_SLOW_WRITE_REG(par, PM3RD_IndexLow, index & 0xff);
121}
122
123static inline void PM3_WRITE_DAC_REG(struct pm3_par *par, unsigned r, u8 v) 102static inline void PM3_WRITE_DAC_REG(struct pm3_par *par, unsigned r, u8 v)
124{ 103{
125 PM3_SET_INDEX(par, r); 104 PM3_WAIT(par, 3);
105 PM3_WRITE_REG(par, PM3RD_IndexHigh, (r >> 8) & 0xff);
106 PM3_WRITE_REG(par, PM3RD_IndexLow, r & 0xff);
126 wmb(); 107 wmb();
127 PM3_WRITE_REG(par, PM3RD_IndexedData, v); 108 PM3_WRITE_REG(par, PM3RD_IndexedData, v);
109 wmb();
128} 110}
129 111
130static inline void pm3fb_set_color(struct pm3_par *par, unsigned char regno, 112static inline void pm3fb_set_color(struct pm3_par *par, unsigned char regno,
131 unsigned char r, unsigned char g, unsigned char b) 113 unsigned char r, unsigned char g, unsigned char b)
132{ 114{
133 PM3_SLOW_WRITE_REG(par, PM3RD_PaletteWriteAddress, regno); 115 PM3_WAIT(par, 4);
134 PM3_SLOW_WRITE_REG(par, PM3RD_PaletteData, r); 116 PM3_WRITE_REG(par, PM3RD_PaletteWriteAddress, regno);
135 PM3_SLOW_WRITE_REG(par, PM3RD_PaletteData, g); 117 wmb();
136 PM3_SLOW_WRITE_REG(par, PM3RD_PaletteData, b); 118 PM3_WRITE_REG(par, PM3RD_PaletteData, r);
119 wmb();
120 PM3_WRITE_REG(par, PM3RD_PaletteData, g);
121 wmb();
122 PM3_WRITE_REG(par, PM3RD_PaletteData, b);
123 wmb();
137} 124}
138 125
139static void pm3fb_clear_colormap(struct pm3_par *par, 126static void pm3fb_clear_colormap(struct pm3_par *par,
@@ -141,7 +128,7 @@ static void pm3fb_clear_colormap(struct pm3_par *par,
141{ 128{
142 int i; 129 int i;
143 130
144 for (i = 0; i < 256 ; i++) /* fill color map with white */ 131 for (i = 0; i < 256 ; i++)
145 pm3fb_set_color(par, i, r, g, b); 132 pm3fb_set_color(par, i, r, g, b);
146 133
147} 134}
@@ -175,19 +162,26 @@ static void pm3fb_calculate_clock(unsigned long reqclock,
175 } 162 }
176} 163}
177 164
178static inline int pm3fb_shift_bpp(unsigned long depth, int v) 165static inline int pm3fb_depth(const struct fb_var_screeninfo *var)
179{ 166{
180 switch (depth) { 167 if ( var->bits_per_pixel == 16 )
168 return var->red.length + var->green.length
169 + var->blue.length;
170
171 return var->bits_per_pixel;
172}
173
174static inline int pm3fb_shift_bpp(unsigned bpp, int v)
175{
176 switch (bpp) {
181 case 8: 177 case 8:
182 return (v >> 4); 178 return (v >> 4);
183 case 12:
184 case 15:
185 case 16: 179 case 16:
186 return (v >> 3); 180 return (v >> 3);
187 case 32: 181 case 32:
188 return (v >> 2); 182 return (v >> 2);
189 } 183 }
190 DPRINTK("Unsupported depth %ld\n", depth); 184 DPRINTK("Unsupported depth %u\n", bpp);
191 return 0; 185 return 0;
192} 186}
193 187
@@ -206,56 +200,50 @@ static void pm3fb_write_mode(struct fb_info *info)
206 const u32 vbend = vsend + info->var.upper_margin; 200 const u32 vbend = vsend + info->var.upper_margin;
207 const u32 vtotal = info->var.yres + vbend; 201 const u32 vtotal = info->var.yres + vbend;
208 const u32 width = (info->var.xres_virtual + 7) & ~7; 202 const u32 width = (info->var.xres_virtual + 7) & ~7;
209 203 const unsigned bpp = info->var.bits_per_pixel;
210 PM3_SLOW_WRITE_REG(par, PM3MemBypassWriteMask, 0xffffffff); 204
211 PM3_SLOW_WRITE_REG(par, PM3Aperture0, 0x00000000); 205 PM3_WAIT(par, 20);
212 PM3_SLOW_WRITE_REG(par, PM3Aperture1, 0x00000000); 206 PM3_WRITE_REG(par, PM3MemBypassWriteMask, 0xffffffff);
213 PM3_SLOW_WRITE_REG(par, PM3FIFODis, 0x00000007); 207 PM3_WRITE_REG(par, PM3Aperture0, 0x00000000);
214 208 PM3_WRITE_REG(par, PM3Aperture1, 0x00000000);
215 PM3_SLOW_WRITE_REG(par, PM3HTotal, 209 PM3_WRITE_REG(par, PM3FIFODis, 0x00000007);
216 pm3fb_shift_bpp(info->var.bits_per_pixel, 210
217 htotal - 1)); 211 PM3_WRITE_REG(par, PM3HTotal,
218 PM3_SLOW_WRITE_REG(par, PM3HsEnd, 212 pm3fb_shift_bpp(bpp, htotal - 1));
219 pm3fb_shift_bpp(info->var.bits_per_pixel, 213 PM3_WRITE_REG(par, PM3HsEnd,
220 hsend)); 214 pm3fb_shift_bpp(bpp, hsend));
221 PM3_SLOW_WRITE_REG(par, PM3HsStart, 215 PM3_WRITE_REG(par, PM3HsStart,
222 pm3fb_shift_bpp(info->var.bits_per_pixel, 216 pm3fb_shift_bpp(bpp, hsstart));
223 hsstart)); 217 PM3_WRITE_REG(par, PM3HbEnd,
224 PM3_SLOW_WRITE_REG(par, PM3HbEnd, 218 pm3fb_shift_bpp(bpp, hbend));
225 pm3fb_shift_bpp(info->var.bits_per_pixel, 219 PM3_WRITE_REG(par, PM3HgEnd,
226 hbend)); 220 pm3fb_shift_bpp(bpp, hbend));
227 PM3_SLOW_WRITE_REG(par, PM3HgEnd, 221 PM3_WRITE_REG(par, PM3ScreenStride,
228 pm3fb_shift_bpp(info->var.bits_per_pixel, 222 pm3fb_shift_bpp(bpp, width));
229 hbend)); 223 PM3_WRITE_REG(par, PM3VTotal, vtotal - 1);
230 PM3_SLOW_WRITE_REG(par, PM3ScreenStride, 224 PM3_WRITE_REG(par, PM3VsEnd, vsend - 1);
231 pm3fb_shift_bpp(info->var.bits_per_pixel, 225 PM3_WRITE_REG(par, PM3VsStart, vsstart - 1);
232 width)); 226 PM3_WRITE_REG(par, PM3VbEnd, vbend);
233 PM3_SLOW_WRITE_REG(par, PM3VTotal, vtotal - 1); 227
234 PM3_SLOW_WRITE_REG(par, PM3VsEnd, vsend - 1); 228 switch (bpp) {
235 PM3_SLOW_WRITE_REG(par, PM3VsStart, vsstart - 1);
236 PM3_SLOW_WRITE_REG(par, PM3VbEnd, vbend);
237
238 switch (info->var.bits_per_pixel) {
239 case 8: 229 case 8:
240 PM3_SLOW_WRITE_REG(par, PM3ByAperture1Mode, 230 PM3_WRITE_REG(par, PM3ByAperture1Mode,
241 PM3ByApertureMode_PIXELSIZE_8BIT); 231 PM3ByApertureMode_PIXELSIZE_8BIT);
242 PM3_SLOW_WRITE_REG(par, PM3ByAperture2Mode, 232 PM3_WRITE_REG(par, PM3ByAperture2Mode,
243 PM3ByApertureMode_PIXELSIZE_8BIT); 233 PM3ByApertureMode_PIXELSIZE_8BIT);
244 break; 234 break;
245 235
246 case 12:
247 case 15:
248 case 16: 236 case 16:
249#ifndef __BIG_ENDIAN 237#ifndef __BIG_ENDIAN
250 PM3_SLOW_WRITE_REG(par, PM3ByAperture1Mode, 238 PM3_WRITE_REG(par, PM3ByAperture1Mode,
251 PM3ByApertureMode_PIXELSIZE_16BIT); 239 PM3ByApertureMode_PIXELSIZE_16BIT);
252 PM3_SLOW_WRITE_REG(par, PM3ByAperture2Mode, 240 PM3_WRITE_REG(par, PM3ByAperture2Mode,
253 PM3ByApertureMode_PIXELSIZE_16BIT); 241 PM3ByApertureMode_PIXELSIZE_16BIT);
254#else 242#else
255 PM3_SLOW_WRITE_REG(par, PM3ByAperture1Mode, 243 PM3_WRITE_REG(par, PM3ByAperture1Mode,
256 PM3ByApertureMode_PIXELSIZE_16BIT | 244 PM3ByApertureMode_PIXELSIZE_16BIT |
257 PM3ByApertureMode_BYTESWAP_BADC); 245 PM3ByApertureMode_BYTESWAP_BADC);
258 PM3_SLOW_WRITE_REG(par, PM3ByAperture2Mode, 246 PM3_WRITE_REG(par, PM3ByAperture2Mode,
259 PM3ByApertureMode_PIXELSIZE_16BIT | 247 PM3ByApertureMode_PIXELSIZE_16BIT |
260 PM3ByApertureMode_BYTESWAP_BADC); 248 PM3ByApertureMode_BYTESWAP_BADC);
261#endif /* ! __BIG_ENDIAN */ 249#endif /* ! __BIG_ENDIAN */
@@ -263,23 +251,22 @@ static void pm3fb_write_mode(struct fb_info *info)
263 251
264 case 32: 252 case 32:
265#ifndef __BIG_ENDIAN 253#ifndef __BIG_ENDIAN
266 PM3_SLOW_WRITE_REG(par, PM3ByAperture1Mode, 254 PM3_WRITE_REG(par, PM3ByAperture1Mode,
267 PM3ByApertureMode_PIXELSIZE_32BIT); 255 PM3ByApertureMode_PIXELSIZE_32BIT);
268 PM3_SLOW_WRITE_REG(par, PM3ByAperture2Mode, 256 PM3_WRITE_REG(par, PM3ByAperture2Mode,
269 PM3ByApertureMode_PIXELSIZE_32BIT); 257 PM3ByApertureMode_PIXELSIZE_32BIT);
270#else 258#else
271 PM3_SLOW_WRITE_REG(par, PM3ByAperture1Mode, 259 PM3_WRITE_REG(par, PM3ByAperture1Mode,
272 PM3ByApertureMode_PIXELSIZE_32BIT | 260 PM3ByApertureMode_PIXELSIZE_32BIT |
273 PM3ByApertureMode_BYTESWAP_DCBA); 261 PM3ByApertureMode_BYTESWAP_DCBA);
274 PM3_SLOW_WRITE_REG(par, PM3ByAperture2Mode, 262 PM3_WRITE_REG(par, PM3ByAperture2Mode,
275 PM3ByApertureMode_PIXELSIZE_32BIT | 263 PM3ByApertureMode_PIXELSIZE_32BIT |
276 PM3ByApertureMode_BYTESWAP_DCBA); 264 PM3ByApertureMode_BYTESWAP_DCBA);
277#endif /* ! __BIG_ENDIAN */ 265#endif /* ! __BIG_ENDIAN */
278 break; 266 break;
279 267
280 default: 268 default:
281 DPRINTK("Unsupported depth %d\n", 269 DPRINTK("Unsupported depth %d\n", bpp);
282 info->var.bits_per_pixel);
283 break; 270 break;
284 } 271 }
285 272
@@ -296,14 +283,15 @@ static void pm3fb_write_mode(struct fb_info *info)
296 PM3VideoControl_VSYNC_MASK); 283 PM3VideoControl_VSYNC_MASK);
297 video |= PM3VideoControl_HSYNC_ACTIVE_HIGH | 284 video |= PM3VideoControl_HSYNC_ACTIVE_HIGH |
298 PM3VideoControl_VSYNC_ACTIVE_HIGH; 285 PM3VideoControl_VSYNC_ACTIVE_HIGH;
299 PM3_SLOW_WRITE_REG(par, PM3VideoControl, video); 286 PM3_WRITE_REG(par, PM3VideoControl, video);
300 } 287 }
301 PM3_SLOW_WRITE_REG(par, PM3VClkCtl, 288 PM3_WRITE_REG(par, PM3VClkCtl,
302 (PM3_READ_REG(par, PM3VClkCtl) & 0xFFFFFFFC)); 289 (PM3_READ_REG(par, PM3VClkCtl) & 0xFFFFFFFC));
303 PM3_SLOW_WRITE_REG(par, PM3ScreenBase, par->base); 290 PM3_WRITE_REG(par, PM3ScreenBase, par->base);
304 PM3_SLOW_WRITE_REG(par, PM3ChipConfig, 291 PM3_WRITE_REG(par, PM3ChipConfig,
305 (PM3_READ_REG(par, PM3ChipConfig) & 0xFFFFFFFD)); 292 (PM3_READ_REG(par, PM3ChipConfig) & 0xFFFFFFFD));
306 293
294 wmb();
307 { 295 {
308 unsigned char uninitialized_var(m); /* ClkPreScale */ 296 unsigned char uninitialized_var(m); /* ClkPreScale */
309 unsigned char uninitialized_var(n); /* ClkFeedBackScale */ 297 unsigned char uninitialized_var(n); /* ClkFeedBackScale */
@@ -337,7 +325,7 @@ static void pm3fb_write_mode(struct fb_info *info)
337 325
338 PM3_WRITE_DAC_REG(par, PM3RD_DACControl, 0x00); 326 PM3_WRITE_DAC_REG(par, PM3RD_DACControl, 0x00);
339 327
340 switch (info->var.bits_per_pixel) { 328 switch (pm3fb_depth(&info->var)) {
341 case 8: 329 case 8:
342 PM3_WRITE_DAC_REG(par, PM3RD_PixelSize, 330 PM3_WRITE_DAC_REG(par, PM3RD_PixelSize,
343 PM3RD_PixelSize_8_BIT_PIXELS); 331 PM3RD_PixelSize_8_BIT_PIXELS);
@@ -393,57 +381,44 @@ static void pm3fb_write_mode(struct fb_info *info)
393 * hardware independent functions 381 * hardware independent functions
394 */ 382 */
395int pm3fb_init(void); 383int pm3fb_init(void);
396int pm3fb_setup(char*);
397 384
398static int pm3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) 385static int pm3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
399{ 386{
400 u32 lpitch; 387 u32 lpitch;
388 unsigned bpp = var->red.length + var->green.length
389 + var->blue.length + var->transp.length;
401 390
402 var->transp.offset = 0; 391 if ( bpp != var->bits_per_pixel ) {
403 var->transp.length = 0; 392 /* set predefined mode for bits_per_pixel settings */
404 switch(var->bits_per_pixel) { 393
405 case 8: 394 switch(var->bits_per_pixel) {
406 var->red.length = var->green.length = var->blue.length = 8; 395 case 8:
407 var->red.offset = var->green.offset = var->blue.offset = 0; 396 var->red.length = var->green.length = var->blue.length = 8;
408 break; 397 var->red.offset = var->green.offset = var->blue.offset = 0;
409 case 12: 398 var->transp.offset = 0;
410 var->red.offset = 8; 399 var->transp.length = 0;
411 var->red.length = 4; 400 break;
412 var->green.offset = 4; 401 case 16:
413 var->green.length = 4; 402 var->red.length = var->blue.length = 5;
414 var->blue.offset = 0; 403 var->green.length = 6;
415 var->blue.length = 4; 404 var->transp.length = 0;
416 var->transp.offset = 12; 405 break;
417 var->transp.length = 4; 406 case 32:
418 case 15: 407 var->red.length = var->green.length = var->blue.length = 8;
419 var->red.offset = 10; 408 var->transp.length = 8;
420 var->red.length = 5; 409 break;
421 var->green.offset = 5; 410 default:
422 var->green.length = 5; 411 DPRINTK("depth not supported: %u\n", var->bits_per_pixel);
423 var->blue.offset = 0; 412 return -EINVAL;
424 var->blue.length = 5; 413 }
425 var->transp.offset = 15; 414 }
426 var->transp.length = 1; 415 /* it is assumed BGRA order */
427 break; 416 if (var->bits_per_pixel > 8 )
428 case 16: 417 {
429 var->red.offset = 11; 418 var->blue.offset = 0;
430 var->red.length = 5; 419 var->green.offset = var->blue.length;
431 var->green.offset = 5; 420 var->red.offset = var->green.offset + var->green.length;
432 var->green.length = 6; 421 var->transp.offset = var->red.offset + var->red.length;
433 var->blue.offset = 0;
434 var->blue.length = 5;
435 break;
436 case 32:
437 var->transp.offset = 24;
438 var->transp.length = 8;
439 var->red.offset = 16;
440 var->green.offset = 8;
441 var->blue.offset = 0;
442 var->red.length = var->green.length = var->blue.length = 8;
443 break;
444 default:
445 DPRINTK("depth not supported: %u\n", var->bits_per_pixel);
446 return -EINVAL;
447 } 422 }
448 var->height = var->width = -1; 423 var->height = var->width = -1;
449 424
@@ -502,10 +477,9 @@ static int pm3fb_set_par(struct fb_info *info)
502{ 477{
503 struct pm3_par *par = info->par; 478 struct pm3_par *par = info->par;
504 const u32 xres = (info->var.xres + 31) & ~31; 479 const u32 xres = (info->var.xres + 31) & ~31;
505 const int depth = (info->var.bits_per_pixel + 7) & ~7; 480 const unsigned bpp = info->var.bits_per_pixel;
506 481
507 par->base = pm3fb_shift_bpp(info->var.bits_per_pixel, 482 par->base = pm3fb_shift_bpp(bpp,(info->var.yoffset * xres)
508 (info->var.yoffset * xres)
509 + info->var.xoffset); 483 + info->var.xoffset);
510 par->video = 0; 484 par->video = 0;
511 485
@@ -524,18 +498,16 @@ static int pm3fb_set_par(struct fb_info *info)
524 else 498 else
525 par->video |= PM3VideoControl_LINE_DOUBLE_OFF; 499 par->video |= PM3VideoControl_LINE_DOUBLE_OFF;
526 500
527 if (info->var.activate == FB_ACTIVATE_NOW) 501 if ((info->var.activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW)
528 par->video |= PM3VideoControl_ENABLE; 502 par->video |= PM3VideoControl_ENABLE;
529 else { 503 else {
530 par->video |= PM3VideoControl_DISABLE; 504 par->video |= PM3VideoControl_DISABLE;
531 DPRINTK("PM3Video disabled\n"); 505 DPRINTK("PM3Video disabled\n");
532 } 506 }
533 switch (depth) { 507 switch (bpp) {
534 case 8: 508 case 8:
535 par->video |= PM3VideoControl_PIXELSIZE_8BIT; 509 par->video |= PM3VideoControl_PIXELSIZE_8BIT;
536 break; 510 break;
537 case 12:
538 case 15:
539 case 16: 511 case 16:
540 par->video |= PM3VideoControl_PIXELSIZE_16BIT; 512 par->video |= PM3VideoControl_PIXELSIZE_16BIT;
541 break; 513 break;
@@ -548,9 +520,9 @@ static int pm3fb_set_par(struct fb_info *info)
548 } 520 }
549 521
550 info->fix.visual = 522 info->fix.visual =
551 (depth == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; 523 (bpp == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
552 info->fix.line_length = ((info->var.xres_virtual + 7) & ~7) 524 info->fix.line_length = ((info->var.xres_virtual + 7) & ~7)
553 * depth / 8; 525 * bpp / 8;
554 526
555/* pm3fb_clear_memory(info, 0);*/ 527/* pm3fb_clear_memory(info, 0);*/
556 pm3fb_clear_colormap(par, 0, 0, 0); 528 pm3fb_clear_colormap(par, 0, 0, 0);
@@ -580,8 +552,8 @@ static int pm3fb_setcolreg(unsigned regno, unsigned red, unsigned green,
580 * var->{color}.length contains length of bitfield 552 * var->{color}.length contains length of bitfield
581 * {hardwarespecific} contains width of DAC 553 * {hardwarespecific} contains width of DAC
582 * pseudo_palette[X] is programmed to (X << red.offset) | 554 * pseudo_palette[X] is programmed to (X << red.offset) |
583 * (X << green.offset) | 555 * (X << green.offset) |
584 * (X << blue.offset) 556 * (X << blue.offset)
585 * RAMDAC[X] is programmed to (red, green, blue) 557 * RAMDAC[X] is programmed to (red, green, blue)
586 * color depth = SUM(var->{color}.length) 558 * color depth = SUM(var->{color}.length)
587 * 559 *
@@ -621,7 +593,6 @@ static int pm3fb_setcolreg(unsigned regno, unsigned red, unsigned green,
621 case 8: 593 case 8:
622 break; 594 break;
623 case 16: 595 case 16:
624 case 24:
625 case 32: 596 case 32:
626 ((u32*)(info->pseudo_palette))[regno] = v; 597 ((u32*)(info->pseudo_palette))[regno] = v;
627 break; 598 break;
@@ -643,7 +614,8 @@ static int pm3fb_pan_display(struct fb_var_screeninfo *var,
643 par->base = pm3fb_shift_bpp(var->bits_per_pixel, 614 par->base = pm3fb_shift_bpp(var->bits_per_pixel,
644 (var->yoffset * xres) 615 (var->yoffset * xres)
645 + var->xoffset); 616 + var->xoffset);
646 PM3_SLOW_WRITE_REG(par, PM3ScreenBase, par->base); 617 PM3_WAIT(par, 1);
618 PM3_WRITE_REG(par, PM3ScreenBase, par->base);
647 return 0; 619 return 0;
648} 620}
649 621
@@ -665,31 +637,31 @@ static int pm3fb_blank(int blank_mode, struct fb_info *info)
665 637
666 switch (blank_mode) { 638 switch (blank_mode) {
667 case FB_BLANK_UNBLANK: 639 case FB_BLANK_UNBLANK:
668 video = video | PM3VideoControl_ENABLE; 640 video |= PM3VideoControl_ENABLE;
669 break; 641 break;
670 case FB_BLANK_NORMAL: /* FIXME */ 642 case FB_BLANK_NORMAL:
671 video = video & ~(PM3VideoControl_ENABLE); 643 video &= ~(PM3VideoControl_ENABLE);
672 break; 644 break;
673 case FB_BLANK_HSYNC_SUSPEND: 645 case FB_BLANK_HSYNC_SUSPEND:
674 video = video & ~(PM3VideoControl_HSYNC_MASK | 646 video &= ~(PM3VideoControl_HSYNC_MASK |
675 PM3VideoControl_BLANK_ACTIVE_LOW); 647 PM3VideoControl_BLANK_ACTIVE_LOW);
676 break; 648 break;
677 case FB_BLANK_VSYNC_SUSPEND: 649 case FB_BLANK_VSYNC_SUSPEND:
678 video = video & ~(PM3VideoControl_VSYNC_MASK | 650 video &= ~(PM3VideoControl_VSYNC_MASK |
679 PM3VideoControl_BLANK_ACTIVE_LOW); 651 PM3VideoControl_BLANK_ACTIVE_LOW);
680 break; 652 break;
681 case FB_BLANK_POWERDOWN: 653 case FB_BLANK_POWERDOWN:
682 video = video & ~(PM3VideoControl_HSYNC_MASK | 654 video &= ~(PM3VideoControl_HSYNC_MASK |
683 PM3VideoControl_VSYNC_MASK | 655 PM3VideoControl_VSYNC_MASK |
684 PM3VideoControl_BLANK_ACTIVE_LOW); 656 PM3VideoControl_BLANK_ACTIVE_LOW);
685 break; 657 break;
686 default: 658 default:
687 DPRINTK("Unsupported blanking %d\n", blank_mode); 659 DPRINTK("Unsupported blanking %d\n", blank_mode);
688 return 1; 660 return 1;
689 } 661 }
690 662
691 PM3_SLOW_WRITE_REG(par,PM3VideoControl, video); 663 PM3_WAIT(par, 1);
692 664 PM3_WRITE_REG(par,PM3VideoControl, video);
693 return 0; 665 return 0;
694} 666}
695 667
@@ -703,9 +675,9 @@ static struct fb_ops pm3fb_ops = {
703 .fb_set_par = pm3fb_set_par, 675 .fb_set_par = pm3fb_set_par,
704 .fb_setcolreg = pm3fb_setcolreg, 676 .fb_setcolreg = pm3fb_setcolreg,
705 .fb_pan_display = pm3fb_pan_display, 677 .fb_pan_display = pm3fb_pan_display,
706 .fb_fillrect = cfb_fillrect, /* Needed !!! */ 678 .fb_fillrect = cfb_fillrect,
707 .fb_copyarea = cfb_copyarea, /* Needed !!! */ 679 .fb_copyarea = cfb_copyarea,
708 .fb_imageblit = cfb_imageblit, /* Needed !!! */ 680 .fb_imageblit = cfb_imageblit,
709 .fb_blank = pm3fb_blank, 681 .fb_blank = pm3fb_blank,
710}; 682};
711 683
@@ -722,7 +694,7 @@ static unsigned long pm3fb_size_memory(struct pm3_par *par)
722 unsigned long memsize = 0, tempBypass, i, temp1, temp2; 694 unsigned long memsize = 0, tempBypass, i, temp1, temp2;
723 unsigned char __iomem *screen_mem; 695 unsigned char __iomem *screen_mem;
724 696
725 pm3fb_fix.smem_len = 64 * 1024 * 1024; /* request full aperture size */ 697 pm3fb_fix.smem_len = 64 * 1024l * 1024; /* request full aperture size */
726 /* Linear frame buffer - request region and map it. */ 698 /* Linear frame buffer - request region and map it. */
727 if (!request_mem_region(pm3fb_fix.smem_start, pm3fb_fix.smem_len, 699 if (!request_mem_region(pm3fb_fix.smem_start, pm3fb_fix.smem_len,
728 "pm3fb smem")) { 700 "pm3fb smem")) {
@@ -744,7 +716,8 @@ static unsigned long pm3fb_size_memory(struct pm3_par *par)
744 716
745 DPRINTK("PM3MemBypassWriteMask was: 0x%08lx\n", tempBypass); 717 DPRINTK("PM3MemBypassWriteMask was: 0x%08lx\n", tempBypass);
746 718
747 PM3_SLOW_WRITE_REG(par, PM3MemBypassWriteMask, 0xFFFFFFFF); 719 PM3_WAIT(par, 1);
720 PM3_WRITE_REG(par, PM3MemBypassWriteMask, 0xFFFFFFFF);
748 721
749 /* pm3 split up memory, replicates, and do a lot of nasty stuff IMHO ;-) */ 722 /* pm3 split up memory, replicates, and do a lot of nasty stuff IMHO ;-) */
750 for (i = 0; i < 32; i++) { 723 for (i = 0; i < 32; i++) {
@@ -765,10 +738,9 @@ static unsigned long pm3fb_size_memory(struct pm3_par *par)
765 if (memsize + 1 == i) { 738 if (memsize + 1 == i) {
766 for (i = 0; i < 32; i++) { 739 for (i = 0; i < 32; i++) {
767 /* Clear first 32MB ; 0 is 0, no need to byteswap */ 740 /* Clear first 32MB ; 0 is 0, no need to byteswap */
768 writel(0x0000000, 741 writel(0x0000000, (screen_mem + (i * 1048576)));
769 (screen_mem + (i * 1048576)));
770 mb();
771 } 742 }
743 wmb();
772 744
773 for (i = 32; i < 64; i++) { 745 for (i = 32; i < 64; i++) {
774 fb_writel(i * 0x00345678, 746 fb_writel(i * 0x00345678,
@@ -787,7 +759,8 @@ static unsigned long pm3fb_size_memory(struct pm3_par *par)
787 } 759 }
788 DPRINTK("Second detect pass got %ld MB\n", memsize + 1); 760 DPRINTK("Second detect pass got %ld MB\n", memsize + 1);
789 761
790 PM3_SLOW_WRITE_REG(par, PM3MemBypassWriteMask, tempBypass); 762 PM3_WAIT(par, 1);
763 PM3_WRITE_REG(par, PM3MemBypassWriteMask, tempBypass);
791 764
792 iounmap(screen_mem); 765 iounmap(screen_mem);
793 release_mem_region(pm3fb_fix.smem_start, pm3fb_fix.smem_len); 766 release_mem_region(pm3fb_fix.smem_start, pm3fb_fix.smem_len);
@@ -890,7 +863,6 @@ static int __devinit pm3fb_probe(struct pci_dev *dev,
890 goto err_exit_both; 863 goto err_exit_both;
891 } 864 }
892 865
893 /* This has to been done !!! */
894 if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { 866 if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
895 retval = -ENOMEM; 867 retval = -ENOMEM;
896 goto err_exit_both; 868 goto err_exit_both;
@@ -907,7 +879,7 @@ static int __devinit pm3fb_probe(struct pci_dev *dev,
907 } 879 }
908 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, 880 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node,
909 info->fix.id); 881 info->fix.id);
910 pci_set_drvdata(dev, info); /* or dev_set_drvdata(device, info) */ 882 pci_set_drvdata(dev, info);
911 return 0; 883 return 0;
912 884
913 err_exit_all: 885 err_exit_all:
@@ -949,8 +921,7 @@ static void __devexit pm3fb_remove(struct pci_dev *dev)
949 921
950static struct pci_device_id pm3fb_id_table[] = { 922static struct pci_device_id pm3fb_id_table[] = {
951 { PCI_VENDOR_ID_3DLABS, 0x0a, 923 { PCI_VENDOR_ID_3DLABS, 0x0a,
952 PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16, 924 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
953 0xff0000, 0 },
954 { 0, } 925 { 0, }
955}; 926};
956 927
@@ -964,6 +935,22 @@ static struct pci_driver pm3fb_driver = {
964 935
965MODULE_DEVICE_TABLE(pci, pm3fb_id_table); 936MODULE_DEVICE_TABLE(pci, pm3fb_id_table);
966 937
938#ifndef MODULE
939 /*
940 * Setup
941 */
942
943/*
944 * Only necessary if your driver takes special options,
945 * otherwise we fall back on the generic fb_setup().
946 */
947static int __init pm3fb_setup(char *options)
948{
949 /* Parse user speficied options (`video=pm3fb:') */
950 return 0;
951}
952#endif /* MODULE */
953
967int __init pm3fb_init(void) 954int __init pm3fb_init(void)
968{ 955{
969 /* 956 /*
@@ -985,22 +972,6 @@ static void __exit pm3fb_exit(void)
985 pci_unregister_driver(&pm3fb_driver); 972 pci_unregister_driver(&pm3fb_driver);
986} 973}
987 974
988#ifndef MODULE
989 /*
990 * Setup
991 */
992
993/*
994 * Only necessary if your driver takes special options,
995 * otherwise we fall back on the generic fb_setup().
996 */
997int __init pm3fb_setup(char *options)
998{
999 /* Parse user speficied options (`video=pm3fb:') */
1000 return 0;
1001}
1002#endif /* MODULE */
1003
1004module_init(pm3fb_init); 975module_init(pm3fb_init);
1005module_exit(pm3fb_exit); 976module_exit(pm3fb_exit);
1006 977
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 9756a728b74f..9cf92ba5d6e3 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -951,12 +951,14 @@ static int ps3fb_xdr_settings(u64 xdr_lpar)
951static struct fb_ops ps3fb_ops = { 951static struct fb_ops ps3fb_ops = {
952 .fb_open = ps3fb_open, 952 .fb_open = ps3fb_open,
953 .fb_release = ps3fb_release, 953 .fb_release = ps3fb_release,
954 .fb_read = fb_sys_read,
955 .fb_write = fb_sys_write,
954 .fb_check_var = ps3fb_check_var, 956 .fb_check_var = ps3fb_check_var,
955 .fb_set_par = ps3fb_set_par, 957 .fb_set_par = ps3fb_set_par,
956 .fb_setcolreg = ps3fb_setcolreg, 958 .fb_setcolreg = ps3fb_setcolreg,
957 .fb_fillrect = cfb_fillrect, 959 .fb_fillrect = sys_fillrect,
958 .fb_copyarea = cfb_copyarea, 960 .fb_copyarea = sys_copyarea,
959 .fb_imageblit = cfb_imageblit, 961 .fb_imageblit = sys_imageblit,
960 .fb_mmap = ps3fb_mmap, 962 .fb_mmap = ps3fb_mmap,
961 .fb_blank = ps3fb_blank, 963 .fb_blank = ps3fb_blank,
962 .fb_ioctl = ps3fb_ioctl, 964 .fb_ioctl = ps3fb_ioctl,
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
index 836a612af977..64779e70408f 100644
--- a/drivers/video/skeletonfb.c
+++ b/drivers/video/skeletonfb.c
@@ -132,7 +132,6 @@ static struct fb_info info;
132static struct xxx_par __initdata current_par; 132static struct xxx_par __initdata current_par;
133 133
134int xxxfb_init(void); 134int xxxfb_init(void);
135int xxxfb_setup(char*);
136 135
137/** 136/**
138 * xxxfb_open - Optional function. Called when the framebuffer is 137 * xxxfb_open - Optional function. Called when the framebuffer is
@@ -975,6 +974,21 @@ static struct platform_device xxxfb_device = {
975 .name = "xxxfb", 974 .name = "xxxfb",
976}; 975};
977 976
977#ifndef MODULE
978 /*
979 * Setup
980 */
981
982/*
983 * Only necessary if your driver takes special options,
984 * otherwise we fall back on the generic fb_setup().
985 */
986int __init xxxfb_setup(char *options)
987{
988 /* Parse user speficied options (`video=xxxfb:') */
989}
990#endif /* MODULE */
991
978static int __init xxxfb_init(void) 992static int __init xxxfb_init(void)
979{ 993{
980 int ret; 994 int ret;
@@ -1006,21 +1020,6 @@ static void __exit xxxfb_exit(void)
1006} 1020}
1007#endif /* CONFIG_PCI */ 1021#endif /* CONFIG_PCI */
1008 1022
1009#ifdef MODULE
1010 /*
1011 * Setup
1012 */
1013
1014/*
1015 * Only necessary if your driver takes special options,
1016 * otherwise we fall back on the generic fb_setup().
1017 */
1018int __init xxxfb_setup(char *options)
1019{
1020 /* Parse user speficied options (`video=xxxfb:') */
1021}
1022#endif /* MODULE */
1023
1024/* ------------------------------------------------------------------------- */ 1023/* ------------------------------------------------------------------------- */
1025 1024
1026 1025
diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c
index 5e9755e464a1..30c0b948852b 100644
--- a/drivers/video/vt8623fb.c
+++ b/drivers/video/vt8623fb.c
@@ -778,9 +778,10 @@ err_enable_device:
778static void __devexit vt8623_pci_remove(struct pci_dev *dev) 778static void __devexit vt8623_pci_remove(struct pci_dev *dev)
779{ 779{
780 struct fb_info *info = pci_get_drvdata(dev); 780 struct fb_info *info = pci_get_drvdata(dev);
781 struct vt8623fb_info *par = info->par;
782 781
783 if (info) { 782 if (info) {
783 struct vt8623fb_info *par = info->par;
784
784#ifdef CONFIG_MTRR 785#ifdef CONFIG_MTRR
785 if (par->mtrr_reg >= 0) { 786 if (par->mtrr_reg >= 0) {
786 mtrr_del(par->mtrr_reg, 0, 0); 787 mtrr_del(par->mtrr_reg, 0, 0);
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index 5fc86ea20692..003c49a490eb 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -660,7 +660,7 @@ int __init w100fb_probe(struct platform_device *pdev)
660 err = -ENODEV; 660 err = -ENODEV;
661 goto out; 661 goto out;
662 } 662 }
663 printk(" at 0x%08lx.\n", mem->start+W100_CFG_BASE); 663 printk(" at 0x%08lx.\n", (unsigned long) mem->start+W100_CFG_BASE);
664 664
665 /* Remap the framebuffer */ 665 /* Remap the framebuffer */
666 remapped_fbuf = ioremap_nocache(mem->start+MEM_WINDOW_BASE, MEM_WINDOW_SIZE); 666 remapped_fbuf = ioremap_nocache(mem->start+MEM_WINDOW_BASE, MEM_WINDOW_SIZE);
@@ -753,10 +753,14 @@ int __init w100fb_probe(struct platform_device *pdev)
753 goto out; 753 goto out;
754 } 754 }
755 755
756 device_create_file(&pdev->dev, &dev_attr_fastpllclk); 756 err = device_create_file(&pdev->dev, &dev_attr_fastpllclk);
757 device_create_file(&pdev->dev, &dev_attr_reg_read); 757 err |= device_create_file(&pdev->dev, &dev_attr_reg_read);
758 device_create_file(&pdev->dev, &dev_attr_reg_write); 758 err |= device_create_file(&pdev->dev, &dev_attr_reg_write);
759 device_create_file(&pdev->dev, &dev_attr_flip); 759 err |= device_create_file(&pdev->dev, &dev_attr_flip);
760
761 if (err != 0)
762 printk(KERN_WARNING "fb%d: failed to register attributes (%d)\n",
763 info->node, err);
760 764
761 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); 765 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id);
762 return 0; 766 return 0;
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index 3128aa948a4e..9ac4ffe9ac7d 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -32,6 +32,7 @@
32#include <linux/inet.h> 32#include <linux/inet.h>
33#include <linux/pagemap.h> 33#include <linux/pagemap.h>
34#include <linux/idr.h> 34#include <linux/idr.h>
35#include <linux/sched.h>
35 36
36#include "debug.h" 37#include "debug.h"
37#include "v9fs.h" 38#include "v9fs.h"
diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c
index 775e26e82cbc..d93960429c09 100644
--- a/fs/9p/vfs_dentry.c
+++ b/fs/9p/vfs_dentry.c
@@ -33,6 +33,7 @@
33#include <linux/inet.h> 33#include <linux/inet.h>
34#include <linux/namei.h> 34#include <linux/namei.h>
35#include <linux/idr.h> 35#include <linux/idr.h>
36#include <linux/sched.h>
36 37
37#include "debug.h" 38#include "debug.h"
38#include "v9fs.h" 39#include "v9fs.h"
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 7624821729a0..c76cd8fa3f6c 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -33,6 +33,7 @@
33#include <linux/inet.h> 33#include <linux/inet.h>
34#include <linux/namei.h> 34#include <linux/namei.h>
35#include <linux/idr.h> 35#include <linux/idr.h>
36#include <linux/sched.h>
36 37
37#include "debug.h" 38#include "debug.h"
38#include "v9fs.h" 39#include "v9fs.h"
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 8eb9263a67b9..7bdf8b326841 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -36,6 +36,7 @@
36#include <linux/seq_file.h> 36#include <linux/seq_file.h>
37#include <linux/mount.h> 37#include <linux/mount.h>
38#include <linux/idr.h> 38#include <linux/idr.h>
39#include <linux/sched.h>
39 40
40#include "debug.h" 41#include "debug.h"
41#include "v9fs.h" 42#include "v9fs.h"
diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
index 74c64409ddbc..d4fc6095466d 100644
--- a/fs/Kconfig.binfmt
+++ b/fs/Kconfig.binfmt
@@ -38,7 +38,7 @@ config BINFMT_ELF_FDPIC
38 38
39config BINFMT_FLAT 39config BINFMT_FLAT
40 tristate "Kernel support for flat binaries" 40 tristate "Kernel support for flat binaries"
41 depends on !MMU || SUPERH 41 depends on !MMU
42 help 42 help
43 Support uClinux FLAT format binaries. 43 Support uClinux FLAT format binaries.
44 44
diff --git a/fs/affs/inode.c b/fs/affs/inode.c
index c5b9d73c084a..4609a6c13fe9 100644
--- a/fs/affs/inode.c
+++ b/fs/affs/inode.c
@@ -9,7 +9,7 @@
9 * 9 *
10 * (C) 1991 Linus Torvalds - minix filesystem 10 * (C) 1991 Linus Torvalds - minix filesystem
11 */ 11 */
12 12#include <linux/sched.h>
13#include "affs.h" 13#include "affs.h"
14 14
15extern const struct inode_operations affs_symlink_inode_operations; 15extern const struct inode_operations affs_symlink_inode_operations;
diff --git a/fs/affs/super.c b/fs/affs/super.c
index b800d451cd60..6d0ebc321530 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -15,6 +15,7 @@
15#include <linux/statfs.h> 15#include <linux/statfs.h>
16#include <linux/parser.h> 16#include <linux/parser.h>
17#include <linux/magic.h> 17#include <linux/magic.h>
18#include <linux/sched.h>
18#include "affs.h" 19#include "affs.h"
19 20
20extern struct timezone sys_tz; 21extern struct timezone sys_tz;
diff --git a/fs/afs/callback.c b/fs/afs/callback.c
index f64e40fefc02..bacf518c6fa8 100644
--- a/fs/afs/callback.c
+++ b/fs/afs/callback.c
@@ -17,6 +17,7 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/circ_buf.h> 19#include <linux/circ_buf.h>
20#include <linux/sched.h>
20#include "internal.h" 21#include "internal.h"
21 22
22unsigned afs_vnode_update_timeout = 10; 23unsigned afs_vnode_update_timeout = 10;
diff --git a/fs/afs/cell.c b/fs/afs/cell.c
index 9b1311a1df51..175a567db78c 100644
--- a/fs/afs/cell.c
+++ b/fs/afs/cell.c
@@ -13,6 +13,7 @@
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/key.h> 14#include <linux/key.h>
15#include <linux/ctype.h> 15#include <linux/ctype.h>
16#include <linux/sched.h>
16#include <keys/rxrpc-type.h> 17#include <keys/rxrpc-type.h>
17#include "internal.h" 18#include "internal.h"
18 19
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 719af4fb15dc..546c59522eb1 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -16,6 +16,7 @@
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/pagemap.h> 17#include <linux/pagemap.h>
18#include <linux/ctype.h> 18#include <linux/ctype.h>
19#include <linux/sched.h>
19#include "internal.h" 20#include "internal.h"
20 21
21static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry, 22static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 47f5fed7195d..d196840127c6 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -19,6 +19,7 @@
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/pagemap.h> 21#include <linux/pagemap.h>
22#include <linux/sched.h>
22#include "internal.h" 23#include "internal.h"
23 24
24struct afs_iget_data { 25struct afs_iget_data {
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 4953ba5a6f44..2c55dd94a1de 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -16,6 +16,9 @@
16#include <linux/skbuff.h> 16#include <linux/skbuff.h>
17#include <linux/rxrpc.h> 17#include <linux/rxrpc.h>
18#include <linux/key.h> 18#include <linux/key.h>
19#include <linux/workqueue.h>
20#include <linux/sched.h>
21
19#include "afs.h" 22#include "afs.h"
20#include "afs_vl.h" 23#include "afs_vl.h"
21 24
diff --git a/fs/afs/main.c b/fs/afs/main.c
index f1f71ff7d5c6..cd21195bbb24 100644
--- a/fs/afs/main.c
+++ b/fs/afs/main.c
@@ -13,6 +13,7 @@
13#include <linux/moduleparam.h> 13#include <linux/moduleparam.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/completion.h> 15#include <linux/completion.h>
16#include <linux/sched.h>
16#include "internal.h" 17#include "internal.h"
17 18
18MODULE_DESCRIPTION("AFS Client File System"); 19MODULE_DESCRIPTION("AFS Client File System");
diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index d5601f617cdb..13df512aea9e 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/proc_fs.h> 14#include <linux/proc_fs.h>
15#include <linux/seq_file.h> 15#include <linux/seq_file.h>
16#include <linux/sched.h>
16#include <asm/uaccess.h> 17#include <asm/uaccess.h>
17#include "internal.h" 18#include "internal.h"
18 19
diff --git a/fs/afs/security.c b/fs/afs/security.c
index e0ea88b63ebf..566fe712c682 100644
--- a/fs/afs/security.c
+++ b/fs/afs/security.c
@@ -13,6 +13,7 @@
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/fs.h> 14#include <linux/fs.h>
15#include <linux/ctype.h> 15#include <linux/ctype.h>
16#include <linux/sched.h>
16#include <keys/rxrpc-type.h> 17#include <keys/rxrpc-type.h>
17#include "internal.h" 18#include "internal.h"
18 19
diff --git a/fs/afs/super.c b/fs/afs/super.c
index 8d47ad88a093..2e8496ba1205 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -22,6 +22,7 @@
22#include <linux/pagemap.h> 22#include <linux/pagemap.h>
23#include <linux/parser.h> 23#include <linux/parser.h>
24#include <linux/statfs.h> 24#include <linux/statfs.h>
25#include <linux/sched.h>
25#include "internal.h" 26#include "internal.h"
26 27
27#define AFS_FS_MAGIC 0x6B414653 /* 'kAFS' */ 28#define AFS_FS_MAGIC 0x6B414653 /* 'kAFS' */
diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c
index 3370cdb72566..09e3ad0fc7cc 100644
--- a/fs/afs/vlocation.c
+++ b/fs/afs/vlocation.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/sched.h>
15#include "internal.h" 16#include "internal.h"
16 17
17unsigned afs_vlocation_timeout = 10; /* volume location timeout in seconds */ 18unsigned afs_vlocation_timeout = 10; /* volume location timeout in seconds */
diff --git a/fs/afs/vnode.c b/fs/afs/vnode.c
index c36c98ce2c3c..232c55dc245d 100644
--- a/fs/afs/vnode.c
+++ b/fs/afs/vnode.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/sched.h>
17#include "internal.h" 18#include "internal.h"
18 19
19#if 0 20#if 0
diff --git a/fs/afs/volume.c b/fs/afs/volume.c
index dd160cada45d..8bab0e3437f9 100644
--- a/fs/afs/volume.c
+++ b/fs/afs/volume.c
@@ -15,6 +15,7 @@
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/pagemap.h> 17#include <linux/pagemap.h>
18#include <linux/sched.h>
18#include "internal.h" 19#include "internal.h"
19 20
20static const char *afs_voltypes[] = { "R/W", "R/O", "BAK" }; 21static const char *afs_voltypes[] = { "R/W", "R/O", "BAK" };
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 72d0b412c376..330fd3fe8546 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -18,7 +18,7 @@
18 18
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/init.h> 20#include <linux/init.h>
21 21#include <linux/sched.h>
22#include <linux/binfmts.h> 22#include <linux/binfmts.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/ctype.h> 24#include <linux/ctype.h>
diff --git a/fs/buffer.c b/fs/buffer.c
index 49590d590d7d..aa68206bd517 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2101,7 +2101,7 @@ int cont_prepare_write(struct page *page, unsigned offset,
2101 PAGE_CACHE_SIZE, get_block); 2101 PAGE_CACHE_SIZE, get_block);
2102 if (status) 2102 if (status)
2103 goto out_unmap; 2103 goto out_unmap;
2104 zero_user_page(page, zerofrom, PAGE_CACHE_SIZE - zerofrom, 2104 zero_user_page(new_page, zerofrom, PAGE_CACHE_SIZE - zerofrom,
2105 KM_USER0); 2105 KM_USER0);
2106 generic_commit_write(NULL, new_page, zerofrom, PAGE_CACHE_SIZE); 2106 generic_commit_write(NULL, new_page, zerofrom, PAGE_CACHE_SIZE);
2107 unlock_page(new_page); 2107 unlock_page(new_page);
diff --git a/fs/coda/cache.c b/fs/coda/cache.c
index 5d0527133266..fcb88fa8d2f2 100644
--- a/fs/coda/cache.c
+++ b/fs/coda/cache.c
@@ -16,6 +16,7 @@
16#include <asm/uaccess.h> 16#include <asm/uaccess.h>
17#include <linux/string.h> 17#include <linux/string.h>
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/sched.h>
19 20
20#include <linux/coda.h> 21#include <linux/coda.h>
21#include <linux/coda_linux.h> 22#include <linux/coda_linux.h>
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index a5b5e631ba61..5faacdb1a479 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -16,7 +16,7 @@
16 16
17#include <asm/system.h> 17#include <asm/system.h>
18#include <linux/signal.h> 18#include <linux/signal.h>
19 19#include <linux/sched.h>
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
diff --git a/fs/compat.c b/fs/compat.c
index 1de2331db844..4db6216e5266 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1544,9 +1544,10 @@ int compat_core_sys_select(int n, compat_ulong_t __user *inp,
1544 compat_ulong_t __user *outp, compat_ulong_t __user *exp, s64 *timeout) 1544 compat_ulong_t __user *outp, compat_ulong_t __user *exp, s64 *timeout)
1545{ 1545{
1546 fd_set_bits fds; 1546 fd_set_bits fds;
1547 char *bits; 1547 void *bits;
1548 int size, max_fds, ret = -EINVAL; 1548 int size, max_fds, ret = -EINVAL;
1549 struct fdtable *fdt; 1549 struct fdtable *fdt;
1550 long stack_fds[SELECT_STACK_ALLOC/sizeof(long)];
1550 1551
1551 if (n < 0) 1552 if (n < 0)
1552 goto out_nofds; 1553 goto out_nofds;
@@ -1564,11 +1565,14 @@ int compat_core_sys_select(int n, compat_ulong_t __user *inp,
1564 * since we used fdset we need to allocate memory in units of 1565 * since we used fdset we need to allocate memory in units of
1565 * long-words. 1566 * long-words.
1566 */ 1567 */
1567 ret = -ENOMEM;
1568 size = FDS_BYTES(n); 1568 size = FDS_BYTES(n);
1569 bits = kmalloc(6 * size, GFP_KERNEL); 1569 bits = stack_fds;
1570 if (!bits) 1570 if (size > sizeof(stack_fds) / 6) {
1571 goto out_nofds; 1571 bits = kmalloc(6 * size, GFP_KERNEL);
1572 ret = -ENOMEM;
1573 if (!bits)
1574 goto out_nofds;
1575 }
1572 fds.in = (unsigned long *) bits; 1576 fds.in = (unsigned long *) bits;
1573 fds.out = (unsigned long *) (bits + size); 1577 fds.out = (unsigned long *) (bits + size);
1574 fds.ex = (unsigned long *) (bits + 2*size); 1578 fds.ex = (unsigned long *) (bits + 2*size);
@@ -1600,7 +1604,8 @@ int compat_core_sys_select(int n, compat_ulong_t __user *inp,
1600 compat_set_fd_set(n, exp, fds.res_ex)) 1604 compat_set_fd_set(n, exp, fds.res_ex))
1601 ret = -EFAULT; 1605 ret = -EFAULT;
1602out: 1606out:
1603 kfree(bits); 1607 if (bits != stack_fds)
1608 kfree(bits);
1604out_nofds: 1609out_nofds:
1605 return ret; 1610 return ret;
1606} 1611}
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 65643def3182..6b44cdc96fac 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -1194,6 +1194,7 @@ static int vt_check(struct file *file)
1194{ 1194{
1195 struct tty_struct *tty; 1195 struct tty_struct *tty;
1196 struct inode *inode = file->f_path.dentry->d_inode; 1196 struct inode *inode = file->f_path.dentry->d_inode;
1197 struct vc_data *vc;
1197 1198
1198 if (file->f_op->ioctl != tty_ioctl) 1199 if (file->f_op->ioctl != tty_ioctl)
1199 return -EINVAL; 1200 return -EINVAL;
@@ -1204,12 +1205,16 @@ static int vt_check(struct file *file)
1204 1205
1205 if (tty->driver->ioctl != vt_ioctl) 1206 if (tty->driver->ioctl != vt_ioctl)
1206 return -EINVAL; 1207 return -EINVAL;
1207 1208
1209 vc = (struct vc_data *)tty->driver_data;
1210 if (!vc_cons_allocated(vc->vc_num)) /* impossible? */
1211 return -ENOIOCTLCMD;
1212
1208 /* 1213 /*
1209 * To have permissions to do most of the vt ioctls, we either have 1214 * To have permissions to do most of the vt ioctls, we either have
1210 * to be the owner of the tty, or super-user. 1215 * to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
1211 */ 1216 */
1212 if (current->signal->tty == tty || capable(CAP_SYS_ADMIN)) 1217 if (current->signal->tty == tty || capable(CAP_SYS_TTY_CONFIG))
1213 return 1; 1218 return 1;
1214 return 0; 1219 return 0;
1215} 1220}
@@ -1310,16 +1315,28 @@ static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,
1310 struct unimapdesc32 tmp; 1315 struct unimapdesc32 tmp;
1311 struct unimapdesc32 __user *user_ud = compat_ptr(arg); 1316 struct unimapdesc32 __user *user_ud = compat_ptr(arg);
1312 int perm = vt_check(file); 1317 int perm = vt_check(file);
1313 1318 struct vc_data *vc;
1314 if (perm < 0) return perm; 1319
1320 if (perm < 0)
1321 return perm;
1315 if (copy_from_user(&tmp, user_ud, sizeof tmp)) 1322 if (copy_from_user(&tmp, user_ud, sizeof tmp))
1316 return -EFAULT; 1323 return -EFAULT;
1324 if (tmp.entries)
1325 if (!access_ok(VERIFY_WRITE, compat_ptr(tmp.entries),
1326 tmp.entry_ct*sizeof(struct unipair)))
1327 return -EFAULT;
1328 vc = ((struct tty_struct *)file->private_data)->driver_data;
1317 switch (cmd) { 1329 switch (cmd) {
1318 case PIO_UNIMAP: 1330 case PIO_UNIMAP:
1319 if (!perm) return -EPERM; 1331 if (!perm)
1320 return con_set_unimap(vc_cons[fg_console].d, tmp.entry_ct, compat_ptr(tmp.entries)); 1332 return -EPERM;
1333 return con_set_unimap(vc, tmp.entry_ct,
1334 compat_ptr(tmp.entries));
1321 case GIO_UNIMAP: 1335 case GIO_UNIMAP:
1322 return con_get_unimap(vc_cons[fg_console].d, tmp.entry_ct, &(user_ud->entry_ct), compat_ptr(tmp.entries)); 1336 if (!perm && fg_console != vc->vc_num)
1337 return -EPERM;
1338 return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct),
1339 compat_ptr(tmp.entries));
1323 } 1340 }
1324 return 0; 1341 return 0;
1325} 1342}
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index 2ec9beac17cf..ddc003a9d214 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -32,6 +32,7 @@
32#include <linux/namei.h> 32#include <linux/namei.h>
33#include <linux/backing-dev.h> 33#include <linux/backing-dev.h>
34#include <linux/capability.h> 34#include <linux/capability.h>
35#include <linux/sched.h>
35 36
36#include <linux/configfs.h> 37#include <linux/configfs.h>
37#include "configfs_internal.h" 38#include "configfs_internal.h"
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 9881b5c5de59..59288d817078 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -33,63 +33,6 @@
33#include "ecryptfs_kernel.h" 33#include "ecryptfs_kernel.h"
34 34
35/** 35/**
36 * ecryptfs_llseek
37 * @file: File we are seeking in
38 * @offset: The offset to seek to
39 * @origin: 2 - offset from i_size; 1 - offset from f_pos
40 *
41 * Returns the position we have seeked to, or negative on error
42 */
43static loff_t ecryptfs_llseek(struct file *file, loff_t offset, int origin)
44{
45 loff_t rv;
46 loff_t new_end_pos;
47 int rc;
48 int expanding_file = 0;
49 struct inode *inode = file->f_mapping->host;
50
51 /* If our offset is past the end of our file, we're going to
52 * need to grow it so we have a valid length of 0's */
53 new_end_pos = offset;
54 switch (origin) {
55 case 2:
56 new_end_pos += i_size_read(inode);
57 expanding_file = 1;
58 break;
59 case 1:
60 new_end_pos += file->f_pos;
61 if (new_end_pos > i_size_read(inode)) {
62 ecryptfs_printk(KERN_DEBUG, "new_end_pos(=[0x%.16x]) "
63 "> i_size_read(inode)(=[0x%.16x])\n",
64 new_end_pos, i_size_read(inode));
65 expanding_file = 1;
66 }
67 break;
68 default:
69 if (new_end_pos > i_size_read(inode)) {
70 ecryptfs_printk(KERN_DEBUG, "new_end_pos(=[0x%.16x]) "
71 "> i_size_read(inode)(=[0x%.16x])\n",
72 new_end_pos, i_size_read(inode));
73 expanding_file = 1;
74 }
75 }
76 ecryptfs_printk(KERN_DEBUG, "new_end_pos = [0x%.16x]\n", new_end_pos);
77 if (expanding_file) {
78 rc = ecryptfs_truncate(file->f_path.dentry, new_end_pos);
79 if (rc) {
80 rv = rc;
81 ecryptfs_printk(KERN_ERR, "Error on attempt to "
82 "truncate to (higher) offset [0x%.16x];"
83 " rc = [%d]\n", new_end_pos, rc);
84 goto out;
85 }
86 }
87 rv = generic_file_llseek(file, offset, origin);
88out:
89 return rv;
90}
91
92/**
93 * ecryptfs_read_update_atime 36 * ecryptfs_read_update_atime
94 * 37 *
95 * generic_file_read updates the atime of upper layer inode. But, it 38 * generic_file_read updates the atime of upper layer inode. But, it
@@ -425,7 +368,7 @@ const struct file_operations ecryptfs_dir_fops = {
425}; 368};
426 369
427const struct file_operations ecryptfs_main_fops = { 370const struct file_operations ecryptfs_main_fops = {
428 .llseek = ecryptfs_llseek, 371 .llseek = generic_file_llseek,
429 .read = do_sync_read, 372 .read = do_sync_read,
430 .aio_read = ecryptfs_read_update_atime, 373 .aio_read = ecryptfs_read_update_atime,
431 .write = do_sync_write, 374 .write = do_sync_write,
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c
index 3baf253be95a..a9d87c47f72d 100644
--- a/fs/ecryptfs/messaging.c
+++ b/fs/ecryptfs/messaging.c
@@ -19,7 +19,7 @@
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA. 20 * 02111-1307, USA.
21 */ 21 */
22 22#include <linux/sched.h>
23#include "ecryptfs_kernel.h" 23#include "ecryptfs_kernel.h"
24 24
25static LIST_HEAD(ecryptfs_msg_ctx_free_list); 25static LIST_HEAD(ecryptfs_msg_ctx_free_list);
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 88ea6697908f..55cec98a84e7 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -376,9 +376,31 @@ out:
376 return 0; 376 return 0;
377} 377}
378 378
379/**
380 * eCryptfs does not currently support holes. When writing after a
381 * seek past the end of the file, eCryptfs fills in 0's through to the
382 * current location. The code to fill in the 0's to all the
383 * intermediate pages calls ecryptfs_prepare_write_no_truncate().
384 */
385static int
386ecryptfs_prepare_write_no_truncate(struct file *file, struct page *page,
387 unsigned from, unsigned to)
388{
389 int rc = 0;
390
391 if (from == 0 && to == PAGE_CACHE_SIZE)
392 goto out; /* If we are writing a full page, it will be
393 up to date. */
394 if (!PageUptodate(page))
395 rc = ecryptfs_do_readpage(file, page, page->index);
396out:
397 return rc;
398}
399
379static int ecryptfs_prepare_write(struct file *file, struct page *page, 400static int ecryptfs_prepare_write(struct file *file, struct page *page,
380 unsigned from, unsigned to) 401 unsigned from, unsigned to)
381{ 402{
403 loff_t pos;
382 int rc = 0; 404 int rc = 0;
383 405
384 if (from == 0 && to == PAGE_CACHE_SIZE) 406 if (from == 0 && to == PAGE_CACHE_SIZE)
@@ -386,6 +408,16 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page,
386 up to date. */ 408 up to date. */
387 if (!PageUptodate(page)) 409 if (!PageUptodate(page))
388 rc = ecryptfs_do_readpage(file, page, page->index); 410 rc = ecryptfs_do_readpage(file, page, page->index);
411 pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
412 if (pos > i_size_read(page->mapping->host)) {
413 rc = ecryptfs_truncate(file->f_path.dentry, pos);
414 if (rc) {
415 printk(KERN_ERR "Error on attempt to "
416 "truncate to (higher) offset [%lld];"
417 " rc = [%d]\n", pos, rc);
418 goto out;
419 }
420 }
389out: 421out:
390 return rc; 422 return rc;
391} 423}
@@ -744,10 +776,10 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros)
744 rc = PTR_ERR(tmp_page); 776 rc = PTR_ERR(tmp_page);
745 goto out; 777 goto out;
746 } 778 }
747 rc = ecryptfs_prepare_write(file, tmp_page, start, start + num_zeros); 779 if ((rc = ecryptfs_prepare_write_no_truncate(file, tmp_page, start,
748 if (rc) { 780 (start + num_zeros)))) {
749 ecryptfs_printk(KERN_ERR, "Error preparing to write zero's " 781 ecryptfs_printk(KERN_ERR, "Error preparing to write zero's "
750 "to remainder of page at index [0x%.16x]\n", 782 "to page at index [0x%.16x]\n",
751 index); 783 index);
752 page_cache_release(tmp_page); 784 page_cache_release(tmp_page);
753 goto out; 785 goto out;
diff --git a/fs/exec.c b/fs/exec.c
index 0b685888ff6f..f20561ff4528 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -134,6 +134,9 @@ asmlinkage long sys_uselib(const char __user * library)
134 if (error) 134 if (error)
135 goto out; 135 goto out;
136 136
137 error = -EACCES;
138 if (nd.mnt->mnt_flags & MNT_NOEXEC)
139 goto exit;
137 error = -EINVAL; 140 error = -EINVAL;
138 if (!S_ISREG(nd.dentry->d_inode->i_mode)) 141 if (!S_ISREG(nd.dentry->d_inode->i_mode))
139 goto exit; 142 goto exit;
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 8a23483ca8d0..3b64bb16c727 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -30,15 +30,15 @@
30void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, 30void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
31 unsigned long *blockgrpp, ext4_grpblk_t *offsetp) 31 unsigned long *blockgrpp, ext4_grpblk_t *offsetp)
32{ 32{
33 struct ext4_super_block *es = EXT4_SB(sb)->s_es; 33 struct ext4_super_block *es = EXT4_SB(sb)->s_es;
34 ext4_grpblk_t offset; 34 ext4_grpblk_t offset;
35 35
36 blocknr = blocknr - le32_to_cpu(es->s_first_data_block); 36 blocknr = blocknr - le32_to_cpu(es->s_first_data_block);
37 offset = do_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb)); 37 offset = do_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb));
38 if (offsetp) 38 if (offsetp)
39 *offsetp = offset; 39 *offsetp = offset;
40 if (blockgrpp) 40 if (blockgrpp)
41 *blockgrpp = blocknr; 41 *blockgrpp = blocknr;
42 42
43} 43}
44 44
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index a0f0c04e79b2..b9ce24129070 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -374,7 +374,7 @@ ext4_ext_binsearch_idx(struct inode *inode, struct ext4_ext_path *path, int bloc
374 le32_to_cpu(ix[-1].ei_block)); 374 le32_to_cpu(ix[-1].ei_block));
375 } 375 }
376 BUG_ON(k && le32_to_cpu(ix->ei_block) 376 BUG_ON(k && le32_to_cpu(ix->ei_block)
377 <= le32_to_cpu(ix[-1].ei_block)); 377 <= le32_to_cpu(ix[-1].ei_block));
378 if (block < le32_to_cpu(ix->ei_block)) 378 if (block < le32_to_cpu(ix->ei_block))
379 break; 379 break;
380 chix = ix; 380 chix = ix;
@@ -423,8 +423,8 @@ ext4_ext_binsearch(struct inode *inode, struct ext4_ext_path *path, int block)
423 423
424 path->p_ext = l - 1; 424 path->p_ext = l - 1;
425 ext_debug(" -> %d:%llu:%d ", 425 ext_debug(" -> %d:%llu:%d ",
426 le32_to_cpu(path->p_ext->ee_block), 426 le32_to_cpu(path->p_ext->ee_block),
427 ext_pblock(path->p_ext), 427 ext_pblock(path->p_ext),
428 le16_to_cpu(path->p_ext->ee_len)); 428 le16_to_cpu(path->p_ext->ee_len));
429 429
430#ifdef CHECK_BINSEARCH 430#ifdef CHECK_BINSEARCH
@@ -435,7 +435,7 @@ ext4_ext_binsearch(struct inode *inode, struct ext4_ext_path *path, int block)
435 chex = ex = EXT_FIRST_EXTENT(eh); 435 chex = ex = EXT_FIRST_EXTENT(eh);
436 for (k = 0; k < le16_to_cpu(eh->eh_entries); k++, ex++) { 436 for (k = 0; k < le16_to_cpu(eh->eh_entries); k++, ex++) {
437 BUG_ON(k && le32_to_cpu(ex->ee_block) 437 BUG_ON(k && le32_to_cpu(ex->ee_block)
438 <= le32_to_cpu(ex[-1].ee_block)); 438 <= le32_to_cpu(ex[-1].ee_block));
439 if (block < le32_to_cpu(ex->ee_block)) 439 if (block < le32_to_cpu(ex->ee_block))
440 break; 440 break;
441 chex = ex; 441 chex = ex;
@@ -577,7 +577,7 @@ static int ext4_ext_insert_index(handle_t *handle, struct inode *inode,
577 curp->p_hdr->eh_entries = cpu_to_le16(le16_to_cpu(curp->p_hdr->eh_entries)+1); 577 curp->p_hdr->eh_entries = cpu_to_le16(le16_to_cpu(curp->p_hdr->eh_entries)+1);
578 578
579 BUG_ON(le16_to_cpu(curp->p_hdr->eh_entries) 579 BUG_ON(le16_to_cpu(curp->p_hdr->eh_entries)
580 > le16_to_cpu(curp->p_hdr->eh_max)); 580 > le16_to_cpu(curp->p_hdr->eh_max));
581 BUG_ON(ix > EXT_LAST_INDEX(curp->p_hdr)); 581 BUG_ON(ix > EXT_LAST_INDEX(curp->p_hdr));
582 582
583 err = ext4_ext_dirty(handle, inode, curp); 583 err = ext4_ext_dirty(handle, inode, curp);
@@ -621,12 +621,12 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
621 border = path[depth].p_ext[1].ee_block; 621 border = path[depth].p_ext[1].ee_block;
622 ext_debug("leaf will be split." 622 ext_debug("leaf will be split."
623 " next leaf starts at %d\n", 623 " next leaf starts at %d\n",
624 le32_to_cpu(border)); 624 le32_to_cpu(border));
625 } else { 625 } else {
626 border = newext->ee_block; 626 border = newext->ee_block;
627 ext_debug("leaf will be added." 627 ext_debug("leaf will be added."
628 " next leaf starts at %d\n", 628 " next leaf starts at %d\n",
629 le32_to_cpu(border)); 629 le32_to_cpu(border));
630 } 630 }
631 631
632 /* 632 /*
@@ -684,9 +684,9 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
684 while (path[depth].p_ext <= 684 while (path[depth].p_ext <=
685 EXT_MAX_EXTENT(path[depth].p_hdr)) { 685 EXT_MAX_EXTENT(path[depth].p_hdr)) {
686 ext_debug("move %d:%llu:%d in new leaf %llu\n", 686 ext_debug("move %d:%llu:%d in new leaf %llu\n",
687 le32_to_cpu(path[depth].p_ext->ee_block), 687 le32_to_cpu(path[depth].p_ext->ee_block),
688 ext_pblock(path[depth].p_ext), 688 ext_pblock(path[depth].p_ext),
689 le16_to_cpu(path[depth].p_ext->ee_len), 689 le16_to_cpu(path[depth].p_ext->ee_len),
690 newblock); 690 newblock);
691 /*memmove(ex++, path[depth].p_ext++, 691 /*memmove(ex++, path[depth].p_ext++,
692 sizeof(struct ext4_extent)); 692 sizeof(struct ext4_extent));
@@ -765,9 +765,9 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
765 EXT_LAST_INDEX(path[i].p_hdr)); 765 EXT_LAST_INDEX(path[i].p_hdr));
766 while (path[i].p_idx <= EXT_MAX_INDEX(path[i].p_hdr)) { 766 while (path[i].p_idx <= EXT_MAX_INDEX(path[i].p_hdr)) {
767 ext_debug("%d: move %d:%d in new index %llu\n", i, 767 ext_debug("%d: move %d:%d in new index %llu\n", i,
768 le32_to_cpu(path[i].p_idx->ei_block), 768 le32_to_cpu(path[i].p_idx->ei_block),
769 idx_pblock(path[i].p_idx), 769 idx_pblock(path[i].p_idx),
770 newblock); 770 newblock);
771 /*memmove(++fidx, path[i].p_idx++, 771 /*memmove(++fidx, path[i].p_idx++,
772 sizeof(struct ext4_extent_idx)); 772 sizeof(struct ext4_extent_idx));
773 neh->eh_entries++; 773 neh->eh_entries++;
@@ -1128,6 +1128,55 @@ ext4_can_extents_be_merged(struct inode *inode, struct ext4_extent *ex1,
1128} 1128}
1129 1129
1130/* 1130/*
1131 * check if a portion of the "newext" extent overlaps with an
1132 * existing extent.
1133 *
1134 * If there is an overlap discovered, it updates the length of the newext
1135 * such that there will be no overlap, and then returns 1.
1136 * If there is no overlap found, it returns 0.
1137 */
1138unsigned int ext4_ext_check_overlap(struct inode *inode,
1139 struct ext4_extent *newext,
1140 struct ext4_ext_path *path)
1141{
1142 unsigned long b1, b2;
1143 unsigned int depth, len1;
1144 unsigned int ret = 0;
1145
1146 b1 = le32_to_cpu(newext->ee_block);
1147 len1 = le16_to_cpu(newext->ee_len);
1148 depth = ext_depth(inode);
1149 if (!path[depth].p_ext)
1150 goto out;
1151 b2 = le32_to_cpu(path[depth].p_ext->ee_block);
1152
1153 /*
1154 * get the next allocated block if the extent in the path
1155 * is before the requested block(s)
1156 */
1157 if (b2 < b1) {
1158 b2 = ext4_ext_next_allocated_block(path);
1159 if (b2 == EXT_MAX_BLOCK)
1160 goto out;
1161 }
1162
1163 /* check for wrap through zero */
1164 if (b1 + len1 < b1) {
1165 len1 = EXT_MAX_BLOCK - b1;
1166 newext->ee_len = cpu_to_le16(len1);
1167 ret = 1;
1168 }
1169
1170 /* check for overlap */
1171 if (b1 + len1 > b2) {
1172 newext->ee_len = cpu_to_le16(b2 - b1);
1173 ret = 1;
1174 }
1175out:
1176 return ret;
1177}
1178
1179/*
1131 * ext4_ext_insert_extent: 1180 * ext4_ext_insert_extent:
1132 * tries to merge requsted extent into the existing extent or 1181 * tries to merge requsted extent into the existing extent or
1133 * inserts requested extent as new one into the tree, 1182 * inserts requested extent as new one into the tree,
@@ -1212,12 +1261,12 @@ has_space:
1212 if (!nearex) { 1261 if (!nearex) {
1213 /* there is no extent in this leaf, create first one */ 1262 /* there is no extent in this leaf, create first one */
1214 ext_debug("first extent in the leaf: %d:%llu:%d\n", 1263 ext_debug("first extent in the leaf: %d:%llu:%d\n",
1215 le32_to_cpu(newext->ee_block), 1264 le32_to_cpu(newext->ee_block),
1216 ext_pblock(newext), 1265 ext_pblock(newext),
1217 le16_to_cpu(newext->ee_len)); 1266 le16_to_cpu(newext->ee_len));
1218 path[depth].p_ext = EXT_FIRST_EXTENT(eh); 1267 path[depth].p_ext = EXT_FIRST_EXTENT(eh);
1219 } else if (le32_to_cpu(newext->ee_block) 1268 } else if (le32_to_cpu(newext->ee_block)
1220 > le32_to_cpu(nearex->ee_block)) { 1269 > le32_to_cpu(nearex->ee_block)) {
1221/* BUG_ON(newext->ee_block == nearex->ee_block); */ 1270/* BUG_ON(newext->ee_block == nearex->ee_block); */
1222 if (nearex != EXT_LAST_EXTENT(eh)) { 1271 if (nearex != EXT_LAST_EXTENT(eh)) {
1223 len = EXT_MAX_EXTENT(eh) - nearex; 1272 len = EXT_MAX_EXTENT(eh) - nearex;
@@ -1225,9 +1274,9 @@ has_space:
1225 len = len < 0 ? 0 : len; 1274 len = len < 0 ? 0 : len;
1226 ext_debug("insert %d:%llu:%d after: nearest 0x%p, " 1275 ext_debug("insert %d:%llu:%d after: nearest 0x%p, "
1227 "move %d from 0x%p to 0x%p\n", 1276 "move %d from 0x%p to 0x%p\n",
1228 le32_to_cpu(newext->ee_block), 1277 le32_to_cpu(newext->ee_block),
1229 ext_pblock(newext), 1278 ext_pblock(newext),
1230 le16_to_cpu(newext->ee_len), 1279 le16_to_cpu(newext->ee_len),
1231 nearex, len, nearex + 1, nearex + 2); 1280 nearex, len, nearex + 1, nearex + 2);
1232 memmove(nearex + 2, nearex + 1, len); 1281 memmove(nearex + 2, nearex + 1, len);
1233 } 1282 }
@@ -1358,9 +1407,9 @@ int ext4_ext_walk_space(struct inode *inode, unsigned long block,
1358 cbex.ec_start = 0; 1407 cbex.ec_start = 0;
1359 cbex.ec_type = EXT4_EXT_CACHE_GAP; 1408 cbex.ec_type = EXT4_EXT_CACHE_GAP;
1360 } else { 1409 } else {
1361 cbex.ec_block = le32_to_cpu(ex->ee_block); 1410 cbex.ec_block = le32_to_cpu(ex->ee_block);
1362 cbex.ec_len = le16_to_cpu(ex->ee_len); 1411 cbex.ec_len = le16_to_cpu(ex->ee_len);
1363 cbex.ec_start = ext_pblock(ex); 1412 cbex.ec_start = ext_pblock(ex);
1364 cbex.ec_type = EXT4_EXT_CACHE_EXTENT; 1413 cbex.ec_type = EXT4_EXT_CACHE_EXTENT;
1365 } 1414 }
1366 1415
@@ -1431,16 +1480,16 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
1431 len = le32_to_cpu(ex->ee_block) - block; 1480 len = le32_to_cpu(ex->ee_block) - block;
1432 ext_debug("cache gap(before): %lu [%lu:%lu]", 1481 ext_debug("cache gap(before): %lu [%lu:%lu]",
1433 (unsigned long) block, 1482 (unsigned long) block,
1434 (unsigned long) le32_to_cpu(ex->ee_block), 1483 (unsigned long) le32_to_cpu(ex->ee_block),
1435 (unsigned long) le16_to_cpu(ex->ee_len)); 1484 (unsigned long) le16_to_cpu(ex->ee_len));
1436 } else if (block >= le32_to_cpu(ex->ee_block) 1485 } else if (block >= le32_to_cpu(ex->ee_block)
1437 + le16_to_cpu(ex->ee_len)) { 1486 + le16_to_cpu(ex->ee_len)) {
1438 lblock = le32_to_cpu(ex->ee_block) 1487 lblock = le32_to_cpu(ex->ee_block)
1439 + le16_to_cpu(ex->ee_len); 1488 + le16_to_cpu(ex->ee_len);
1440 len = ext4_ext_next_allocated_block(path); 1489 len = ext4_ext_next_allocated_block(path);
1441 ext_debug("cache gap(after): [%lu:%lu] %lu", 1490 ext_debug("cache gap(after): [%lu:%lu] %lu",
1442 (unsigned long) le32_to_cpu(ex->ee_block), 1491 (unsigned long) le32_to_cpu(ex->ee_block),
1443 (unsigned long) le16_to_cpu(ex->ee_len), 1492 (unsigned long) le16_to_cpu(ex->ee_len),
1444 (unsigned long) block); 1493 (unsigned long) block);
1445 BUG_ON(len == lblock); 1494 BUG_ON(len == lblock);
1446 len = len - lblock; 1495 len = len - lblock;
@@ -1468,9 +1517,9 @@ ext4_ext_in_cache(struct inode *inode, unsigned long block,
1468 BUG_ON(cex->ec_type != EXT4_EXT_CACHE_GAP && 1517 BUG_ON(cex->ec_type != EXT4_EXT_CACHE_GAP &&
1469 cex->ec_type != EXT4_EXT_CACHE_EXTENT); 1518 cex->ec_type != EXT4_EXT_CACHE_EXTENT);
1470 if (block >= cex->ec_block && block < cex->ec_block + cex->ec_len) { 1519 if (block >= cex->ec_block && block < cex->ec_block + cex->ec_len) {
1471 ex->ee_block = cpu_to_le32(cex->ec_block); 1520 ex->ee_block = cpu_to_le32(cex->ec_block);
1472 ext4_ext_store_pblock(ex, cex->ec_start); 1521 ext4_ext_store_pblock(ex, cex->ec_start);
1473 ex->ee_len = cpu_to_le16(cex->ec_len); 1522 ex->ee_len = cpu_to_le16(cex->ec_len);
1474 ext_debug("%lu cached by %lu:%lu:%llu\n", 1523 ext_debug("%lu cached by %lu:%lu:%llu\n",
1475 (unsigned long) block, 1524 (unsigned long) block,
1476 (unsigned long) cex->ec_block, 1525 (unsigned long) cex->ec_block,
@@ -1956,9 +2005,9 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
1956 /* we should allocate requested block */ 2005 /* we should allocate requested block */
1957 } else if (goal == EXT4_EXT_CACHE_EXTENT) { 2006 } else if (goal == EXT4_EXT_CACHE_EXTENT) {
1958 /* block is already allocated */ 2007 /* block is already allocated */
1959 newblock = iblock 2008 newblock = iblock
1960 - le32_to_cpu(newex.ee_block) 2009 - le32_to_cpu(newex.ee_block)
1961 + ext_pblock(&newex); 2010 + ext_pblock(&newex);
1962 /* number of remaining blocks in the extent */ 2011 /* number of remaining blocks in the extent */
1963 allocated = le16_to_cpu(newex.ee_len) - 2012 allocated = le16_to_cpu(newex.ee_len) -
1964 (iblock - le32_to_cpu(newex.ee_block)); 2013 (iblock - le32_to_cpu(newex.ee_block));
@@ -1987,7 +2036,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
1987 2036
1988 ex = path[depth].p_ext; 2037 ex = path[depth].p_ext;
1989 if (ex) { 2038 if (ex) {
1990 unsigned long ee_block = le32_to_cpu(ex->ee_block); 2039 unsigned long ee_block = le32_to_cpu(ex->ee_block);
1991 ext4_fsblk_t ee_start = ext_pblock(ex); 2040 ext4_fsblk_t ee_start = ext_pblock(ex);
1992 unsigned short ee_len = le16_to_cpu(ex->ee_len); 2041 unsigned short ee_len = le16_to_cpu(ex->ee_len);
1993 2042
@@ -2000,7 +2049,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
2000 if (ee_len > EXT_MAX_LEN) 2049 if (ee_len > EXT_MAX_LEN)
2001 goto out2; 2050 goto out2;
2002 /* if found extent covers block, simply return it */ 2051 /* if found extent covers block, simply return it */
2003 if (iblock >= ee_block && iblock < ee_block + ee_len) { 2052 if (iblock >= ee_block && iblock < ee_block + ee_len) {
2004 newblock = iblock - ee_block + ee_start; 2053 newblock = iblock - ee_block + ee_start;
2005 /* number of remaining blocks in the extent */ 2054 /* number of remaining blocks in the extent */
2006 allocated = ee_len - (iblock - ee_block); 2055 allocated = ee_len - (iblock - ee_block);
@@ -2031,7 +2080,15 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
2031 2080
2032 /* allocate new block */ 2081 /* allocate new block */
2033 goal = ext4_ext_find_goal(inode, path, iblock); 2082 goal = ext4_ext_find_goal(inode, path, iblock);
2034 allocated = max_blocks; 2083
2084 /* Check if we can really insert (iblock)::(iblock+max_blocks) extent */
2085 newex.ee_block = cpu_to_le32(iblock);
2086 newex.ee_len = cpu_to_le16(max_blocks);
2087 err = ext4_ext_check_overlap(inode, &newex, path);
2088 if (err)
2089 allocated = le16_to_cpu(newex.ee_len);
2090 else
2091 allocated = max_blocks;
2035 newblock = ext4_new_blocks(handle, inode, goal, &allocated, &err); 2092 newblock = ext4_new_blocks(handle, inode, goal, &allocated, &err);
2036 if (!newblock) 2093 if (!newblock)
2037 goto out2; 2094 goto out2;
@@ -2039,12 +2096,15 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
2039 goal, newblock, allocated); 2096 goal, newblock, allocated);
2040 2097
2041 /* try to insert new extent into found leaf and return */ 2098 /* try to insert new extent into found leaf and return */
2042 newex.ee_block = cpu_to_le32(iblock);
2043 ext4_ext_store_pblock(&newex, newblock); 2099 ext4_ext_store_pblock(&newex, newblock);
2044 newex.ee_len = cpu_to_le16(allocated); 2100 newex.ee_len = cpu_to_le16(allocated);
2045 err = ext4_ext_insert_extent(handle, inode, path, &newex); 2101 err = ext4_ext_insert_extent(handle, inode, path, &newex);
2046 if (err) 2102 if (err) {
2103 /* free data blocks we just allocated */
2104 ext4_free_blocks(handle, inode, ext_pblock(&newex),
2105 le16_to_cpu(newex.ee_len));
2047 goto out2; 2106 goto out2;
2107 }
2048 2108
2049 if (extend_disksize && inode->i_size > EXT4_I(inode)->i_disksize) 2109 if (extend_disksize && inode->i_size > EXT4_I(inode)->i_disksize)
2050 EXT4_I(inode)->i_disksize = inode->i_size; 2110 EXT4_I(inode)->i_disksize = inode->i_size;
@@ -2157,11 +2217,3 @@ int ext4_ext_writepage_trans_blocks(struct inode *inode, int num)
2157 2217
2158 return needed; 2218 return needed;
2159} 2219}
2160
2161EXPORT_SYMBOL(ext4_mark_inode_dirty);
2162EXPORT_SYMBOL(ext4_ext_invalidate_cache);
2163EXPORT_SYMBOL(ext4_ext_insert_extent);
2164EXPORT_SYMBOL(ext4_ext_walk_space);
2165EXPORT_SYMBOL(ext4_ext_find_goal);
2166EXPORT_SYMBOL(ext4_ext_calc_credits_for_insert);
2167
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index b34182b6ee4d..0bcf62a750ff 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -255,8 +255,8 @@ static int verify_chain(Indirect *from, Indirect *to)
255 * @inode: inode in question (we are only interested in its superblock) 255 * @inode: inode in question (we are only interested in its superblock)
256 * @i_block: block number to be parsed 256 * @i_block: block number to be parsed
257 * @offsets: array to store the offsets in 257 * @offsets: array to store the offsets in
258 * @boundary: set this non-zero if the referred-to block is likely to be 258 * @boundary: set this non-zero if the referred-to block is likely to be
259 * followed (on disk) by an indirect block. 259 * followed (on disk) by an indirect block.
260 * 260 *
261 * To store the locations of file's data ext4 uses a data structure common 261 * To store the locations of file's data ext4 uses a data structure common
262 * for UNIX filesystems - tree of pointers anchored in the inode, with 262 * for UNIX filesystems - tree of pointers anchored in the inode, with
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 4ec57be5baf5..2811e5720ad0 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -46,7 +46,7 @@
46 */ 46 */
47#define NAMEI_RA_CHUNKS 2 47#define NAMEI_RA_CHUNKS 2
48#define NAMEI_RA_BLOCKS 4 48#define NAMEI_RA_BLOCKS 4
49#define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS) 49#define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS)
50#define NAMEI_RA_INDEX(c,b) (((c) * NAMEI_RA_BLOCKS) + (b)) 50#define NAMEI_RA_INDEX(c,b) (((c) * NAMEI_RA_BLOCKS) + (b))
51 51
52static struct buffer_head *ext4_append(handle_t *handle, 52static struct buffer_head *ext4_append(handle_t *handle,
@@ -241,7 +241,7 @@ static inline unsigned dx_node_limit (struct inode *dir)
241static void dx_show_index (char * label, struct dx_entry *entries) 241static void dx_show_index (char * label, struct dx_entry *entries)
242{ 242{
243 int i, n = dx_get_count (entries); 243 int i, n = dx_get_count (entries);
244 printk("%s index ", label); 244 printk("%s index ", label);
245 for (i = 0; i < n; i++) { 245 for (i = 0; i < n; i++) {
246 printk("%x->%u ", i? dx_get_hash(entries + i) : 246 printk("%x->%u ", i? dx_get_hash(entries + i) :
247 0, dx_get_block(entries + i)); 247 0, dx_get_block(entries + i));
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index cb9afdd0e26e..175b68c60968 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1985,7 +1985,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
1985 1985
1986 if (bd_claim(bdev, sb)) { 1986 if (bd_claim(bdev, sb)) {
1987 printk(KERN_ERR 1987 printk(KERN_ERR
1988 "EXT4: failed to claim external journal device.\n"); 1988 "EXT4: failed to claim external journal device.\n");
1989 blkdev_put(bdev); 1989 blkdev_put(bdev);
1990 return NULL; 1990 return NULL;
1991 } 1991 }
diff --git a/fs/fifo.c b/fs/fifo.c
index 6e7df7256782..9785e36f81e7 100644
--- a/fs/fifo.c
+++ b/fs/fifo.c
@@ -12,6 +12,7 @@
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/fs.h> 14#include <linux/fs.h>
15#include <linux/sched.h>
15#include <linux/pipe_fs_i.h> 16#include <linux/pipe_fs_i.h>
16 17
17static void wait_for_partner(struct inode* inode, unsigned int *cnt) 18static void wait_for_partner(struct inode* inode, unsigned int *cnt)
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 8890eba1db52..bd5a772d8ccf 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -485,7 +485,7 @@ static int fuse_mknod(struct inode *dir, struct dentry *entry, int mode,
485static int fuse_create(struct inode *dir, struct dentry *entry, int mode, 485static int fuse_create(struct inode *dir, struct dentry *entry, int mode,
486 struct nameidata *nd) 486 struct nameidata *nd)
487{ 487{
488 if (nd && (nd->flags & LOOKUP_CREATE)) { 488 if (nd && (nd->flags & LOOKUP_OPEN)) {
489 int err = fuse_create_open(dir, entry, mode, nd); 489 int err = fuse_create_open(dir, entry, mode, nd);
490 if (err != -ENOSYS) 490 if (err != -ENOSYS)
491 return err; 491 return err;
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index acfad65a6e8e..adf7995232b8 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -11,6 +11,7 @@
11#include <linux/pagemap.h> 11#include <linux/pagemap.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/sched.h>
14 15
15static const struct file_operations fuse_direct_io_file_operations; 16static const struct file_operations fuse_direct_io_file_operations;
16 17
@@ -609,7 +610,9 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf,
609 ssize_t res; 610 ssize_t res;
610 /* Don't allow parallel writes to the same file */ 611 /* Don't allow parallel writes to the same file */
611 mutex_lock(&inode->i_mutex); 612 mutex_lock(&inode->i_mutex);
612 res = fuse_direct_io(file, buf, count, ppos, 1); 613 res = generic_write_checks(file, ppos, &count, 0);
614 if (!res)
615 res = fuse_direct_io(file, buf, count, ppos, 1);
613 mutex_unlock(&inode->i_mutex); 616 mutex_unlock(&inode->i_mutex);
614 return res; 617 return res;
615} 618}
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index c3a2ad0da43c..9804c0cdcb42 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -17,6 +17,7 @@
17#include <linux/parser.h> 17#include <linux/parser.h>
18#include <linux/statfs.h> 18#include <linux/statfs.h>
19#include <linux/random.h> 19#include <linux/random.h>
20#include <linux/sched.h>
20 21
21MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>"); 22MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
22MODULE_DESCRIPTION("Filesystem in Userspace"); 23MODULE_DESCRIPTION("Filesystem in Userspace");
@@ -453,6 +454,7 @@ static const struct super_operations fuse_super_operations = {
453 .destroy_inode = fuse_destroy_inode, 454 .destroy_inode = fuse_destroy_inode,
454 .read_inode = fuse_read_inode, 455 .read_inode = fuse_read_inode,
455 .clear_inode = fuse_clear_inode, 456 .clear_inode = fuse_clear_inode,
457 .drop_inode = generic_delete_inode,
456 .remount_fs = fuse_remount_fs, 458 .remount_fs = fuse_remount_fs,
457 .put_super = fuse_put_super, 459 .put_super = fuse_put_super,
458 .umount_begin = fuse_umount_begin, 460 .umount_begin = fuse_umount_begin,
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index 11477ca3a3c0..b3e152db70c8 100644
--- a/fs/gfs2/glock.h
+++ b/fs/gfs2/glock.h
@@ -10,6 +10,7 @@
10#ifndef __GLOCK_DOT_H__ 10#ifndef __GLOCK_DOT_H__
11#define __GLOCK_DOT_H__ 11#define __GLOCK_DOT_H__
12 12
13#include <linux/sched.h>
13#include "incore.h" 14#include "incore.h"
14 15
15/* Flags for lock requests; used in gfs2_holder gh_flag field. 16/* Flags for lock requests; used in gfs2_holder gh_flag field.
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index fafcba593871..9a934db0bd8a 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -13,6 +13,7 @@
13 13
14#include <linux/pagemap.h> 14#include <linux/pagemap.h>
15#include <linux/mpage.h> 15#include <linux/mpage.h>
16#include <linux/sched.h>
16 17
17#include "hfs_fs.h" 18#include "hfs_fs.h"
18#include "btree.h" 19#include "btree.h"
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 642012ac3370..45dab5d6cc10 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -12,6 +12,7 @@
12#include <linux/fs.h> 12#include <linux/fs.h>
13#include <linux/pagemap.h> 13#include <linux/pagemap.h>
14#include <linux/mpage.h> 14#include <linux/mpage.h>
15#include <linux/sched.h>
15 16
16#include "hfsplus_fs.h" 17#include "hfsplus_fs.h"
17#include "hfsplus_raw.h" 18#include "hfsplus_raw.h"
diff --git a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c
index b52b7381d10f..b6fca543544c 100644
--- a/fs/hpfs/buffer.c
+++ b/fs/hpfs/buffer.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * general buffer i/o 6 * general buffer i/o
7 */ 7 */
8 8#include <linux/sched.h>
9#include "hpfs_fn.h" 9#include "hpfs_fn.h"
10 10
11void hpfs_lock_creation(struct super_block *s) 11void hpfs_lock_creation(struct super_block *s)
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index 9953cf9a2f16..d256559b4104 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * adding & removing files & directories 6 * adding & removing files & directories
7 */ 7 */
8 8#include <linux/sched.h>
9#include "hpfs_fn.h" 9#include "hpfs_fn.h"
10 10
11static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 11static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index fca1165d7192..29cc34abb2ea 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -12,6 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/statfs.h> 13#include <linux/statfs.h>
14#include <linux/magic.h> 14#include <linux/magic.h>
15#include <linux/sched.h>
15 16
16/* Mark the filesystem dirty, so that chkdsk checks it when os/2 booted */ 17/* Mark the filesystem dirty, so that chkdsk checks it when os/2 booted */
17 18
diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c
index c4a554df7b7e..99a12f127769 100644
--- a/fs/minix/bitmap.c
+++ b/fs/minix/bitmap.c
@@ -15,6 +15,7 @@
15#include <linux/smp_lock.h> 15#include <linux/smp_lock.h>
16#include <linux/buffer_head.h> 16#include <linux/buffer_head.h>
17#include <linux/bitops.h> 17#include <linux/bitops.h>
18#include <linux/sched.h>
18 19
19static int nibblemap[] = { 4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0 }; 20static int nibblemap[] = { 4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0 };
20 21
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c
index addfd3147ea7..d3152f8d95c6 100644
--- a/fs/ncpfs/file.c
+++ b/fs/ncpfs/file.c
@@ -17,6 +17,7 @@
17#include <linux/mm.h> 17#include <linux/mm.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
20#include <linux/sched.h>
20 21
21#include <linux/ncp_fs.h> 22#include <linux/ncp_fs.h>
22#include "ncplib_kernel.h" 23#include "ncplib_kernel.h"
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c
index 8843a83d4ef0..c67b4bdcf719 100644
--- a/fs/ncpfs/ioctl.c
+++ b/fs/ncpfs/ioctl.c
@@ -17,6 +17,7 @@
17#include <linux/highuid.h> 17#include <linux/highuid.h>
18#include <linux/smp_lock.h> 18#include <linux/smp_lock.h>
19#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
20#include <linux/sched.h>
20 21
21#include <linux/ncp_fs.h> 22#include <linux/ncp_fs.h>
22 23
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 50c6821bad26..881fa4900923 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -12,7 +12,7 @@
12 12
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/init.h> 14#include <linux/init.h>
15 15#include <linux/sched.h>
16#include <linux/time.h> 16#include <linux/time.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index ac92e45432a3..c27258b5d3e1 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -33,6 +33,7 @@
33#include <linux/pagevec.h> 33#include <linux/pagevec.h>
34#include <linux/namei.h> 34#include <linux/namei.h>
35#include <linux/mount.h> 35#include <linux/mount.h>
36#include <linux/sched.h>
36 37
37#include "nfs4_fs.h" 38#include "nfs4_fs.h"
38#include "delegation.h" 39#include "delegation.h"
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 345aa5c0f382..00eee87510fe 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -122,19 +122,25 @@ ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_
122 return -EINVAL; 122 return -EINVAL;
123} 123}
124 124
125static void nfs_direct_dirty_pages(struct page **pages, int npages) 125static void nfs_direct_dirty_pages(struct page **pages, unsigned int pgbase, size_t count)
126{ 126{
127 int i; 127 unsigned int npages;
128 unsigned int i;
129
130 if (count == 0)
131 return;
132 pages += (pgbase >> PAGE_SHIFT);
133 npages = (count + (pgbase & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT;
128 for (i = 0; i < npages; i++) { 134 for (i = 0; i < npages; i++) {
129 struct page *page = pages[i]; 135 struct page *page = pages[i];
130 if (!PageCompound(page)) 136 if (!PageCompound(page))
131 set_page_dirty_lock(page); 137 set_page_dirty(page);
132 } 138 }
133} 139}
134 140
135static void nfs_direct_release_pages(struct page **pages, int npages) 141static void nfs_direct_release_pages(struct page **pages, unsigned int npages)
136{ 142{
137 int i; 143 unsigned int i;
138 for (i = 0; i < npages; i++) 144 for (i = 0; i < npages; i++)
139 page_cache_release(pages[i]); 145 page_cache_release(pages[i]);
140} 146}
@@ -162,7 +168,7 @@ static inline struct nfs_direct_req *nfs_direct_req_alloc(void)
162 return dreq; 168 return dreq;
163} 169}
164 170
165static void nfs_direct_req_release(struct kref *kref) 171static void nfs_direct_req_free(struct kref *kref)
166{ 172{
167 struct nfs_direct_req *dreq = container_of(kref, struct nfs_direct_req, kref); 173 struct nfs_direct_req *dreq = container_of(kref, struct nfs_direct_req, kref);
168 174
@@ -171,6 +177,11 @@ static void nfs_direct_req_release(struct kref *kref)
171 kmem_cache_free(nfs_direct_cachep, dreq); 177 kmem_cache_free(nfs_direct_cachep, dreq);
172} 178}
173 179
180static void nfs_direct_req_release(struct nfs_direct_req *dreq)
181{
182 kref_put(&dreq->kref, nfs_direct_req_free);
183}
184
174/* 185/*
175 * Collects and returns the final error value/byte-count. 186 * Collects and returns the final error value/byte-count.
176 */ 187 */
@@ -190,7 +201,6 @@ static ssize_t nfs_direct_wait(struct nfs_direct_req *dreq)
190 result = dreq->count; 201 result = dreq->count;
191 202
192out: 203out:
193 kref_put(&dreq->kref, nfs_direct_req_release);
194 return (ssize_t) result; 204 return (ssize_t) result;
195} 205}
196 206
@@ -208,7 +218,7 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq)
208 } 218 }
209 complete_all(&dreq->completion); 219 complete_all(&dreq->completion);
210 220
211 kref_put(&dreq->kref, nfs_direct_req_release); 221 nfs_direct_req_release(dreq);
212} 222}
213 223
214/* 224/*
@@ -224,17 +234,18 @@ static void nfs_direct_read_result(struct rpc_task *task, void *calldata)
224 if (nfs_readpage_result(task, data) != 0) 234 if (nfs_readpage_result(task, data) != 0)
225 return; 235 return;
226 236
227 nfs_direct_dirty_pages(data->pagevec, data->npages);
228 nfs_direct_release_pages(data->pagevec, data->npages);
229
230 spin_lock(&dreq->lock); 237 spin_lock(&dreq->lock);
231 238 if (unlikely(task->tk_status < 0)) {
232 if (likely(task->tk_status >= 0))
233 dreq->count += data->res.count;
234 else
235 dreq->error = task->tk_status; 239 dreq->error = task->tk_status;
236 240 spin_unlock(&dreq->lock);
237 spin_unlock(&dreq->lock); 241 } else {
242 dreq->count += data->res.count;
243 spin_unlock(&dreq->lock);
244 nfs_direct_dirty_pages(data->pagevec,
245 data->args.pgbase,
246 data->res.count);
247 }
248 nfs_direct_release_pages(data->pagevec, data->npages);
238 249
239 if (put_dreq(dreq)) 250 if (put_dreq(dreq))
240 nfs_direct_complete(dreq); 251 nfs_direct_complete(dreq);
@@ -279,9 +290,12 @@ static ssize_t nfs_direct_read_schedule(struct nfs_direct_req *dreq, unsigned lo
279 result = get_user_pages(current, current->mm, user_addr, 290 result = get_user_pages(current, current->mm, user_addr,
280 data->npages, 1, 0, data->pagevec, NULL); 291 data->npages, 1, 0, data->pagevec, NULL);
281 up_read(&current->mm->mmap_sem); 292 up_read(&current->mm->mmap_sem);
282 if (unlikely(result < data->npages)) { 293 if (result < 0) {
283 if (result > 0) 294 nfs_readdata_release(data);
284 nfs_direct_release_pages(data->pagevec, result); 295 break;
296 }
297 if ((unsigned)result < data->npages) {
298 nfs_direct_release_pages(data->pagevec, result);
285 nfs_readdata_release(data); 299 nfs_readdata_release(data);
286 break; 300 break;
287 } 301 }
@@ -359,6 +373,7 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size
359 if (!result) 373 if (!result)
360 result = nfs_direct_wait(dreq); 374 result = nfs_direct_wait(dreq);
361 rpc_clnt_sigunmask(clnt, &oldset); 375 rpc_clnt_sigunmask(clnt, &oldset);
376 nfs_direct_req_release(dreq);
362 377
363 return result; 378 return result;
364} 379}
@@ -610,9 +625,12 @@ static ssize_t nfs_direct_write_schedule(struct nfs_direct_req *dreq, unsigned l
610 result = get_user_pages(current, current->mm, user_addr, 625 result = get_user_pages(current, current->mm, user_addr,
611 data->npages, 0, 0, data->pagevec, NULL); 626 data->npages, 0, 0, data->pagevec, NULL);
612 up_read(&current->mm->mmap_sem); 627 up_read(&current->mm->mmap_sem);
613 if (unlikely(result < data->npages)) { 628 if (result < 0) {
614 if (result > 0) 629 nfs_writedata_release(data);
615 nfs_direct_release_pages(data->pagevec, result); 630 break;
631 }
632 if ((unsigned)result < data->npages) {
633 nfs_direct_release_pages(data->pagevec, result);
616 nfs_writedata_release(data); 634 nfs_writedata_release(data);
617 break; 635 break;
618 } 636 }
@@ -703,6 +721,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, siz
703 if (!result) 721 if (!result)
704 result = nfs_direct_wait(dreq); 722 result = nfs_direct_wait(dreq);
705 rpc_clnt_sigunmask(clnt, &oldset); 723 rpc_clnt_sigunmask(clnt, &oldset);
724 nfs_direct_req_release(dreq);
706 725
707 return result; 726 return result;
708} 727}
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 5eaee6dd040b..9eb8eb4e4a08 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -27,6 +27,7 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/pagemap.h> 28#include <linux/pagemap.h>
29#include <linux/smp_lock.h> 29#include <linux/smp_lock.h>
30#include <linux/aio.h>
30 31
31#include <asm/uaccess.h> 32#include <asm/uaccess.h>
32#include <asm/system.h> 33#include <asm/system.h>
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 2b26ad7c9770..bd9f5a836592 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -15,7 +15,7 @@
15 15
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/init.h> 17#include <linux/init.h>
18 18#include <linux/sched.h>
19#include <linux/time.h> 19#include <linux/time.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index e12054c86d0d..c5bb51a29e80 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/file.h> 13#include <linux/file.h>
14#include <linux/sched.h>
14#include <linux/sunrpc/clnt.h> 15#include <linux/sunrpc/clnt.h>
15#include <linux/nfs3.h> 16#include <linux/nfs3.h>
16#include <linux/nfs4.h> 17#include <linux/nfs4.h>
@@ -354,6 +355,26 @@ void nfs_pageio_complete(struct nfs_pageio_descriptor *desc)
354 nfs_pageio_doio(desc); 355 nfs_pageio_doio(desc);
355} 356}
356 357
358/**
359 * nfs_pageio_cond_complete - Conditional I/O completion
360 * @desc: pointer to io descriptor
361 * @index: page index
362 *
363 * It is important to ensure that processes don't try to take locks
364 * on non-contiguous ranges of pages as that might deadlock. This
365 * function should be called before attempting to wait on a locked
366 * nfs_page. It will complete the I/O if the page index 'index'
367 * is not contiguous with the existing list of pages in 'desc'.
368 */
369void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *desc, pgoff_t index)
370{
371 if (!list_empty(&desc->pg_list)) {
372 struct nfs_page *prev = nfs_list_entry(desc->pg_list.prev);
373 if (index != prev->wb_index + 1)
374 nfs_pageio_doio(desc);
375 }
376}
377
357#define NFS_SCAN_MAXENTRIES 16 378#define NFS_SCAN_MAXENTRIES 16
358/** 379/**
359 * nfs_scan_list - Scan a list for matching requests 380 * nfs_scan_list - Scan a list for matching requests
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index b084c03ce493..af344a158e01 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -273,8 +273,6 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,
273 * request as dirty (in which case we don't care). 273 * request as dirty (in which case we don't care).
274 */ 274 */
275 spin_unlock(req_lock); 275 spin_unlock(req_lock);
276 /* Prevent deadlock! */
277 nfs_pageio_complete(pgio);
278 ret = nfs_wait_on_request(req); 276 ret = nfs_wait_on_request(req);
279 nfs_release_request(req); 277 nfs_release_request(req);
280 if (ret != 0) 278 if (ret != 0)
@@ -321,6 +319,8 @@ static int nfs_writepage_locked(struct page *page, struct writeback_control *wbc
321 pgio = &mypgio; 319 pgio = &mypgio;
322 } 320 }
323 321
322 nfs_pageio_cond_complete(pgio, page->index);
323
324 err = nfs_page_async_flush(pgio, page); 324 err = nfs_page_async_flush(pgio, page);
325 if (err <= 0) 325 if (err <= 0)
326 goto out; 326 goto out;
@@ -329,6 +329,8 @@ static int nfs_writepage_locked(struct page *page, struct writeback_control *wbc
329 if (!offset) 329 if (!offset)
330 goto out; 330 goto out;
331 331
332 nfs_pageio_cond_complete(pgio, page->index);
333
332 ctx = nfs_find_open_context(inode, NULL, FMODE_WRITE); 334 ctx = nfs_find_open_context(inode, NULL, FMODE_WRITE);
333 if (ctx == NULL) { 335 if (ctx == NULL) {
334 err = -EBADF; 336 err = -EBADF;
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 32ffea033c7a..864090edc28b 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -38,6 +38,7 @@
38#include <linux/inet.h> 38#include <linux/inet.h>
39#include <linux/errno.h> 39#include <linux/errno.h>
40#include <linux/delay.h> 40#include <linux/delay.h>
41#include <linux/sched.h>
41#include <linux/sunrpc/xdr.h> 42#include <linux/sunrpc/xdr.h>
42#include <linux/sunrpc/svc.h> 43#include <linux/sunrpc/svc.h>
43#include <linux/sunrpc/clnt.h> 44#include <linux/sunrpc/clnt.h>
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index c7774e3a9469..ebd03cc07479 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -45,7 +45,7 @@
45#include <asm/uaccess.h> 45#include <asm/uaccess.h>
46#include <asm/scatterlist.h> 46#include <asm/scatterlist.h>
47#include <linux/crypto.h> 47#include <linux/crypto.h>
48 48#include <linux/sched.h>
49 49
50#define NFSDDBG_FACILITY NFSDDBG_PROC 50#define NFSDDBG_FACILITY NFSDDBG_PROC
51 51
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index d7759ce6ed94..ff55950efb43 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -9,7 +9,7 @@
9 */ 9 */
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12 12#include <linux/sched.h>
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/nfs.h> 15#include <linux/nfs.h>
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index 39a1669506bd..7ed56390b582 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -26,6 +26,7 @@
26#include <linux/swap.h> 26#include <linux/swap.h>
27#include <linux/uio.h> 27#include <linux/uio.h>
28#include <linux/writeback.h> 28#include <linux/writeback.h>
29#include <linux/sched.h>
29 30
30#include <asm/page.h> 31#include <asm/page.h>
31#include <asm/uaccess.h> 32#include <asm/uaccess.h>
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index 074791ce4ab2..b532a730cec2 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -140,7 +140,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
140 if (!ni->name) 140 if (!ni->name)
141 return -ENOMEM; 141 return -ENOMEM;
142 memcpy(ni->name, na->name, i); 142 memcpy(ni->name, na->name, i);
143 ni->name[i] = 0; 143 ni->name[na->name_len] = 0;
144 } 144 }
145 return 0; 145 return 0;
146} 146}
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 8e7cafb5fc6c..0023b31e48a8 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -222,7 +222,10 @@ static int ocfs2_readpage(struct file *file, struct page *page)
222 goto out; 222 goto out;
223 } 223 }
224 224
225 down_read(&OCFS2_I(inode)->ip_alloc_sem); 225 if (down_read_trylock(&OCFS2_I(inode)->ip_alloc_sem) == 0) {
226 ret = AOP_TRUNCATED_PAGE;
227 goto out_meta_unlock;
228 }
226 229
227 /* 230 /*
228 * i_size might have just been updated as we grabed the meta lock. We 231 * i_size might have just been updated as we grabed the meta lock. We
@@ -235,10 +238,7 @@ static int ocfs2_readpage(struct file *file, struct page *page)
235 * XXX sys_readahead() seems to get that wrong? 238 * XXX sys_readahead() seems to get that wrong?
236 */ 239 */
237 if (start >= i_size_read(inode)) { 240 if (start >= i_size_read(inode)) {
238 char *addr = kmap(page); 241 zero_user_page(page, 0, PAGE_SIZE, KM_USER0);
239 memset(addr, 0, PAGE_SIZE);
240 flush_dcache_page(page);
241 kunmap(page);
242 SetPageUptodate(page); 242 SetPageUptodate(page);
243 ret = 0; 243 ret = 0;
244 goto out_alloc; 244 goto out_alloc;
@@ -258,6 +258,7 @@ static int ocfs2_readpage(struct file *file, struct page *page)
258 ocfs2_data_unlock(inode, 0); 258 ocfs2_data_unlock(inode, 0);
259out_alloc: 259out_alloc:
260 up_read(&OCFS2_I(inode)->ip_alloc_sem); 260 up_read(&OCFS2_I(inode)->ip_alloc_sem);
261out_meta_unlock:
261 ocfs2_meta_unlock(inode, 0); 262 ocfs2_meta_unlock(inode, 0);
262out: 263out:
263 if (unlock) 264 if (unlock)
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 9395b4fa547d..ac6c96431bbc 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -326,6 +326,7 @@ static int ocfs2_truncate_file(struct inode *inode,
326 (unsigned long long)OCFS2_I(inode)->ip_blkno, 326 (unsigned long long)OCFS2_I(inode)->ip_blkno,
327 (unsigned long long)new_i_size); 327 (unsigned long long)new_i_size);
328 328
329 unmap_mapping_range(inode->i_mapping, new_i_size + PAGE_SIZE - 1, 0, 1);
329 truncate_inode_pages(inode->i_mapping, new_i_size); 330 truncate_inode_pages(inode->i_mapping, new_i_size);
330 331
331 fe = (struct ocfs2_dinode *) di_bh->b_data; 332 fe = (struct ocfs2_dinode *) di_bh->b_data;
@@ -1418,36 +1419,6 @@ out:
1418 return total ? total : ret; 1419 return total ? total : ret;
1419} 1420}
1420 1421
1421static int ocfs2_check_iovec(const struct iovec *iov, size_t *counted,
1422 unsigned long *nr_segs)
1423{
1424 size_t ocount; /* original count */
1425 unsigned long seg;
1426
1427 ocount = 0;
1428 for (seg = 0; seg < *nr_segs; seg++) {
1429 const struct iovec *iv = &iov[seg];
1430
1431 /*
1432 * If any segment has a negative length, or the cumulative
1433 * length ever wraps negative then return -EINVAL.
1434 */
1435 ocount += iv->iov_len;
1436 if (unlikely((ssize_t)(ocount|iv->iov_len) < 0))
1437 return -EINVAL;
1438 if (access_ok(VERIFY_READ, iv->iov_base, iv->iov_len))
1439 continue;
1440 if (seg == 0)
1441 return -EFAULT;
1442 *nr_segs = seg;
1443 ocount -= iv->iov_len; /* This segment is no good */
1444 break;
1445 }
1446
1447 *counted = ocount;
1448 return 0;
1449}
1450
1451static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, 1422static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
1452 const struct iovec *iov, 1423 const struct iovec *iov,
1453 unsigned long nr_segs, 1424 unsigned long nr_segs,
@@ -1470,7 +1441,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
1470 if (iocb->ki_left == 0) 1441 if (iocb->ki_left == 0)
1471 return 0; 1442 return 0;
1472 1443
1473 ret = ocfs2_check_iovec(iov, &ocount, &nr_segs); 1444 ret = generic_segment_checks(iov, &nr_segs, &ocount, VERIFY_READ);
1474 if (ret) 1445 if (ret)
1475 return ret; 1446 return ret;
1476 1447
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
index 4dedd9789108..545f7892cdf3 100644
--- a/fs/ocfs2/localalloc.c
+++ b/fs/ocfs2/localalloc.c
@@ -471,9 +471,6 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
471 471
472 mutex_lock(&local_alloc_inode->i_mutex); 472 mutex_lock(&local_alloc_inode->i_mutex);
473 473
474 ac->ac_inode = local_alloc_inode;
475 ac->ac_which = OCFS2_AC_USE_LOCAL;
476
477 if (osb->local_alloc_state != OCFS2_LA_ENABLED) { 474 if (osb->local_alloc_state != OCFS2_LA_ENABLED) {
478 status = -ENOSPC; 475 status = -ENOSPC;
479 goto bail; 476 goto bail;
@@ -511,10 +508,14 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
511 } 508 }
512 } 509 }
513 510
511 ac->ac_inode = local_alloc_inode;
512 ac->ac_which = OCFS2_AC_USE_LOCAL;
514 get_bh(osb->local_alloc_bh); 513 get_bh(osb->local_alloc_bh);
515 ac->ac_bh = osb->local_alloc_bh; 514 ac->ac_bh = osb->local_alloc_bh;
516 status = 0; 515 status = 0;
517bail: 516bail:
517 if (status < 0 && local_alloc_inode)
518 iput(local_alloc_inode);
518 519
519 mlog_exit(status); 520 mlog_exit(status);
520 return status; 521 return status;
diff --git a/fs/partitions/Kconfig b/fs/partitions/Kconfig
index 7638a1c42a7d..a99acd8de353 100644
--- a/fs/partitions/Kconfig
+++ b/fs/partitions/Kconfig
@@ -166,8 +166,12 @@ config LDM_PARTITION
166 depends on PARTITION_ADVANCED 166 depends on PARTITION_ADVANCED
167 ---help--- 167 ---help---
168 Say Y here if you would like to use hard disks under Linux which 168 Say Y here if you would like to use hard disks under Linux which
169 were partitioned using Windows 2000's or XP's Logical Disk Manager. 169 were partitioned using Windows 2000's/XP's or Vista's Logical Disk
170 They are also known as "Dynamic Disks". 170 Manager. They are also known as "Dynamic Disks".
171
172 Note this driver only supports Dynamic Disks with a protective MBR
173 label, i.e. DOS partition table. It does not support GPT labelled
174 Dynamic Disks yet as can be created with Vista.
171 175
172 Windows 2000 introduced the concept of Dynamic Disks to get around 176 Windows 2000 introduced the concept of Dynamic Disks to get around
173 the limitations of the PC's partitioning scheme. The Logical Disk 177 the limitations of the PC's partitioning scheme. The Logical Disk
@@ -175,8 +179,8 @@ config LDM_PARTITION
175 mirrored, striped or RAID volumes, all without the need for 179 mirrored, striped or RAID volumes, all without the need for
176 rebooting. 180 rebooting.
177 181
178 Normal partitions are now called Basic Disks under Windows 2000 and 182 Normal partitions are now called Basic Disks under Windows 2000, XP,
179 XP. 183 and Vista.
180 184
181 For a fuller description read <file:Documentation/ldm.txt>. 185 For a fuller description read <file:Documentation/ldm.txt>.
182 186
diff --git a/fs/partitions/ldm.c b/fs/partitions/ldm.c
index 1a60926a4ccd..99873a2b4cbc 100644
--- a/fs/partitions/ldm.c
+++ b/fs/partitions/ldm.c
@@ -2,10 +2,10 @@
2 * ldm - Support for Windows Logical Disk Manager (Dynamic Disks) 2 * ldm - Support for Windows Logical Disk Manager (Dynamic Disks)
3 * 3 *
4 * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org> 4 * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org>
5 * Copyright (c) 2001-2004 Anton Altaparmakov 5 * Copyright (c) 2001-2007 Anton Altaparmakov
6 * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com> 6 * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com>
7 * 7 *
8 * Documentation is available at http://linux-ntfs.sf.net/ldm 8 * Documentation is available at http://www.linux-ntfs.org/content/view/19/37/
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it under 10 * This program is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License as published by the Free Software 11 * the terms of the GNU General Public License as published by the Free Software
@@ -62,7 +62,6 @@ static void _ldm_printk (const char *level, const char *function,
62 printk ("%s%s(): %s\n", level, function, buf); 62 printk ("%s%s(): %s\n", level, function, buf);
63} 63}
64 64
65
66/** 65/**
67 * ldm_parse_hexbyte - Convert a ASCII hex number to a byte 66 * ldm_parse_hexbyte - Convert a ASCII hex number to a byte
68 * @src: Pointer to at least 2 characters to convert. 67 * @src: Pointer to at least 2 characters to convert.
@@ -118,7 +117,6 @@ static bool ldm_parse_guid (const u8 *src, u8 *dest)
118 return true; 117 return true;
119} 118}
120 119
121
122/** 120/**
123 * ldm_parse_privhead - Read the LDM Database PRIVHEAD structure 121 * ldm_parse_privhead - Read the LDM Database PRIVHEAD structure
124 * @data: Raw database PRIVHEAD structure loaded from the device 122 * @data: Raw database PRIVHEAD structure loaded from the device
@@ -130,46 +128,48 @@ static bool ldm_parse_guid (const u8 *src, u8 *dest)
130 * Return: 'true' @ph contains the PRIVHEAD data 128 * Return: 'true' @ph contains the PRIVHEAD data
131 * 'false' @ph contents are undefined 129 * 'false' @ph contents are undefined
132 */ 130 */
133static bool ldm_parse_privhead (const u8 *data, struct privhead *ph) 131static bool ldm_parse_privhead(const u8 *data, struct privhead *ph)
134{ 132{
135 BUG_ON (!data || !ph); 133 bool is_vista = false;
136 134
137 if (MAGIC_PRIVHEAD != BE64 (data)) { 135 BUG_ON(!data || !ph);
138 ldm_error ("Cannot find PRIVHEAD structure. LDM database is" 136 if (MAGIC_PRIVHEAD != BE64(data)) {
137 ldm_error("Cannot find PRIVHEAD structure. LDM database is"
139 " corrupt. Aborting."); 138 " corrupt. Aborting.");
140 return false; 139 return false;
141 } 140 }
142 141 ph->ver_major = BE16(data + 0x000C);
143 ph->ver_major = BE16 (data + 0x000C); 142 ph->ver_minor = BE16(data + 0x000E);
144 ph->ver_minor = BE16 (data + 0x000E); 143 ph->logical_disk_start = BE64(data + 0x011B);
145 ph->logical_disk_start = BE64 (data + 0x011B); 144 ph->logical_disk_size = BE64(data + 0x0123);
146 ph->logical_disk_size = BE64 (data + 0x0123); 145 ph->config_start = BE64(data + 0x012B);
147 ph->config_start = BE64 (data + 0x012B); 146 ph->config_size = BE64(data + 0x0133);
148 ph->config_size = BE64 (data + 0x0133); 147 /* Version 2.11 is Win2k/XP and version 2.12 is Vista. */
149 148 if (ph->ver_major == 2 && ph->ver_minor == 12)
150 if ((ph->ver_major != 2) || (ph->ver_minor != 11)) { 149 is_vista = true;
151 ldm_error ("Expected PRIVHEAD version %d.%d, got %d.%d." 150 if (!is_vista && (ph->ver_major != 2 || ph->ver_minor != 11)) {
152 " Aborting.", 2, 11, ph->ver_major, ph->ver_minor); 151 ldm_error("Expected PRIVHEAD version 2.11 or 2.12, got %d.%d."
152 " Aborting.", ph->ver_major, ph->ver_minor);
153 return false; 153 return false;
154 } 154 }
155 ldm_debug("PRIVHEAD version %d.%d (Windows %s).", ph->ver_major,
156 ph->ver_minor, is_vista ? "Vista" : "2000/XP");
155 if (ph->config_size != LDM_DB_SIZE) { /* 1 MiB in sectors. */ 157 if (ph->config_size != LDM_DB_SIZE) { /* 1 MiB in sectors. */
156 /* Warn the user and continue, carefully */ 158 /* Warn the user and continue, carefully. */
157 ldm_info ("Database is normally %u bytes, it claims to " 159 ldm_info("Database is normally %u bytes, it claims to "
158 "be %llu bytes.", LDM_DB_SIZE, 160 "be %llu bytes.", LDM_DB_SIZE,
159 (unsigned long long)ph->config_size ); 161 (unsigned long long)ph->config_size);
160 } 162 }
161 if ((ph->logical_disk_size == 0) || 163 if ((ph->logical_disk_size == 0) || (ph->logical_disk_start +
162 (ph->logical_disk_start + ph->logical_disk_size > ph->config_start)) { 164 ph->logical_disk_size > ph->config_start)) {
163 ldm_error ("PRIVHEAD disk size doesn't match real disk size"); 165 ldm_error("PRIVHEAD disk size doesn't match real disk size");
164 return false; 166 return false;
165 } 167 }
166 168 if (!ldm_parse_guid(data + 0x0030, ph->disk_id)) {
167 if (!ldm_parse_guid (data + 0x0030, ph->disk_id)) { 169 ldm_error("PRIVHEAD contains an invalid GUID.");
168 ldm_error ("PRIVHEAD contains an invalid GUID.");
169 return false; 170 return false;
170 } 171 }
171 172 ldm_debug("Parsed PRIVHEAD successfully.");
172 ldm_debug ("Parsed PRIVHEAD successfully.");
173 return true; 173 return true;
174} 174}
175 175
@@ -409,7 +409,7 @@ out:
409 * Return: 'true' @toc1 contains validated TOCBLOCK info 409 * Return: 'true' @toc1 contains validated TOCBLOCK info
410 * 'false' @toc1 contents are undefined 410 * 'false' @toc1 contents are undefined
411 */ 411 */
412static bool ldm_validate_tocblocks (struct block_device *bdev, 412static bool ldm_validate_tocblocks(struct block_device *bdev,
413 unsigned long base, struct ldmdb *ldb) 413 unsigned long base, struct ldmdb *ldb)
414{ 414{
415 static const int off[4] = { OFF_TOCB1, OFF_TOCB2, OFF_TOCB3, OFF_TOCB4}; 415 static const int off[4] = { OFF_TOCB1, OFF_TOCB2, OFF_TOCB3, OFF_TOCB4};
@@ -417,54 +417,57 @@ static bool ldm_validate_tocblocks (struct block_device *bdev,
417 struct privhead *ph; 417 struct privhead *ph;
418 Sector sect; 418 Sector sect;
419 u8 *data; 419 u8 *data;
420 int i, nr_tbs;
420 bool result = false; 421 bool result = false;
421 int i;
422 422
423 BUG_ON (!bdev || !ldb); 423 BUG_ON(!bdev || !ldb);
424 424 ph = &ldb->ph;
425 ph = &ldb->ph;
426 tb[0] = &ldb->toc; 425 tb[0] = &ldb->toc;
427 tb[1] = kmalloc (sizeof (*tb[1]), GFP_KERNEL); 426 tb[1] = kmalloc(sizeof(*tb[1]) * 3, GFP_KERNEL);
428 tb[2] = kmalloc (sizeof (*tb[2]), GFP_KERNEL); 427 if (!tb[1]) {
429 tb[3] = kmalloc (sizeof (*tb[3]), GFP_KERNEL); 428 ldm_crit("Out of memory.");
430 if (!tb[1] || !tb[2] || !tb[3]) { 429 goto err;
431 ldm_crit ("Out of memory.");
432 goto out;
433 } 430 }
434 431 tb[2] = (struct tocblock*)((u8*)tb[1] + sizeof(*tb[1]));
435 for (i = 0; i < 4; i++) /* Read and parse all four toc's. */ 432 tb[3] = (struct tocblock*)((u8*)tb[2] + sizeof(*tb[2]));
436 { 433 /*
437 data = read_dev_sector (bdev, base + off[i], &sect); 434 * Try to read and parse all four TOCBLOCKs.
435 *
436 * Windows Vista LDM v2.12 does not always have all four TOCBLOCKs so
437 * skip any that fail as long as we get at least one valid TOCBLOCK.
438 */
439 for (nr_tbs = i = 0; i < 4; i++) {
440 data = read_dev_sector(bdev, base + off[i], &sect);
438 if (!data) { 441 if (!data) {
439 ldm_crit ("Disk read failed."); 442 ldm_error("Disk read failed for TOCBLOCK %d.", i);
440 goto out; 443 continue;
441 } 444 }
442 result = ldm_parse_tocblock (data, tb[i]); 445 if (ldm_parse_tocblock(data, tb[nr_tbs]))
443 put_dev_sector (sect); 446 nr_tbs++;
444 if (!result) 447 put_dev_sector(sect);
445 goto out; /* Already logged */
446 } 448 }
447 449 if (!nr_tbs) {
448 /* Range check the toc against a privhead. */ 450 ldm_crit("Failed to find a valid TOCBLOCK.");
451 goto err;
452 }
453 /* Range check the TOCBLOCK against a privhead. */
449 if (((tb[0]->bitmap1_start + tb[0]->bitmap1_size) > ph->config_size) || 454 if (((tb[0]->bitmap1_start + tb[0]->bitmap1_size) > ph->config_size) ||
450 ((tb[0]->bitmap2_start + tb[0]->bitmap2_size) > ph->config_size)) { 455 ((tb[0]->bitmap2_start + tb[0]->bitmap2_size) >
451 ldm_crit ("The bitmaps are out of range. Giving up."); 456 ph->config_size)) {
452 goto out; 457 ldm_crit("The bitmaps are out of range. Giving up.");
458 goto err;
453 } 459 }
454 460 /* Compare all loaded TOCBLOCKs. */
455 if (!ldm_compare_tocblocks (tb[0], tb[1]) || /* Compare all tocs. */ 461 for (i = 1; i < nr_tbs; i++) {
456 !ldm_compare_tocblocks (tb[0], tb[2]) || 462 if (!ldm_compare_tocblocks(tb[0], tb[i])) {
457 !ldm_compare_tocblocks (tb[0], tb[3])) { 463 ldm_crit("TOCBLOCKs 0 and %d do not match.", i);
458 ldm_crit ("The TOCBLOCKs don't match."); 464 goto err;
459 goto out; 465 }
460 } 466 }
461 467 ldm_debug("Validated %d TOCBLOCKs successfully.", nr_tbs);
462 ldm_debug ("Validated TOCBLOCKs successfully.");
463 result = true; 468 result = true;
464out: 469err:
465 kfree (tb[1]); 470 kfree(tb[1]);
466 kfree (tb[2]);
467 kfree (tb[3]);
468 return result; 471 return result;
469} 472}
470 473
@@ -566,7 +569,7 @@ static bool ldm_validate_partition_table (struct block_device *bdev)
566 569
567 p = (struct partition*)(data + 0x01BE); 570 p = (struct partition*)(data + 0x01BE);
568 for (i = 0; i < 4; i++, p++) 571 for (i = 0; i < 4; i++, p++)
569 if (SYS_IND (p) == WIN2K_DYNAMIC_PARTITION) { 572 if (SYS_IND (p) == LDM_PARTITION) {
570 result = true; 573 result = true;
571 break; 574 break;
572 } 575 }
@@ -975,44 +978,68 @@ static bool ldm_parse_dsk4 (const u8 *buffer, int buflen, struct vblk *vb)
975 * Return: 'true' @vb contains a Partition VBLK 978 * Return: 'true' @vb contains a Partition VBLK
976 * 'false' @vb contents are not defined 979 * 'false' @vb contents are not defined
977 */ 980 */
978static bool ldm_parse_prt3 (const u8 *buffer, int buflen, struct vblk *vb) 981static bool ldm_parse_prt3(const u8 *buffer, int buflen, struct vblk *vb)
979{ 982{
980 int r_objid, r_name, r_size, r_parent, r_diskid, r_index, len; 983 int r_objid, r_name, r_size, r_parent, r_diskid, r_index, len;
981 struct vblk_part *part; 984 struct vblk_part *part;
982 985
983 BUG_ON (!buffer || !vb); 986 BUG_ON(!buffer || !vb);
984 987 r_objid = ldm_relative(buffer, buflen, 0x18, 0);
985 r_objid = ldm_relative (buffer, buflen, 0x18, 0); 988 if (r_objid < 0) {
986 r_name = ldm_relative (buffer, buflen, 0x18, r_objid); 989 ldm_error("r_objid %d < 0", r_objid);
987 r_size = ldm_relative (buffer, buflen, 0x34, r_name); 990 return false;
988 r_parent = ldm_relative (buffer, buflen, 0x34, r_size); 991 }
989 r_diskid = ldm_relative (buffer, buflen, 0x34, r_parent); 992 r_name = ldm_relative(buffer, buflen, 0x18, r_objid);
990 993 if (r_name < 0) {
994 ldm_error("r_name %d < 0", r_name);
995 return false;
996 }
997 r_size = ldm_relative(buffer, buflen, 0x34, r_name);
998 if (r_size < 0) {
999 ldm_error("r_size %d < 0", r_size);
1000 return false;
1001 }
1002 r_parent = ldm_relative(buffer, buflen, 0x34, r_size);
1003 if (r_parent < 0) {
1004 ldm_error("r_parent %d < 0", r_parent);
1005 return false;
1006 }
1007 r_diskid = ldm_relative(buffer, buflen, 0x34, r_parent);
1008 if (r_diskid < 0) {
1009 ldm_error("r_diskid %d < 0", r_diskid);
1010 return false;
1011 }
991 if (buffer[0x12] & VBLK_FLAG_PART_INDEX) { 1012 if (buffer[0x12] & VBLK_FLAG_PART_INDEX) {
992 r_index = ldm_relative (buffer, buflen, 0x34, r_diskid); 1013 r_index = ldm_relative(buffer, buflen, 0x34, r_diskid);
1014 if (r_index < 0) {
1015 ldm_error("r_index %d < 0", r_index);
1016 return false;
1017 }
993 len = r_index; 1018 len = r_index;
994 } else { 1019 } else {
995 r_index = 0; 1020 r_index = 0;
996 len = r_diskid; 1021 len = r_diskid;
997 } 1022 }
998 if (len < 0) 1023 if (len < 0) {
1024 ldm_error("len %d < 0", len);
999 return false; 1025 return false;
1000 1026 }
1001 len += VBLK_SIZE_PRT3; 1027 len += VBLK_SIZE_PRT3;
1002 if (len != BE32 (buffer + 0x14)) 1028 if (len > BE32(buffer + 0x14)) {
1029 ldm_error("len %d > BE32(buffer + 0x14) %d", len,
1030 BE32(buffer + 0x14));
1003 return false; 1031 return false;
1004 1032 }
1005 part = &vb->vblk.part; 1033 part = &vb->vblk.part;
1006 part->start = BE64 (buffer + 0x24 + r_name); 1034 part->start = BE64(buffer + 0x24 + r_name);
1007 part->volume_offset = BE64 (buffer + 0x2C + r_name); 1035 part->volume_offset = BE64(buffer + 0x2C + r_name);
1008 part->size = ldm_get_vnum (buffer + 0x34 + r_name); 1036 part->size = ldm_get_vnum(buffer + 0x34 + r_name);
1009 part->parent_id = ldm_get_vnum (buffer + 0x34 + r_size); 1037 part->parent_id = ldm_get_vnum(buffer + 0x34 + r_size);
1010 part->disk_id = ldm_get_vnum (buffer + 0x34 + r_parent); 1038 part->disk_id = ldm_get_vnum(buffer + 0x34 + r_parent);
1011 if (vb->flags & VBLK_FLAG_PART_INDEX) 1039 if (vb->flags & VBLK_FLAG_PART_INDEX)
1012 part->partnum = buffer[0x35 + r_diskid]; 1040 part->partnum = buffer[0x35 + r_diskid];
1013 else 1041 else
1014 part->partnum = 0; 1042 part->partnum = 0;
1015
1016 return true; 1043 return true;
1017} 1044}
1018 1045
@@ -1475,4 +1502,3 @@ out:
1475 kfree (ldb); 1502 kfree (ldb);
1476 return result; 1503 return result;
1477} 1504}
1478
diff --git a/fs/partitions/ldm.h b/fs/partitions/ldm.h
index 6e8d7952b8b5..d2e6a3046939 100644
--- a/fs/partitions/ldm.h
+++ b/fs/partitions/ldm.h
@@ -2,10 +2,10 @@
2 * ldm - Part of the Linux-NTFS project. 2 * ldm - Part of the Linux-NTFS project.
3 * 3 *
4 * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org> 4 * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org>
5 * Copyright (C) 2001 Anton Altaparmakov <aia21@cantab.net> 5 * Copyright (c) 2001-2007 Anton Altaparmakov
6 * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com> 6 * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com>
7 * 7 *
8 * Documentation is available at http://linux-ntfs.sf.net/ldm 8 * Documentation is available at http://www.linux-ntfs.org/content/view/19/37/
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 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 Free 11 * under the terms of the GNU General Public License as published by the Free
@@ -93,7 +93,7 @@ struct parsed_partitions;
93 93
94#define OFF_VMDB 17 /* List of partitions. */ 94#define OFF_VMDB 17 /* List of partitions. */
95 95
96#define WIN2K_DYNAMIC_PARTITION 0x42 /* Formerly SFS (Landis). */ 96#define LDM_PARTITION 0x42 /* Formerly SFS (Landis). */
97 97
98#define TOC_BITMAP1 "config" /* Names of the two defined */ 98#define TOC_BITMAP1 "config" /* Names of the two defined */
99#define TOC_BITMAP2 "log" /* bitmaps in the TOCBLOCK. */ 99#define TOC_BITMAP2 "log" /* bitmaps in the TOCBLOCK. */
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index 3b481d557edb..9345a46ffb32 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -179,7 +179,7 @@ static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size)
179 return ret; 179 return ret;
180 } 180 }
181 181
182 ret = vmtruncate(inode, size); 182 ret = vmtruncate(inode, newsize);
183 183
184 return ret; 184 return ret;
185} 185}
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 4ace5d72eae1..d40d22b347b7 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -32,7 +32,7 @@
32#include <linux/string.h> 32#include <linux/string.h>
33#include <linux/backing-dev.h> 33#include <linux/backing-dev.h>
34#include <linux/ramfs.h> 34#include <linux/ramfs.h>
35 35#include <linux/sched.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include "internal.h" 37#include "internal.h"
38 38
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c
index 9c23fee3bae9..ffbfc2caaf20 100644
--- a/fs/reiserfs/dir.c
+++ b/fs/reiserfs/dir.c
@@ -10,7 +10,7 @@
10#include <linux/buffer_head.h> 10#include <linux/buffer_head.h>
11#include <asm/uaccess.h> 11#include <asm/uaccess.h>
12 12
13extern struct reiserfs_key MIN_KEY; 13extern const struct reiserfs_key MIN_KEY;
14 14
15static int reiserfs_readdir(struct file *, void *, filldir_t); 15static int reiserfs_readdir(struct file *, void *, filldir_t);
16static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, 16static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry,
diff --git a/fs/signalfd.c b/fs/signalfd.c
index 7cfeab412b45..f1da89203a9a 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -11,6 +11,8 @@
11 * Now using anonymous inode source. 11 * Now using anonymous inode source.
12 * Thanks to Oleg Nesterov for useful code review and suggestions. 12 * Thanks to Oleg Nesterov for useful code review and suggestions.
13 * More comments and suggestions from Arnd Bergmann. 13 * More comments and suggestions from Arnd Bergmann.
14 * Sat May 19, 2007: Davi E. M. Arnaut <davi@haxent.com.br>
15 * Retrieve multiple signals with one read() call
14 */ 16 */
15 17
16#include <linux/file.h> 18#include <linux/file.h>
@@ -206,6 +208,59 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
206 return err ? -EFAULT: sizeof(*uinfo); 208 return err ? -EFAULT: sizeof(*uinfo);
207} 209}
208 210
211static ssize_t signalfd_dequeue(struct signalfd_ctx *ctx, siginfo_t *info,
212 int nonblock)
213{
214 ssize_t ret;
215 struct signalfd_lockctx lk;
216 DECLARE_WAITQUEUE(wait, current);
217
218 if (!signalfd_lock(ctx, &lk))
219 return 0;
220
221 ret = dequeue_signal(lk.tsk, &ctx->sigmask, info);
222 switch (ret) {
223 case 0:
224 if (!nonblock)
225 break;
226 ret = -EAGAIN;
227 default:
228 signalfd_unlock(&lk);
229 return ret;
230 }
231
232 add_wait_queue(&ctx->wqh, &wait);
233 for (;;) {
234 set_current_state(TASK_INTERRUPTIBLE);
235 ret = dequeue_signal(lk.tsk, &ctx->sigmask, info);
236 signalfd_unlock(&lk);
237 if (ret != 0)
238 break;
239 if (signal_pending(current)) {
240 ret = -ERESTARTSYS;
241 break;
242 }
243 schedule();
244 ret = signalfd_lock(ctx, &lk);
245 if (unlikely(!ret)) {
246 /*
247 * Let the caller read zero byte, ala socket
248 * recv() when the peer disconnect. This test
249 * must be done before doing a dequeue_signal(),
250 * because if the sighand has been orphaned,
251 * the dequeue_signal() call is going to crash
252 * because ->sighand will be long gone.
253 */
254 break;
255 }
256 }
257
258 remove_wait_queue(&ctx->wqh, &wait);
259 __set_current_state(TASK_RUNNING);
260
261 return ret;
262}
263
209/* 264/*
210 * Returns either the size of a "struct signalfd_siginfo", or zero if the 265 * Returns either the size of a "struct signalfd_siginfo", or zero if the
211 * sighand we are attached to, has been orphaned. The "count" parameter 266 * sighand we are attached to, has been orphaned. The "count" parameter
@@ -215,55 +270,30 @@ static ssize_t signalfd_read(struct file *file, char __user *buf, size_t count,
215 loff_t *ppos) 270 loff_t *ppos)
216{ 271{
217 struct signalfd_ctx *ctx = file->private_data; 272 struct signalfd_ctx *ctx = file->private_data;
218 ssize_t res = 0; 273 struct signalfd_siginfo __user *siginfo;
219 int locked, signo; 274 int nonblock = file->f_flags & O_NONBLOCK;
275 ssize_t ret, total = 0;
220 siginfo_t info; 276 siginfo_t info;
221 struct signalfd_lockctx lk;
222 DECLARE_WAITQUEUE(wait, current);
223 277
224 if (count < sizeof(struct signalfd_siginfo)) 278 count /= sizeof(struct signalfd_siginfo);
279 if (!count)
225 return -EINVAL; 280 return -EINVAL;
226 locked = signalfd_lock(ctx, &lk);
227 if (!locked)
228 return 0;
229 res = -EAGAIN;
230 signo = dequeue_signal(lk.tsk, &ctx->sigmask, &info);
231 if (signo == 0 && !(file->f_flags & O_NONBLOCK)) {
232 add_wait_queue(&ctx->wqh, &wait);
233 for (;;) {
234 set_current_state(TASK_INTERRUPTIBLE);
235 signo = dequeue_signal(lk.tsk, &ctx->sigmask, &info);
236 if (signo != 0)
237 break;
238 if (signal_pending(current)) {
239 res = -ERESTARTSYS;
240 break;
241 }
242 signalfd_unlock(&lk);
243 schedule();
244 locked = signalfd_lock(ctx, &lk);
245 if (unlikely(!locked)) {
246 /*
247 * Let the caller read zero byte, ala socket
248 * recv() when the peer disconnect. This test
249 * must be done before doing a dequeue_signal(),
250 * because if the sighand has been orphaned,
251 * the dequeue_signal() call is going to crash.
252 */
253 res = 0;
254 break;
255 }
256 }
257 remove_wait_queue(&ctx->wqh, &wait);
258 __set_current_state(TASK_RUNNING);
259 }
260 if (likely(locked))
261 signalfd_unlock(&lk);
262 if (likely(signo))
263 res = signalfd_copyinfo((struct signalfd_siginfo __user *) buf,
264 &info);
265 281
266 return res; 282 siginfo = (struct signalfd_siginfo __user *) buf;
283
284 do {
285 ret = signalfd_dequeue(ctx, &info, nonblock);
286 if (unlikely(ret <= 0))
287 break;
288 ret = signalfd_copyinfo(siginfo, &info);
289 if (ret < 0)
290 break;
291 siginfo++;
292 total += ret;
293 nonblock = 1;
294 } while (--count);
295
296 return total ? total : ret;
267} 297}
268 298
269static const struct file_operations signalfd_fops = { 299static const struct file_operations signalfd_fops = {
diff --git a/fs/smbfs/dir.c b/fs/smbfs/dir.c
index 50136b1a3eca..48da4fa6b7d4 100644
--- a/fs/smbfs/dir.c
+++ b/fs/smbfs/dir.c
@@ -13,6 +13,7 @@
13#include <linux/smp_lock.h> 13#include <linux/smp_lock.h>
14#include <linux/ctype.h> 14#include <linux/ctype.h>
15#include <linux/net.h> 15#include <linux/net.h>
16#include <linux/sched.h>
16 17
17#include <linux/smb_fs.h> 18#include <linux/smb_fs.h>
18#include <linux/smb_mount.h> 19#include <linux/smb_mount.h>
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c
index f161797160c4..aea3f8aa54c0 100644
--- a/fs/smbfs/file.c
+++ b/fs/smbfs/file.c
@@ -17,6 +17,7 @@
17#include <linux/pagemap.h> 17#include <linux/pagemap.h>
18#include <linux/smp_lock.h> 18#include <linux/smp_lock.h>
19#include <linux/net.h> 19#include <linux/net.h>
20#include <linux/aio.h>
20 21
21#include <asm/uaccess.h> 22#include <asm/uaccess.h>
22#include <asm/system.h> 23#include <asm/system.h>
diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c
index 5c9243a23b9b..6724a6cf01ff 100644
--- a/fs/smbfs/inode.c
+++ b/fs/smbfs/inode.c
@@ -25,6 +25,7 @@
25#include <linux/net.h> 25#include <linux/net.h>
26#include <linux/vfs.h> 26#include <linux/vfs.h>
27#include <linux/highuid.h> 27#include <linux/highuid.h>
28#include <linux/sched.h>
28#include <linux/smb_fs.h> 29#include <linux/smb_fs.h>
29#include <linux/smbno.h> 30#include <linux/smbno.h>
30#include <linux/smb_mount.h> 31#include <linux/smb_mount.h>
diff --git a/fs/smbfs/request.c b/fs/smbfs/request.c
index c288fbe7953d..3f54a0f80fae 100644
--- a/fs/smbfs/request.c
+++ b/fs/smbfs/request.c
@@ -11,6 +11,7 @@
11#include <linux/fs.h> 11#include <linux/fs.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/net.h> 13#include <linux/net.h>
14#include <linux/sched.h>
14 15
15#include <linux/smb_fs.h> 16#include <linux/smb_fs.h>
16#include <linux/smbno.h> 17#include <linux/smbno.h>
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 4de5c6b89918..bdd30e74de6b 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -13,6 +13,7 @@
13#include <linux/backing-dev.h> 13#include <linux/backing-dev.h>
14#include <linux/capability.h> 14#include <linux/capability.h>
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/sched.h>
16#include <asm/semaphore.h> 17#include <asm/semaphore.h>
17#include "sysfs.h" 18#include "sysfs.h"
18 19
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 40d5047defea..51b5764685e7 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -36,6 +36,7 @@
36#include <linux/smp_lock.h> 36#include <linux/smp_lock.h>
37#include <linux/pagemap.h> 37#include <linux/pagemap.h>
38#include <linux/buffer_head.h> 38#include <linux/buffer_head.h>
39#include <linux/aio.h>
39 40
40#include "udf_i.h" 41#include "udf_i.h"
41#include "udf_sb.h" 42#include "udf_sb.h"
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index c8461551e108..1f0129405cf4 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -460,8 +460,8 @@ static struct buffer_head * inode_getblk(struct inode * inode, sector_t block,
460 kernel_long_ad laarr[EXTENT_MERGE_SIZE]; 460 kernel_long_ad laarr[EXTENT_MERGE_SIZE];
461 struct extent_position prev_epos, cur_epos, next_epos; 461 struct extent_position prev_epos, cur_epos, next_epos;
462 int count = 0, startnum = 0, endnum = 0; 462 int count = 0, startnum = 0, endnum = 0;
463 uint32_t elen = 0; 463 uint32_t elen = 0, tmpelen;
464 kernel_lb_addr eloc; 464 kernel_lb_addr eloc, tmpeloc;
465 int c = 1; 465 int c = 1;
466 loff_t lbcount = 0, b_off = 0; 466 loff_t lbcount = 0, b_off = 0;
467 uint32_t newblocknum, newblock; 467 uint32_t newblocknum, newblock;
@@ -520,8 +520,12 @@ static struct buffer_head * inode_getblk(struct inode * inode, sector_t block,
520 520
521 b_off -= lbcount; 521 b_off -= lbcount;
522 offset = b_off >> inode->i_sb->s_blocksize_bits; 522 offset = b_off >> inode->i_sb->s_blocksize_bits;
523 /* Move into indirect extent if we are at a pointer to it */ 523 /*
524 udf_next_aext(inode, &prev_epos, &eloc, &elen, 0); 524 * Move prev_epos and cur_epos into indirect extent if we are at
525 * the pointer to it
526 */
527 udf_next_aext(inode, &prev_epos, &tmpeloc, &tmpelen, 0);
528 udf_next_aext(inode, &cur_epos, &tmpeloc, &tmpelen, 0);
525 529
526 /* if the extent is allocated and recorded, return the block 530 /* if the extent is allocated and recorded, return the block
527 if the extent is not a multiple of the blocksize, round up */ 531 if the extent is not a multiple of the blocksize, round up */
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 91df4928651c..51fe307dc0ec 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -30,6 +30,7 @@
30#include <linux/quotaops.h> 30#include <linux/quotaops.h>
31#include <linux/smp_lock.h> 31#include <linux/smp_lock.h>
32#include <linux/buffer_head.h> 32#include <linux/buffer_head.h>
33#include <linux/sched.h>
33 34
34static inline int udf_match(int len1, const char *name1, int len2, const char *name2) 35static inline int udf_match(int len1, const char *name1, int len2, const char *name2)
35{ 36{
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 3a743d854c17..6658afb41cc7 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1351,7 +1351,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1351 1351
1352 for (i=0; i<UDF_SB_NUMPARTS(sb); i++) 1352 for (i=0; i<UDF_SB_NUMPARTS(sb); i++)
1353 { 1353 {
1354 switch UDF_SB_PARTTYPE(sb, i) 1354 switch (UDF_SB_PARTTYPE(sb, i))
1355 { 1355 {
1356 case UDF_VIRTUAL_MAP15: 1356 case UDF_VIRTUAL_MAP15:
1357 case UDF_VIRTUAL_MAP20: 1357 case UDF_VIRTUAL_MAP20:
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 4475588e973a..7361861e3aac 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -701,7 +701,7 @@ xfs_is_delayed_page(
701 else if (buffer_delay(bh)) 701 else if (buffer_delay(bh))
702 acceptable = (type == IOMAP_DELAY); 702 acceptable = (type == IOMAP_DELAY);
703 else if (buffer_dirty(bh) && buffer_mapped(bh)) 703 else if (buffer_dirty(bh) && buffer_mapped(bh))
704 acceptable = (type == 0); 704 acceptable = (type == IOMAP_NEW);
705 else 705 else
706 break; 706 break;
707 } while ((bh = bh->b_this_page) != head); 707 } while ((bh = bh->b_this_page) != head);
@@ -810,7 +810,7 @@ xfs_convert_page(
810 page_dirty--; 810 page_dirty--;
811 count++; 811 count++;
812 } else { 812 } else {
813 type = 0; 813 type = IOMAP_NEW;
814 if (buffer_mapped(bh) && all_bh && startio) { 814 if (buffer_mapped(bh) && all_bh && startio) {
815 lock_buffer(bh); 815 lock_buffer(bh);
816 xfs_add_to_ioend(inode, bh, offset, 816 xfs_add_to_ioend(inode, bh, offset,
@@ -968,8 +968,8 @@ xfs_page_state_convert(
968 968
969 bh = head = page_buffers(page); 969 bh = head = page_buffers(page);
970 offset = page_offset(page); 970 offset = page_offset(page);
971 flags = -1; 971 flags = BMAPI_READ;
972 type = IOMAP_READ; 972 type = IOMAP_NEW;
973 973
974 /* TODO: cleanup count and page_dirty */ 974 /* TODO: cleanup count and page_dirty */
975 975
@@ -999,14 +999,14 @@ xfs_page_state_convert(
999 * 999 *
1000 * Third case, an unmapped buffer was found, and we are 1000 * Third case, an unmapped buffer was found, and we are
1001 * in a path where we need to write the whole page out. 1001 * in a path where we need to write the whole page out.
1002 */ 1002 */
1003 if (buffer_unwritten(bh) || buffer_delay(bh) || 1003 if (buffer_unwritten(bh) || buffer_delay(bh) ||
1004 ((buffer_uptodate(bh) || PageUptodate(page)) && 1004 ((buffer_uptodate(bh) || PageUptodate(page)) &&
1005 !buffer_mapped(bh) && (unmapped || startio))) { 1005 !buffer_mapped(bh) && (unmapped || startio))) {
1006 /* 1006 /*
1007 * Make sure we don't use a read-only iomap 1007 * Make sure we don't use a read-only iomap
1008 */ 1008 */
1009 if (flags == BMAPI_READ) 1009 if (flags == BMAPI_READ)
1010 iomap_valid = 0; 1010 iomap_valid = 0;
1011 1011
1012 if (buffer_unwritten(bh)) { 1012 if (buffer_unwritten(bh)) {
@@ -1055,7 +1055,7 @@ xfs_page_state_convert(
1055 * That means it must already have extents allocated 1055 * That means it must already have extents allocated
1056 * underneath it. Map the extent by reading it. 1056 * underneath it. Map the extent by reading it.
1057 */ 1057 */
1058 if (!iomap_valid || type != IOMAP_READ) { 1058 if (!iomap_valid || flags != BMAPI_READ) {
1059 flags = BMAPI_READ; 1059 flags = BMAPI_READ;
1060 size = xfs_probe_cluster(inode, page, bh, 1060 size = xfs_probe_cluster(inode, page, bh,
1061 head, 1); 1061 head, 1);
@@ -1066,7 +1066,15 @@ xfs_page_state_convert(
1066 iomap_valid = xfs_iomap_valid(&iomap, offset); 1066 iomap_valid = xfs_iomap_valid(&iomap, offset);
1067 } 1067 }
1068 1068
1069 type = IOMAP_READ; 1069 /*
1070 * We set the type to IOMAP_NEW in case we are doing a
1071 * small write at EOF that is extending the file but
1072 * without needing an allocation. We need to update the
1073 * file size on I/O completion in this case so it is
1074 * the same case as having just allocated a new extent
1075 * that we are writing into for the first time.
1076 */
1077 type = IOMAP_NEW;
1070 if (!test_and_set_bit(BH_Lock, &bh->b_state)) { 1078 if (!test_and_set_bit(BH_Lock, &bh->b_state)) {
1071 ASSERT(buffer_mapped(bh)); 1079 ASSERT(buffer_mapped(bh));
1072 if (iomap_valid) 1080 if (iomap_valid)
diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h
index b62cd36ff324..e2fcee2b340d 100644
--- a/include/acpi/acpi_numa.h
+++ b/include/acpi/acpi_numa.h
@@ -13,7 +13,7 @@
13 13
14extern int pxm_to_node(int); 14extern int pxm_to_node(int);
15extern int node_to_pxm(int); 15extern int node_to_pxm(int);
16extern int __cpuinit acpi_map_pxm_to_node(int); 16extern int acpi_map_pxm_to_node(int);
17extern void __cpuinit acpi_unmap_pxm_to_node(int); 17extern void __cpuinit acpi_unmap_pxm_to_node(int);
18 18
19#endif /* CONFIG_ACPI_NUMA */ 19#endif /* CONFIG_ACPI_NUMA */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 5e07db0d46e9..ca882b8e7d10 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -78,7 +78,7 @@ struct acpi_signal_fatal_info {
78/* 78/*
79 * OSL Initialization and shutdown primitives 79 * OSL Initialization and shutdown primitives
80 */ 80 */
81acpi_status acpi_os_initialize(void); 81acpi_status __initdata acpi_os_initialize(void);
82 82
83acpi_status acpi_os_terminate(void); 83acpi_status acpi_os_terminate(void);
84 84
@@ -236,6 +236,7 @@ acpi_os_derive_pci_id(acpi_handle rhandle,
236 * Miscellaneous 236 * Miscellaneous
237 */ 237 */
238acpi_status acpi_os_validate_interface(char *interface); 238acpi_status acpi_os_validate_interface(char *interface);
239acpi_status acpi_osi_invalidate(char* interface);
239 240
240acpi_status 241acpi_status
241acpi_os_validate_address(u8 space_id, 242acpi_os_validate_address(u8 space_id,
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index e08f7df85a4f..b5cca5daa348 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -55,7 +55,7 @@ acpi_status
55acpi_initialize_tables(struct acpi_table_desc *initial_storage, 55acpi_initialize_tables(struct acpi_table_desc *initial_storage,
56 u32 initial_table_count, u8 allow_resize); 56 u32 initial_table_count, u8 allow_resize);
57 57
58acpi_status acpi_initialize_subsystem(void); 58acpi_status __init acpi_initialize_subsystem(void);
59 59
60acpi_status acpi_enable_subsystem(u32 flags); 60acpi_status acpi_enable_subsystem(u32 flags);
61 61
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 15a838862cd4..a87ef1c8d46b 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -390,6 +390,8 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object);
390 390
391u8 acpi_ut_valid_internal_object(void *object); 391u8 acpi_ut_valid_internal_object(void *object);
392 392
393union acpi_operand_object *acpi_ut_create_package_object(u32 count);
394
393union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size); 395union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size);
394 396
395union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size); 397union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size);
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
index 4b6ef7f21b93..3a0cbeb03fa1 100644
--- a/include/asm-alpha/bitops.h
+++ b/include/asm-alpha/bitops.h
@@ -313,32 +313,29 @@ static inline int ffs(int word)
313 * fls: find last bit set. 313 * fls: find last bit set.
314 */ 314 */
315#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67) 315#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
316static inline int fls(int word) 316static inline int fls64(unsigned long word)
317{ 317{
318 return 64 - __kernel_ctlz(word & 0xffffffff); 318 return 64 - __kernel_ctlz(word);
319} 319}
320#else 320#else
321#include <asm-generic/bitops/fls.h> 321extern const unsigned char __flsm1_tab[256];
322#endif
323#include <asm-generic/bitops/fls64.h>
324 322
325/* Compute powers of two for the given integer. */ 323static inline int fls64(unsigned long x)
326static inline long floor_log2(unsigned long word)
327{ 324{
328#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67) 325 unsigned long t, a, r;
329 return 63 - __kernel_ctlz(word); 326
330#else 327 t = __kernel_cmpbge (x, 0x0101010101010101);
331 long bit; 328 a = __flsm1_tab[t];
332 for (bit = -1; word ; bit++) 329 t = __kernel_extbl (x, a);
333 word >>= 1; 330 r = a*8 + __flsm1_tab[t] + (x != 0);
334 return bit; 331
335#endif 332 return r;
336} 333}
334#endif
337 335
338static inline long ceil_log2(unsigned long word) 336static inline int fls(int x)
339{ 337{
340 long bit = floor_log2(word); 338 return fls64((unsigned int) x);
341 return bit + (word > (1UL << bit));
342} 339}
343 340
344/* 341/*
@@ -353,9 +350,20 @@ static inline unsigned long hweight64(unsigned long w)
353 return __kernel_ctpop(w); 350 return __kernel_ctpop(w);
354} 351}
355 352
356#define hweight32(x) (unsigned int) hweight64((x) & 0xfffffffful) 353static inline unsigned int hweight32(unsigned int w)
357#define hweight16(x) (unsigned int) hweight64((x) & 0xfffful) 354{
358#define hweight8(x) (unsigned int) hweight64((x) & 0xfful) 355 return hweight64(w);
356}
357
358static inline unsigned int hweight16(unsigned int w)
359{
360 return hweight64(w & 0xffff);
361}
362
363static inline unsigned int hweight8(unsigned int w)
364{
365 return hweight64(w & 0xff);
366}
359#else 367#else
360#include <asm-generic/bitops/hweight.h> 368#include <asm-generic/bitops/hweight.h>
361#endif 369#endif
diff --git a/include/asm-alpha/core_t2.h b/include/asm-alpha/core_t2.h
index 457c34b6eb09..90e6b5d6c214 100644
--- a/include/asm-alpha/core_t2.h
+++ b/include/asm-alpha/core_t2.h
@@ -437,9 +437,15 @@ static inline void t2_outl(u32 b, unsigned long addr)
437 437
438static DEFINE_SPINLOCK(t2_hae_lock); 438static DEFINE_SPINLOCK(t2_hae_lock);
439 439
440/*
441 * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since
442 * they may be called directly, rather than through the
443 * ioreadNN/iowriteNN routines.
444 */
445
440__EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr) 446__EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr)
441{ 447{
442 unsigned long addr = (unsigned long) xaddr; 448 unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
443 unsigned long result, msb; 449 unsigned long result, msb;
444 unsigned long flags; 450 unsigned long flags;
445 spin_lock_irqsave(&t2_hae_lock, flags); 451 spin_lock_irqsave(&t2_hae_lock, flags);
@@ -453,7 +459,7 @@ __EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr)
453 459
454__EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr) 460__EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr)
455{ 461{
456 unsigned long addr = (unsigned long) xaddr; 462 unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
457 unsigned long result, msb; 463 unsigned long result, msb;
458 unsigned long flags; 464 unsigned long flags;
459 spin_lock_irqsave(&t2_hae_lock, flags); 465 spin_lock_irqsave(&t2_hae_lock, flags);
@@ -471,7 +477,7 @@ __EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr)
471 */ 477 */
472__EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr) 478__EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr)
473{ 479{
474 unsigned long addr = (unsigned long) xaddr; 480 unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
475 unsigned long result, msb; 481 unsigned long result, msb;
476 unsigned long flags; 482 unsigned long flags;
477 spin_lock_irqsave(&t2_hae_lock, flags); 483 spin_lock_irqsave(&t2_hae_lock, flags);
@@ -485,7 +491,7 @@ __EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr)
485 491
486__EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr) 492__EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr)
487{ 493{
488 unsigned long addr = (unsigned long) xaddr; 494 unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
489 unsigned long r0, r1, work, msb; 495 unsigned long r0, r1, work, msb;
490 unsigned long flags; 496 unsigned long flags;
491 spin_lock_irqsave(&t2_hae_lock, flags); 497 spin_lock_irqsave(&t2_hae_lock, flags);
@@ -501,7 +507,7 @@ __EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr)
501 507
502__EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr) 508__EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr)
503{ 509{
504 unsigned long addr = (unsigned long) xaddr; 510 unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
505 unsigned long msb, w; 511 unsigned long msb, w;
506 unsigned long flags; 512 unsigned long flags;
507 spin_lock_irqsave(&t2_hae_lock, flags); 513 spin_lock_irqsave(&t2_hae_lock, flags);
@@ -515,7 +521,7 @@ __EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr)
515 521
516__EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr) 522__EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr)
517{ 523{
518 unsigned long addr = (unsigned long) xaddr; 524 unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
519 unsigned long msb, w; 525 unsigned long msb, w;
520 unsigned long flags; 526 unsigned long flags;
521 spin_lock_irqsave(&t2_hae_lock, flags); 527 spin_lock_irqsave(&t2_hae_lock, flags);
@@ -533,7 +539,7 @@ __EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr)
533 */ 539 */
534__EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr) 540__EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr)
535{ 541{
536 unsigned long addr = (unsigned long) xaddr; 542 unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
537 unsigned long msb; 543 unsigned long msb;
538 unsigned long flags; 544 unsigned long flags;
539 spin_lock_irqsave(&t2_hae_lock, flags); 545 spin_lock_irqsave(&t2_hae_lock, flags);
@@ -546,7 +552,7 @@ __EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr)
546 552
547__EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr) 553__EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr)
548{ 554{
549 unsigned long addr = (unsigned long) xaddr; 555 unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
550 unsigned long msb, work; 556 unsigned long msb, work;
551 unsigned long flags; 557 unsigned long flags;
552 spin_lock_irqsave(&t2_hae_lock, flags); 558 spin_lock_irqsave(&t2_hae_lock, flags);
@@ -587,14 +593,14 @@ __EXTERN_INLINE int t2_is_mmio(const volatile void __iomem *addr)
587__EXTERN_INLINE unsigned int t2_ioread##NS(void __iomem *xaddr) \ 593__EXTERN_INLINE unsigned int t2_ioread##NS(void __iomem *xaddr) \
588{ \ 594{ \
589 if (t2_is_mmio(xaddr)) \ 595 if (t2_is_mmio(xaddr)) \
590 return t2_read##OS(xaddr - T2_DENSE_MEM); \ 596 return t2_read##OS(xaddr); \
591 else \ 597 else \
592 return t2_in##OS((unsigned long)xaddr - T2_IO); \ 598 return t2_in##OS((unsigned long)xaddr - T2_IO); \
593} \ 599} \
594__EXTERN_INLINE void t2_iowrite##NS(u##NS b, void __iomem *xaddr) \ 600__EXTERN_INLINE void t2_iowrite##NS(u##NS b, void __iomem *xaddr) \
595{ \ 601{ \
596 if (t2_is_mmio(xaddr)) \ 602 if (t2_is_mmio(xaddr)) \
597 t2_write##OS(b, xaddr - T2_DENSE_MEM); \ 603 t2_write##OS(b, xaddr); \
598 else \ 604 else \
599 t2_out##OS(b, (unsigned long)xaddr - T2_IO); \ 605 t2_out##OS(b, (unsigned long)xaddr - T2_IO); \
600} 606}
diff --git a/include/asm-alpha/core_titan.h b/include/asm-alpha/core_titan.h
index a64ccbff7d98..a17f6f33b68e 100644
--- a/include/asm-alpha/core_titan.h
+++ b/include/asm-alpha/core_titan.h
@@ -380,12 +380,7 @@ struct el_PRIVATEER_envdata_mcheck {
380/* 380/*
381 * Memory functions. all accesses are done through linear space. 381 * Memory functions. all accesses are done through linear space.
382 */ 382 */
383 383extern void __iomem *titan_ioportmap(unsigned long addr);
384__EXTERN_INLINE void __iomem *titan_ioportmap(unsigned long addr)
385{
386 return (void __iomem *)(addr + TITAN_IO_BIAS);
387}
388
389extern void __iomem *titan_ioremap(unsigned long addr, unsigned long size); 384extern void __iomem *titan_ioremap(unsigned long addr, unsigned long size);
390extern void titan_iounmap(volatile void __iomem *addr); 385extern void titan_iounmap(volatile void __iomem *addr);
391 386
diff --git a/include/asm-alpha/core_tsunami.h b/include/asm-alpha/core_tsunami.h
index 44e635d2c571..58d4fe48742c 100644
--- a/include/asm-alpha/core_tsunami.h
+++ b/include/asm-alpha/core_tsunami.h
@@ -2,6 +2,7 @@
2#define __ALPHA_TSUNAMI__H__ 2#define __ALPHA_TSUNAMI__H__
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/pci.h>
5#include <asm/compiler.h> 6#include <asm/compiler.h>
6 7
7/* 8/*
@@ -302,18 +303,8 @@ struct el_TSUNAMI_sysdata_mcheck {
302/* 303/*
303 * Memory functions. all accesses are done through linear space. 304 * Memory functions. all accesses are done through linear space.
304 */ 305 */
305 306extern void __iomem *tsunami_ioportmap(unsigned long addr);
306__EXTERN_INLINE void __iomem *tsunami_ioportmap(unsigned long addr) 307extern void __iomem *tsunami_ioremap(unsigned long addr, unsigned long size);
307{
308 return (void __iomem *)(addr + TSUNAMI_IO_BIAS);
309}
310
311__EXTERN_INLINE void __iomem *tsunami_ioremap(unsigned long addr,
312 unsigned long size)
313{
314 return (void __iomem *)(addr + TSUNAMI_MEM_BIAS);
315}
316
317__EXTERN_INLINE int tsunami_is_ioaddr(unsigned long addr) 308__EXTERN_INLINE int tsunami_is_ioaddr(unsigned long addr)
318{ 309{
319 return addr >= TSUNAMI_BASE; 310 return addr >= TSUNAMI_BASE;
diff --git a/include/asm-alpha/core_wildfire.h b/include/asm-alpha/core_wildfire.h
index 12af803d445a..cd562f544ba2 100644
--- a/include/asm-alpha/core_wildfire.h
+++ b/include/asm-alpha/core_wildfire.h
@@ -295,7 +295,7 @@ __EXTERN_INLINE int wildfire_is_ioaddr(unsigned long addr)
295 295
296__EXTERN_INLINE int wildfire_is_mmio(const volatile void __iomem *xaddr) 296__EXTERN_INLINE int wildfire_is_mmio(const volatile void __iomem *xaddr)
297{ 297{
298 unsigned long addr = (unsigned long)addr; 298 unsigned long addr = (unsigned long)xaddr;
299 return (addr & 0x100000000UL) == 0; 299 return (addr & 0x100000000UL) == 0;
300} 300}
301 301
diff --git a/include/asm-alpha/thread_info.h b/include/asm-alpha/thread_info.h
index f4defc2bd3fb..48a22e3e6f32 100644
--- a/include/asm-alpha/thread_info.h
+++ b/include/asm-alpha/thread_info.h
@@ -76,12 +76,14 @@ register struct thread_info *__current_thread_info __asm__("$8");
76#define TIF_UAC_NOFIX 7 76#define TIF_UAC_NOFIX 7
77#define TIF_UAC_SIGBUS 8 77#define TIF_UAC_SIGBUS 8
78#define TIF_MEMDIE 9 78#define TIF_MEMDIE 9
79#define TIF_RESTORE_SIGMASK 10 /* restore signal mask in do_signal */
79 80
80#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 81#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
81#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 82#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
82#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 83#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
83#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 84#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
84#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 85#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
86#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
85 87
86/* Work to do on interrupt/exception return. */ 88/* Work to do on interrupt/exception return. */
87#define _TIF_WORK_MASK (_TIF_NOTIFY_RESUME \ 89#define _TIF_WORK_MASK (_TIF_NOTIFY_RESUME \
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index e58a427012dd..29bf2fdc91c0 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -233,6 +233,20 @@
233#define __NR_osf_memcntl 260 /* not implemented */ 233#define __NR_osf_memcntl 260 /* not implemented */
234#define __NR_osf_fdatasync 261 /* not implemented */ 234#define __NR_osf_fdatasync 261 /* not implemented */
235 235
236/*
237 * Ignore legacy syscalls that we don't use.
238 */
239#define __IGNORE_alarm
240#define __IGNORE_creat
241#define __IGNORE_getegid
242#define __IGNORE_geteuid
243#define __IGNORE_getgid
244#define __IGNORE_getpid
245#define __IGNORE_getppid
246#define __IGNORE_getuid
247#define __IGNORE_pause
248#define __IGNORE_time
249#define __IGNORE_utime
236 250
237/* 251/*
238 * Linux-specific system calls begin at 300 252 * Linux-specific system calls begin at 300
@@ -387,10 +401,42 @@
387#define __NR_inotify_init 444 401#define __NR_inotify_init 444
388#define __NR_inotify_add_watch 445 402#define __NR_inotify_add_watch 445
389#define __NR_inotify_rm_watch 446 403#define __NR_inotify_rm_watch 446
404#define __NR_fdatasync 447
405#define __NR_kexec_load 448
406#define __NR_migrate_pages 449
407#define __NR_openat 450
408#define __NR_mkdirat 451
409#define __NR_mknodat 452
410#define __NR_fchownat 453
411#define __NR_futimesat 454
412#define __NR_fstatat64 455
413#define __NR_unlinkat 456
414#define __NR_renameat 457
415#define __NR_linkat 458
416#define __NR_symlinkat 459
417#define __NR_readlinkat 460
418#define __NR_fchmodat 461
419#define __NR_faccessat 462
420#define __NR_pselect6 463
421#define __NR_ppoll 464
422#define __NR_unshare 465
423#define __NR_set_robust_list 466
424#define __NR_get_robust_list 467
425#define __NR_splice 468
426#define __NR_sync_file_range 469
427#define __NR_tee 470
428#define __NR_vmsplice 471
429#define __NR_move_pages 472
430#define __NR_getcpu 473
431#define __NR_epoll_pwait 474
432#define __NR_utimensat 475
433#define __NR_signalfd 476
434#define __NR_timerfd 477
435#define __NR_eventfd 478
390 436
391#ifdef __KERNEL__ 437#ifdef __KERNEL__
392 438
393#define NR_SYSCALLS 447 439#define NR_SYSCALLS 479
394 440
395#define __ARCH_WANT_IPC_PARSE_VERSION 441#define __ARCH_WANT_IPC_PARSE_VERSION
396#define __ARCH_WANT_OLD_READDIR 442#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-alpha/vga.h b/include/asm-alpha/vga.h
index ed06f59b544d..e8df1e7aae6b 100644
--- a/include/asm-alpha/vga.h
+++ b/include/asm-alpha/vga.h
@@ -46,6 +46,37 @@ extern void scr_memcpyw(u16 *d, const u16 *s, unsigned int count);
46#define vga_readb(a) readb((u8 __iomem *)(a)) 46#define vga_readb(a) readb((u8 __iomem *)(a))
47#define vga_writeb(v,a) writeb(v, (u8 __iomem *)(a)) 47#define vga_writeb(v,a) writeb(v, (u8 __iomem *)(a))
48 48
49#ifdef CONFIG_VGA_HOSE
50#include <linux/ioport.h>
51#include <linux/pci.h>
52
53extern struct pci_controller *pci_vga_hose;
54
55# define __is_port_vga(a) \
56 (((a) >= 0x3b0) && ((a) < 0x3e0) && \
57 ((a) != 0x3b3) && ((a) != 0x3d3))
58
59# define __is_mem_vga(a) \
60 (((a) >= 0xa0000) && ((a) <= 0xc0000))
61
62# define FIXUP_IOADDR_VGA(a) do { \
63 if (pci_vga_hose && __is_port_vga(a)) \
64 (a) += pci_vga_hose->io_space->start; \
65 } while(0)
66
67# define FIXUP_MEMADDR_VGA(a) do { \
68 if (pci_vga_hose && __is_mem_vga(a)) \
69 (a) += pci_vga_hose->mem_space->start; \
70 } while(0)
71
72#else /* CONFIG_VGA_HOSE */
73# define pci_vga_hose 0
74# define __is_port_vga(a) 0
75# define __is_mem_vga(a) 0
76# define FIXUP_IOADDR_VGA(a)
77# define FIXUP_MEMADDR_VGA(a)
78#endif /* CONFIG_VGA_HOSE */
79
49#define VGA_MAP_MEM(x,s) ((unsigned long) ioremap(x, s)) 80#define VGA_MAP_MEM(x,s) ((unsigned long) ioremap(x, s))
50 81
51#endif 82#endif
diff --git a/include/asm-arm/arch-at91/at91_adc.h b/include/asm-arm/arch-at91/at91_adc.h
index 1ed66eaaf83a..6d71ea2637b1 100644
--- a/include/asm-arm/arch-at91/at91_adc.h
+++ b/include/asm-arm/arch-at91/at91_adc.h
@@ -55,7 +55,7 @@
55#define AT91_ADC_IDR 0x28 /* Interrupt Disable Register */ 55#define AT91_ADC_IDR 0x28 /* Interrupt Disable Register */
56#define AT91_ADC_IMR 0x2C /* Interrupt Mask Register */ 56#define AT91_ADC_IMR 0x2C /* Interrupt Mask Register */
57 57
58#define AT91_ADC_CHR(n) (0x30 + ((n) * 4) /* Channel Data Register N */ 58#define AT91_ADC_CHR(n) (0x30 + ((n) * 4)) /* Channel Data Register N */
59#define AT91_ADC_DATA (0x3ff) 59#define AT91_ADC_DATA (0x3ff)
60 60
61#endif 61#endif
diff --git a/include/asm-arm/arch-integrator/smp.h b/include/asm-arm/arch-integrator/smp.h
deleted file mode 100644
index ab2c79bb9505..000000000000
--- a/include/asm-arm/arch-integrator/smp.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef ASMARM_ARCH_SMP_H
2#define ASMARM_ARCH_SMP_H
3
4
5#include <asm/hardware.h>
6#include <asm/io.h>
7
8#define hard_smp_processor_id() \
9 ({ \
10 unsigned int cpunum; \
11 __asm__("mrc p15, 0, %0, c0, c0, 5" \
12 : "=r" (cpunum)); \
13 cpunum &= 0x0F; \
14 })
15
16extern void secondary_scan_irqs(void);
17
18#endif
diff --git a/include/asm-arm/arch-ixp4xx/nas100d.h b/include/asm-arm/arch-ixp4xx/nas100d.h
index 84467a5190d0..131e0a1d0df3 100644
--- a/include/asm-arm/arch-ixp4xx/nas100d.h
+++ b/include/asm-arm/arch-ixp4xx/nas100d.h
@@ -10,7 +10,7 @@
10 * based on ixdp425.h: 10 * based on ixdp425.h:
11 * Copyright 2004 (c) MontaVista, Software, Inc. 11 * Copyright 2004 (c) MontaVista, Software, Inc.
12 * 12 *
13 * This file is licensed under the terms of the GNU General Public 13 * This file is licensed under the terms of the GNU General Public
14 * License version 2. This program is licensed "as is" without any 14 * License version 2. This program is licensed "as is" without any
15 * warranty of any kind, whether express or implied. 15 * warranty of any kind, whether express or implied.
16 */ 16 */
@@ -36,31 +36,11 @@
36#define NAS100D_PCI_INTD_PIN 8 36#define NAS100D_PCI_INTD_PIN 8
37#define NAS100D_PCI_INTE_PIN 7 37#define NAS100D_PCI_INTE_PIN 7
38 38
39/* GPIO */
40
41#define NAS100D_GPIO0 0
42#define NAS100D_GPIO1 1
43#define NAS100D_GPIO2 2
44#define NAS100D_GPIO3 3
45#define NAS100D_GPIO4 4
46#define NAS100D_GPIO5 5
47#define NAS100D_GPIO6 6
48#define NAS100D_GPIO7 7
49#define NAS100D_GPIO8 8
50#define NAS100D_GPIO9 9
51#define NAS100D_GPIO10 10
52#define NAS100D_GPIO11 11
53#define NAS100D_GPIO12 12
54#define NAS100D_GPIO13 13
55#define NAS100D_GPIO14 14
56#define NAS100D_GPIO15 15
57
58
59/* Buttons */ 39/* Buttons */
60 40
61#define NAS100D_PB_GPIO NAS100D_GPIO14 41#define NAS100D_PB_GPIO 14
62#define NAS100D_RB_GPIO NAS100D_GPIO4 42#define NAS100D_RB_GPIO 4
63#define NAS100D_PO_GPIO NAS100D_GPIO12 /* power off */ 43#define NAS100D_PO_GPIO 12 /* power off */
64 44
65#define NAS100D_PB_IRQ IRQ_IXP4XX_GPIO14 45#define NAS100D_PB_IRQ IRQ_IXP4XX_GPIO14
66#define NAS100D_RB_IRQ IRQ_IXP4XX_GPIO4 46#define NAS100D_RB_IRQ IRQ_IXP4XX_GPIO4
diff --git a/include/asm-arm/arch-ixp4xx/nslu2.h b/include/asm-arm/arch-ixp4xx/nslu2.h
index 6b437f7c9955..850fdc5b45da 100644
--- a/include/asm-arm/arch-ixp4xx/nslu2.h
+++ b/include/asm-arm/arch-ixp4xx/nslu2.h
@@ -9,7 +9,7 @@
9 * based on ixdp425.h: 9 * based on ixdp425.h:
10 * Copyright 2004 (c) MontaVista, Software, Inc. 10 * Copyright 2004 (c) MontaVista, Software, Inc.
11 * 11 *
12 * This file is licensed under the terms of the GNU General Public 12 * This file is licensed under the terms of the GNU General Public
13 * License version 2. This program is licensed "as is" without any 13 * License version 2. This program is licensed "as is" without any
14 * warranty of any kind, whether express or implied. 14 * warranty of any kind, whether express or implied.
15 */ 15 */
@@ -34,36 +34,14 @@
34#define NSLU2_PCI_INTC_PIN 9 34#define NSLU2_PCI_INTC_PIN 9
35#define NSLU2_PCI_INTD_PIN 8 35#define NSLU2_PCI_INTD_PIN 8
36 36
37
38/* NSLU2 Timer */ 37/* NSLU2 Timer */
39#define NSLU2_FREQ 66000000 38#define NSLU2_FREQ 66000000
40#define NSLU2_CLOCK_TICK_RATE (((NSLU2_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ)
41#define NSLU2_CLOCK_TICKS_PER_USEC ((NSLU2_CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC)
42
43/* GPIO */
44
45#define NSLU2_GPIO0 0
46#define NSLU2_GPIO1 1
47#define NSLU2_GPIO2 2
48#define NSLU2_GPIO3 3
49#define NSLU2_GPIO4 4
50#define NSLU2_GPIO5 5
51#define NSLU2_GPIO6 6
52#define NSLU2_GPIO7 7
53#define NSLU2_GPIO8 8
54#define NSLU2_GPIO9 9
55#define NSLU2_GPIO10 10
56#define NSLU2_GPIO11 11
57#define NSLU2_GPIO12 12
58#define NSLU2_GPIO13 13
59#define NSLU2_GPIO14 14
60#define NSLU2_GPIO15 15
61 39
62/* Buttons */ 40/* Buttons */
63 41
64#define NSLU2_PB_GPIO NSLU2_GPIO5 42#define NSLU2_PB_GPIO 5
65#define NSLU2_PO_GPIO NSLU2_GPIO8 /* power off */ 43#define NSLU2_PO_GPIO 8 /* power off */
66#define NSLU2_RB_GPIO NSLU2_GPIO12 44#define NSLU2_RB_GPIO 12
67 45
68#define NSLU2_PB_IRQ IRQ_IXP4XX_GPIO5 46#define NSLU2_PB_IRQ IRQ_IXP4XX_GPIO5
69#define NSLU2_RB_IRQ IRQ_IXP4XX_GPIO12 47#define NSLU2_RB_IRQ IRQ_IXP4XX_GPIO12
@@ -79,16 +57,16 @@
79 57
80/* LEDs */ 58/* LEDs */
81 59
82#define NSLU2_LED_RED NSLU2_GPIO0 60#define NSLU2_LED_RED_GPIO 0
83#define NSLU2_LED_GRN NSLU2_GPIO1 61#define NSLU2_LED_GRN_GPIO 1
84 62
85#define NSLU2_LED_RED_BM (1L << NSLU2_LED_RED) 63#define NSLU2_LED_RED_BM (1L << NSLU2_LED_RED_GPIO)
86#define NSLU2_LED_GRN_BM (1L << NSLU2_LED_GRN) 64#define NSLU2_LED_GRN_BM (1L << NSLU2_LED_GRN_GPIO)
87 65
88#define NSLU2_LED_DISK1 NSLU2_GPIO3 66#define NSLU2_LED_DISK1_GPIO 3
89#define NSLU2_LED_DISK2 NSLU2_GPIO2 67#define NSLU2_LED_DISK2_GPIO 2
90 68
91#define NSLU2_LED_DISK1_BM (1L << NSLU2_GPIO2) 69#define NSLU2_LED_DISK1_BM (1L << NSLU2_LED_DISK1_GPIO)
92#define NSLU2_LED_DISK2_BM (1L << NSLU2_GPIO3) 70#define NSLU2_LED_DISK2_BM (1L << NSLU2_LED_DISK2_GPIO)
93 71
94 72
diff --git a/include/asm-arm/arch-ixp4xx/platform.h b/include/asm-arm/arch-ixp4xx/platform.h
index ab194e5f6653..2a44d3d67980 100644
--- a/include/asm-arm/arch-ixp4xx/platform.h
+++ b/include/asm-arm/arch-ixp4xx/platform.h
@@ -113,6 +113,7 @@ extern unsigned long ixp4xx_timer_freq;
113extern void ixp4xx_map_io(void); 113extern void ixp4xx_map_io(void);
114extern void ixp4xx_init_irq(void); 114extern void ixp4xx_init_irq(void);
115extern void ixp4xx_sys_init(void); 115extern void ixp4xx_sys_init(void);
116extern void ixp4xx_timer_init(void);
116extern struct sys_timer ixp4xx_timer; 117extern struct sys_timer ixp4xx_timer;
117extern void ixp4xx_pci_preinit(void); 118extern void ixp4xx_pci_preinit(void);
118struct pci_sys_data; 119struct pci_sys_data;
diff --git a/include/asm-arm/arch-s3c2410/irqs.h b/include/asm-arm/arch-s3c2410/irqs.h
index c79cb1819913..3b49cd1c345c 100644
--- a/include/asm-arm/arch-s3c2410/irqs.h
+++ b/include/asm-arm/arch-s3c2410/irqs.h
@@ -124,7 +124,7 @@
124#define IRQ_S3C2443_DMA S3C2410_IRQ(17) /* IRQ_DMA1 */ 124#define IRQ_S3C2443_DMA S3C2410_IRQ(17) /* IRQ_DMA1 */
125#define IRQ_S3C2443_UART3 S3C2410_IRQ(18) /* IRQ_DMA2 */ 125#define IRQ_S3C2443_UART3 S3C2410_IRQ(18) /* IRQ_DMA2 */
126#define IRQ_S3C2443_CFCON S3C2410_IRQ(19) /* IRQ_DMA3 */ 126#define IRQ_S3C2443_CFCON S3C2410_IRQ(19) /* IRQ_DMA3 */
127#define IRQ_S3C2443_SDI1 S3C2410_IRQ(20) /* IRQ_SDI */ 127#define IRQ_S3C2443_HSMMC S3C2410_IRQ(20) /* IRQ_SDI */
128#define IRQ_S3C2443_NAND S3C2410_IRQ(24) /* reserved */ 128#define IRQ_S3C2443_NAND S3C2410_IRQ(24) /* reserved */
129 129
130#define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14) 130#define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14)
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h
index 4505aefbad17..19e77f038042 100644
--- a/include/asm-arm/arch-s3c2410/map.h
+++ b/include/asm-arm/arch-s3c2410/map.h
@@ -153,6 +153,10 @@
153#define S3C2440_PA_AC97 (0x5B000000) 153#define S3C2440_PA_AC97 (0x5B000000)
154#define S3C2440_SZ_AC97 SZ_1M 154#define S3C2440_SZ_AC97 SZ_1M
155 155
156/* S3C2443 High-speed SD/MMC */
157#define S3C2443_PA_HSMMC (0x4A800000)
158#define S3C2443_SZ_HSMMC (256)
159
156/* ISA style IO, for each machine to sort out mappings for, if it 160/* ISA style IO, for each machine to sort out mappings for, if it
157 * implements it. We reserve two 16M regions for ISA. 161 * implements it. We reserve two 16M regions for ISA.
158 */ 162 */
diff --git a/include/asm-arm/arch-s3c2410/regs-gpioj.h b/include/asm-arm/arch-s3c2410/regs-gpioj.h
index 02131a5a1d3a..0362332faaf0 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpioj.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpioj.h
@@ -98,5 +98,9 @@
98#define S3C2440_GPJ12_OUTP (0x01 << 24) 98#define S3C2440_GPJ12_OUTP (0x01 << 24)
99#define S3C2440_GPJ12_CAMRESET (0x02 << 24) 99#define S3C2440_GPJ12_CAMRESET (0x02 << 24)
100 100
101#define S3C2443_GPJ13 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 13)
102#define S3C2443_GPJ14 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 14)
103#define S3C2443_GPJ15 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 15)
104
101#endif /* __ASM_ARCH_REGS_GPIOJ_H */ 105#endif /* __ASM_ARCH_REGS_GPIOJ_H */
102 106
diff --git a/include/asm-arm/arch-s3c2410/regs-s3c2412.h b/include/asm-arm/arch-s3c2410/regs-s3c2412.h
new file mode 100644
index 000000000000..8ca6a3bc8555
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-s3c2412.h
@@ -0,0 +1,21 @@
1/* linux/include/asm-arm/arch-s3c2410/regs-s3c2412.h
2 *
3 * Copyright 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 * S3C2412 specific register definitions
12*/
13
14#ifndef __ASM_ARCH_REGS_S3C2412_H
15#define __ASM_ARCH_REGS_S3C2412_H "s3c2412"
16
17#define S3C2412_SWRST (S3C24XX_VA_CLKPWR + 0x30)
18#define S3C2412_SWRST_RESET (0x533C2412)
19
20#endif /* __ASM_ARCH_REGS_S3C2412_H */
21
diff --git a/include/asm-arm/arch-s3c2410/regs-spi.h b/include/asm-arm/arch-s3c2410/regs-spi.h
index 3552280d1e8f..4a499a138256 100644
--- a/include/asm-arm/arch-s3c2410/regs-spi.h
+++ b/include/asm-arm/arch-s3c2410/regs-spi.h
@@ -12,6 +12,8 @@
12#ifndef __ASM_ARCH_REGS_SPI_H 12#ifndef __ASM_ARCH_REGS_SPI_H
13#define __ASM_ARCH_REGS_SPI_H 13#define __ASM_ARCH_REGS_SPI_H
14 14
15#define S3C2410_SPI1 (0x20)
16#define S3C2412_SPI1 (0x100)
15 17
16#define S3C2410_SPCON (0x00) 18#define S3C2410_SPCON (0x00)
17 19
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 8261ff9e7955..1d3caa42a386 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -259,9 +259,11 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
259#define BIOVEC_MERGEABLE(vec1, vec2) \ 259#define BIOVEC_MERGEABLE(vec1, vec2) \
260 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) 260 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
261 261
262#ifdef CONFIG_MMU
262#define ARCH_HAS_VALID_PHYS_ADDR_RANGE 263#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
263extern int valid_phys_addr_range(unsigned long addr, size_t size); 264extern int valid_phys_addr_range(unsigned long addr, size_t size);
264extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); 265extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
266#endif
265 267
266/* 268/*
267 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 269 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
diff --git a/include/asm-arm/ioctls.h b/include/asm-arm/ioctls.h
index bb9a7aa10c12..a91d8a1523cf 100644
--- a/include/asm-arm/ioctls.h
+++ b/include/asm-arm/ioctls.h
@@ -46,6 +46,10 @@
46#define TIOCSBRK 0x5427 /* BSD compatibility */ 46#define TIOCSBRK 0x5427 /* BSD compatibility */
47#define TIOCCBRK 0x5428 /* BSD compatibility */ 47#define TIOCCBRK 0x5428 /* BSD compatibility */
48#define TIOCGSID 0x5429 /* Return the session ID of FD */ 48#define TIOCGSID 0x5429 /* Return the session ID of FD */
49#define TCGETS2 _IOR('T',0x2A, struct termios2)
50#define TCSETS2 _IOW('T',0x2B, struct termios2)
51#define TCSETSW2 _IOW('T',0x2C, struct termios2)
52#define TCSETSF2 _IOW('T',0x2D, struct termios2)
49#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
50#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
51 55
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h
index fd2f9bf4dcc6..c59fad18e73b 100644
--- a/include/asm-arm/mach/arch.h
+++ b/include/asm-arm/mach/arch.h
@@ -49,7 +49,7 @@ struct machine_desc {
49 */ 49 */
50#define MACHINE_START(_type,_name) \ 50#define MACHINE_START(_type,_name) \
51static const struct machine_desc __mach_desc_##_type \ 51static const struct machine_desc __mach_desc_##_type \
52 __attribute_used__ \ 52 __used \
53 __attribute__((__section__(".arch.info.init"))) = { \ 53 __attribute__((__section__(".arch.info.init"))) = { \
54 .nr = MACH_TYPE_##_type, \ 54 .nr = MACH_TYPE_##_type, \
55 .name = _name, 55 .name = _name,
diff --git a/include/asm-arm/mmu.h b/include/asm-arm/mmu.h
index fe2a23b5627b..53099d4ee421 100644
--- a/include/asm-arm/mmu.h
+++ b/include/asm-arm/mmu.h
@@ -4,13 +4,13 @@
4#ifdef CONFIG_MMU 4#ifdef CONFIG_MMU
5 5
6typedef struct { 6typedef struct {
7#if __LINUX_ARM_ARCH__ >= 6 7#ifdef CONFIG_CPU_HAS_ASID
8 unsigned int id; 8 unsigned int id;
9#endif 9#endif
10 unsigned int kvm_seq; 10 unsigned int kvm_seq;
11} mm_context_t; 11} mm_context_t;
12 12
13#if __LINUX_ARM_ARCH__ >= 6 13#ifdef CONFIG_CPU_HAS_ASID
14#define ASID(mm) ((mm)->context.id & 255) 14#define ASID(mm) ((mm)->context.id & 255)
15#else 15#else
16#define ASID(mm) (0) 16#define ASID(mm) (0)
diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h
index 4981ad419198..6913d02ca5d6 100644
--- a/include/asm-arm/mmu_context.h
+++ b/include/asm-arm/mmu_context.h
@@ -20,7 +20,7 @@
20 20
21void __check_kvm_seq(struct mm_struct *mm); 21void __check_kvm_seq(struct mm_struct *mm);
22 22
23#if __LINUX_ARM_ARCH__ >= 6 23#ifdef CONFIG_CPU_HAS_ASID
24 24
25/* 25/*
26 * On ARMv6, we have the following structure in the Context ID: 26 * On ARMv6, we have the following structure in the Context ID:
diff --git a/include/asm-arm/plat-s3c24xx/devs.h b/include/asm-arm/plat-s3c24xx/devs.h
index dddf485fc067..f9d6f0317bc1 100644
--- a/include/asm-arm/plat-s3c24xx/devs.h
+++ b/include/asm-arm/plat-s3c24xx/devs.h
@@ -29,6 +29,7 @@ extern struct platform_device s3c_device_iis;
29extern struct platform_device s3c_device_rtc; 29extern struct platform_device s3c_device_rtc;
30extern struct platform_device s3c_device_adc; 30extern struct platform_device s3c_device_adc;
31extern struct platform_device s3c_device_sdi; 31extern struct platform_device s3c_device_sdi;
32extern struct platform_device s3c_device_hsmmc;
32 33
33extern struct platform_device s3c_device_spi0; 34extern struct platform_device s3c_device_spi0;
34extern struct platform_device s3c_device_spi1; 35extern struct platform_device s3c_device_spi1;
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h
index e5407392afca..7bbf105463f1 100644
--- a/include/asm-arm/setup.h
+++ b/include/asm-arm/setup.h
@@ -185,7 +185,7 @@ struct tagtable {
185 185
186#ifdef __KERNEL__ 186#ifdef __KERNEL__
187 187
188#define __tag __attribute_used__ __attribute__((__section__(".taglist.init"))) 188#define __tag __used __attribute__((__section__(".taglist.init")))
189#define __tagtable(tag, fn) \ 189#define __tagtable(tag, fn) \
190static struct tagtable __tagtable_##fn __tag = { tag, fn } 190static struct tagtable __tagtable_##fn __tag = { tag, fn }
191 191
@@ -218,7 +218,7 @@ struct early_params {
218}; 218};
219 219
220#define __early_param(name,fn) \ 220#define __early_param(name,fn) \
221static struct early_params __early_##fn __attribute_used__ \ 221static struct early_params __early_##fn __used \
222__attribute__((__section__(".early_param.init"))) = { name, fn } 222__attribute__((__section__(".early_param.init"))) = { name, fn }
223 223
224#endif /* __KERNEL__ */ 224#endif /* __KERNEL__ */
diff --git a/include/asm-arm/termbits.h b/include/asm-arm/termbits.h
index a3f4fe1742d0..f784d11f40b5 100644
--- a/include/asm-arm/termbits.h
+++ b/include/asm-arm/termbits.h
@@ -15,6 +15,17 @@ struct termios {
15 cc_t c_cc[NCCS]; /* control characters */ 15 cc_t c_cc[NCCS]; /* control characters */
16}; 16};
17 17
18struct termios2 {
19 tcflag_t c_iflag; /* input mode flags */
20 tcflag_t c_oflag; /* output mode flags */
21 tcflag_t c_cflag; /* control mode flags */
22 tcflag_t c_lflag; /* local mode flags */
23 cc_t c_line; /* line discipline */
24 cc_t c_cc[NCCS]; /* control characters */
25 speed_t c_ispeed; /* input speed */
26 speed_t c_ospeed; /* output speed */
27};
28
18struct ktermios { 29struct ktermios {
19 tcflag_t c_iflag; /* input mode flags */ 30 tcflag_t c_iflag; /* input mode flags */
20 tcflag_t c_oflag; /* output mode flags */ 31 tcflag_t c_oflag; /* output mode flags */
@@ -128,6 +139,7 @@ struct ktermios {
128#define HUPCL 0002000 139#define HUPCL 0002000
129#define CLOCAL 0004000 140#define CLOCAL 0004000
130#define CBAUDEX 0010000 141#define CBAUDEX 0010000
142#define BOTHER 0010000
131#define B57600 0010001 143#define B57600 0010001
132#define B115200 0010002 144#define B115200 0010002
133#define B230400 0010003 145#define B230400 0010003
@@ -143,10 +155,12 @@ struct ktermios {
143#define B3000000 0010015 155#define B3000000 0010015
144#define B3500000 0010016 156#define B3500000 0010016
145#define B4000000 0010017 157#define B4000000 0010017
146#define CIBAUD 002003600000 /* input baud rate (not used) */ 158#define CIBAUD 002003600000 /* input baud rate */
147#define CMSPAR 010000000000 /* mark or space (stick) parity */ 159#define CMSPAR 010000000000 /* mark or space (stick) parity */
148#define CRTSCTS 020000000000 /* flow control */ 160#define CRTSCTS 020000000000 /* flow control */
149 161
162#define IBSHIFT 16
163
150/* c_lflag bits */ 164/* c_lflag bits */
151#define ISIG 0000001 165#define ISIG 0000001
152#define ICANON 0000002 166#define ICANON 0000002
diff --git a/include/asm-arm/termios.h b/include/asm-arm/termios.h
index 329c324c4040..293e3f1bc3f2 100644
--- a/include/asm-arm/termios.h
+++ b/include/asm-arm/termios.h
@@ -82,8 +82,10 @@ struct termio {
82 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 82 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
83}) 83})
84 84
85#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 85#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
86#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 86#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
87#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
88#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
87 89
88#endif /* __KERNEL__ */ 90#endif /* __KERNEL__ */
89 91
diff --git a/include/asm-arm/tlbflush.h b/include/asm-arm/tlbflush.h
index 08c6991dc9c9..71be4fded7e2 100644
--- a/include/asm-arm/tlbflush.h
+++ b/include/asm-arm/tlbflush.h
@@ -138,12 +138,27 @@
138# define v6wbi_always_flags (-1UL) 138# define v6wbi_always_flags (-1UL)
139#endif 139#endif
140 140
141#ifdef CONFIG_CPU_TLB_V7
142# define v7wbi_possible_flags v6wbi_tlb_flags
143# define v7wbi_always_flags v6wbi_tlb_flags
144# ifdef _TLB
145# define MULTI_TLB 1
146# else
147# define _TLB v7wbi
148# endif
149#else
150# define v7wbi_possible_flags 0
151# define v7wbi_always_flags (-1UL)
152#endif
153
141#ifndef _TLB 154#ifndef _TLB
142#error Unknown TLB model 155#error Unknown TLB model
143#endif 156#endif
144 157
145#ifndef __ASSEMBLY__ 158#ifndef __ASSEMBLY__
146 159
160#include <linux/sched.h>
161
147struct cpu_tlb_fns { 162struct cpu_tlb_fns {
148 void (*flush_user_range)(unsigned long, unsigned long, struct vm_area_struct *); 163 void (*flush_user_range)(unsigned long, unsigned long, struct vm_area_struct *);
149 void (*flush_kern_range)(unsigned long, unsigned long); 164 void (*flush_kern_range)(unsigned long, unsigned long);
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index c025ab47e4b9..250d7f145aca 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -373,6 +373,10 @@
373#define __NR_getcpu (__NR_SYSCALL_BASE+345) 373#define __NR_getcpu (__NR_SYSCALL_BASE+345)
374 /* 346 for epoll_pwait */ 374 /* 346 for epoll_pwait */
375#define __NR_kexec_load (__NR_SYSCALL_BASE+347) 375#define __NR_kexec_load (__NR_SYSCALL_BASE+347)
376#define __NR_utimensat (__NR_SYSCALL_BASE+348)
377#define __NR_signalfd (__NR_SYSCALL_BASE+349)
378#define __NR_timerfd (__NR_SYSCALL_BASE+350)
379#define __NR_eventfd (__NR_SYSCALL_BASE+351)
376 380
377/* 381/*
378 * The following SWIs are ARM private. 382 * The following SWIs are ARM private.
@@ -433,5 +437,11 @@
433 */ 437 */
434#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 438#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
435 439
440/*
441 * Unimplemented (or alternatively implemented) syscalls
442 */
443#define __IGNORE_sync_file_range 1
444#define __IGNORE_fadvise64_64 1
445
436#endif /* __KERNEL__ */ 446#endif /* __KERNEL__ */
437#endif /* __ASM_ARM_UNISTD_H */ 447#endif /* __ASM_ARM_UNISTD_H */
diff --git a/include/asm-arm26/setup.h b/include/asm-arm26/setup.h
index 10fd07c76662..e82562306475 100644
--- a/include/asm-arm26/setup.h
+++ b/include/asm-arm26/setup.h
@@ -173,7 +173,7 @@ struct tagtable {
173 int (*parse)(const struct tag *); 173 int (*parse)(const struct tag *);
174}; 174};
175 175
176#define __tag __attribute_used__ __attribute__((__section__(".taglist"))) 176#define __tag __used __attribute__((__section__(".taglist")))
177#define __tagtable(tag, fn) \ 177#define __tagtable(tag, fn) \
178static struct tagtable __tagtable_##fn __tag = { tag, fn } 178static struct tagtable __tagtable_##fn __tag = { tag, fn }
179 179
diff --git a/include/asm-blackfin/bfin-global.h b/include/asm-blackfin/bfin-global.h
index e37f81609fc3..57f37ccdcdf1 100644
--- a/include/asm-blackfin/bfin-global.h
+++ b/include/asm-blackfin/bfin-global.h
@@ -104,6 +104,7 @@ extern unsigned long dpdt_swapcount_table[];
104 104
105extern unsigned long table_start, table_end; 105extern unsigned long table_start, table_end;
106 106
107extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
107extern struct file_operations dpmc_fops; 108extern struct file_operations dpmc_fops;
108extern char _start; 109extern char _start;
109extern unsigned long _ramstart, _ramend, _rambase; 110extern unsigned long _ramstart, _ramend, _rambase;
diff --git a/include/asm-blackfin/gpio.h b/include/asm-blackfin/gpio.h
index d16fe3cd6135..aa0d5503e232 100644
--- a/include/asm-blackfin/gpio.h
+++ b/include/asm-blackfin/gpio.h
@@ -148,10 +148,6 @@
148 148
149#ifdef BF537_FAMILY 149#ifdef BF537_FAMILY
150#define MAX_BLACKFIN_GPIOS 48 150#define MAX_BLACKFIN_GPIOS 48
151#define PORT_F 0
152#define PORT_G 1
153#define PORT_H 2
154#define PORT_J 3
155 151
156#define GPIO_PF0 0 152#define GPIO_PF0 0
157#define GPIO_PF1 1 153#define GPIO_PF1 1
@@ -202,13 +198,17 @@
202#define GPIO_PH14 46 198#define GPIO_PH14 46
203#define GPIO_PH15 47 199#define GPIO_PH15 47
204 200
201#define PORT_F GPIO_PF0
202#define PORT_G GPIO_PG0
203#define PORT_H GPIO_PH0
204
205#endif 205#endif
206 206
207#ifdef BF561_FAMILY 207#ifdef BF561_FAMILY
208#define MAX_BLACKFIN_GPIOS 48 208#define MAX_BLACKFIN_GPIOS 48
209#define PORT_FIO0 0 209#define PORT_FIO0 GPIO_0
210#define PORT_FIO1 1 210#define PORT_FIO1 GPIO_16
211#define PORT_FIO2 2 211#define PORT_FIO2 GPIO_32
212#endif 212#endif
213 213
214#ifndef __ASSEMBLY__ 214#ifndef __ASSEMBLY__
diff --git a/include/asm-blackfin/io.h b/include/asm-blackfin/io.h
index 7e6995e80d97..eac8bcaf64c2 100644
--- a/include/asm-blackfin/io.h
+++ b/include/asm-blackfin/io.h
@@ -115,13 +115,21 @@ static inline unsigned int readl(void __iomem *addr)
115 115
116#ifndef __ASSEMBLY__ 116#ifndef __ASSEMBLY__
117 117
118extern void outsb(void __iomem *port, const void *addr, unsigned long count); 118extern void outsb(void __iomem *port, const void *addr, unsigned short count);
119extern void outsw(void __iomem *port, const void *addr, unsigned long count); 119extern void outsw(void __iomem *port, const void *addr, unsigned short count);
120extern void outsl(void __iomem *port, const void *addr, unsigned long count); 120extern void outsl(void __iomem *port, const void *addr, unsigned short count);
121 121
122extern void insb(const void __iomem *port, void *addr, unsigned long count); 122extern void insb(const void __iomem *port, void *addr, unsigned short count);
123extern void insw(const void __iomem *port, void *addr, unsigned long count); 123extern void insw(const void __iomem *port, void *addr, unsigned short count);
124extern void insl(const void __iomem *port, void *addr, unsigned long count); 124extern void insl(const void __iomem *port, void *addr, unsigned short count);
125
126extern void dma_outsb(void __iomem *port, const void *addr, unsigned short count);
127extern void dma_outsw(void __iomem *port, const void *addr, unsigned short count);
128extern void dma_outsl(void __iomem *port, const void *addr, unsigned short count);
129
130extern void dma_insb(const void __iomem *port, void *addr, unsigned short count);
131extern void dma_insw(const void __iomem *port, void *addr, unsigned short count);
132extern void dma_insl(const void __iomem *port, void *addr, unsigned short count);
125 133
126/* 134/*
127 * Map some physical address range into the kernel address space. 135 * Map some physical address range into the kernel address space.
diff --git a/include/asm-blackfin/mach-bf527/cdefBF522.h b/include/asm-blackfin/mach-bf527/cdefBF522.h
new file mode 100644
index 000000000000..52c06494b886
--- /dev/null
+++ b/include/asm-blackfin/mach-bf527/cdefBF522.h
@@ -0,0 +1,46 @@
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
new file mode 100644
index 000000000000..2cc67e4b4d86
--- /dev/null
+++ b/include/asm-blackfin/mach-bf527/cdefBF525.h
@@ -0,0 +1,461 @@
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
new file mode 100644
index 000000000000..5bd1a8601743
--- /dev/null
+++ b/include/asm-blackfin/mach-bf527/cdefBF527.h
@@ -0,0 +1,626 @@
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
new file mode 100644
index 000000000000..5f801a0ef797
--- /dev/null
+++ b/include/asm-blackfin/mach-bf527/cdefBF52x_base.h
@@ -0,0 +1,1187 @@
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
33#include "defBF52x_base.h"
34
35/* ==== begin from cdefBF534.h ==== */
36
37/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
38#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
39#define bfin_write_PLL_CTL(val) bfin_write16(PLL_CTL, val)
40#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
41#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
42#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
43#define bfin_write_VR_CTL(val) bfin_write16(VR_CTL, val)
44#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
45#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
46#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
47#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT, val)
48#define bfin_read_CHIPID() bfin_read16(CHIPID)
49#define bfin_write_CHIPID(val) bfin_write16(CHIPID, val)
50
51
52/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
53#define bfin_read_SWRST() bfin_read16(SWRST)
54#define bfin_write_SWRST(val) bfin_write16(SWRST, val)
55#define bfin_read_SYSCR() bfin_read16(SYSCR)
56#define bfin_write_SYSCR(val) bfin_write16(SYSCR, val)
57
58#define bfin_read_SIC_RVECT() bfin_read32(SIC_RVECT)
59#define bfin_write_SIC_RVECT(val) bfin_write32(SIC_RVECT, val)
60#define bfin_read_SIC_IMASK0() bfin_read32(SIC_IMASK0)
61#define bfin_write_SIC_IMASK0(val) bfin_write32(SIC_IMASK0, val)
62/* legacy register name (below) provided for backwards code compatibility */
63#define bfin_read_SIC_IMASK() bfin_read32(SIC_IMASK)
64#define bfin_write_SIC_IMASK(val) bfin_write32(SIC_IMASK, val)
65
66#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
67#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0, val)
68#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
69#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1, val)
70#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
71#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2, val)
72#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
73#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3, val)
74
75#define bfin_read_SIC_ISR0() bfin_read32(SIC_ISR0)
76#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val)
77/* legacy register name (below) provided for backwards code compatibility */
78#define bfin_read_SIC_ISR() bfin_read32(SIC_ISR)
79#define bfin_write_SIC_ISR(val) bfin_write32(SIC_ISR, val)
80
81#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0)
82#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val)
83/* legacy register name (below) provided for backwards code compatibility */
84#define bfin_read_SIC_IWR() bfin_read32(SIC_IWR)
85#define bfin_write_SIC_IWR(val) bfin_write32(SIC_IWR, val)
86
87/* SIC Additions to ADSP-BF52x (0xFFC0014C - 0xFFC00162) */
88
89#define bfin_read_SIC_IMASK1() bfin_read32(SIC_IMASK1)
90#define bfin_write_SIC_IMASK1(val) bfin_write32(SIC_IMASK1, val)
91#define bfin_read_SIC_IAR4() bfin_read32(SIC_IAR4)
92#define bfin_write_SIC_IAR4(val) bfin_write32(SIC_IAR4, val)
93#define bfin_read_SIC_IAR5() bfin_read32(SIC_IAR5)
94#define bfin_write_SIC_IAR5(val) bfin_write32(SIC_IAR5, val)
95#define bfin_read_SIC_IAR6() bfin_read32(SIC_IAR6)
96#define bfin_write_SIC_IAR6(val) bfin_write32(SIC_IAR6, val)
97#define bfin_read_SIC_IAR7() bfin_read32(SIC_IAR7)
98#define bfin_write_SIC_IAR7(val) bfin_write32(SIC_IAR7, val)
99#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1)
100#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val)
101#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1)
102#define bfin_write_SIC_IWR1(val) bfin_write32(SIC_IWR1, val)
103
104/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
105#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
106#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL, val)
107#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
108#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT, val)
109#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
110#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT, val)
111
112
113/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
114#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
115#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT, val)
116#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
117#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL, val)
118#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
119#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT, val)
120#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
121#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT, val)
122#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
123#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM, val)
124#define bfin_read_RTC_FAST() bfin_read16(RTC_FAST)
125#define bfin_write_RTC_FAST(val) bfin_write16(RTC_FAST, val)
126#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
127#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN, val)
128
129
130/* UART0 Controller (0xFFC00400 - 0xFFC004FF) */
131#define bfin_read_UART0_THR() bfin_read16(UART0_THR)
132#define bfin_write_UART0_THR(val) bfin_write16(UART0_THR, val)
133#define bfin_read_UART0_RBR() bfin_read16(UART0_RBR)
134#define bfin_write_UART0_RBR(val) bfin_write16(UART0_RBR, val)
135#define bfin_read_UART0_DLL() bfin_read16(UART0_DLL)
136#define bfin_write_UART0_DLL(val) bfin_write16(UART0_DLL, val)
137#define bfin_read_UART0_IER() bfin_read16(UART0_IER)
138#define bfin_write_UART0_IER(val) bfin_write16(UART0_IER, val)
139#define bfin_read_UART0_DLH() bfin_read16(UART0_DLH)
140#define bfin_write_UART0_DLH(val) bfin_write16(UART0_DLH, val)
141#define bfin_read_UART0_IIR() bfin_read16(UART0_IIR)
142#define bfin_write_UART0_IIR(val) bfin_write16(UART0_IIR, val)
143#define bfin_read_UART0_LCR() bfin_read16(UART0_LCR)
144#define bfin_write_UART0_LCR(val) bfin_write16(UART0_LCR, val)
145#define bfin_read_UART0_MCR() bfin_read16(UART0_MCR)
146#define bfin_write_UART0_MCR(val) bfin_write16(UART0_MCR, val)
147#define bfin_read_UART0_LSR() bfin_read16(UART0_LSR)
148#define bfin_write_UART0_LSR(val) bfin_write16(UART0_LSR, val)
149#define bfin_read_UART0_MSR() bfin_read16(UART0_MSR)
150#define bfin_write_UART0_MSR(val) bfin_write16(UART0_MSR, val)
151#define bfin_read_UART0_SCR() bfin_read16(UART0_SCR)
152#define bfin_write_UART0_SCR(val) bfin_write16(UART0_SCR, val)
153#define bfin_read_UART0_GCTL() bfin_read16(UART0_GCTL)
154#define bfin_write_UART0_GCTL(val) bfin_write16(UART0_GCTL, val)
155
156
157/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
158#define bfin_read_SPI_CTL() bfin_read16(SPI_CTL)
159#define bfin_write_SPI_CTL(val) bfin_write16(SPI_CTL, val)
160#define bfin_read_SPI_FLG() bfin_read16(SPI_FLG)
161#define bfin_write_SPI_FLG(val) bfin_write16(SPI_FLG, val)
162#define bfin_read_SPI_STAT() bfin_read16(SPI_STAT)
163#define bfin_write_SPI_STAT(val) bfin_write16(SPI_STAT, val)
164#define bfin_read_SPI_TDBR() bfin_read16(SPI_TDBR)
165#define bfin_write_SPI_TDBR(val) bfin_write16(SPI_TDBR, val)
166#define bfin_read_SPI_RDBR() bfin_read16(SPI_RDBR)
167#define bfin_write_SPI_RDBR(val) bfin_write16(SPI_RDBR, val)
168#define bfin_read_SPI_BAUD() bfin_read16(SPI_BAUD)
169#define bfin_write_SPI_BAUD(val) bfin_write16(SPI_BAUD, val)
170#define bfin_read_SPI_SHADOW() bfin_read16(SPI_SHADOW)
171#define bfin_write_SPI_SHADOW(val) bfin_write16(SPI_SHADOW, val)
172
173
174/* TIMER0-7 Registers (0xFFC00600 - 0xFFC006FF) */
175#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
176#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG, val)
177#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
178#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
179#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
180#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD, val)
181#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
182#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH, val)
183
184#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
185#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG, val)
186#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
187#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
188#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
189#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD, val)
190#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
191#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH, val)
192
193#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
194#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG, val)
195#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
196#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
197#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
198#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD, val)
199#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
200#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH, val)
201
202#define bfin_read_TIMER3_CONFIG() bfin_read16(TIMER3_CONFIG)
203#define bfin_write_TIMER3_CONFIG(val) bfin_write16(TIMER3_CONFIG, val)
204#define bfin_read_TIMER3_COUNTER() bfin_read32(TIMER3_COUNTER)
205#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER, val)
206#define bfin_read_TIMER3_PERIOD() bfin_read32(TIMER3_PERIOD)
207#define bfin_write_TIMER3_PERIOD(val) bfin_write32(TIMER3_PERIOD, val)
208#define bfin_read_TIMER3_WIDTH() bfin_read32(TIMER3_WIDTH)
209#define bfin_write_TIMER3_WIDTH(val) bfin_write32(TIMER3_WIDTH, val)
210
211#define bfin_read_TIMER4_CONFIG() bfin_read16(TIMER4_CONFIG)
212#define bfin_write_TIMER4_CONFIG(val) bfin_write16(TIMER4_CONFIG, val)
213#define bfin_read_TIMER4_COUNTER() bfin_read32(TIMER4_COUNTER)
214#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER, val)
215#define bfin_read_TIMER4_PERIOD() bfin_read32(TIMER4_PERIOD)
216#define bfin_write_TIMER4_PERIOD(val) bfin_write32(TIMER4_PERIOD, val)
217#define bfin_read_TIMER4_WIDTH() bfin_read32(TIMER4_WIDTH)
218#define bfin_write_TIMER4_WIDTH(val) bfin_write32(TIMER4_WIDTH, val)
219
220#define bfin_read_TIMER5_CONFIG() bfin_read16(TIMER5_CONFIG)
221#define bfin_write_TIMER5_CONFIG(val) bfin_write16(TIMER5_CONFIG, val)
222#define bfin_read_TIMER5_COUNTER() bfin_read32(TIMER5_COUNTER)
223#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER, val)
224#define bfin_read_TIMER5_PERIOD() bfin_read32(TIMER5_PERIOD)
225#define bfin_write_TIMER5_PERIOD(val) bfin_write32(TIMER5_PERIOD, val)
226#define bfin_read_TIMER5_WIDTH() bfin_read32(TIMER5_WIDTH)
227#define bfin_write_TIMER5_WIDTH(val) bfin_write32(TIMER5_WIDTH, val)
228
229#define bfin_read_TIMER6_CONFIG() bfin_read16(TIMER6_CONFIG)
230#define bfin_write_TIMER6_CONFIG(val) bfin_write16(TIMER6_CONFIG, val)
231#define bfin_read_TIMER6_COUNTER() bfin_read32(TIMER6_COUNTER)
232#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER, val)
233#define bfin_read_TIMER6_PERIOD() bfin_read32(TIMER6_PERIOD)
234#define bfin_write_TIMER6_PERIOD(val) bfin_write32(TIMER6_PERIOD, val)
235#define bfin_read_TIMER6_WIDTH() bfin_read32(TIMER6_WIDTH)
236#define bfin_write_TIMER6_WIDTH(val) bfin_write32(TIMER6_WIDTH, val)
237
238#define bfin_read_TIMER7_CONFIG() bfin_read16(TIMER7_CONFIG)
239#define bfin_write_TIMER7_CONFIG(val) bfin_write16(TIMER7_CONFIG, val)
240#define bfin_read_TIMER7_COUNTER() bfin_read32(TIMER7_COUNTER)
241#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER, val)
242#define bfin_read_TIMER7_PERIOD() bfin_read32(TIMER7_PERIOD)
243#define bfin_write_TIMER7_PERIOD(val) bfin_write32(TIMER7_PERIOD, val)
244#define bfin_read_TIMER7_WIDTH() bfin_read32(TIMER7_WIDTH)
245#define bfin_write_TIMER7_WIDTH(val) bfin_write32(TIMER7_WIDTH, val)
246
247#define bfin_read_TIMER_ENABLE() bfin_read16(TIMER_ENABLE)
248#define bfin_write_TIMER_ENABLE(val) bfin_write16(TIMER_ENABLE, val)
249#define bfin_read_TIMER_DISABLE() bfin_read16(TIMER_DISABLE)
250#define bfin_write_TIMER_DISABLE(val) bfin_write16(TIMER_DISABLE, val)
251#define bfin_read_TIMER_STATUS() bfin_read32(TIMER_STATUS)
252#define bfin_write_TIMER_STATUS(val) bfin_write32(TIMER_STATUS, val)
253
254
255/* General Purpose I/O Port F (0xFFC00700 - 0xFFC007FF) */
256#define bfin_read_PORTFIO() bfin_read16(PORTFIO)
257#define bfin_write_PORTFIO(val) bfin_write16(PORTFIO, val)
258#define bfin_read_PORTFIO_CLEAR() bfin_read16(PORTFIO_CLEAR)
259#define bfin_write_PORTFIO_CLEAR(val) bfin_write16(PORTFIO_CLEAR, val)
260#define bfin_read_PORTFIO_SET() bfin_read16(PORTFIO_SET)
261#define bfin_write_PORTFIO_SET(val) bfin_write16(PORTFIO_SET, val)
262#define bfin_read_PORTFIO_TOGGLE() bfin_read16(PORTFIO_TOGGLE)
263#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE, val)
264#define bfin_read_PORTFIO_MASKA() bfin_read16(PORTFIO_MASKA)
265#define bfin_write_PORTFIO_MASKA(val) bfin_write16(PORTFIO_MASKA, val)
266#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
267#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR, val)
268#define bfin_read_PORTFIO_MASKA_SET() bfin_read16(PORTFIO_MASKA_SET)
269#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET, val)
270#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
271#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE, val)
272#define bfin_read_PORTFIO_MASKB() bfin_read16(PORTFIO_MASKB)
273#define bfin_write_PORTFIO_MASKB(val) bfin_write16(PORTFIO_MASKB, val)
274#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
275#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR, val)
276#define bfin_read_PORTFIO_MASKB_SET() bfin_read16(PORTFIO_MASKB_SET)
277#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET, val)
278#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
279#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE, val)
280#define bfin_read_PORTFIO_DIR() bfin_read16(PORTFIO_DIR)
281#define bfin_write_PORTFIO_DIR(val) bfin_write16(PORTFIO_DIR, val)
282#define bfin_read_PORTFIO_POLAR() bfin_read16(PORTFIO_POLAR)
283#define bfin_write_PORTFIO_POLAR(val) bfin_write16(PORTFIO_POLAR, val)
284#define bfin_read_PORTFIO_EDGE() bfin_read16(PORTFIO_EDGE)
285#define bfin_write_PORTFIO_EDGE(val) bfin_write16(PORTFIO_EDGE, val)
286#define bfin_read_PORTFIO_BOTH() bfin_read16(PORTFIO_BOTH)
287#define bfin_write_PORTFIO_BOTH(val) bfin_write16(PORTFIO_BOTH, val)
288#define bfin_read_PORTFIO_INEN() bfin_read16(PORTFIO_INEN)
289#define bfin_write_PORTFIO_INEN(val) bfin_write16(PORTFIO_INEN, val)
290
291
292/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
293#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
294#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1, val)
295#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
296#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2, val)
297#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
298#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
299#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
300#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV, val)
301#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
302#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX, val)
303#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
304#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX, val)
305#define bfin_read_SPORT0_TX32() bfin_read32(SPORT0_TX32)
306#define bfin_write_SPORT0_TX32(val) bfin_write32(SPORT0_TX32, val)
307#define bfin_read_SPORT0_RX32() bfin_read32(SPORT0_RX32)
308#define bfin_write_SPORT0_RX32(val) bfin_write32(SPORT0_RX32, val)
309#define bfin_read_SPORT0_TX16() bfin_read16(SPORT0_TX16)
310#define bfin_write_SPORT0_TX16(val) bfin_write16(SPORT0_TX16, val)
311#define bfin_read_SPORT0_RX16() bfin_read16(SPORT0_RX16)
312#define bfin_write_SPORT0_RX16(val) bfin_write16(SPORT0_RX16, val)
313#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
314#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1, val)
315#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
316#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2, val)
317#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
318#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
319#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
320#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV, val)
321#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
322#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT, val)
323#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
324#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL, val)
325#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
326#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1, val)
327#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
328#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2, val)
329#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
330#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0, val)
331#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
332#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1, val)
333#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
334#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2, val)
335#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
336#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3, val)
337#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
338#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0, val)
339#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
340#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1, val)
341#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
342#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2, val)
343#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
344#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3, val)
345
346
347/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
348#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
349#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1, val)
350#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
351#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2, val)
352#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
353#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
354#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
355#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV, val)
356#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
357#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX, val)
358#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
359#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX, val)
360#define bfin_read_SPORT1_TX32() bfin_read32(SPORT1_TX32)
361#define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX32, val)
362#define bfin_read_SPORT1_RX32() bfin_read32(SPORT1_RX32)
363#define bfin_write_SPORT1_RX32(val) bfin_write32(SPORT1_RX32, val)
364#define bfin_read_SPORT1_TX16() bfin_read16(SPORT1_TX16)
365#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX16, val)
366#define bfin_read_SPORT1_RX16() bfin_read16(SPORT1_RX16)
367#define bfin_write_SPORT1_RX16(val) bfin_write16(SPORT1_RX16, val)
368#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
369#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1, val)
370#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
371#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2, val)
372#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
373#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
374#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
375#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV, val)
376#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
377#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT, val)
378#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
379#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL, val)
380#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
381#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1, val)
382#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
383#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2, val)
384#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
385#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0, val)
386#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
387#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1, val)
388#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
389#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2, val)
390#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
391#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3, val)
392#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
393#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0, val)
394#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
395#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1, val)
396#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
397#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2, val)
398#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
399#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3, val)
400
401
402/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
403#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
404#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL, val)
405#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
406#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0, val)
407#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
408#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1, val)
409#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
410#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL, val)
411#define bfin_read_EBIU_SDBCTL() bfin_read16(EBIU_SDBCTL)
412#define bfin_write_EBIU_SDBCTL(val) bfin_write16(EBIU_SDBCTL, val)
413#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
414#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC, val)
415#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
416#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT, val)
417
418
419/* DMA Traffic Control Registers */
420#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
421#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER, val)
422#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
423#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT, val)
424
425/* Alternate deprecated register names (below) provided for backwards code compatibility */
426#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
427#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER, val)
428#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
429#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT, val)
430
431/* DMA Controller */
432#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
433#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG, val)
434#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_read32(DMA0_NEXT_DESC_PTR)
435#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_write32(DMA0_NEXT_DESC_PTR, val)
436#define bfin_read_DMA0_START_ADDR() bfin_read32(DMA0_START_ADDR)
437#define bfin_write_DMA0_START_ADDR(val) bfin_write32(DMA0_START_ADDR, val)
438#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
439#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT, val)
440#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
441#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT, val)
442#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
443#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY, val)
444#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
445#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY, val)
446#define bfin_read_DMA0_CURR_DESC_PTR() bfin_read32(DMA0_CURR_DESC_PTR)
447#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_write32(DMA0_CURR_DESC_PTR, val)
448#define bfin_read_DMA0_CURR_ADDR() bfin_read32(DMA0_CURR_ADDR)
449#define bfin_write_DMA0_CURR_ADDR(val) bfin_write32(DMA0_CURR_ADDR, val)
450#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
451#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
452#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
453#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
454#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
455#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
456#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
457#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
458
459#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
460#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG, val)
461#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_read32(DMA1_NEXT_DESC_PTR)
462#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_write32(DMA1_NEXT_DESC_PTR, val)
463#define bfin_read_DMA1_START_ADDR() bfin_read32(DMA1_START_ADDR)
464#define bfin_write_DMA1_START_ADDR(val) bfin_write32(DMA1_START_ADDR, val)
465#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
466#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT, val)
467#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
468#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT, val)
469#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
470#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY, val)
471#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
472#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY, val)
473#define bfin_read_DMA1_CURR_DESC_PTR() bfin_read32(DMA1_CURR_DESC_PTR)
474#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_write32(DMA1_CURR_DESC_PTR, val)
475#define bfin_read_DMA1_CURR_ADDR() bfin_read32(DMA1_CURR_ADDR)
476#define bfin_write_DMA1_CURR_ADDR(val) bfin_write32(DMA1_CURR_ADDR, val)
477#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
478#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
479#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
480#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
481#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
482#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
483#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
484#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
485
486#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
487#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG, val)
488#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_read32(DMA2_NEXT_DESC_PTR)
489#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_write32(DMA2_NEXT_DESC_PTR, val)
490#define bfin_read_DMA2_START_ADDR() bfin_read32(DMA2_START_ADDR)
491#define bfin_write_DMA2_START_ADDR(val) bfin_write32(DMA2_START_ADDR, val)
492#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
493#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT, val)
494#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
495#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT, val)
496#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
497#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY, val)
498#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
499#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY, val)
500#define bfin_read_DMA2_CURR_DESC_PTR() bfin_read32(DMA2_CURR_DESC_PTR)
501#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_write32(DMA2_CURR_DESC_PTR, val)
502#define bfin_read_DMA2_CURR_ADDR() bfin_read32(DMA2_CURR_ADDR)
503#define bfin_write_DMA2_CURR_ADDR(val) bfin_write32(DMA2_CURR_ADDR, val)
504#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
505#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
506#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
507#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
508#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
509#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
510#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
511#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
512
513#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
514#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG, val)
515#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_read32(DMA3_NEXT_DESC_PTR)
516#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_write32(DMA3_NEXT_DESC_PTR, val)
517#define bfin_read_DMA3_START_ADDR() bfin_read32(DMA3_START_ADDR)
518#define bfin_write_DMA3_START_ADDR(val) bfin_write32(DMA3_START_ADDR, val)
519#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
520#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT, val)
521#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
522#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT, val)
523#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
524#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY, val)
525#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
526#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY, val)
527#define bfin_read_DMA3_CURR_DESC_PTR() bfin_read32(DMA3_CURR_DESC_PTR)
528#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_write32(DMA3_CURR_DESC_PTR, val)
529#define bfin_read_DMA3_CURR_ADDR() bfin_read32(DMA3_CURR_ADDR)
530#define bfin_write_DMA3_CURR_ADDR(val) bfin_write32(DMA3_CURR_ADDR, val)
531#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
532#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
533#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
534#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
535#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
536#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
537#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
538#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
539
540#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
541#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG, val)
542#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_read32(DMA4_NEXT_DESC_PTR)
543#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_write32(DMA4_NEXT_DESC_PTR, val)
544#define bfin_read_DMA4_START_ADDR() bfin_read32(DMA4_START_ADDR)
545#define bfin_write_DMA4_START_ADDR(val) bfin_write32(DMA4_START_ADDR, val)
546#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
547#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT, val)
548#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
549#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT, val)
550#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
551#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY, val)
552#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
553#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY, val)
554#define bfin_read_DMA4_CURR_DESC_PTR() bfin_read32(DMA4_CURR_DESC_PTR)
555#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_write32(DMA4_CURR_DESC_PTR, val)
556#define bfin_read_DMA4_CURR_ADDR() bfin_read32(DMA4_CURR_ADDR)
557#define bfin_write_DMA4_CURR_ADDR(val) bfin_write32(DMA4_CURR_ADDR, val)
558#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
559#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
560#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
561#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
562#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
563#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
564#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
565#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
566
567#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
568#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG, val)
569#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_read32(DMA5_NEXT_DESC_PTR)
570#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_write32(DMA5_NEXT_DESC_PTR, val)
571#define bfin_read_DMA5_START_ADDR() bfin_read32(DMA5_START_ADDR)
572#define bfin_write_DMA5_START_ADDR(val) bfin_write32(DMA5_START_ADDR, val)
573#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
574#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT, val)
575#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
576#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT, val)
577#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
578#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY, val)
579#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
580#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY, val)
581#define bfin_read_DMA5_CURR_DESC_PTR() bfin_read32(DMA5_CURR_DESC_PTR)
582#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_write32(DMA5_CURR_DESC_PTR, val)
583#define bfin_read_DMA5_CURR_ADDR() bfin_read32(DMA5_CURR_ADDR)
584#define bfin_write_DMA5_CURR_ADDR(val) bfin_write32(DMA5_CURR_ADDR, val)
585#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
586#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
587#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
588#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
589#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
590#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
591#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
592#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
593
594#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
595#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG, val)
596#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
597#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR, val)
598#define bfin_read_DMA6_START_ADDR() bfin_read32(DMA6_START_ADDR)
599#define bfin_write_DMA6_START_ADDR(val) bfin_write32(DMA6_START_ADDR, val)
600#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
601#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT, val)
602#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
603#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT, val)
604#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
605#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY, val)
606#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
607#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY, val)
608#define bfin_read_DMA6_CURR_DESC_PTR() bfin_read32(DMA6_CURR_DESC_PTR)
609#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_write32(DMA6_CURR_DESC_PTR, val)
610#define bfin_read_DMA6_CURR_ADDR() bfin_read32(DMA6_CURR_ADDR)
611#define bfin_write_DMA6_CURR_ADDR(val) bfin_write32(DMA6_CURR_ADDR, val)
612#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
613#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
614#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
615#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
616#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
617#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
618#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
619#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
620
621#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
622#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG, val)
623#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_read32(DMA7_NEXT_DESC_PTR)
624#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_write32(DMA7_NEXT_DESC_PTR, val)
625#define bfin_read_DMA7_START_ADDR() bfin_read32(DMA7_START_ADDR)
626#define bfin_write_DMA7_START_ADDR(val) bfin_write32(DMA7_START_ADDR, val)
627#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
628#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT, val)
629#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
630#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT, val)
631#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
632#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY, val)
633#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
634#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY, val)
635#define bfin_read_DMA7_CURR_DESC_PTR() bfin_read32(DMA7_CURR_DESC_PTR)
636#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_write32(DMA7_CURR_DESC_PTR, val)
637#define bfin_read_DMA7_CURR_ADDR() bfin_read32(DMA7_CURR_ADDR)
638#define bfin_write_DMA7_CURR_ADDR(val) bfin_write32(DMA7_CURR_ADDR, val)
639#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
640#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
641#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
642#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
643#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
644#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
645#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
646#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
647
648#define bfin_read_DMA8_CONFIG() bfin_read16(DMA8_CONFIG)
649#define bfin_write_DMA8_CONFIG(val) bfin_write16(DMA8_CONFIG, val)
650#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_read32(DMA8_NEXT_DESC_PTR)
651#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_write32(DMA8_NEXT_DESC_PTR, val)
652#define bfin_read_DMA8_START_ADDR() bfin_read32(DMA8_START_ADDR)
653#define bfin_write_DMA8_START_ADDR(val) bfin_write32(DMA8_START_ADDR, val)
654#define bfin_read_DMA8_X_COUNT() bfin_read16(DMA8_X_COUNT)
655#define bfin_write_DMA8_X_COUNT(val) bfin_write16(DMA8_X_COUNT, val)
656#define bfin_read_DMA8_Y_COUNT() bfin_read16(DMA8_Y_COUNT)
657#define bfin_write_DMA8_Y_COUNT(val) bfin_write16(DMA8_Y_COUNT, val)
658#define bfin_read_DMA8_X_MODIFY() bfin_read16(DMA8_X_MODIFY)
659#define bfin_write_DMA8_X_MODIFY(val) bfin_write16(DMA8_X_MODIFY, val)
660#define bfin_read_DMA8_Y_MODIFY() bfin_read16(DMA8_Y_MODIFY)
661#define bfin_write_DMA8_Y_MODIFY(val) bfin_write16(DMA8_Y_MODIFY, val)
662#define bfin_read_DMA8_CURR_DESC_PTR() bfin_read32(DMA8_CURR_DESC_PTR)
663#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_write32(DMA8_CURR_DESC_PTR, val)
664#define bfin_read_DMA8_CURR_ADDR() bfin_read32(DMA8_CURR_ADDR)
665#define bfin_write_DMA8_CURR_ADDR(val) bfin_write32(DMA8_CURR_ADDR, val)
666#define bfin_read_DMA8_CURR_X_COUNT() bfin_read16(DMA8_CURR_X_COUNT)
667#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
668#define bfin_read_DMA8_CURR_Y_COUNT() bfin_read16(DMA8_CURR_Y_COUNT)
669#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
670#define bfin_read_DMA8_IRQ_STATUS() bfin_read16(DMA8_IRQ_STATUS)
671#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
672#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
673#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
674
675#define bfin_read_DMA9_CONFIG() bfin_read16(DMA9_CONFIG)
676#define bfin_write_DMA9_CONFIG(val) bfin_write16(DMA9_CONFIG, val)
677#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_read32(DMA9_NEXT_DESC_PTR)
678#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_write32(DMA9_NEXT_DESC_PTR, val)
679#define bfin_read_DMA9_START_ADDR() bfin_read32(DMA9_START_ADDR)
680#define bfin_write_DMA9_START_ADDR(val) bfin_write32(DMA9_START_ADDR, val)
681#define bfin_read_DMA9_X_COUNT() bfin_read16(DMA9_X_COUNT)
682#define bfin_write_DMA9_X_COUNT(val) bfin_write16(DMA9_X_COUNT, val)
683#define bfin_read_DMA9_Y_COUNT() bfin_read16(DMA9_Y_COUNT)
684#define bfin_write_DMA9_Y_COUNT(val) bfin_write16(DMA9_Y_COUNT, val)
685#define bfin_read_DMA9_X_MODIFY() bfin_read16(DMA9_X_MODIFY)
686#define bfin_write_DMA9_X_MODIFY(val) bfin_write16(DMA9_X_MODIFY, val)
687#define bfin_read_DMA9_Y_MODIFY() bfin_read16(DMA9_Y_MODIFY)
688#define bfin_write_DMA9_Y_MODIFY(val) bfin_write16(DMA9_Y_MODIFY, val)
689#define bfin_read_DMA9_CURR_DESC_PTR() bfin_read32(DMA9_CURR_DESC_PTR)
690#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_write32(DMA9_CURR_DESC_PTR, val)
691#define bfin_read_DMA9_CURR_ADDR() bfin_read32(DMA9_CURR_ADDR)
692#define bfin_write_DMA9_CURR_ADDR(val) bfin_write32(DMA9_CURR_ADDR, val)
693#define bfin_read_DMA9_CURR_X_COUNT() bfin_read16(DMA9_CURR_X_COUNT)
694#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
695#define bfin_read_DMA9_CURR_Y_COUNT() bfin_read16(DMA9_CURR_Y_COUNT)
696#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
697#define bfin_read_DMA9_IRQ_STATUS() bfin_read16(DMA9_IRQ_STATUS)
698#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
699#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
700#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
701
702#define bfin_read_DMA10_CONFIG() bfin_read16(DMA10_CONFIG)
703#define bfin_write_DMA10_CONFIG(val) bfin_write16(DMA10_CONFIG, val)
704#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_read32(DMA10_NEXT_DESC_PTR)
705#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_write32(DMA10_NEXT_DESC_PTR, val)
706#define bfin_read_DMA10_START_ADDR() bfin_read32(DMA10_START_ADDR)
707#define bfin_write_DMA10_START_ADDR(val) bfin_write32(DMA10_START_ADDR, val)
708#define bfin_read_DMA10_X_COUNT() bfin_read16(DMA10_X_COUNT)
709#define bfin_write_DMA10_X_COUNT(val) bfin_write16(DMA10_X_COUNT, val)
710#define bfin_read_DMA10_Y_COUNT() bfin_read16(DMA10_Y_COUNT)
711#define bfin_write_DMA10_Y_COUNT(val) bfin_write16(DMA10_Y_COUNT, val)
712#define bfin_read_DMA10_X_MODIFY() bfin_read16(DMA10_X_MODIFY)
713#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY, val)
714#define bfin_read_DMA10_Y_MODIFY() bfin_read16(DMA10_Y_MODIFY)
715#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY, val)
716#define bfin_read_DMA10_CURR_DESC_PTR() bfin_read32(DMA10_CURR_DESC_PTR)
717#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_write32(DMA10_CURR_DESC_PTR, val)
718#define bfin_read_DMA10_CURR_ADDR() bfin_read32(DMA10_CURR_ADDR)
719#define bfin_write_DMA10_CURR_ADDR(val) bfin_write32(DMA10_CURR_ADDR, val)
720#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
721#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
722#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
723#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
724#define bfin_read_DMA10_IRQ_STATUS() bfin_read16(DMA10_IRQ_STATUS)
725#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
726#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
727#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
728
729#define bfin_read_DMA11_CONFIG() bfin_read16(DMA11_CONFIG)
730#define bfin_write_DMA11_CONFIG(val) bfin_write16(DMA11_CONFIG, val)
731#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_read32(DMA11_NEXT_DESC_PTR)
732#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_write32(DMA11_NEXT_DESC_PTR, val)
733#define bfin_read_DMA11_START_ADDR() bfin_read32(DMA11_START_ADDR)
734#define bfin_write_DMA11_START_ADDR(val) bfin_write32(DMA11_START_ADDR, val)
735#define bfin_read_DMA11_X_COUNT() bfin_read16(DMA11_X_COUNT)
736#define bfin_write_DMA11_X_COUNT(val) bfin_write16(DMA11_X_COUNT, val)
737#define bfin_read_DMA11_Y_COUNT() bfin_read16(DMA11_Y_COUNT)
738#define bfin_write_DMA11_Y_COUNT(val) bfin_write16(DMA11_Y_COUNT, val)
739#define bfin_read_DMA11_X_MODIFY() bfin_read16(DMA11_X_MODIFY)
740#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY, val)
741#define bfin_read_DMA11_Y_MODIFY() bfin_read16(DMA11_Y_MODIFY)
742#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY, val)
743#define bfin_read_DMA11_CURR_DESC_PTR() bfin_read32(DMA11_CURR_DESC_PTR)
744#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_write32(DMA11_CURR_DESC_PTR, val)
745#define bfin_read_DMA11_CURR_ADDR() bfin_read32(DMA11_CURR_ADDR)
746#define bfin_write_DMA11_CURR_ADDR(val) bfin_write32(DMA11_CURR_ADDR, val)
747#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
748#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
749#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
750#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
751#define bfin_read_DMA11_IRQ_STATUS() bfin_read16(DMA11_IRQ_STATUS)
752#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
753#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
754#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
755
756#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
757#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
758#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
759#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR, val)
760#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
761#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR, val)
762#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
763#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
764#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
765#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
766#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
767#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY, val)
768#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
769#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY, val)
770#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
771#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR, val)
772#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
773#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR, val)
774#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
775#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT, val)
776#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
777#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
778#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
779#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
780#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
781#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP, val)
782
783#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
784#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
785#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
786#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR, val)
787#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
788#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR, val)
789#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
790#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
791#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
792#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
793#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
794#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY, val)
795#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
796#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY, val)
797#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
798#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR, val)
799#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
800#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR, val)
801#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
802#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT, val)
803#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
804#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT, val)
805#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
806#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val)
807#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
808#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP, val)
809
810#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
811#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
812#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
813#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR, val)
814#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
815#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR, val)
816#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
817#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT, val)
818#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
819#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT, val)
820#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
821#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY, val)
822#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
823#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY, val)
824#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
825#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR, val)
826#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
827#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR, val)
828#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
829#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT, val)
830#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
831#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
832#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
833#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
834#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
835#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP, val)
836
837#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
838#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
839#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
840#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR, val)
841#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
842#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR, val)
843#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
844#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT, val)
845#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
846#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT, val)
847#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
848#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY, val)
849#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
850#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY, val)
851#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
852#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR, val)
853#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
854#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR, val)
855#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
856#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT, val)
857#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
858#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT, val)
859#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
860#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
861#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
862#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP, val)
863
864
865/* Parallel Peripheral Interface (0xFFC01000 - 0xFFC010FF) */
866#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
867#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL, val)
868#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
869#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS, val)
870#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
871#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY, val)
872#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
873#define bfin_write_PPI_COUNT(val) bfin_write16(PPI_COUNT, val)
874#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
875#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME, val)
876
877
878/* Two-Wire Interface (0xFFC01400 - 0xFFC014FF) */
879#define bfin_read_TWI_CLKDIV() bfin_read16(TWI_CLKDIV)
880#define bfin_write_TWI_CLKDIV(val) bfin_write16(TWI_CLKDIV, val)
881#define bfin_read_TWI_CONTROL() bfin_read16(TWI_CONTROL)
882#define bfin_write_TWI_CONTROL(val) bfin_write16(TWI_CONTROL, val)
883#define bfin_read_TWI_SLAVE_CTL() bfin_read16(TWI_SLAVE_CTL)
884#define bfin_write_TWI_SLAVE_CTL(val) bfin_write16(TWI_SLAVE_CTL, val)
885#define bfin_read_TWI_SLAVE_STAT() bfin_read16(TWI_SLAVE_STAT)
886#define bfin_write_TWI_SLAVE_STAT(val) bfin_write16(TWI_SLAVE_STAT, val)
887#define bfin_read_TWI_SLAVE_ADDR() bfin_read16(TWI_SLAVE_ADDR)
888#define bfin_write_TWI_SLAVE_ADDR(val) bfin_write16(TWI_SLAVE_ADDR, val)
889#define bfin_read_TWI_MASTER_CTL() bfin_read16(TWI_MASTER_CTL)
890#define bfin_write_TWI_MASTER_CTL(val) bfin_write16(TWI_MASTER_CTL, val)
891#define bfin_read_TWI_MASTER_STAT() bfin_read16(TWI_MASTER_STAT)
892#define bfin_write_TWI_MASTER_STAT(val) bfin_write16(TWI_MASTER_STAT, val)
893#define bfin_read_TWI_MASTER_ADDR() bfin_read16(TWI_MASTER_ADDR)
894#define bfin_write_TWI_MASTER_ADDR(val) bfin_write16(TWI_MASTER_ADDR, val)
895#define bfin_read_TWI_INT_STAT() bfin_read16(TWI_INT_STAT)
896#define bfin_write_TWI_INT_STAT(val) bfin_write16(TWI_INT_STAT, val)
897#define bfin_read_TWI_INT_MASK() bfin_read16(TWI_INT_MASK)
898#define bfin_write_TWI_INT_MASK(val) bfin_write16(TWI_INT_MASK, val)
899#define bfin_read_TWI_FIFO_CTL() bfin_read16(TWI_FIFO_CTL)
900#define bfin_write_TWI_FIFO_CTL(val) bfin_write16(TWI_FIFO_CTL, val)
901#define bfin_read_TWI_FIFO_STAT() bfin_read16(TWI_FIFO_STAT)
902#define bfin_write_TWI_FIFO_STAT(val) bfin_write16(TWI_FIFO_STAT, val)
903#define bfin_read_TWI_XMT_DATA8() bfin_read16(TWI_XMT_DATA8)
904#define bfin_write_TWI_XMT_DATA8(val) bfin_write16(TWI_XMT_DATA8, val)
905#define bfin_read_TWI_XMT_DATA16() bfin_read16(TWI_XMT_DATA16)
906#define bfin_write_TWI_XMT_DATA16(val) bfin_write16(TWI_XMT_DATA16, val)
907#define bfin_read_TWI_RCV_DATA8() bfin_read16(TWI_RCV_DATA8)
908#define bfin_write_TWI_RCV_DATA8(val) bfin_write16(TWI_RCV_DATA8, val)
909#define bfin_read_TWI_RCV_DATA16() bfin_read16(TWI_RCV_DATA16)
910#define bfin_write_TWI_RCV_DATA16(val) bfin_write16(TWI_RCV_DATA16, val)
911
912
913/* General Purpose I/O Port G (0xFFC01500 - 0xFFC015FF) */
914#define bfin_read_PORTGIO() bfin_read16(PORTGIO)
915#define bfin_write_PORTGIO(val) bfin_write16(PORTGIO, val)
916#define bfin_read_PORTGIO_CLEAR() bfin_read16(PORTGIO_CLEAR)
917#define bfin_write_PORTGIO_CLEAR(val) bfin_write16(PORTGIO_CLEAR, val)
918#define bfin_read_PORTGIO_SET() bfin_read16(PORTGIO_SET)
919#define bfin_write_PORTGIO_SET(val) bfin_write16(PORTGIO_SET, val)
920#define bfin_read_PORTGIO_TOGGLE() bfin_read16(PORTGIO_TOGGLE)
921#define bfin_write_PORTGIO_TOGGLE(val) bfin_write16(PORTGIO_TOGGLE, val)
922#define bfin_read_PORTGIO_MASKA() bfin_read16(PORTGIO_MASKA)
923#define bfin_write_PORTGIO_MASKA(val) bfin_write16(PORTGIO_MASKA, val)
924#define bfin_read_PORTGIO_MASKA_CLEAR() bfin_read16(PORTGIO_MASKA_CLEAR)
925#define bfin_write_PORTGIO_MASKA_CLEAR(val) bfin_write16(PORTGIO_MASKA_CLEAR, val)
926#define bfin_read_PORTGIO_MASKA_SET() bfin_read16(PORTGIO_MASKA_SET)
927#define bfin_write_PORTGIO_MASKA_SET(val) bfin_write16(PORTGIO_MASKA_SET, val)
928#define bfin_read_PORTGIO_MASKA_TOGGLE() bfin_read16(PORTGIO_MASKA_TOGGLE)
929#define bfin_write_PORTGIO_MASKA_TOGGLE(val) bfin_write16(PORTGIO_MASKA_TOGGLE, val)
930#define bfin_read_PORTGIO_MASKB() bfin_read16(PORTGIO_MASKB)
931#define bfin_write_PORTGIO_MASKB(val) bfin_write16(PORTGIO_MASKB, val)
932#define bfin_read_PORTGIO_MASKB_CLEAR() bfin_read16(PORTGIO_MASKB_CLEAR)
933#define bfin_write_PORTGIO_MASKB_CLEAR(val) bfin_write16(PORTGIO_MASKB_CLEAR, val)
934#define bfin_read_PORTGIO_MASKB_SET() bfin_read16(PORTGIO_MASKB_SET)
935#define bfin_write_PORTGIO_MASKB_SET(val) bfin_write16(PORTGIO_MASKB_SET, val)
936#define bfin_read_PORTGIO_MASKB_TOGGLE() bfin_read16(PORTGIO_MASKB_TOGGLE)
937#define bfin_write_PORTGIO_MASKB_TOGGLE(val) bfin_write16(PORTGIO_MASKB_TOGGLE, val)
938#define bfin_read_PORTGIO_DIR() bfin_read16(PORTGIO_DIR)
939#define bfin_write_PORTGIO_DIR(val) bfin_write16(PORTGIO_DIR, val)
940#define bfin_read_PORTGIO_POLAR() bfin_read16(PORTGIO_POLAR)
941#define bfin_write_PORTGIO_POLAR(val) bfin_write16(PORTGIO_POLAR, val)
942#define bfin_read_PORTGIO_EDGE() bfin_read16(PORTGIO_EDGE)
943#define bfin_write_PORTGIO_EDGE(val) bfin_write16(PORTGIO_EDGE, val)
944#define bfin_read_PORTGIO_BOTH() bfin_read16(PORTGIO_BOTH)
945#define bfin_write_PORTGIO_BOTH(val) bfin_write16(PORTGIO_BOTH, val)
946#define bfin_read_PORTGIO_INEN() bfin_read16(PORTGIO_INEN)
947#define bfin_write_PORTGIO_INEN(val) bfin_write16(PORTGIO_INEN, val)
948
949
950/* General Purpose I/O Port H (0xFFC01700 - 0xFFC017FF) */
951#define bfin_read_PORTHIO() bfin_read16(PORTHIO)
952#define bfin_write_PORTHIO(val) bfin_write16(PORTHIO, val)
953#define bfin_read_PORTHIO_CLEAR() bfin_read16(PORTHIO_CLEAR)
954#define bfin_write_PORTHIO_CLEAR(val) bfin_write16(PORTHIO_CLEAR, val)
955#define bfin_read_PORTHIO_SET() bfin_read16(PORTHIO_SET)
956#define bfin_write_PORTHIO_SET(val) bfin_write16(PORTHIO_SET, val)
957#define bfin_read_PORTHIO_TOGGLE() bfin_read16(PORTHIO_TOGGLE)
958#define bfin_write_PORTHIO_TOGGLE(val) bfin_write16(PORTHIO_TOGGLE, val)
959#define bfin_read_PORTHIO_MASKA() bfin_read16(PORTHIO_MASKA)
960#define bfin_write_PORTHIO_MASKA(val) bfin_write16(PORTHIO_MASKA, val)
961#define bfin_read_PORTHIO_MASKA_CLEAR() bfin_read16(PORTHIO_MASKA_CLEAR)
962#define bfin_write_PORTHIO_MASKA_CLEAR(val) bfin_write16(PORTHIO_MASKA_CLEAR, val)
963#define bfin_read_PORTHIO_MASKA_SET() bfin_read16(PORTHIO_MASKA_SET)
964#define bfin_write_PORTHIO_MASKA_SET(val) bfin_write16(PORTHIO_MASKA_SET, val)
965#define bfin_read_PORTHIO_MASKA_TOGGLE() bfin_read16(PORTHIO_MASKA_TOGGLE)
966#define bfin_write_PORTHIO_MASKA_TOGGLE(val) bfin_write16(PORTHIO_MASKA_TOGGLE, val)
967#define bfin_read_PORTHIO_MASKB() bfin_read16(PORTHIO_MASKB)
968#define bfin_write_PORTHIO_MASKB(val) bfin_write16(PORTHIO_MASKB, val)
969#define bfin_read_PORTHIO_MASKB_CLEAR() bfin_read16(PORTHIO_MASKB_CLEAR)
970#define bfin_write_PORTHIO_MASKB_CLEAR(val) bfin_write16(PORTHIO_MASKB_CLEAR, val)
971#define bfin_read_PORTHIO_MASKB_SET() bfin_read16(PORTHIO_MASKB_SET)
972#define bfin_write_PORTHIO_MASKB_SET(val) bfin_write16(PORTHIO_MASKB_SET, val)
973#define bfin_read_PORTHIO_MASKB_TOGGLE() bfin_read16(PORTHIO_MASKB_TOGGLE)
974#define bfin_write_PORTHIO_MASKB_TOGGLE(val) bfin_write16(PORTHIO_MASKB_TOGGLE, val)
975#define bfin_read_PORTHIO_DIR() bfin_read16(PORTHIO_DIR)
976#define bfin_write_PORTHIO_DIR(val) bfin_write16(PORTHIO_DIR, val)
977#define bfin_read_PORTHIO_POLAR() bfin_read16(PORTHIO_POLAR)
978#define bfin_write_PORTHIO_POLAR(val) bfin_write16(PORTHIO_POLAR, val)
979#define bfin_read_PORTHIO_EDGE() bfin_read16(PORTHIO_EDGE)
980#define bfin_write_PORTHIO_EDGE(val) bfin_write16(PORTHIO_EDGE, val)
981#define bfin_read_PORTHIO_BOTH() bfin_read16(PORTHIO_BOTH)
982#define bfin_write_PORTHIO_BOTH(val) bfin_write16(PORTHIO_BOTH, val)
983#define bfin_read_PORTHIO_INEN() bfin_read16(PORTHIO_INEN)
984#define bfin_write_PORTHIO_INEN(val) bfin_write16(PORTHIO_INEN, val)
985
986
987/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
988#define bfin_read_UART1_THR() bfin_read16(UART1_THR)
989#define bfin_write_UART1_THR(val) bfin_write16(UART1_THR, val)
990#define bfin_read_UART1_RBR() bfin_read16(UART1_RBR)
991#define bfin_write_UART1_RBR(val) bfin_write16(UART1_RBR, val)
992#define bfin_read_UART1_DLL() bfin_read16(UART1_DLL)
993#define bfin_write_UART1_DLL(val) bfin_write16(UART1_DLL, val)
994#define bfin_read_UART1_IER() bfin_read16(UART1_IER)
995#define bfin_write_UART1_IER(val) bfin_write16(UART1_IER, val)
996#define bfin_read_UART1_DLH() bfin_read16(UART1_DLH)
997#define bfin_write_UART1_DLH(val) bfin_write16(UART1_DLH, val)
998#define bfin_read_UART1_IIR() bfin_read16(UART1_IIR)
999#define bfin_write_UART1_IIR(val) bfin_write16(UART1_IIR, val)
1000#define bfin_read_UART1_LCR() bfin_read16(UART1_LCR)
1001#define bfin_write_UART1_LCR(val) bfin_write16(UART1_LCR, val)
1002#define bfin_read_UART1_MCR() bfin_read16(UART1_MCR)
1003#define bfin_write_UART1_MCR(val) bfin_write16(UART1_MCR, val)
1004#define bfin_read_UART1_LSR() bfin_read16(UART1_LSR)
1005#define bfin_write_UART1_LSR(val) bfin_write16(UART1_LSR, val)
1006#define bfin_read_UART1_MSR() bfin_read16(UART1_MSR)
1007#define bfin_write_UART1_MSR(val) bfin_write16(UART1_MSR, val)
1008#define bfin_read_UART1_SCR() bfin_read16(UART1_SCR)
1009#define bfin_write_UART1_SCR(val) bfin_write16(UART1_SCR, val)
1010#define bfin_read_UART1_GCTL() bfin_read16(UART1_GCTL)
1011#define bfin_write_UART1_GCTL(val) bfin_write16(UART1_GCTL, val)
1012
1013/* Omit CAN register sets from the cdefBF534.h (CAN is not in the ADSP-BF52x processor) */
1014
1015/* Pin Control Registers (0xFFC03200 - 0xFFC032FF) */
1016#define bfin_read_PORTF_FER() bfin_read16(PORTF_FER)
1017#define bfin_write_PORTF_FER(val) bfin_write16(PORTF_FER, val)
1018#define bfin_read_PORTG_FER() bfin_read16(PORTG_FER)
1019#define bfin_write_PORTG_FER(val) bfin_write16(PORTG_FER, val)
1020#define bfin_read_PORTH_FER() bfin_read16(PORTH_FER)
1021#define bfin_write_PORTH_FER(val) bfin_write16(PORTH_FER, val)
1022#define bfin_read_PORT_MUX() bfin_read16(PORT_MUX)
1023#define bfin_write_PORT_MUX(val) bfin_write16(PORT_MUX, val)
1024
1025
1026/* Handshake MDMA Registers (0xFFC03300 - 0xFFC033FF) */
1027#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
1028#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
1029#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
1030#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT, val)
1031#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
1032#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT, val)
1033#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
1034#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
1035#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
1036#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
1037#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
1038#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT, val)
1039#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
1040#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT, val)
1041
1042#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
1043#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
1044#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
1045#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT, val)
1046#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
1047#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT, val)
1048#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
1049#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
1050#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
1051#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
1052#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
1053#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT, val)
1054#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
1055#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT, val)
1056
1057/* ==== end from cdefBF534.h ==== */
1058
1059/* GPIO PIN mux (0xFFC03210 - OxFFC03288) */
1060
1061#define bfin_read_PORTF_MUX() bfin_read16(PORTF_MUX)
1062#define bfin_write_PORTF_MUX(val) bfin_write16(PORTF_MUX, val)
1063#define bfin_read_PORTG_MUX() bfin_read16(PORTG_MUX)
1064#define bfin_write_PORTG_MUX(val) bfin_write16(PORTG_MUX, val)
1065#define bfin_read_PORTH_MUX() bfin_read16(PORTH_MUX)
1066#define bfin_write_PORTH_MUX(val) bfin_write16(PORTH_MUX, val)
1067
1068#define bfin_read_PORTF_DRIVE() bfin_read16(PORTF_DRIVE)
1069#define bfin_write_PORTF_DRIVE(val) bfin_write16(PORTF_DRIVE, val)
1070#define bfin_read_PORTG_DRIVE() bfin_read16(PORTG_DRIVE)
1071#define bfin_write_PORTG_DRIVE(val) bfin_write16(PORTG_DRIVE, val)
1072#define bfin_read_PORTH_DRIVE() bfin_read16(PORTH_DRIVE)
1073#define bfin_write_PORTH_DRIVE(val) bfin_write16(PORTH_DRIVE, val)
1074#define bfin_read_PORTF_SLEW() bfin_read16(PORTF_SLEW)
1075#define bfin_write_PORTF_SLEW(val) bfin_write16(PORTF_SLEW, val)
1076#define bfin_read_PORTG_SLEW() bfin_read16(PORTG_SLEW)
1077#define bfin_write_PORTG_SLEW(val) bfin_write16(PORTG_SLEW, val)
1078#define bfin_read_PORTH_SLEW() bfin_read16(PORTH_SLEW)
1079#define bfin_write_PORTH_SLEW(val) bfin_write16(PORTH_SLEW, val)
1080#define bfin_read_PORTF_HYSTERISIS() bfin_read16(PORTF_HYSTERISIS)
1081#define bfin_write_PORTF_HYSTERISIS(val) bfin_write16(PORTF_HYSTERISIS, val)
1082#define bfin_read_PORTG_HYSTERISIS() bfin_read16(PORTG_HYSTERISIS)
1083#define bfin_write_PORTG_HYSTERISIS(val) bfin_write16(PORTG_HYSTERISIS, val)
1084#define bfin_read_PORTH_HYSTERISIS() bfin_read16(PORTH_HYSTERISIS)
1085#define bfin_write_PORTH_HYSTERISIS(val) bfin_write16(PORTH_HYSTERISIS, val)
1086#define bfin_read_MISCPORT_DRIVE() bfin_read16(MISCPORT_DRIVE)
1087#define bfin_write_MISCPORT_DRIVE(val) bfin_write16(MISCPORT_DRIVE, val)
1088#define bfin_read_MISCPORT_SLEW() bfin_read16(MISCPORT_SLEW)
1089#define bfin_write_MISCPORT_SLEW(val) bfin_write16(MISCPORT_SLEW, val)
1090#define bfin_read_MISCPORT_HYSTERISIS() bfin_read16(MISCPORT_HYSTERISIS)
1091#define bfin_write_MISCPORT_HYSTERISIS(val) bfin_write16(MISCPORT_HYSTERISIS, val)
1092
1093/* HOST Port Registers */
1094
1095#define bfin_read_HOST_CONTROL() bfin_read16(HOST_CONTROL)
1096#define bfin_write_HOST_CONTROL(val) bfin_write16(HOST_CONTROL, val)
1097#define bfin_read_HOST_STATUS() bfin_read16(HOST_STATUS)
1098#define bfin_write_HOST_STATUS(val) bfin_write16(HOST_STATUS, val)
1099#define bfin_read_HOST_TIMEOUT() bfin_read16(HOST_TIMEOUT)
1100#define bfin_write_HOST_TIMEOUT(val) bfin_write16(HOST_TIMEOUT, val)
1101
1102/* Counter Registers */
1103
1104#define bfin_read_CNT_CONFIG() bfin_read16(CNT_CONFIG)
1105#define bfin_write_CNT_CONFIG(val) bfin_write16(CNT_CONFIG, val)
1106#define bfin_read_CNT_IMASK() bfin_read16(CNT_IMASK)
1107#define bfin_write_CNT_IMASK(val) bfin_write16(CNT_IMASK, val)
1108#define bfin_read_CNT_STATUS() bfin_read16(CNT_STATUS)
1109#define bfin_write_CNT_STATUS(val) bfin_write16(CNT_STATUS, val)
1110#define bfin_read_CNT_COMMAND() bfin_read16(CNT_COMMAND)
1111#define bfin_write_CNT_COMMAND(val) bfin_write16(CNT_COMMAND, val)
1112#define bfin_read_CNT_DEBOUNCE() bfin_read16(CNT_DEBOUNCE)
1113#define bfin_write_CNT_DEBOUNCE(val) bfin_write16(CNT_DEBOUNCE, val)
1114#define bfin_read_CNT_COUNTER() bfin_read32(CNT_COUNTER)
1115#define bfin_write_CNT_COUNTER(val) bfin_write32(CNT_COUNTER, val)
1116#define bfin_read_CNT_MAX() bfin_read32(CNT_MAX)
1117#define bfin_write_CNT_MAX(val) bfin_write32(CNT_MAX, val)
1118#define bfin_read_CNT_MIN() bfin_read32(CNT_MIN)
1119#define bfin_write_CNT_MIN(val) bfin_write32(CNT_MIN, val)
1120
1121/* OTP/FUSE Registers */
1122
1123#define bfin_read_OTP_CONTROL() bfin_read16(OTP_CONTROL)
1124#define bfin_write_OTP_CONTROL(val) bfin_write16(OTP_CONTROL, val)
1125#define bfin_read_OTP_BEN() bfin_read16(OTP_BEN)
1126#define bfin_write_OTP_BEN(val) bfin_write16(OTP_BEN, val)
1127#define bfin_read_OTP_STATUS() bfin_read16(OTP_STATUS)
1128#define bfin_write_OTP_STATUS(val) bfin_write16(OTP_STATUS, val)
1129#define bfin_read_OTP_TIMING() bfin_read32(OTP_TIMING)
1130#define bfin_write_OTP_TIMING(val) bfin_write32(OTP_TIMING, val)
1131
1132/* Security Registers */
1133
1134#define bfin_read_SECURE_SYSSWT() bfin_read32(SECURE_SYSSWT)
1135#define bfin_write_SECURE_SYSSWT(val) bfin_write32(SECURE_SYSSWT, val)
1136#define bfin_read_SECURE_CONTROL() bfin_read16(SECURE_CONTROL)
1137#define bfin_write_SECURE_CONTROL(val) bfin_write16(SECURE_CONTROL, val)
1138#define bfin_read_SECURE_STATUS() bfin_read16(SECURE_STATUS)
1139#define bfin_write_SECURE_STATUS(val) bfin_write16(SECURE_STATUS, val)
1140
1141/* OTP Read/Write Data Buffer Registers */
1142
1143#define bfin_read_OTP_DATA0() bfin_read32(OTP_DATA0)
1144#define bfin_write_OTP_DATA0(val) bfin_write32(OTP_DATA0, val)
1145#define bfin_read_OTP_DATA1() bfin_read32(OTP_DATA1)
1146#define bfin_write_OTP_DATA1(val) bfin_write32(OTP_DATA1, val)
1147#define bfin_read_OTP_DATA2() bfin_read32(OTP_DATA2)
1148#define bfin_write_OTP_DATA2(val) bfin_write32(OTP_DATA2, val)
1149#define bfin_read_OTP_DATA3() bfin_read32(OTP_DATA3)
1150#define bfin_write_OTP_DATA3(val) bfin_write32(OTP_DATA3, val)
1151
1152/* NFC Registers */
1153
1154#define bfin_read_NFC_CTL() bfin_read16(NFC_CTL)
1155#define bfin_write_NFC_CTL(val) bfin_write16(NFC_CTL, val)
1156#define bfin_read_NFC_STAT() bfin_read16(NFC_STAT)
1157#define bfin_write_NFC_STAT(val) bfin_write16(NFC_STAT, val)
1158#define bfin_read_NFC_IRQSTAT() bfin_read16(NFC_IRQSTAT)
1159#define bfin_write_NFC_IRQSTAT(val) bfin_write16(NFC_IRQSTAT, val)
1160#define bfin_read_NFC_IRQMASK() bfin_read16(NFC_IRQMASK)
1161#define bfin_write_NFC_IRQMASK(val) bfin_write16(NFC_IRQMASK, val)
1162#define bfin_read_NFC_ECC0() bfin_read16(NFC_ECC0)
1163#define bfin_write_NFC_ECC0(val) bfin_write16(NFC_ECC0, val)
1164#define bfin_read_NFC_ECC1() bfin_read16(NFC_ECC1)
1165#define bfin_write_NFC_ECC1(val) bfin_write16(NFC_ECC1, val)
1166#define bfin_read_NFC_ECC2() bfin_read16(NFC_ECC2)
1167#define bfin_write_NFC_ECC2(val) bfin_write16(NFC_ECC2, val)
1168#define bfin_read_NFC_ECC3() bfin_read16(NFC_ECC3)
1169#define bfin_write_NFC_ECC3(val) bfin_write16(NFC_ECC3, val)
1170#define bfin_read_NFC_COUNT() bfin_read16(NFC_COUNT)
1171#define bfin_write_NFC_COUNT(val) bfin_write16(NFC_COUNT, val)
1172#define bfin_read_NFC_RST() bfin_read16(NFC_RST)
1173#define bfin_write_NFC_RST(val) bfin_write16(NFC_RST, val)
1174#define bfin_read_NFC_PGCTL() bfin_read16(NFC_PGCTL)
1175#define bfin_write_NFC_PGCTL(val) bfin_write16(NFC_PGCTL, val)
1176#define bfin_read_NFC_READ() bfin_read16(NFC_READ)
1177#define bfin_write_NFC_READ(val) bfin_write16(NFC_READ, val)
1178#define bfin_read_NFC_ADDR() bfin_read16(NFC_ADDR)
1179#define bfin_write_NFC_ADDR(val) bfin_write16(NFC_ADDR, val)
1180#define bfin_read_NFC_CMD() bfin_read16(NFC_CMD)
1181#define bfin_write_NFC_CMD(val) bfin_write16(NFC_CMD, val)
1182#define bfin_read_NFC_DATA_WR() bfin_read16(NFC_DATA_WR)
1183#define bfin_write_NFC_DATA_WR(val) bfin_write16(NFC_DATA_WR, val)
1184#define bfin_read_NFC_DATA_RD() bfin_read16(NFC_DATA_RD)
1185#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val)
1186
1187#endif /* _CDEF_BF52X_H */
diff --git a/include/asm-blackfin/mach-bf527/defBF522.h b/include/asm-blackfin/mach-bf527/defBF522.h
new file mode 100644
index 000000000000..9671d8f2c5ef
--- /dev/null
+++ b/include/asm-blackfin/mach-bf527/defBF522.h
@@ -0,0 +1,42 @@
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
new file mode 100644
index 000000000000..6a375a084acc
--- /dev/null
+++ b/include/asm-blackfin/mach-bf527/defBF525.h
@@ -0,0 +1,713 @@
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
new file mode 100644
index 000000000000..2be3293f9e26
--- /dev/null
+++ b/include/asm-blackfin/mach-bf527/defBF527.h
@@ -0,0 +1,1089 @@
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 <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 MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */
306
307#define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */
308
309/* EMAC_SYSTAT Masks */
310
311#define PHYINT 0x00000001 /* PHY_INT Interrupt Status */
312#define MMCINT 0x00000002 /* MMC Counter Interrupt Status */
313#define RXFSINT 0x00000004 /* RX Frame-Status Interrupt Status */
314#define TXFSINT 0x00000008 /* TX Frame-Status Interrupt Status */
315#define WAKEDET 0x00000010 /* Wake-Up Detected Status */
316#define RXDMAERR 0x00000020 /* RX DMA Direction Error Status */
317#define TXDMAERR 0x00000040 /* TX DMA Direction Error Status */
318#define STMDONE 0x00000080 /* Station Mgt. Transfer Done Interrupt Status */
319
320/* EMAC_RX_STAT, EMAC_RX_STKY, and EMAC_RX_IRQE Masks */
321
322#define RX_FRLEN 0x000007FF /* Frame Length In Bytes */
323#define RX_COMP 0x00001000 /* RX Frame Complete */
324#define RX_OK 0x00002000 /* RX Frame Received With No Errors */
325#define RX_LONG 0x00004000 /* RX Frame Too Long Error */
326#define RX_ALIGN 0x00008000 /* RX Frame Alignment Error */
327#define RX_CRC 0x00010000 /* RX Frame CRC Error */
328#define RX_LEN 0x00020000 /* RX Frame Length Error */
329#define RX_FRAG 0x00040000 /* RX Frame Fragment Error */
330#define RX_ADDR 0x00080000 /* RX Frame Address Filter Failed Error */
331#define RX_DMAO 0x00100000 /* RX Frame DMA Overrun Error */
332#define RX_PHY 0x00200000 /* RX Frame PHY Error */
333#define RX_LATE 0x00400000 /* RX Frame Late Collision Error */
334#define RX_RANGE 0x00800000 /* RX Frame Length Field Out of Range Error */
335#define RX_MULTI 0x01000000 /* RX Multicast Frame Indicator */
336#define RX_BROAD 0x02000000 /* RX Broadcast Frame Indicator */
337#define RX_CTL 0x04000000 /* RX Control Frame Indicator */
338#define RX_UCTL 0x08000000 /* Unsupported RX Control Frame Indicator */
339#define RX_TYPE 0x10000000 /* RX Typed Frame Indicator */
340#define RX_VLAN1 0x20000000 /* RX VLAN1 Frame Indicator */
341#define RX_VLAN2 0x40000000 /* RX VLAN2 Frame Indicator */
342#define RX_ACCEPT 0x80000000 /* RX Frame Accepted Indicator */
343
344/* EMAC_TX_STAT, EMAC_TX_STKY, and EMAC_TX_IRQE Masks */
345
346#define TX_COMP 0x00000001 /* TX Frame Complete */
347#define TX_OK 0x00000002 /* TX Frame Sent With No Errors */
348#define TX_ECOLL 0x00000004 /* TX Frame Excessive Collision Error */
349#define TX_LATE 0x00000008 /* TX Frame Late Collision Error */
350#define TX_DMAU 0x00000010 /* TX Frame DMA Underrun Error (STAT) */
351#define TX_MACE 0x00000010 /* Internal MAC Error Detected (STKY and IRQE) */
352#define TX_EDEFER 0x00000020 /* TX Frame Excessive Deferral Error */
353#define TX_BROAD 0x00000040 /* TX Broadcast Frame Indicator */
354#define TX_MULTI 0x00000080 /* TX Multicast Frame Indicator */
355#define TX_CCNT 0x00000F00 /* TX Frame Collision Count */
356#define TX_DEFER 0x00001000 /* TX Frame Deferred Indicator */
357#define TX_CRS 0x00002000 /* TX Frame Carrier Sense Not Asserted Error */
358#define TX_LOSS 0x00004000 /* TX Frame Carrier Lost During TX Error */
359#define TX_RETRY 0x00008000 /* TX Frame Successful After Retry */
360#define TX_FRLEN 0x07FF0000 /* TX Frame Length (Bytes) */
361
362/* EMAC_MMC_CTL Masks */
363#define RSTC 0x00000001 /* Reset All Counters */
364#define CROLL 0x00000002 /* Counter Roll-Over Enable */
365#define CCOR 0x00000004 /* Counter Clear-On-Read Mode Enable */
366#define MMCE 0x00000008 /* Enable MMC Counter Operation */
367
368/* EMAC_MMC_RIRQS and EMAC_MMC_RIRQE Masks */
369#define RX_OK_CNT 0x00000001 /* RX Frames Received With No Errors */
370#define RX_FCS_CNT 0x00000002 /* RX Frames W/Frame Check Sequence Errors */
371#define RX_ALIGN_CNT 0x00000004 /* RX Frames With Alignment Errors */
372#define RX_OCTET_CNT 0x00000008 /* RX Octets Received OK */
373#define RX_LOST_CNT 0x00000010 /* RX Frames Lost Due To Internal MAC RX Error */
374#define RX_UNI_CNT 0x00000020 /* Unicast RX Frames Received OK */
375#define RX_MULTI_CNT 0x00000040 /* Multicast RX Frames Received OK */
376#define RX_BROAD_CNT 0x00000080 /* Broadcast RX Frames Received OK */
377#define RX_IRL_CNT 0x00000100 /* RX Frames With In-Range Length Errors */
378#define RX_ORL_CNT 0x00000200 /* RX Frames With Out-Of-Range Length Errors */
379#define RX_LONG_CNT 0x00000400 /* RX Frames With Frame Too Long Errors */
380#define RX_MACCTL_CNT 0x00000800 /* MAC Control RX Frames Received */
381#define RX_OPCODE_CTL 0x00001000 /* Unsupported Op-Code RX Frames Received */
382#define RX_PAUSE_CNT 0x00002000 /* PAUSEMAC Control RX Frames Received */
383#define RX_ALLF_CNT 0x00004000 /* All RX Frames Received */
384#define RX_ALLO_CNT 0x00008000 /* All RX Octets Received */
385#define RX_TYPED_CNT 0x00010000 /* Typed RX Frames Received */
386#define RX_SHORT_CNT 0x00020000 /* RX Frame Fragments (< 64 Bytes) Received */
387#define RX_EQ64_CNT 0x00040000 /* 64-Byte RX Frames Received */
388#define RX_LT128_CNT 0x00080000 /* 65-127-Byte RX Frames Received */
389#define RX_LT256_CNT 0x00100000 /* 128-255-Byte RX Frames Received */
390#define RX_LT512_CNT 0x00200000 /* 256-511-Byte RX Frames Received */
391#define RX_LT1024_CNT 0x00400000 /* 512-1023-Byte RX Frames Received */
392#define RX_GE1024_CNT 0x00800000 /* 1024-Max-Byte RX Frames Received */
393
394/* EMAC_MMC_TIRQS and EMAC_MMC_TIRQE Masks */
395
396#define TX_OK_CNT 0x00000001 /* TX Frames Sent OK */
397#define TX_SCOLL_CNT 0x00000002 /* TX Frames With Single Collisions */
398#define TX_MCOLL_CNT 0x00000004 /* TX Frames With Multiple Collisions */
399#define TX_OCTET_CNT 0x00000008 /* TX Octets Sent OK */
400#define TX_DEFER_CNT 0x00000010 /* TX Frames With Deferred Transmission */
401#define TX_LATE_CNT 0x00000020 /* TX Frames With Late Collisions */
402#define TX_ABORTC_CNT 0x00000040 /* TX Frames Aborted Due To Excess Collisions */
403#define TX_LOST_CNT 0x00000080 /* TX Frames Lost Due To Internal MAC TX Error */
404#define TX_CRS_CNT 0x00000100 /* TX Frames With Carrier Sense Errors */
405#define TX_UNI_CNT 0x00000200 /* Unicast TX Frames Sent */
406#define TX_MULTI_CNT 0x00000400 /* Multicast TX Frames Sent */
407#define TX_BROAD_CNT 0x00000800 /* Broadcast TX Frames Sent */
408#define TX_EXDEF_CTL 0x00001000 /* TX Frames With Excessive Deferral */
409#define TX_MACCTL_CNT 0x00002000 /* MAC Control TX Frames Sent */
410#define TX_ALLF_CNT 0x00004000 /* All TX Frames Sent */
411#define TX_ALLO_CNT 0x00008000 /* All TX Octets Sent */
412#define TX_EQ64_CNT 0x00010000 /* 64-Byte TX Frames Sent */
413#define TX_LT128_CNT 0x00020000 /* 65-127-Byte TX Frames Sent */
414#define TX_LT256_CNT 0x00040000 /* 128-255-Byte TX Frames Sent */
415#define TX_LT512_CNT 0x00080000 /* 256-511-Byte TX Frames Sent */
416#define TX_LT1024_CNT 0x00100000 /* 512-1023-Byte TX Frames Sent */
417#define TX_GE1024_CNT 0x00200000 /* 1024-Max-Byte TX Frames Sent */
418#define TX_ABORT_CNT 0x00400000 /* TX Frames Aborted */
419
420/* USB Control Registers */
421
422#define USB_FADDR 0xffc03800 /* Function address register */
423#define USB_POWER 0xffc03804 /* Power management register */
424#define USB_INTRTX 0xffc03808 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
425#define USB_INTRRX 0xffc0380c /* Interrupt register for Rx endpoints 1 to 7 */
426#define USB_INTRTXE 0xffc03810 /* Interrupt enable register for IntrTx */
427#define USB_INTRRXE 0xffc03814 /* Interrupt enable register for IntrRx */
428#define USB_INTRUSB 0xffc03818 /* Interrupt register for common USB interrupts */
429#define USB_INTRUSBE 0xffc0381c /* Interrupt enable register for IntrUSB */
430#define USB_FRAME 0xffc03820 /* USB frame number */
431#define USB_INDEX 0xffc03824 /* Index register for selecting the indexed endpoint registers */
432#define USB_TESTMODE 0xffc03828 /* Enabled USB 20 test modes */
433#define USB_GLOBINTR 0xffc0382c /* Global Interrupt Mask register and Wakeup Exception Interrupt */
434#define USB_GLOBAL_CTL 0xffc03830 /* Global Clock Control for the core */
435
436/* USB Packet Control Registers */
437
438#define USB_TX_MAX_PACKET 0xffc03840 /* Maximum packet size for Host Tx endpoint */
439#define USB_CSR0 0xffc03844 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
440#define USB_TXCSR 0xffc03844 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
441#define USB_RX_MAX_PACKET 0xffc03848 /* Maximum packet size for Host Rx endpoint */
442#define USB_RXCSR 0xffc0384c /* Control Status register for Host Rx endpoint */
443#define USB_COUNT0 0xffc03850 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
444#define USB_RXCOUNT 0xffc03850 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
445#define USB_TXTYPE 0xffc03854 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint */
446#define USB_NAKLIMIT0 0xffc03858 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
447#define USB_TXINTERVAL 0xffc03858 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
448#define USB_RXTYPE 0xffc0385c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint */
449#define USB_RXINTERVAL 0xffc03860 /* Sets the polling interval for Interrupt and Isochronous transfers or the NAK response timeout on Bulk transfers */
450#define USB_TXCOUNT 0xffc03868 /* Number of bytes to be written to the selected endpoint Tx FIFO */
451
452/* USB Endpoint FIFO Registers */
453
454#define USB_EP0_FIFO 0xffc03880 /* Endpoint 0 FIFO */
455#define USB_EP1_FIFO 0xffc03888 /* Endpoint 1 FIFO */
456#define USB_EP2_FIFO 0xffc03890 /* Endpoint 2 FIFO */
457#define USB_EP3_FIFO 0xffc03898 /* Endpoint 3 FIFO */
458#define USB_EP4_FIFO 0xffc038a0 /* Endpoint 4 FIFO */
459#define USB_EP5_FIFO 0xffc038a8 /* Endpoint 5 FIFO */
460#define USB_EP6_FIFO 0xffc038b0 /* Endpoint 6 FIFO */
461#define USB_EP7_FIFO 0xffc038b8 /* Endpoint 7 FIFO */
462
463/* USB OTG Control Registers */
464
465#define USB_OTG_DEV_CTL 0xffc03900 /* OTG Device Control Register */
466#define USB_OTG_VBUS_IRQ 0xffc03904 /* OTG VBUS Control Interrupts */
467#define USB_OTG_VBUS_MASK 0xffc03908 /* VBUS Control Interrupt Enable */
468
469/* USB Phy Control Registers */
470
471#define USB_LINKINFO 0xffc03948 /* Enables programming of some PHY-side delays */
472#define USB_VPLEN 0xffc0394c /* Determines duration of VBUS pulse for VBUS charging */
473#define USB_HS_EOF1 0xffc03950 /* Time buffer for High-Speed transactions */
474#define USB_FS_EOF1 0xffc03954 /* Time buffer for Full-Speed transactions */
475#define USB_LS_EOF1 0xffc03958 /* Time buffer for Low-Speed transactions */
476
477/* (APHY_CNTRL is for ADI usage only) */
478
479#define USB_APHY_CNTRL 0xffc039e0 /* Register that increases visibility of Analog PHY */
480
481/* (APHY_CALIB is for ADI usage only) */
482
483#define USB_APHY_CALIB 0xffc039e4 /* Register used to set some calibration values */
484
485#define USB_APHY_CNTRL2 0xffc039e8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */
486
487/* (PHY_TEST is for ADI usage only) */
488
489#define USB_PHY_TEST 0xffc039ec /* Used for reducing simulation time and simplifies FIFO testability */
490
491#define USB_PLLOSC_CTRL 0xffc039f0 /* Used to program different parameters for USB PLL and Oscillator */
492#define USB_SRP_CLKDIV 0xffc039f4 /* Used to program clock divide value for the clock fed to the SRP detection logic */
493
494/* USB Endpoint 0 Control Registers */
495
496#define USB_EP_NI0_TXMAXP 0xffc03a00 /* Maximum packet size for Host Tx endpoint0 */
497#define USB_EP_NI0_TXCSR 0xffc03a04 /* Control Status register for endpoint 0 */
498#define USB_EP_NI0_RXMAXP 0xffc03a08 /* Maximum packet size for Host Rx endpoint0 */
499#define USB_EP_NI0_RXCSR 0xffc03a0c /* Control Status register for Host Rx endpoint0 */
500#define USB_EP_NI0_RXCOUNT 0xffc03a10 /* Number of bytes received in endpoint 0 FIFO */
501#define USB_EP_NI0_TXTYPE 0xffc03a14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint0 */
502#define USB_EP_NI0_TXINTERVAL 0xffc03a18 /* Sets the NAK response timeout on Endpoint 0 */
503#define USB_EP_NI0_RXTYPE 0xffc03a1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint0 */
504#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 */
505#define USB_EP_NI0_TXCOUNT 0xffc03a28 /* Number of bytes to be written to the endpoint0 Tx FIFO */
506
507/* USB Endpoint 1 Control Registers */
508
509#define USB_EP_NI1_TXMAXP 0xffc03a40 /* Maximum packet size for Host Tx endpoint1 */
510#define USB_EP_NI1_TXCSR 0xffc03a44 /* Control Status register for endpoint1 */
511#define USB_EP_NI1_RXMAXP 0xffc03a48 /* Maximum packet size for Host Rx endpoint1 */
512#define USB_EP_NI1_RXCSR 0xffc03a4c /* Control Status register for Host Rx endpoint1 */
513#define USB_EP_NI1_RXCOUNT 0xffc03a50 /* Number of bytes received in endpoint1 FIFO */
514#define USB_EP_NI1_TXTYPE 0xffc03a54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint1 */
515#define USB_EP_NI1_TXINTERVAL 0xffc03a58 /* Sets the NAK response timeout on Endpoint1 */
516#define USB_EP_NI1_RXTYPE 0xffc03a5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint1 */
517#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 */
518#define USB_EP_NI1_TXCOUNT 0xffc03a68 /* Number of bytes to be written to the+H102 endpoint1 Tx FIFO */
519
520/* USB Endpoint 2 Control Registers */
521
522#define USB_EP_NI2_TXMAXP 0xffc03a80 /* Maximum packet size for Host Tx endpoint2 */
523#define USB_EP_NI2_TXCSR 0xffc03a84 /* Control Status register for endpoint2 */
524#define USB_EP_NI2_RXMAXP 0xffc03a88 /* Maximum packet size for Host Rx endpoint2 */
525#define USB_EP_NI2_RXCSR 0xffc03a8c /* Control Status register for Host Rx endpoint2 */
526#define USB_EP_NI2_RXCOUNT 0xffc03a90 /* Number of bytes received in endpoint2 FIFO */
527#define USB_EP_NI2_TXTYPE 0xffc03a94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint2 */
528#define USB_EP_NI2_TXINTERVAL 0xffc03a98 /* Sets the NAK response timeout on Endpoint2 */
529#define USB_EP_NI2_RXTYPE 0xffc03a9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint2 */
530#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 */
531#define USB_EP_NI2_TXCOUNT 0xffc03aa8 /* Number of bytes to be written to the endpoint2 Tx FIFO */
532
533/* USB Endpoint 3 Control Registers */
534
535#define USB_EP_NI3_TXMAXP 0xffc03ac0 /* Maximum packet size for Host Tx endpoint3 */
536#define USB_EP_NI3_TXCSR 0xffc03ac4 /* Control Status register for endpoint3 */
537#define USB_EP_NI3_RXMAXP 0xffc03ac8 /* Maximum packet size for Host Rx endpoint3 */
538#define USB_EP_NI3_RXCSR 0xffc03acc /* Control Status register for Host Rx endpoint3 */
539#define USB_EP_NI3_RXCOUNT 0xffc03ad0 /* Number of bytes received in endpoint3 FIFO */
540#define USB_EP_NI3_TXTYPE 0xffc03ad4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint3 */
541#define USB_EP_NI3_TXINTERVAL 0xffc03ad8 /* Sets the NAK response timeout on Endpoint3 */
542#define USB_EP_NI3_RXTYPE 0xffc03adc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint3 */
543#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 */
544#define USB_EP_NI3_TXCOUNT 0xffc03ae8 /* Number of bytes to be written to the H124endpoint3 Tx FIFO */
545
546/* USB Endpoint 4 Control Registers */
547
548#define USB_EP_NI4_TXMAXP 0xffc03b00 /* Maximum packet size for Host Tx endpoint4 */
549#define USB_EP_NI4_TXCSR 0xffc03b04 /* Control Status register for endpoint4 */
550#define USB_EP_NI4_RXMAXP 0xffc03b08 /* Maximum packet size for Host Rx endpoint4 */
551#define USB_EP_NI4_RXCSR 0xffc03b0c /* Control Status register for Host Rx endpoint4 */
552#define USB_EP_NI4_RXCOUNT 0xffc03b10 /* Number of bytes received in endpoint4 FIFO */
553#define USB_EP_NI4_TXTYPE 0xffc03b14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint4 */
554#define USB_EP_NI4_TXINTERVAL 0xffc03b18 /* Sets the NAK response timeout on Endpoint4 */
555#define USB_EP_NI4_RXTYPE 0xffc03b1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint4 */
556#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 */
557#define USB_EP_NI4_TXCOUNT 0xffc03b28 /* Number of bytes to be written to the endpoint4 Tx FIFO */
558
559/* USB Endpoint 5 Control Registers */
560
561#define USB_EP_NI5_TXMAXP 0xffc03b40 /* Maximum packet size for Host Tx endpoint5 */
562#define USB_EP_NI5_TXCSR 0xffc03b44 /* Control Status register for endpoint5 */
563#define USB_EP_NI5_RXMAXP 0xffc03b48 /* Maximum packet size for Host Rx endpoint5 */
564#define USB_EP_NI5_RXCSR 0xffc03b4c /* Control Status register for Host Rx endpoint5 */
565#define USB_EP_NI5_RXCOUNT 0xffc03b50 /* Number of bytes received in endpoint5 FIFO */
566#define USB_EP_NI5_TXTYPE 0xffc03b54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint5 */
567#define USB_EP_NI5_TXINTERVAL 0xffc03b58 /* Sets the NAK response timeout on Endpoint5 */
568#define USB_EP_NI5_RXTYPE 0xffc03b5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint5 */
569#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 */
570#define USB_EP_NI5_TXCOUNT 0xffc03b68 /* Number of bytes to be written to the endpoint5 Tx FIFO */
571
572/* USB Endpoint 6 Control Registers */
573
574#define USB_EP_NI6_TXMAXP 0xffc03b80 /* Maximum packet size for Host Tx endpoint6 */
575#define USB_EP_NI6_TXCSR 0xffc03b84 /* Control Status register for endpoint6 */
576#define USB_EP_NI6_RXMAXP 0xffc03b88 /* Maximum packet size for Host Rx endpoint6 */
577#define USB_EP_NI6_RXCSR 0xffc03b8c /* Control Status register for Host Rx endpoint6 */
578#define USB_EP_NI6_RXCOUNT 0xffc03b90 /* Number of bytes received in endpoint6 FIFO */
579#define USB_EP_NI6_TXTYPE 0xffc03b94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint6 */
580#define USB_EP_NI6_TXINTERVAL 0xffc03b98 /* Sets the NAK response timeout on Endpoint6 */
581#define USB_EP_NI6_RXTYPE 0xffc03b9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint6 */
582#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 */
583#define USB_EP_NI6_TXCOUNT 0xffc03ba8 /* Number of bytes to be written to the endpoint6 Tx FIFO */
584
585/* USB Endpoint 7 Control Registers */
586
587#define USB_EP_NI7_TXMAXP 0xffc03bc0 /* Maximum packet size for Host Tx endpoint7 */
588#define USB_EP_NI7_TXCSR 0xffc03bc4 /* Control Status register for endpoint7 */
589#define USB_EP_NI7_RXMAXP 0xffc03bc8 /* Maximum packet size for Host Rx endpoint7 */
590#define USB_EP_NI7_RXCSR 0xffc03bcc /* Control Status register for Host Rx endpoint7 */
591#define USB_EP_NI7_RXCOUNT 0xffc03bd0 /* Number of bytes received in endpoint7 FIFO */
592#define USB_EP_NI7_TXTYPE 0xffc03bd4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint7 */
593#define USB_EP_NI7_TXINTERVAL 0xffc03bd8 /* Sets the NAK response timeout on Endpoint7 */
594#define USB_EP_NI7_RXTYPE 0xffc03bdc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint7 */
595#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 */
596#define USB_EP_NI7_TXCOUNT 0xffc03bf8 /* Number of bytes to be written to the endpoint7 Tx FIFO */
597
598#define USB_DMA_INTERRUPT 0xffc03c00 /* Indicates pending interrupts for the DMA channels */
599
600/* USB Channel 0 Config Registers */
601
602#define USB_DMA0CONTROL 0xffc03c04 /* DMA master channel 0 configuration */
603#define USB_DMA0ADDRLOW 0xffc03c08 /* Lower 16-bits of memory source/destination address for DMA master channel 0 */
604#define USB_DMA0ADDRHIGH 0xffc03c0c /* Upper 16-bits of memory source/destination address for DMA master channel 0 */
605#define USB_DMA0COUNTLOW 0xffc03c10 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 0 */
606#define USB_DMA0COUNTHIGH 0xffc03c14 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 0 */
607
608/* USB Channel 1 Config Registers */
609
610#define USB_DMA1CONTROL 0xffc03c24 /* DMA master channel 1 configuration */
611#define USB_DMA1ADDRLOW 0xffc03c28 /* Lower 16-bits of memory source/destination address for DMA master channel 1 */
612#define USB_DMA1ADDRHIGH 0xffc03c2c /* Upper 16-bits of memory source/destination address for DMA master channel 1 */
613#define USB_DMA1COUNTLOW 0xffc03c30 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 1 */
614#define USB_DMA1COUNTHIGH 0xffc03c34 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 1 */
615
616/* USB Channel 2 Config Registers */
617
618#define USB_DMA2CONTROL 0xffc03c44 /* DMA master channel 2 configuration */
619#define USB_DMA2ADDRLOW 0xffc03c48 /* Lower 16-bits of memory source/destination address for DMA master channel 2 */
620#define USB_DMA2ADDRHIGH 0xffc03c4c /* Upper 16-bits of memory source/destination address for DMA master channel 2 */
621#define USB_DMA2COUNTLOW 0xffc03c50 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 2 */
622#define USB_DMA2COUNTHIGH 0xffc03c54 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 2 */
623
624/* USB Channel 3 Config Registers */
625
626#define USB_DMA3CONTROL 0xffc03c64 /* DMA master channel 3 configuration */
627#define USB_DMA3ADDRLOW 0xffc03c68 /* Lower 16-bits of memory source/destination address for DMA master channel 3 */
628#define USB_DMA3ADDRHIGH 0xffc03c6c /* Upper 16-bits of memory source/destination address for DMA master channel 3 */
629#define USB_DMA3COUNTLOW 0xffc03c70 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 3 */
630#define USB_DMA3COUNTHIGH 0xffc03c74 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 3 */
631
632/* USB Channel 4 Config Registers */
633
634#define USB_DMA4CONTROL 0xffc03c84 /* DMA master channel 4 configuration */
635#define USB_DMA4ADDRLOW 0xffc03c88 /* Lower 16-bits of memory source/destination address for DMA master channel 4 */
636#define USB_DMA4ADDRHIGH 0xffc03c8c /* Upper 16-bits of memory source/destination address for DMA master channel 4 */
637#define USB_DMA4COUNTLOW 0xffc03c90 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 4 */
638#define USB_DMA4COUNTHIGH 0xffc03c94 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 4 */
639
640/* USB Channel 5 Config Registers */
641
642#define USB_DMA5CONTROL 0xffc03ca4 /* DMA master channel 5 configuration */
643#define USB_DMA5ADDRLOW 0xffc03ca8 /* Lower 16-bits of memory source/destination address for DMA master channel 5 */
644#define USB_DMA5ADDRHIGH 0xffc03cac /* Upper 16-bits of memory source/destination address for DMA master channel 5 */
645#define USB_DMA5COUNTLOW 0xffc03cb0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 5 */
646#define USB_DMA5COUNTHIGH 0xffc03cb4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 5 */
647
648/* USB Channel 6 Config Registers */
649
650#define USB_DMA6CONTROL 0xffc03cc4 /* DMA master channel 6 configuration */
651#define USB_DMA6ADDRLOW 0xffc03cc8 /* Lower 16-bits of memory source/destination address for DMA master channel 6 */
652#define USB_DMA6ADDRHIGH 0xffc03ccc /* Upper 16-bits of memory source/destination address for DMA master channel 6 */
653#define USB_DMA6COUNTLOW 0xffc03cd0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 6 */
654#define USB_DMA6COUNTHIGH 0xffc03cd4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 6 */
655
656/* USB Channel 7 Config Registers */
657
658#define USB_DMA7CONTROL 0xffc03ce4 /* DMA master channel 7 configuration */
659#define USB_DMA7ADDRLOW 0xffc03ce8 /* Lower 16-bits of memory source/destination address for DMA master channel 7 */
660#define USB_DMA7ADDRHIGH 0xffc03cec /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
661#define USB_DMA7COUNTLOW 0xffc03cf0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
662#define USB_DMA7COUNTHIGH 0xffc03cf4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
663
664/* Bit masks for USB_FADDR */
665
666#define FUNCTION_ADDRESS 0x7f /* Function address */
667
668/* Bit masks for USB_POWER */
669
670#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
671#define nENABLE_SUSPENDM 0x0
672#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
673#define nSUSPEND_MODE 0x0
674#define RESUME_MODE 0x4 /* DMA Mode */
675#define nRESUME_MODE 0x0
676#define RESET 0x8 /* Reset indicator */
677#define nRESET 0x0
678#define HS_MODE 0x10 /* High Speed mode indicator */
679#define nHS_MODE 0x0
680#define HS_ENABLE 0x20 /* high Speed Enable */
681#define nHS_ENABLE 0x0
682#define SOFT_CONN 0x40 /* Soft connect */
683#define nSOFT_CONN 0x0
684#define ISO_UPDATE 0x80 /* Isochronous update */
685#define nISO_UPDATE 0x0
686
687/* Bit masks for USB_INTRTX */
688
689#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
690#define nEP0_TX 0x0
691#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
692#define nEP1_TX 0x0
693#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
694#define nEP2_TX 0x0
695#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
696#define nEP3_TX 0x0
697#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
698#define nEP4_TX 0x0
699#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
700#define nEP5_TX 0x0
701#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
702#define nEP6_TX 0x0
703#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
704#define nEP7_TX 0x0
705
706/* Bit masks for USB_INTRRX */
707
708#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
709#define nEP1_RX 0x0
710#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
711#define nEP2_RX 0x0
712#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
713#define nEP3_RX 0x0
714#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
715#define nEP4_RX 0x0
716#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
717#define nEP5_RX 0x0
718#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
719#define nEP6_RX 0x0
720#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
721#define nEP7_RX 0x0
722
723/* Bit masks for USB_INTRTXE */
724
725#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
726#define nEP0_TX_E 0x0
727#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
728#define nEP1_TX_E 0x0
729#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
730#define nEP2_TX_E 0x0
731#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
732#define nEP3_TX_E 0x0
733#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
734#define nEP4_TX_E 0x0
735#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
736#define nEP5_TX_E 0x0
737#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
738#define nEP6_TX_E 0x0
739#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
740#define nEP7_TX_E 0x0
741
742/* Bit masks for USB_INTRRXE */
743
744#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
745#define nEP1_RX_E 0x0
746#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
747#define nEP2_RX_E 0x0
748#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
749#define nEP3_RX_E 0x0
750#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
751#define nEP4_RX_E 0x0
752#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
753#define nEP5_RX_E 0x0
754#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
755#define nEP6_RX_E 0x0
756#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
757#define nEP7_RX_E 0x0
758
759/* Bit masks for USB_INTRUSB */
760
761#define SUSPEND_B 0x1 /* Suspend indicator */
762#define nSUSPEND_B 0x0
763#define RESUME_B 0x2 /* Resume indicator */
764#define nRESUME_B 0x0
765#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
766#define nRESET_OR_BABLE_B 0x0
767#define SOF_B 0x8 /* Start of frame */
768#define nSOF_B 0x0
769#define CONN_B 0x10 /* Connection indicator */
770#define nCONN_B 0x0
771#define DISCON_B 0x20 /* Disconnect indicator */
772#define nDISCON_B 0x0
773#define SESSION_REQ_B 0x40 /* Session Request */
774#define nSESSION_REQ_B 0x0
775#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
776#define nVBUS_ERROR_B 0x0
777
778/* Bit masks for USB_INTRUSBE */
779
780#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
781#define nSUSPEND_BE 0x0
782#define RESUME_BE 0x2 /* Resume indicator int enable */
783#define nRESUME_BE 0x0
784#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
785#define nRESET_OR_BABLE_BE 0x0
786#define SOF_BE 0x8 /* Start of frame int enable */
787#define nSOF_BE 0x0
788#define CONN_BE 0x10 /* Connection indicator int enable */
789#define nCONN_BE 0x0
790#define DISCON_BE 0x20 /* Disconnect indicator int enable */
791#define nDISCON_BE 0x0
792#define SESSION_REQ_BE 0x40 /* Session Request int enable */
793#define nSESSION_REQ_BE 0x0
794#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
795#define nVBUS_ERROR_BE 0x0
796
797/* Bit masks for USB_FRAME */
798
799#define FRAME_NUMBER 0x7ff /* Frame number */
800
801/* Bit masks for USB_INDEX */
802
803#define SELECTED_ENDPOINT 0xf /* selected endpoint */
804
805/* Bit masks for USB_GLOBAL_CTL */
806
807#define GLOBAL_ENA 0x1 /* enables USB module */
808#define nGLOBAL_ENA 0x0
809#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
810#define nEP1_TX_ENA 0x0
811#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
812#define nEP2_TX_ENA 0x0
813#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
814#define nEP3_TX_ENA 0x0
815#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
816#define nEP4_TX_ENA 0x0
817#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
818#define nEP5_TX_ENA 0x0
819#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
820#define nEP6_TX_ENA 0x0
821#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
822#define nEP7_TX_ENA 0x0
823#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
824#define nEP1_RX_ENA 0x0
825#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
826#define nEP2_RX_ENA 0x0
827#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
828#define nEP3_RX_ENA 0x0
829#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
830#define nEP4_RX_ENA 0x0
831#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
832#define nEP5_RX_ENA 0x0
833#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
834#define nEP6_RX_ENA 0x0
835#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
836#define nEP7_RX_ENA 0x0
837
838/* Bit masks for USB_OTG_DEV_CTL */
839
840#define SESSION 0x1 /* session indicator */
841#define nSESSION 0x0
842#define HOST_REQ 0x2 /* Host negotiation request */
843#define nHOST_REQ 0x0
844#define HOST_MODE 0x4 /* indicates USBDRC is a host */
845#define nHOST_MODE 0x0
846#define VBUS0 0x8 /* Vbus level indicator[0] */
847#define nVBUS0 0x0
848#define VBUS1 0x10 /* Vbus level indicator[1] */
849#define nVBUS1 0x0
850#define LSDEV 0x20 /* Low-speed indicator */
851#define nLSDEV 0x0
852#define FSDEV 0x40 /* Full or High-speed indicator */
853#define nFSDEV 0x0
854#define B_DEVICE 0x80 /* A' or 'B' device indicator */
855#define nB_DEVICE 0x0
856
857/* Bit masks for USB_OTG_VBUS_IRQ */
858
859#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
860#define nDRIVE_VBUS_ON 0x0
861#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
862#define nDRIVE_VBUS_OFF 0x0
863#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
864#define nCHRG_VBUS_START 0x0
865#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
866#define nCHRG_VBUS_END 0x0
867#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
868#define nDISCHRG_VBUS_START 0x0
869#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
870#define nDISCHRG_VBUS_END 0x0
871
872/* Bit masks for USB_OTG_VBUS_MASK */
873
874#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
875#define nDRIVE_VBUS_ON_ENA 0x0
876#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
877#define nDRIVE_VBUS_OFF_ENA 0x0
878#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
879#define nCHRG_VBUS_START_ENA 0x0
880#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
881#define nCHRG_VBUS_END_ENA 0x0
882#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
883#define nDISCHRG_VBUS_START_ENA 0x0
884#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
885#define nDISCHRG_VBUS_END_ENA 0x0
886
887/* Bit masks for USB_CSR0 */
888
889#define RXPKTRDY 0x1 /* data packet receive indicator */
890#define nRXPKTRDY 0x0
891#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
892#define nTXPKTRDY 0x0
893#define STALL_SENT 0x4 /* STALL handshake sent */
894#define nSTALL_SENT 0x0
895#define DATAEND 0x8 /* Data end indicator */
896#define nDATAEND 0x0
897#define SETUPEND 0x10 /* Setup end */
898#define nSETUPEND 0x0
899#define SENDSTALL 0x20 /* Send STALL handshake */
900#define nSENDSTALL 0x0
901#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
902#define nSERVICED_RXPKTRDY 0x0
903#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
904#define nSERVICED_SETUPEND 0x0
905#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
906#define nFLUSHFIFO 0x0
907#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
908#define nSTALL_RECEIVED_H 0x0
909#define SETUPPKT_H 0x8 /* send Setup token host mode */
910#define nSETUPPKT_H 0x0
911#define ERROR_H 0x10 /* timeout error indicator host mode */
912#define nERROR_H 0x0
913#define REQPKT_H 0x20 /* Request an IN transaction host mode */
914#define nREQPKT_H 0x0
915#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
916#define nSTATUSPKT_H 0x0
917#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
918#define nNAK_TIMEOUT_H 0x0
919
920/* Bit masks for USB_COUNT0 */
921
922#define EP0_RX_COUNT 0x7f /* number of received bytes in EP0 FIFO */
923
924/* Bit masks for USB_NAKLIMIT0 */
925
926#define EP0_NAK_LIMIT 0x1f /* number of frames/micro frames after which EP0 timeouts */
927
928/* Bit masks for USB_TX_MAX_PACKET */
929
930#define MAX_PACKET_SIZE_T 0x7ff /* maximum data pay load in a frame */
931
932/* Bit masks for USB_RX_MAX_PACKET */
933
934#define MAX_PACKET_SIZE_R 0x7ff /* maximum data pay load in a frame */
935
936/* Bit masks for USB_TXCSR */
937
938#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
939#define nTXPKTRDY_T 0x0
940#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
941#define nFIFO_NOT_EMPTY_T 0x0
942#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
943#define nUNDERRUN_T 0x0
944#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
945#define nFLUSHFIFO_T 0x0
946#define STALL_SEND_T 0x10 /* issue a Stall handshake */
947#define nSTALL_SEND_T 0x0
948#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
949#define nSTALL_SENT_T 0x0
950#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
951#define nCLEAR_DATATOGGLE_T 0x0
952#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
953#define nINCOMPTX_T 0x0
954#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
955#define nDMAREQMODE_T 0x0
956#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
957#define nFORCE_DATATOGGLE_T 0x0
958#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
959#define nDMAREQ_ENA_T 0x0
960#define ISO_T 0x4000 /* enable Isochronous transfers */
961#define nISO_T 0x0
962#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
963#define nAUTOSET_T 0x0
964#define ERROR_TH 0x4 /* error condition host mode */
965#define nERROR_TH 0x0
966#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
967#define nSTALL_RECEIVED_TH 0x0
968#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
969#define nNAK_TIMEOUT_TH 0x0
970
971/* Bit masks for USB_TXCOUNT */
972
973#define TX_COUNT 0x1fff /* Number of bytes to be written to the selected endpoint Tx FIFO */
974
975/* Bit masks for USB_RXCSR */
976
977#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
978#define nRXPKTRDY_R 0x0
979#define FIFO_FULL_R 0x2 /* FIFO not empty */
980#define nFIFO_FULL_R 0x0
981#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
982#define nOVERRUN_R 0x0
983#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
984#define nDATAERROR_R 0x0
985#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
986#define nFLUSHFIFO_R 0x0
987#define STALL_SEND_R 0x20 /* issue a Stall handshake */
988#define nSTALL_SEND_R 0x0
989#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
990#define nSTALL_SENT_R 0x0
991#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
992#define nCLEAR_DATATOGGLE_R 0x0
993#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
994#define nINCOMPRX_R 0x0
995#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
996#define nDMAREQMODE_R 0x0
997#define DISNYET_R 0x1000 /* disable Nyet handshakes */
998#define nDISNYET_R 0x0
999#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
1000#define nDMAREQ_ENA_R 0x0
1001#define ISO_R 0x4000 /* enable Isochronous transfers */
1002#define nISO_R 0x0
1003#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
1004#define nAUTOCLEAR_R 0x0
1005#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
1006#define nERROR_RH 0x0
1007#define REQPKT_RH 0x20 /* request an IN transaction host mode */
1008#define nREQPKT_RH 0x0
1009#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
1010#define nSTALL_RECEIVED_RH 0x0
1011#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
1012#define nINCOMPRX_RH 0x0
1013#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
1014#define nDMAREQMODE_RH 0x0
1015#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
1016#define nAUTOREQ_RH 0x0
1017
1018/* Bit masks for USB_RXCOUNT */
1019
1020#define RX_COUNT 0x1fff /* Number of received bytes in the packet in the Rx FIFO */
1021
1022/* Bit masks for USB_TXTYPE */
1023
1024#define TARGET_EP_NO_T 0xf /* EP number */
1025#define PROTOCOL_T 0xc /* transfer type */
1026
1027/* Bit masks for USB_TXINTERVAL */
1028
1029#define TX_POLL_INTERVAL 0xff /* polling interval for selected Tx EP */
1030
1031/* Bit masks for USB_RXTYPE */
1032
1033#define TARGET_EP_NO_R 0xf /* EP number */
1034#define PROTOCOL_R 0xc /* transfer type */
1035
1036/* Bit masks for USB_RXINTERVAL */
1037
1038#define RX_POLL_INTERVAL 0xff /* polling interval for selected Rx EP */
1039
1040/* Bit masks for USB_DMA_INTERRUPT */
1041
1042#define DMA0_INT 0x1 /* DMA0 pending interrupt */
1043#define nDMA0_INT 0x0
1044#define DMA1_INT 0x2 /* DMA1 pending interrupt */
1045#define nDMA1_INT 0x0
1046#define DMA2_INT 0x4 /* DMA2 pending interrupt */
1047#define nDMA2_INT 0x0
1048#define DMA3_INT 0x8 /* DMA3 pending interrupt */
1049#define nDMA3_INT 0x0
1050#define DMA4_INT 0x10 /* DMA4 pending interrupt */
1051#define nDMA4_INT 0x0
1052#define DMA5_INT 0x20 /* DMA5 pending interrupt */
1053#define nDMA5_INT 0x0
1054#define DMA6_INT 0x40 /* DMA6 pending interrupt */
1055#define nDMA6_INT 0x0
1056#define DMA7_INT 0x80 /* DMA7 pending interrupt */
1057#define nDMA7_INT 0x0
1058
1059/* Bit masks for USB_DMAxCONTROL */
1060
1061#define DMA_ENA 0x1 /* DMA enable */
1062#define nDMA_ENA 0x0
1063#define DIRECTION 0x2 /* direction of DMA transfer */
1064#define nDIRECTION 0x0
1065#define MODE 0x4 /* DMA Bus error */
1066#define nMODE 0x0
1067#define INT_ENA 0x8 /* Interrupt enable */
1068#define nINT_ENA 0x0
1069#define EPNUM 0xf0 /* EP number */
1070#define BUSERROR 0x100 /* DMA Bus error */
1071#define nBUSERROR 0x0
1072
1073/* Bit masks for USB_DMAxADDRHIGH */
1074
1075#define DMA_ADDR_HIGH 0xffff /* Upper 16-bits of memory source/destination address for the DMA master channel */
1076
1077/* Bit masks for USB_DMAxADDRLOW */
1078
1079#define DMA_ADDR_LOW 0xffff /* Lower 16-bits of memory source/destination address for the DMA master channel */
1080
1081/* Bit masks for USB_DMAxCOUNTHIGH */
1082
1083#define DMA_COUNT_HIGH 0xffff /* Upper 16-bits of byte count of DMA transfer for DMA master channel */
1084
1085/* Bit masks for USB_DMAxCOUNTLOW */
1086
1087#define DMA_COUNT_LOW 0xffff /* Lower 16-bits of byte count of DMA transfer for DMA master channel */
1088
1089#endif /* _DEF_BF527_H */
diff --git a/include/asm-blackfin/mach-bf527/defBF52x_base.h b/include/asm-blackfin/mach-bf527/defBF52x_base.h
new file mode 100644
index 000000000000..0b2fb5036ed0
--- /dev/null
+++ b/include/asm-blackfin/mach-bf527/defBF52x_base.h
@@ -0,0 +1,2009 @@
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_IMASK 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_ISR 0xFFC00120 /* Interrupt Status Register */
61#define SIC_IWR 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 SPI_CTL 0xFFC00500 /* SPI Control Register */
106#define SPI_FLG 0xFFC00504 /* SPI Flag register */
107#define SPI_STAT 0xFFC00508 /* SPI Status register */
108#define SPI_TDBR 0xFFC0050C /* SPI Transmit Data Buffer Register */
109#define SPI_RDBR 0xFFC00510 /* SPI Receive Data Buffer Register */
110#define SPI_BAUD 0xFFC00514 /* SPI Baud rate Register */
111#define SPI_SHADOW 0xFFC00518 /* SPI_RDBR Shadow Register */
112
113
114/* TIMER0-7 Registers (0xFFC00600 - 0xFFC006FF) */
115#define TIMER0_CONFIG 0xFFC00600 /* Timer 0 Configuration Register */
116#define TIMER0_COUNTER 0xFFC00604 /* Timer 0 Counter Register */
117#define TIMER0_PERIOD 0xFFC00608 /* Timer 0 Period Register */
118#define TIMER0_WIDTH 0xFFC0060C /* Timer 0 Width Register */
119
120#define TIMER1_CONFIG 0xFFC00610 /* Timer 1 Configuration Register */
121#define TIMER1_COUNTER 0xFFC00614 /* Timer 1 Counter Register */
122#define TIMER1_PERIOD 0xFFC00618 /* Timer 1 Period Register */
123#define TIMER1_WIDTH 0xFFC0061C /* Timer 1 Width Register */
124
125#define TIMER2_CONFIG 0xFFC00620 /* Timer 2 Configuration Register */
126#define TIMER2_COUNTER 0xFFC00624 /* Timer 2 Counter Register */
127#define TIMER2_PERIOD 0xFFC00628 /* Timer 2 Period Register */
128#define TIMER2_WIDTH 0xFFC0062C /* Timer 2 Width Register */
129
130#define TIMER3_CONFIG 0xFFC00630 /* Timer 3 Configuration Register */
131#define TIMER3_COUNTER 0xFFC00634 /* Timer 3 Counter Register */
132#define TIMER3_PERIOD 0xFFC00638 /* Timer 3 Period Register */
133#define TIMER3_WIDTH 0xFFC0063C /* Timer 3 Width Register */
134
135#define TIMER4_CONFIG 0xFFC00640 /* Timer 4 Configuration Register */
136#define TIMER4_COUNTER 0xFFC00644 /* Timer 4 Counter Register */
137#define TIMER4_PERIOD 0xFFC00648 /* Timer 4 Period Register */
138#define TIMER4_WIDTH 0xFFC0064C /* Timer 4 Width Register */
139
140#define TIMER5_CONFIG 0xFFC00650 /* Timer 5 Configuration Register */
141#define TIMER5_COUNTER 0xFFC00654 /* Timer 5 Counter Register */
142#define TIMER5_PERIOD 0xFFC00658 /* Timer 5 Period Register */
143#define TIMER5_WIDTH 0xFFC0065C /* Timer 5 Width Register */
144
145#define TIMER6_CONFIG 0xFFC00660 /* Timer 6 Configuration Register */
146#define TIMER6_COUNTER 0xFFC00664 /* Timer 6 Counter Register */
147#define TIMER6_PERIOD 0xFFC00668 /* Timer 6 Period Register */
148#define TIMER6_WIDTH 0xFFC0066C /* Timer 6 Width Register */
149
150#define TIMER7_CONFIG 0xFFC00670 /* Timer 7 Configuration Register */
151#define TIMER7_COUNTER 0xFFC00674 /* Timer 7 Counter Register */
152#define TIMER7_PERIOD 0xFFC00678 /* Timer 7 Period Register */
153#define TIMER7_WIDTH 0xFFC0067C /* Timer 7 Width Register */
154
155#define TIMER_ENABLE 0xFFC00680 /* Timer Enable Register */
156#define TIMER_DISABLE 0xFFC00684 /* Timer Disable Register */
157#define TIMER_STATUS 0xFFC00688 /* Timer Status Register */
158
159
160/* General Purpose I/O Port F (0xFFC00700 - 0xFFC007FF) */
161#define PORTFIO 0xFFC00700 /* Port F I/O Pin State Specify Register */
162#define PORTFIO_CLEAR 0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register */
163#define PORTFIO_SET 0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register */
164#define PORTFIO_TOGGLE 0xFFC0070C /* Port F I/O Pin State Toggle Register */
165#define PORTFIO_MASKA 0xFFC00710 /* Port F I/O Mask State Specify Interrupt A Register */
166#define PORTFIO_MASKA_CLEAR 0xFFC00714 /* Port F I/O Mask Disable Interrupt A Register */
167#define PORTFIO_MASKA_SET 0xFFC00718 /* Port F I/O Mask Enable Interrupt A Register */
168#define PORTFIO_MASKA_TOGGLE 0xFFC0071C /* Port F I/O Mask Toggle Enable Interrupt A Register */
169#define PORTFIO_MASKB 0xFFC00720 /* Port F I/O Mask State Specify Interrupt B Register */
170#define PORTFIO_MASKB_CLEAR 0xFFC00724 /* Port F I/O Mask Disable Interrupt B Register */
171#define PORTFIO_MASKB_SET 0xFFC00728 /* Port F I/O Mask Enable Interrupt B Register */
172#define PORTFIO_MASKB_TOGGLE 0xFFC0072C /* Port F I/O Mask Toggle Enable Interrupt B Register */
173#define PORTFIO_DIR 0xFFC00730 /* Port F I/O Direction Register */
174#define PORTFIO_POLAR 0xFFC00734 /* Port F I/O Source Polarity Register */
175#define PORTFIO_EDGE 0xFFC00738 /* Port F I/O Source Sensitivity Register */
176#define PORTFIO_BOTH 0xFFC0073C /* Port F I/O Set on BOTH Edges Register */
177#define PORTFIO_INEN 0xFFC00740 /* Port F I/O Input Enable Register */
178
179
180/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
181#define SPORT0_TCR1 0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
182#define SPORT0_TCR2 0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
183#define SPORT0_TCLKDIV 0xFFC00808 /* SPORT0 Transmit Clock Divider */
184#define SPORT0_TFSDIV 0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
185#define SPORT0_TX 0xFFC00810 /* SPORT0 TX Data Register */
186#define SPORT0_RX 0xFFC00818 /* SPORT0 RX Data Register */
187#define SPORT0_RCR1 0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
188#define SPORT0_RCR2 0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
189#define SPORT0_RCLKDIV 0xFFC00828 /* SPORT0 Receive Clock Divider */
190#define SPORT0_RFSDIV 0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
191#define SPORT0_STAT 0xFFC00830 /* SPORT0 Status Register */
192#define SPORT0_CHNL 0xFFC00834 /* SPORT0 Current Channel Register */
193#define SPORT0_MCMC1 0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
194#define SPORT0_MCMC2 0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
195#define SPORT0_MTCS0 0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
196#define SPORT0_MTCS1 0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
197#define SPORT0_MTCS2 0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
198#define SPORT0_MTCS3 0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
199#define SPORT0_MRCS0 0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
200#define SPORT0_MRCS1 0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
201#define SPORT0_MRCS2 0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
202#define SPORT0_MRCS3 0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
203
204
205/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
206#define SPORT1_TCR1 0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
207#define SPORT1_TCR2 0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
208#define SPORT1_TCLKDIV 0xFFC00908 /* SPORT1 Transmit Clock Divider */
209#define SPORT1_TFSDIV 0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
210#define SPORT1_TX 0xFFC00910 /* SPORT1 TX Data Register */
211#define SPORT1_RX 0xFFC00918 /* SPORT1 RX Data Register */
212#define SPORT1_RCR1 0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
213#define SPORT1_RCR2 0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
214#define SPORT1_RCLKDIV 0xFFC00928 /* SPORT1 Receive Clock Divider */
215#define SPORT1_RFSDIV 0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
216#define SPORT1_STAT 0xFFC00930 /* SPORT1 Status Register */
217#define SPORT1_CHNL 0xFFC00934 /* SPORT1 Current Channel Register */
218#define SPORT1_MCMC1 0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
219#define SPORT1_MCMC2 0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
220#define SPORT1_MTCS0 0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
221#define SPORT1_MTCS1 0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
222#define SPORT1_MTCS2 0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
223#define SPORT1_MTCS3 0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
224#define SPORT1_MRCS0 0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
225#define SPORT1_MRCS1 0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
226#define SPORT1_MRCS2 0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
227#define SPORT1_MRCS3 0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
228
229
230/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
231#define EBIU_AMGCTL 0xFFC00A00 /* Asynchronous Memory Global Control Register */
232#define EBIU_AMBCTL0 0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
233#define EBIU_AMBCTL1 0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
234#define EBIU_SDGCTL 0xFFC00A10 /* SDRAM Global Control Register */
235#define EBIU_SDBCTL 0xFFC00A14 /* SDRAM Bank Control Register */
236#define EBIU_SDRRC 0xFFC00A18 /* SDRAM Refresh Rate Control Register */
237#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
238
239
240/* DMA Traffic Control Registers */
241#define DMA_TC_PER 0xFFC00B0C /* Traffic Control Periods Register */
242#define DMA_TC_CNT 0xFFC00B10 /* Traffic Control Current Counts Register */
243
244/* Alternate deprecated register names (below) provided for backwards code compatibility */
245#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */
246#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */
247
248/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */
249#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
250#define DMA0_START_ADDR 0xFFC00C04 /* DMA Channel 0 Start Address Register */
251#define DMA0_CONFIG 0xFFC00C08 /* DMA Channel 0 Configuration Register */
252#define DMA0_X_COUNT 0xFFC00C10 /* DMA Channel 0 X Count Register */
253#define DMA0_X_MODIFY 0xFFC00C14 /* DMA Channel 0 X Modify Register */
254#define DMA0_Y_COUNT 0xFFC00C18 /* DMA Channel 0 Y Count Register */
255#define DMA0_Y_MODIFY 0xFFC00C1C /* DMA Channel 0 Y Modify Register */
256#define DMA0_CURR_DESC_PTR 0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
257#define DMA0_CURR_ADDR 0xFFC00C24 /* DMA Channel 0 Current Address Register */
258#define DMA0_IRQ_STATUS 0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
259#define DMA0_PERIPHERAL_MAP 0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
260#define DMA0_CURR_X_COUNT 0xFFC00C30 /* DMA Channel 0 Current X Count Register */
261#define DMA0_CURR_Y_COUNT 0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
262
263#define DMA1_NEXT_DESC_PTR 0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
264#define DMA1_START_ADDR 0xFFC00C44 /* DMA Channel 1 Start Address Register */
265#define DMA1_CONFIG 0xFFC00C48 /* DMA Channel 1 Configuration Register */
266#define DMA1_X_COUNT 0xFFC00C50 /* DMA Channel 1 X Count Register */
267#define DMA1_X_MODIFY 0xFFC00C54 /* DMA Channel 1 X Modify Register */
268#define DMA1_Y_COUNT 0xFFC00C58 /* DMA Channel 1 Y Count Register */
269#define DMA1_Y_MODIFY 0xFFC00C5C /* DMA Channel 1 Y Modify Register */
270#define DMA1_CURR_DESC_PTR 0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
271#define DMA1_CURR_ADDR 0xFFC00C64 /* DMA Channel 1 Current Address Register */
272#define DMA1_IRQ_STATUS 0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
273#define DMA1_PERIPHERAL_MAP 0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
274#define DMA1_CURR_X_COUNT 0xFFC00C70 /* DMA Channel 1 Current X Count Register */
275#define DMA1_CURR_Y_COUNT 0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
276
277#define DMA2_NEXT_DESC_PTR 0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
278#define DMA2_START_ADDR 0xFFC00C84 /* DMA Channel 2 Start Address Register */
279#define DMA2_CONFIG 0xFFC00C88 /* DMA Channel 2 Configuration Register */
280#define DMA2_X_COUNT 0xFFC00C90 /* DMA Channel 2 X Count Register */
281#define DMA2_X_MODIFY 0xFFC00C94 /* DMA Channel 2 X Modify Register */
282#define DMA2_Y_COUNT 0xFFC00C98 /* DMA Channel 2 Y Count Register */
283#define DMA2_Y_MODIFY 0xFFC00C9C /* DMA Channel 2 Y Modify Register */
284#define DMA2_CURR_DESC_PTR 0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
285#define DMA2_CURR_ADDR 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
286#define DMA2_IRQ_STATUS 0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
287#define DMA2_PERIPHERAL_MAP 0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
288#define DMA2_CURR_X_COUNT 0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
289#define DMA2_CURR_Y_COUNT 0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
290
291#define DMA3_NEXT_DESC_PTR 0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
292#define DMA3_START_ADDR 0xFFC00CC4 /* DMA Channel 3 Start Address Register */
293#define DMA3_CONFIG 0xFFC00CC8 /* DMA Channel 3 Configuration Register */
294#define DMA3_X_COUNT 0xFFC00CD0 /* DMA Channel 3 X Count Register */
295#define DMA3_X_MODIFY 0xFFC00CD4 /* DMA Channel 3 X Modify Register */
296#define DMA3_Y_COUNT 0xFFC00CD8 /* DMA Channel 3 Y Count Register */
297#define DMA3_Y_MODIFY 0xFFC00CDC /* DMA Channel 3 Y Modify Register */
298#define DMA3_CURR_DESC_PTR 0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
299#define DMA3_CURR_ADDR 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
300#define DMA3_IRQ_STATUS 0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
301#define DMA3_PERIPHERAL_MAP 0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
302#define DMA3_CURR_X_COUNT 0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
303#define DMA3_CURR_Y_COUNT 0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
304
305#define DMA4_NEXT_DESC_PTR 0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
306#define DMA4_START_ADDR 0xFFC00D04 /* DMA Channel 4 Start Address Register */
307#define DMA4_CONFIG 0xFFC00D08 /* DMA Channel 4 Configuration Register */
308#define DMA4_X_COUNT 0xFFC00D10 /* DMA Channel 4 X Count Register */
309#define DMA4_X_MODIFY 0xFFC00D14 /* DMA Channel 4 X Modify Register */
310#define DMA4_Y_COUNT 0xFFC00D18 /* DMA Channel 4 Y Count Register */
311#define DMA4_Y_MODIFY 0xFFC00D1C /* DMA Channel 4 Y Modify Register */
312#define DMA4_CURR_DESC_PTR 0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
313#define DMA4_CURR_ADDR 0xFFC00D24 /* DMA Channel 4 Current Address Register */
314#define DMA4_IRQ_STATUS 0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
315#define DMA4_PERIPHERAL_MAP 0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
316#define DMA4_CURR_X_COUNT 0xFFC00D30 /* DMA Channel 4 Current X Count Register */
317#define DMA4_CURR_Y_COUNT 0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
318
319#define DMA5_NEXT_DESC_PTR 0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
320#define DMA5_START_ADDR 0xFFC00D44 /* DMA Channel 5 Start Address Register */
321#define DMA5_CONFIG 0xFFC00D48 /* DMA Channel 5 Configuration Register */
322#define DMA5_X_COUNT 0xFFC00D50 /* DMA Channel 5 X Count Register */
323#define DMA5_X_MODIFY 0xFFC00D54 /* DMA Channel 5 X Modify Register */
324#define DMA5_Y_COUNT 0xFFC00D58 /* DMA Channel 5 Y Count Register */
325#define DMA5_Y_MODIFY 0xFFC00D5C /* DMA Channel 5 Y Modify Register */
326#define DMA5_CURR_DESC_PTR 0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
327#define DMA5_CURR_ADDR 0xFFC00D64 /* DMA Channel 5 Current Address Register */
328#define DMA5_IRQ_STATUS 0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
329#define DMA5_PERIPHERAL_MAP 0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
330#define DMA5_CURR_X_COUNT 0xFFC00D70 /* DMA Channel 5 Current X Count Register */
331#define DMA5_CURR_Y_COUNT 0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
332
333#define DMA6_NEXT_DESC_PTR 0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
334#define DMA6_START_ADDR 0xFFC00D84 /* DMA Channel 6 Start Address Register */
335#define DMA6_CONFIG 0xFFC00D88 /* DMA Channel 6 Configuration Register */
336#define DMA6_X_COUNT 0xFFC00D90 /* DMA Channel 6 X Count Register */
337#define DMA6_X_MODIFY 0xFFC00D94 /* DMA Channel 6 X Modify Register */
338#define DMA6_Y_COUNT 0xFFC00D98 /* DMA Channel 6 Y Count Register */
339#define DMA6_Y_MODIFY 0xFFC00D9C /* DMA Channel 6 Y Modify Register */
340#define DMA6_CURR_DESC_PTR 0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
341#define DMA6_CURR_ADDR 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
342#define DMA6_IRQ_STATUS 0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
343#define DMA6_PERIPHERAL_MAP 0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
344#define DMA6_CURR_X_COUNT 0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
345#define DMA6_CURR_Y_COUNT 0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
346
347#define DMA7_NEXT_DESC_PTR 0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
348#define DMA7_START_ADDR 0xFFC00DC4 /* DMA Channel 7 Start Address Register */
349#define DMA7_CONFIG 0xFFC00DC8 /* DMA Channel 7 Configuration Register */
350#define DMA7_X_COUNT 0xFFC00DD0 /* DMA Channel 7 X Count Register */
351#define DMA7_X_MODIFY 0xFFC00DD4 /* DMA Channel 7 X Modify Register */
352#define DMA7_Y_COUNT 0xFFC00DD8 /* DMA Channel 7 Y Count Register */
353#define DMA7_Y_MODIFY 0xFFC00DDC /* DMA Channel 7 Y Modify Register */
354#define DMA7_CURR_DESC_PTR 0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
355#define DMA7_CURR_ADDR 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
356#define DMA7_IRQ_STATUS 0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
357#define DMA7_PERIPHERAL_MAP 0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
358#define DMA7_CURR_X_COUNT 0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
359#define DMA7_CURR_Y_COUNT 0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
360
361#define DMA8_NEXT_DESC_PTR 0xFFC00E00 /* DMA Channel 8 Next Descriptor Pointer Register */
362#define DMA8_START_ADDR 0xFFC00E04 /* DMA Channel 8 Start Address Register */
363#define DMA8_CONFIG 0xFFC00E08 /* DMA Channel 8 Configuration Register */
364#define DMA8_X_COUNT 0xFFC00E10 /* DMA Channel 8 X Count Register */
365#define DMA8_X_MODIFY 0xFFC00E14 /* DMA Channel 8 X Modify Register */
366#define DMA8_Y_COUNT 0xFFC00E18 /* DMA Channel 8 Y Count Register */
367#define DMA8_Y_MODIFY 0xFFC00E1C /* DMA Channel 8 Y Modify Register */
368#define DMA8_CURR_DESC_PTR 0xFFC00E20 /* DMA Channel 8 Current Descriptor Pointer Register */
369#define DMA8_CURR_ADDR 0xFFC00E24 /* DMA Channel 8 Current Address Register */
370#define DMA8_IRQ_STATUS 0xFFC00E28 /* DMA Channel 8 Interrupt/Status Register */
371#define DMA8_PERIPHERAL_MAP 0xFFC00E2C /* DMA Channel 8 Peripheral Map Register */
372#define DMA8_CURR_X_COUNT 0xFFC00E30 /* DMA Channel 8 Current X Count Register */
373#define DMA8_CURR_Y_COUNT 0xFFC00E38 /* DMA Channel 8 Current Y Count Register */
374
375#define DMA9_NEXT_DESC_PTR 0xFFC00E40 /* DMA Channel 9 Next Descriptor Pointer Register */
376#define DMA9_START_ADDR 0xFFC00E44 /* DMA Channel 9 Start Address Register */
377#define DMA9_CONFIG 0xFFC00E48 /* DMA Channel 9 Configuration Register */
378#define DMA9_X_COUNT 0xFFC00E50 /* DMA Channel 9 X Count Register */
379#define DMA9_X_MODIFY 0xFFC00E54 /* DMA Channel 9 X Modify Register */
380#define DMA9_Y_COUNT 0xFFC00E58 /* DMA Channel 9 Y Count Register */
381#define DMA9_Y_MODIFY 0xFFC00E5C /* DMA Channel 9 Y Modify Register */
382#define DMA9_CURR_DESC_PTR 0xFFC00E60 /* DMA Channel 9 Current Descriptor Pointer Register */
383#define DMA9_CURR_ADDR 0xFFC00E64 /* DMA Channel 9 Current Address Register */
384#define DMA9_IRQ_STATUS 0xFFC00E68 /* DMA Channel 9 Interrupt/Status Register */
385#define DMA9_PERIPHERAL_MAP 0xFFC00E6C /* DMA Channel 9 Peripheral Map Register */
386#define DMA9_CURR_X_COUNT 0xFFC00E70 /* DMA Channel 9 Current X Count Register */
387#define DMA9_CURR_Y_COUNT 0xFFC00E78 /* DMA Channel 9 Current Y Count Register */
388
389#define DMA10_NEXT_DESC_PTR 0xFFC00E80 /* DMA Channel 10 Next Descriptor Pointer Register */
390#define DMA10_START_ADDR 0xFFC00E84 /* DMA Channel 10 Start Address Register */
391#define DMA10_CONFIG 0xFFC00E88 /* DMA Channel 10 Configuration Register */
392#define DMA10_X_COUNT 0xFFC00E90 /* DMA Channel 10 X Count Register */
393#define DMA10_X_MODIFY 0xFFC00E94 /* DMA Channel 10 X Modify Register */
394#define DMA10_Y_COUNT 0xFFC00E98 /* DMA Channel 10 Y Count Register */
395#define DMA10_Y_MODIFY 0xFFC00E9C /* DMA Channel 10 Y Modify Register */
396#define DMA10_CURR_DESC_PTR 0xFFC00EA0 /* DMA Channel 10 Current Descriptor Pointer Register */
397#define DMA10_CURR_ADDR 0xFFC00EA4 /* DMA Channel 10 Current Address Register */
398#define DMA10_IRQ_STATUS 0xFFC00EA8 /* DMA Channel 10 Interrupt/Status Register */
399#define DMA10_PERIPHERAL_MAP 0xFFC00EAC /* DMA Channel 10 Peripheral Map Register */
400#define DMA10_CURR_X_COUNT 0xFFC00EB0 /* DMA Channel 10 Current X Count Register */
401#define DMA10_CURR_Y_COUNT 0xFFC00EB8 /* DMA Channel 10 Current Y Count Register */
402
403#define DMA11_NEXT_DESC_PTR 0xFFC00EC0 /* DMA Channel 11 Next Descriptor Pointer Register */
404#define DMA11_START_ADDR 0xFFC00EC4 /* DMA Channel 11 Start Address Register */
405#define DMA11_CONFIG 0xFFC00EC8 /* DMA Channel 11 Configuration Register */
406#define DMA11_X_COUNT 0xFFC00ED0 /* DMA Channel 11 X Count Register */
407#define DMA11_X_MODIFY 0xFFC00ED4 /* DMA Channel 11 X Modify Register */
408#define DMA11_Y_COUNT 0xFFC00ED8 /* DMA Channel 11 Y Count Register */
409#define DMA11_Y_MODIFY 0xFFC00EDC /* DMA Channel 11 Y Modify Register */
410#define DMA11_CURR_DESC_PTR 0xFFC00EE0 /* DMA Channel 11 Current Descriptor Pointer Register */
411#define DMA11_CURR_ADDR 0xFFC00EE4 /* DMA Channel 11 Current Address Register */
412#define DMA11_IRQ_STATUS 0xFFC00EE8 /* DMA Channel 11 Interrupt/Status Register */
413#define DMA11_PERIPHERAL_MAP 0xFFC00EEC /* DMA Channel 11 Peripheral Map Register */
414#define DMA11_CURR_X_COUNT 0xFFC00EF0 /* DMA Channel 11 Current X Count Register */
415#define DMA11_CURR_Y_COUNT 0xFFC00EF8 /* DMA Channel 11 Current Y Count Register */
416
417#define MDMA_D0_NEXT_DESC_PTR 0xFFC00F00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
418#define MDMA_D0_START_ADDR 0xFFC00F04 /* MemDMA Stream 0 Destination Start Address Register */
419#define MDMA_D0_CONFIG 0xFFC00F08 /* MemDMA Stream 0 Destination Configuration Register */
420#define MDMA_D0_X_COUNT 0xFFC00F10 /* MemDMA Stream 0 Destination X Count Register */
421#define MDMA_D0_X_MODIFY 0xFFC00F14 /* MemDMA Stream 0 Destination X Modify Register */
422#define MDMA_D0_Y_COUNT 0xFFC00F18 /* MemDMA Stream 0 Destination Y Count Register */
423#define MDMA_D0_Y_MODIFY 0xFFC00F1C /* MemDMA Stream 0 Destination Y Modify Register */
424#define MDMA_D0_CURR_DESC_PTR 0xFFC00F20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
425#define MDMA_D0_CURR_ADDR 0xFFC00F24 /* MemDMA Stream 0 Destination Current Address Register */
426#define MDMA_D0_IRQ_STATUS 0xFFC00F28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
427#define MDMA_D0_PERIPHERAL_MAP 0xFFC00F2C /* MemDMA Stream 0 Destination Peripheral Map Register */
428#define MDMA_D0_CURR_X_COUNT 0xFFC00F30 /* MemDMA Stream 0 Destination Current X Count Register */
429#define MDMA_D0_CURR_Y_COUNT 0xFFC00F38 /* MemDMA Stream 0 Destination Current Y Count Register */
430
431#define MDMA_S0_NEXT_DESC_PTR 0xFFC00F40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
432#define MDMA_S0_START_ADDR 0xFFC00F44 /* MemDMA Stream 0 Source Start Address Register */
433#define MDMA_S0_CONFIG 0xFFC00F48 /* MemDMA Stream 0 Source Configuration Register */
434#define MDMA_S0_X_COUNT 0xFFC00F50 /* MemDMA Stream 0 Source X Count Register */
435#define MDMA_S0_X_MODIFY 0xFFC00F54 /* MemDMA Stream 0 Source X Modify Register */
436#define MDMA_S0_Y_COUNT 0xFFC00F58 /* MemDMA Stream 0 Source Y Count Register */
437#define MDMA_S0_Y_MODIFY 0xFFC00F5C /* MemDMA Stream 0 Source Y Modify Register */
438#define MDMA_S0_CURR_DESC_PTR 0xFFC00F60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
439#define MDMA_S0_CURR_ADDR 0xFFC00F64 /* MemDMA Stream 0 Source Current Address Register */
440#define MDMA_S0_IRQ_STATUS 0xFFC00F68 /* MemDMA Stream 0 Source Interrupt/Status Register */
441#define MDMA_S0_PERIPHERAL_MAP 0xFFC00F6C /* MemDMA Stream 0 Source Peripheral Map Register */
442#define MDMA_S0_CURR_X_COUNT 0xFFC00F70 /* MemDMA Stream 0 Source Current X Count Register */
443#define MDMA_S0_CURR_Y_COUNT 0xFFC00F78 /* MemDMA Stream 0 Source Current Y Count Register */
444
445#define MDMA_D1_NEXT_DESC_PTR 0xFFC00F80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
446#define MDMA_D1_START_ADDR 0xFFC00F84 /* MemDMA Stream 1 Destination Start Address Register */
447#define MDMA_D1_CONFIG 0xFFC00F88 /* MemDMA Stream 1 Destination Configuration Register */
448#define MDMA_D1_X_COUNT 0xFFC00F90 /* MemDMA Stream 1 Destination X Count Register */
449#define MDMA_D1_X_MODIFY 0xFFC00F94 /* MemDMA Stream 1 Destination X Modify Register */
450#define MDMA_D1_Y_COUNT 0xFFC00F98 /* MemDMA Stream 1 Destination Y Count Register */
451#define MDMA_D1_Y_MODIFY 0xFFC00F9C /* MemDMA Stream 1 Destination Y Modify Register */
452#define MDMA_D1_CURR_DESC_PTR 0xFFC00FA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
453#define MDMA_D1_CURR_ADDR 0xFFC00FA4 /* MemDMA Stream 1 Destination Current Address Register */
454#define MDMA_D1_IRQ_STATUS 0xFFC00FA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
455#define MDMA_D1_PERIPHERAL_MAP 0xFFC00FAC /* MemDMA Stream 1 Destination Peripheral Map Register */
456#define MDMA_D1_CURR_X_COUNT 0xFFC00FB0 /* MemDMA Stream 1 Destination Current X Count Register */
457#define MDMA_D1_CURR_Y_COUNT 0xFFC00FB8 /* MemDMA Stream 1 Destination Current Y Count Register */
458
459#define MDMA_S1_NEXT_DESC_PTR 0xFFC00FC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
460#define MDMA_S1_START_ADDR 0xFFC00FC4 /* MemDMA Stream 1 Source Start Address Register */
461#define MDMA_S1_CONFIG 0xFFC00FC8 /* MemDMA Stream 1 Source Configuration Register */
462#define MDMA_S1_X_COUNT 0xFFC00FD0 /* MemDMA Stream 1 Source X Count Register */
463#define MDMA_S1_X_MODIFY 0xFFC00FD4 /* MemDMA Stream 1 Source X Modify Register */
464#define MDMA_S1_Y_COUNT 0xFFC00FD8 /* MemDMA Stream 1 Source Y Count Register */
465#define MDMA_S1_Y_MODIFY 0xFFC00FDC /* MemDMA Stream 1 Source Y Modify Register */
466#define MDMA_S1_CURR_DESC_PTR 0xFFC00FE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
467#define MDMA_S1_CURR_ADDR 0xFFC00FE4 /* MemDMA Stream 1 Source Current Address Register */
468#define MDMA_S1_IRQ_STATUS 0xFFC00FE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
469#define MDMA_S1_PERIPHERAL_MAP 0xFFC00FEC /* MemDMA Stream 1 Source Peripheral Map Register */
470#define MDMA_S1_CURR_X_COUNT 0xFFC00FF0 /* MemDMA Stream 1 Source Current X Count Register */
471#define MDMA_S1_CURR_Y_COUNT 0xFFC00FF8 /* MemDMA Stream 1 Source Current Y Count Register */
472
473
474/* Parallel Peripheral Interface (0xFFC01000 - 0xFFC010FF) */
475#define PPI_CONTROL 0xFFC01000 /* PPI Control Register */
476#define PPI_STATUS 0xFFC01004 /* PPI Status Register */
477#define PPI_COUNT 0xFFC01008 /* PPI Transfer Count Register */
478#define PPI_DELAY 0xFFC0100C /* PPI Delay Count Register */
479#define PPI_FRAME 0xFFC01010 /* PPI Frame Length Register */
480
481
482/* Two-Wire Interface (0xFFC01400 - 0xFFC014FF) */
483#define TWI_CLKDIV 0xFFC01400 /* Serial Clock Divider Register */
484#define TWI_CONTROL 0xFFC01404 /* TWI Control Register */
485#define TWI_SLAVE_CTL 0xFFC01408 /* Slave Mode Control Register */
486#define TWI_SLAVE_STAT 0xFFC0140C /* Slave Mode Status Register */
487#define TWI_SLAVE_ADDR 0xFFC01410 /* Slave Mode Address Register */
488#define TWI_MASTER_CTL 0xFFC01414 /* Master Mode Control Register */
489#define TWI_MASTER_STAT 0xFFC01418 /* Master Mode Status Register */
490#define TWI_MASTER_ADDR 0xFFC0141C /* Master Mode Address Register */
491#define TWI_INT_STAT 0xFFC01420 /* TWI Interrupt Status Register */
492#define TWI_INT_MASK 0xFFC01424 /* TWI Master Interrupt Mask Register */
493#define TWI_FIFO_CTL 0xFFC01428 /* FIFO Control Register */
494#define TWI_FIFO_STAT 0xFFC0142C /* FIFO Status Register */
495#define TWI_XMT_DATA8 0xFFC01480 /* FIFO Transmit Data Single Byte Register */
496#define TWI_XMT_DATA16 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
497#define TWI_RCV_DATA8 0xFFC01488 /* FIFO Receive Data Single Byte Register */
498#define TWI_RCV_DATA16 0xFFC0148C /* FIFO Receive Data Double Byte Register */
499
500
501/* General Purpose I/O Port G (0xFFC01500 - 0xFFC015FF) */
502#define PORTGIO 0xFFC01500 /* Port G I/O Pin State Specify Register */
503#define PORTGIO_CLEAR 0xFFC01504 /* Port G I/O Peripheral Interrupt Clear Register */
504#define PORTGIO_SET 0xFFC01508 /* Port G I/O Peripheral Interrupt Set Register */
505#define PORTGIO_TOGGLE 0xFFC0150C /* Port G I/O Pin State Toggle Register */
506#define PORTGIO_MASKA 0xFFC01510 /* Port G I/O Mask State Specify Interrupt A Register */
507#define PORTGIO_MASKA_CLEAR 0xFFC01514 /* Port G I/O Mask Disable Interrupt A Register */
508#define PORTGIO_MASKA_SET 0xFFC01518 /* Port G I/O Mask Enable Interrupt A Register */
509#define PORTGIO_MASKA_TOGGLE 0xFFC0151C /* Port G I/O Mask Toggle Enable Interrupt A Register */
510#define PORTGIO_MASKB 0xFFC01520 /* Port G I/O Mask State Specify Interrupt B Register */
511#define PORTGIO_MASKB_CLEAR 0xFFC01524 /* Port G I/O Mask Disable Interrupt B Register */
512#define PORTGIO_MASKB_SET 0xFFC01528 /* Port G I/O Mask Enable Interrupt B Register */
513#define PORTGIO_MASKB_TOGGLE 0xFFC0152C /* Port G I/O Mask Toggle Enable Interrupt B Register */
514#define PORTGIO_DIR 0xFFC01530 /* Port G I/O Direction Register */
515#define PORTGIO_POLAR 0xFFC01534 /* Port G I/O Source Polarity Register */
516#define PORTGIO_EDGE 0xFFC01538 /* Port G I/O Source Sensitivity Register */
517#define PORTGIO_BOTH 0xFFC0153C /* Port G I/O Set on BOTH Edges Register */
518#define PORTGIO_INEN 0xFFC01540 /* Port G I/O Input Enable Register */
519
520
521/* General Purpose I/O Port H (0xFFC01700 - 0xFFC017FF) */
522#define PORTHIO 0xFFC01700 /* Port H I/O Pin State Specify Register */
523#define PORTHIO_CLEAR 0xFFC01704 /* Port H I/O Peripheral Interrupt Clear Register */
524#define PORTHIO_SET 0xFFC01708 /* Port H I/O Peripheral Interrupt Set Register */
525#define PORTHIO_TOGGLE 0xFFC0170C /* Port H I/O Pin State Toggle Register */
526#define PORTHIO_MASKA 0xFFC01710 /* Port H I/O Mask State Specify Interrupt A Register */
527#define PORTHIO_MASKA_CLEAR 0xFFC01714 /* Port H I/O Mask Disable Interrupt A Register */
528#define PORTHIO_MASKA_SET 0xFFC01718 /* Port H I/O Mask Enable Interrupt A Register */
529#define PORTHIO_MASKA_TOGGLE 0xFFC0171C /* Port H I/O Mask Toggle Enable Interrupt A Register */
530#define PORTHIO_MASKB 0xFFC01720 /* Port H I/O Mask State Specify Interrupt B Register */
531#define PORTHIO_MASKB_CLEAR 0xFFC01724 /* Port H I/O Mask Disable Interrupt B Register */
532#define PORTHIO_MASKB_SET 0xFFC01728 /* Port H I/O Mask Enable Interrupt B Register */
533#define PORTHIO_MASKB_TOGGLE 0xFFC0172C /* Port H I/O Mask Toggle Enable Interrupt B Register */
534#define PORTHIO_DIR 0xFFC01730 /* Port H I/O Direction Register */
535#define PORTHIO_POLAR 0xFFC01734 /* Port H I/O Source Polarity Register */
536#define PORTHIO_EDGE 0xFFC01738 /* Port H I/O Source Sensitivity Register */
537#define PORTHIO_BOTH 0xFFC0173C /* Port H I/O Set on BOTH Edges Register */
538#define PORTHIO_INEN 0xFFC01740 /* Port H I/O Input Enable Register */
539
540
541/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
542#define UART1_THR 0xFFC02000 /* Transmit Holding register */
543#define UART1_RBR 0xFFC02000 /* Receive Buffer register */
544#define UART1_DLL 0xFFC02000 /* Divisor Latch (Low-Byte) */
545#define UART1_IER 0xFFC02004 /* Interrupt Enable Register */
546#define UART1_DLH 0xFFC02004 /* Divisor Latch (High-Byte) */
547#define UART1_IIR 0xFFC02008 /* Interrupt Identification Register */
548#define UART1_LCR 0xFFC0200C /* Line Control Register */
549#define UART1_MCR 0xFFC02010 /* Modem Control Register */
550#define UART1_LSR 0xFFC02014 /* Line Status Register */
551#define UART1_MSR 0xFFC02018 /* Modem Status Register */
552#define UART1_SCR 0xFFC0201C /* SCR Scratch Register */
553#define UART1_GCTL 0xFFC02024 /* Global Control Register */
554
555
556/* Omit CAN register sets from the defBF534.h (CAN is not in the ADSP-BF52x processor) */
557
558/* Pin Control Registers (0xFFC03200 - 0xFFC032FF) */
559#define PORTF_FER 0xFFC03200 /* Port F Function Enable Register (Alternate/Flag*) */
560#define PORTG_FER 0xFFC03204 /* Port G Function Enable Register (Alternate/Flag*) */
561#define PORTH_FER 0xFFC03208 /* Port H Function Enable Register (Alternate/Flag*) */
562#define BFIN_PORT_MUX 0xFFC0320C /* Port Multiplexer Control Register */
563
564
565/* Handshake MDMA Registers (0xFFC03300 - 0xFFC033FF) */
566#define HMDMA0_CONTROL 0xFFC03300 /* Handshake MDMA0 Control Register */
567#define HMDMA0_ECINIT 0xFFC03304 /* HMDMA0 Initial Edge Count Register */
568#define HMDMA0_BCINIT 0xFFC03308 /* HMDMA0 Initial Block Count Register */
569#define HMDMA0_ECURGENT 0xFFC0330C /* HMDMA0 Urgent Edge Count Threshhold Register */
570#define HMDMA0_ECOVERFLOW 0xFFC03310 /* HMDMA0 Edge Count Overflow Interrupt Register */
571#define HMDMA0_ECOUNT 0xFFC03314 /* HMDMA0 Current Edge Count Register */
572#define HMDMA0_BCOUNT 0xFFC03318 /* HMDMA0 Current Block Count Register */
573
574#define HMDMA1_CONTROL 0xFFC03340 /* Handshake MDMA1 Control Register */
575#define HMDMA1_ECINIT 0xFFC03344 /* HMDMA1 Initial Edge Count Register */
576#define HMDMA1_BCINIT 0xFFC03348 /* HMDMA1 Initial Block Count Register */
577#define HMDMA1_ECURGENT 0xFFC0334C /* HMDMA1 Urgent Edge Count Threshhold Register */
578#define HMDMA1_ECOVERFLOW 0xFFC03350 /* HMDMA1 Edge Count Overflow Interrupt Register */
579#define HMDMA1_ECOUNT 0xFFC03354 /* HMDMA1 Current Edge Count Register */
580#define HMDMA1_BCOUNT 0xFFC03358 /* HMDMA1 Current Block Count Register */
581
582/* GPIO PIN mux (0xFFC03210 - OxFFC03288) */
583#define PORTF_MUX 0xFFC03210 /* Port F mux control */
584#define PORTG_MUX 0xFFC03214 /* Port G mux control */
585#define PORTH_MUX 0xFFC03218 /* Port H mux control */
586#define PORTF_DRIVE 0xFFC03220 /* Port F drive strength control */
587#define PORTG_DRIVE 0xFFC03224 /* Port G drive strength control */
588#define PORTH_DRIVE 0xFFC03228 /* Port H drive strength control */
589#define PORTF_SLEW 0xFFC03230 /* Port F slew control */
590#define PORTG_SLEW 0xFFC03234 /* Port G slew control */
591#define PORTH_SLEW 0xFFC03238 /* Port H slew control */
592#define PORTF_HYSTERISIS 0xFFC03240 /* Port F Schmitt trigger control */
593#define PORTG_HYSTERISIS 0xFFC03244 /* Port G Schmitt trigger control */
594#define PORTH_HYSTERISIS 0xFFC03248 /* Port H Schmitt trigger control */
595#define MISCPORT_DRIVE 0xFFC03280 /* Misc Port drive strength control */
596#define MISCPORT_SLEW 0xFFC03284 /* Misc Port slew control */
597#define MISCPORT_HYSTERISIS 0xFFC03288 /* Misc Port Schmitt trigger control */
598
599
600/***********************************************************************************
601** System MMR Register Bits And Macros
602**
603** Disclaimer: All macros are intended to make C and Assembly code more readable.
604** Use these macros carefully, as any that do left shifts for field
605** depositing will result in the lower order bits being destroyed. Any
606** macro that shifts left to properly position the bit-field should be
607** used as part of an OR to initialize a register and NOT as a dynamic
608** modifier UNLESS the lower order bits are saved and ORed back in when
609** the macro is used.
610*************************************************************************************/
611/*
612** ********************* PLL AND RESET MASKS ****************************************/
613/* PLL_CTL Masks */
614#define DF 0x0001 /* 0: PLL = CLKIN, 1: PLL = CLKIN/2 */
615#define PLL_OFF 0x0002 /* PLL Not Powered */
616#define STOPCK 0x0008 /* Core Clock Off */
617#define PDWN 0x0020 /* Enter Deep Sleep Mode */
618#define IN_DELAY 0x0040 /* Add 200ps Delay To EBIU Input Latches */
619#define OUT_DELAY 0x0080 /* Add 200ps Delay To EBIU Output Signals */
620#define BYPASS 0x0100 /* Bypass the PLL */
621#define MSEL 0x7E00 /* Multiplier Select For CCLK/VCO Factors */
622/* PLL_CTL Macros (Only Use With Logic OR While Setting Lower Order Bits) */
623#define SET_MSEL(x) (((x)&0x3F) << 0x9) /* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */
624
625/* PLL_DIV Masks */
626#define SSEL 0x000F /* System Select */
627#define CSEL 0x0030 /* Core Select */
628#define CSEL_DIV1 0x0000 /* CCLK = VCO / 1 */
629#define CSEL_DIV2 0x0010 /* CCLK = VCO / 2 */
630#define CSEL_DIV4 0x0020 /* CCLK = VCO / 4 */
631#define CSEL_DIV8 0x0030 /* CCLK = VCO / 8 */
632/* PLL_DIV Macros */
633#define SET_SSEL(x) ((x)&0xF) /* Set SSEL = 0-15 --> SCLK = VCO/SSEL */
634
635/* VR_CTL Masks */
636#define FREQ 0x0003 /* Switching Oscillator Frequency For Regulator */
637#define HIBERNATE 0x0000 /* Powerdown/Bypass On-Board Regulation */
638#define FREQ_333 0x0001 /* Switching Frequency Is 333 kHz */
639#define FREQ_667 0x0002 /* Switching Frequency Is 667 kHz */
640#define FREQ_1000 0x0003 /* Switching Frequency Is 1 MHz */
641
642#define GAIN 0x000C /* Voltage Level Gain */
643#define GAIN_5 0x0000 /* GAIN = 5 */
644#define GAIN_10 0x0004 /* GAIN = 10 */
645#define GAIN_20 0x0008 /* GAIN = 20 */
646#define GAIN_50 0x000C /* GAIN = 50 */
647
648#define VLEV 0x00F0 /* Internal Voltage Level */
649#define VLEV_085 0x0060 /* VLEV = 0.85 V (-5% - +10% Accuracy) */
650#define VLEV_090 0x0070 /* VLEV = 0.90 V (-5% - +10% Accuracy) */
651#define VLEV_095 0x0080 /* VLEV = 0.95 V (-5% - +10% Accuracy) */
652#define VLEV_100 0x0090 /* VLEV = 1.00 V (-5% - +10% Accuracy) */
653#define VLEV_105 0x00A0 /* VLEV = 1.05 V (-5% - +10% Accuracy) */
654#define VLEV_110 0x00B0 /* VLEV = 1.10 V (-5% - +10% Accuracy) */
655#define VLEV_115 0x00C0 /* VLEV = 1.15 V (-5% - +10% Accuracy) */
656#define VLEV_120 0x00D0 /* VLEV = 1.20 V (-5% - +10% Accuracy) */
657#define VLEV_125 0x00E0 /* VLEV = 1.25 V (-5% - +10% Accuracy) */
658#define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */
659
660#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */
661#define CANWE 0x0200 /* Enable CAN Wakeup From Hibernate */
662#define PHYWE 0x0400 /* Enable PHY Wakeup From Hibernate */
663#define CLKBUFOE 0x4000 /* CLKIN Buffer Output Enable */
664#define PHYCLKOE CLKBUFOE /* Alternative legacy name for the above */
665#define SCKELOW 0x8000 /* Enable Drive CKE Low During Reset */
666
667/* PLL_STAT Masks */
668#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
669#define FULL_ON 0x0002 /* Processor In Full On Mode */
670#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
671#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
672
673/* CHIPID Masks */
674#define CHIPID_VERSION 0xF0000000
675#define CHIPID_FAMILY 0x0FFFF000
676#define CHIPID_MANUFACTURE 0x00000FFE
677
678/* SWRST Masks */
679#define SYSTEM_RESET 0x0007 /* Initiates A System Software Reset */
680#define DOUBLE_FAULT 0x0008 /* Core Double Fault Causes Reset */
681#define RESET_DOUBLE 0x2000 /* SW Reset Generated By Core Double-Fault */
682#define RESET_WDOG 0x4000 /* SW Reset Generated By Watchdog Timer */
683#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */
684
685/* SYSCR Masks */
686#define BMODE 0x0007 /* Boot Mode - Latched During HW Reset From Mode Pins */
687#define NOBOOT 0x0010 /* Execute From L1 or ASYNC Bank 0 When BMODE = 0 */
688
689
690/* ************* SYSTEM INTERRUPT CONTROLLER MASKS *************************************/
691/* Peripheral Masks For SIC_ISR, SIC_IWR, SIC_IMASK */
692#define IRQ_PLL_WAKEUP 0x00000001 /* PLL Wakeup Interrupt */
693
694#define IRQ_ERROR1 0x00000002 /* Error Interrupt (DMA, DMARx Block, DMARx Overflow) */
695#define IRQ_ERROR2 0x00000004 /* Error Interrupt (CAN, Ethernet, SPORTx, PPI, SPI, UARTx) */
696#define IRQ_RTC 0x00000008 /* Real Time Clock Interrupt */
697#define IRQ_DMA0 0x00000010 /* DMA Channel 0 (PPI) Interrupt */
698#define IRQ_DMA3 0x00000020 /* DMA Channel 3 (SPORT0 RX) Interrupt */
699#define IRQ_DMA4 0x00000040 /* DMA Channel 4 (SPORT0 TX) Interrupt */
700#define IRQ_DMA5 0x00000080 /* DMA Channel 5 (SPORT1 RX) Interrupt */
701
702#define IRQ_DMA6 0x00000100 /* DMA Channel 6 (SPORT1 TX) Interrupt */
703#define IRQ_TWI 0x00000200 /* TWI Interrupt */
704#define IRQ_DMA7 0x00000400 /* DMA Channel 7 (SPI) Interrupt */
705#define IRQ_DMA8 0x00000800 /* DMA Channel 8 (UART0 RX) Interrupt */
706#define IRQ_DMA9 0x00001000 /* DMA Channel 9 (UART0 TX) Interrupt */
707#define IRQ_DMA10 0x00002000 /* DMA Channel 10 (UART1 RX) Interrupt */
708#define IRQ_DMA11 0x00004000 /* DMA Channel 11 (UART1 TX) Interrupt */
709#define IRQ_CAN_RX 0x00008000 /* CAN Receive Interrupt */
710
711#define IRQ_CAN_TX 0x00010000 /* CAN Transmit Interrupt */
712#define IRQ_DMA1 0x00020000 /* DMA Channel 1 (Ethernet RX) Interrupt */
713#define IRQ_PFA_PORTH 0x00020000 /* PF Port H (PF47:32) Interrupt A */
714#define IRQ_DMA2 0x00040000 /* DMA Channel 2 (Ethernet TX) Interrupt */
715#define IRQ_PFB_PORTH 0x00040000 /* PF Port H (PF47:32) Interrupt B */
716#define IRQ_TIMER0 0x00080000 /* Timer 0 Interrupt */
717#define IRQ_TIMER1 0x00100000 /* Timer 1 Interrupt */
718#define IRQ_TIMER2 0x00200000 /* Timer 2 Interrupt */
719#define IRQ_TIMER3 0x00400000 /* Timer 3 Interrupt */
720#define IRQ_TIMER4 0x00800000 /* Timer 4 Interrupt */
721
722#define IRQ_TIMER5 0x01000000 /* Timer 5 Interrupt */
723#define IRQ_TIMER6 0x02000000 /* Timer 6 Interrupt */
724#define IRQ_TIMER7 0x04000000 /* Timer 7 Interrupt */
725#define IRQ_PFA_PORTFG 0x08000000 /* PF Ports F&G (PF31:0) Interrupt A */
726#define IRQ_PFB_PORTF 0x80000000 /* PF Port F (PF15:0) Interrupt B */
727#define IRQ_DMA12 0x20000000 /* DMA Channels 12 (MDMA1 Source) RX Interrupt */
728#define IRQ_DMA13 0x20000000 /* DMA Channels 13 (MDMA1 Destination) TX Interrupt */
729#define IRQ_DMA14 0x40000000 /* DMA Channels 14 (MDMA0 Source) RX Interrupt */
730#define IRQ_DMA15 0x40000000 /* DMA Channels 15 (MDMA0 Destination) TX Interrupt */
731#define IRQ_WDOG 0x80000000 /* Software Watchdog Timer Interrupt */
732#define IRQ_PFB_PORTG 0x10000000 /* PF Port G (PF31:16) Interrupt B */
733
734/* SIC_IAR0 Macros */
735#define P0_IVG(x) (((x)&0xF)-7) /* Peripheral #0 assigned IVG #x */
736#define P1_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #1 assigned IVG #x */
737#define P2_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #2 assigned IVG #x */
738#define P3_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #3 assigned IVG #x */
739#define P4_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #4 assigned IVG #x */
740#define P5_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #5 assigned IVG #x */
741#define P6_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #6 assigned IVG #x */
742#define P7_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #7 assigned IVG #x */
743
744/* SIC_IAR1 Macros */
745#define P8_IVG(x) (((x)&0xF)-7) /* Peripheral #8 assigned IVG #x */
746#define P9_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #9 assigned IVG #x */
747#define P10_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #10 assigned IVG #x */
748#define P11_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #11 assigned IVG #x */
749#define P12_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #12 assigned IVG #x */
750#define P13_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #13 assigned IVG #x */
751#define P14_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #14 assigned IVG #x */
752#define P15_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #15 assigned IVG #x */
753
754/* SIC_IAR2 Macros */
755#define P16_IVG(x) (((x)&0xF)-7) /* Peripheral #16 assigned IVG #x */
756#define P17_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #17 assigned IVG #x */
757#define P18_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #18 assigned IVG #x */
758#define P19_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #19 assigned IVG #x */
759#define P20_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #20 assigned IVG #x */
760#define P21_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #21 assigned IVG #x */
761#define P22_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #22 assigned IVG #x */
762#define P23_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #23 assigned IVG #x */
763
764/* SIC_IAR3 Macros */
765#define P24_IVG(x) (((x)&0xF)-7) /* Peripheral #24 assigned IVG #x */
766#define P25_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #25 assigned IVG #x */
767#define P26_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #26 assigned IVG #x */
768#define P27_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #27 assigned IVG #x */
769#define P28_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #28 assigned IVG #x */
770#define P29_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #29 assigned IVG #x */
771#define P30_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #30 assigned IVG #x */
772#define P31_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #31 assigned IVG #x */
773
774
775/* SIC_IMASK Masks */
776#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
777#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
778#define SIC_MASK(x) (1 << ((x)&0x1F)) /* Mask Peripheral #x interrupt */
779#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Unmask Peripheral #x interrupt */
780
781/* SIC_IWR Masks */
782#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
783#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
784#define IWR_ENABLE(x) (1 << ((x)&0x1F)) /* Wakeup Enable Peripheral #x */
785#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Wakeup Disable Peripheral #x */
786
787
788/* ********* WATCHDOG TIMER MASKS ******************** */
789
790/* Watchdog Timer WDOG_CTL Register Masks */
791
792#define WDEV(x) (((x)<<1) & 0x0006) /* event generated on roll over */
793#define WDEV_RESET 0x0000 /* generate reset event on roll over */
794#define WDEV_NMI 0x0002 /* generate NMI event on roll over */
795#define WDEV_GPI 0x0004 /* generate GP IRQ on roll over */
796#define WDEV_NONE 0x0006 /* no event on roll over */
797#define WDEN 0x0FF0 /* enable watchdog */
798#define WDDIS 0x0AD0 /* disable watchdog */
799#define WDRO 0x8000 /* watchdog rolled over latch */
800
801/* depreciated WDOG_CTL Register Masks for legacy code */
802
803
804#define ICTL WDEV
805#define ENABLE_RESET WDEV_RESET
806#define WDOG_RESET WDEV_RESET
807#define ENABLE_NMI WDEV_NMI
808#define WDOG_NMI WDEV_NMI
809#define ENABLE_GPI WDEV_GPI
810#define WDOG_GPI WDEV_GPI
811#define DISABLE_EVT WDEV_NONE
812#define WDOG_NONE WDEV_NONE
813
814#define TMR_EN WDEN
815#define TMR_DIS WDDIS
816#define TRO WDRO
817#define ICTL_P0 0x01
818 #define ICTL_P1 0x02
819#define TRO_P 0x0F
820
821
822
823/* *************** REAL TIME CLOCK MASKS **************************/
824/* RTC_STAT and RTC_ALARM Masks */
825#define RTC_SEC 0x0000003F /* Real-Time Clock Seconds */
826#define RTC_MIN 0x00000FC0 /* Real-Time Clock Minutes */
827#define RTC_HR 0x0001F000 /* Real-Time Clock Hours */
828#define RTC_DAY 0xFFFE0000 /* Real-Time Clock Days */
829
830/* RTC_ALARM Macro z=day y=hr x=min w=sec */
831#define SET_ALARM(z,y,x,w) ((((z)&0x7FFF)<<0x11)|(((y)&0x1F)<<0xC)|(((x)&0x3F)<<0x6)|((w)&0x3F))
832
833/* RTC_ICTL and RTC_ISTAT Masks */
834#define STOPWATCH 0x0001 /* Stopwatch Interrupt Enable */
835#define ALARM 0x0002 /* Alarm Interrupt Enable */
836#define SECOND 0x0004 /* Seconds (1 Hz) Interrupt Enable */
837#define MINUTE 0x0008 /* Minutes Interrupt Enable */
838#define HOUR 0x0010 /* Hours Interrupt Enable */
839#define DAY 0x0020 /* 24 Hours (Days) Interrupt Enable */
840#define DAY_ALARM 0x0040 /* Day Alarm (Day, Hour, Minute, Second) Interrupt Enable */
841#define WRITE_PENDING 0x4000 /* Write Pending Status */
842#define WRITE_COMPLETE 0x8000 /* Write Complete Interrupt Enable */
843
844/* RTC_FAST / RTC_PREN Mask */
845#define PREN 0x0001 /* Enable Prescaler, RTC Runs @1 Hz */
846
847
848/* ************** UART CONTROLLER MASKS *************************/
849/* UARTx_LCR Masks */
850#define WLS(x) (((x)-5) & 0x03) /* Word Length Select */
851#define STB 0x04 /* Stop Bits */
852#define PEN 0x08 /* Parity Enable */
853#define EPS 0x10 /* Even Parity Select */
854#define STP 0x20 /* Stick Parity */
855#define SB 0x40 /* Set Break */
856#define DLAB 0x80 /* Divisor Latch Access */
857
858/* UARTx_MCR Mask */
859#define LOOP_ENA 0x10 /* Loopback Mode Enable */
860#define LOOP_ENA_P 0x04
861
862/* UARTx_LSR Masks */
863#define DR 0x01 /* Data Ready */
864#define OE 0x02 /* Overrun Error */
865#define PE 0x04 /* Parity Error */
866#define FE 0x08 /* Framing Error */
867#define BI 0x10 /* Break Interrupt */
868#define THRE 0x20 /* THR Empty */
869#define TEMT 0x40 /* TSR and UART_THR Empty */
870
871/* UARTx_IER Masks */
872#define ERBFI 0x01 /* Enable Receive Buffer Full Interrupt */
873#define ETBEI 0x02 /* Enable Transmit Buffer Empty Interrupt */
874#define ELSI 0x04 /* Enable RX Status Interrupt */
875
876/* UARTx_IIR Masks */
877#define NINT 0x01 /* Pending Interrupt */
878#define IIR_TX_READY 0x02 /* UART_THR empty */
879#define IIR_RX_READY 0x04 /* Receive data ready */
880#define IIR_LINE_CHANGE 0x06 /* Receive line status */
881#define IIR_STATUS 0x06 /* Highest Priority Pending Interrupt */
882
883/* UARTx_GCTL Masks */
884#define UCEN 0x01 /* Enable UARTx Clocks */
885#define IREN 0x02 /* Enable IrDA Mode */
886#define TPOLC 0x04 /* IrDA TX Polarity Change */
887#define RPOLC 0x08 /* IrDA RX Polarity Change */
888#define FPE 0x10 /* Force Parity Error On Transmit */
889#define FFE 0x20 /* Force Framing Error On Transmit */
890
891
892/* *********** SERIAL PERIPHERAL INTERFACE (SPI) MASKS ****************************/
893/* SPI_CTL Masks */
894#define TIMOD 0x0003 /* Transfer Initiate Mode */
895#define RDBR_CORE 0x0000 /* RDBR Read Initiates, IRQ When RDBR Full */
896#define TDBR_CORE 0x0001 /* TDBR Write Initiates, IRQ When TDBR Empty */
897#define RDBR_DMA 0x0002 /* DMA Read, DMA Until FIFO Empty */
898#define TDBR_DMA 0x0003 /* DMA Write, DMA Until FIFO Full */
899#define SZ 0x0004 /* Send Zero (When TDBR Empty, Send Zero/Last*) */
900#define GM 0x0008 /* Get More (When RDBR Full, Overwrite/Discard*) */
901#define PSSE 0x0010 /* Slave-Select Input Enable */
902#define EMISO 0x0020 /* Enable MISO As Output */
903#define SIZE 0x0100 /* Size of Words (16/8* Bits) */
904#define LSBF 0x0200 /* LSB First */
905#define CPHA 0x0400 /* Clock Phase */
906#define CPOL 0x0800 /* Clock Polarity */
907#define MSTR 0x1000 /* Master/Slave* */
908#define WOM 0x2000 /* Write Open Drain Master */
909#define SPE 0x4000 /* SPI Enable */
910
911/* SPI_FLG Masks */
912#define FLS1 0x0002 /* Enables SPI_FLOUT1 as SPI Slave-Select Output */
913#define FLS2 0x0004 /* Enables SPI_FLOUT2 as SPI Slave-Select Output */
914#define FLS3 0x0008 /* Enables SPI_FLOUT3 as SPI Slave-Select Output */
915#define FLS4 0x0010 /* Enables SPI_FLOUT4 as SPI Slave-Select Output */
916#define FLS5 0x0020 /* Enables SPI_FLOUT5 as SPI Slave-Select Output */
917#define FLS6 0x0040 /* Enables SPI_FLOUT6 as SPI Slave-Select Output */
918#define FLS7 0x0080 /* Enables SPI_FLOUT7 as SPI Slave-Select Output */
919#define FLG1 0xFDFF /* Activates SPI_FLOUT1 */
920#define FLG2 0xFBFF /* Activates SPI_FLOUT2 */
921#define FLG3 0xF7FF /* Activates SPI_FLOUT3 */
922#define FLG4 0xEFFF /* Activates SPI_FLOUT4 */
923#define FLG5 0xDFFF /* Activates SPI_FLOUT5 */
924#define FLG6 0xBFFF /* Activates SPI_FLOUT6 */
925#define FLG7 0x7FFF /* Activates SPI_FLOUT7 */
926
927/* SPI_STAT Masks */
928#define SPIF 0x0001 /* SPI Finished (Single-Word Transfer Complete) */
929#define MODF 0x0002 /* Mode Fault Error (Another Device Tried To Become Master) */
930#define TXE 0x0004 /* Transmission Error (Data Sent With No New Data In TDBR) */
931#define TXS 0x0008 /* SPI_TDBR Data Buffer Status (Full/Empty*) */
932#define RBSY 0x0010 /* Receive Error (Data Received With RDBR Full) */
933#define RXS 0x0020 /* SPI_RDBR Data Buffer Status (Full/Empty*) */
934#define TXCOL 0x0040 /* Transmit Collision Error (Corrupt Data May Have Been Sent) */
935
936
937/* **************** GENERAL PURPOSE TIMER MASKS **********************/
938/* TIMER_ENABLE Masks */
939#define TIMEN0 0x0001 /* Enable Timer 0 */
940#define TIMEN1 0x0002 /* Enable Timer 1 */
941#define TIMEN2 0x0004 /* Enable Timer 2 */
942#define TIMEN3 0x0008 /* Enable Timer 3 */
943#define TIMEN4 0x0010 /* Enable Timer 4 */
944#define TIMEN5 0x0020 /* Enable Timer 5 */
945#define TIMEN6 0x0040 /* Enable Timer 6 */
946#define TIMEN7 0x0080 /* Enable Timer 7 */
947
948/* TIMER_DISABLE Masks */
949#define TIMDIS0 TIMEN0 /* Disable Timer 0 */
950#define TIMDIS1 TIMEN1 /* Disable Timer 1 */
951#define TIMDIS2 TIMEN2 /* Disable Timer 2 */
952#define TIMDIS3 TIMEN3 /* Disable Timer 3 */
953#define TIMDIS4 TIMEN4 /* Disable Timer 4 */
954#define TIMDIS5 TIMEN5 /* Disable Timer 5 */
955#define TIMDIS6 TIMEN6 /* Disable Timer 6 */
956#define TIMDIS7 TIMEN7 /* Disable Timer 7 */
957
958/* TIMER_STATUS Masks */
959#define TIMIL0 0x00000001 /* Timer 0 Interrupt */
960#define TIMIL1 0x00000002 /* Timer 1 Interrupt */
961#define TIMIL2 0x00000004 /* Timer 2 Interrupt */
962#define TIMIL3 0x00000008 /* Timer 3 Interrupt */
963#define TOVF_ERR0 0x00000010 /* Timer 0 Counter Overflow */
964#define TOVF_ERR1 0x00000020 /* Timer 1 Counter Overflow */
965#define TOVF_ERR2 0x00000040 /* Timer 2 Counter Overflow */
966#define TOVF_ERR3 0x00000080 /* Timer 3 Counter Overflow */
967#define TRUN0 0x00001000 /* Timer 0 Slave Enable Status */
968#define TRUN1 0x00002000 /* Timer 1 Slave Enable Status */
969#define TRUN2 0x00004000 /* Timer 2 Slave Enable Status */
970#define TRUN3 0x00008000 /* Timer 3 Slave Enable Status */
971#define TIMIL4 0x00010000 /* Timer 4 Interrupt */
972#define TIMIL5 0x00020000 /* Timer 5 Interrupt */
973#define TIMIL6 0x00040000 /* Timer 6 Interrupt */
974#define TIMIL7 0x00080000 /* Timer 7 Interrupt */
975#define TOVF_ERR4 0x00100000 /* Timer 4 Counter Overflow */
976#define TOVF_ERR5 0x00200000 /* Timer 5 Counter Overflow */
977#define TOVF_ERR6 0x00400000 /* Timer 6 Counter Overflow */
978#define TOVF_ERR7 0x00800000 /* Timer 7 Counter Overflow */
979#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */
980#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */
981#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */
982#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */
983
984/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
985#define TOVL_ERR0 TOVF_ERR0
986#define TOVL_ERR1 TOVF_ERR1
987#define TOVL_ERR2 TOVF_ERR2
988#define TOVL_ERR3 TOVF_ERR3
989#define TOVL_ERR4 TOVF_ERR4
990#define TOVL_ERR5 TOVF_ERR5
991#define TOVL_ERR6 TOVF_ERR6
992#define TOVL_ERR7 TOVF_ERR7
993
994/* TIMERx_CONFIG Masks */
995#define PWM_OUT 0x0001 /* Pulse-Width Modulation Output Mode */
996#define WDTH_CAP 0x0002 /* Width Capture Input Mode */
997#define EXT_CLK 0x0003 /* External Clock Mode */
998#define PULSE_HI 0x0004 /* Action Pulse (Positive/Negative*) */
999#define PERIOD_CNT 0x0008 /* Period Count */
1000#define IRQ_ENA 0x0010 /* Interrupt Request Enable */
1001#define TIN_SEL 0x0020 /* Timer Input Select */
1002#define OUT_DIS 0x0040 /* Output Pad Disable */
1003#define CLK_SEL 0x0080 /* Timer Clock Select */
1004#define TOGGLE_HI 0x0100 /* PWM_OUT PULSE_HI Toggle Mode */
1005#define EMU_RUN 0x0200 /* Emulation Behavior Select */
1006#define ERR_TYP 0xC000 /* Error Type */
1007
1008
1009/* ****************** GPIO PORTS F, G, H MASKS ***********************/
1010/* General Purpose IO (0xFFC00700 - 0xFFC007FF) Masks */
1011/* Port F Masks */
1012#define PF0 0x0001
1013#define PF1 0x0002
1014#define PF2 0x0004
1015#define PF3 0x0008
1016#define PF4 0x0010
1017#define PF5 0x0020
1018#define PF6 0x0040
1019#define PF7 0x0080
1020#define PF8 0x0100
1021#define PF9 0x0200
1022#define PF10 0x0400
1023#define PF11 0x0800
1024#define PF12 0x1000
1025#define PF13 0x2000
1026#define PF14 0x4000
1027#define PF15 0x8000
1028
1029/* Port G Masks */
1030#define PG0 0x0001
1031#define PG1 0x0002
1032#define PG2 0x0004
1033#define PG3 0x0008
1034#define PG4 0x0010
1035#define PG5 0x0020
1036#define PG6 0x0040
1037#define PG7 0x0080
1038#define PG8 0x0100
1039#define PG9 0x0200
1040#define PG10 0x0400
1041#define PG11 0x0800
1042#define PG12 0x1000
1043#define PG13 0x2000
1044#define PG14 0x4000
1045#define PG15 0x8000
1046
1047/* Port H Masks */
1048#define PH0 0x0001
1049#define PH1 0x0002
1050#define PH2 0x0004
1051#define PH3 0x0008
1052#define PH4 0x0010
1053#define PH5 0x0020
1054#define PH6 0x0040
1055#define PH7 0x0080
1056#define PH8 0x0100
1057#define PH9 0x0200
1058#define PH10 0x0400
1059#define PH11 0x0800
1060#define PH12 0x1000
1061#define PH13 0x2000
1062#define PH14 0x4000
1063#define PH15 0x8000
1064
1065
1066/* ******************* SERIAL PORT MASKS **************************************/
1067/* SPORTx_TCR1 Masks */
1068#define TSPEN 0x0001 /* Transmit Enable */
1069#define ITCLK 0x0002 /* Internal Transmit Clock Select */
1070#define DTYPE_NORM 0x0004 /* Data Format Normal */
1071#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1072#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1073#define TLSBIT 0x0010 /* Transmit Bit Order */
1074#define ITFS 0x0200 /* Internal Transmit Frame Sync Select */
1075#define TFSR 0x0400 /* Transmit Frame Sync Required Select */
1076#define DITFS 0x0800 /* Data-Independent Transmit Frame Sync Select */
1077#define LTFS 0x1000 /* Low Transmit Frame Sync Select */
1078#define LATFS 0x2000 /* Late Transmit Frame Sync Select */
1079#define TCKFE 0x4000 /* Clock Falling Edge Select */
1080
1081/* SPORTx_TCR2 Masks and Macro */
1082#define SLEN(x) ((x)&0x1F) /* SPORT TX Word Length (2 - 31) */
1083#define TXSE 0x0100 /* TX Secondary Enable */
1084#define TSFSE 0x0200 /* Transmit Stereo Frame Sync Enable */
1085#define TRFST 0x0400 /* Left/Right Order (1 = Right Channel 1st) */
1086
1087/* SPORTx_RCR1 Masks */
1088#define RSPEN 0x0001 /* Receive Enable */
1089#define IRCLK 0x0002 /* Internal Receive Clock Select */
1090#define DTYPE_NORM 0x0004 /* Data Format Normal */
1091#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1092#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1093#define RLSBIT 0x0010 /* Receive Bit Order */
1094#define IRFS 0x0200 /* Internal Receive Frame Sync Select */
1095#define RFSR 0x0400 /* Receive Frame Sync Required Select */
1096#define LRFS 0x1000 /* Low Receive Frame Sync Select */
1097#define LARFS 0x2000 /* Late Receive Frame Sync Select */
1098#define RCKFE 0x4000 /* Clock Falling Edge Select */
1099
1100/* SPORTx_RCR2 Masks */
1101#define SLEN(x) ((x)&0x1F) /* SPORT RX Word Length (2 - 31) */
1102#define RXSE 0x0100 /* RX Secondary Enable */
1103#define RSFSE 0x0200 /* RX Stereo Frame Sync Enable */
1104#define RRFST 0x0400 /* Right-First Data Order */
1105
1106/* SPORTx_STAT Masks */
1107#define RXNE 0x0001 /* Receive FIFO Not Empty Status */
1108#define RUVF 0x0002 /* Sticky Receive Underflow Status */
1109#define ROVF 0x0004 /* Sticky Receive Overflow Status */
1110#define TXF 0x0008 /* Transmit FIFO Full Status */
1111#define TUVF 0x0010 /* Sticky Transmit Underflow Status */
1112#define TOVF 0x0020 /* Sticky Transmit Overflow Status */
1113#define TXHRE 0x0040 /* Transmit Hold Register Empty */
1114
1115/* SPORTx_MCMC1 Macros */
1116#define SP_WOFF(x) ((x) & 0x3FF) /* Multichannel Window Offset Field */
1117
1118/* Only use WSIZE Macro With Logic OR While Setting Lower Order Bits */
1119#define SP_WSIZE(x) (((((x)>>0x3)-1)&0xF) << 0xC) /* Multichannel Window Size = (x/8)-1 */
1120
1121/* SPORTx_MCMC2 Masks */
1122#define REC_BYPASS 0x0000 /* Bypass Mode (No Clock Recovery) */
1123#define REC_2FROM4 0x0002 /* Recover 2 MHz Clock from 4 MHz Clock */
1124#define REC_8FROM16 0x0003 /* Recover 8 MHz Clock from 16 MHz Clock */
1125#define MCDTXPE 0x0004 /* Multichannel DMA Transmit Packing */
1126#define MCDRXPE 0x0008 /* Multichannel DMA Receive Packing */
1127#define MCMEN 0x0010 /* Multichannel Frame Mode Enable */
1128#define FSDR 0x0080 /* Multichannel Frame Sync to Data Relationship */
1129#define MFD_0 0x0000 /* Multichannel Frame Delay = 0 */
1130#define MFD_1 0x1000 /* Multichannel Frame Delay = 1 */
1131#define MFD_2 0x2000 /* Multichannel Frame Delay = 2 */
1132#define MFD_3 0x3000 /* Multichannel Frame Delay = 3 */
1133#define MFD_4 0x4000 /* Multichannel Frame Delay = 4 */
1134#define MFD_5 0x5000 /* Multichannel Frame Delay = 5 */
1135#define MFD_6 0x6000 /* Multichannel Frame Delay = 6 */
1136#define MFD_7 0x7000 /* Multichannel Frame Delay = 7 */
1137#define MFD_8 0x8000 /* Multichannel Frame Delay = 8 */
1138#define MFD_9 0x9000 /* Multichannel Frame Delay = 9 */
1139#define MFD_10 0xA000 /* Multichannel Frame Delay = 10 */
1140#define MFD_11 0xB000 /* Multichannel Frame Delay = 11 */
1141#define MFD_12 0xC000 /* Multichannel Frame Delay = 12 */
1142#define MFD_13 0xD000 /* Multichannel Frame Delay = 13 */
1143#define MFD_14 0xE000 /* Multichannel Frame Delay = 14 */
1144#define MFD_15 0xF000 /* Multichannel Frame Delay = 15 */
1145
1146
1147/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS *************************/
1148/* EBIU_AMGCTL Masks */
1149#define AMCKEN 0x0001 /* Enable CLKOUT */
1150#define AMBEN_NONE 0x0000 /* All Banks Disabled */
1151#define AMBEN_B0 0x0002 /* Enable Async Memory Bank 0 only */
1152#define AMBEN_B0_B1 0x0004 /* Enable Async Memory Banks 0 & 1 only */
1153#define AMBEN_B0_B1_B2 0x0006 /* Enable Async Memory Banks 0, 1, and 2 */
1154#define AMBEN_ALL 0x0008 /* Enable Async Memory Banks (all) 0, 1, 2, and 3 */
1155
1156/* EBIU_AMBCTL0 Masks */
1157#define B0RDYEN 0x00000001 /* Bank 0 (B0) RDY Enable */
1158#define B0RDYPOL 0x00000002 /* B0 RDY Active High */
1159#define B0TT_1 0x00000004 /* B0 Transition Time (Read to Write) = 1 cycle */
1160#define B0TT_2 0x00000008 /* B0 Transition Time (Read to Write) = 2 cycles */
1161#define B0TT_3 0x0000000C /* B0 Transition Time (Read to Write) = 3 cycles */
1162#define B0TT_4 0x00000000 /* B0 Transition Time (Read to Write) = 4 cycles */
1163#define B0ST_1 0x00000010 /* B0 Setup Time (AOE to Read/Write) = 1 cycle */
1164#define B0ST_2 0x00000020 /* B0 Setup Time (AOE to Read/Write) = 2 cycles */
1165#define B0ST_3 0x00000030 /* B0 Setup Time (AOE to Read/Write) = 3 cycles */
1166#define B0ST_4 0x00000000 /* B0 Setup Time (AOE to Read/Write) = 4 cycles */
1167#define B0HT_1 0x00000040 /* B0 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1168#define B0HT_2 0x00000080 /* B0 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1169#define B0HT_3 0x000000C0 /* B0 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1170#define B0HT_0 0x00000000 /* B0 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1171#define B0RAT_1 0x00000100 /* B0 Read Access Time = 1 cycle */
1172#define B0RAT_2 0x00000200 /* B0 Read Access Time = 2 cycles */
1173#define B0RAT_3 0x00000300 /* B0 Read Access Time = 3 cycles */
1174#define B0RAT_4 0x00000400 /* B0 Read Access Time = 4 cycles */
1175#define B0RAT_5 0x00000500 /* B0 Read Access Time = 5 cycles */
1176#define B0RAT_6 0x00000600 /* B0 Read Access Time = 6 cycles */
1177#define B0RAT_7 0x00000700 /* B0 Read Access Time = 7 cycles */
1178#define B0RAT_8 0x00000800 /* B0 Read Access Time = 8 cycles */
1179#define B0RAT_9 0x00000900 /* B0 Read Access Time = 9 cycles */
1180#define B0RAT_10 0x00000A00 /* B0 Read Access Time = 10 cycles */
1181#define B0RAT_11 0x00000B00 /* B0 Read Access Time = 11 cycles */
1182#define B0RAT_12 0x00000C00 /* B0 Read Access Time = 12 cycles */
1183#define B0RAT_13 0x00000D00 /* B0 Read Access Time = 13 cycles */
1184#define B0RAT_14 0x00000E00 /* B0 Read Access Time = 14 cycles */
1185#define B0RAT_15 0x00000F00 /* B0 Read Access Time = 15 cycles */
1186#define B0WAT_1 0x00001000 /* B0 Write Access Time = 1 cycle */
1187#define B0WAT_2 0x00002000 /* B0 Write Access Time = 2 cycles */
1188#define B0WAT_3 0x00003000 /* B0 Write Access Time = 3 cycles */
1189#define B0WAT_4 0x00004000 /* B0 Write Access Time = 4 cycles */
1190#define B0WAT_5 0x00005000 /* B0 Write Access Time = 5 cycles */
1191#define B0WAT_6 0x00006000 /* B0 Write Access Time = 6 cycles */
1192#define B0WAT_7 0x00007000 /* B0 Write Access Time = 7 cycles */
1193#define B0WAT_8 0x00008000 /* B0 Write Access Time = 8 cycles */
1194#define B0WAT_9 0x00009000 /* B0 Write Access Time = 9 cycles */
1195#define B0WAT_10 0x0000A000 /* B0 Write Access Time = 10 cycles */
1196#define B0WAT_11 0x0000B000 /* B0 Write Access Time = 11 cycles */
1197#define B0WAT_12 0x0000C000 /* B0 Write Access Time = 12 cycles */
1198#define B0WAT_13 0x0000D000 /* B0 Write Access Time = 13 cycles */
1199#define B0WAT_14 0x0000E000 /* B0 Write Access Time = 14 cycles */
1200#define B0WAT_15 0x0000F000 /* B0 Write Access Time = 15 cycles */
1201
1202#define B1RDYEN 0x00010000 /* Bank 1 (B1) RDY Enable */
1203#define B1RDYPOL 0x00020000 /* B1 RDY Active High */
1204#define B1TT_1 0x00040000 /* B1 Transition Time (Read to Write) = 1 cycle */
1205#define B1TT_2 0x00080000 /* B1 Transition Time (Read to Write) = 2 cycles */
1206#define B1TT_3 0x000C0000 /* B1 Transition Time (Read to Write) = 3 cycles */
1207#define B1TT_4 0x00000000 /* B1 Transition Time (Read to Write) = 4 cycles */
1208#define B1ST_1 0x00100000 /* B1 Setup Time (AOE to Read/Write) = 1 cycle */
1209#define B1ST_2 0x00200000 /* B1 Setup Time (AOE to Read/Write) = 2 cycles */
1210#define B1ST_3 0x00300000 /* B1 Setup Time (AOE to Read/Write) = 3 cycles */
1211#define B1ST_4 0x00000000 /* B1 Setup Time (AOE to Read/Write) = 4 cycles */
1212#define B1HT_1 0x00400000 /* B1 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1213#define B1HT_2 0x00800000 /* B1 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1214#define B1HT_3 0x00C00000 /* B1 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1215#define B1HT_0 0x00000000 /* B1 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1216#define B1RAT_1 0x01000000 /* B1 Read Access Time = 1 cycle */
1217#define B1RAT_2 0x02000000 /* B1 Read Access Time = 2 cycles */
1218#define B1RAT_3 0x03000000 /* B1 Read Access Time = 3 cycles */
1219#define B1RAT_4 0x04000000 /* B1 Read Access Time = 4 cycles */
1220#define B1RAT_5 0x05000000 /* B1 Read Access Time = 5 cycles */
1221#define B1RAT_6 0x06000000 /* B1 Read Access Time = 6 cycles */
1222#define B1RAT_7 0x07000000 /* B1 Read Access Time = 7 cycles */
1223#define B1RAT_8 0x08000000 /* B1 Read Access Time = 8 cycles */
1224#define B1RAT_9 0x09000000 /* B1 Read Access Time = 9 cycles */
1225#define B1RAT_10 0x0A000000 /* B1 Read Access Time = 10 cycles */
1226#define B1RAT_11 0x0B000000 /* B1 Read Access Time = 11 cycles */
1227#define B1RAT_12 0x0C000000 /* B1 Read Access Time = 12 cycles */
1228#define B1RAT_13 0x0D000000 /* B1 Read Access Time = 13 cycles */
1229#define B1RAT_14 0x0E000000 /* B1 Read Access Time = 14 cycles */
1230#define B1RAT_15 0x0F000000 /* B1 Read Access Time = 15 cycles */
1231#define B1WAT_1 0x10000000 /* B1 Write Access Time = 1 cycle */
1232#define B1WAT_2 0x20000000 /* B1 Write Access Time = 2 cycles */
1233#define B1WAT_3 0x30000000 /* B1 Write Access Time = 3 cycles */
1234#define B1WAT_4 0x40000000 /* B1 Write Access Time = 4 cycles */
1235#define B1WAT_5 0x50000000 /* B1 Write Access Time = 5 cycles */
1236#define B1WAT_6 0x60000000 /* B1 Write Access Time = 6 cycles */
1237#define B1WAT_7 0x70000000 /* B1 Write Access Time = 7 cycles */
1238#define B1WAT_8 0x80000000 /* B1 Write Access Time = 8 cycles */
1239#define B1WAT_9 0x90000000 /* B1 Write Access Time = 9 cycles */
1240#define B1WAT_10 0xA0000000 /* B1 Write Access Time = 10 cycles */
1241#define B1WAT_11 0xB0000000 /* B1 Write Access Time = 11 cycles */
1242#define B1WAT_12 0xC0000000 /* B1 Write Access Time = 12 cycles */
1243#define B1WAT_13 0xD0000000 /* B1 Write Access Time = 13 cycles */
1244#define B1WAT_14 0xE0000000 /* B1 Write Access Time = 14 cycles */
1245#define B1WAT_15 0xF0000000 /* B1 Write Access Time = 15 cycles */
1246
1247/* EBIU_AMBCTL1 Masks */
1248#define B2RDYEN 0x00000001 /* Bank 2 (B2) RDY Enable */
1249#define B2RDYPOL 0x00000002 /* B2 RDY Active High */
1250#define B2TT_1 0x00000004 /* B2 Transition Time (Read to Write) = 1 cycle */
1251#define B2TT_2 0x00000008 /* B2 Transition Time (Read to Write) = 2 cycles */
1252#define B2TT_3 0x0000000C /* B2 Transition Time (Read to Write) = 3 cycles */
1253#define B2TT_4 0x00000000 /* B2 Transition Time (Read to Write) = 4 cycles */
1254#define B2ST_1 0x00000010 /* B2 Setup Time (AOE to Read/Write) = 1 cycle */
1255#define B2ST_2 0x00000020 /* B2 Setup Time (AOE to Read/Write) = 2 cycles */
1256#define B2ST_3 0x00000030 /* B2 Setup Time (AOE to Read/Write) = 3 cycles */
1257#define B2ST_4 0x00000000 /* B2 Setup Time (AOE to Read/Write) = 4 cycles */
1258#define B2HT_1 0x00000040 /* B2 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1259#define B2HT_2 0x00000080 /* B2 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1260#define B2HT_3 0x000000C0 /* B2 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1261#define B2HT_0 0x00000000 /* B2 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1262#define B2RAT_1 0x00000100 /* B2 Read Access Time = 1 cycle */
1263#define B2RAT_2 0x00000200 /* B2 Read Access Time = 2 cycles */
1264#define B2RAT_3 0x00000300 /* B2 Read Access Time = 3 cycles */
1265#define B2RAT_4 0x00000400 /* B2 Read Access Time = 4 cycles */
1266#define B2RAT_5 0x00000500 /* B2 Read Access Time = 5 cycles */
1267#define B2RAT_6 0x00000600 /* B2 Read Access Time = 6 cycles */
1268#define B2RAT_7 0x00000700 /* B2 Read Access Time = 7 cycles */
1269#define B2RAT_8 0x00000800 /* B2 Read Access Time = 8 cycles */
1270#define B2RAT_9 0x00000900 /* B2 Read Access Time = 9 cycles */
1271#define B2RAT_10 0x00000A00 /* B2 Read Access Time = 10 cycles */
1272#define B2RAT_11 0x00000B00 /* B2 Read Access Time = 11 cycles */
1273#define B2RAT_12 0x00000C00 /* B2 Read Access Time = 12 cycles */
1274#define B2RAT_13 0x00000D00 /* B2 Read Access Time = 13 cycles */
1275#define B2RAT_14 0x00000E00 /* B2 Read Access Time = 14 cycles */
1276#define B2RAT_15 0x00000F00 /* B2 Read Access Time = 15 cycles */
1277#define B2WAT_1 0x00001000 /* B2 Write Access Time = 1 cycle */
1278#define B2WAT_2 0x00002000 /* B2 Write Access Time = 2 cycles */
1279#define B2WAT_3 0x00003000 /* B2 Write Access Time = 3 cycles */
1280#define B2WAT_4 0x00004000 /* B2 Write Access Time = 4 cycles */
1281#define B2WAT_5 0x00005000 /* B2 Write Access Time = 5 cycles */
1282#define B2WAT_6 0x00006000 /* B2 Write Access Time = 6 cycles */
1283#define B2WAT_7 0x00007000 /* B2 Write Access Time = 7 cycles */
1284#define B2WAT_8 0x00008000 /* B2 Write Access Time = 8 cycles */
1285#define B2WAT_9 0x00009000 /* B2 Write Access Time = 9 cycles */
1286#define B2WAT_10 0x0000A000 /* B2 Write Access Time = 10 cycles */
1287#define B2WAT_11 0x0000B000 /* B2 Write Access Time = 11 cycles */
1288#define B2WAT_12 0x0000C000 /* B2 Write Access Time = 12 cycles */
1289#define B2WAT_13 0x0000D000 /* B2 Write Access Time = 13 cycles */
1290#define B2WAT_14 0x0000E000 /* B2 Write Access Time = 14 cycles */
1291#define B2WAT_15 0x0000F000 /* B2 Write Access Time = 15 cycles */
1292
1293#define B3RDYEN 0x00010000 /* Bank 3 (B3) RDY Enable */
1294#define B3RDYPOL 0x00020000 /* B3 RDY Active High */
1295#define B3TT_1 0x00040000 /* B3 Transition Time (Read to Write) = 1 cycle */
1296#define B3TT_2 0x00080000 /* B3 Transition Time (Read to Write) = 2 cycles */
1297#define B3TT_3 0x000C0000 /* B3 Transition Time (Read to Write) = 3 cycles */
1298#define B3TT_4 0x00000000 /* B3 Transition Time (Read to Write) = 4 cycles */
1299#define B3ST_1 0x00100000 /* B3 Setup Time (AOE to Read/Write) = 1 cycle */
1300#define B3ST_2 0x00200000 /* B3 Setup Time (AOE to Read/Write) = 2 cycles */
1301#define B3ST_3 0x00300000 /* B3 Setup Time (AOE to Read/Write) = 3 cycles */
1302#define B3ST_4 0x00000000 /* B3 Setup Time (AOE to Read/Write) = 4 cycles */
1303#define B3HT_1 0x00400000 /* B3 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1304#define B3HT_2 0x00800000 /* B3 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1305#define B3HT_3 0x00C00000 /* B3 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1306#define B3HT_0 0x00000000 /* B3 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1307#define B3RAT_1 0x01000000 /* B3 Read Access Time = 1 cycle */
1308#define B3RAT_2 0x02000000 /* B3 Read Access Time = 2 cycles */
1309#define B3RAT_3 0x03000000 /* B3 Read Access Time = 3 cycles */
1310#define B3RAT_4 0x04000000 /* B3 Read Access Time = 4 cycles */
1311#define B3RAT_5 0x05000000 /* B3 Read Access Time = 5 cycles */
1312#define B3RAT_6 0x06000000 /* B3 Read Access Time = 6 cycles */
1313#define B3RAT_7 0x07000000 /* B3 Read Access Time = 7 cycles */
1314#define B3RAT_8 0x08000000 /* B3 Read Access Time = 8 cycles */
1315#define B3RAT_9 0x09000000 /* B3 Read Access Time = 9 cycles */
1316#define B3RAT_10 0x0A000000 /* B3 Read Access Time = 10 cycles */
1317#define B3RAT_11 0x0B000000 /* B3 Read Access Time = 11 cycles */
1318#define B3RAT_12 0x0C000000 /* B3 Read Access Time = 12 cycles */
1319#define B3RAT_13 0x0D000000 /* B3 Read Access Time = 13 cycles */
1320#define B3RAT_14 0x0E000000 /* B3 Read Access Time = 14 cycles */
1321#define B3RAT_15 0x0F000000 /* B3 Read Access Time = 15 cycles */
1322#define B3WAT_1 0x10000000 /* B3 Write Access Time = 1 cycle */
1323#define B3WAT_2 0x20000000 /* B3 Write Access Time = 2 cycles */
1324#define B3WAT_3 0x30000000 /* B3 Write Access Time = 3 cycles */
1325#define B3WAT_4 0x40000000 /* B3 Write Access Time = 4 cycles */
1326#define B3WAT_5 0x50000000 /* B3 Write Access Time = 5 cycles */
1327#define B3WAT_6 0x60000000 /* B3 Write Access Time = 6 cycles */
1328#define B3WAT_7 0x70000000 /* B3 Write Access Time = 7 cycles */
1329#define B3WAT_8 0x80000000 /* B3 Write Access Time = 8 cycles */
1330#define B3WAT_9 0x90000000 /* B3 Write Access Time = 9 cycles */
1331#define B3WAT_10 0xA0000000 /* B3 Write Access Time = 10 cycles */
1332#define B3WAT_11 0xB0000000 /* B3 Write Access Time = 11 cycles */
1333#define B3WAT_12 0xC0000000 /* B3 Write Access Time = 12 cycles */
1334#define B3WAT_13 0xD0000000 /* B3 Write Access Time = 13 cycles */
1335#define B3WAT_14 0xE0000000 /* B3 Write Access Time = 14 cycles */
1336#define B3WAT_15 0xF0000000 /* B3 Write Access Time = 15 cycles */
1337
1338
1339/* ********************** SDRAM CONTROLLER MASKS **********************************************/
1340/* EBIU_SDGCTL Masks */
1341#define SCTLE 0x00000001 /* Enable SDRAM Signals */
1342#define CL_2 0x00000008 /* SDRAM CAS Latency = 2 cycles */
1343#define CL_3 0x0000000C /* SDRAM CAS Latency = 3 cycles */
1344#define PASR_ALL 0x00000000 /* All 4 SDRAM Banks Refreshed In Self-Refresh */
1345#define PASR_B0_B1 0x00000010 /* SDRAM Banks 0 and 1 Are Refreshed In Self-Refresh */
1346#define PASR_B0 0x00000020 /* Only SDRAM Bank 0 Is Refreshed In Self-Refresh */
1347#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
1348#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
1349#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
1350#define TRAS_4 0x00000100 /* SDRAM tRAS = 4 cycles */
1351#define TRAS_5 0x00000140 /* SDRAM tRAS = 5 cycles */
1352#define TRAS_6 0x00000180 /* SDRAM tRAS = 6 cycles */
1353#define TRAS_7 0x000001C0 /* SDRAM tRAS = 7 cycles */
1354#define TRAS_8 0x00000200 /* SDRAM tRAS = 8 cycles */
1355#define TRAS_9 0x00000240 /* SDRAM tRAS = 9 cycles */
1356#define TRAS_10 0x00000280 /* SDRAM tRAS = 10 cycles */
1357#define TRAS_11 0x000002C0 /* SDRAM tRAS = 11 cycles */
1358#define TRAS_12 0x00000300 /* SDRAM tRAS = 12 cycles */
1359#define TRAS_13 0x00000340 /* SDRAM tRAS = 13 cycles */
1360#define TRAS_14 0x00000380 /* SDRAM tRAS = 14 cycles */
1361#define TRAS_15 0x000003C0 /* SDRAM tRAS = 15 cycles */
1362#define TRP_1 0x00000800 /* SDRAM tRP = 1 cycle */
1363#define TRP_2 0x00001000 /* SDRAM tRP = 2 cycles */
1364#define TRP_3 0x00001800 /* SDRAM tRP = 3 cycles */
1365#define TRP_4 0x00002000 /* SDRAM tRP = 4 cycles */
1366#define TRP_5 0x00002800 /* SDRAM tRP = 5 cycles */
1367#define TRP_6 0x00003000 /* SDRAM tRP = 6 cycles */
1368#define TRP_7 0x00003800 /* SDRAM tRP = 7 cycles */
1369#define TRCD_1 0x00008000 /* SDRAM tRCD = 1 cycle */
1370#define TRCD_2 0x00010000 /* SDRAM tRCD = 2 cycles */
1371#define TRCD_3 0x00018000 /* SDRAM tRCD = 3 cycles */
1372#define TRCD_4 0x00020000 /* SDRAM tRCD = 4 cycles */
1373#define TRCD_5 0x00028000 /* SDRAM tRCD = 5 cycles */
1374#define TRCD_6 0x00030000 /* SDRAM tRCD = 6 cycles */
1375#define TRCD_7 0x00038000 /* SDRAM tRCD = 7 cycles */
1376#define TWR_1 0x00080000 /* SDRAM tWR = 1 cycle */
1377#define TWR_2 0x00100000 /* SDRAM tWR = 2 cycles */
1378#define TWR_3 0x00180000 /* SDRAM tWR = 3 cycles */
1379#define PUPSD 0x00200000 /* Power-Up Start Delay (15 SCLK Cycles Delay) */
1380#define PSM 0x00400000 /* Power-Up Sequence (Mode Register Before/After* Refresh) */
1381#define PSS 0x00800000 /* Enable Power-Up Sequence on Next SDRAM Access */
1382#define SRFS 0x01000000 /* Enable SDRAM Self-Refresh Mode */
1383#define EBUFE 0x02000000 /* Enable External Buffering Timing */
1384#define FBBRW 0x04000000 /* Enable Fast Back-To-Back Read To Write */
1385#define EMREN 0x10000000 /* Extended Mode Register Enable */
1386#define TCSR 0x20000000 /* Temp-Compensated Self-Refresh Value (85/45* Deg C) */
1387#define CDDBG 0x40000000 /* Tristate SDRAM Controls During Bus Grant */
1388
1389/* EBIU_SDBCTL Masks */
1390#define EBE 0x0001 /* Enable SDRAM External Bank */
1391#define EBSZ_16 0x0000 /* SDRAM External Bank Size = 16MB */
1392#define EBSZ_32 0x0002 /* SDRAM External Bank Size = 32MB */
1393#define EBSZ_64 0x0004 /* SDRAM External Bank Size = 64MB */
1394#define EBSZ_128 0x0006 /* SDRAM External Bank Size = 128MB */
1395#define EBSZ_256 0x0008 /* SDRAM External Bank Size = 256MB */
1396#define EBSZ_512 0x000A /* SDRAM External Bank Size = 512MB */
1397#define EBCAW_8 0x0000 /* SDRAM External Bank Column Address Width = 8 Bits */
1398#define EBCAW_9 0x0010 /* SDRAM External Bank Column Address Width = 9 Bits */
1399#define EBCAW_10 0x0020 /* SDRAM External Bank Column Address Width = 10 Bits */
1400#define EBCAW_11 0x0030 /* SDRAM External Bank Column Address Width = 11 Bits */
1401
1402/* EBIU_SDSTAT Masks */
1403#define SDCI 0x0001 /* SDRAM Controller Idle */
1404#define SDSRA 0x0002 /* SDRAM Self-Refresh Active */
1405#define SDPUA 0x0004 /* SDRAM Power-Up Active */
1406#define SDRS 0x0008 /* SDRAM Will Power-Up On Next Access */
1407#define SDEASE 0x0010 /* SDRAM EAB Sticky Error Status */
1408#define BGSTAT 0x0020 /* Bus Grant Status */
1409
1410
1411/* ************************** DMA CONTROLLER MASKS ********************************/
1412/* DMAx_CONFIG, MDMA_yy_CONFIG Masks */
1413#define DMAEN 0x0001 /* DMA Channel Enable */
1414#define WNR 0x0002 /* Channel Direction (W/R*) */
1415#define WDSIZE_8 0x0000 /* Transfer Word Size = 8 */
1416#define WDSIZE_16 0x0004 /* Transfer Word Size = 16 */
1417#define WDSIZE_32 0x0008 /* Transfer Word Size = 32 */
1418#define DMA2D 0x0010 /* DMA Mode (2D/1D*) */
1419#define RESTART 0x0020 /* DMA Buffer Clear */
1420#define DI_SEL 0x0040 /* Data Interrupt Timing Select */
1421#define DI_EN 0x0080 /* Data Interrupt Enable */
1422#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
1423#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
1424#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
1425#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
1426#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
1427#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
1428#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
1429#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
1430#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
1431#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
1432#define NDSIZE 0x0900 /* Next Descriptor Size */
1433#define DMAFLOW 0x7000 /* Flow Control */
1434#define DMAFLOW_STOP 0x0000 /* Stop Mode */
1435#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
1436#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
1437#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
1438#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
1439
1440/* DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP Masks */
1441#define CTYPE 0x0040 /* DMA Channel Type Indicator (Memory/Peripheral*) */
1442#define PMAP 0xF000 /* Peripheral Mapped To This Channel */
1443#define PMAP_PPI 0x0000 /* PPI Port DMA */
1444#define PMAP_EMACRX 0x1000 /* Ethernet Receive DMA */
1445#define PMAP_EMACTX 0x2000 /* Ethernet Transmit DMA */
1446#define PMAP_SPORT0RX 0x3000 /* SPORT0 Receive DMA */
1447#define PMAP_SPORT0TX 0x4000 /* SPORT0 Transmit DMA */
1448#define PMAP_SPORT1RX 0x5000 /* SPORT1 Receive DMA */
1449#define PMAP_SPORT1TX 0x6000 /* SPORT1 Transmit DMA */
1450#define PMAP_SPI 0x7000 /* SPI Port DMA */
1451#define PMAP_UART0RX 0x8000 /* UART0 Port Receive DMA */
1452#define PMAP_UART0TX 0x9000 /* UART0 Port Transmit DMA */
1453#define PMAP_UART1RX 0xA000 /* UART1 Port Receive DMA */
1454#define PMAP_UART1TX 0xB000 /* UART1 Port Transmit DMA */
1455
1456/* DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS Masks */
1457#define DMA_DONE 0x0001 /* DMA Completion Interrupt Status */
1458#define DMA_ERR 0x0002 /* DMA Error Interrupt Status */
1459#define DFETCH 0x0004 /* DMA Descriptor Fetch Indicator */
1460#define DMA_RUN 0x0008 /* DMA Channel Running Indicator */
1461
1462
1463/* ************ PARALLEL PERIPHERAL INTERFACE (PPI) MASKS *************/
1464/* PPI_CONTROL Masks */
1465#define PORT_EN 0x0001 /* PPI Port Enable */
1466#define PORT_DIR 0x0002 /* PPI Port Direction */
1467#define XFR_TYPE 0x000C /* PPI Transfer Type */
1468#define PORT_CFG 0x0030 /* PPI Port Configuration */
1469#define FLD_SEL 0x0040 /* PPI Active Field Select */
1470#define PACK_EN 0x0080 /* PPI Packing Mode */
1471#define DMA32 0x0100 /* PPI 32-bit DMA Enable */
1472#define SKIP_EN 0x0200 /* PPI Skip Element Enable */
1473#define SKIP_EO 0x0400 /* PPI Skip Even/Odd Elements */
1474#define DLEN_8 0x0000 /* Data Length = 8 Bits */
1475#define DLEN_10 0x0800 /* Data Length = 10 Bits */
1476#define DLEN_11 0x1000 /* Data Length = 11 Bits */
1477#define DLEN_12 0x1800 /* Data Length = 12 Bits */
1478#define DLEN_13 0x2000 /* Data Length = 13 Bits */
1479#define DLEN_14 0x2800 /* Data Length = 14 Bits */
1480#define DLEN_15 0x3000 /* Data Length = 15 Bits */
1481#define DLEN_16 0x3800 /* Data Length = 16 Bits */
1482#define DLENGTH 0x3800 /* PPI Data Length */
1483#define POLC 0x4000 /* PPI Clock Polarity */
1484#define POLS 0x8000 /* PPI Frame Sync Polarity */
1485
1486/* PPI_STATUS Masks */
1487#define FLD 0x0400 /* Field Indicator */
1488#define FT_ERR 0x0800 /* Frame Track Error */
1489#define OVR 0x1000 /* FIFO Overflow Error */
1490#define UNDR 0x2000 /* FIFO Underrun Error */
1491#define ERR_DET 0x4000 /* Error Detected Indicator */
1492#define ERR_NCOR 0x8000 /* Error Not Corrected Indicator */
1493
1494
1495/* ******************** TWO-WIRE INTERFACE (TWI) MASKS ***********************/
1496/* TWI_CLKDIV Macros (Use: *pTWI_CLKDIV = CLKLOW(x)|CLKHI(y); ) */
1497#define CLKLOW(x) ((x) & 0xFF) /* Periods Clock Is Held Low */
1498#define CLKHI(y) (((y)&0xFF)<<0x8) /* Periods Before New Clock Low */
1499
1500/* TWI_PRESCALE Masks */
1501#define PRESCALE 0x007F /* SCLKs Per Internal Time Reference (10MHz) */
1502#define TWI_ENA 0x0080 /* TWI Enable */
1503#define SCCB 0x0200 /* SCCB Compatibility Enable */
1504
1505/* TWI_SLAVE_CTRL Masks */
1506#define SEN 0x0001 /* Slave Enable */
1507#define SADD_LEN 0x0002 /* Slave Address Length */
1508#define STDVAL 0x0004 /* Slave Transmit Data Valid */
1509#define NAK 0x0008 /* NAK/ACK* Generated At Conclusion Of Transfer */
1510#define GEN 0x0010 /* General Call Adrress Matching Enabled */
1511
1512/* TWI_SLAVE_STAT Masks */
1513#define SDIR 0x0001 /* Slave Transfer Direction (Transmit/Receive*) */
1514#define GCALL 0x0002 /* General Call Indicator */
1515
1516/* TWI_MASTER_CTRL Masks */
1517#define MEN 0x0001 /* Master Mode Enable */
1518#define MADD_LEN 0x0002 /* Master Address Length */
1519#define MDIR 0x0004 /* Master Transmit Direction (RX/TX*) */
1520#define FAST 0x0008 /* Use Fast Mode Timing Specs */
1521#define STOP 0x0010 /* Issue Stop Condition */
1522#define RSTART 0x0020 /* Repeat Start or Stop* At End Of Transfer */
1523#define DCNT 0x3FC0 /* Data Bytes To Transfer */
1524#define SDAOVR 0x4000 /* Serial Data Override */
1525#define SCLOVR 0x8000 /* Serial Clock Override */
1526
1527/* TWI_MASTER_STAT Masks */
1528#define MPROG 0x0001 /* Master Transfer In Progress */
1529#define LOSTARB 0x0002 /* Lost Arbitration Indicator (Xfer Aborted) */
1530#define ANAK 0x0004 /* Address Not Acknowledged */
1531#define DNAK 0x0008 /* Data Not Acknowledged */
1532#define BUFRDERR 0x0010 /* Buffer Read Error */
1533#define BUFWRERR 0x0020 /* Buffer Write Error */
1534#define SDASEN 0x0040 /* Serial Data Sense */
1535#define SCLSEN 0x0080 /* Serial Clock Sense */
1536#define BUSBUSY 0x0100 /* Bus Busy Indicator */
1537
1538/* TWI_INT_SRC and TWI_INT_ENABLE Masks */
1539#define SINIT 0x0001 /* Slave Transfer Initiated */
1540#define SCOMP 0x0002 /* Slave Transfer Complete */
1541#define SERR 0x0004 /* Slave Transfer Error */
1542#define SOVF 0x0008 /* Slave Overflow */
1543#define MCOMP 0x0010 /* Master Transfer Complete */
1544#define MERR 0x0020 /* Master Transfer Error */
1545#define XMTSERV 0x0040 /* Transmit FIFO Service */
1546#define RCVSERV 0x0080 /* Receive FIFO Service */
1547
1548/* TWI_FIFO_CTRL Masks */
1549#define XMTFLUSH 0x0001 /* Transmit Buffer Flush */
1550#define RCVFLUSH 0x0002 /* Receive Buffer Flush */
1551#define XMTINTLEN 0x0004 /* Transmit Buffer Interrupt Length */
1552#define RCVINTLEN 0x0008 /* Receive Buffer Interrupt Length */
1553
1554/* TWI_FIFO_STAT Masks */
1555#define XMTSTAT 0x0003 /* Transmit FIFO Status */
1556#define XMT_EMPTY 0x0000 /* Transmit FIFO Empty */
1557#define XMT_HALF 0x0001 /* Transmit FIFO Has 1 Byte To Write */
1558#define XMT_FULL 0x0003 /* Transmit FIFO Full (2 Bytes To Write) */
1559
1560#define RCVSTAT 0x000C /* Receive FIFO Status */
1561#define RCV_EMPTY 0x0000 /* Receive FIFO Empty */
1562#define RCV_HALF 0x0004 /* Receive FIFO Has 1 Byte To Read */
1563#define RCV_FULL 0x000C /* Receive FIFO Full (2 Bytes To Read) */
1564
1565
1566/* Omit CAN masks from defBF534.h */
1567
1568/* ******************* PIN CONTROL REGISTER MASKS ************************/
1569/* PORT_MUX Masks */
1570#define PJSE 0x0001 /* Port J SPI/SPORT Enable */
1571#define PJSE_SPORT 0x0000 /* Enable TFS0/DT0PRI */
1572#define PJSE_SPI 0x0001 /* Enable SPI_SSEL3:2 */
1573
1574#define PJCE(x) (((x)&0x3)<<1) /* Port J CAN/SPI/SPORT Enable */
1575#define PJCE_SPORT 0x0000 /* Enable DR0SEC/DT0SEC */
1576#define PJCE_CAN 0x0002 /* Enable CAN RX/TX */
1577#define PJCE_SPI 0x0004 /* Enable SPI_SSEL7 */
1578
1579#define PFDE 0x0008 /* Port F DMA Request Enable */
1580#define PFDE_UART 0x0000 /* Enable UART0 RX/TX */
1581#define PFDE_DMA 0x0008 /* Enable DMAR1:0 */
1582
1583#define PFTE 0x0010 /* Port F Timer Enable */
1584#define PFTE_UART 0x0000 /* Enable UART1 RX/TX */
1585#define PFTE_TIMER 0x0010 /* Enable TMR7:6 */
1586
1587#define PFS6E 0x0020 /* Port F SPI SSEL 6 Enable */
1588#define PFS6E_TIMER 0x0000 /* Enable TMR5 */
1589#define PFS6E_SPI 0x0020 /* Enable SPI_SSEL6 */
1590
1591#define PFS5E 0x0040 /* Port F SPI SSEL 5 Enable */
1592#define PFS5E_TIMER 0x0000 /* Enable TMR4 */
1593#define PFS5E_SPI 0x0040 /* Enable SPI_SSEL5 */
1594
1595#define PFS4E 0x0080 /* Port F SPI SSEL 4 Enable */
1596#define PFS4E_TIMER 0x0000 /* Enable TMR3 */
1597#define PFS4E_SPI 0x0080 /* Enable SPI_SSEL4 */
1598
1599#define PFFE 0x0100 /* Port F PPI Frame Sync Enable */
1600#define PFFE_TIMER 0x0000 /* Enable TMR2 */
1601#define PFFE_PPI 0x0100 /* Enable PPI FS3 */
1602
1603#define PGSE 0x0200 /* Port G SPORT1 Secondary Enable */
1604#define PGSE_PPI 0x0000 /* Enable PPI D9:8 */
1605#define PGSE_SPORT 0x0200 /* Enable DR1SEC/DT1SEC */
1606
1607#define PGRE 0x0400 /* Port G SPORT1 Receive Enable */
1608#define PGRE_PPI 0x0000 /* Enable PPI D12:10 */
1609#define PGRE_SPORT 0x0400 /* Enable DR1PRI/RFS1/RSCLK1 */
1610
1611#define PGTE 0x0800 /* Port G SPORT1 Transmit Enable */
1612#define PGTE_PPI 0x0000 /* Enable PPI D15:13 */
1613#define PGTE_SPORT 0x0800 /* Enable DT1PRI/TFS1/TSCLK1 */
1614
1615
1616/* ****************** HANDSHAKE DMA (HDMA) MASKS *********************/
1617/* HDMAx_CTL Masks */
1618#define HMDMAEN 0x0001 /* Enable Handshake DMA 0/1 */
1619#define REP 0x0002 /* HDMA Request Polarity */
1620#define UTE 0x0004 /* Urgency Threshold Enable */
1621#define OIE 0x0010 /* Overflow Interrupt Enable */
1622#define BDIE 0x0020 /* Block Done Interrupt Enable */
1623#define MBDI 0x0040 /* Mask Block Done IRQ If Pending ECNT */
1624#define DRQ 0x0300 /* HDMA Request Type */
1625#define DRQ_NONE 0x0000 /* No Request */
1626#define DRQ_SINGLE 0x0100 /* Channels Request Single */
1627#define DRQ_MULTI 0x0200 /* Channels Request Multi (Default) */
1628#define DRQ_URGENT 0x0300 /* Channels Request Multi Urgent */
1629#define RBC 0x1000 /* Reload BCNT With IBCNT */
1630#define PS 0x2000 /* HDMA Pin Status */
1631#define OI 0x4000 /* Overflow Interrupt Generated */
1632#define BDI 0x8000 /* Block Done Interrupt Generated */
1633
1634/* entry addresses of the user-callable Boot ROM functions */
1635
1636#define _BOOTROM_RESET 0xEF000000
1637#define _BOOTROM_FINAL_INIT 0xEF000002
1638#define _BOOTROM_DO_MEMORY_DMA 0xEF000006
1639#define _BOOTROM_BOOT_DXE_FLASH 0xEF000008
1640#define _BOOTROM_BOOT_DXE_SPI 0xEF00000A
1641#define _BOOTROM_BOOT_DXE_TWI 0xEF00000C
1642#define _BOOTROM_GET_DXE_ADDRESS_FLASH 0xEF000010
1643#define _BOOTROM_GET_DXE_ADDRESS_SPI 0xEF000012
1644#define _BOOTROM_GET_DXE_ADDRESS_TWI 0xEF000014
1645
1646/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
1647#define PGDE_UART PFDE_UART
1648#define PGDE_DMA PFDE_DMA
1649#define CKELOW SCKELOW
1650
1651/* ==== end from defBF534.h ==== */
1652
1653/* HOST Port Registers */
1654
1655#define HOST_CONTROL 0xffc03400 /* HOST Control Register */
1656#define HOST_STATUS 0xffc03404 /* HOST Status Register */
1657#define HOST_TIMEOUT 0xffc03408 /* HOST Acknowledge Mode Timeout Register */
1658
1659/* Counter Registers */
1660
1661#define CNT_CONFIG 0xffc03500 /* Configuration Register */
1662#define CNT_IMASK 0xffc03504 /* Interrupt Mask Register */
1663#define CNT_STATUS 0xffc03508 /* Status Register */
1664#define CNT_COMMAND 0xffc0350c /* Command Register */
1665#define CNT_DEBOUNCE 0xffc03510 /* Debounce Register */
1666#define CNT_COUNTER 0xffc03514 /* Counter Register */
1667#define CNT_MAX 0xffc03518 /* Maximal Count Register */
1668#define CNT_MIN 0xffc0351c /* Minimal Count Register */
1669
1670/* OTP/FUSE Registers */
1671
1672#define OTP_CONTROL 0xffc03600 /* OTP/Fuse Control Register */
1673#define OTP_BEN 0xffc03604 /* OTP/Fuse Byte Enable */
1674#define OTP_STATUS 0xffc03608 /* OTP/Fuse Status */
1675#define OTP_TIMING 0xffc0360c /* OTP/Fuse Access Timing */
1676
1677/* Security Registers */
1678
1679#define SECURE_SYSSWT 0xffc03620 /* Secure System Switches */
1680#define SECURE_CONTROL 0xffc03624 /* Secure Control */
1681#define SECURE_STATUS 0xffc03628 /* Secure Status */
1682
1683/* OTP Read/Write Data Buffer Registers */
1684
1685#define OTP_DATA0 0xffc03680 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1686#define OTP_DATA1 0xffc03684 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1687#define OTP_DATA2 0xffc03688 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1688#define OTP_DATA3 0xffc0368c /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1689
1690/* NFC Registers */
1691
1692#define NFC_CTL 0xffc03700 /* NAND Control Register */
1693#define NFC_STAT 0xffc03704 /* NAND Status Register */
1694#define NFC_IRQSTAT 0xffc03708 /* NAND Interrupt Status Register */
1695#define NFC_IRQMASK 0xffc0370c /* NAND Interrupt Mask Register */
1696#define NFC_ECC0 0xffc03710 /* NAND ECC Register 0 */
1697#define NFC_ECC1 0xffc03714 /* NAND ECC Register 1 */
1698#define NFC_ECC2 0xffc03718 /* NAND ECC Register 2 */
1699#define NFC_ECC3 0xffc0371c /* NAND ECC Register 3 */
1700#define NFC_COUNT 0xffc03720 /* NAND ECC Count Register */
1701#define NFC_RST 0xffc03724 /* NAND ECC Reset Register */
1702#define NFC_PGCTL 0xffc03728 /* NAND Page Control Register */
1703#define NFC_READ 0xffc0372c /* NAND Read Data Register */
1704#define NFC_ADDR 0xffc03740 /* NAND Address Register */
1705#define NFC_CMD 0xffc03744 /* NAND Command Register */
1706#define NFC_DATA_WR 0xffc03748 /* NAND Data Write Register */
1707#define NFC_DATA_RD 0xffc0374c /* NAND Data Read Register */
1708
1709/* ********************************************************** */
1710/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
1711/* and MULTI BIT READ MACROS */
1712/* ********************************************************** */
1713
1714/* Bit masks for HOST_CONTROL */
1715
1716#define HOST_EN 0x1 /* Host Enable */
1717#define nHOST_EN 0x0
1718#define HOST_END 0x2 /* Host Endianess */
1719#define nHOST_END 0x0
1720#define DATA_SIZE 0x4 /* Data Size */
1721#define nDATA_SIZE 0x0
1722#define HOST_RST 0x8 /* Host Reset */
1723#define nHOST_RST 0x0
1724#define HRDY_OVR 0x20 /* Host Ready Override */
1725#define nHRDY_OVR 0x0
1726#define INT_MODE 0x40 /* Interrupt Mode */
1727#define nINT_MODE 0x0
1728#define BT_EN 0x80 /* Bus Timeout Enable */
1729#define nBT_EN 0x0
1730#define EHW 0x100 /* Enable Host Write */
1731#define nEHW 0x0
1732#define EHR 0x200 /* Enable Host Read */
1733#define nEHR 0x0
1734#define BDR 0x400 /* Burst DMA Requests */
1735#define nBDR 0x0
1736
1737/* Bit masks for HOST_STATUS */
1738
1739#define READY 0x1 /* DMA Ready */
1740#define nREADY 0x0
1741#define FIFOFULL 0x2 /* FIFO Full */
1742#define nFIFOFULL 0x0
1743#define FIFOEMPTY 0x4 /* FIFO Empty */
1744#define nFIFOEMPTY 0x0
1745#define COMPLETE 0x8 /* DMA Complete */
1746#define nCOMPLETE 0x0
1747#define HSHK 0x10 /* Host Handshake */
1748#define nHSHK 0x0
1749#define TIMEOUT 0x20 /* Host Timeout */
1750#define nTIMEOUT 0x0
1751#define HIRQ 0x40 /* Host Interrupt Request */
1752#define nHIRQ 0x0
1753#define ALLOW_CNFG 0x80 /* Allow New Configuration */
1754#define nALLOW_CNFG 0x0
1755#define DMA_DIR 0x100 /* DMA Direction */
1756#define nDMA_DIR 0x0
1757#define BTE 0x200 /* Bus Timeout Enabled */
1758#define nBTE 0x0
1759#define HOSTRD_DONE 0x8000 /* Host Read Completion Interrupt */
1760#define nHOSTRD_DONE 0x0
1761
1762/* Bit masks for HOST_TIMEOUT */
1763
1764#define COUNT_TIMEOUT 0x7ff /* Host Timeout count */
1765
1766/* Bit masks for CNT_CONFIG */
1767
1768#define CNTE 0x1 /* Counter Enable */
1769#define nCNTE 0x0
1770#define DEBE 0x2 /* Debounce Enable */
1771#define nDEBE 0x0
1772#define CDGINV 0x10 /* CDG Pin Polarity Invert */
1773#define nCDGINV 0x0
1774#define CUDINV 0x20 /* CUD Pin Polarity Invert */
1775#define nCUDINV 0x0
1776#define CZMINV 0x40 /* CZM Pin Polarity Invert */
1777#define nCZMINV 0x0
1778#define CNTMODE 0x700 /* Counter Operating Mode */
1779#define ZMZC 0x800 /* CZM Zeroes Counter Enable */
1780#define nZMZC 0x0
1781#define BNDMODE 0x3000 /* Boundary register Mode */
1782#define INPDIS 0x8000 /* CUG and CDG Input Disable */
1783#define nINPDIS 0x0
1784
1785/* Bit masks for CNT_IMASK */
1786
1787#define ICIE 0x1 /* Illegal Gray/Binary Code Interrupt Enable */
1788#define nICIE 0x0
1789#define UCIE 0x2 /* Up count Interrupt Enable */
1790#define nUCIE 0x0
1791#define DCIE 0x4 /* Down count Interrupt Enable */
1792#define nDCIE 0x0
1793#define MINCIE 0x8 /* Min Count Interrupt Enable */
1794#define nMINCIE 0x0
1795#define MAXCIE 0x10 /* Max Count Interrupt Enable */
1796#define nMAXCIE 0x0
1797#define COV31IE 0x20 /* Bit 31 Overflow Interrupt Enable */
1798#define nCOV31IE 0x0
1799#define COV15IE 0x40 /* Bit 15 Overflow Interrupt Enable */
1800#define nCOV15IE 0x0
1801#define CZEROIE 0x80 /* Count to Zero Interrupt Enable */
1802#define nCZEROIE 0x0
1803#define CZMIE 0x100 /* CZM Pin Interrupt Enable */
1804#define nCZMIE 0x0
1805#define CZMEIE 0x200 /* CZM Error Interrupt Enable */
1806#define nCZMEIE 0x0
1807#define CZMZIE 0x400 /* CZM Zeroes Counter Interrupt Enable */
1808#define nCZMZIE 0x0
1809
1810/* Bit masks for CNT_STATUS */
1811
1812#define ICII 0x1 /* Illegal Gray/Binary Code Interrupt Identifier */
1813#define nICII 0x0
1814#define UCII 0x2 /* Up count Interrupt Identifier */
1815#define nUCII 0x0
1816#define DCII 0x4 /* Down count Interrupt Identifier */
1817#define nDCII 0x0
1818#define MINCII 0x8 /* Min Count Interrupt Identifier */
1819#define nMINCII 0x0
1820#define MAXCII 0x10 /* Max Count Interrupt Identifier */
1821#define nMAXCII 0x0
1822#define COV31II 0x20 /* Bit 31 Overflow Interrupt Identifier */
1823#define nCOV31II 0x0
1824#define COV15II 0x40 /* Bit 15 Overflow Interrupt Identifier */
1825#define nCOV15II 0x0
1826#define CZEROII 0x80 /* Count to Zero Interrupt Identifier */
1827#define nCZEROII 0x0
1828#define CZMII 0x100 /* CZM Pin Interrupt Identifier */
1829#define nCZMII 0x0
1830#define CZMEII 0x200 /* CZM Error Interrupt Identifier */
1831#define nCZMEII 0x0
1832#define CZMZII 0x400 /* CZM Zeroes Counter Interrupt Identifier */
1833#define nCZMZII 0x0
1834
1835/* Bit masks for CNT_COMMAND */
1836
1837#define W1LCNT 0xf /* Load Counter Register */
1838#define W1LMIN 0xf0 /* Load Min Register */
1839#define W1LMAX 0xf00 /* Load Max Register */
1840#define W1ZMONCE 0x1000 /* Enable CZM Clear Counter Once */
1841#define nW1ZMONCE 0x0
1842
1843/* Bit masks for CNT_DEBOUNCE */
1844
1845#define DPRESCALE 0xf /* Load Counter Register */
1846
1847/* Bit masks for OTP_CONTROL */
1848
1849#define FUSE_FADDR 0x1ff /* OTP/Fuse Address */
1850#define FIEN 0x800 /* OTP/Fuse Interrupt Enable */
1851#define nFIEN 0x0
1852#define FTESTDEC 0x1000 /* OTP/Fuse Test Decoder */
1853#define nFTESTDEC 0x0
1854#define FWRTEST 0x2000 /* OTP/Fuse Write Test */
1855#define nFWRTEST 0x0
1856#define FRDEN 0x4000 /* OTP/Fuse Read Enable */
1857#define nFRDEN 0x0
1858#define FWREN 0x8000 /* OTP/Fuse Write Enable */
1859#define nFWREN 0x0
1860
1861/* Bit masks for OTP_BEN */
1862
1863#define FBEN 0xffff /* OTP/Fuse Byte Enable */
1864
1865/* Bit masks for OTP_STATUS */
1866
1867#define FCOMP 0x1 /* OTP/Fuse Access Complete */
1868#define nFCOMP 0x0
1869#define FERROR 0x2 /* OTP/Fuse Access Error */
1870#define nFERROR 0x0
1871#define MMRGLOAD 0x10 /* Memory Mapped Register Gasket Load */
1872#define nMMRGLOAD 0x0
1873#define MMRGLOCK 0x20 /* Memory Mapped Register Gasket Lock */
1874#define nMMRGLOCK 0x0
1875#define FPGMEN 0x40 /* OTP/Fuse Program Enable */
1876#define nFPGMEN 0x0
1877
1878/* Bit masks for OTP_TIMING */
1879
1880#define USECDIV 0xff /* Micro Second Divider */
1881#define READACC 0x7f00 /* Read Access Time */
1882#define CPUMPRL 0x38000 /* Charge Pump Release Time */
1883#define CPUMPSU 0xc0000 /* Charge Pump Setup Time */
1884#define CPUMPHD 0xf00000 /* Charge Pump Hold Time */
1885#define PGMTIME 0xff000000 /* Program Time */
1886
1887/* Bit masks for SECURE_SYSSWT */
1888
1889#define EMUDABL 0x1 /* Emulation Disable. */
1890#define nEMUDABL 0x0
1891#define RSTDABL 0x2 /* Reset Disable */
1892#define nRSTDABL 0x0
1893#define L1IDABL 0x1c /* L1 Instruction Memory Disable. */
1894#define L1DADABL 0xe0 /* L1 Data Bank A Memory Disable. */
1895#define L1DBDABL 0x700 /* L1 Data Bank B Memory Disable. */
1896#define DMA0OVR 0x800 /* DMA0 Memory Access Override */
1897#define nDMA0OVR 0x0
1898#define DMA1OVR 0x1000 /* DMA1 Memory Access Override */
1899#define nDMA1OVR 0x0
1900#define EMUOVR 0x4000 /* Emulation Override */
1901#define nEMUOVR 0x0
1902#define OTPSEN 0x8000 /* OTP Secrets Enable. */
1903#define nOTPSEN 0x0
1904#define L2DABL 0x70000 /* L2 Memory Disable. */
1905
1906/* Bit masks for SECURE_CONTROL */
1907
1908#define SECURE0 0x1 /* SECURE 0 */
1909#define nSECURE0 0x0
1910#define SECURE1 0x2 /* SECURE 1 */
1911#define nSECURE1 0x0
1912#define SECURE2 0x4 /* SECURE 2 */
1913#define nSECURE2 0x0
1914#define SECURE3 0x8 /* SECURE 3 */
1915#define nSECURE3 0x0
1916
1917/* Bit masks for SECURE_STATUS */
1918
1919#define SECMODE 0x3 /* Secured Mode Control State */
1920#define NMI 0x4 /* Non Maskable Interrupt */
1921#define nNMI 0x0
1922#define AFVALID 0x8 /* Authentication Firmware Valid */
1923#define nAFVALID 0x0
1924#define AFEXIT 0x10 /* Authentication Firmware Exit */
1925#define nAFEXIT 0x0
1926#define SECSTAT 0xe0 /* Secure Status */
1927
1928/* Bit masks for NFC_CTL */
1929
1930#define WR_DLY 0xf /* Write Strobe Delay */
1931#define RD_DLY 0xf0 /* Read Strobe Delay */
1932#define NWIDTH 0x100 /* NAND Data Width */
1933#define nNWIDTH 0x0
1934#define PG_SIZE 0x200 /* Page Size */
1935#define nPG_SIZE 0x0
1936
1937/* Bit masks for NFC_STAT */
1938
1939#define NBUSY 0x1 /* Not Busy */
1940#define nNBUSY 0x0
1941#define WB_FULL 0x2 /* Write Buffer Full */
1942#define nWB_FULL 0x0
1943#define PG_WR_STAT 0x4 /* Page Write Pending */
1944#define nPG_WR_STAT 0x0
1945#define PG_RD_STAT 0x8 /* Page Read Pending */
1946#define nPG_RD_STAT 0x0
1947#define WB_EMPTY 0x10 /* Write Buffer Empty */
1948#define nWB_EMPTY 0x0
1949
1950/* Bit masks for NFC_IRQSTAT */
1951
1952#define NBUSYIRQ 0x1 /* Not Busy IRQ */
1953#define nNBUSYIRQ 0x0
1954#define WB_OVF 0x2 /* Write Buffer Overflow */
1955#define nWB_OVF 0x0
1956#define WB_EDGE 0x4 /* Write Buffer Edge Detect */
1957#define nWB_EDGE 0x0
1958#define RD_RDY 0x8 /* Read Data Ready */
1959#define nRD_RDY 0x0
1960#define WR_DONE 0x10 /* Page Write Done */
1961#define nWR_DONE 0x0
1962
1963/* Bit masks for NFC_IRQMASK */
1964
1965#define MASK_BUSYIRQ 0x1 /* Mask Not Busy IRQ */
1966#define nMASK_BUSYIRQ 0x0
1967#define MASK_WBOVF 0x2 /* Mask Write Buffer Overflow */
1968#define nMASK_WBOVF 0x0
1969#define MASK_WBEMPTY 0x4 /* Mask Write Buffer Empty */
1970#define nMASK_WBEMPTY 0x0
1971#define MASK_RDRDY 0x8 /* Mask Read Data Ready */
1972#define nMASK_RDRDY 0x0
1973#define MASK_WRDONE 0x10 /* Mask Write Done */
1974#define nMASK_WRDONE 0x0
1975
1976/* Bit masks for NFC_RST */
1977
1978#define ECC_RST 0x1 /* ECC (and NFC counters) Reset */
1979#define nECC_RST 0x0
1980
1981/* Bit masks for NFC_PGCTL */
1982
1983#define PG_RD_START 0x1 /* Page Read Start */
1984#define nPG_RD_START 0x0
1985#define PG_WR_START 0x2 /* Page Write Start */
1986#define nPG_WR_START 0x0
1987
1988/* Bit masks for NFC_ECC0 */
1989
1990#define ECC0 0x7ff /* Parity Calculation Result0 */
1991
1992/* Bit masks for NFC_ECC1 */
1993
1994#define ECC1 0x7ff /* Parity Calculation Result1 */
1995
1996/* Bit masks for NFC_ECC2 */
1997
1998#define ECC2 0x7ff /* Parity Calculation Result2 */
1999
2000/* Bit masks for NFC_ECC3 */
2001
2002#define ECC3 0x7ff /* Parity Calculation Result3 */
2003
2004/* Bit masks for NFC_COUNT */
2005
2006#define ECCCNT 0x3ff /* Transfer Count */
2007
2008
2009#endif /* _DEF_BF52X_H */
diff --git a/include/asm-blackfin/mach-bf533/cdefBF532.h b/include/asm-blackfin/mach-bf533/cdefBF532.h
index 1d7c494ceb64..74f967b235e2 100644
--- a/include/asm-blackfin/mach-bf533/cdefBF532.h
+++ b/include/asm-blackfin/mach-bf533/cdefBF532.h
@@ -51,10 +51,6 @@
51#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT) 51#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
52#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val) 52#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val)
53#define bfin_read_CHIPID() bfin_read32(CHIPID) 53#define bfin_read_CHIPID() bfin_read32(CHIPID)
54#define bfin_read_SWRST() bfin_read16(SWRST)
55#define bfin_write_SWRST(val) bfin_write16(SWRST,val)
56#define bfin_read_SYSCR() bfin_read16(SYSCR)
57#define bfin_write_SYSCR(val) bfin_write16(SYSCR,val)
58#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV) 54#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
59#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val) 55#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
60#define bfin_read_VR_CTL() bfin_read16(VR_CTL) 56#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
@@ -63,12 +59,14 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
63{ 59{
64 unsigned long flags, iwr; 60 unsigned long flags, iwr;
65 61
66 bfin_write16(VR_CTL, val);
67 __builtin_bfin_ssync();
68 /* Enable the PLL Wakeup bit in SIC IWR */ 62 /* Enable the PLL Wakeup bit in SIC IWR */
69 iwr = bfin_read32(SIC_IWR); 63 iwr = bfin_read32(SIC_IWR);
70 /* Only allow PPL Wakeup) */ 64 /* Only allow PPL Wakeup) */
71 bfin_write32(SIC_IWR, IWR_ENABLE(0)); 65 bfin_write32(SIC_IWR, IWR_ENABLE(0));
66
67 bfin_write16(VR_CTL, val);
68 __builtin_bfin_ssync();
69
72 local_irq_save(flags); 70 local_irq_save(flags);
73 asm("IDLE;"); 71 asm("IDLE;");
74 local_irq_restore(flags); 72 local_irq_restore(flags);
@@ -76,6 +74,10 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
76} 74}
77 75
78/* System Interrupt Controller (0xFFC0 0C00-0xFFC0 0FFF) */ 76/* System Interrupt Controller (0xFFC0 0C00-0xFFC0 0FFF) */
77#define bfin_read_SWRST() bfin_read16(SWRST)
78#define bfin_write_SWRST(val) bfin_write16(SWRST,val)
79#define bfin_read_SYSCR() bfin_read16(SYSCR)
80#define bfin_write_SYSCR(val) bfin_write16(SYSCR,val)
79#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0) 81#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
80#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0,val) 82#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0,val)
81#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1) 83#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
@@ -115,6 +117,18 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
115#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN) 117#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
116#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN,val) 118#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN,val)
117 119
120/* DMA Traffic controls */
121#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
122#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER,val)
123#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
124#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT,val)
125
126/* Alternate deprecated register names (below) provided for backwards code compatibility */
127#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
128#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER,val)
129#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
130#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT,val)
131
118/* General Purpose IO (0xFFC0 2400-0xFFC0 27FF) */ 132/* General Purpose IO (0xFFC0 2400-0xFFC0 27FF) */
119#define bfin_read_FIO_DIR() bfin_read16(FIO_DIR) 133#define bfin_read_FIO_DIR() bfin_read16(FIO_DIR)
120#define bfin_write_FIO_DIR(val) bfin_write16(FIO_DIR,val) 134#define bfin_write_FIO_DIR(val) bfin_write16(FIO_DIR,val)
@@ -151,16 +165,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
151#define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T) 165#define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T)
152#define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val) 166#define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val)
153 167
154/* DMA Traffic controls */
155#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
156#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER,val)
157#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
158#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT,val)
159#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
160#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER,val)
161#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
162#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT,val)
163
164/* DMA Controller */ 168/* DMA Controller */
165#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG) 169#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
166#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val) 170#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val)
diff --git a/include/asm-blackfin/mach-bf533/defBF532.h b/include/asm-blackfin/mach-bf533/defBF532.h
index b240a082aa09..6a3cf93f8b57 100644
--- a/include/asm-blackfin/mach-bf533/defBF532.h
+++ b/include/asm-blackfin/mach-bf533/defBF532.h
@@ -46,11 +46,7 @@
46 46
47#ifndef _DEF_BF532_H 47#ifndef _DEF_BF532_H
48#define _DEF_BF532_H 48#define _DEF_BF532_H
49/* 49
50#if !defined(__ADSPLPBLACKFIN__)
51#warning defBF532.h should only be included for 532 compatible chips
52#endif
53*/
54/* include all Core registers and bit definitions */ 50/* include all Core registers and bit definitions */
55#include <asm/mach-common/def_LPBlackfin.h> 51#include <asm/mach-common/def_LPBlackfin.h>
56 52
@@ -65,10 +61,10 @@
65#define PLL_STAT 0xFFC0000C /* PLL Status register (16-bit) */ 61#define PLL_STAT 0xFFC0000C /* PLL Status register (16-bit) */
66#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count register (16-bit) */ 62#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count register (16-bit) */
67#define CHIPID 0xFFC00014 /* Chip ID Register */ 63#define CHIPID 0xFFC00014 /* Chip ID Register */
68#define SWRST 0xFFC00100 /* Software Reset Register (16-bit) */
69#define SYSCR 0xFFC00104 /* System Configuration registe */
70 64
71/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */ 65/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
66#define SWRST 0xFFC00100 /* Software Reset Register (16-bit) */
67#define SYSCR 0xFFC00104 /* System Configuration registe */
72#define SIC_RVECT 0xFFC00108 /* Interrupt Reset Vector Address Register */ 68#define SIC_RVECT 0xFFC00108 /* Interrupt Reset Vector Address Register */
73#define SIC_IMASK 0xFFC0010C /* Interrupt Mask Register */ 69#define SIC_IMASK 0xFFC0010C /* Interrupt Mask Register */
74#define SIC_IAR0 0xFFC00110 /* Interrupt Assignment Register 0 */ 70#define SIC_IAR0 0xFFC00110 /* Interrupt Assignment Register 0 */
@@ -218,11 +214,13 @@
218#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */ 214#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
219 215
220/* DMA Traffic controls */ 216/* DMA Traffic controls */
221#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */
222#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */
223#define DMA_TC_PER 0xFFC00B0C /* Traffic Control Periods Register */ 217#define DMA_TC_PER 0xFFC00B0C /* Traffic Control Periods Register */
224#define DMA_TC_CNT 0xFFC00B10 /* Traffic Control Current Counts Register */ 218#define DMA_TC_CNT 0xFFC00B10 /* Traffic Control Current Counts Register */
225 219
220/* Alternate deprecated register names (below) provided for backwards code compatibility */
221#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */
222#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */
223
226/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */ 224/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */
227#define DMA0_CONFIG 0xFFC00C08 /* DMA Channel 0 Configuration Register */ 225#define DMA0_CONFIG 0xFFC00C08 /* DMA Channel 0 Configuration Register */
228#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */ 226#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
@@ -407,14 +405,25 @@
407/* ********************* PLL AND RESET MASKS ************************ */ 405/* ********************* PLL AND RESET MASKS ************************ */
408 406
409/* PLL_CTL Masks */ 407/* PLL_CTL Masks */
410#define PLL_CLKIN 0x00000000 /* Pass CLKIN to PLL */ 408#define PLL_CLKIN 0x0000 /* Pass CLKIN to PLL */
411#define PLL_CLKIN_DIV2 0x00000001 /* Pass CLKIN/2 to PLL */ 409#define PLL_CLKIN_DIV2 0x0001 /* Pass CLKIN/2 to PLL */
412#define PLL_OFF 0x00000002 /* Shut off PLL clocks */ 410#define DF 0x0001 /* 0: PLL = CLKIN, 1: PLL = CLKIN/2 */
413#define STOPCK_OFF 0x00000008 /* Core clock off */ 411#define PLL_OFF 0x0002 /* Shut off PLL clocks */
414#define PDWN 0x00000020 /* Put the PLL in a Deep Sleep state */ 412#define STOPCK_OFF 0x0008 /* Core clock off */
415#define BYPASS 0x00000100 /* Bypass the PLL */ 413#define STOPCK 0x0008 /* Core Clock Off */
414#define PDWN 0x0020 /* Put the PLL in a Deep Sleep state */
415#if !defined(__ADSPBF538__)
416/* this file is included in defBF538.h but IN_DELAY/OUT_DELAY are different */
417# define IN_DELAY 0x0040 /* Add 200ps Delay To EBIU Input Latches */
418# define OUT_DELAY 0x0080 /* Add 200ps Delay To EBIU Output Signals */
419#endif
420#define BYPASS 0x0100 /* Bypass the PLL */
421/* PLL_CTL Macros (Only Use With Logic OR While Setting Lower Order Bits) */
422#define SET_MSEL(x) (((x)&0x3F) << 0x9) /* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */
416 423
417/* PLL_DIV Masks */ 424/* PLL_DIV Masks */
425#define SSEL 0x000F /* System Select */
426#define CSEL 0x0030 /* Core Select */
418 427
419#define SCLK_DIV(x) (x) /* SCLK = VCO / x */ 428#define SCLK_DIV(x) (x) /* SCLK = VCO / x */
420 429
@@ -422,6 +431,8 @@
422#define CCLK_DIV2 0x00000010 /* CCLK = VCO / 2 */ 431#define CCLK_DIV2 0x00000010 /* CCLK = VCO / 2 */
423#define CCLK_DIV4 0x00000020 /* CCLK = VCO / 4 */ 432#define CCLK_DIV4 0x00000020 /* CCLK = VCO / 4 */
424#define CCLK_DIV8 0x00000030 /* CCLK = VCO / 8 */ 433#define CCLK_DIV8 0x00000030 /* CCLK = VCO / 8 */
434/* PLL_DIV Macros */
435#define SET_SSEL(x) ((x)&0xF) /* Set SSEL = 0-15 --> SCLK = VCO/SSEL */
425 436
426/* PLL_STAT Masks */ 437/* PLL_STAT Masks */
427#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */ 438#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
@@ -429,13 +440,47 @@
429#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */ 440#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
430#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */ 441#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
431 442
443/* VR_CTL Masks */
444#define FREQ 0x0003 /* Switching Oscillator Frequency For Regulator */
445#define HIBERNATE 0x0000 /* Powerdown/Bypass On-Board Regulation */
446#define FREQ_333 0x0001 /* Switching Frequency Is 333 kHz */
447#define FREQ_667 0x0002 /* Switching Frequency Is 667 kHz */
448#define FREQ_1000 0x0003 /* Switching Frequency Is 1 MHz */
449
450#define GAIN 0x000C /* Voltage Level Gain */
451#define GAIN_5 0x0000 /* GAIN = 5 */
452#define GAIN_10 0x0004 /* GAIN = 10 */
453#define GAIN_20 0x0008 /* GAIN = 20 */
454#define GAIN_50 0x000C /* GAIN = 50 */
455
456#define VLEV 0x00F0 /* Internal Voltage Level */
457#define VLEV_085 0x0060 /* VLEV = 0.85 V (-5% - +10% Accuracy) */
458#define VLEV_090 0x0070 /* VLEV = 0.90 V (-5% - +10% Accuracy) */
459#define VLEV_095 0x0080 /* VLEV = 0.95 V (-5% - +10% Accuracy) */
460#define VLEV_100 0x0090 /* VLEV = 1.00 V (-5% - +10% Accuracy) */
461#define VLEV_105 0x00A0 /* VLEV = 1.05 V (-5% - +10% Accuracy) */
462#define VLEV_110 0x00B0 /* VLEV = 1.10 V (-5% - +10% Accuracy) */
463#define VLEV_115 0x00C0 /* VLEV = 1.15 V (-5% - +10% Accuracy) */
464#define VLEV_120 0x00D0 /* VLEV = 1.20 V (-5% - +10% Accuracy) */
465
466#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */
467#define SCKELOW 0x8000 /* Do Not Drive SCKE High During Reset After Hibernate */
468
432/* CHIPID Masks */ 469/* CHIPID Masks */
433#define CHIPID_VERSION 0xF0000000 470#define CHIPID_VERSION 0xF0000000
434#define CHIPID_FAMILY 0x0FFFF000 471#define CHIPID_FAMILY 0x0FFFF000
435#define CHIPID_MANUFACTURE 0x00000FFE 472#define CHIPID_MANUFACTURE 0x00000FFE
436 473
437/* SWRST Mask */ 474/* SWRST Mask */
438#define SYSTEM_RESET 0x00000007 /* Initiates a system software reset */ 475#define SYSTEM_RESET 0x0007 /* Initiates A System Software Reset */
476#define DOUBLE_FAULT 0x0008 /* Core Double Fault Causes Reset */
477#define RESET_DOUBLE 0x2000 /* SW Reset Generated By Core Double-Fault */
478#define RESET_WDOG 0x4000 /* SW Reset Generated By Watchdog Timer */
479#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */
480
481/* SYSCR Masks */
482#define BMODE 0x0006 /* Boot Mode - Latched During HW Reset From Mode Pins */
483#define NOBOOT 0x0010 /* Execute From L1 or ASYNC Bank 0 When BMODE = 0 */
439 484
440/* ************* SYSTEM INTERRUPT CONTROLLER MASKS ***************** */ 485/* ************* SYSTEM INTERRUPT CONTROLLER MASKS ***************** */
441 486
@@ -483,23 +528,6 @@
483#define IWR_ENABLE(x) (1 << (x)) /* Wakeup Enable Peripheral #x */ 528#define IWR_ENABLE(x) (1 << (x)) /* Wakeup Enable Peripheral #x */
484#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << (x))) /* Wakeup Disable Peripheral #x */ 529#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << (x))) /* Wakeup Disable Peripheral #x */
485 530
486/* ********* WATCHDOG TIMER MASKS ********************8 */
487
488/* Watchdog Timer WDOG_CTL Register */
489#define ICTL(x) ((x<<1) & 0x0006)
490#define ENABLE_RESET 0x00000000 /* Set Watchdog Timer to generate reset */
491#define ENABLE_NMI 0x00000002 /* Set Watchdog Timer to generate non-maskable interrupt */
492#define ENABLE_GPI 0x00000004 /* Set Watchdog Timer to generate general-purpose interrupt */
493#define DISABLE_EVT 0x00000006 /* Disable Watchdog Timer interrupts */
494
495#define TMR_EN 0x0000
496#define TMR_DIS 0x0AD0
497#define TRO 0x8000
498
499#define ICTL_P0 0x01
500#define ICTL_P1 0x02
501#define TRO_P 0x0F
502
503/* ***************************** UART CONTROLLER MASKS ********************** */ 531/* ***************************** UART CONTROLLER MASKS ********************** */
504 532
505/* UART_LCR Register */ 533/* UART_LCR Register */
@@ -583,6 +611,9 @@
583#define TSPEN 0x0001 /* TX enable */ 611#define TSPEN 0x0001 /* TX enable */
584#define ITCLK 0x0002 /* Internal TX Clock Select */ 612#define ITCLK 0x0002 /* Internal TX Clock Select */
585#define TDTYPE 0x000C /* TX Data Formatting Select */ 613#define TDTYPE 0x000C /* TX Data Formatting Select */
614#define DTYPE_NORM 0x0000 /* Data Format Normal */
615#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
616#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
586#define TLSBIT 0x0010 /* TX Bit Order */ 617#define TLSBIT 0x0010 /* TX Bit Order */
587#define ITFS 0x0200 /* Internal TX Frame Sync Select */ 618#define ITFS 0x0200 /* Internal TX Frame Sync Select */
588#define TFSR 0x0400 /* TX Frame Sync Required Select */ 619#define TFSR 0x0400 /* TX Frame Sync Required Select */
@@ -592,7 +623,12 @@
592#define TCKFE 0x4000 /* TX Clock Falling Edge Select */ 623#define TCKFE 0x4000 /* TX Clock Falling Edge Select */
593 624
594/* SPORTx_TCR2 Masks */ 625/* SPORTx_TCR2 Masks */
595#define SLEN 0x001F /*TX Word Length */ 626#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || \
627 defined(__ADSPBF533__)
628# define SLEN 0x001F /*TX Word Length */
629#else
630# define SLEN(x) ((x)&0x1F) /* SPORT TX Word Length (2 - 31) */
631#endif
596#define TXSE 0x0100 /*TX Secondary Enable */ 632#define TXSE 0x0100 /*TX Secondary Enable */
597#define TSFSE 0x0200 /*TX Stereo Frame Sync Enable */ 633#define TSFSE 0x0200 /*TX Stereo Frame Sync Enable */
598#define TRFST 0x0400 /*TX Right-First Data Order */ 634#define TRFST 0x0400 /*TX Right-First Data Order */
@@ -601,8 +637,9 @@
601#define RSPEN 0x0001 /* RX enable */ 637#define RSPEN 0x0001 /* RX enable */
602#define IRCLK 0x0002 /* Internal RX Clock Select */ 638#define IRCLK 0x0002 /* Internal RX Clock Select */
603#define RDTYPE 0x000C /* RX Data Formatting Select */ 639#define RDTYPE 0x000C /* RX Data Formatting Select */
604#define RULAW 0x0008 /* u-Law enable */ 640#define DTYPE_NORM 0x0000 /* no companding */
605#define RALAW 0x000C /* A-Law enable */ 641#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
642#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
606#define RLSBIT 0x0010 /* RX Bit Order */ 643#define RLSBIT 0x0010 /* RX Bit Order */
607#define IRFS 0x0200 /* Internal RX Frame Sync Select */ 644#define IRFS 0x0200 /* Internal RX Frame Sync Select */
608#define RFSR 0x0400 /* RX Frame Sync Required Select */ 645#define RFSR 0x0400 /* RX Frame Sync Required Select */
@@ -611,7 +648,7 @@
611#define RCKFE 0x4000 /* RX Clock Falling Edge Select */ 648#define RCKFE 0x4000 /* RX Clock Falling Edge Select */
612 649
613/* SPORTx_RCR2 Masks */ 650/* SPORTx_RCR2 Masks */
614#define SLEN 0x001F /*RX Word Length */ 651/* SLEN defined above */
615#define RXSE 0x0100 /*RX Secondary Enable */ 652#define RXSE 0x0100 /*RX Secondary Enable */
616#define RSFSE 0x0200 /*RX Stereo Frame Sync Enable */ 653#define RSFSE 0x0200 /*RX Stereo Frame Sync Enable */
617#define RRFST 0x0400 /*Right-First Data Order */ 654#define RRFST 0x0400 /*Right-First Data Order */
@@ -628,14 +665,37 @@
628/*SPORTx_MCMC1 Masks */ 665/*SPORTx_MCMC1 Masks */
629#define SP_WSIZE 0x0000F000 /*Multichannel Window Size Field */ 666#define SP_WSIZE 0x0000F000 /*Multichannel Window Size Field */
630#define SP_WOFF 0x000003FF /*Multichannel Window Offset Field */ 667#define SP_WOFF 0x000003FF /*Multichannel Window Offset Field */
668/* SPORTx_MCMC1 Macros */
669#define SET_SP_WOFF(x) ((x) & 0x3FF) /* Multichannel Window Offset Field */
670/* Only use SET_WSIZE Macro With Logic OR While Setting Lower Order Bits */
671#define SET_SP_WSIZE(x) (((((x)>>0x3)-1)&0xF) << 0xC) /* Multichannel Window Size = (x/8)-1 */
631 672
632/*SPORTx_MCMC2 Masks */ 673/*SPORTx_MCMC2 Masks */
633#define MCCRM 0x00000003 /*Multichannel Clock Recovery Mode */ 674#define MCCRM 0x00000003 /*Multichannel Clock Recovery Mode */
634#define MCDTXPE 0x00000004 /*Multichannel DMA Transmit Packing */ 675#define REC_BYPASS 0x0000 /* Bypass Mode (No Clock Recovery) */
635#define MCDRXPE 0x00000008 /*Multichannel DMA Receive Packing */ 676#define REC_2FROM4 0x0002 /* Recover 2 MHz Clock from 4 MHz Clock */
636#define MCMEN 0x00000010 /*Multichannel Frame Mode Enable */ 677#define REC_8FROM16 0x0003 /* Recover 8 MHz Clock from 16 MHz Clock */
637#define FSDR 0x00000080 /*Multichannel Frame Sync to Data Relationship */ 678#define MCDTXPE 0x00000004 /*Multichannel DMA Transmit Packing */
638#define MFD 0x0000F000 /*Multichannel Frame Delay */ 679#define MCDRXPE 0x00000008 /*Multichannel DMA Receive Packing */
680#define MCMEN 0x00000010 /*Multichannel Frame Mode Enable */
681#define FSDR 0x00000080 /*Multichannel Frame Sync to Data Relationship */
682#define MFD 0x0000F000 /*Multichannel Frame Delay */
683#define MFD_0 0x0000 /* Multichannel Frame Delay = 0 */
684#define MFD_1 0x1000 /* Multichannel Frame Delay = 1 */
685#define MFD_2 0x2000 /* Multichannel Frame Delay = 2 */
686#define MFD_3 0x3000 /* Multichannel Frame Delay = 3 */
687#define MFD_4 0x4000 /* Multichannel Frame Delay = 4 */
688#define MFD_5 0x5000 /* Multichannel Frame Delay = 5 */
689#define MFD_6 0x6000 /* Multichannel Frame Delay = 6 */
690#define MFD_7 0x7000 /* Multichannel Frame Delay = 7 */
691#define MFD_8 0x8000 /* Multichannel Frame Delay = 8 */
692#define MFD_9 0x9000 /* Multichannel Frame Delay = 9 */
693#define MFD_10 0xA000 /* Multichannel Frame Delay = 10 */
694#define MFD_11 0xB000 /* Multichannel Frame Delay = 11 */
695#define MFD_12 0xC000 /* Multichannel Frame Delay = 12 */
696#define MFD_13 0xD000 /* Multichannel Frame Delay = 13 */
697#define MFD_14 0xE000 /* Multichannel Frame Delay = 14 */
698#define MFD_15 0xF000 /* Multichannel Frame Delay = 15 */
639 699
640/* ********* PARALLEL PERIPHERAL INTERFACE (PPI) MASKS **************** */ 700/* ********* PARALLEL PERIPHERAL INTERFACE (PPI) MASKS **************** */
641 701
@@ -660,6 +720,8 @@
660#define DLEN_16 0x3800 /* Data Length = 16 Bits */ 720#define DLEN_16 0x3800 /* Data Length = 16 Bits */
661#define DLEN(x) (((x-9) & 0x07) << 11) /* PPI Data Length (only works for x=10-->x=16) */ 721#define DLEN(x) (((x-9) & 0x07) << 11) /* PPI Data Length (only works for x=10-->x=16) */
662#define POL 0x0000C000 /* PPI Signal Polarities */ 722#define POL 0x0000C000 /* PPI Signal Polarities */
723#define POLC 0x4000 /* PPI Clock Polarity */
724#define POLS 0x8000 /* PPI Frame Sync Polarity */
663 725
664/* PPI_STATUS Masks */ 726/* PPI_STATUS Masks */
665#define FLD 0x00000400 /* Field Indicator */ 727#define FLD 0x00000400 /* Field Indicator */
@@ -729,6 +791,15 @@
729#define PCAPRD 0x00000800 /* DMA Read Operation Indicator */ 791#define PCAPRD 0x00000800 /* DMA Read Operation Indicator */
730#define PMAP 0x00007000 /* DMA Peripheral Map Field */ 792#define PMAP 0x00007000 /* DMA Peripheral Map Field */
731 793
794#define PMAP_PPI 0x0000 /* PMAP PPI Port DMA */
795#define PMAP_SPORT0RX 0x1000 /* PMAP SPORT0 Receive DMA */
796#define PMAP_SPORT0TX 0x2000 /* PMAP SPORT0 Transmit DMA */
797#define PMAP_SPORT1RX 0x3000 /* PMAP SPORT1 Receive DMA */
798#define PMAP_SPORT1TX 0x4000 /* PMAP SPORT1 Transmit DMA */
799#define PMAP_SPI 0x5000 /* PMAP SPI DMA */
800#define PMAP_UARTRX 0x6000 /* PMAP UART Receive DMA */
801#define PMAP_UARTTX 0x7000 /* PMAP UART Transmit DMA */
802
732/* ************* GENERAL PURPOSE TIMER MASKS ******************** */ 803/* ************* GENERAL PURPOSE TIMER MASKS ******************** */
733 804
734/* PWM Timer bit definitions */ 805/* PWM Timer bit definitions */
@@ -755,9 +826,9 @@
755#define TIMIL0 0x0001 826#define TIMIL0 0x0001
756#define TIMIL1 0x0002 827#define TIMIL1 0x0002
757#define TIMIL2 0x0004 828#define TIMIL2 0x0004
758#define TOVL_ERR0 0x0010 829#define TOVF_ERR0 0x0010 /* Timer 0 Counter Overflow */
759#define TOVL_ERR1 0x0020 830#define TOVF_ERR1 0x0020 /* Timer 1 Counter Overflow */
760#define TOVL_ERR2 0x0040 831#define TOVF_ERR2 0x0040 /* Timer 2 Counter Overflow */
761#define TRUN0 0x1000 832#define TRUN0 0x1000
762#define TRUN1 0x2000 833#define TRUN1 0x2000
763#define TRUN2 0x4000 834#define TRUN2 0x4000
@@ -765,13 +836,21 @@
765#define TIMIL0_P 0x00 836#define TIMIL0_P 0x00
766#define TIMIL1_P 0x01 837#define TIMIL1_P 0x01
767#define TIMIL2_P 0x02 838#define TIMIL2_P 0x02
768#define TOVL_ERR0_P 0x04 839#define TOVF_ERR0_P 0x04
769#define TOVL_ERR1_P 0x05 840#define TOVF_ERR1_P 0x05
770#define TOVL_ERR2_P 0x06 841#define TOVF_ERR2_P 0x06
771#define TRUN0_P 0x0C 842#define TRUN0_P 0x0C
772#define TRUN1_P 0x0D 843#define TRUN1_P 0x0D
773#define TRUN2_P 0x0E 844#define TRUN2_P 0x0E
774 845
846/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
847#define TOVL_ERR0 TOVF_ERR0
848#define TOVL_ERR1 TOVF_ERR1
849#define TOVL_ERR2 TOVF_ERR2
850#define TOVL_ERR0_P TOVF_ERR0_P
851#define TOVL_ERR1_P TOVF_ERR1_P
852#define TOVL_ERR2_P TOVF_ERR2_P
853
775/* TIMERx_CONFIG Registers */ 854/* TIMERx_CONFIG Registers */
776#define PWM_OUT 0x0001 855#define PWM_OUT 0x0001
777#define WDTH_CAP 0x0002 856#define WDTH_CAP 0x0002
@@ -841,6 +920,10 @@
841 920
842/* SPI_CTL Masks */ 921/* SPI_CTL Masks */
843#define TIMOD 0x00000003 /* Transfer initiation mode and interrupt generation */ 922#define TIMOD 0x00000003 /* Transfer initiation mode and interrupt generation */
923#define RDBR_CORE 0x0000 /* RDBR Read Initiates, IRQ When RDBR Full */
924#define TDBR_CORE 0x0001 /* TDBR Write Initiates, IRQ When TDBR Empty */
925#define RDBR_DMA 0x0002 /* DMA Read, DMA Until FIFO Empty */
926#define TDBR_DMA 0x0003 /* DMA Write, DMA Until FIFO Full */
844#define SZ 0x00000004 /* Send Zero (=0) or last (=1) word when TDBR empty. */ 927#define SZ 0x00000004 /* Send Zero (=0) or last (=1) word when TDBR empty. */
845#define GM 0x00000008 /* When RDBR full, get more (=1) data or discard (=0) incoming Data */ 928#define GM 0x00000008 /* When RDBR full, get more (=1) data or discard (=0) incoming Data */
846#define PSSE 0x00000010 /* Enable (=1) Slave-Select input for Master. */ 929#define PSSE 0x00000010 /* Enable (=1) Slave-Select input for Master. */
@@ -894,10 +977,20 @@
894#define RXS 0x00000020 /* SPI_RDBR Data Buffer Status (0=Empty, 1=Full) */ 977#define RXS 0x00000020 /* SPI_RDBR Data Buffer Status (0=Empty, 1=Full) */
895#define TXCOL 0x00000040 /* When set (=1), corrupt data may have been transmitted */ 978#define TXCOL 0x00000040 /* When set (=1), corrupt data may have been transmitted */
896 979
980/* SPIx_FLG Masks */
981#define FLG1E 0xFDFF /* Activates SPI_FLOUT1 */
982#define FLG2E 0xFBFF /* Activates SPI_FLOUT2 */
983#define FLG3E 0xF7FF /* Activates SPI_FLOUT3 */
984#define FLG4E 0xEFFF /* Activates SPI_FLOUT4 */
985#define FLG5E 0xDFFF /* Activates SPI_FLOUT5 */
986#define FLG6E 0xBFFF /* Activates SPI_FLOUT6 */
987#define FLG7E 0x7FFF /* Activates SPI_FLOUT7 */
988
897/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS ************* */ 989/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS ************* */
898 990
899/* AMGCTL Masks */ 991/* AMGCTL Masks */
900#define AMCKEN 0x00000001 /* Enable CLKOUT */ 992#define AMCKEN 0x00000001 /* Enable CLKOUT */
993#define AMBEN_NONE 0x00000000 /* All Banks Disabled */
901#define AMBEN_B0 0x00000002 /* Enable Asynchronous Memory Bank 0 only */ 994#define AMBEN_B0 0x00000002 /* Enable Asynchronous Memory Bank 0 only */
902#define AMBEN_B0_B1 0x00000004 /* Enable Asynchronous Memory Banks 0 & 1 only */ 995#define AMBEN_B0_B1 0x00000004 /* Enable Asynchronous Memory Banks 0 & 1 only */
903#define AMBEN_B0_B1_B2 0x00000006 /* Enable Asynchronous Memory Banks 0, 1, and 2 */ 996#define AMBEN_B0_B1_B2 0x00000006 /* Enable Asynchronous Memory Banks 0, 1, and 2 */
@@ -1097,6 +1190,9 @@
1097#define CL_3 0x0000000C /* SDRAM CAS latency = 3 cycles */ 1190#define CL_3 0x0000000C /* SDRAM CAS latency = 3 cycles */
1098#define PFE 0x00000010 /* Enable SDRAM prefetch */ 1191#define PFE 0x00000010 /* Enable SDRAM prefetch */
1099#define PFP 0x00000020 /* Prefetch has priority over AMC requests */ 1192#define PFP 0x00000020 /* Prefetch has priority over AMC requests */
1193#define PASR_ALL 0x00000000 /* All 4 SDRAM Banks Refreshed In Self-Refresh */
1194#define PASR_B0_B1 0x00000010 /* SDRAM Banks 0 and 1 Are Refreshed In Self-Refresh */
1195#define PASR_B0 0x00000020 /* Only SDRAM Bank 0 Is Refreshed In Self-Refresh */
1100#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */ 1196#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
1101#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */ 1197#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
1102#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */ 1198#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
@@ -1158,18 +1254,5 @@
1158#define SDEASE 0x00000010 /* SDRAM EAB sticky error status - W1C */ 1254#define SDEASE 0x00000010 /* SDRAM EAB sticky error status - W1C */
1159#define BGSTAT 0x00000020 /* Bus granted */ 1255#define BGSTAT 0x00000020 /* Bus granted */
1160 1256
1161/*VR_CTL Masks*/
1162#define WAKE 0x100
1163#define VLEV_6 0x60
1164#define VLEV_7 0x70
1165#define VLEV_8 0x80
1166#define VLEV_9 0x90
1167#define VLEV_10 0xA0
1168#define VLEV_11 0xB0
1169#define VLEV_12 0xC0
1170#define VLEV_13 0xD0
1171#define VLEV_14 0xE0
1172#define VLEV_15 0xF0
1173#define FREQ_3 0x03
1174 1257
1175#endif /* _DEF_BF532_H */ 1258#endif /* _DEF_BF532_H */
diff --git a/include/asm-blackfin/mach-bf537/cdefBF534.h b/include/asm-blackfin/mach-bf537/cdefBF534.h
index 7b658c175f85..84e58fa73dce 100644
--- a/include/asm-blackfin/mach-bf537/cdefBF534.h
+++ b/include/asm-blackfin/mach-bf537/cdefBF534.h
@@ -51,12 +51,14 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
51{ 51{
52 unsigned long flags, iwr; 52 unsigned long flags, iwr;
53 53
54 bfin_write16(VR_CTL, val);
55 __builtin_bfin_ssync();
56 /* Enable the PLL Wakeup bit in SIC IWR */ 54 /* Enable the PLL Wakeup bit in SIC IWR */
57 iwr = bfin_read32(SIC_IWR); 55 iwr = bfin_read32(SIC_IWR);
58 /* Only allow PPL Wakeup) */ 56 /* Only allow PPL Wakeup) */
59 bfin_write32(SIC_IWR, IWR_ENABLE(0)); 57 bfin_write32(SIC_IWR, IWR_ENABLE(0));
58
59 bfin_write16(VR_CTL, val);
60 __builtin_bfin_ssync();
61
60 local_irq_save(flags); 62 local_irq_save(flags);
61 asm("IDLE;"); 63 asm("IDLE;");
62 local_irq_restore(flags); 64 local_irq_restore(flags);
@@ -73,7 +75,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
73#define bfin_write_SWRST(val) bfin_write16(SWRST,val) 75#define bfin_write_SWRST(val) bfin_write16(SWRST,val)
74#define bfin_read_SYSCR() bfin_read16(SYSCR) 76#define bfin_read_SYSCR() bfin_read16(SYSCR)
75#define bfin_write_SYSCR(val) bfin_write16(SYSCR,val) 77#define bfin_write_SYSCR(val) bfin_write16(SYSCR,val)
76#define pSIC_RVECT ((void * volatile *)SIC_RVECT)
77#define bfin_read_SIC_RVECT() bfin_read32(SIC_RVECT) 78#define bfin_read_SIC_RVECT() bfin_read32(SIC_RVECT)
78#define bfin_write_SIC_RVECT(val) bfin_write32(SIC_RVECT,val) 79#define bfin_write_SIC_RVECT(val) bfin_write32(SIC_RVECT,val)
79#define bfin_read_SIC_IMASK() bfin_read32(SIC_IMASK) 80#define bfin_read_SIC_IMASK() bfin_read32(SIC_IMASK)
@@ -398,10 +399,14 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
398#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT,val) 399#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT,val)
399 400
400/* DMA Traffic Control Registers */ 401/* DMA Traffic Control Registers */
401#define pDMA_TCPER ((volatile unsigned short *)DMA_TCPER) 402#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
403#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER,val)
404#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
405#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT,val)
406
407/* Alternate deprecated register names (below) provided for backwards code compatibility */
402#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER) 408#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
403#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER,val) 409#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER,val)
404#define pDMA_TCCNT ((volatile unsigned short *)DMA_TCCNT)
405#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT) 410#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
406#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT,val) 411#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT,val)
407 412
@@ -1076,8 +1081,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
1076#define bfin_write_CAN_UCRC(val) bfin_write16(CAN_UCRC,val) 1081#define bfin_write_CAN_UCRC(val) bfin_write16(CAN_UCRC,val)
1077#define bfin_read_CAN_UCCNF() bfin_read16(CAN_UCCNF) 1082#define bfin_read_CAN_UCCNF() bfin_read16(CAN_UCCNF)
1078#define bfin_write_CAN_UCCNF(val) bfin_write16(CAN_UCCNF,val) 1083#define bfin_write_CAN_UCCNF(val) bfin_write16(CAN_UCCNF,val)
1079#define bfin_read_CAN_SFCMVER2() bfin_read16(CAN_SFCMVER2)
1080#define bfin_write_CAN_SFCMVER2(val) bfin_write16(CAN_SFCMVER2,val)
1081 1084
1082/* Mailbox Acceptance Masks */ 1085/* Mailbox Acceptance Masks */
1083#define bfin_read_CAN_AM00L() bfin_read16(CAN_AM00L) 1086#define bfin_read_CAN_AM00L() bfin_read16(CAN_AM00L)
diff --git a/include/asm-blackfin/mach-bf537/cdefBF537.h b/include/asm-blackfin/mach-bf537/cdefBF537.h
index 932a1b6b5d14..b8fc949a991f 100644
--- a/include/asm-blackfin/mach-bf537/cdefBF537.h
+++ b/include/asm-blackfin/mach-bf537/cdefBF537.h
@@ -40,7 +40,6 @@
40 40
41/* Include Macro "Defines" For EMAC (Unique to BF536/BF537 */ 41/* Include Macro "Defines" For EMAC (Unique to BF536/BF537 */
42/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */ 42/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
43#define pEMAC_OPMODE ((volatile unsigned long *)EMAC_OPMODE)
44#define bfin_read_EMAC_OPMODE() bfin_read32(EMAC_OPMODE) 43#define bfin_read_EMAC_OPMODE() bfin_read32(EMAC_OPMODE)
45#define bfin_write_EMAC_OPMODE(val) bfin_write32(EMAC_OPMODE,val) 44#define bfin_write_EMAC_OPMODE(val) bfin_write32(EMAC_OPMODE,val)
46#define bfin_read_EMAC_ADDRLO() bfin_read32(EMAC_ADDRLO) 45#define bfin_read_EMAC_ADDRLO() bfin_read32(EMAC_ADDRLO)
@@ -80,7 +79,6 @@
80#define bfin_read_EMAC_WKUP_FFCRC1() bfin_read32(EMAC_WKUP_FFCRC1) 79#define bfin_read_EMAC_WKUP_FFCRC1() bfin_read32(EMAC_WKUP_FFCRC1)
81#define bfin_write_EMAC_WKUP_FFCRC1(val) bfin_write32(EMAC_WKUP_FFCRC1,val) 80#define bfin_write_EMAC_WKUP_FFCRC1(val) bfin_write32(EMAC_WKUP_FFCRC1,val)
82 81
83#define pEMAC_SYSCTL ((volatile unsigned long *)EMAC_SYSCTL)
84#define bfin_read_EMAC_SYSCTL() bfin_read32(EMAC_SYSCTL) 82#define bfin_read_EMAC_SYSCTL() bfin_read32(EMAC_SYSCTL)
85#define bfin_write_EMAC_SYSCTL(val) bfin_write32(EMAC_SYSCTL,val) 83#define bfin_write_EMAC_SYSCTL(val) bfin_write32(EMAC_SYSCTL,val)
86#define bfin_read_EMAC_SYSTAT() bfin_read32(EMAC_SYSTAT) 84#define bfin_read_EMAC_SYSTAT() bfin_read32(EMAC_SYSTAT)
@@ -147,7 +145,6 @@
147#define bfin_write_EMAC_RXC_SHORT(val) bfin_write32(EMAC_RXC_SHORT,val) 145#define bfin_write_EMAC_RXC_SHORT(val) bfin_write32(EMAC_RXC_SHORT,val)
148#define bfin_read_EMAC_RXC_EQ64() bfin_read32(EMAC_RXC_EQ64) 146#define bfin_read_EMAC_RXC_EQ64() bfin_read32(EMAC_RXC_EQ64)
149#define bfin_write_EMAC_RXC_EQ64(val) bfin_write32(EMAC_RXC_EQ64,val) 147#define bfin_write_EMAC_RXC_EQ64(val) bfin_write32(EMAC_RXC_EQ64,val)
150#define pEMAC_RXC_LT128 ((volatile unsigned long *)EMAC_RXC_LT128)
151#define bfin_read_EMAC_RXC_LT128() bfin_read32(EMAC_RXC_LT128) 148#define bfin_read_EMAC_RXC_LT128() bfin_read32(EMAC_RXC_LT128)
152#define bfin_write_EMAC_RXC_LT128(val) bfin_write32(EMAC_RXC_LT128,val) 149#define bfin_write_EMAC_RXC_LT128(val) bfin_write32(EMAC_RXC_LT128,val)
153#define bfin_read_EMAC_RXC_LT256() bfin_read32(EMAC_RXC_LT256) 150#define bfin_read_EMAC_RXC_LT256() bfin_read32(EMAC_RXC_LT256)
diff --git a/include/asm-blackfin/mach-bf537/defBF534.h b/include/asm-blackfin/mach-bf537/defBF534.h
index e605e9709004..1859f2fee5a7 100644
--- a/include/asm-blackfin/mach-bf537/defBF534.h
+++ b/include/asm-blackfin/mach-bf537/defBF534.h
@@ -216,8 +216,12 @@
216#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */ 216#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
217 217
218/* DMA Traffic Control Registers */ 218/* DMA Traffic Control Registers */
219#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */ 219#define DMA_TC_PER 0xFFC00B0C /* Traffic Control Periods Register */
220#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */ 220#define DMA_TC_CNT 0xFFC00B10 /* Traffic Control Current Counts Register */
221
222/* Alternate deprecated register names (below) provided for backwards code compatibility */
223#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */
224#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */
221 225
222/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */ 226/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */
223#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */ 227#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
@@ -563,7 +567,7 @@
563#define CAN_GIF 0xFFC02A9C /* Global Interrupt Flag Register */ 567#define CAN_GIF 0xFFC02A9C /* Global Interrupt Flag Register */
564#define CAN_CONTROL 0xFFC02AA0 /* Master Control Register */ 568#define CAN_CONTROL 0xFFC02AA0 /* Master Control Register */
565#define CAN_INTR 0xFFC02AA4 /* Interrupt Pending Register */ 569#define CAN_INTR 0xFFC02AA4 /* Interrupt Pending Register */
566#define CAN_SFCMVER 0xFFC02AA8 /* Version Code Register */ 570
567#define CAN_MBTD 0xFFC02AAC /* Mailbox Temporary Disable Feature */ 571#define CAN_MBTD 0xFFC02AAC /* Mailbox Temporary Disable Feature */
568#define CAN_EWR 0xFFC02AB0 /* Programmable Warning Level */ 572#define CAN_EWR 0xFFC02AB0 /* Programmable Warning Level */
569#define CAN_ESR 0xFFC02AB4 /* Error Status Register */ 573#define CAN_ESR 0xFFC02AB4 /* Error Status Register */
@@ -1026,10 +1030,11 @@
1026#define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */ 1030#define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */
1027 1031
1028#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */ 1032#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */
1029#define PHYWE 0x0200 /* Enable PHY Wakeup From Hibernate */ 1033#define CANWE 0x0200 /* Enable CAN Wakeup From Hibernate */
1030#define CANWE 0x0400 /* Enable CAN Wakeup From Hibernate */ 1034#define PHYWE 0x0400 /* Enable PHY Wakeup From Hibernate */
1031#define PHYCLKOE 0x4000 /* PHY Clock Output Enable */ 1035#define CLKBUFOE 0x4000 /* CLKIN Buffer Output Enable */
1032#define CKELOW 0x8000 /* Enable Drive CKE Low During Reset */ 1036#define PHYCLKOE CLKBUFOE /* Alternative legacy name for the above */
1037#define SCKELOW 0x8000 /* Enable Drive CKE Low During Reset */
1033 1038
1034/* PLL_STAT Masks */ 1039/* PLL_STAT Masks */
1035#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */ 1040#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
@@ -1050,7 +1055,7 @@
1050#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */ 1055#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */
1051 1056
1052/* SYSCR Masks */ 1057/* SYSCR Masks */
1053#define BMODE 0x0006 /* Boot Mode - Latched During HW Reset From Mode Pins */ 1058#define BMODE 0x0007 /* Boot Mode - Latched During HW Reset From Mode Pins */
1054#define NOBOOT 0x0010 /* Execute From L1 or ASYNC Bank 0 When BMODE = 0 */ 1059#define NOBOOT 0x0010 /* Execute From L1 or ASYNC Bank 0 When BMODE = 0 */
1055 1060
1056/* ************* SYSTEM INTERRUPT CONTROLLER MASKS *************************************/ 1061/* ************* SYSTEM INTERRUPT CONTROLLER MASKS *************************************/
@@ -1107,19 +1112,9 @@
1107#define IWR_ENABLE(x) (1 << ((x)&0x1F)) /* Wakeup Enable Peripheral #x */ 1112#define IWR_ENABLE(x) (1 << ((x)&0x1F)) /* Wakeup Enable Peripheral #x */
1108#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Wakeup Disable Peripheral #x */ 1113#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Wakeup Disable Peripheral #x */
1109 1114
1110/* *************** WATCHDOG TIMER MASKS *******************************************/
1111/* WDOG_CTL Masks */
1112#define WDOG_RESET 0x0000 /* Generate Reset Event */
1113#define WDOG_NMI 0x0002 /* Generate Non-Maskable Interrupt (NMI) Event */
1114#define WDOG_GPI 0x0004 /* Generate General Purpose (GP) Interrupt */
1115#define WDOG_NONE 0x0006 /* Disable Watchdog Timer Interrupts */
1116#define TMR_EN 0x0FF0 /* Watchdog Counter Enable */
1117#define TMR_DIS 0x0AD0 /* Watchdog Counter Disable */
1118#define TRO 0x8000 /* Watchdog Expired */
1119
1120/* ************** UART CONTROLLER MASKS *************************/ 1115/* ************** UART CONTROLLER MASKS *************************/
1121/* UARTx_LCR Masks */ 1116/* UARTx_LCR Masks */
1122#define WLS(x) ((((x)&0x3)-5) & 0x03) /* Word Length Select */ 1117#define WLS(x) (((x)-5) & 0x03) /* Word Length Select */
1123#define STB 0x04 /* Stop Bits */ 1118#define STB 0x04 /* Stop Bits */
1124#define PEN 0x08 /* Parity Enable */ 1119#define PEN 0x08 /* Parity Enable */
1125#define EPS 0x10 /* Even Parity Select */ 1120#define EPS 0x10 /* Even Parity Select */
@@ -1128,8 +1123,8 @@
1128#define DLAB 0x80 /* Divisor Latch Access */ 1123#define DLAB 0x80 /* Divisor Latch Access */
1129 1124
1130/* UARTx_MCR Mask */ 1125/* UARTx_MCR Mask */
1131#define LOOP 0x10 /* Loopback Mode Enable */ 1126#define LOOP_ENA 0x10 /* Loopback Mode Enable */
1132 1127#define LOOP_ENA_P 0x04
1133/* UARTx_LSR Masks */ 1128/* UARTx_LSR Masks */
1134#define DR 0x01 /* Data Ready */ 1129#define DR 0x01 /* Data Ready */
1135#define OE 0x02 /* Overrun Error */ 1130#define OE 0x02 /* Overrun Error */
@@ -1229,10 +1224,10 @@
1229#define TIMIL1 0x00000002 /* Timer 1 Interrupt */ 1224#define TIMIL1 0x00000002 /* Timer 1 Interrupt */
1230#define TIMIL2 0x00000004 /* Timer 2 Interrupt */ 1225#define TIMIL2 0x00000004 /* Timer 2 Interrupt */
1231#define TIMIL3 0x00000008 /* Timer 3 Interrupt */ 1226#define TIMIL3 0x00000008 /* Timer 3 Interrupt */
1232#define TOVL_ERR0 0x00000010 /* Timer 0 Counter Overflow */ 1227#define TOVF_ERR0 0x00000010 /* Timer 0 Counter Overflow */
1233#define TOVL_ERR1 0x00000020 /* Timer 1 Counter Overflow */ 1228#define TOVF_ERR1 0x00000020 /* Timer 1 Counter Overflow */
1234#define TOVL_ERR2 0x00000040 /* Timer 2 Counter Overflow */ 1229#define TOVF_ERR2 0x00000040 /* Timer 2 Counter Overflow */
1235#define TOVL_ERR3 0x00000080 /* Timer 3 Counter Overflow */ 1230#define TOVF_ERR3 0x00000080 /* Timer 3 Counter Overflow */
1236#define TRUN0 0x00001000 /* Timer 0 Slave Enable Status */ 1231#define TRUN0 0x00001000 /* Timer 0 Slave Enable Status */
1237#define TRUN1 0x00002000 /* Timer 1 Slave Enable Status */ 1232#define TRUN1 0x00002000 /* Timer 1 Slave Enable Status */
1238#define TRUN2 0x00004000 /* Timer 2 Slave Enable Status */ 1233#define TRUN2 0x00004000 /* Timer 2 Slave Enable Status */
@@ -1241,15 +1236,24 @@
1241#define TIMIL5 0x00020000 /* Timer 5 Interrupt */ 1236#define TIMIL5 0x00020000 /* Timer 5 Interrupt */
1242#define TIMIL6 0x00040000 /* Timer 6 Interrupt */ 1237#define TIMIL6 0x00040000 /* Timer 6 Interrupt */
1243#define TIMIL7 0x00080000 /* Timer 7 Interrupt */ 1238#define TIMIL7 0x00080000 /* Timer 7 Interrupt */
1244#define TOVL_ERR4 0x00100000 /* Timer 4 Counter Overflow */ 1239#define TOVF_ERR4 0x00100000 /* Timer 4 Counter Overflow */
1245#define TOVL_ERR5 0x00200000 /* Timer 5 Counter Overflow */ 1240#define TOVF_ERR5 0x00200000 /* Timer 5 Counter Overflow */
1246#define TOVL_ERR6 0x00400000 /* Timer 6 Counter Overflow */ 1241#define TOVF_ERR6 0x00400000 /* Timer 6 Counter Overflow */
1247#define TOVL_ERR7 0x00800000 /* Timer 7 Counter Overflow */ 1242#define TOVF_ERR7 0x00800000 /* Timer 7 Counter Overflow */
1248#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */ 1243#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */
1249#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */ 1244#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */
1250#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */ 1245#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */
1251#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */ 1246#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */
1252 1247
1248/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
1249#define TOVL_ERR0 TOVF_ERR0
1250#define TOVL_ERR1 TOVF_ERR1
1251#define TOVL_ERR2 TOVF_ERR2
1252#define TOVL_ERR3 TOVF_ERR3
1253#define TOVL_ERR4 TOVF_ERR4
1254#define TOVL_ERR5 TOVF_ERR5
1255#define TOVL_ERR6 TOVF_ERR6
1256#define TOVL_ERR7 TOVF_ERR7
1253/* TIMERx_CONFIG Masks */ 1257/* TIMERx_CONFIG Masks */
1254#define PWM_OUT 0x0001 /* Pulse-Width Modulation Output Mode */ 1258#define PWM_OUT 0x0001 /* Pulse-Width Modulation Output Mode */
1255#define WDTH_CAP 0x0002 /* Width Capture Input Mode */ 1259#define WDTH_CAP 0x0002 /* Width Capture Input Mode */
@@ -1647,6 +1651,8 @@
1647#define EBSZ_32 0x0002 /* SDRAM External Bank Size = 32MB */ 1651#define EBSZ_32 0x0002 /* SDRAM External Bank Size = 32MB */
1648#define EBSZ_64 0x0004 /* SDRAM External Bank Size = 64MB */ 1652#define EBSZ_64 0x0004 /* SDRAM External Bank Size = 64MB */
1649#define EBSZ_128 0x0006 /* SDRAM External Bank Size = 128MB */ 1653#define EBSZ_128 0x0006 /* SDRAM External Bank Size = 128MB */
1654#define EBSZ_256 0x0008 /* SDRAM External Bank Size = 256MB */
1655#define EBSZ_512 0x000A /* SDRAM External Bank Size = 512MB */
1650#define EBCAW_8 0x0000 /* SDRAM External Bank Column Address Width = 8 Bits */ 1656#define EBCAW_8 0x0000 /* SDRAM External Bank Column Address Width = 8 Bits */
1651#define EBCAW_9 0x0010 /* SDRAM External Bank Column Address Width = 9 Bits */ 1657#define EBCAW_9 0x0010 /* SDRAM External Bank Column Address Width = 9 Bits */
1652#define EBCAW_10 0x0020 /* SDRAM External Bank Column Address Width = 10 Bits */ 1658#define EBCAW_10 0x0020 /* SDRAM External Bank Column Address Width = 10 Bits */
@@ -1859,8 +1865,10 @@
1859#define TXECNT 0xFF00 /* Transmit Error Counter */ 1865#define TXECNT 0xFF00 /* Transmit Error Counter */
1860 1866
1861/* CAN_INTR Masks */ 1867/* CAN_INTR Masks */
1862#define MBRIF 0x0001 /* Mailbox Receive Interrupt */ 1868#define MBRIRQ 0x0001 /* Mailbox Receive Interrupt */
1863#define MBTIF 0x0002 /* Mailbox Transmit Interrupt */ 1869#define MBRIF MBRIRQ /* legacy */
1870#define MBTIRQ 0x0002 /* Mailbox Transmit Interrupt */
1871#define MBTIF MBTIRQ /* legacy */
1864#define GIRQ 0x0004 /* Global Interrupt */ 1872#define GIRQ 0x0004 /* Global Interrupt */
1865#define SMACK 0x0008 /* Sleep Mode Acknowledge */ 1873#define SMACK 0x0008 /* Sleep Mode Acknowledge */
1866#define CANTX 0x0040 /* CAN TX Bus Value */ 1874#define CANTX 0x0040 /* CAN TX Bus Value */
@@ -2445,8 +2453,8 @@
2445#define PJCE_SPI 0x0004 /* Enable SPI_SSEL7 */ 2453#define PJCE_SPI 0x0004 /* Enable SPI_SSEL7 */
2446 2454
2447#define PFDE 0x0008 /* Port F DMA Request Enable */ 2455#define PFDE 0x0008 /* Port F DMA Request Enable */
2448#define PGDE_UART 0x0000 /* Enable UART0 RX/TX */ 2456#define PFDE_UART 0x0000 /* Enable UART0 RX/TX */
2449#define PGDE_DMA 0x0008 /* Enable DMAR1:0 */ 2457#define PFDE_DMA 0x0008 /* Enable DMAR1:0 */
2450 2458
2451#define PFTE 0x0010 /* Port F Timer Enable */ 2459#define PFTE 0x0010 /* Port F Timer Enable */
2452#define PFTE_UART 0x0000 /* Enable UART1 RX/TX */ 2460#define PFTE_UART 0x0000 /* Enable UART1 RX/TX */
@@ -2498,4 +2506,20 @@
2498#define OI 0x4000 /* Overflow Interrupt Generated */ 2506#define OI 0x4000 /* Overflow Interrupt Generated */
2499#define BDI 0x8000 /* Block Done Interrupt Generated */ 2507#define BDI 0x8000 /* Block Done Interrupt Generated */
2500 2508
2509/* entry addresses of the user-callable Boot ROM functions */
2510
2511#define _BOOTROM_RESET 0xEF000000
2512#define _BOOTROM_FINAL_INIT 0xEF000002
2513#define _BOOTROM_DO_MEMORY_DMA 0xEF000006
2514#define _BOOTROM_BOOT_DXE_FLASH 0xEF000008
2515#define _BOOTROM_BOOT_DXE_SPI 0xEF00000A
2516#define _BOOTROM_BOOT_DXE_TWI 0xEF00000C
2517#define _BOOTROM_GET_DXE_ADDRESS_FLASH 0xEF000010
2518#define _BOOTROM_GET_DXE_ADDRESS_SPI 0xEF000012
2519#define _BOOTROM_GET_DXE_ADDRESS_TWI 0xEF000014
2520
2521/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
2522#define PGDE_UART PFDE_UART
2523#define PGDE_DMA PFDE_DMA
2524#define CKELOW SCKELOW
2501#endif /* _DEF_BF534_H */ 2525#endif /* _DEF_BF534_H */
diff --git a/include/asm-blackfin/mach-bf537/defBF537.h b/include/asm-blackfin/mach-bf537/defBF537.h
index 26f9c02eb73c..3f455909c418 100644
--- a/include/asm-blackfin/mach-bf537/defBF537.h
+++ b/include/asm-blackfin/mach-bf537/defBF537.h
@@ -32,12 +32,12 @@
32#ifndef _DEF_BF537_H 32#ifndef _DEF_BF537_H
33#define _DEF_BF537_H 33#define _DEF_BF537_H
34 34
35/*include all Core registers and bit definitions*/ 35/* Include all Core registers and bit definitions*/
36#include "defBF537.h"
37
38/*include core specific register pointer definitions*/
39#include <asm/mach-common/cdef_LPBlackfin.h> 36#include <asm/mach-common/cdef_LPBlackfin.h>
40 37
38/* Include all MMR and bit defines common to BF534 */
39#include "defBF534.h"
40
41/************************************************************************************ 41/************************************************************************************
42** Define EMAC Section Unique to BF536/BF537 42** Define EMAC Section Unique to BF536/BF537
43*************************************************************************************/ 43*************************************************************************************/
diff --git a/include/asm-blackfin/mach-bf548/cdefBF542.h b/include/asm-blackfin/mach-bf548/cdefBF542.h
new file mode 100644
index 000000000000..308b33ab5311
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/cdefBF542.h
@@ -0,0 +1,590 @@
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() fin_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() fin_read16(SDH_STATUS_CLR)
131#define bfin_write_SDH_STATUS_CLR(val) fin_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() fin_read16(USB_TESTMODE)
188#define bfin_write_USB_TESTMODE(val) fin_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) fin_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
new file mode 100644
index 000000000000..7a2d177c8dc2
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/cdefBF544.h
@@ -0,0 +1,978 @@
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#define bfin_read_TWI1_CLKDIV() bfin_read16(TWI1_CLKDIV)
117#define bfin_write_TWI1_CLKDIV(val) bfin_write16(TWI1_CLKDIV, val)
118#define bfin_read_TWI1_CONTROL() bfin_read16(TWI1_CONTROL)
119#define bfin_write_TWI1_CONTROL(val) bfin_write16(TWI1_CONTROL, val)
120#define bfin_read_TWI1_SLAVE_CTRL() bfin_read16(TWI1_SLAVE_CTRL)
121#define bfin_write_TWI1_SLAVE_CTRL(val) bfin_write16(TWI1_SLAVE_CTRL, val)
122#define bfin_read_TWI1_SLAVE_STAT() bfin_read16(TWI1_SLAVE_STAT)
123#define bfin_write_TWI1_SLAVE_STAT(val) bfin_write16(TWI1_SLAVE_STAT, val)
124#define bfin_read_TWI1_SLAVE_ADDR() bfin_read16(TWI1_SLAVE_ADDR)
125#define bfin_write_TWI1_SLAVE_ADDR(val) bfin_write16(TWI1_SLAVE_ADDR, val)
126#define bfin_read_TWI1_MASTER_CTRL() bfin_read16(TWI1_MASTER_CTRL)
127#define bfin_write_TWI1_MASTER_CTRL(val) bfin_write16(TWI1_MASTER_CTRL, val)
128#define bfin_read_TWI1_MASTER_STAT() bfin_read16(TWI1_MASTER_STAT)
129#define bfin_write_TWI1_MASTER_STAT(val) bfin_write16(TWI1_MASTER_STAT, val)
130#define bfin_read_TWI1_MASTER_ADDR() bfin_read16(TWI1_MASTER_ADDR)
131#define bfin_write_TWI1_MASTER_ADDR(val) bfin_write16(TWI1_MASTER_ADDR, val)
132#define bfin_read_TWI1_INT_STAT() bfin_read16(TWI1_INT_STAT)
133#define bfin_write_TWI1_INT_STAT(val) bfin_write16(TWI1_INT_STAT, val)
134#define bfin_read_TWI1_INT_MASK() bfin_read16(TWI1_INT_MASK)
135#define bfin_write_TWI1_INT_MASK(val) bfin_write16(TWI1_INT_MASK, val)
136#define bfin_read_TWI1_FIFO_CTRL() bfin_read16(TWI1_FIFO_CTRL)
137#define bfin_write_TWI1_FIFO_CTRL(val) bfin_write16(TWI1_FIFO_CTRL, val)
138#define bfin_read_TWI1_FIFO_STAT() bfin_read16(TWI1_FIFO_STAT)
139#define bfin_write_TWI1_FIFO_STAT(val) bfin_write16(TWI1_FIFO_STAT, val)
140#define bfin_read_TWI1_XMT_DATA8() bfin_read16(TWI1_XMT_DATA8)
141#define bfin_write_TWI1_XMT_DATA8(val) bfin_write16(TWI1_XMT_DATA8, val)
142#define bfin_read_TWI1_XMT_DATA16() bfin_read16(TWI1_XMT_DATA16)
143#define bfin_write_TWI1_XMT_DATA16(val) bfin_write16(TWI1_XMT_DATA16, val)
144#define bfin_read_TWI1_RCV_DATA8() bfin_read16(TWI1_RCV_DATA8)
145#define bfin_write_TWI1_RCV_DATA8(val) bfin_write16(TWI1_RCV_DATA8, val)
146#define bfin_read_TWI1_RCV_DATA16() bfin_read16(TWI1_RCV_DATA16)
147#define bfin_write_TWI1_RCV_DATA16(val) bfin_write16(TWI1_RCV_DATA16, val)
148
149/* CAN Controller 1 Config 1 Registers */
150
151#define bfin_read_CAN1_MC1() bfin_read16(CAN1_MC1)
152#define bfin_write_CAN1_MC1(val) bfin_write16(CAN1_MC1, val)
153#define bfin_read_CAN1_MD1() bfin_read16(CAN1_MD1)
154#define bfin_write_CAN1_MD1(val) bfin_write16(CAN1_MD1, val)
155#define bfin_read_CAN1_TRS1() bfin_read16(CAN1_TRS1)
156#define bfin_write_CAN1_TRS1(val) bfin_write16(CAN1_TRS1, val)
157#define bfin_read_CAN1_TRR1() bfin_read16(CAN1_TRR1)
158#define bfin_write_CAN1_TRR1(val) bfin_write16(CAN1_TRR1, val)
159#define bfin_read_CAN1_TA1() bfin_read16(CAN1_TA1)
160#define bfin_write_CAN1_TA1(val) bfin_write16(CAN1_TA1, val)
161#define bfin_read_CAN1_AA1() bfin_read16(CAN1_AA1)
162#define bfin_write_CAN1_AA1(val) bfin_write16(CAN1_AA1, val)
163#define bfin_read_CAN1_RMP1() bfin_read16(CAN1_RMP1)
164#define bfin_write_CAN1_RMP1(val) bfin_write16(CAN1_RMP1, val)
165#define bfin_read_CAN1_RML1() bfin_read16(CAN1_RML1)
166#define bfin_write_CAN1_RML1(val) bfin_write16(CAN1_RML1, val)
167#define bfin_read_CAN1_MBTIF1() bfin_read16(CAN1_MBTIF1)
168#define bfin_write_CAN1_MBTIF1(val) bfin_write16(CAN1_MBTIF1, val)
169#define bfin_read_CAN1_MBRIF1() bfin_read16(CAN1_MBRIF1)
170#define bfin_write_CAN1_MBRIF1(val) bfin_write16(CAN1_MBRIF1, val)
171#define bfin_read_CAN1_MBIM1() bfin_read16(CAN1_MBIM1)
172#define bfin_write_CAN1_MBIM1(val) bfin_write16(CAN1_MBIM1, val)
173#define bfin_read_CAN1_RFH1() bfin_read16(CAN1_RFH1)
174#define bfin_write_CAN1_RFH1(val) bfin_write16(CAN1_RFH1, val)
175#define bfin_read_CAN1_OPSS1() bfin_read16(CAN1_OPSS1)
176#define bfin_write_CAN1_OPSS1(val) bfin_write16(CAN1_OPSS1, val)
177
178/* CAN Controller 1 Config 2 Registers */
179
180#define bfin_read_CAN1_MC2() bfin_read16(CAN1_MC2)
181#define bfin_write_CAN1_MC2(val) bfin_write16(CAN1_MC2, val)
182#define bfin_read_CAN1_MD2() bfin_read16(CAN1_MD2)
183#define bfin_write_CAN1_MD2(val) bfin_write16(CAN1_MD2, val)
184#define bfin_read_CAN1_TRS2() bfin_read16(CAN1_TRS2)
185#define bfin_write_CAN1_TRS2(val) bfin_write16(CAN1_TRS2, val)
186#define bfin_read_CAN1_TRR2() bfin_read16(CAN1_TRR2)
187#define bfin_write_CAN1_TRR2(val) bfin_write16(CAN1_TRR2, val)
188#define bfin_read_CAN1_TA2() bfin_read16(CAN1_TA2)
189#define bfin_write_CAN1_TA2(val) bfin_write16(CAN1_TA2, val)
190#define bfin_read_CAN1_AA2() bfin_read16(CAN1_AA2)
191#define bfin_write_CAN1_AA2(val) bfin_write16(CAN1_AA2, val)
192#define bfin_read_CAN1_RMP2() bfin_read16(CAN1_RMP2)
193#define bfin_write_CAN1_RMP2(val) bfin_write16(CAN1_RMP2, val)
194#define bfin_read_CAN1_RML2() bfin_read16(CAN1_RML2)
195#define bfin_write_CAN1_RML2(val) bfin_write16(CAN1_RML2, val)
196#define bfin_read_CAN1_MBTIF2() bfin_read16(CAN1_MBTIF2)
197#define bfin_write_CAN1_MBTIF2(val) bfin_write16(CAN1_MBTIF2, val)
198#define bfin_read_CAN1_MBRIF2() bfin_read16(CAN1_MBRIF2)
199#define bfin_write_CAN1_MBRIF2(val) bfin_write16(CAN1_MBRIF2, val)
200#define bfin_read_CAN1_MBIM2() bfin_read16(CAN1_MBIM2)
201#define bfin_write_CAN1_MBIM2(val) bfin_write16(CAN1_MBIM2, val)
202#define bfin_read_CAN1_RFH2() bfin_read16(CAN1_RFH2)
203#define bfin_write_CAN1_RFH2(val) bfin_write16(CAN1_RFH2, val)
204#define bfin_read_CAN1_OPSS2() bfin_read16(CAN1_OPSS2)
205#define bfin_write_CAN1_OPSS2(val) bfin_write16(CAN1_OPSS2, val)
206
207/* CAN Controller 1 Clock/Interrubfin_read_()t/Counter Registers */
208
209#define bfin_read_CAN1_CLOCK() bfin_read16(CAN1_CLOCK)
210#define bfin_write_CAN1_CLOCK(val) bfin_write16(CAN1_CLOCK, val)
211#define bfin_read_CAN1_TIMING() bfin_read16(CAN1_TIMING)
212#define bfin_write_CAN1_TIMING(val) bfin_write16(CAN1_TIMING, val)
213#define bfin_read_CAN1_DEBUG() bfin_read16(CAN1_DEBUG)
214#define bfin_write_CAN1_DEBUG(val) bfin_write16(CAN1_DEBUG, val)
215#define bfin_read_CAN1_STATUS() bfin_read16(CAN1_STATUS)
216#define bfin_write_CAN1_STATUS(val) bfin_write16(CAN1_STATUS, val)
217#define bfin_read_CAN1_CEC() bfin_read16(CAN1_CEC)
218#define bfin_write_CAN1_CEC(val) bfin_write16(CAN1_CEC, val)
219#define bfin_read_CAN1_GIS() bfin_read16(CAN1_GIS)
220#define bfin_write_CAN1_GIS(val) bfin_write16(CAN1_GIS, val)
221#define bfin_read_CAN1_GIM() bfin_read16(CAN1_GIM)
222#define bfin_write_CAN1_GIM(val) bfin_write16(CAN1_GIM, val)
223#define bfin_read_CAN1_GIF() bfin_read16(CAN1_GIF)
224#define bfin_write_CAN1_GIF(val) bfin_write16(CAN1_GIF, val)
225#define bfin_read_CAN1_CONTROL() bfin_read16(CAN1_CONTROL)
226#define bfin_write_CAN1_CONTROL(val) bfin_write16(CAN1_CONTROL, val)
227#define bfin_read_CAN1_INTR() bfin_read16(CAN1_INTR)
228#define bfin_write_CAN1_INTR(val) bfin_write16(CAN1_INTR, val)
229#define bfin_read_CAN1_MBTD() bfin_read16(CAN1_MBTD)
230#define bfin_write_CAN1_MBTD(val) bfin_write16(CAN1_MBTD, val)
231#define bfin_read_CAN1_EWR() bfin_read16(CAN1_EWR)
232#define bfin_write_CAN1_EWR(val) bfin_write16(CAN1_EWR, val)
233#define bfin_read_CAN1_ESR() bfin_read16(CAN1_ESR)
234#define bfin_write_CAN1_ESR(val) bfin_write16(CAN1_ESR, val)
235#define bfin_read_CAN1_UCCNT() bfin_read16(CAN1_UCCNT)
236#define bfin_write_CAN1_UCCNT(val) bfin_write16(CAN1_UCCNT, val)
237#define bfin_read_CAN1_UCRC() bfin_read16(CAN1_UCRC)
238#define bfin_write_CAN1_UCRC(val) bfin_write16(CAN1_UCRC, val)
239#define bfin_read_CAN1_UCCNF() bfin_read16(CAN1_UCCNF)
240#define bfin_write_CAN1_UCCNF(val) bfin_write16(CAN1_UCCNF, val)
241
242/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
243
244#define bfin_read_CAN1_AM00L() bfin_read16(CAN1_AM00L)
245#define bfin_write_CAN1_AM00L(val) bfin_write16(CAN1_AM00L, val)
246#define bfin_read_CAN1_AM00H() bfin_read16(CAN1_AM00H)
247#define bfin_write_CAN1_AM00H(val) bfin_write16(CAN1_AM00H, val)
248#define bfin_read_CAN1_AM01L() bfin_read16(CAN1_AM01L)
249#define bfin_write_CAN1_AM01L(val) bfin_write16(CAN1_AM01L, val)
250#define bfin_read_CAN1_AM01H() bfin_read16(CAN1_AM01H)
251#define bfin_write_CAN1_AM01H(val) bfin_write16(CAN1_AM01H, val)
252#define bfin_read_CAN1_AM02L() bfin_read16(CAN1_AM02L)
253#define bfin_write_CAN1_AM02L(val) bfin_write16(CAN1_AM02L, val)
254#define bfin_read_CAN1_AM02H() bfin_read16(CAN1_AM02H)
255#define bfin_write_CAN1_AM02H(val) bfin_write16(CAN1_AM02H, val)
256#define bfin_read_CAN1_AM03L() bfin_read16(CAN1_AM03L)
257#define bfin_write_CAN1_AM03L(val) bfin_write16(CAN1_AM03L, val)
258#define bfin_read_CAN1_AM03H() bfin_read16(CAN1_AM03H)
259#define bfin_write_CAN1_AM03H(val) bfin_write16(CAN1_AM03H, val)
260#define bfin_read_CAN1_AM04L() bfin_read16(CAN1_AM04L)
261#define bfin_write_CAN1_AM04L(val) bfin_write16(CAN1_AM04L, val)
262#define bfin_read_CAN1_AM04H() bfin_read16(CAN1_AM04H)
263#define bfin_write_CAN1_AM04H(val) bfin_write16(CAN1_AM04H, val)
264#define bfin_read_CAN1_AM05L() bfin_read16(CAN1_AM05L)
265#define bfin_write_CAN1_AM05L(val) bfin_write16(CAN1_AM05L, val)
266#define bfin_read_CAN1_AM05H() bfin_read16(CAN1_AM05H)
267#define bfin_write_CAN1_AM05H(val) bfin_write16(CAN1_AM05H, val)
268#define bfin_read_CAN1_AM06L() bfin_read16(CAN1_AM06L)
269#define bfin_write_CAN1_AM06L(val) bfin_write16(CAN1_AM06L, val)
270#define bfin_read_CAN1_AM06H() bfin_read16(CAN1_AM06H)
271#define bfin_write_CAN1_AM06H(val) bfin_write16(CAN1_AM06H, val)
272#define bfin_read_CAN1_AM07L() bfin_read16(CAN1_AM07L)
273#define bfin_write_CAN1_AM07L(val) bfin_write16(CAN1_AM07L, val)
274#define bfin_read_CAN1_AM07H() bfin_read16(CAN1_AM07H)
275#define bfin_write_CAN1_AM07H(val) bfin_write16(CAN1_AM07H, val)
276#define bfin_read_CAN1_AM08L() bfin_read16(CAN1_AM08L)
277#define bfin_write_CAN1_AM08L(val) bfin_write16(CAN1_AM08L, val)
278#define bfin_read_CAN1_AM08H() bfin_read16(CAN1_AM08H)
279#define bfin_write_CAN1_AM08H(val) bfin_write16(CAN1_AM08H, val)
280#define bfin_read_CAN1_AM09L() bfin_read16(CAN1_AM09L)
281#define bfin_write_CAN1_AM09L(val) bfin_write16(CAN1_AM09L, val)
282#define bfin_read_CAN1_AM09H() bfin_read16(CAN1_AM09H)
283#define bfin_write_CAN1_AM09H(val) bfin_write16(CAN1_AM09H, val)
284#define bfin_read_CAN1_AM10L() bfin_read16(CAN1_AM10L)
285#define bfin_write_CAN1_AM10L(val) bfin_write16(CAN1_AM10L, val)
286#define bfin_read_CAN1_AM10H() bfin_read16(CAN1_AM10H)
287#define bfin_write_CAN1_AM10H(val) bfin_write16(CAN1_AM10H, val)
288#define bfin_read_CAN1_AM11L() bfin_read16(CAN1_AM11L)
289#define bfin_write_CAN1_AM11L(val) bfin_write16(CAN1_AM11L, val)
290#define bfin_read_CAN1_AM11H() bfin_read16(CAN1_AM11H)
291#define bfin_write_CAN1_AM11H(val) bfin_write16(CAN1_AM11H, val)
292#define bfin_read_CAN1_AM12L() bfin_read16(CAN1_AM12L)
293#define bfin_write_CAN1_AM12L(val) bfin_write16(CAN1_AM12L, val)
294#define bfin_read_CAN1_AM12H() bfin_read16(CAN1_AM12H)
295#define bfin_write_CAN1_AM12H(val) bfin_write16(CAN1_AM12H, val)
296#define bfin_read_CAN1_AM13L() bfin_read16(CAN1_AM13L)
297#define bfin_write_CAN1_AM13L(val) bfin_write16(CAN1_AM13L, val)
298#define bfin_read_CAN1_AM13H() bfin_read16(CAN1_AM13H)
299#define bfin_write_CAN1_AM13H(val) bfin_write16(CAN1_AM13H, val)
300#define bfin_read_CAN1_AM14L() bfin_read16(CAN1_AM14L)
301#define bfin_write_CAN1_AM14L(val) bfin_write16(CAN1_AM14L, val)
302#define bfin_read_CAN1_AM14H() bfin_read16(CAN1_AM14H)
303#define bfin_write_CAN1_AM14H(val) bfin_write16(CAN1_AM14H, val)
304#define bfin_read_CAN1_AM15L() bfin_read16(CAN1_AM15L)
305#define bfin_write_CAN1_AM15L(val) bfin_write16(CAN1_AM15L, val)
306#define bfin_read_CAN1_AM15H() bfin_read16(CAN1_AM15H)
307#define bfin_write_CAN1_AM15H(val) bfin_write16(CAN1_AM15H, val)
308
309/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
310
311#define bfin_read_CAN1_AM16L() bfin_read16(CAN1_AM16L)
312#define bfin_write_CAN1_AM16L(val) bfin_write16(CAN1_AM16L, val)
313#define bfin_read_CAN1_AM16H() bfin_read16(CAN1_AM16H)
314#define bfin_write_CAN1_AM16H(val) bfin_write16(CAN1_AM16H, val)
315#define bfin_read_CAN1_AM17L() bfin_read16(CAN1_AM17L)
316#define bfin_write_CAN1_AM17L(val) bfin_write16(CAN1_AM17L, val)
317#define bfin_read_CAN1_AM17H() bfin_read16(CAN1_AM17H)
318#define bfin_write_CAN1_AM17H(val) bfin_write16(CAN1_AM17H, val)
319#define bfin_read_CAN1_AM18L() bfin_read16(CAN1_AM18L)
320#define bfin_write_CAN1_AM18L(val) bfin_write16(CAN1_AM18L, val)
321#define bfin_read_CAN1_AM18H() bfin_read16(CAN1_AM18H)
322#define bfin_write_CAN1_AM18H(val) bfin_write16(CAN1_AM18H, val)
323#define bfin_read_CAN1_AM19L() bfin_read16(CAN1_AM19L)
324#define bfin_write_CAN1_AM19L(val) bfin_write16(CAN1_AM19L, val)
325#define bfin_read_CAN1_AM19H() bfin_read16(CAN1_AM19H)
326#define bfin_write_CAN1_AM19H(val) bfin_write16(CAN1_AM19H, val)
327#define bfin_read_CAN1_AM20L() bfin_read16(CAN1_AM20L)
328#define bfin_write_CAN1_AM20L(val) bfin_write16(CAN1_AM20L, val)
329#define bfin_read_CAN1_AM20H() bfin_read16(CAN1_AM20H)
330#define bfin_write_CAN1_AM20H(val) bfin_write16(CAN1_AM20H, val)
331#define bfin_read_CAN1_AM21L() bfin_read16(CAN1_AM21L)
332#define bfin_write_CAN1_AM21L(val) bfin_write16(CAN1_AM21L, val)
333#define bfin_read_CAN1_AM21H() bfin_read16(CAN1_AM21H)
334#define bfin_write_CAN1_AM21H(val) bfin_write16(CAN1_AM21H, val)
335#define bfin_read_CAN1_AM22L() bfin_read16(CAN1_AM22L)
336#define bfin_write_CAN1_AM22L(val) bfin_write16(CAN1_AM22L, val)
337#define bfin_read_CAN1_AM22H() bfin_read16(CAN1_AM22H)
338#define bfin_write_CAN1_AM22H(val) bfin_write16(CAN1_AM22H, val)
339#define bfin_read_CAN1_AM23L() bfin_read16(CAN1_AM23L)
340#define bfin_write_CAN1_AM23L(val) bfin_write16(CAN1_AM23L, val)
341#define bfin_read_CAN1_AM23H() bfin_read16(CAN1_AM23H)
342#define bfin_write_CAN1_AM23H(val) bfin_write16(CAN1_AM23H, val)
343#define bfin_read_CAN1_AM24L() bfin_read16(CAN1_AM24L)
344#define bfin_write_CAN1_AM24L(val) bfin_write16(CAN1_AM24L, val)
345#define bfin_read_CAN1_AM24H() bfin_read16(CAN1_AM24H)
346#define bfin_write_CAN1_AM24H(val) bfin_write16(CAN1_AM24H, val)
347#define bfin_read_CAN1_AM25L() bfin_read16(CAN1_AM25L)
348#define bfin_write_CAN1_AM25L(val) bfin_write16(CAN1_AM25L, val)
349#define bfin_read_CAN1_AM25H() bfin_read16(CAN1_AM25H)
350#define bfin_write_CAN1_AM25H(val) bfin_write16(CAN1_AM25H, val)
351#define bfin_read_CAN1_AM26L() bfin_read16(CAN1_AM26L)
352#define bfin_write_CAN1_AM26L(val) bfin_write16(CAN1_AM26L, val)
353#define bfin_read_CAN1_AM26H() bfin_read16(CAN1_AM26H)
354#define bfin_write_CAN1_AM26H(val) bfin_write16(CAN1_AM26H, val)
355#define bfin_read_CAN1_AM27L() bfin_read16(CAN1_AM27L)
356#define bfin_write_CAN1_AM27L(val) bfin_write16(CAN1_AM27L, val)
357#define bfin_read_CAN1_AM27H() bfin_read16(CAN1_AM27H)
358#define bfin_write_CAN1_AM27H(val) bfin_write16(CAN1_AM27H, val)
359#define bfin_read_CAN1_AM28L() bfin_read16(CAN1_AM28L)
360#define bfin_write_CAN1_AM28L(val) bfin_write16(CAN1_AM28L, val)
361#define bfin_read_CAN1_AM28H() bfin_read16(CAN1_AM28H)
362#define bfin_write_CAN1_AM28H(val) bfin_write16(CAN1_AM28H, val)
363#define bfin_read_CAN1_AM29L() bfin_read16(CAN1_AM29L)
364#define bfin_write_CAN1_AM29L(val) bfin_write16(CAN1_AM29L, val)
365#define bfin_read_CAN1_AM29H() bfin_read16(CAN1_AM29H)
366#define bfin_write_CAN1_AM29H(val) bfin_write16(CAN1_AM29H, val)
367#define bfin_read_CAN1_AM30L() bfin_read16(CAN1_AM30L)
368#define bfin_write_CAN1_AM30L(val) bfin_write16(CAN1_AM30L, val)
369#define bfin_read_CAN1_AM30H() bfin_read16(CAN1_AM30H)
370#define bfin_write_CAN1_AM30H(val) bfin_write16(CAN1_AM30H, val)
371#define bfin_read_CAN1_AM31L() bfin_read16(CAN1_AM31L)
372#define bfin_write_CAN1_AM31L(val) bfin_write16(CAN1_AM31L, val)
373#define bfin_read_CAN1_AM31H() bfin_read16(CAN1_AM31H)
374#define bfin_write_CAN1_AM31H(val) bfin_write16(CAN1_AM31H, val)
375
376/* CAN Controller 1 Mailbox Data Registers */
377
378#define bfin_read_CAN1_MB00_DATA0() bfin_read16(CAN1_MB00_DATA0)
379#define bfin_write_CAN1_MB00_DATA0(val) bfin_write16(CAN1_MB00_DATA0, val)
380#define bfin_read_CAN1_MB00_DATA1() bfin_read16(CAN1_MB00_DATA1)
381#define bfin_write_CAN1_MB00_DATA1(val) bfin_write16(CAN1_MB00_DATA1, val)
382#define bfin_read_CAN1_MB00_DATA2() bfin_read16(CAN1_MB00_DATA2)
383#define bfin_write_CAN1_MB00_DATA2(val) bfin_write16(CAN1_MB00_DATA2, val)
384#define bfin_read_CAN1_MB00_DATA3() bfin_read16(CAN1_MB00_DATA3)
385#define bfin_write_CAN1_MB00_DATA3(val) bfin_write16(CAN1_MB00_DATA3, val)
386#define bfin_read_CAN1_MB00_LENGTH() bfin_read16(CAN1_MB00_LENGTH)
387#define bfin_write_CAN1_MB00_LENGTH(val) bfin_write16(CAN1_MB00_LENGTH, val)
388#define bfin_read_CAN1_MB00_TIMESTAMP() bfin_read16(CAN1_MB00_TIMESTAMP)
389#define bfin_write_CAN1_MB00_TIMESTAMP(val) bfin_write16(CAN1_MB00_TIMESTAMP, val)
390#define bfin_read_CAN1_MB00_ID0() bfin_read16(CAN1_MB00_ID0)
391#define bfin_write_CAN1_MB00_ID0(val) bfin_write16(CAN1_MB00_ID0, val)
392#define bfin_read_CAN1_MB00_ID1() bfin_read16(CAN1_MB00_ID1)
393#define bfin_write_CAN1_MB00_ID1(val) bfin_write16(CAN1_MB00_ID1, val)
394#define bfin_read_CAN1_MB01_DATA0() bfin_read16(CAN1_MB01_DATA0)
395#define bfin_write_CAN1_MB01_DATA0(val) bfin_write16(CAN1_MB01_DATA0, val)
396#define bfin_read_CAN1_MB01_DATA1() bfin_read16(CAN1_MB01_DATA1)
397#define bfin_write_CAN1_MB01_DATA1(val) bfin_write16(CAN1_MB01_DATA1, val)
398#define bfin_read_CAN1_MB01_DATA2() bfin_read16(CAN1_MB01_DATA2)
399#define bfin_write_CAN1_MB01_DATA2(val) bfin_write16(CAN1_MB01_DATA2, val)
400#define bfin_read_CAN1_MB01_DATA3() bfin_read16(CAN1_MB01_DATA3)
401#define bfin_write_CAN1_MB01_DATA3(val) bfin_write16(CAN1_MB01_DATA3, val)
402#define bfin_read_CAN1_MB01_LENGTH() bfin_read16(CAN1_MB01_LENGTH)
403#define bfin_write_CAN1_MB01_LENGTH(val) bfin_write16(CAN1_MB01_LENGTH, val)
404#define bfin_read_CAN1_MB01_TIMESTAMP() bfin_read16(CAN1_MB01_TIMESTAMP)
405#define bfin_write_CAN1_MB01_TIMESTAMP(val) bfin_write16(CAN1_MB01_TIMESTAMP, val)
406#define bfin_read_CAN1_MB01_ID0() bfin_read16(CAN1_MB01_ID0)
407#define bfin_write_CAN1_MB01_ID0(val) bfin_write16(CAN1_MB01_ID0, val)
408#define bfin_read_CAN1_MB01_ID1() bfin_read16(CAN1_MB01_ID1)
409#define bfin_write_CAN1_MB01_ID1(val) bfin_write16(CAN1_MB01_ID1, val)
410#define bfin_read_CAN1_MB02_DATA0() bfin_read16(CAN1_MB02_DATA0)
411#define bfin_write_CAN1_MB02_DATA0(val) bfin_write16(CAN1_MB02_DATA0, val)
412#define bfin_read_CAN1_MB02_DATA1() bfin_read16(CAN1_MB02_DATA1)
413#define bfin_write_CAN1_MB02_DATA1(val) bfin_write16(CAN1_MB02_DATA1, val)
414#define bfin_read_CAN1_MB02_DATA2() bfin_read16(CAN1_MB02_DATA2)
415#define bfin_write_CAN1_MB02_DATA2(val) bfin_write16(CAN1_MB02_DATA2, val)
416#define bfin_read_CAN1_MB02_DATA3() bfin_read16(CAN1_MB02_DATA3)
417#define bfin_write_CAN1_MB02_DATA3(val) bfin_write16(CAN1_MB02_DATA3, val)
418#define bfin_read_CAN1_MB02_LENGTH() bfin_read16(CAN1_MB02_LENGTH)
419#define bfin_write_CAN1_MB02_LENGTH(val) bfin_write16(CAN1_MB02_LENGTH, val)
420#define bfin_read_CAN1_MB02_TIMESTAMP() bfin_read16(CAN1_MB02_TIMESTAMP)
421#define bfin_write_CAN1_MB02_TIMESTAMP(val) bfin_write16(CAN1_MB02_TIMESTAMP, val)
422#define bfin_read_CAN1_MB02_ID0() bfin_read16(CAN1_MB02_ID0)
423#define bfin_write_CAN1_MB02_ID0(val) bfin_write16(CAN1_MB02_ID0, val)
424#define bfin_read_CAN1_MB02_ID1() bfin_read16(CAN1_MB02_ID1)
425#define bfin_write_CAN1_MB02_ID1(val) bfin_write16(CAN1_MB02_ID1, val)
426#define bfin_read_CAN1_MB03_DATA0() bfin_read16(CAN1_MB03_DATA0)
427#define bfin_write_CAN1_MB03_DATA0(val) bfin_write16(CAN1_MB03_DATA0, val)
428#define bfin_read_CAN1_MB03_DATA1() bfin_read16(CAN1_MB03_DATA1)
429#define bfin_write_CAN1_MB03_DATA1(val) bfin_write16(CAN1_MB03_DATA1, val)
430#define bfin_read_CAN1_MB03_DATA2() bfin_read16(CAN1_MB03_DATA2)
431#define bfin_write_CAN1_MB03_DATA2(val) bfin_write16(CAN1_MB03_DATA2, val)
432#define bfin_read_CAN1_MB03_DATA3() bfin_read16(CAN1_MB03_DATA3)
433#define bfin_write_CAN1_MB03_DATA3(val) bfin_write16(CAN1_MB03_DATA3, val)
434#define bfin_read_CAN1_MB03_LENGTH() bfin_read16(CAN1_MB03_LENGTH)
435#define bfin_write_CAN1_MB03_LENGTH(val) bfin_write16(CAN1_MB03_LENGTH, val)
436#define bfin_read_CAN1_MB03_TIMESTAMP() bfin_read16(CAN1_MB03_TIMESTAMP)
437#define bfin_write_CAN1_MB03_TIMESTAMP(val) bfin_write16(CAN1_MB03_TIMESTAMP, val)
438#define bfin_read_CAN1_MB03_ID0() bfin_read16(CAN1_MB03_ID0)
439#define bfin_write_CAN1_MB03_ID0(val) bfin_write16(CAN1_MB03_ID0, val)
440#define bfin_read_CAN1_MB03_ID1() bfin_read16(CAN1_MB03_ID1)
441#define bfin_write_CAN1_MB03_ID1(val) bfin_write16(CAN1_MB03_ID1, val)
442#define bfin_read_CAN1_MB04_DATA0() bfin_read16(CAN1_MB04_DATA0)
443#define bfin_write_CAN1_MB04_DATA0(val) bfin_write16(CAN1_MB04_DATA0, val)
444#define bfin_read_CAN1_MB04_DATA1() bfin_read16(CAN1_MB04_DATA1)
445#define bfin_write_CAN1_MB04_DATA1(val) bfin_write16(CAN1_MB04_DATA1, val)
446#define bfin_read_CAN1_MB04_DATA2() bfin_read16(CAN1_MB04_DATA2)
447#define bfin_write_CAN1_MB04_DATA2(val) bfin_write16(CAN1_MB04_DATA2, val)
448#define bfin_read_CAN1_MB04_DATA3() bfin_read16(CAN1_MB04_DATA3)
449#define bfin_write_CAN1_MB04_DATA3(val) bfin_write16(CAN1_MB04_DATA3, val)
450#define bfin_read_CAN1_MB04_LENGTH() bfin_read16(CAN1_MB04_LENGTH)
451#define bfin_write_CAN1_MB04_LENGTH(val) bfin_write16(CAN1_MB04_LENGTH, val)
452#define bfin_read_CAN1_MB04_TIMESTAMP() bfin_read16(CAN1_MB04_TIMESTAMP)
453#define bfin_write_CAN1_MB04_TIMESTAMP(val) bfin_write16(CAN1_MB04_TIMESTAMP, val)
454#define bfin_read_CAN1_MB04_ID0() bfin_read16(CAN1_MB04_ID0)
455#define bfin_write_CAN1_MB04_ID0(val) bfin_write16(CAN1_MB04_ID0, val)
456#define bfin_read_CAN1_MB04_ID1() bfin_read16(CAN1_MB04_ID1)
457#define bfin_write_CAN1_MB04_ID1(val) bfin_write16(CAN1_MB04_ID1, val)
458#define bfin_read_CAN1_MB05_DATA0() bfin_read16(CAN1_MB05_DATA0)
459#define bfin_write_CAN1_MB05_DATA0(val) bfin_write16(CAN1_MB05_DATA0, val)
460#define bfin_read_CAN1_MB05_DATA1() bfin_read16(CAN1_MB05_DATA1)
461#define bfin_write_CAN1_MB05_DATA1(val) bfin_write16(CAN1_MB05_DATA1, val)
462#define bfin_read_CAN1_MB05_DATA2() bfin_read16(CAN1_MB05_DATA2)
463#define bfin_write_CAN1_MB05_DATA2(val) bfin_write16(CAN1_MB05_DATA2, val)
464#define bfin_read_CAN1_MB05_DATA3() bfin_read16(CAN1_MB05_DATA3)
465#define bfin_write_CAN1_MB05_DATA3(val) bfin_write16(CAN1_MB05_DATA3, val)
466#define bfin_read_CAN1_MB05_LENGTH() bfin_read16(CAN1_MB05_LENGTH)
467#define bfin_write_CAN1_MB05_LENGTH(val) bfin_write16(CAN1_MB05_LENGTH, val)
468#define bfin_read_CAN1_MB05_TIMESTAMP() bfin_read16(CAN1_MB05_TIMESTAMP)
469#define bfin_write_CAN1_MB05_TIMESTAMP(val) bfin_write16(CAN1_MB05_TIMESTAMP, val)
470#define bfin_read_CAN1_MB05_ID0() bfin_read16(CAN1_MB05_ID0)
471#define bfin_write_CAN1_MB05_ID0(val) bfin_write16(CAN1_MB05_ID0, val)
472#define bfin_read_CAN1_MB05_ID1() bfin_read16(CAN1_MB05_ID1)
473#define bfin_write_CAN1_MB05_ID1(val) bfin_write16(CAN1_MB05_ID1, val)
474#define bfin_read_CAN1_MB06_DATA0() bfin_read16(CAN1_MB06_DATA0)
475#define bfin_write_CAN1_MB06_DATA0(val) bfin_write16(CAN1_MB06_DATA0, val)
476#define bfin_read_CAN1_MB06_DATA1() bfin_read16(CAN1_MB06_DATA1)
477#define bfin_write_CAN1_MB06_DATA1(val) bfin_write16(CAN1_MB06_DATA1, val)
478#define bfin_read_CAN1_MB06_DATA2() bfin_read16(CAN1_MB06_DATA2)
479#define bfin_write_CAN1_MB06_DATA2(val) bfin_write16(CAN1_MB06_DATA2, val)
480#define bfin_read_CAN1_MB06_DATA3() bfin_read16(CAN1_MB06_DATA3)
481#define bfin_write_CAN1_MB06_DATA3(val) bfin_write16(CAN1_MB06_DATA3, val)
482#define bfin_read_CAN1_MB06_LENGTH() bfin_read16(CAN1_MB06_LENGTH)
483#define bfin_write_CAN1_MB06_LENGTH(val) bfin_write16(CAN1_MB06_LENGTH, val)
484#define bfin_read_CAN1_MB06_TIMESTAMP() bfin_read16(CAN1_MB06_TIMESTAMP)
485#define bfin_write_CAN1_MB06_TIMESTAMP(val) bfin_write16(CAN1_MB06_TIMESTAMP, val)
486#define bfin_read_CAN1_MB06_ID0() bfin_read16(CAN1_MB06_ID0)
487#define bfin_write_CAN1_MB06_ID0(val) bfin_write16(CAN1_MB06_ID0, val)
488#define bfin_read_CAN1_MB06_ID1() bfin_read16(CAN1_MB06_ID1)
489#define bfin_write_CAN1_MB06_ID1(val) bfin_write16(CAN1_MB06_ID1, val)
490#define bfin_read_CAN1_MB07_DATA0() bfin_read16(CAN1_MB07_DATA0)
491#define bfin_write_CAN1_MB07_DATA0(val) bfin_write16(CAN1_MB07_DATA0, val)
492#define bfin_read_CAN1_MB07_DATA1() bfin_read16(CAN1_MB07_DATA1)
493#define bfin_write_CAN1_MB07_DATA1(val) bfin_write16(CAN1_MB07_DATA1, val)
494#define bfin_read_CAN1_MB07_DATA2() bfin_read16(CAN1_MB07_DATA2)
495#define bfin_write_CAN1_MB07_DATA2(val) bfin_write16(CAN1_MB07_DATA2, val)
496#define bfin_read_CAN1_MB07_DATA3() bfin_read16(CAN1_MB07_DATA3)
497#define bfin_write_CAN1_MB07_DATA3(val) bfin_write16(CAN1_MB07_DATA3, val)
498#define bfin_read_CAN1_MB07_LENGTH() bfin_read16(CAN1_MB07_LENGTH)
499#define bfin_write_CAN1_MB07_LENGTH(val) bfin_write16(CAN1_MB07_LENGTH, val)
500#define bfin_read_CAN1_MB07_TIMESTAMP() bfin_read16(CAN1_MB07_TIMESTAMP)
501#define bfin_write_CAN1_MB07_TIMESTAMP(val) bfin_write16(CAN1_MB07_TIMESTAMP, val)
502#define bfin_read_CAN1_MB07_ID0() bfin_read16(CAN1_MB07_ID0)
503#define bfin_write_CAN1_MB07_ID0(val) bfin_write16(CAN1_MB07_ID0, val)
504#define bfin_read_CAN1_MB07_ID1() bfin_read16(CAN1_MB07_ID1)
505#define bfin_write_CAN1_MB07_ID1(val) bfin_write16(CAN1_MB07_ID1, val)
506#define bfin_read_CAN1_MB08_DATA0() bfin_read16(CAN1_MB08_DATA0)
507#define bfin_write_CAN1_MB08_DATA0(val) bfin_write16(CAN1_MB08_DATA0, val)
508#define bfin_read_CAN1_MB08_DATA1() bfin_read16(CAN1_MB08_DATA1)
509#define bfin_write_CAN1_MB08_DATA1(val) bfin_write16(CAN1_MB08_DATA1, val)
510#define bfin_read_CAN1_MB08_DATA2() bfin_read16(CAN1_MB08_DATA2)
511#define bfin_write_CAN1_MB08_DATA2(val) bfin_write16(CAN1_MB08_DATA2, val)
512#define bfin_read_CAN1_MB08_DATA3() bfin_read16(CAN1_MB08_DATA3)
513#define bfin_write_CAN1_MB08_DATA3(val) bfin_write16(CAN1_MB08_DATA3, val)
514#define bfin_read_CAN1_MB08_LENGTH() bfin_read16(CAN1_MB08_LENGTH)
515#define bfin_write_CAN1_MB08_LENGTH(val) bfin_write16(CAN1_MB08_LENGTH, val)
516#define bfin_read_CAN1_MB08_TIMESTAMP() bfin_read16(CAN1_MB08_TIMESTAMP)
517#define bfin_write_CAN1_MB08_TIMESTAMP(val) bfin_write16(CAN1_MB08_TIMESTAMP, val)
518#define bfin_read_CAN1_MB08_ID0() bfin_read16(CAN1_MB08_ID0)
519#define bfin_write_CAN1_MB08_ID0(val) bfin_write16(CAN1_MB08_ID0, val)
520#define bfin_read_CAN1_MB08_ID1() bfin_read16(CAN1_MB08_ID1)
521#define bfin_write_CAN1_MB08_ID1(val) bfin_write16(CAN1_MB08_ID1, val)
522#define bfin_read_CAN1_MB09_DATA0() bfin_read16(CAN1_MB09_DATA0)
523#define bfin_write_CAN1_MB09_DATA0(val) bfin_write16(CAN1_MB09_DATA0, val)
524#define bfin_read_CAN1_MB09_DATA1() bfin_read16(CAN1_MB09_DATA1)
525#define bfin_write_CAN1_MB09_DATA1(val) bfin_write16(CAN1_MB09_DATA1, val)
526#define bfin_read_CAN1_MB09_DATA2() bfin_read16(CAN1_MB09_DATA2)
527#define bfin_write_CAN1_MB09_DATA2(val) bfin_write16(CAN1_MB09_DATA2, val)
528#define bfin_read_CAN1_MB09_DATA3() bfin_read16(CAN1_MB09_DATA3)
529#define bfin_write_CAN1_MB09_DATA3(val) bfin_write16(CAN1_MB09_DATA3, val)
530#define bfin_read_CAN1_MB09_LENGTH() bfin_read16(CAN1_MB09_LENGTH)
531#define bfin_write_CAN1_MB09_LENGTH(val) bfin_write16(CAN1_MB09_LENGTH, val)
532#define bfin_read_CAN1_MB09_TIMESTAMP() bfin_read16(CAN1_MB09_TIMESTAMP)
533#define bfin_write_CAN1_MB09_TIMESTAMP(val) bfin_write16(CAN1_MB09_TIMESTAMP, val)
534#define bfin_read_CAN1_MB09_ID0() bfin_read16(CAN1_MB09_ID0)
535#define bfin_write_CAN1_MB09_ID0(val) bfin_write16(CAN1_MB09_ID0, val)
536#define bfin_read_CAN1_MB09_ID1() bfin_read16(CAN1_MB09_ID1)
537#define bfin_write_CAN1_MB09_ID1(val) bfin_write16(CAN1_MB09_ID1, val)
538#define bfin_read_CAN1_MB10_DATA0() bfin_read16(CAN1_MB10_DATA0)
539#define bfin_write_CAN1_MB10_DATA0(val) bfin_write16(CAN1_MB10_DATA0, val)
540#define bfin_read_CAN1_MB10_DATA1() bfin_read16(CAN1_MB10_DATA1)
541#define bfin_write_CAN1_MB10_DATA1(val) bfin_write16(CAN1_MB10_DATA1, val)
542#define bfin_read_CAN1_MB10_DATA2() bfin_read16(CAN1_MB10_DATA2)
543#define bfin_write_CAN1_MB10_DATA2(val) bfin_write16(CAN1_MB10_DATA2, val)
544#define bfin_read_CAN1_MB10_DATA3() bfin_read16(CAN1_MB10_DATA3)
545#define bfin_write_CAN1_MB10_DATA3(val) bfin_write16(CAN1_MB10_DATA3, val)
546#define bfin_read_CAN1_MB10_LENGTH() bfin_read16(CAN1_MB10_LENGTH)
547#define bfin_write_CAN1_MB10_LENGTH(val) bfin_write16(CAN1_MB10_LENGTH, val)
548#define bfin_read_CAN1_MB10_TIMESTAMP() bfin_read16(CAN1_MB10_TIMESTAMP)
549#define bfin_write_CAN1_MB10_TIMESTAMP(val) bfin_write16(CAN1_MB10_TIMESTAMP, val)
550#define bfin_read_CAN1_MB10_ID0() bfin_read16(CAN1_MB10_ID0)
551#define bfin_write_CAN1_MB10_ID0(val) bfin_write16(CAN1_MB10_ID0, val)
552#define bfin_read_CAN1_MB10_ID1() bfin_read16(CAN1_MB10_ID1)
553#define bfin_write_CAN1_MB10_ID1(val) bfin_write16(CAN1_MB10_ID1, val)
554#define bfin_read_CAN1_MB11_DATA0() bfin_read16(CAN1_MB11_DATA0)
555#define bfin_write_CAN1_MB11_DATA0(val) bfin_write16(CAN1_MB11_DATA0, val)
556#define bfin_read_CAN1_MB11_DATA1() bfin_read16(CAN1_MB11_DATA1)
557#define bfin_write_CAN1_MB11_DATA1(val) bfin_write16(CAN1_MB11_DATA1, val)
558#define bfin_read_CAN1_MB11_DATA2() bfin_read16(CAN1_MB11_DATA2)
559#define bfin_write_CAN1_MB11_DATA2(val) bfin_write16(CAN1_MB11_DATA2, val)
560#define bfin_read_CAN1_MB11_DATA3() bfin_read16(CAN1_MB11_DATA3)
561#define bfin_write_CAN1_MB11_DATA3(val) bfin_write16(CAN1_MB11_DATA3, val)
562#define bfin_read_CAN1_MB11_LENGTH() bfin_read16(CAN1_MB11_LENGTH)
563#define bfin_write_CAN1_MB11_LENGTH(val) bfin_write16(CAN1_MB11_LENGTH, val)
564#define bfin_read_CAN1_MB11_TIMESTAMP() bfin_read16(CAN1_MB11_TIMESTAMP)
565#define bfin_write_CAN1_MB11_TIMESTAMP(val) bfin_write16(CAN1_MB11_TIMESTAMP, val)
566#define bfin_read_CAN1_MB11_ID0() bfin_read16(CAN1_MB11_ID0)
567#define bfin_write_CAN1_MB11_ID0(val) bfin_write16(CAN1_MB11_ID0, val)
568#define bfin_read_CAN1_MB11_ID1() bfin_read16(CAN1_MB11_ID1)
569#define bfin_write_CAN1_MB11_ID1(val) bfin_write16(CAN1_MB11_ID1, val)
570#define bfin_read_CAN1_MB12_DATA0() bfin_read16(CAN1_MB12_DATA0)
571#define bfin_write_CAN1_MB12_DATA0(val) bfin_write16(CAN1_MB12_DATA0, val)
572#define bfin_read_CAN1_MB12_DATA1() bfin_read16(CAN1_MB12_DATA1)
573#define bfin_write_CAN1_MB12_DATA1(val) bfin_write16(CAN1_MB12_DATA1, val)
574#define bfin_read_CAN1_MB12_DATA2() bfin_read16(CAN1_MB12_DATA2)
575#define bfin_write_CAN1_MB12_DATA2(val) bfin_write16(CAN1_MB12_DATA2, val)
576#define bfin_read_CAN1_MB12_DATA3() bfin_read16(CAN1_MB12_DATA3)
577#define bfin_write_CAN1_MB12_DATA3(val) bfin_write16(CAN1_MB12_DATA3, val)
578#define bfin_read_CAN1_MB12_LENGTH() bfin_read16(CAN1_MB12_LENGTH)
579#define bfin_write_CAN1_MB12_LENGTH(val) bfin_write16(CAN1_MB12_LENGTH, val)
580#define bfin_read_CAN1_MB12_TIMESTAMP() bfin_read16(CAN1_MB12_TIMESTAMP)
581#define bfin_write_CAN1_MB12_TIMESTAMP(val) bfin_write16(CAN1_MB12_TIMESTAMP, val)
582#define bfin_read_CAN1_MB12_ID0() bfin_read16(CAN1_MB12_ID0)
583#define bfin_write_CAN1_MB12_ID0(val) bfin_write16(CAN1_MB12_ID0, val)
584#define bfin_read_CAN1_MB12_ID1() bfin_read16(CAN1_MB12_ID1)
585#define bfin_write_CAN1_MB12_ID1(val) bfin_write16(CAN1_MB12_ID1, val)
586#define bfin_read_CAN1_MB13_DATA0() bfin_read16(CAN1_MB13_DATA0)
587#define bfin_write_CAN1_MB13_DATA0(val) bfin_write16(CAN1_MB13_DATA0, val)
588#define bfin_read_CAN1_MB13_DATA1() bfin_read16(CAN1_MB13_DATA1)
589#define bfin_write_CAN1_MB13_DATA1(val) bfin_write16(CAN1_MB13_DATA1, val)
590#define bfin_read_CAN1_MB13_DATA2() bfin_read16(CAN1_MB13_DATA2)
591#define bfin_write_CAN1_MB13_DATA2(val) bfin_write16(CAN1_MB13_DATA2, val)
592#define bfin_read_CAN1_MB13_DATA3() bfin_read16(CAN1_MB13_DATA3)
593#define bfin_write_CAN1_MB13_DATA3(val) bfin_write16(CAN1_MB13_DATA3, val)
594#define bfin_read_CAN1_MB13_LENGTH() bfin_read16(CAN1_MB13_LENGTH)
595#define bfin_write_CAN1_MB13_LENGTH(val) bfin_write16(CAN1_MB13_LENGTH, val)
596#define bfin_read_CAN1_MB13_TIMESTAMP() bfin_read16(CAN1_MB13_TIMESTAMP)
597#define bfin_write_CAN1_MB13_TIMESTAMP(val) bfin_write16(CAN1_MB13_TIMESTAMP, val)
598#define bfin_read_CAN1_MB13_ID0() bfin_read16(CAN1_MB13_ID0)
599#define bfin_write_CAN1_MB13_ID0(val) bfin_write16(CAN1_MB13_ID0, val)
600#define bfin_read_CAN1_MB13_ID1() bfin_read16(CAN1_MB13_ID1)
601#define bfin_write_CAN1_MB13_ID1(val) bfin_write16(CAN1_MB13_ID1, val)
602#define bfin_read_CAN1_MB14_DATA0() bfin_read16(CAN1_MB14_DATA0)
603#define bfin_write_CAN1_MB14_DATA0(val) bfin_write16(CAN1_MB14_DATA0, val)
604#define bfin_read_CAN1_MB14_DATA1() bfin_read16(CAN1_MB14_DATA1)
605#define bfin_write_CAN1_MB14_DATA1(val) bfin_write16(CAN1_MB14_DATA1, val)
606#define bfin_read_CAN1_MB14_DATA2() bfin_read16(CAN1_MB14_DATA2)
607#define bfin_write_CAN1_MB14_DATA2(val) bfin_write16(CAN1_MB14_DATA2, val)
608#define bfin_read_CAN1_MB14_DATA3() bfin_read16(CAN1_MB14_DATA3)
609#define bfin_write_CAN1_MB14_DATA3(val) bfin_write16(CAN1_MB14_DATA3, val)
610#define bfin_read_CAN1_MB14_LENGTH() bfin_read16(CAN1_MB14_LENGTH)
611#define bfin_write_CAN1_MB14_LENGTH(val) bfin_write16(CAN1_MB14_LENGTH, val)
612#define bfin_read_CAN1_MB14_TIMESTAMP() bfin_read16(CAN1_MB14_TIMESTAMP)
613#define bfin_write_CAN1_MB14_TIMESTAMP(val) bfin_write16(CAN1_MB14_TIMESTAMP, val)
614#define bfin_read_CAN1_MB14_ID0() bfin_read16(CAN1_MB14_ID0)
615#define bfin_write_CAN1_MB14_ID0(val) bfin_write16(CAN1_MB14_ID0, val)
616#define bfin_read_CAN1_MB14_ID1() bfin_read16(CAN1_MB14_ID1)
617#define bfin_write_CAN1_MB14_ID1(val) bfin_write16(CAN1_MB14_ID1, val)
618#define bfin_read_CAN1_MB15_DATA0() bfin_read16(CAN1_MB15_DATA0)
619#define bfin_write_CAN1_MB15_DATA0(val) bfin_write16(CAN1_MB15_DATA0, val)
620#define bfin_read_CAN1_MB15_DATA1() bfin_read16(CAN1_MB15_DATA1)
621#define bfin_write_CAN1_MB15_DATA1(val) bfin_write16(CAN1_MB15_DATA1, val)
622#define bfin_read_CAN1_MB15_DATA2() bfin_read16(CAN1_MB15_DATA2)
623#define bfin_write_CAN1_MB15_DATA2(val) bfin_write16(CAN1_MB15_DATA2, val)
624#define bfin_read_CAN1_MB15_DATA3() bfin_read16(CAN1_MB15_DATA3)
625#define bfin_write_CAN1_MB15_DATA3(val) bfin_write16(CAN1_MB15_DATA3, val)
626#define bfin_read_CAN1_MB15_LENGTH() bfin_read16(CAN1_MB15_LENGTH)
627#define bfin_write_CAN1_MB15_LENGTH(val) bfin_write16(CAN1_MB15_LENGTH, val)
628#define bfin_read_CAN1_MB15_TIMESTAMP() bfin_read16(CAN1_MB15_TIMESTAMP)
629#define bfin_write_CAN1_MB15_TIMESTAMP(val) bfin_write16(CAN1_MB15_TIMESTAMP, val)
630#define bfin_read_CAN1_MB15_ID0() bfin_read16(CAN1_MB15_ID0)
631#define bfin_write_CAN1_MB15_ID0(val) bfin_write16(CAN1_MB15_ID0, val)
632#define bfin_read_CAN1_MB15_ID1() bfin_read16(CAN1_MB15_ID1)
633#define bfin_write_CAN1_MB15_ID1(val) bfin_write16(CAN1_MB15_ID1, val)
634
635/* CAN Controller 1 Mailbox Data Registers */
636
637#define bfin_read_CAN1_MB16_DATA0() bfin_read16(CAN1_MB16_DATA0)
638#define bfin_write_CAN1_MB16_DATA0(val) bfin_write16(CAN1_MB16_DATA0, val)
639#define bfin_read_CAN1_MB16_DATA1() bfin_read16(CAN1_MB16_DATA1)
640#define bfin_write_CAN1_MB16_DATA1(val) bfin_write16(CAN1_MB16_DATA1, val)
641#define bfin_read_CAN1_MB16_DATA2() bfin_read16(CAN1_MB16_DATA2)
642#define bfin_write_CAN1_MB16_DATA2(val) bfin_write16(CAN1_MB16_DATA2, val)
643#define bfin_read_CAN1_MB16_DATA3() bfin_read16(CAN1_MB16_DATA3)
644#define bfin_write_CAN1_MB16_DATA3(val) bfin_write16(CAN1_MB16_DATA3, val)
645#define bfin_read_CAN1_MB16_LENGTH() bfin_read16(CAN1_MB16_LENGTH)
646#define bfin_write_CAN1_MB16_LENGTH(val) bfin_write16(CAN1_MB16_LENGTH, val)
647#define bfin_read_CAN1_MB16_TIMESTAMP() bfin_read16(CAN1_MB16_TIMESTAMP)
648#define bfin_write_CAN1_MB16_TIMESTAMP(val) bfin_write16(CAN1_MB16_TIMESTAMP, val)
649#define bfin_read_CAN1_MB16_ID0() bfin_read16(CAN1_MB16_ID0)
650#define bfin_write_CAN1_MB16_ID0(val) bfin_write16(CAN1_MB16_ID0, val)
651#define bfin_read_CAN1_MB16_ID1() bfin_read16(CAN1_MB16_ID1)
652#define bfin_write_CAN1_MB16_ID1(val) bfin_write16(CAN1_MB16_ID1, val)
653#define bfin_read_CAN1_MB17_DATA0() bfin_read16(CAN1_MB17_DATA0)
654#define bfin_write_CAN1_MB17_DATA0(val) bfin_write16(CAN1_MB17_DATA0, val)
655#define bfin_read_CAN1_MB17_DATA1() bfin_read16(CAN1_MB17_DATA1)
656#define bfin_write_CAN1_MB17_DATA1(val) bfin_write16(CAN1_MB17_DATA1, val)
657#define bfin_read_CAN1_MB17_DATA2() bfin_read16(CAN1_MB17_DATA2)
658#define bfin_write_CAN1_MB17_DATA2(val) bfin_write16(CAN1_MB17_DATA2, val)
659#define bfin_read_CAN1_MB17_DATA3() bfin_read16(CAN1_MB17_DATA3)
660#define bfin_write_CAN1_MB17_DATA3(val) bfin_write16(CAN1_MB17_DATA3, val)
661#define bfin_read_CAN1_MB17_LENGTH() bfin_read16(CAN1_MB17_LENGTH)
662#define bfin_write_CAN1_MB17_LENGTH(val) bfin_write16(CAN1_MB17_LENGTH, val)
663#define bfin_read_CAN1_MB17_TIMESTAMP() bfin_read16(CAN1_MB17_TIMESTAMP)
664#define bfin_write_CAN1_MB17_TIMESTAMP(val) bfin_write16(CAN1_MB17_TIMESTAMP, val)
665#define bfin_read_CAN1_MB17_ID0() bfin_read16(CAN1_MB17_ID0)
666#define bfin_write_CAN1_MB17_ID0(val) bfin_write16(CAN1_MB17_ID0, val)
667#define bfin_read_CAN1_MB17_ID1() bfin_read16(CAN1_MB17_ID1)
668#define bfin_write_CAN1_MB17_ID1(val) bfin_write16(CAN1_MB17_ID1, val)
669#define bfin_read_CAN1_MB18_DATA0() bfin_read16(CAN1_MB18_DATA0)
670#define bfin_write_CAN1_MB18_DATA0(val) bfin_write16(CAN1_MB18_DATA0, val)
671#define bfin_read_CAN1_MB18_DATA1() bfin_read16(CAN1_MB18_DATA1)
672#define bfin_write_CAN1_MB18_DATA1(val) bfin_write16(CAN1_MB18_DATA1, val)
673#define bfin_read_CAN1_MB18_DATA2() bfin_read16(CAN1_MB18_DATA2)
674#define bfin_write_CAN1_MB18_DATA2(val) bfin_write16(CAN1_MB18_DATA2, val)
675#define bfin_read_CAN1_MB18_DATA3() bfin_read16(CAN1_MB18_DATA3)
676#define bfin_write_CAN1_MB18_DATA3(val) bfin_write16(CAN1_MB18_DATA3, val)
677#define bfin_read_CAN1_MB18_LENGTH() bfin_read16(CAN1_MB18_LENGTH)
678#define bfin_write_CAN1_MB18_LENGTH(val) bfin_write16(CAN1_MB18_LENGTH, val)
679#define bfin_read_CAN1_MB18_TIMESTAMP() bfin_read16(CAN1_MB18_TIMESTAMP)
680#define bfin_write_CAN1_MB18_TIMESTAMP(val) bfin_write16(CAN1_MB18_TIMESTAMP, val)
681#define bfin_read_CAN1_MB18_ID0() bfin_read16(CAN1_MB18_ID0)
682#define bfin_write_CAN1_MB18_ID0(val) bfin_write16(CAN1_MB18_ID0, val)
683#define bfin_read_CAN1_MB18_ID1() bfin_read16(CAN1_MB18_ID1)
684#define bfin_write_CAN1_MB18_ID1(val) bfin_write16(CAN1_MB18_ID1, val)
685#define bfin_read_CAN1_MB19_DATA0() bfin_read16(CAN1_MB19_DATA0)
686#define bfin_write_CAN1_MB19_DATA0(val) bfin_write16(CAN1_MB19_DATA0, val)
687#define bfin_read_CAN1_MB19_DATA1() bfin_read16(CAN1_MB19_DATA1)
688#define bfin_write_CAN1_MB19_DATA1(val) bfin_write16(CAN1_MB19_DATA1, val)
689#define bfin_read_CAN1_MB19_DATA2() bfin_read16(CAN1_MB19_DATA2)
690#define bfin_write_CAN1_MB19_DATA2(val) bfin_write16(CAN1_MB19_DATA2, val)
691#define bfin_read_CAN1_MB19_DATA3() bfin_read16(CAN1_MB19_DATA3)
692#define bfin_write_CAN1_MB19_DATA3(val) bfin_write16(CAN1_MB19_DATA3, val)
693#define bfin_read_CAN1_MB19_LENGTH() bfin_read16(CAN1_MB19_LENGTH)
694#define bfin_write_CAN1_MB19_LENGTH(val) bfin_write16(CAN1_MB19_LENGTH, val)
695#define bfin_read_CAN1_MB19_TIMESTAMP() bfin_read16(CAN1_MB19_TIMESTAMP)
696#define bfin_write_CAN1_MB19_TIMESTAMP(val) bfin_write16(CAN1_MB19_TIMESTAMP, val)
697#define bfin_read_CAN1_MB19_ID0() bfin_read16(CAN1_MB19_ID0)
698#define bfin_write_CAN1_MB19_ID0(val) bfin_write16(CAN1_MB19_ID0, val)
699#define bfin_read_CAN1_MB19_ID1() bfin_read16(CAN1_MB19_ID1)
700#define bfin_write_CAN1_MB19_ID1(val) bfin_write16(CAN1_MB19_ID1, val)
701#define bfin_read_CAN1_MB20_DATA0() bfin_read16(CAN1_MB20_DATA0)
702#define bfin_write_CAN1_MB20_DATA0(val) bfin_write16(CAN1_MB20_DATA0, val)
703#define bfin_read_CAN1_MB20_DATA1() bfin_read16(CAN1_MB20_DATA1)
704#define bfin_write_CAN1_MB20_DATA1(val) bfin_write16(CAN1_MB20_DATA1, val)
705#define bfin_read_CAN1_MB20_DATA2() bfin_read16(CAN1_MB20_DATA2)
706#define bfin_write_CAN1_MB20_DATA2(val) bfin_write16(CAN1_MB20_DATA2, val)
707#define bfin_read_CAN1_MB20_DATA3() bfin_read16(CAN1_MB20_DATA3)
708#define bfin_write_CAN1_MB20_DATA3(val) bfin_write16(CAN1_MB20_DATA3, val)
709#define bfin_read_CAN1_MB20_LENGTH() bfin_read16(CAN1_MB20_LENGTH)
710#define bfin_write_CAN1_MB20_LENGTH(val) bfin_write16(CAN1_MB20_LENGTH, val)
711#define bfin_read_CAN1_MB20_TIMESTAMP() bfin_read16(CAN1_MB20_TIMESTAMP)
712#define bfin_write_CAN1_MB20_TIMESTAMP(val) bfin_write16(CAN1_MB20_TIMESTAMP, val)
713#define bfin_read_CAN1_MB20_ID0() bfin_read16(CAN1_MB20_ID0)
714#define bfin_write_CAN1_MB20_ID0(val) bfin_write16(CAN1_MB20_ID0, val)
715#define bfin_read_CAN1_MB20_ID1() bfin_read16(CAN1_MB20_ID1)
716#define bfin_write_CAN1_MB20_ID1(val) bfin_write16(CAN1_MB20_ID1, val)
717#define bfin_read_CAN1_MB21_DATA0() bfin_read16(CAN1_MB21_DATA0)
718#define bfin_write_CAN1_MB21_DATA0(val) bfin_write16(CAN1_MB21_DATA0, val)
719#define bfin_read_CAN1_MB21_DATA1() bfin_read16(CAN1_MB21_DATA1)
720#define bfin_write_CAN1_MB21_DATA1(val) bfin_write16(CAN1_MB21_DATA1, val)
721#define bfin_read_CAN1_MB21_DATA2() bfin_read16(CAN1_MB21_DATA2)
722#define bfin_write_CAN1_MB21_DATA2(val) bfin_write16(CAN1_MB21_DATA2, val)
723#define bfin_read_CAN1_MB21_DATA3() bfin_read16(CAN1_MB21_DATA3)
724#define bfin_write_CAN1_MB21_DATA3(val) bfin_write16(CAN1_MB21_DATA3, val)
725#define bfin_read_CAN1_MB21_LENGTH() bfin_read16(CAN1_MB21_LENGTH)
726#define bfin_write_CAN1_MB21_LENGTH(val) bfin_write16(CAN1_MB21_LENGTH, val)
727#define bfin_read_CAN1_MB21_TIMESTAMP() bfin_read16(CAN1_MB21_TIMESTAMP)
728#define bfin_write_CAN1_MB21_TIMESTAMP(val) bfin_write16(CAN1_MB21_TIMESTAMP, val)
729#define bfin_read_CAN1_MB21_ID0() bfin_read16(CAN1_MB21_ID0)
730#define bfin_write_CAN1_MB21_ID0(val) bfin_write16(CAN1_MB21_ID0, val)
731#define bfin_read_CAN1_MB21_ID1() bfin_read16(CAN1_MB21_ID1)
732#define bfin_write_CAN1_MB21_ID1(val) bfin_write16(CAN1_MB21_ID1, val)
733#define bfin_read_CAN1_MB22_DATA0() bfin_read16(CAN1_MB22_DATA0)
734#define bfin_write_CAN1_MB22_DATA0(val) bfin_write16(CAN1_MB22_DATA0, val)
735#define bfin_read_CAN1_MB22_DATA1() bfin_read16(CAN1_MB22_DATA1)
736#define bfin_write_CAN1_MB22_DATA1(val) bfin_write16(CAN1_MB22_DATA1, val)
737#define bfin_read_CAN1_MB22_DATA2() bfin_read16(CAN1_MB22_DATA2)
738#define bfin_write_CAN1_MB22_DATA2(val) bfin_write16(CAN1_MB22_DATA2, val)
739#define bfin_read_CAN1_MB22_DATA3() bfin_read16(CAN1_MB22_DATA3)
740#define bfin_write_CAN1_MB22_DATA3(val) bfin_write16(CAN1_MB22_DATA3, val)
741#define bfin_read_CAN1_MB22_LENGTH() bfin_read16(CAN1_MB22_LENGTH)
742#define bfin_write_CAN1_MB22_LENGTH(val) bfin_write16(CAN1_MB22_LENGTH, val)
743#define bfin_read_CAN1_MB22_TIMESTAMP() bfin_read16(CAN1_MB22_TIMESTAMP)
744#define bfin_write_CAN1_MB22_TIMESTAMP(val) bfin_write16(CAN1_MB22_TIMESTAMP, val)
745#define bfin_read_CAN1_MB22_ID0() bfin_read16(CAN1_MB22_ID0)
746#define bfin_write_CAN1_MB22_ID0(val) bfin_write16(CAN1_MB22_ID0, val)
747#define bfin_read_CAN1_MB22_ID1() bfin_read16(CAN1_MB22_ID1)
748#define bfin_write_CAN1_MB22_ID1(val) bfin_write16(CAN1_MB22_ID1, val)
749#define bfin_read_CAN1_MB23_DATA0() bfin_read16(CAN1_MB23_DATA0)
750#define bfin_write_CAN1_MB23_DATA0(val) bfin_write16(CAN1_MB23_DATA0, val)
751#define bfin_read_CAN1_MB23_DATA1() bfin_read16(CAN1_MB23_DATA1)
752#define bfin_write_CAN1_MB23_DATA1(val) bfin_write16(CAN1_MB23_DATA1, val)
753#define bfin_read_CAN1_MB23_DATA2() bfin_read16(CAN1_MB23_DATA2)
754#define bfin_write_CAN1_MB23_DATA2(val) bfin_write16(CAN1_MB23_DATA2, val)
755#define bfin_read_CAN1_MB23_DATA3() bfin_read16(CAN1_MB23_DATA3)
756#define bfin_write_CAN1_MB23_DATA3(val) bfin_write16(CAN1_MB23_DATA3, val)
757#define bfin_read_CAN1_MB23_LENGTH() bfin_read16(CAN1_MB23_LENGTH)
758#define bfin_write_CAN1_MB23_LENGTH(val) bfin_write16(CAN1_MB23_LENGTH, val)
759#define bfin_read_CAN1_MB23_TIMESTAMP() bfin_read16(CAN1_MB23_TIMESTAMP)
760#define bfin_write_CAN1_MB23_TIMESTAMP(val) bfin_write16(CAN1_MB23_TIMESTAMP, val)
761#define bfin_read_CAN1_MB23_ID0() bfin_read16(CAN1_MB23_ID0)
762#define bfin_write_CAN1_MB23_ID0(val) bfin_write16(CAN1_MB23_ID0, val)
763#define bfin_read_CAN1_MB23_ID1() bfin_read16(CAN1_MB23_ID1)
764#define bfin_write_CAN1_MB23_ID1(val) bfin_write16(CAN1_MB23_ID1, val)
765#define bfin_read_CAN1_MB24_DATA0() bfin_read16(CAN1_MB24_DATA0)
766#define bfin_write_CAN1_MB24_DATA0(val) bfin_write16(CAN1_MB24_DATA0, val)
767#define bfin_read_CAN1_MB24_DATA1() bfin_read16(CAN1_MB24_DATA1)
768#define bfin_write_CAN1_MB24_DATA1(val) bfin_write16(CAN1_MB24_DATA1, val)
769#define bfin_read_CAN1_MB24_DATA2() bfin_read16(CAN1_MB24_DATA2)
770#define bfin_write_CAN1_MB24_DATA2(val) bfin_write16(CAN1_MB24_DATA2, val)
771#define bfin_read_CAN1_MB24_DATA3() bfin_read16(CAN1_MB24_DATA3)
772#define bfin_write_CAN1_MB24_DATA3(val) bfin_write16(CAN1_MB24_DATA3, val)
773#define bfin_read_CAN1_MB24_LENGTH() bfin_read16(CAN1_MB24_LENGTH)
774#define bfin_write_CAN1_MB24_LENGTH(val) bfin_write16(CAN1_MB24_LENGTH, val)
775#define bfin_read_CAN1_MB24_TIMESTAMP() bfin_read16(CAN1_MB24_TIMESTAMP)
776#define bfin_write_CAN1_MB24_TIMESTAMP(val) bfin_write16(CAN1_MB24_TIMESTAMP, val)
777#define bfin_read_CAN1_MB24_ID0() bfin_read16(CAN1_MB24_ID0)
778#define bfin_write_CAN1_MB24_ID0(val) bfin_write16(CAN1_MB24_ID0, val)
779#define bfin_read_CAN1_MB24_ID1() bfin_read16(CAN1_MB24_ID1)
780#define bfin_write_CAN1_MB24_ID1(val) bfin_write16(CAN1_MB24_ID1, val)
781#define bfin_read_CAN1_MB25_DATA0() bfin_read16(CAN1_MB25_DATA0)
782#define bfin_write_CAN1_MB25_DATA0(val) bfin_write16(CAN1_MB25_DATA0, val)
783#define bfin_read_CAN1_MB25_DATA1() bfin_read16(CAN1_MB25_DATA1)
784#define bfin_write_CAN1_MB25_DATA1(val) bfin_write16(CAN1_MB25_DATA1, val)
785#define bfin_read_CAN1_MB25_DATA2() bfin_read16(CAN1_MB25_DATA2)
786#define bfin_write_CAN1_MB25_DATA2(val) bfin_write16(CAN1_MB25_DATA2, val)
787#define bfin_read_CAN1_MB25_DATA3() bfin_read16(CAN1_MB25_DATA3)
788#define bfin_write_CAN1_MB25_DATA3(val) bfin_write16(CAN1_MB25_DATA3, val)
789#define bfin_read_CAN1_MB25_LENGTH() bfin_read16(CAN1_MB25_LENGTH)
790#define bfin_write_CAN1_MB25_LENGTH(val) bfin_write16(CAN1_MB25_LENGTH, val)
791#define bfin_read_CAN1_MB25_TIMESTAMP() bfin_read16(CAN1_MB25_TIMESTAMP)
792#define bfin_write_CAN1_MB25_TIMESTAMP(val) bfin_write16(CAN1_MB25_TIMESTAMP, val)
793#define bfin_read_CAN1_MB25_ID0() bfin_read16(CAN1_MB25_ID0)
794#define bfin_write_CAN1_MB25_ID0(val) bfin_write16(CAN1_MB25_ID0, val)
795#define bfin_read_CAN1_MB25_ID1() bfin_read16(CAN1_MB25_ID1)
796#define bfin_write_CAN1_MB25_ID1(val) bfin_write16(CAN1_MB25_ID1, val)
797#define bfin_read_CAN1_MB26_DATA0() bfin_read16(CAN1_MB26_DATA0)
798#define bfin_write_CAN1_MB26_DATA0(val) bfin_write16(CAN1_MB26_DATA0, val)
799#define bfin_read_CAN1_MB26_DATA1() bfin_read16(CAN1_MB26_DATA1)
800#define bfin_write_CAN1_MB26_DATA1(val) bfin_write16(CAN1_MB26_DATA1, val)
801#define bfin_read_CAN1_MB26_DATA2() bfin_read16(CAN1_MB26_DATA2)
802#define bfin_write_CAN1_MB26_DATA2(val) bfin_write16(CAN1_MB26_DATA2, val)
803#define bfin_read_CAN1_MB26_DATA3() bfin_read16(CAN1_MB26_DATA3)
804#define bfin_write_CAN1_MB26_DATA3(val) bfin_write16(CAN1_MB26_DATA3, val)
805#define bfin_read_CAN1_MB26_LENGTH() bfin_read16(CAN1_MB26_LENGTH)
806#define bfin_write_CAN1_MB26_LENGTH(val) bfin_write16(CAN1_MB26_LENGTH, val)
807#define bfin_read_CAN1_MB26_TIMESTAMP() bfin_read16(CAN1_MB26_TIMESTAMP)
808#define bfin_write_CAN1_MB26_TIMESTAMP(val) bfin_write16(CAN1_MB26_TIMESTAMP, val)
809#define bfin_read_CAN1_MB26_ID0() bfin_read16(CAN1_MB26_ID0)
810#define bfin_write_CAN1_MB26_ID0(val) bfin_write16(CAN1_MB26_ID0, val)
811#define bfin_read_CAN1_MB26_ID1() bfin_read16(CAN1_MB26_ID1)
812#define bfin_write_CAN1_MB26_ID1(val) bfin_write16(CAN1_MB26_ID1, val)
813#define bfin_read_CAN1_MB27_DATA0() bfin_read16(CAN1_MB27_DATA0)
814#define bfin_write_CAN1_MB27_DATA0(val) bfin_write16(CAN1_MB27_DATA0, val)
815#define bfin_read_CAN1_MB27_DATA1() bfin_read16(CAN1_MB27_DATA1)
816#define bfin_write_CAN1_MB27_DATA1(val) bfin_write16(CAN1_MB27_DATA1, val)
817#define bfin_read_CAN1_MB27_DATA2() bfin_read16(CAN1_MB27_DATA2)
818#define bfin_write_CAN1_MB27_DATA2(val) bfin_write16(CAN1_MB27_DATA2, val)
819#define bfin_read_CAN1_MB27_DATA3() bfin_read16(CAN1_MB27_DATA3)
820#define bfin_write_CAN1_MB27_DATA3(val) bfin_write16(CAN1_MB27_DATA3, val)
821#define bfin_read_CAN1_MB27_LENGTH() bfin_read16(CAN1_MB27_LENGTH)
822#define bfin_write_CAN1_MB27_LENGTH(val) bfin_write16(CAN1_MB27_LENGTH, val)
823#define bfin_read_CAN1_MB27_TIMESTAMP() bfin_read16(CAN1_MB27_TIMESTAMP)
824#define bfin_write_CAN1_MB27_TIMESTAMP(val) bfin_write16(CAN1_MB27_TIMESTAMP, val)
825#define bfin_read_CAN1_MB27_ID0() bfin_read16(CAN1_MB27_ID0)
826#define bfin_write_CAN1_MB27_ID0(val) bfin_write16(CAN1_MB27_ID0, val)
827#define bfin_read_CAN1_MB27_ID1() bfin_read16(CAN1_MB27_ID1)
828#define bfin_write_CAN1_MB27_ID1(val) bfin_write16(CAN1_MB27_ID1, val)
829#define bfin_read_CAN1_MB28_DATA0() bfin_read16(CAN1_MB28_DATA0)
830#define bfin_write_CAN1_MB28_DATA0(val) bfin_write16(CAN1_MB28_DATA0, val)
831#define bfin_read_CAN1_MB28_DATA1() bfin_read16(CAN1_MB28_DATA1)
832#define bfin_write_CAN1_MB28_DATA1(val) bfin_write16(CAN1_MB28_DATA1, val)
833#define bfin_read_CAN1_MB28_DATA2() bfin_read16(CAN1_MB28_DATA2)
834#define bfin_write_CAN1_MB28_DATA2(val) bfin_write16(CAN1_MB28_DATA2, val)
835#define bfin_read_CAN1_MB28_DATA3() bfin_read16(CAN1_MB28_DATA3)
836#define bfin_write_CAN1_MB28_DATA3(val) bfin_write16(CAN1_MB28_DATA3, val)
837#define bfin_read_CAN1_MB28_LENGTH() bfin_read16(CAN1_MB28_LENGTH)
838#define bfin_write_CAN1_MB28_LENGTH(val) bfin_write16(CAN1_MB28_LENGTH, val)
839#define bfin_read_CAN1_MB28_TIMESTAMP() bfin_read16(CAN1_MB28_TIMESTAMP)
840#define bfin_write_CAN1_MB28_TIMESTAMP(val) bfin_write16(CAN1_MB28_TIMESTAMP, val)
841#define bfin_read_CAN1_MB28_ID0() bfin_read16(CAN1_MB28_ID0)
842#define bfin_write_CAN1_MB28_ID0(val) bfin_write16(CAN1_MB28_ID0, val)
843#define bfin_read_CAN1_MB28_ID1() bfin_read16(CAN1_MB28_ID1)
844#define bfin_write_CAN1_MB28_ID1(val) bfin_write16(CAN1_MB28_ID1, val)
845#define bfin_read_CAN1_MB29_DATA0() bfin_read16(CAN1_MB29_DATA0)
846#define bfin_write_CAN1_MB29_DATA0(val) bfin_write16(CAN1_MB29_DATA0, val)
847#define bfin_read_CAN1_MB29_DATA1() bfin_read16(CAN1_MB29_DATA1)
848#define bfin_write_CAN1_MB29_DATA1(val) bfin_write16(CAN1_MB29_DATA1, val)
849#define bfin_read_CAN1_MB29_DATA2() bfin_read16(CAN1_MB29_DATA2)
850#define bfin_write_CAN1_MB29_DATA2(val) bfin_write16(CAN1_MB29_DATA2, val)
851#define bfin_read_CAN1_MB29_DATA3() bfin_read16(CAN1_MB29_DATA3)
852#define bfin_write_CAN1_MB29_DATA3(val) bfin_write16(CAN1_MB29_DATA3, val)
853#define bfin_read_CAN1_MB29_LENGTH() bfin_read16(CAN1_MB29_LENGTH)
854#define bfin_write_CAN1_MB29_LENGTH(val) bfin_write16(CAN1_MB29_LENGTH, val)
855#define bfin_read_CAN1_MB29_TIMESTAMP() bfin_read16(CAN1_MB29_TIMESTAMP)
856#define bfin_write_CAN1_MB29_TIMESTAMP(val) bfin_write16(CAN1_MB29_TIMESTAMP, val)
857#define bfin_read_CAN1_MB29_ID0() bfin_read16(CAN1_MB29_ID0)
858#define bfin_write_CAN1_MB29_ID0(val) bfin_write16(CAN1_MB29_ID0, val)
859#define bfin_read_CAN1_MB29_ID1() bfin_read16(CAN1_MB29_ID1)
860#define bfin_write_CAN1_MB29_ID1(val) bfin_write16(CAN1_MB29_ID1, val)
861#define bfin_read_CAN1_MB30_DATA0() bfin_read16(CAN1_MB30_DATA0)
862#define bfin_write_CAN1_MB30_DATA0(val) bfin_write16(CAN1_MB30_DATA0, val)
863#define bfin_read_CAN1_MB30_DATA1() bfin_read16(CAN1_MB30_DATA1)
864#define bfin_write_CAN1_MB30_DATA1(val) bfin_write16(CAN1_MB30_DATA1, val)
865#define bfin_read_CAN1_MB30_DATA2() bfin_read16(CAN1_MB30_DATA2)
866#define bfin_write_CAN1_MB30_DATA2(val) bfin_write16(CAN1_MB30_DATA2, val)
867#define bfin_read_CAN1_MB30_DATA3() bfin_read16(CAN1_MB30_DATA3)
868#define bfin_write_CAN1_MB30_DATA3(val) bfin_write16(CAN1_MB30_DATA3, val)
869#define bfin_read_CAN1_MB30_LENGTH() bfin_read16(CAN1_MB30_LENGTH)
870#define bfin_write_CAN1_MB30_LENGTH(val) bfin_write16(CAN1_MB30_LENGTH, val)
871#define bfin_read_CAN1_MB30_TIMESTAMP() bfin_read16(CAN1_MB30_TIMESTAMP)
872#define bfin_write_CAN1_MB30_TIMESTAMP(val) bfin_write16(CAN1_MB30_TIMESTAMP, val)
873#define bfin_read_CAN1_MB30_ID0() bfin_read16(CAN1_MB30_ID0)
874#define bfin_write_CAN1_MB30_ID0(val) bfin_write16(CAN1_MB30_ID0, val)
875#define bfin_read_CAN1_MB30_ID1() bfin_read16(CAN1_MB30_ID1)
876#define bfin_write_CAN1_MB30_ID1(val) bfin_write16(CAN1_MB30_ID1, val)
877#define bfin_read_CAN1_MB31_DATA0() bfin_read16(CAN1_MB31_DATA0)
878#define bfin_write_CAN1_MB31_DATA0(val) bfin_write16(CAN1_MB31_DATA0, val)
879#define bfin_read_CAN1_MB31_DATA1() bfin_read16(CAN1_MB31_DATA1)
880#define bfin_write_CAN1_MB31_DATA1(val) bfin_write16(CAN1_MB31_DATA1, val)
881#define bfin_read_CAN1_MB31_DATA2() bfin_read16(CAN1_MB31_DATA2)
882#define bfin_write_CAN1_MB31_DATA2(val) bfin_write16(CAN1_MB31_DATA2, val)
883#define bfin_read_CAN1_MB31_DATA3() bfin_read16(CAN1_MB31_DATA3)
884#define bfin_write_CAN1_MB31_DATA3(val) bfin_write16(CAN1_MB31_DATA3, val)
885#define bfin_read_CAN1_MB31_LENGTH() bfin_read16(CAN1_MB31_LENGTH)
886#define bfin_write_CAN1_MB31_LENGTH(val) bfin_write16(CAN1_MB31_LENGTH, val)
887#define bfin_read_CAN1_MB31_TIMESTAMP() bfin_read16(CAN1_MB31_TIMESTAMP)
888#define bfin_write_CAN1_MB31_TIMESTAMP(val) bfin_write16(CAN1_MB31_TIMESTAMP, val)
889#define bfin_read_CAN1_MB31_ID0() bfin_read16(CAN1_MB31_ID0)
890#define bfin_write_CAN1_MB31_ID0(val) bfin_write16(CAN1_MB31_ID0, val)
891#define bfin_read_CAN1_MB31_ID1() bfin_read16(CAN1_MB31_ID1)
892#define bfin_write_CAN1_MB31_ID1(val) bfin_write16(CAN1_MB31_ID1, val)
893
894/* HOST Port Registers */
895
896#define bfin_read_HOST_CONTROL() bfin_read16(HOST_CONTROL)
897#define bfin_write_HOST_CONTROL(val) bfin_write16(HOST_CONTROL, val)
898#define bfin_read_HOST_STATUS() bfin_read16(HOST_STATUS)
899#define bfin_write_HOST_STATUS(val) bfin_write16(HOST_STATUS, val)
900#define bfin_read_HOST_TIMEOUT() bfin_read16(HOST_TIMEOUT)
901#define bfin_write_HOST_TIMEOUT(val) bfin_write16(HOST_TIMEOUT, val)
902
903/* Pixel Combfin_read_()ositor (PIXC) Registers */
904
905#define bfin_read_PIXC_CTL() bfin_read16(PIXC_CTL)
906#define bfin_write_PIXC_CTL(val) bfin_write16(PIXC_CTL, val)
907#define bfin_read_PIXC_PPL() bfin_read16(PIXC_PPL)
908#define bfin_write_PIXC_PPL(val) bfin_write16(PIXC_PPL, val)
909#define bfin_read_PIXC_LPF() bfin_read16(PIXC_LPF)
910#define bfin_write_PIXC_LPF(val) bfin_write16(PIXC_LPF, val)
911#define bfin_read_PIXC_AHSTART() bfin_read16(PIXC_AHSTART)
912#define bfin_write_PIXC_AHSTART(val) bfin_write16(PIXC_AHSTART, val)
913#define bfin_read_PIXC_AHEND() bfin_read16(PIXC_AHEND)
914#define bfin_write_PIXC_AHEND(val) bfin_write16(PIXC_AHEND, val)
915#define bfin_read_PIXC_AVSTART() bfin_read16(PIXC_AVSTART)
916#define bfin_write_PIXC_AVSTART(val) bfin_write16(PIXC_AVSTART, val)
917#define bfin_read_PIXC_AVEND() bfin_read16(PIXC_AVEND)
918#define bfin_write_PIXC_AVEND(val) bfin_write16(PIXC_AVEND, val)
919#define bfin_read_PIXC_ATRANSP() bfin_read16(PIXC_ATRANSP)
920#define bfin_write_PIXC_ATRANSP(val) bfin_write16(PIXC_ATRANSP, val)
921#define bfin_read_PIXC_BHSTART() bfin_read16(PIXC_BHSTART)
922#define bfin_write_PIXC_BHSTART(val) bfin_write16(PIXC_BHSTART, val)
923#define bfin_read_PIXC_BHEND() bfin_read16(PIXC_BHEND)
924#define bfin_write_PIXC_BHEND(val) bfin_write16(PIXC_BHEND, val)
925#define bfin_read_PIXC_BVSTART() bfin_read16(PIXC_BVSTART)
926#define bfin_write_PIXC_BVSTART(val) bfin_write16(PIXC_BVSTART, val)
927#define bfin_read_PIXC_BVEND() bfin_read16(PIXC_BVEND)
928#define bfin_write_PIXC_BVEND(val) bfin_write16(PIXC_BVEND, val)
929#define bfin_read_PIXC_BTRANSP() bfin_read16(PIXC_BTRANSP)
930#define bfin_write_PIXC_BTRANSP(val) bfin_write16(PIXC_BTRANSP, val)
931#define bfin_read_PIXC_INTRSTAT() bfin_read16(PIXC_INTRSTAT)
932#define bfin_write_PIXC_INTRSTAT(val) bfin_write16(PIXC_INTRSTAT, val)
933#define bfin_read_PIXC_RYCON() bfin_read32(PIXC_RYCON)
934#define bfin_write_PIXC_RYCON(val) bfin_write32(PIXC_RYCON, val)
935#define bfin_read_PIXC_GUCON() bfin_read32(PIXC_GUCON)
936#define bfin_write_PIXC_GUCON(val) bfin_write32(PIXC_GUCON, val)
937#define bfin_read_PIXC_BVCON() bfin_read32(PIXC_BVCON)
938#define bfin_write_PIXC_BVCON(val) bfin_write32(PIXC_BVCON, val)
939#define bfin_read_PIXC_CCBIAS() bfin_read32(PIXC_CCBIAS)
940#define bfin_write_PIXC_CCBIAS(val) bfin_write32(PIXC_CCBIAS, val)
941#define bfin_read_PIXC_TC() bfin_read32(PIXC_TC)
942#define bfin_write_PIXC_TC(val) bfin_write32(PIXC_TC, val)
943
944/* Handshake MDMA 0 Registers */
945
946#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
947#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
948#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
949#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT, val)
950#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
951#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT, val)
952#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
953#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
954#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
955#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
956#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
957#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT, val)
958#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
959#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT, val)
960
961/* Handshake MDMA 1 Registers */
962
963#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
964#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
965#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
966#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT, val)
967#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
968#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT, val)
969#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
970#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
971#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
972#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
973#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
974#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT, val)
975#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
976#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT, val)
977
978#endif /* _CDEF_BF544_H */
diff --git a/include/asm-blackfin/mach-bf548/cdefBF548.h b/include/asm-blackfin/mach-bf548/cdefBF548.h
new file mode 100644
index 000000000000..674be0216bff
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/cdefBF548.h
@@ -0,0 +1,1610 @@
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#define bfin_read_TWI1_CLKDIV() bfin_read16(TWI1_CLKDIV)
189#define bfin_write_TWI1_CLKDIV(val) bfin_write16(TWI1_CLKDIV, val)
190#define bfin_read_TWI1_CONTROL() bfin_read16(TWI1_CONTROL)
191#define bfin_write_TWI1_CONTROL(val) bfin_write16(TWI1_CONTROL, val)
192#define bfin_read_TWI1_SLAVE_CTRL() bfin_read16(TWI1_SLAVE_CTRL)
193#define bfin_write_TWI1_SLAVE_CTRL(val) bfin_write16(TWI1_SLAVE_CTRL, val)
194#define bfin_read_TWI1_SLAVE_STAT() bfin_read16(TWI1_SLAVE_STAT)
195#define bfin_write_TWI1_SLAVE_STAT(val) bfin_write16(TWI1_SLAVE_STAT, val)
196#define bfin_read_TWI1_SLAVE_ADDR() bfin_read16(TWI1_SLAVE_ADDR)
197#define bfin_write_TWI1_SLAVE_ADDR(val) bfin_write16(TWI1_SLAVE_ADDR, val)
198#define bfin_read_TWI1_MASTER_CTRL() bfin_read16(TWI1_MASTER_CTRL)
199#define bfin_write_TWI1_MASTER_CTRL(val) bfin_write16(TWI1_MASTER_CTRL, val)
200#define bfin_read_TWI1_MASTER_STAT() bfin_read16(TWI1_MASTER_STAT)
201#define bfin_write_TWI1_MASTER_STAT(val) bfin_write16(TWI1_MASTER_STAT, val)
202#define bfin_read_TWI1_MASTER_ADDR() bfin_read16(TWI1_MASTER_ADDR)
203#define bfin_write_TWI1_MASTER_ADDR(val) bfin_write16(TWI1_MASTER_ADDR, val)
204#define bfin_read_TWI1_INT_STAT() bfin_read16(TWI1_INT_STAT)
205#define bfin_write_TWI1_INT_STAT(val) bfin_write16(TWI1_INT_STAT, val)
206#define bfin_read_TWI1_INT_MASK() bfin_read16(TWI1_INT_MASK)
207#define bfin_write_TWI1_INT_MASK(val) bfin_write16(TWI1_INT_MASK, val)
208#define bfin_read_TWI1_FIFO_CTRL() bfin_read16(TWI1_FIFO_CTRL)
209#define bfin_write_TWI1_FIFO_CTRL(val) bfin_write16(TWI1_FIFO_CTRL, val)
210#define bfin_read_TWI1_FIFO_STAT() bfin_read16(TWI1_FIFO_STAT)
211#define bfin_write_TWI1_FIFO_STAT(val) bfin_write16(TWI1_FIFO_STAT, val)
212#define bfin_read_TWI1_XMT_DATA8() bfin_read16(TWI1_XMT_DATA8)
213#define bfin_write_TWI1_XMT_DATA8(val) bfin_write16(TWI1_XMT_DATA8, val)
214#define bfin_read_TWI1_XMT_DATA16() bfin_read16(TWI1_XMT_DATA16)
215#define bfin_write_TWI1_XMT_DATA16(val) bfin_write16(TWI1_XMT_DATA16, val)
216#define bfin_read_TWI1_RCV_DATA8() bfin_read16(TWI1_RCV_DATA8)
217#define bfin_write_TWI1_RCV_DATA8(val) bfin_write16(TWI1_RCV_DATA8, val)
218#define bfin_read_TWI1_RCV_DATA16() bfin_read16(TWI1_RCV_DATA16)
219#define bfin_write_TWI1_RCV_DATA16(val) bfin_write16(TWI1_RCV_DATA16, val)
220
221/* SPI2 Registers */
222
223#define bfin_read_SPI2_CTL() bfin_read16(SPI2_CTL)
224#define bfin_write_SPI2_CTL(val) bfin_write16(SPI2_CTL, val)
225#define bfin_read_SPI2_FLG() bfin_read16(SPI2_FLG)
226#define bfin_write_SPI2_FLG(val) bfin_write16(SPI2_FLG, val)
227#define bfin_read_SPI2_STAT() bfin_read16(SPI2_STAT)
228#define bfin_write_SPI2_STAT(val) bfin_write16(SPI2_STAT, val)
229#define bfin_read_SPI2_TDBR() bfin_read16(SPI2_TDBR)
230#define bfin_write_SPI2_TDBR(val) bfin_write16(SPI2_TDBR, val)
231#define bfin_read_SPI2_RDBR() bfin_read16(SPI2_RDBR)
232#define bfin_write_SPI2_RDBR(val) bfin_write16(SPI2_RDBR, val)
233#define bfin_read_SPI2_BAUD() bfin_read16(SPI2_BAUD)
234#define bfin_write_SPI2_BAUD(val) bfin_write16(SPI2_BAUD, val)
235#define bfin_read_SPI2_SHADOW() bfin_read16(SPI2_SHADOW)
236#define bfin_write_SPI2_SHADOW(val) bfin_write16(SPI2_SHADOW, val)
237
238/* CAN Controller 1 Config 1 Registers */
239
240#define bfin_read_CAN1_MC1() bfin_read16(CAN1_MC1)
241#define bfin_write_CAN1_MC1(val) bfin_write16(CAN1_MC1, val)
242#define bfin_read_CAN1_MD1() bfin_read16(CAN1_MD1)
243#define bfin_write_CAN1_MD1(val) bfin_write16(CAN1_MD1, val)
244#define bfin_read_CAN1_TRS1() bfin_read16(CAN1_TRS1)
245#define bfin_write_CAN1_TRS1(val) bfin_write16(CAN1_TRS1, val)
246#define bfin_read_CAN1_TRR1() bfin_read16(CAN1_TRR1)
247#define bfin_write_CAN1_TRR1(val) bfin_write16(CAN1_TRR1, val)
248#define bfin_read_CAN1_TA1() bfin_read16(CAN1_TA1)
249#define bfin_write_CAN1_TA1(val) bfin_write16(CAN1_TA1, val)
250#define bfin_read_CAN1_AA1() bfin_read16(CAN1_AA1)
251#define bfin_write_CAN1_AA1(val) bfin_write16(CAN1_AA1, val)
252#define bfin_read_CAN1_RMP1() bfin_read16(CAN1_RMP1)
253#define bfin_write_CAN1_RMP1(val) bfin_write16(CAN1_RMP1, val)
254#define bfin_read_CAN1_RML1() bfin_read16(CAN1_RML1)
255#define bfin_write_CAN1_RML1(val) bfin_write16(CAN1_RML1, val)
256#define bfin_read_CAN1_MBTIF1() bfin_read16(CAN1_MBTIF1)
257#define bfin_write_CAN1_MBTIF1(val) bfin_write16(CAN1_MBTIF1, val)
258#define bfin_read_CAN1_MBRIF1() bfin_read16(CAN1_MBRIF1)
259#define bfin_write_CAN1_MBRIF1(val) bfin_write16(CAN1_MBRIF1, val)
260#define bfin_read_CAN1_MBIM1() bfin_read16(CAN1_MBIM1)
261#define bfin_write_CAN1_MBIM1(val) bfin_write16(CAN1_MBIM1, val)
262#define bfin_read_CAN1_RFH1() bfin_read16(CAN1_RFH1)
263#define bfin_write_CAN1_RFH1(val) bfin_write16(CAN1_RFH1, val)
264#define bfin_read_CAN1_OPSS1() bfin_read16(CAN1_OPSS1)
265#define bfin_write_CAN1_OPSS1(val) bfin_write16(CAN1_OPSS1, val)
266
267/* CAN Controller 1 Config 2 Registers */
268
269#define bfin_read_CAN1_MC2() bfin_read16(CAN1_MC2)
270#define bfin_write_CAN1_MC2(val) bfin_write16(CAN1_MC2, val)
271#define bfin_read_CAN1_MD2() bfin_read16(CAN1_MD2)
272#define bfin_write_CAN1_MD2(val) bfin_write16(CAN1_MD2, val)
273#define bfin_read_CAN1_TRS2() bfin_read16(CAN1_TRS2)
274#define bfin_write_CAN1_TRS2(val) bfin_write16(CAN1_TRS2, val)
275#define bfin_read_CAN1_TRR2() bfin_read16(CAN1_TRR2)
276#define bfin_write_CAN1_TRR2(val) bfin_write16(CAN1_TRR2, val)
277#define bfin_read_CAN1_TA2() bfin_read16(CAN1_TA2)
278#define bfin_write_CAN1_TA2(val) bfin_write16(CAN1_TA2, val)
279#define bfin_read_CAN1_AA2() bfin_read16(CAN1_AA2)
280#define bfin_write_CAN1_AA2(val) bfin_write16(CAN1_AA2, val)
281#define bfin_read_CAN1_RMP2() bfin_read16(CAN1_RMP2)
282#define bfin_write_CAN1_RMP2(val) bfin_write16(CAN1_RMP2, val)
283#define bfin_read_CAN1_RML2() bfin_read16(CAN1_RML2)
284#define bfin_write_CAN1_RML2(val) bfin_write16(CAN1_RML2, val)
285#define bfin_read_CAN1_MBTIF2() bfin_read16(CAN1_MBTIF2)
286#define bfin_write_CAN1_MBTIF2(val) bfin_write16(CAN1_MBTIF2, val)
287#define bfin_read_CAN1_MBRIF2() bfin_read16(CAN1_MBRIF2)
288#define bfin_write_CAN1_MBRIF2(val) bfin_write16(CAN1_MBRIF2, val)
289#define bfin_read_CAN1_MBIM2() bfin_read16(CAN1_MBIM2)
290#define bfin_write_CAN1_MBIM2(val) bfin_write16(CAN1_MBIM2, val)
291#define bfin_read_CAN1_RFH2() bfin_read16(CAN1_RFH2)
292#define bfin_write_CAN1_RFH2(val) bfin_write16(CAN1_RFH2, val)
293#define bfin_read_CAN1_OPSS2() bfin_read16(CAN1_OPSS2)
294#define bfin_write_CAN1_OPSS2(val) bfin_write16(CAN1_OPSS2, val)
295
296/* CAN Controller 1 Clock/Interrubfin_read_()t/Counter Registers */
297
298#define bfin_read_CAN1_CLOCK() bfin_read16(CAN1_CLOCK)
299#define bfin_write_CAN1_CLOCK(val) bfin_write16(CAN1_CLOCK, val)
300#define bfin_read_CAN1_TIMING() bfin_read16(CAN1_TIMING)
301#define bfin_write_CAN1_TIMING(val) bfin_write16(CAN1_TIMING, val)
302#define bfin_read_CAN1_DEBUG() bfin_read16(CAN1_DEBUG)
303#define bfin_write_CAN1_DEBUG(val) bfin_write16(CAN1_DEBUG, val)
304#define bfin_read_CAN1_STATUS() bfin_read16(CAN1_STATUS)
305#define bfin_write_CAN1_STATUS(val) bfin_write16(CAN1_STATUS, val)
306#define bfin_read_CAN1_CEC() bfin_read16(CAN1_CEC)
307#define bfin_write_CAN1_CEC(val) bfin_write16(CAN1_CEC, val)
308#define bfin_read_CAN1_GIS() bfin_read16(CAN1_GIS)
309#define bfin_write_CAN1_GIS(val) bfin_write16(CAN1_GIS, val)
310#define bfin_read_CAN1_GIM() bfin_read16(CAN1_GIM)
311#define bfin_write_CAN1_GIM(val) bfin_write16(CAN1_GIM, val)
312#define bfin_read_CAN1_GIF() bfin_read16(CAN1_GIF)
313#define bfin_write_CAN1_GIF(val) bfin_write16(CAN1_GIF, val)
314#define bfin_read_CAN1_CONTROL() bfin_read16(CAN1_CONTROL)
315#define bfin_write_CAN1_CONTROL(val) bfin_write16(CAN1_CONTROL, val)
316#define bfin_read_CAN1_INTR() bfin_read16(CAN1_INTR)
317#define bfin_write_CAN1_INTR(val) bfin_write16(CAN1_INTR, val)
318#define bfin_read_CAN1_MBTD() bfin_read16(CAN1_MBTD)
319#define bfin_write_CAN1_MBTD(val) bfin_write16(CAN1_MBTD, val)
320#define bfin_read_CAN1_EWR() bfin_read16(CAN1_EWR)
321#define bfin_write_CAN1_EWR(val) bfin_write16(CAN1_EWR, val)
322#define bfin_read_CAN1_ESR() bfin_read16(CAN1_ESR)
323#define bfin_write_CAN1_ESR(val) bfin_write16(CAN1_ESR, val)
324#define bfin_read_CAN1_UCCNT() bfin_read16(CAN1_UCCNT)
325#define bfin_write_CAN1_UCCNT(val) bfin_write16(CAN1_UCCNT, val)
326#define bfin_read_CAN1_UCRC() bfin_read16(CAN1_UCRC)
327#define bfin_write_CAN1_UCRC(val) bfin_write16(CAN1_UCRC, val)
328#define bfin_read_CAN1_UCCNF() bfin_read16(CAN1_UCCNF)
329#define bfin_write_CAN1_UCCNF(val) bfin_write16(CAN1_UCCNF, val)
330
331/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
332
333#define bfin_read_CAN1_AM00L() bfin_read16(CAN1_AM00L)
334#define bfin_write_CAN1_AM00L(val) bfin_write16(CAN1_AM00L, val)
335#define bfin_read_CAN1_AM00H() bfin_read16(CAN1_AM00H)
336#define bfin_write_CAN1_AM00H(val) bfin_write16(CAN1_AM00H, val)
337#define bfin_read_CAN1_AM01L() bfin_read16(CAN1_AM01L)
338#define bfin_write_CAN1_AM01L(val) bfin_write16(CAN1_AM01L, val)
339#define bfin_read_CAN1_AM01H() bfin_read16(CAN1_AM01H)
340#define bfin_write_CAN1_AM01H(val) bfin_write16(CAN1_AM01H, val)
341#define bfin_read_CAN1_AM02L() bfin_read16(CAN1_AM02L)
342#define bfin_write_CAN1_AM02L(val) bfin_write16(CAN1_AM02L, val)
343#define bfin_read_CAN1_AM02H() bfin_read16(CAN1_AM02H)
344#define bfin_write_CAN1_AM02H(val) bfin_write16(CAN1_AM02H, val)
345#define bfin_read_CAN1_AM03L() bfin_read16(CAN1_AM03L)
346#define bfin_write_CAN1_AM03L(val) bfin_write16(CAN1_AM03L, val)
347#define bfin_read_CAN1_AM03H() bfin_read16(CAN1_AM03H)
348#define bfin_write_CAN1_AM03H(val) bfin_write16(CAN1_AM03H, val)
349#define bfin_read_CAN1_AM04L() bfin_read16(CAN1_AM04L)
350#define bfin_write_CAN1_AM04L(val) bfin_write16(CAN1_AM04L, val)
351#define bfin_read_CAN1_AM04H() bfin_read16(CAN1_AM04H)
352#define bfin_write_CAN1_AM04H(val) bfin_write16(CAN1_AM04H, val)
353#define bfin_read_CAN1_AM05L() bfin_read16(CAN1_AM05L)
354#define bfin_write_CAN1_AM05L(val) bfin_write16(CAN1_AM05L, val)
355#define bfin_read_CAN1_AM05H() bfin_read16(CAN1_AM05H)
356#define bfin_write_CAN1_AM05H(val) bfin_write16(CAN1_AM05H, val)
357#define bfin_read_CAN1_AM06L() bfin_read16(CAN1_AM06L)
358#define bfin_write_CAN1_AM06L(val) bfin_write16(CAN1_AM06L, val)
359#define bfin_read_CAN1_AM06H() bfin_read16(CAN1_AM06H)
360#define bfin_write_CAN1_AM06H(val) bfin_write16(CAN1_AM06H, val)
361#define bfin_read_CAN1_AM07L() bfin_read16(CAN1_AM07L)
362#define bfin_write_CAN1_AM07L(val) bfin_write16(CAN1_AM07L, val)
363#define bfin_read_CAN1_AM07H() bfin_read16(CAN1_AM07H)
364#define bfin_write_CAN1_AM07H(val) bfin_write16(CAN1_AM07H, val)
365#define bfin_read_CAN1_AM08L() bfin_read16(CAN1_AM08L)
366#define bfin_write_CAN1_AM08L(val) bfin_write16(CAN1_AM08L, val)
367#define bfin_read_CAN1_AM08H() bfin_read16(CAN1_AM08H)
368#define bfin_write_CAN1_AM08H(val) bfin_write16(CAN1_AM08H, val)
369#define bfin_read_CAN1_AM09L() bfin_read16(CAN1_AM09L)
370#define bfin_write_CAN1_AM09L(val) bfin_write16(CAN1_AM09L, val)
371#define bfin_read_CAN1_AM09H() bfin_read16(CAN1_AM09H)
372#define bfin_write_CAN1_AM09H(val) bfin_write16(CAN1_AM09H, val)
373#define bfin_read_CAN1_AM10L() bfin_read16(CAN1_AM10L)
374#define bfin_write_CAN1_AM10L(val) bfin_write16(CAN1_AM10L, val)
375#define bfin_read_CAN1_AM10H() bfin_read16(CAN1_AM10H)
376#define bfin_write_CAN1_AM10H(val) bfin_write16(CAN1_AM10H, val)
377#define bfin_read_CAN1_AM11L() bfin_read16(CAN1_AM11L)
378#define bfin_write_CAN1_AM11L(val) bfin_write16(CAN1_AM11L, val)
379#define bfin_read_CAN1_AM11H() bfin_read16(CAN1_AM11H)
380#define bfin_write_CAN1_AM11H(val) bfin_write16(CAN1_AM11H, val)
381#define bfin_read_CAN1_AM12L() bfin_read16(CAN1_AM12L)
382#define bfin_write_CAN1_AM12L(val) bfin_write16(CAN1_AM12L, val)
383#define bfin_read_CAN1_AM12H() bfin_read16(CAN1_AM12H)
384#define bfin_write_CAN1_AM12H(val) bfin_write16(CAN1_AM12H, val)
385#define bfin_read_CAN1_AM13L() bfin_read16(CAN1_AM13L)
386#define bfin_write_CAN1_AM13L(val) bfin_write16(CAN1_AM13L, val)
387#define bfin_read_CAN1_AM13H() bfin_read16(CAN1_AM13H)
388#define bfin_write_CAN1_AM13H(val) bfin_write16(CAN1_AM13H, val)
389#define bfin_read_CAN1_AM14L() bfin_read16(CAN1_AM14L)
390#define bfin_write_CAN1_AM14L(val) bfin_write16(CAN1_AM14L, val)
391#define bfin_read_CAN1_AM14H() bfin_read16(CAN1_AM14H)
392#define bfin_write_CAN1_AM14H(val) bfin_write16(CAN1_AM14H, val)
393#define bfin_read_CAN1_AM15L() bfin_read16(CAN1_AM15L)
394#define bfin_write_CAN1_AM15L(val) bfin_write16(CAN1_AM15L, val)
395#define bfin_read_CAN1_AM15H() bfin_read16(CAN1_AM15H)
396#define bfin_write_CAN1_AM15H(val) bfin_write16(CAN1_AM15H, val)
397
398/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
399
400#define bfin_read_CAN1_AM16L() bfin_read16(CAN1_AM16L)
401#define bfin_write_CAN1_AM16L(val) bfin_write16(CAN1_AM16L, val)
402#define bfin_read_CAN1_AM16H() bfin_read16(CAN1_AM16H)
403#define bfin_write_CAN1_AM16H(val) bfin_write16(CAN1_AM16H, val)
404#define bfin_read_CAN1_AM17L() bfin_read16(CAN1_AM17L)
405#define bfin_write_CAN1_AM17L(val) bfin_write16(CAN1_AM17L, val)
406#define bfin_read_CAN1_AM17H() bfin_read16(CAN1_AM17H)
407#define bfin_write_CAN1_AM17H(val) bfin_write16(CAN1_AM17H, val)
408#define bfin_read_CAN1_AM18L() bfin_read16(CAN1_AM18L)
409#define bfin_write_CAN1_AM18L(val) bfin_write16(CAN1_AM18L, val)
410#define bfin_read_CAN1_AM18H() bfin_read16(CAN1_AM18H)
411#define bfin_write_CAN1_AM18H(val) bfin_write16(CAN1_AM18H, val)
412#define bfin_read_CAN1_AM19L() bfin_read16(CAN1_AM19L)
413#define bfin_write_CAN1_AM19L(val) bfin_write16(CAN1_AM19L, val)
414#define bfin_read_CAN1_AM19H() bfin_read16(CAN1_AM19H)
415#define bfin_write_CAN1_AM19H(val) bfin_write16(CAN1_AM19H, val)
416#define bfin_read_CAN1_AM20L() bfin_read16(CAN1_AM20L)
417#define bfin_write_CAN1_AM20L(val) bfin_write16(CAN1_AM20L, val)
418#define bfin_read_CAN1_AM20H() bfin_read16(CAN1_AM20H)
419#define bfin_write_CAN1_AM20H(val) bfin_write16(CAN1_AM20H, val)
420#define bfin_read_CAN1_AM21L() bfin_read16(CAN1_AM21L)
421#define bfin_write_CAN1_AM21L(val) bfin_write16(CAN1_AM21L, val)
422#define bfin_read_CAN1_AM21H() bfin_read16(CAN1_AM21H)
423#define bfin_write_CAN1_AM21H(val) bfin_write16(CAN1_AM21H, val)
424#define bfin_read_CAN1_AM22L() bfin_read16(CAN1_AM22L)
425#define bfin_write_CAN1_AM22L(val) bfin_write16(CAN1_AM22L, val)
426#define bfin_read_CAN1_AM22H() bfin_read16(CAN1_AM22H)
427#define bfin_write_CAN1_AM22H(val) bfin_write16(CAN1_AM22H, val)
428#define bfin_read_CAN1_AM23L() bfin_read16(CAN1_AM23L)
429#define bfin_write_CAN1_AM23L(val) bfin_write16(CAN1_AM23L, val)
430#define bfin_read_CAN1_AM23H() bfin_read16(CAN1_AM23H)
431#define bfin_write_CAN1_AM23H(val) bfin_write16(CAN1_AM23H, val)
432#define bfin_read_CAN1_AM24L() bfin_read16(CAN1_AM24L)
433#define bfin_write_CAN1_AM24L(val) bfin_write16(CAN1_AM24L, val)
434#define bfin_read_CAN1_AM24H() bfin_read16(CAN1_AM24H)
435#define bfin_write_CAN1_AM24H(val) bfin_write16(CAN1_AM24H, val)
436#define bfin_read_CAN1_AM25L() bfin_read16(CAN1_AM25L)
437#define bfin_write_CAN1_AM25L(val) bfin_write16(CAN1_AM25L, val)
438#define bfin_read_CAN1_AM25H() bfin_read16(CAN1_AM25H)
439#define bfin_write_CAN1_AM25H(val) bfin_write16(CAN1_AM25H, val)
440#define bfin_read_CAN1_AM26L() bfin_read16(CAN1_AM26L)
441#define bfin_write_CAN1_AM26L(val) bfin_write16(CAN1_AM26L, val)
442#define bfin_read_CAN1_AM26H() bfin_read16(CAN1_AM26H)
443#define bfin_write_CAN1_AM26H(val) bfin_write16(CAN1_AM26H, val)
444#define bfin_read_CAN1_AM27L() bfin_read16(CAN1_AM27L)
445#define bfin_write_CAN1_AM27L(val) bfin_write16(CAN1_AM27L, val)
446#define bfin_read_CAN1_AM27H() bfin_read16(CAN1_AM27H)
447#define bfin_write_CAN1_AM27H(val) bfin_write16(CAN1_AM27H, val)
448#define bfin_read_CAN1_AM28L() bfin_read16(CAN1_AM28L)
449#define bfin_write_CAN1_AM28L(val) bfin_write16(CAN1_AM28L, val)
450#define bfin_read_CAN1_AM28H() bfin_read16(CAN1_AM28H)
451#define bfin_write_CAN1_AM28H(val) bfin_write16(CAN1_AM28H, val)
452#define bfin_read_CAN1_AM29L() bfin_read16(CAN1_AM29L)
453#define bfin_write_CAN1_AM29L(val) bfin_write16(CAN1_AM29L, val)
454#define bfin_read_CAN1_AM29H() bfin_read16(CAN1_AM29H)
455#define bfin_write_CAN1_AM29H(val) bfin_write16(CAN1_AM29H, val)
456#define bfin_read_CAN1_AM30L() bfin_read16(CAN1_AM30L)
457#define bfin_write_CAN1_AM30L(val) bfin_write16(CAN1_AM30L, val)
458#define bfin_read_CAN1_AM30H() bfin_read16(CAN1_AM30H)
459#define bfin_write_CAN1_AM30H(val) bfin_write16(CAN1_AM30H, val)
460#define bfin_read_CAN1_AM31L() bfin_read16(CAN1_AM31L)
461#define bfin_write_CAN1_AM31L(val) bfin_write16(CAN1_AM31L, val)
462#define bfin_read_CAN1_AM31H() bfin_read16(CAN1_AM31H)
463#define bfin_write_CAN1_AM31H(val) bfin_write16(CAN1_AM31H, val)
464
465/* CAN Controller 1 Mailbox Data Registers */
466
467#define bfin_read_CAN1_MB00_DATA0() bfin_read16(CAN1_MB00_DATA0)
468#define bfin_write_CAN1_MB00_DATA0(val) bfin_write16(CAN1_MB00_DATA0, val)
469#define bfin_read_CAN1_MB00_DATA1() bfin_read16(CAN1_MB00_DATA1)
470#define bfin_write_CAN1_MB00_DATA1(val) bfin_write16(CAN1_MB00_DATA1, val)
471#define bfin_read_CAN1_MB00_DATA2() bfin_read16(CAN1_MB00_DATA2)
472#define bfin_write_CAN1_MB00_DATA2(val) bfin_write16(CAN1_MB00_DATA2, val)
473#define bfin_read_CAN1_MB00_DATA3() bfin_read16(CAN1_MB00_DATA3)
474#define bfin_write_CAN1_MB00_DATA3(val) bfin_write16(CAN1_MB00_DATA3, val)
475#define bfin_read_CAN1_MB00_LENGTH() bfin_read16(CAN1_MB00_LENGTH)
476#define bfin_write_CAN1_MB00_LENGTH(val) bfin_write16(CAN1_MB00_LENGTH, val)
477#define bfin_read_CAN1_MB00_TIMESTAMP() bfin_read16(CAN1_MB00_TIMESTAMP)
478#define bfin_write_CAN1_MB00_TIMESTAMP(val) bfin_write16(CAN1_MB00_TIMESTAMP, val)
479#define bfin_read_CAN1_MB00_ID0() bfin_read16(CAN1_MB00_ID0)
480#define bfin_write_CAN1_MB00_ID0(val) bfin_write16(CAN1_MB00_ID0, val)
481#define bfin_read_CAN1_MB00_ID1() bfin_read16(CAN1_MB00_ID1)
482#define bfin_write_CAN1_MB00_ID1(val) bfin_write16(CAN1_MB00_ID1, val)
483#define bfin_read_CAN1_MB01_DATA0() bfin_read16(CAN1_MB01_DATA0)
484#define bfin_write_CAN1_MB01_DATA0(val) bfin_write16(CAN1_MB01_DATA0, val)
485#define bfin_read_CAN1_MB01_DATA1() bfin_read16(CAN1_MB01_DATA1)
486#define bfin_write_CAN1_MB01_DATA1(val) bfin_write16(CAN1_MB01_DATA1, val)
487#define bfin_read_CAN1_MB01_DATA2() bfin_read16(CAN1_MB01_DATA2)
488#define bfin_write_CAN1_MB01_DATA2(val) bfin_write16(CAN1_MB01_DATA2, val)
489#define bfin_read_CAN1_MB01_DATA3() bfin_read16(CAN1_MB01_DATA3)
490#define bfin_write_CAN1_MB01_DATA3(val) bfin_write16(CAN1_MB01_DATA3, val)
491#define bfin_read_CAN1_MB01_LENGTH() bfin_read16(CAN1_MB01_LENGTH)
492#define bfin_write_CAN1_MB01_LENGTH(val) bfin_write16(CAN1_MB01_LENGTH, val)
493#define bfin_read_CAN1_MB01_TIMESTAMP() bfin_read16(CAN1_MB01_TIMESTAMP)
494#define bfin_write_CAN1_MB01_TIMESTAMP(val) bfin_write16(CAN1_MB01_TIMESTAMP, val)
495#define bfin_read_CAN1_MB01_ID0() bfin_read16(CAN1_MB01_ID0)
496#define bfin_write_CAN1_MB01_ID0(val) bfin_write16(CAN1_MB01_ID0, val)
497#define bfin_read_CAN1_MB01_ID1() bfin_read16(CAN1_MB01_ID1)
498#define bfin_write_CAN1_MB01_ID1(val) bfin_write16(CAN1_MB01_ID1, val)
499#define bfin_read_CAN1_MB02_DATA0() bfin_read16(CAN1_MB02_DATA0)
500#define bfin_write_CAN1_MB02_DATA0(val) bfin_write16(CAN1_MB02_DATA0, val)
501#define bfin_read_CAN1_MB02_DATA1() bfin_read16(CAN1_MB02_DATA1)
502#define bfin_write_CAN1_MB02_DATA1(val) bfin_write16(CAN1_MB02_DATA1, val)
503#define bfin_read_CAN1_MB02_DATA2() bfin_read16(CAN1_MB02_DATA2)
504#define bfin_write_CAN1_MB02_DATA2(val) bfin_write16(CAN1_MB02_DATA2, val)
505#define bfin_read_CAN1_MB02_DATA3() bfin_read16(CAN1_MB02_DATA3)
506#define bfin_write_CAN1_MB02_DATA3(val) bfin_write16(CAN1_MB02_DATA3, val)
507#define bfin_read_CAN1_MB02_LENGTH() bfin_read16(CAN1_MB02_LENGTH)
508#define bfin_write_CAN1_MB02_LENGTH(val) bfin_write16(CAN1_MB02_LENGTH, val)
509#define bfin_read_CAN1_MB02_TIMESTAMP() bfin_read16(CAN1_MB02_TIMESTAMP)
510#define bfin_write_CAN1_MB02_TIMESTAMP(val) bfin_write16(CAN1_MB02_TIMESTAMP, val)
511#define bfin_read_CAN1_MB02_ID0() bfin_read16(CAN1_MB02_ID0)
512#define bfin_write_CAN1_MB02_ID0(val) bfin_write16(CAN1_MB02_ID0, val)
513#define bfin_read_CAN1_MB02_ID1() bfin_read16(CAN1_MB02_ID1)
514#define bfin_write_CAN1_MB02_ID1(val) bfin_write16(CAN1_MB02_ID1, val)
515#define bfin_read_CAN1_MB03_DATA0() bfin_read16(CAN1_MB03_DATA0)
516#define bfin_write_CAN1_MB03_DATA0(val) bfin_write16(CAN1_MB03_DATA0, val)
517#define bfin_read_CAN1_MB03_DATA1() bfin_read16(CAN1_MB03_DATA1)
518#define bfin_write_CAN1_MB03_DATA1(val) bfin_write16(CAN1_MB03_DATA1, val)
519#define bfin_read_CAN1_MB03_DATA2() bfin_read16(CAN1_MB03_DATA2)
520#define bfin_write_CAN1_MB03_DATA2(val) bfin_write16(CAN1_MB03_DATA2, val)
521#define bfin_read_CAN1_MB03_DATA3() bfin_read16(CAN1_MB03_DATA3)
522#define bfin_write_CAN1_MB03_DATA3(val) bfin_write16(CAN1_MB03_DATA3, val)
523#define bfin_read_CAN1_MB03_LENGTH() bfin_read16(CAN1_MB03_LENGTH)
524#define bfin_write_CAN1_MB03_LENGTH(val) bfin_write16(CAN1_MB03_LENGTH, val)
525#define bfin_read_CAN1_MB03_TIMESTAMP() bfin_read16(CAN1_MB03_TIMESTAMP)
526#define bfin_write_CAN1_MB03_TIMESTAMP(val) bfin_write16(CAN1_MB03_TIMESTAMP, val)
527#define bfin_read_CAN1_MB03_ID0() bfin_read16(CAN1_MB03_ID0)
528#define bfin_write_CAN1_MB03_ID0(val) bfin_write16(CAN1_MB03_ID0, val)
529#define bfin_read_CAN1_MB03_ID1() bfin_read16(CAN1_MB03_ID1)
530#define bfin_write_CAN1_MB03_ID1(val) bfin_write16(CAN1_MB03_ID1, val)
531#define bfin_read_CAN1_MB04_DATA0() bfin_read16(CAN1_MB04_DATA0)
532#define bfin_write_CAN1_MB04_DATA0(val) bfin_write16(CAN1_MB04_DATA0, val)
533#define bfin_read_CAN1_MB04_DATA1() bfin_read16(CAN1_MB04_DATA1)
534#define bfin_write_CAN1_MB04_DATA1(val) bfin_write16(CAN1_MB04_DATA1, val)
535#define bfin_read_CAN1_MB04_DATA2() bfin_read16(CAN1_MB04_DATA2)
536#define bfin_write_CAN1_MB04_DATA2(val) bfin_write16(CAN1_MB04_DATA2, val)
537#define bfin_read_CAN1_MB04_DATA3() bfin_read16(CAN1_MB04_DATA3)
538#define bfin_write_CAN1_MB04_DATA3(val) bfin_write16(CAN1_MB04_DATA3, val)
539#define bfin_read_CAN1_MB04_LENGTH() bfin_read16(CAN1_MB04_LENGTH)
540#define bfin_write_CAN1_MB04_LENGTH(val) bfin_write16(CAN1_MB04_LENGTH, val)
541#define bfin_read_CAN1_MB04_TIMESTAMP() bfin_read16(CAN1_MB04_TIMESTAMP)
542#define bfin_write_CAN1_MB04_TIMESTAMP(val) bfin_write16(CAN1_MB04_TIMESTAMP, val)
543#define bfin_read_CAN1_MB04_ID0() bfin_read16(CAN1_MB04_ID0)
544#define bfin_write_CAN1_MB04_ID0(val) bfin_write16(CAN1_MB04_ID0, val)
545#define bfin_read_CAN1_MB04_ID1() bfin_read16(CAN1_MB04_ID1)
546#define bfin_write_CAN1_MB04_ID1(val) bfin_write16(CAN1_MB04_ID1, val)
547#define bfin_read_CAN1_MB05_DATA0() bfin_read16(CAN1_MB05_DATA0)
548#define bfin_write_CAN1_MB05_DATA0(val) bfin_write16(CAN1_MB05_DATA0, val)
549#define bfin_read_CAN1_MB05_DATA1() bfin_read16(CAN1_MB05_DATA1)
550#define bfin_write_CAN1_MB05_DATA1(val) bfin_write16(CAN1_MB05_DATA1, val)
551#define bfin_read_CAN1_MB05_DATA2() bfin_read16(CAN1_MB05_DATA2)
552#define bfin_write_CAN1_MB05_DATA2(val) bfin_write16(CAN1_MB05_DATA2, val)
553#define bfin_read_CAN1_MB05_DATA3() bfin_read16(CAN1_MB05_DATA3)
554#define bfin_write_CAN1_MB05_DATA3(val) bfin_write16(CAN1_MB05_DATA3, val)
555#define bfin_read_CAN1_MB05_LENGTH() bfin_read16(CAN1_MB05_LENGTH)
556#define bfin_write_CAN1_MB05_LENGTH(val) bfin_write16(CAN1_MB05_LENGTH, val)
557#define bfin_read_CAN1_MB05_TIMESTAMP() bfin_read16(CAN1_MB05_TIMESTAMP)
558#define bfin_write_CAN1_MB05_TIMESTAMP(val) bfin_write16(CAN1_MB05_TIMESTAMP, val)
559#define bfin_read_CAN1_MB05_ID0() bfin_read16(CAN1_MB05_ID0)
560#define bfin_write_CAN1_MB05_ID0(val) bfin_write16(CAN1_MB05_ID0, val)
561#define bfin_read_CAN1_MB05_ID1() bfin_read16(CAN1_MB05_ID1)
562#define bfin_write_CAN1_MB05_ID1(val) bfin_write16(CAN1_MB05_ID1, val)
563#define bfin_read_CAN1_MB06_DATA0() bfin_read16(CAN1_MB06_DATA0)
564#define bfin_write_CAN1_MB06_DATA0(val) bfin_write16(CAN1_MB06_DATA0, val)
565#define bfin_read_CAN1_MB06_DATA1() bfin_read16(CAN1_MB06_DATA1)
566#define bfin_write_CAN1_MB06_DATA1(val) bfin_write16(CAN1_MB06_DATA1, val)
567#define bfin_read_CAN1_MB06_DATA2() bfin_read16(CAN1_MB06_DATA2)
568#define bfin_write_CAN1_MB06_DATA2(val) bfin_write16(CAN1_MB06_DATA2, val)
569#define bfin_read_CAN1_MB06_DATA3() bfin_read16(CAN1_MB06_DATA3)
570#define bfin_write_CAN1_MB06_DATA3(val) bfin_write16(CAN1_MB06_DATA3, val)
571#define bfin_read_CAN1_MB06_LENGTH() bfin_read16(CAN1_MB06_LENGTH)
572#define bfin_write_CAN1_MB06_LENGTH(val) bfin_write16(CAN1_MB06_LENGTH, val)
573#define bfin_read_CAN1_MB06_TIMESTAMP() bfin_read16(CAN1_MB06_TIMESTAMP)
574#define bfin_write_CAN1_MB06_TIMESTAMP(val) bfin_write16(CAN1_MB06_TIMESTAMP, val)
575#define bfin_read_CAN1_MB06_ID0() bfin_read16(CAN1_MB06_ID0)
576#define bfin_write_CAN1_MB06_ID0(val) bfin_write16(CAN1_MB06_ID0, val)
577#define bfin_read_CAN1_MB06_ID1() bfin_read16(CAN1_MB06_ID1)
578#define bfin_write_CAN1_MB06_ID1(val) bfin_write16(CAN1_MB06_ID1, val)
579#define bfin_read_CAN1_MB07_DATA0() bfin_read16(CAN1_MB07_DATA0)
580#define bfin_write_CAN1_MB07_DATA0(val) bfin_write16(CAN1_MB07_DATA0, val)
581#define bfin_read_CAN1_MB07_DATA1() bfin_read16(CAN1_MB07_DATA1)
582#define bfin_write_CAN1_MB07_DATA1(val) bfin_write16(CAN1_MB07_DATA1, val)
583#define bfin_read_CAN1_MB07_DATA2() bfin_read16(CAN1_MB07_DATA2)
584#define bfin_write_CAN1_MB07_DATA2(val) bfin_write16(CAN1_MB07_DATA2, val)
585#define bfin_read_CAN1_MB07_DATA3() bfin_read16(CAN1_MB07_DATA3)
586#define bfin_write_CAN1_MB07_DATA3(val) bfin_write16(CAN1_MB07_DATA3, val)
587#define bfin_read_CAN1_MB07_LENGTH() bfin_read16(CAN1_MB07_LENGTH)
588#define bfin_write_CAN1_MB07_LENGTH(val) bfin_write16(CAN1_MB07_LENGTH, val)
589#define bfin_read_CAN1_MB07_TIMESTAMP() bfin_read16(CAN1_MB07_TIMESTAMP)
590#define bfin_write_CAN1_MB07_TIMESTAMP(val) bfin_write16(CAN1_MB07_TIMESTAMP, val)
591#define bfin_read_CAN1_MB07_ID0() bfin_read16(CAN1_MB07_ID0)
592#define bfin_write_CAN1_MB07_ID0(val) bfin_write16(CAN1_MB07_ID0, val)
593#define bfin_read_CAN1_MB07_ID1() bfin_read16(CAN1_MB07_ID1)
594#define bfin_write_CAN1_MB07_ID1(val) bfin_write16(CAN1_MB07_ID1, val)
595#define bfin_read_CAN1_MB08_DATA0() bfin_read16(CAN1_MB08_DATA0)
596#define bfin_write_CAN1_MB08_DATA0(val) bfin_write16(CAN1_MB08_DATA0, val)
597#define bfin_read_CAN1_MB08_DATA1() bfin_read16(CAN1_MB08_DATA1)
598#define bfin_write_CAN1_MB08_DATA1(val) bfin_write16(CAN1_MB08_DATA1, val)
599#define bfin_read_CAN1_MB08_DATA2() bfin_read16(CAN1_MB08_DATA2)
600#define bfin_write_CAN1_MB08_DATA2(val) bfin_write16(CAN1_MB08_DATA2, val)
601#define bfin_read_CAN1_MB08_DATA3() bfin_read16(CAN1_MB08_DATA3)
602#define bfin_write_CAN1_MB08_DATA3(val) bfin_write16(CAN1_MB08_DATA3, val)
603#define bfin_read_CAN1_MB08_LENGTH() bfin_read16(CAN1_MB08_LENGTH)
604#define bfin_write_CAN1_MB08_LENGTH(val) bfin_write16(CAN1_MB08_LENGTH, val)
605#define bfin_read_CAN1_MB08_TIMESTAMP() bfin_read16(CAN1_MB08_TIMESTAMP)
606#define bfin_write_CAN1_MB08_TIMESTAMP(val) bfin_write16(CAN1_MB08_TIMESTAMP, val)
607#define bfin_read_CAN1_MB08_ID0() bfin_read16(CAN1_MB08_ID0)
608#define bfin_write_CAN1_MB08_ID0(val) bfin_write16(CAN1_MB08_ID0, val)
609#define bfin_read_CAN1_MB08_ID1() bfin_read16(CAN1_MB08_ID1)
610#define bfin_write_CAN1_MB08_ID1(val) bfin_write16(CAN1_MB08_ID1, val)
611#define bfin_read_CAN1_MB09_DATA0() bfin_read16(CAN1_MB09_DATA0)
612#define bfin_write_CAN1_MB09_DATA0(val) bfin_write16(CAN1_MB09_DATA0, val)
613#define bfin_read_CAN1_MB09_DATA1() bfin_read16(CAN1_MB09_DATA1)
614#define bfin_write_CAN1_MB09_DATA1(val) bfin_write16(CAN1_MB09_DATA1, val)
615#define bfin_read_CAN1_MB09_DATA2() bfin_read16(CAN1_MB09_DATA2)
616#define bfin_write_CAN1_MB09_DATA2(val) bfin_write16(CAN1_MB09_DATA2, val)
617#define bfin_read_CAN1_MB09_DATA3() bfin_read16(CAN1_MB09_DATA3)
618#define bfin_write_CAN1_MB09_DATA3(val) bfin_write16(CAN1_MB09_DATA3, val)
619#define bfin_read_CAN1_MB09_LENGTH() bfin_read16(CAN1_MB09_LENGTH)
620#define bfin_write_CAN1_MB09_LENGTH(val) bfin_write16(CAN1_MB09_LENGTH, val)
621#define bfin_read_CAN1_MB09_TIMESTAMP() bfin_read16(CAN1_MB09_TIMESTAMP)
622#define bfin_write_CAN1_MB09_TIMESTAMP(val) bfin_write16(CAN1_MB09_TIMESTAMP, val)
623#define bfin_read_CAN1_MB09_ID0() bfin_read16(CAN1_MB09_ID0)
624#define bfin_write_CAN1_MB09_ID0(val) bfin_write16(CAN1_MB09_ID0, val)
625#define bfin_read_CAN1_MB09_ID1() bfin_read16(CAN1_MB09_ID1)
626#define bfin_write_CAN1_MB09_ID1(val) bfin_write16(CAN1_MB09_ID1, val)
627#define bfin_read_CAN1_MB10_DATA0() bfin_read16(CAN1_MB10_DATA0)
628#define bfin_write_CAN1_MB10_DATA0(val) bfin_write16(CAN1_MB10_DATA0, val)
629#define bfin_read_CAN1_MB10_DATA1() bfin_read16(CAN1_MB10_DATA1)
630#define bfin_write_CAN1_MB10_DATA1(val) bfin_write16(CAN1_MB10_DATA1, val)
631#define bfin_read_CAN1_MB10_DATA2() bfin_read16(CAN1_MB10_DATA2)
632#define bfin_write_CAN1_MB10_DATA2(val) bfin_write16(CAN1_MB10_DATA2, val)
633#define bfin_read_CAN1_MB10_DATA3() bfin_read16(CAN1_MB10_DATA3)
634#define bfin_write_CAN1_MB10_DATA3(val) bfin_write16(CAN1_MB10_DATA3, val)
635#define bfin_read_CAN1_MB10_LENGTH() bfin_read16(CAN1_MB10_LENGTH)
636#define bfin_write_CAN1_MB10_LENGTH(val) bfin_write16(CAN1_MB10_LENGTH, val)
637#define bfin_read_CAN1_MB10_TIMESTAMP() bfin_read16(CAN1_MB10_TIMESTAMP)
638#define bfin_write_CAN1_MB10_TIMESTAMP(val) bfin_write16(CAN1_MB10_TIMESTAMP, val)
639#define bfin_read_CAN1_MB10_ID0() bfin_read16(CAN1_MB10_ID0)
640#define bfin_write_CAN1_MB10_ID0(val) bfin_write16(CAN1_MB10_ID0, val)
641#define bfin_read_CAN1_MB10_ID1() bfin_read16(CAN1_MB10_ID1)
642#define bfin_write_CAN1_MB10_ID1(val) bfin_write16(CAN1_MB10_ID1, val)
643#define bfin_read_CAN1_MB11_DATA0() bfin_read16(CAN1_MB11_DATA0)
644#define bfin_write_CAN1_MB11_DATA0(val) bfin_write16(CAN1_MB11_DATA0, val)
645#define bfin_read_CAN1_MB11_DATA1() bfin_read16(CAN1_MB11_DATA1)
646#define bfin_write_CAN1_MB11_DATA1(val) bfin_write16(CAN1_MB11_DATA1, val)
647#define bfin_read_CAN1_MB11_DATA2() bfin_read16(CAN1_MB11_DATA2)
648#define bfin_write_CAN1_MB11_DATA2(val) bfin_write16(CAN1_MB11_DATA2, val)
649#define bfin_read_CAN1_MB11_DATA3() bfin_read16(CAN1_MB11_DATA3)
650#define bfin_write_CAN1_MB11_DATA3(val) bfin_write16(CAN1_MB11_DATA3, val)
651#define bfin_read_CAN1_MB11_LENGTH() bfin_read16(CAN1_MB11_LENGTH)
652#define bfin_write_CAN1_MB11_LENGTH(val) bfin_write16(CAN1_MB11_LENGTH, val)
653#define bfin_read_CAN1_MB11_TIMESTAMP() bfin_read16(CAN1_MB11_TIMESTAMP)
654#define bfin_write_CAN1_MB11_TIMESTAMP(val) bfin_write16(CAN1_MB11_TIMESTAMP, val)
655#define bfin_read_CAN1_MB11_ID0() bfin_read16(CAN1_MB11_ID0)
656#define bfin_write_CAN1_MB11_ID0(val) bfin_write16(CAN1_MB11_ID0, val)
657#define bfin_read_CAN1_MB11_ID1() bfin_read16(CAN1_MB11_ID1)
658#define bfin_write_CAN1_MB11_ID1(val) bfin_write16(CAN1_MB11_ID1, val)
659#define bfin_read_CAN1_MB12_DATA0() bfin_read16(CAN1_MB12_DATA0)
660#define bfin_write_CAN1_MB12_DATA0(val) bfin_write16(CAN1_MB12_DATA0, val)
661#define bfin_read_CAN1_MB12_DATA1() bfin_read16(CAN1_MB12_DATA1)
662#define bfin_write_CAN1_MB12_DATA1(val) bfin_write16(CAN1_MB12_DATA1, val)
663#define bfin_read_CAN1_MB12_DATA2() bfin_read16(CAN1_MB12_DATA2)
664#define bfin_write_CAN1_MB12_DATA2(val) bfin_write16(CAN1_MB12_DATA2, val)
665#define bfin_read_CAN1_MB12_DATA3() bfin_read16(CAN1_MB12_DATA3)
666#define bfin_write_CAN1_MB12_DATA3(val) bfin_write16(CAN1_MB12_DATA3, val)
667#define bfin_read_CAN1_MB12_LENGTH() bfin_read16(CAN1_MB12_LENGTH)
668#define bfin_write_CAN1_MB12_LENGTH(val) bfin_write16(CAN1_MB12_LENGTH, val)
669#define bfin_read_CAN1_MB12_TIMESTAMP() bfin_read16(CAN1_MB12_TIMESTAMP)
670#define bfin_write_CAN1_MB12_TIMESTAMP(val) bfin_write16(CAN1_MB12_TIMESTAMP, val)
671#define bfin_read_CAN1_MB12_ID0() bfin_read16(CAN1_MB12_ID0)
672#define bfin_write_CAN1_MB12_ID0(val) bfin_write16(CAN1_MB12_ID0, val)
673#define bfin_read_CAN1_MB12_ID1() bfin_read16(CAN1_MB12_ID1)
674#define bfin_write_CAN1_MB12_ID1(val) bfin_write16(CAN1_MB12_ID1, val)
675#define bfin_read_CAN1_MB13_DATA0() bfin_read16(CAN1_MB13_DATA0)
676#define bfin_write_CAN1_MB13_DATA0(val) bfin_write16(CAN1_MB13_DATA0, val)
677#define bfin_read_CAN1_MB13_DATA1() bfin_read16(CAN1_MB13_DATA1)
678#define bfin_write_CAN1_MB13_DATA1(val) bfin_write16(CAN1_MB13_DATA1, val)
679#define bfin_read_CAN1_MB13_DATA2() bfin_read16(CAN1_MB13_DATA2)
680#define bfin_write_CAN1_MB13_DATA2(val) bfin_write16(CAN1_MB13_DATA2, val)
681#define bfin_read_CAN1_MB13_DATA3() bfin_read16(CAN1_MB13_DATA3)
682#define bfin_write_CAN1_MB13_DATA3(val) bfin_write16(CAN1_MB13_DATA3, val)
683#define bfin_read_CAN1_MB13_LENGTH() bfin_read16(CAN1_MB13_LENGTH)
684#define bfin_write_CAN1_MB13_LENGTH(val) bfin_write16(CAN1_MB13_LENGTH, val)
685#define bfin_read_CAN1_MB13_TIMESTAMP() bfin_read16(CAN1_MB13_TIMESTAMP)
686#define bfin_write_CAN1_MB13_TIMESTAMP(val) bfin_write16(CAN1_MB13_TIMESTAMP, val)
687#define bfin_read_CAN1_MB13_ID0() bfin_read16(CAN1_MB13_ID0)
688#define bfin_write_CAN1_MB13_ID0(val) bfin_write16(CAN1_MB13_ID0, val)
689#define bfin_read_CAN1_MB13_ID1() bfin_read16(CAN1_MB13_ID1)
690#define bfin_write_CAN1_MB13_ID1(val) bfin_write16(CAN1_MB13_ID1, val)
691#define bfin_read_CAN1_MB14_DATA0() bfin_read16(CAN1_MB14_DATA0)
692#define bfin_write_CAN1_MB14_DATA0(val) bfin_write16(CAN1_MB14_DATA0, val)
693#define bfin_read_CAN1_MB14_DATA1() bfin_read16(CAN1_MB14_DATA1)
694#define bfin_write_CAN1_MB14_DATA1(val) bfin_write16(CAN1_MB14_DATA1, val)
695#define bfin_read_CAN1_MB14_DATA2() bfin_read16(CAN1_MB14_DATA2)
696#define bfin_write_CAN1_MB14_DATA2(val) bfin_write16(CAN1_MB14_DATA2, val)
697#define bfin_read_CAN1_MB14_DATA3() bfin_read16(CAN1_MB14_DATA3)
698#define bfin_write_CAN1_MB14_DATA3(val) bfin_write16(CAN1_MB14_DATA3, val)
699#define bfin_read_CAN1_MB14_LENGTH() bfin_read16(CAN1_MB14_LENGTH)
700#define bfin_write_CAN1_MB14_LENGTH(val) bfin_write16(CAN1_MB14_LENGTH, val)
701#define bfin_read_CAN1_MB14_TIMESTAMP() bfin_read16(CAN1_MB14_TIMESTAMP)
702#define bfin_write_CAN1_MB14_TIMESTAMP(val) bfin_write16(CAN1_MB14_TIMESTAMP, val)
703#define bfin_read_CAN1_MB14_ID0() bfin_read16(CAN1_MB14_ID0)
704#define bfin_write_CAN1_MB14_ID0(val) bfin_write16(CAN1_MB14_ID0, val)
705#define bfin_read_CAN1_MB14_ID1() bfin_read16(CAN1_MB14_ID1)
706#define bfin_write_CAN1_MB14_ID1(val) bfin_write16(CAN1_MB14_ID1, val)
707#define bfin_read_CAN1_MB15_DATA0() bfin_read16(CAN1_MB15_DATA0)
708#define bfin_write_CAN1_MB15_DATA0(val) bfin_write16(CAN1_MB15_DATA0, val)
709#define bfin_read_CAN1_MB15_DATA1() bfin_read16(CAN1_MB15_DATA1)
710#define bfin_write_CAN1_MB15_DATA1(val) bfin_write16(CAN1_MB15_DATA1, val)
711#define bfin_read_CAN1_MB15_DATA2() bfin_read16(CAN1_MB15_DATA2)
712#define bfin_write_CAN1_MB15_DATA2(val) bfin_write16(CAN1_MB15_DATA2, val)
713#define bfin_read_CAN1_MB15_DATA3() bfin_read16(CAN1_MB15_DATA3)
714#define bfin_write_CAN1_MB15_DATA3(val) bfin_write16(CAN1_MB15_DATA3, val)
715#define bfin_read_CAN1_MB15_LENGTH() bfin_read16(CAN1_MB15_LENGTH)
716#define bfin_write_CAN1_MB15_LENGTH(val) bfin_write16(CAN1_MB15_LENGTH, val)
717#define bfin_read_CAN1_MB15_TIMESTAMP() bfin_read16(CAN1_MB15_TIMESTAMP)
718#define bfin_write_CAN1_MB15_TIMESTAMP(val) bfin_write16(CAN1_MB15_TIMESTAMP, val)
719#define bfin_read_CAN1_MB15_ID0() bfin_read16(CAN1_MB15_ID0)
720#define bfin_write_CAN1_MB15_ID0(val) bfin_write16(CAN1_MB15_ID0, val)
721#define bfin_read_CAN1_MB15_ID1() bfin_read16(CAN1_MB15_ID1)
722#define bfin_write_CAN1_MB15_ID1(val) bfin_write16(CAN1_MB15_ID1, val)
723
724/* CAN Controller 1 Mailbox Data Registers */
725
726#define bfin_read_CAN1_MB16_DATA0() bfin_read16(CAN1_MB16_DATA0)
727#define bfin_write_CAN1_MB16_DATA0(val) bfin_write16(CAN1_MB16_DATA0, val)
728#define bfin_read_CAN1_MB16_DATA1() bfin_read16(CAN1_MB16_DATA1)
729#define bfin_write_CAN1_MB16_DATA1(val) bfin_write16(CAN1_MB16_DATA1, val)
730#define bfin_read_CAN1_MB16_DATA2() bfin_read16(CAN1_MB16_DATA2)
731#define bfin_write_CAN1_MB16_DATA2(val) bfin_write16(CAN1_MB16_DATA2, val)
732#define bfin_read_CAN1_MB16_DATA3() bfin_read16(CAN1_MB16_DATA3)
733#define bfin_write_CAN1_MB16_DATA3(val) bfin_write16(CAN1_MB16_DATA3, val)
734#define bfin_read_CAN1_MB16_LENGTH() bfin_read16(CAN1_MB16_LENGTH)
735#define bfin_write_CAN1_MB16_LENGTH(val) bfin_write16(CAN1_MB16_LENGTH, val)
736#define bfin_read_CAN1_MB16_TIMESTAMP() bfin_read16(CAN1_MB16_TIMESTAMP)
737#define bfin_write_CAN1_MB16_TIMESTAMP(val) bfin_write16(CAN1_MB16_TIMESTAMP, val)
738#define bfin_read_CAN1_MB16_ID0() bfin_read16(CAN1_MB16_ID0)
739#define bfin_write_CAN1_MB16_ID0(val) bfin_write16(CAN1_MB16_ID0, val)
740#define bfin_read_CAN1_MB16_ID1() bfin_read16(CAN1_MB16_ID1)
741#define bfin_write_CAN1_MB16_ID1(val) bfin_write16(CAN1_MB16_ID1, val)
742#define bfin_read_CAN1_MB17_DATA0() bfin_read16(CAN1_MB17_DATA0)
743#define bfin_write_CAN1_MB17_DATA0(val) bfin_write16(CAN1_MB17_DATA0, val)
744#define bfin_read_CAN1_MB17_DATA1() bfin_read16(CAN1_MB17_DATA1)
745#define bfin_write_CAN1_MB17_DATA1(val) bfin_write16(CAN1_MB17_DATA1, val)
746#define bfin_read_CAN1_MB17_DATA2() bfin_read16(CAN1_MB17_DATA2)
747#define bfin_write_CAN1_MB17_DATA2(val) bfin_write16(CAN1_MB17_DATA2, val)
748#define bfin_read_CAN1_MB17_DATA3() bfin_read16(CAN1_MB17_DATA3)
749#define bfin_write_CAN1_MB17_DATA3(val) bfin_write16(CAN1_MB17_DATA3, val)
750#define bfin_read_CAN1_MB17_LENGTH() bfin_read16(CAN1_MB17_LENGTH)
751#define bfin_write_CAN1_MB17_LENGTH(val) bfin_write16(CAN1_MB17_LENGTH, val)
752#define bfin_read_CAN1_MB17_TIMESTAMP() bfin_read16(CAN1_MB17_TIMESTAMP)
753#define bfin_write_CAN1_MB17_TIMESTAMP(val) bfin_write16(CAN1_MB17_TIMESTAMP, val)
754#define bfin_read_CAN1_MB17_ID0() bfin_read16(CAN1_MB17_ID0)
755#define bfin_write_CAN1_MB17_ID0(val) bfin_write16(CAN1_MB17_ID0, val)
756#define bfin_read_CAN1_MB17_ID1() bfin_read16(CAN1_MB17_ID1)
757#define bfin_write_CAN1_MB17_ID1(val) bfin_write16(CAN1_MB17_ID1, val)
758#define bfin_read_CAN1_MB18_DATA0() bfin_read16(CAN1_MB18_DATA0)
759#define bfin_write_CAN1_MB18_DATA0(val) bfin_write16(CAN1_MB18_DATA0, val)
760#define bfin_read_CAN1_MB18_DATA1() bfin_read16(CAN1_MB18_DATA1)
761#define bfin_write_CAN1_MB18_DATA1(val) bfin_write16(CAN1_MB18_DATA1, val)
762#define bfin_read_CAN1_MB18_DATA2() bfin_read16(CAN1_MB18_DATA2)
763#define bfin_write_CAN1_MB18_DATA2(val) bfin_write16(CAN1_MB18_DATA2, val)
764#define bfin_read_CAN1_MB18_DATA3() bfin_read16(CAN1_MB18_DATA3)
765#define bfin_write_CAN1_MB18_DATA3(val) bfin_write16(CAN1_MB18_DATA3, val)
766#define bfin_read_CAN1_MB18_LENGTH() bfin_read16(CAN1_MB18_LENGTH)
767#define bfin_write_CAN1_MB18_LENGTH(val) bfin_write16(CAN1_MB18_LENGTH, val)
768#define bfin_read_CAN1_MB18_TIMESTAMP() bfin_read16(CAN1_MB18_TIMESTAMP)
769#define bfin_write_CAN1_MB18_TIMESTAMP(val) bfin_write16(CAN1_MB18_TIMESTAMP, val)
770#define bfin_read_CAN1_MB18_ID0() bfin_read16(CAN1_MB18_ID0)
771#define bfin_write_CAN1_MB18_ID0(val) bfin_write16(CAN1_MB18_ID0, val)
772#define bfin_read_CAN1_MB18_ID1() bfin_read16(CAN1_MB18_ID1)
773#define bfin_write_CAN1_MB18_ID1(val) bfin_write16(CAN1_MB18_ID1, val)
774#define bfin_read_CAN1_MB19_DATA0() bfin_read16(CAN1_MB19_DATA0)
775#define bfin_write_CAN1_MB19_DATA0(val) bfin_write16(CAN1_MB19_DATA0, val)
776#define bfin_read_CAN1_MB19_DATA1() bfin_read16(CAN1_MB19_DATA1)
777#define bfin_write_CAN1_MB19_DATA1(val) bfin_write16(CAN1_MB19_DATA1, val)
778#define bfin_read_CAN1_MB19_DATA2() bfin_read16(CAN1_MB19_DATA2)
779#define bfin_write_CAN1_MB19_DATA2(val) bfin_write16(CAN1_MB19_DATA2, val)
780#define bfin_read_CAN1_MB19_DATA3() bfin_read16(CAN1_MB19_DATA3)
781#define bfin_write_CAN1_MB19_DATA3(val) bfin_write16(CAN1_MB19_DATA3, val)
782#define bfin_read_CAN1_MB19_LENGTH() bfin_read16(CAN1_MB19_LENGTH)
783#define bfin_write_CAN1_MB19_LENGTH(val) bfin_write16(CAN1_MB19_LENGTH, val)
784#define bfin_read_CAN1_MB19_TIMESTAMP() bfin_read16(CAN1_MB19_TIMESTAMP)
785#define bfin_write_CAN1_MB19_TIMESTAMP(val) bfin_write16(CAN1_MB19_TIMESTAMP, val)
786#define bfin_read_CAN1_MB19_ID0() bfin_read16(CAN1_MB19_ID0)
787#define bfin_write_CAN1_MB19_ID0(val) bfin_write16(CAN1_MB19_ID0, val)
788#define bfin_read_CAN1_MB19_ID1() bfin_read16(CAN1_MB19_ID1)
789#define bfin_write_CAN1_MB19_ID1(val) bfin_write16(CAN1_MB19_ID1, val)
790#define bfin_read_CAN1_MB20_DATA0() bfin_read16(CAN1_MB20_DATA0)
791#define bfin_write_CAN1_MB20_DATA0(val) bfin_write16(CAN1_MB20_DATA0, val)
792#define bfin_read_CAN1_MB20_DATA1() bfin_read16(CAN1_MB20_DATA1)
793#define bfin_write_CAN1_MB20_DATA1(val) bfin_write16(CAN1_MB20_DATA1, val)
794#define bfin_read_CAN1_MB20_DATA2() bfin_read16(CAN1_MB20_DATA2)
795#define bfin_write_CAN1_MB20_DATA2(val) bfin_write16(CAN1_MB20_DATA2, val)
796#define bfin_read_CAN1_MB20_DATA3() bfin_read16(CAN1_MB20_DATA3)
797#define bfin_write_CAN1_MB20_DATA3(val) bfin_write16(CAN1_MB20_DATA3, val)
798#define bfin_read_CAN1_MB20_LENGTH() bfin_read16(CAN1_MB20_LENGTH)
799#define bfin_write_CAN1_MB20_LENGTH(val) bfin_write16(CAN1_MB20_LENGTH, val)
800#define bfin_read_CAN1_MB20_TIMESTAMP() bfin_read16(CAN1_MB20_TIMESTAMP)
801#define bfin_write_CAN1_MB20_TIMESTAMP(val) bfin_write16(CAN1_MB20_TIMESTAMP, val)
802#define bfin_read_CAN1_MB20_ID0() bfin_read16(CAN1_MB20_ID0)
803#define bfin_write_CAN1_MB20_ID0(val) bfin_write16(CAN1_MB20_ID0, val)
804#define bfin_read_CAN1_MB20_ID1() bfin_read16(CAN1_MB20_ID1)
805#define bfin_write_CAN1_MB20_ID1(val) bfin_write16(CAN1_MB20_ID1, val)
806#define bfin_read_CAN1_MB21_DATA0() bfin_read16(CAN1_MB21_DATA0)
807#define bfin_write_CAN1_MB21_DATA0(val) bfin_write16(CAN1_MB21_DATA0, val)
808#define bfin_read_CAN1_MB21_DATA1() bfin_read16(CAN1_MB21_DATA1)
809#define bfin_write_CAN1_MB21_DATA1(val) bfin_write16(CAN1_MB21_DATA1, val)
810#define bfin_read_CAN1_MB21_DATA2() bfin_read16(CAN1_MB21_DATA2)
811#define bfin_write_CAN1_MB21_DATA2(val) bfin_write16(CAN1_MB21_DATA2, val)
812#define bfin_read_CAN1_MB21_DATA3() bfin_read16(CAN1_MB21_DATA3)
813#define bfin_write_CAN1_MB21_DATA3(val) bfin_write16(CAN1_MB21_DATA3, val)
814#define bfin_read_CAN1_MB21_LENGTH() bfin_read16(CAN1_MB21_LENGTH)
815#define bfin_write_CAN1_MB21_LENGTH(val) bfin_write16(CAN1_MB21_LENGTH, val)
816#define bfin_read_CAN1_MB21_TIMESTAMP() bfin_read16(CAN1_MB21_TIMESTAMP)
817#define bfin_write_CAN1_MB21_TIMESTAMP(val) bfin_write16(CAN1_MB21_TIMESTAMP, val)
818#define bfin_read_CAN1_MB21_ID0() bfin_read16(CAN1_MB21_ID0)
819#define bfin_write_CAN1_MB21_ID0(val) bfin_write16(CAN1_MB21_ID0, val)
820#define bfin_read_CAN1_MB21_ID1() bfin_read16(CAN1_MB21_ID1)
821#define bfin_write_CAN1_MB21_ID1(val) bfin_write16(CAN1_MB21_ID1, val)
822#define bfin_read_CAN1_MB22_DATA0() bfin_read16(CAN1_MB22_DATA0)
823#define bfin_write_CAN1_MB22_DATA0(val) bfin_write16(CAN1_MB22_DATA0, val)
824#define bfin_read_CAN1_MB22_DATA1() bfin_read16(CAN1_MB22_DATA1)
825#define bfin_write_CAN1_MB22_DATA1(val) bfin_write16(CAN1_MB22_DATA1, val)
826#define bfin_read_CAN1_MB22_DATA2() bfin_read16(CAN1_MB22_DATA2)
827#define bfin_write_CAN1_MB22_DATA2(val) bfin_write16(CAN1_MB22_DATA2, val)
828#define bfin_read_CAN1_MB22_DATA3() bfin_read16(CAN1_MB22_DATA3)
829#define bfin_write_CAN1_MB22_DATA3(val) bfin_write16(CAN1_MB22_DATA3, val)
830#define bfin_read_CAN1_MB22_LENGTH() bfin_read16(CAN1_MB22_LENGTH)
831#define bfin_write_CAN1_MB22_LENGTH(val) bfin_write16(CAN1_MB22_LENGTH, val)
832#define bfin_read_CAN1_MB22_TIMESTAMP() bfin_read16(CAN1_MB22_TIMESTAMP)
833#define bfin_write_CAN1_MB22_TIMESTAMP(val) bfin_write16(CAN1_MB22_TIMESTAMP, val)
834#define bfin_read_CAN1_MB22_ID0() bfin_read16(CAN1_MB22_ID0)
835#define bfin_write_CAN1_MB22_ID0(val) bfin_write16(CAN1_MB22_ID0, val)
836#define bfin_read_CAN1_MB22_ID1() bfin_read16(CAN1_MB22_ID1)
837#define bfin_write_CAN1_MB22_ID1(val) bfin_write16(CAN1_MB22_ID1, val)
838#define bfin_read_CAN1_MB23_DATA0() bfin_read16(CAN1_MB23_DATA0)
839#define bfin_write_CAN1_MB23_DATA0(val) bfin_write16(CAN1_MB23_DATA0, val)
840#define bfin_read_CAN1_MB23_DATA1() bfin_read16(CAN1_MB23_DATA1)
841#define bfin_write_CAN1_MB23_DATA1(val) bfin_write16(CAN1_MB23_DATA1, val)
842#define bfin_read_CAN1_MB23_DATA2() bfin_read16(CAN1_MB23_DATA2)
843#define bfin_write_CAN1_MB23_DATA2(val) bfin_write16(CAN1_MB23_DATA2, val)
844#define bfin_read_CAN1_MB23_DATA3() bfin_read16(CAN1_MB23_DATA3)
845#define bfin_write_CAN1_MB23_DATA3(val) bfin_write16(CAN1_MB23_DATA3, val)
846#define bfin_read_CAN1_MB23_LENGTH() bfin_read16(CAN1_MB23_LENGTH)
847#define bfin_write_CAN1_MB23_LENGTH(val) bfin_write16(CAN1_MB23_LENGTH, val)
848#define bfin_read_CAN1_MB23_TIMESTAMP() bfin_read16(CAN1_MB23_TIMESTAMP)
849#define bfin_write_CAN1_MB23_TIMESTAMP(val) bfin_write16(CAN1_MB23_TIMESTAMP, val)
850#define bfin_read_CAN1_MB23_ID0() bfin_read16(CAN1_MB23_ID0)
851#define bfin_write_CAN1_MB23_ID0(val) bfin_write16(CAN1_MB23_ID0, val)
852#define bfin_read_CAN1_MB23_ID1() bfin_read16(CAN1_MB23_ID1)
853#define bfin_write_CAN1_MB23_ID1(val) bfin_write16(CAN1_MB23_ID1, val)
854#define bfin_read_CAN1_MB24_DATA0() bfin_read16(CAN1_MB24_DATA0)
855#define bfin_write_CAN1_MB24_DATA0(val) bfin_write16(CAN1_MB24_DATA0, val)
856#define bfin_read_CAN1_MB24_DATA1() bfin_read16(CAN1_MB24_DATA1)
857#define bfin_write_CAN1_MB24_DATA1(val) bfin_write16(CAN1_MB24_DATA1, val)
858#define bfin_read_CAN1_MB24_DATA2() bfin_read16(CAN1_MB24_DATA2)
859#define bfin_write_CAN1_MB24_DATA2(val) bfin_write16(CAN1_MB24_DATA2, val)
860#define bfin_read_CAN1_MB24_DATA3() bfin_read16(CAN1_MB24_DATA3)
861#define bfin_write_CAN1_MB24_DATA3(val) bfin_write16(CAN1_MB24_DATA3, val)
862#define bfin_read_CAN1_MB24_LENGTH() bfin_read16(CAN1_MB24_LENGTH)
863#define bfin_write_CAN1_MB24_LENGTH(val) bfin_write16(CAN1_MB24_LENGTH, val)
864#define bfin_read_CAN1_MB24_TIMESTAMP() bfin_read16(CAN1_MB24_TIMESTAMP)
865#define bfin_write_CAN1_MB24_TIMESTAMP(val) bfin_write16(CAN1_MB24_TIMESTAMP, val)
866#define bfin_read_CAN1_MB24_ID0() bfin_read16(CAN1_MB24_ID0)
867#define bfin_write_CAN1_MB24_ID0(val) bfin_write16(CAN1_MB24_ID0, val)
868#define bfin_read_CAN1_MB24_ID1() bfin_read16(CAN1_MB24_ID1)
869#define bfin_write_CAN1_MB24_ID1(val) bfin_write16(CAN1_MB24_ID1, val)
870#define bfin_read_CAN1_MB25_DATA0() bfin_read16(CAN1_MB25_DATA0)
871#define bfin_write_CAN1_MB25_DATA0(val) bfin_write16(CAN1_MB25_DATA0, val)
872#define bfin_read_CAN1_MB25_DATA1() bfin_read16(CAN1_MB25_DATA1)
873#define bfin_write_CAN1_MB25_DATA1(val) bfin_write16(CAN1_MB25_DATA1, val)
874#define bfin_read_CAN1_MB25_DATA2() bfin_read16(CAN1_MB25_DATA2)
875#define bfin_write_CAN1_MB25_DATA2(val) bfin_write16(CAN1_MB25_DATA2, val)
876#define bfin_read_CAN1_MB25_DATA3() bfin_read16(CAN1_MB25_DATA3)
877#define bfin_write_CAN1_MB25_DATA3(val) bfin_write16(CAN1_MB25_DATA3, val)
878#define bfin_read_CAN1_MB25_LENGTH() bfin_read16(CAN1_MB25_LENGTH)
879#define bfin_write_CAN1_MB25_LENGTH(val) bfin_write16(CAN1_MB25_LENGTH, val)
880#define bfin_read_CAN1_MB25_TIMESTAMP() bfin_read16(CAN1_MB25_TIMESTAMP)
881#define bfin_write_CAN1_MB25_TIMESTAMP(val) bfin_write16(CAN1_MB25_TIMESTAMP, val)
882#define bfin_read_CAN1_MB25_ID0() bfin_read16(CAN1_MB25_ID0)
883#define bfin_write_CAN1_MB25_ID0(val) bfin_write16(CAN1_MB25_ID0, val)
884#define bfin_read_CAN1_MB25_ID1() bfin_read16(CAN1_MB25_ID1)
885#define bfin_write_CAN1_MB25_ID1(val) bfin_write16(CAN1_MB25_ID1, val)
886#define bfin_read_CAN1_MB26_DATA0() bfin_read16(CAN1_MB26_DATA0)
887#define bfin_write_CAN1_MB26_DATA0(val) bfin_write16(CAN1_MB26_DATA0, val)
888#define bfin_read_CAN1_MB26_DATA1() bfin_read16(CAN1_MB26_DATA1)
889#define bfin_write_CAN1_MB26_DATA1(val) bfin_write16(CAN1_MB26_DATA1, val)
890#define bfin_read_CAN1_MB26_DATA2() bfin_read16(CAN1_MB26_DATA2)
891#define bfin_write_CAN1_MB26_DATA2(val) bfin_write16(CAN1_MB26_DATA2, val)
892#define bfin_read_CAN1_MB26_DATA3() bfin_read16(CAN1_MB26_DATA3)
893#define bfin_write_CAN1_MB26_DATA3(val) bfin_write16(CAN1_MB26_DATA3, val)
894#define bfin_read_CAN1_MB26_LENGTH() bfin_read16(CAN1_MB26_LENGTH)
895#define bfin_write_CAN1_MB26_LENGTH(val) bfin_write16(CAN1_MB26_LENGTH, val)
896#define bfin_read_CAN1_MB26_TIMESTAMP() bfin_read16(CAN1_MB26_TIMESTAMP)
897#define bfin_write_CAN1_MB26_TIMESTAMP(val) bfin_write16(CAN1_MB26_TIMESTAMP, val)
898#define bfin_read_CAN1_MB26_ID0() bfin_read16(CAN1_MB26_ID0)
899#define bfin_write_CAN1_MB26_ID0(val) bfin_write16(CAN1_MB26_ID0, val)
900#define bfin_read_CAN1_MB26_ID1() bfin_read16(CAN1_MB26_ID1)
901#define bfin_write_CAN1_MB26_ID1(val) bfin_write16(CAN1_MB26_ID1, val)
902#define bfin_read_CAN1_MB27_DATA0() bfin_read16(CAN1_MB27_DATA0)
903#define bfin_write_CAN1_MB27_DATA0(val) bfin_write16(CAN1_MB27_DATA0, val)
904#define bfin_read_CAN1_MB27_DATA1() bfin_read16(CAN1_MB27_DATA1)
905#define bfin_write_CAN1_MB27_DATA1(val) bfin_write16(CAN1_MB27_DATA1, val)
906#define bfin_read_CAN1_MB27_DATA2() bfin_read16(CAN1_MB27_DATA2)
907#define bfin_write_CAN1_MB27_DATA2(val) bfin_write16(CAN1_MB27_DATA2, val)
908#define bfin_read_CAN1_MB27_DATA3() bfin_read16(CAN1_MB27_DATA3)
909#define bfin_write_CAN1_MB27_DATA3(val) bfin_write16(CAN1_MB27_DATA3, val)
910#define bfin_read_CAN1_MB27_LENGTH() bfin_read16(CAN1_MB27_LENGTH)
911#define bfin_write_CAN1_MB27_LENGTH(val) bfin_write16(CAN1_MB27_LENGTH, val)
912#define bfin_read_CAN1_MB27_TIMESTAMP() bfin_read16(CAN1_MB27_TIMESTAMP)
913#define bfin_write_CAN1_MB27_TIMESTAMP(val) bfin_write16(CAN1_MB27_TIMESTAMP, val)
914#define bfin_read_CAN1_MB27_ID0() bfin_read16(CAN1_MB27_ID0)
915#define bfin_write_CAN1_MB27_ID0(val) bfin_write16(CAN1_MB27_ID0, val)
916#define bfin_read_CAN1_MB27_ID1() bfin_read16(CAN1_MB27_ID1)
917#define bfin_write_CAN1_MB27_ID1(val) bfin_write16(CAN1_MB27_ID1, val)
918#define bfin_read_CAN1_MB28_DATA0() bfin_read16(CAN1_MB28_DATA0)
919#define bfin_write_CAN1_MB28_DATA0(val) bfin_write16(CAN1_MB28_DATA0, val)
920#define bfin_read_CAN1_MB28_DATA1() bfin_read16(CAN1_MB28_DATA1)
921#define bfin_write_CAN1_MB28_DATA1(val) bfin_write16(CAN1_MB28_DATA1, val)
922#define bfin_read_CAN1_MB28_DATA2() bfin_read16(CAN1_MB28_DATA2)
923#define bfin_write_CAN1_MB28_DATA2(val) bfin_write16(CAN1_MB28_DATA2, val)
924#define bfin_read_CAN1_MB28_DATA3() bfin_read16(CAN1_MB28_DATA3)
925#define bfin_write_CAN1_MB28_DATA3(val) bfin_write16(CAN1_MB28_DATA3, val)
926#define bfin_read_CAN1_MB28_LENGTH() bfin_read16(CAN1_MB28_LENGTH)
927#define bfin_write_CAN1_MB28_LENGTH(val) bfin_write16(CAN1_MB28_LENGTH, val)
928#define bfin_read_CAN1_MB28_TIMESTAMP() bfin_read16(CAN1_MB28_TIMESTAMP)
929#define bfin_write_CAN1_MB28_TIMESTAMP(val) bfin_write16(CAN1_MB28_TIMESTAMP, val)
930#define bfin_read_CAN1_MB28_ID0() bfin_read16(CAN1_MB28_ID0)
931#define bfin_write_CAN1_MB28_ID0(val) bfin_write16(CAN1_MB28_ID0, val)
932#define bfin_read_CAN1_MB28_ID1() bfin_read16(CAN1_MB28_ID1)
933#define bfin_write_CAN1_MB28_ID1(val) bfin_write16(CAN1_MB28_ID1, val)
934#define bfin_read_CAN1_MB29_DATA0() bfin_read16(CAN1_MB29_DATA0)
935#define bfin_write_CAN1_MB29_DATA0(val) bfin_write16(CAN1_MB29_DATA0, val)
936#define bfin_read_CAN1_MB29_DATA1() bfin_read16(CAN1_MB29_DATA1)
937#define bfin_write_CAN1_MB29_DATA1(val) bfin_write16(CAN1_MB29_DATA1, val)
938#define bfin_read_CAN1_MB29_DATA2() bfin_read16(CAN1_MB29_DATA2)
939#define bfin_write_CAN1_MB29_DATA2(val) bfin_write16(CAN1_MB29_DATA2, val)
940#define bfin_read_CAN1_MB29_DATA3() bfin_read16(CAN1_MB29_DATA3)
941#define bfin_write_CAN1_MB29_DATA3(val) bfin_write16(CAN1_MB29_DATA3, val)
942#define bfin_read_CAN1_MB29_LENGTH() bfin_read16(CAN1_MB29_LENGTH)
943#define bfin_write_CAN1_MB29_LENGTH(val) bfin_write16(CAN1_MB29_LENGTH, val)
944#define bfin_read_CAN1_MB29_TIMESTAMP() bfin_read16(CAN1_MB29_TIMESTAMP)
945#define bfin_write_CAN1_MB29_TIMESTAMP(val) bfin_write16(CAN1_MB29_TIMESTAMP, val)
946#define bfin_read_CAN1_MB29_ID0() bfin_read16(CAN1_MB29_ID0)
947#define bfin_write_CAN1_MB29_ID0(val) bfin_write16(CAN1_MB29_ID0, val)
948#define bfin_read_CAN1_MB29_ID1() bfin_read16(CAN1_MB29_ID1)
949#define bfin_write_CAN1_MB29_ID1(val) bfin_write16(CAN1_MB29_ID1, val)
950#define bfin_read_CAN1_MB30_DATA0() bfin_read16(CAN1_MB30_DATA0)
951#define bfin_write_CAN1_MB30_DATA0(val) bfin_write16(CAN1_MB30_DATA0, val)
952#define bfin_read_CAN1_MB30_DATA1() bfin_read16(CAN1_MB30_DATA1)
953#define bfin_write_CAN1_MB30_DATA1(val) bfin_write16(CAN1_MB30_DATA1, val)
954#define bfin_read_CAN1_MB30_DATA2() bfin_read16(CAN1_MB30_DATA2)
955#define bfin_write_CAN1_MB30_DATA2(val) bfin_write16(CAN1_MB30_DATA2, val)
956#define bfin_read_CAN1_MB30_DATA3() bfin_read16(CAN1_MB30_DATA3)
957#define bfin_write_CAN1_MB30_DATA3(val) bfin_write16(CAN1_MB30_DATA3, val)
958#define bfin_read_CAN1_MB30_LENGTH() bfin_read16(CAN1_MB30_LENGTH)
959#define bfin_write_CAN1_MB30_LENGTH(val) bfin_write16(CAN1_MB30_LENGTH, val)
960#define bfin_read_CAN1_MB30_TIMESTAMP() bfin_read16(CAN1_MB30_TIMESTAMP)
961#define bfin_write_CAN1_MB30_TIMESTAMP(val) bfin_write16(CAN1_MB30_TIMESTAMP, val)
962#define bfin_read_CAN1_MB30_ID0() bfin_read16(CAN1_MB30_ID0)
963#define bfin_write_CAN1_MB30_ID0(val) bfin_write16(CAN1_MB30_ID0, val)
964#define bfin_read_CAN1_MB30_ID1() bfin_read16(CAN1_MB30_ID1)
965#define bfin_write_CAN1_MB30_ID1(val) bfin_write16(CAN1_MB30_ID1, val)
966#define bfin_read_CAN1_MB31_DATA0() bfin_read16(CAN1_MB31_DATA0)
967#define bfin_write_CAN1_MB31_DATA0(val) bfin_write16(CAN1_MB31_DATA0, val)
968#define bfin_read_CAN1_MB31_DATA1() bfin_read16(CAN1_MB31_DATA1)
969#define bfin_write_CAN1_MB31_DATA1(val) bfin_write16(CAN1_MB31_DATA1, val)
970#define bfin_read_CAN1_MB31_DATA2() bfin_read16(CAN1_MB31_DATA2)
971#define bfin_write_CAN1_MB31_DATA2(val) bfin_write16(CAN1_MB31_DATA2, val)
972#define bfin_read_CAN1_MB31_DATA3() bfin_read16(CAN1_MB31_DATA3)
973#define bfin_write_CAN1_MB31_DATA3(val) bfin_write16(CAN1_MB31_DATA3, val)
974#define bfin_read_CAN1_MB31_LENGTH() bfin_read16(CAN1_MB31_LENGTH)
975#define bfin_write_CAN1_MB31_LENGTH(val) bfin_write16(CAN1_MB31_LENGTH, val)
976#define bfin_read_CAN1_MB31_TIMESTAMP() bfin_read16(CAN1_MB31_TIMESTAMP)
977#define bfin_write_CAN1_MB31_TIMESTAMP(val) bfin_write16(CAN1_MB31_TIMESTAMP, val)
978#define bfin_read_CAN1_MB31_ID0() bfin_read16(CAN1_MB31_ID0)
979#define bfin_write_CAN1_MB31_ID0(val) bfin_write16(CAN1_MB31_ID0, val)
980#define bfin_read_CAN1_MB31_ID1() bfin_read16(CAN1_MB31_ID1)
981#define bfin_write_CAN1_MB31_ID1(val) bfin_write16(CAN1_MB31_ID1, val)
982
983/* ATAPI Registers */
984
985#define bfin_read_ATAPI_CONTROL() bfin_read16(ATAPI_CONTROL)
986#define bfin_write_ATAPI_CONTROL(val) bfin_write16(ATAPI_CONTROL, val)
987#define bfin_read_ATAPI_STATUS() bfin_read16(ATAPI_STATUS)
988#define bfin_write_ATAPI_STATUS(val) bfin_write16(ATAPI_STATUS, val)
989#define bfin_read_ATAPI_DEV_ADDR() bfin_read16(ATAPI_DEV_ADDR)
990#define bfin_write_ATAPI_DEV_ADDR(val) bfin_write16(ATAPI_DEV_ADDR, val)
991#define bfin_read_ATAPI_DEV_TXBUF() bfin_read16(ATAPI_DEV_TXBUF)
992#define bfin_write_ATAPI_DEV_TXBUF(val) bfin_write16(ATAPI_DEV_TXBUF, val)
993#define bfin_read_ATAPI_DEV_RXBUF() bfin_read16(ATAPI_DEV_RXBUF)
994#define bfin_write_ATAPI_DEV_RXBUF(val) bfin_write16(ATAPI_DEV_RXBUF, val)
995#define bfin_read_ATAPI_INT_MASK() bfin_read16(ATAPI_INT_MASK)
996#define bfin_write_ATAPI_INT_MASK(val) bfin_write16(ATAPI_INT_MASK, val)
997#define bfin_read_ATAPI_INT_STATUS() bfin_read16(ATAPI_INT_STATUS)
998#define bfin_write_ATAPI_INT_STATUS(val) bfin_write16(ATAPI_INT_STATUS, val)
999#define bfin_read_ATAPI_XFER_LEN() bfin_read16(ATAPI_XFER_LEN)
1000#define bfin_write_ATAPI_XFER_LEN(val) bfin_write16(ATAPI_XFER_LEN, val)
1001#define bfin_read_ATAPI_LINE_STATUS() bfin_read16(ATAPI_LINE_STATUS)
1002#define bfin_write_ATAPI_LINE_STATUS(val) bfin_write16(ATAPI_LINE_STATUS, val)
1003#define bfin_read_ATAPI_SM_STATE() bfin_read16(ATAPI_SM_STATE)
1004#define bfin_write_ATAPI_SM_STATE(val) bfin_write16(ATAPI_SM_STATE, val)
1005#define bfin_read_ATAPI_TERMINATE() bfin_read16(ATAPI_TERMINATE)
1006#define bfin_write_ATAPI_TERMINATE(val) bfin_write16(ATAPI_TERMINATE, val)
1007#define bfin_read_ATAPI_PIO_TFRCNT() bfin_read16(ATAPI_PIO_TFRCNT)
1008#define bfin_write_ATAPI_PIO_TFRCNT(val) bfin_write16(ATAPI_PIO_TFRCNT, val)
1009#define bfin_read_ATAPI_DMA_TFRCNT() bfin_read16(ATAPI_DMA_TFRCNT)
1010#define bfin_write_ATAPI_DMA_TFRCNT(val) bfin_write16(ATAPI_DMA_TFRCNT, val)
1011#define bfin_read_ATAPI_UMAIN_TFRCNT() bfin_read16(ATAPI_UMAIN_TFRCNT)
1012#define bfin_write_ATAPI_UMAIN_TFRCNT(val) bfin_write16(ATAPI_UMAIN_TFRCNT, val)
1013#define bfin_read_ATAPI_UDMAOUT_TFRCNT() bfin_read16(ATAPI_UDMAOUT_TFRCNT)
1014#define bfin_write_ATAPI_UDMAOUT_TFRCNT(val) bfin_write16(ATAPI_UDMAOUT_TFRCNT, val)
1015#define bfin_read_ATAPI_REG_TIM_0() bfin_read16(ATAPI_REG_TIM_0)
1016#define bfin_write_ATAPI_REG_TIM_0(val) bfin_write16(ATAPI_REG_TIM_0, val)
1017#define bfin_read_ATAPI_PIO_TIM_0() bfin_read16(ATAPI_PIO_TIM_0)
1018#define bfin_write_ATAPI_PIO_TIM_0(val) bfin_write16(ATAPI_PIO_TIM_0, val)
1019#define bfin_read_ATAPI_PIO_TIM_1() bfin_read16(ATAPI_PIO_TIM_1)
1020#define bfin_write_ATAPI_PIO_TIM_1(val) bfin_write16(ATAPI_PIO_TIM_1, val)
1021#define bfin_read_ATAPI_MULTI_TIM_0() bfin_read16(ATAPI_MULTI_TIM_0)
1022#define bfin_write_ATAPI_MULTI_TIM_0(val) bfin_write16(ATAPI_MULTI_TIM_0, val)
1023#define bfin_read_ATAPI_MULTI_TIM_1() bfin_read16(ATAPI_MULTI_TIM_1)
1024#define bfin_write_ATAPI_MULTI_TIM_1(val) bfin_write16(ATAPI_MULTI_TIM_1, val)
1025#define bfin_read_ATAPI_MULTI_TIM_2() bfin_read16(ATAPI_MULTI_TIM_2)
1026#define bfin_write_ATAPI_MULTI_TIM_2(val) bfin_write16(ATAPI_MULTI_TIM_2, val)
1027#define bfin_read_ATAPI_ULTRA_TIM_0() bfin_read16(ATAPI_ULTRA_TIM_0)
1028#define bfin_write_ATAPI_ULTRA_TIM_0(val) bfin_write16(ATAPI_ULTRA_TIM_0, val)
1029#define bfin_read_ATAPI_ULTRA_TIM_1() bfin_read16(ATAPI_ULTRA_TIM_1)
1030#define bfin_write_ATAPI_ULTRA_TIM_1(val) bfin_write16(ATAPI_ULTRA_TIM_1, val)
1031#define bfin_read_ATAPI_ULTRA_TIM_2() bfin_read16(ATAPI_ULTRA_TIM_2)
1032#define bfin_write_ATAPI_ULTRA_TIM_2(val) bfin_write16(ATAPI_ULTRA_TIM_2, val)
1033#define bfin_read_ATAPI_ULTRA_TIM_3() bfin_read16(ATAPI_ULTRA_TIM_3)
1034#define bfin_write_ATAPI_ULTRA_TIM_3(val) bfin_write16(ATAPI_ULTRA_TIM_3, val)
1035
1036/* SDH Registers */
1037
1038#define bfin_read_SDH_PWR_CTL() bfin_read16(SDH_PWR_CTL)
1039#define bfin_write_SDH_PWR_CTL(val) bfin_write16(SDH_PWR_CTL, val)
1040#define bfin_read_SDH_CLK_CTL() bfin_read16(SDH_CLK_CTL)
1041#define bfin_write_SDH_CLK_CTL(val) bfin_write16(SDH_CLK_CTL, val)
1042#define bfin_read_SDH_ARGUMENT() bfin_read32(SDH_ARGUMENT)
1043#define bfin_write_SDH_ARGUMENT(val) bfin_write32(SDH_ARGUMENT, val)
1044#define bfin_read_SDH_COMMAND() bfin_read16(SDH_COMMAND)
1045#define bfin_write_SDH_COMMAND(val) bfin_write16(SDH_COMMAND, val)
1046#define bfin_read_SDH_RESP_CMD() bfin_read16(SDH_RESP_CMD)
1047#define bfin_write_SDH_RESP_CMD(val) bfin_write16(SDH_RESP_CMD, val)
1048#define bfin_read_SDH_RESPONSE0() bfin_read32(SDH_RESPONSE0)
1049#define bfin_write_SDH_RESPONSE0(val) bfin_write32(SDH_RESPONSE0, val)
1050#define bfin_read_SDH_RESPONSE1() bfin_read32(SDH_RESPONSE1)
1051#define bfin_write_SDH_RESPONSE1(val) bfin_write32(SDH_RESPONSE1, val)
1052#define bfin_read_SDH_RESPONSE2() bfin_read32(SDH_RESPONSE2)
1053#define bfin_write_SDH_RESPONSE2(val) bfin_write32(SDH_RESPONSE2, val)
1054#define bfin_read_SDH_RESPONSE3() bfin_read32(SDH_RESPONSE3)
1055#define bfin_write_SDH_RESPONSE3(val) bfin_write32(SDH_RESPONSE3, val)
1056#define bfin_read_SDH_DATA_TIMER() bfin_read32(SDH_DATA_TIMER)
1057#define bfin_write_SDH_DATA_TIMER(val) bfin_write32(SDH_DATA_TIMER, val)
1058#define bfin_read_SDH_DATA_LGTH() bfin_read16(SDH_DATA_LGTH)
1059#define bfin_write_SDH_DATA_LGTH(val) bfin_write16(SDH_DATA_LGTH, val)
1060#define bfin_read_SDH_DATA_CTL() bfin_read16(SDH_DATA_CTL)
1061#define bfin_write_SDH_DATA_CTL(val) bfin_write16(SDH_DATA_CTL, val)
1062#define bfin_read_SDH_DATA_CNT() bfin_read16(SDH_DATA_CNT)
1063#define bfin_write_SDH_DATA_CNT(val) bfin_write16(SDH_DATA_CNT, val)
1064#define bfin_read_SDH_STATUS() bfin_read32(SDH_STATUS)
1065#define bfin_write_SDH_STATUS(val) bfin_write32(SDH_STATUS, val)
1066#define bfin_read_SDH_STATUS_CLR() bfin_read16(SDH_STATUS_CLR)
1067#define bfin_write_SDH_STATUS_CLR(val) bfin_write16(SDH_STATUS_CLR, val)
1068#define bfin_read_SDH_MASK0() bfin_read32(SDH_MASK0)
1069#define bfin_write_SDH_MASK0(val) bfin_write32(SDH_MASK0, val)
1070#define bfin_read_SDH_MASK1() bfin_read32(SDH_MASK1)
1071#define bfin_write_SDH_MASK1(val) bfin_write32(SDH_MASK1, val)
1072#define bfin_read_SDH_FIFO_CNT() bfin_read16(SDH_FIFO_CNT)
1073#define bfin_write_SDH_FIFO_CNT(val) bfin_write16(SDH_FIFO_CNT, val)
1074#define bfin_read_SDH_FIFO() bfin_read32(SDH_FIFO)
1075#define bfin_write_SDH_FIFO(val) bfin_write32(SDH_FIFO, val)
1076#define bfin_read_SDH_E_STATUS() bfin_read16(SDH_E_STATUS)
1077#define bfin_write_SDH_E_STATUS(val) bfin_write16(SDH_E_STATUS, val)
1078#define bfin_read_SDH_E_MASK() bfin_read16(SDH_E_MASK)
1079#define bfin_write_SDH_E_MASK(val) bfin_write16(SDH_E_MASK, val)
1080#define bfin_read_SDH_CFG() bfin_read16(SDH_CFG)
1081#define bfin_write_SDH_CFG(val) bfin_write16(SDH_CFG, val)
1082#define bfin_read_SDH_RD_WAIT_EN() bfin_read16(SDH_RD_WAIT_EN)
1083#define bfin_write_SDH_RD_WAIT_EN(val) bfin_write16(SDH_RD_WAIT_EN, val)
1084#define bfin_read_SDH_PID0() bfin_read16(SDH_PID0)
1085#define bfin_write_SDH_PID0(val) bfin_write16(SDH_PID0, val)
1086#define bfin_read_SDH_PID1() bfin_read16(SDH_PID1)
1087#define bfin_write_SDH_PID1(val) bfin_write16(SDH_PID1, val)
1088#define bfin_read_SDH_PID2() bfin_read16(SDH_PID2)
1089#define bfin_write_SDH_PID2(val) bfin_write16(SDH_PID2, val)
1090#define bfin_read_SDH_PID3() bfin_read16(SDH_PID3)
1091#define bfin_write_SDH_PID3(val) bfin_write16(SDH_PID3, val)
1092#define bfin_read_SDH_PID4() bfin_read16(SDH_PID4)
1093#define bfin_write_SDH_PID4(val) bfin_write16(SDH_PID4, val)
1094#define bfin_read_SDH_PID5() bfin_read16(SDH_PID5)
1095#define bfin_write_SDH_PID5(val) bfin_write16(SDH_PID5, val)
1096#define bfin_read_SDH_PID6() bfin_read16(SDH_PID6)
1097#define bfin_write_SDH_PID6(val) bfin_write16(SDH_PID6, val)
1098#define bfin_read_SDH_PID7() bfin_read16(SDH_PID7)
1099#define bfin_write_SDH_PID7(val) bfin_write16(SDH_PID7, val)
1100
1101/* HOST Port Registers */
1102
1103#define bfin_read_HOST_CONTROL() bfin_read16(HOST_CONTROL)
1104#define bfin_write_HOST_CONTROL(val) bfin_write16(HOST_CONTROL, val)
1105#define bfin_read_HOST_STATUS() bfin_read16(HOST_STATUS)
1106#define bfin_write_HOST_STATUS(val) bfin_write16(HOST_STATUS, val)
1107#define bfin_read_HOST_TIMEOUT() bfin_read16(HOST_TIMEOUT)
1108#define bfin_write_HOST_TIMEOUT(val) bfin_write16(HOST_TIMEOUT, val)
1109
1110/* USB Control Registers */
1111
1112#define bfin_read_USB_FADDR() bfin_read16(USB_FADDR)
1113#define bfin_write_USB_FADDR(val) bfin_write16(USB_FADDR, val)
1114#define bfin_read_USB_POWER() bfin_read16(USB_POWER)
1115#define bfin_write_USB_POWER(val) bfin_write16(USB_POWER, val)
1116#define bfin_read_USB_INTRTX() bfin_read16(USB_INTRTX)
1117#define bfin_write_USB_INTRTX(val) bfin_write16(USB_INTRTX, val)
1118#define bfin_read_USB_INTRRX() bfin_read16(USB_INTRRX)
1119#define bfin_write_USB_INTRRX(val) bfin_write16(USB_INTRRX, val)
1120#define bfin_read_USB_INTRTXE() bfin_read16(USB_INTRTXE)
1121#define bfin_write_USB_INTRTXE(val) bfin_write16(USB_INTRTXE, val)
1122#define bfin_read_USB_INTRRXE() bfin_read16(USB_INTRRXE)
1123#define bfin_write_USB_INTRRXE(val) bfin_write16(USB_INTRRXE, val)
1124#define bfin_read_USB_INTRUSB() bfin_read16(USB_INTRUSB)
1125#define bfin_write_USB_INTRUSB(val) bfin_write16(USB_INTRUSB, val)
1126#define bfin_read_USB_INTRUSBE() bfin_read16(USB_INTRUSBE)
1127#define bfin_write_USB_INTRUSBE(val) bfin_write16(USB_INTRUSBE, val)
1128#define bfin_read_USB_FRAME() bfin_read16(USB_FRAME)
1129#define bfin_write_USB_FRAME(val) bfin_write16(USB_FRAME, val)
1130#define bfin_read_USB_INDEX() bfin_read16(USB_INDEX)
1131#define bfin_write_USB_INDEX(val) bfin_write16(USB_INDEX, val)
1132#define bfin_read_USB_TESTMODE() bfin_read16(USB_TESTMODE)
1133#define bfin_write_USB_TESTMODE(val) bfin_write16(USB_TESTMODE, val)
1134#define bfin_read_USB_GLOBINTR() bfin_read16(USB_GLOBINTR)
1135#define bfin_write_USB_GLOBINTR(val) bfin_write16(USB_GLOBINTR, val)
1136#define bfin_read_USB_GLOBAL_CTL() bfin_read16(USB_GLOBAL_CTL)
1137#define bfin_write_USB_GLOBAL_CTL(val) bfin_write16(USB_GLOBAL_CTL, val)
1138
1139/* USB Packet Control Registers */
1140
1141#define bfin_read_USB_TX_MAX_PACKET() bfin_read16(USB_TX_MAX_PACKET)
1142#define bfin_write_USB_TX_MAX_PACKET(val) bfin_write16(USB_TX_MAX_PACKET, val)
1143#define bfin_read_USB_CSR0() bfin_read16(USB_CSR0)
1144#define bfin_write_USB_CSR0(val) bfin_write16(USB_CSR0, val)
1145#define bfin_read_USB_TXCSR() bfin_read16(USB_TXCSR)
1146#define bfin_write_USB_TXCSR(val) bfin_write16(USB_TXCSR, val)
1147#define bfin_read_USB_RX_MAX_PACKET() bfin_read16(USB_RX_MAX_PACKET)
1148#define bfin_write_USB_RX_MAX_PACKET(val) bfin_write16(USB_RX_MAX_PACKET, val)
1149#define bfin_read_USB_RXCSR() bfin_read16(USB_RXCSR)
1150#define bfin_write_USB_RXCSR(val) bfin_write16(USB_RXCSR, val)
1151#define bfin_read_USB_COUNT0() bfin_read16(USB_COUNT0)
1152#define bfin_write_USB_COUNT0(val) bfin_write16(USB_COUNT0, val)
1153#define bfin_read_USB_RXCOUNT() bfin_read16(USB_RXCOUNT)
1154#define bfin_write_USB_RXCOUNT(val) bfin_write16(USB_RXCOUNT, val)
1155#define bfin_read_USB_TXTYPE() bfin_read16(USB_TXTYPE)
1156#define bfin_write_USB_TXTYPE(val) bfin_write16(USB_TXTYPE, val)
1157#define bfin_read_USB_NAKLIMIT0() bfin_read16(USB_NAKLIMIT0)
1158#define bfin_write_USB_NAKLIMIT0(val) bfin_write16(USB_NAKLIMIT0, val)
1159#define bfin_read_USB_TXINTERVAL() bfin_read16(USB_TXINTERVAL)
1160#define bfin_write_USB_TXINTERVAL(val) bfin_write16(USB_TXINTERVAL, val)
1161#define bfin_read_USB_RXTYPE() bfin_read16(USB_RXTYPE)
1162#define bfin_write_USB_RXTYPE(val) bfin_write16(USB_RXTYPE, val)
1163#define bfin_read_USB_RXINTERVAL() bfin_read16(USB_RXINTERVAL)
1164#define bfin_write_USB_RXINTERVAL(val) bfin_write16(USB_RXINTERVAL, val)
1165#define bfin_read_USB_TXCOUNT() bfin_read16(USB_TXCOUNT)
1166#define bfin_write_USB_TXCOUNT(val) bfin_write16(USB_TXCOUNT, val)
1167
1168/* USB Endbfin_read_()oint FIFO Registers */
1169
1170#define bfin_read_USB_EP0_FIFO() bfin_read16(USB_EP0_FIFO)
1171#define bfin_write_USB_EP0_FIFO(val) bfin_write16(USB_EP0_FIFO, val)
1172#define bfin_read_USB_EP1_FIFO() bfin_read16(USB_EP1_FIFO)
1173#define bfin_write_USB_EP1_FIFO(val) bfin_write16(USB_EP1_FIFO, val)
1174#define bfin_read_USB_EP2_FIFO() bfin_read16(USB_EP2_FIFO)
1175#define bfin_write_USB_EP2_FIFO(val) bfin_write16(USB_EP2_FIFO, val)
1176#define bfin_read_USB_EP3_FIFO() bfin_read16(USB_EP3_FIFO)
1177#define bfin_write_USB_EP3_FIFO(val) bfin_write16(USB_EP3_FIFO, val)
1178#define bfin_read_USB_EP4_FIFO() bfin_read16(USB_EP4_FIFO)
1179#define bfin_write_USB_EP4_FIFO(val) bfin_write16(USB_EP4_FIFO, val)
1180#define bfin_read_USB_EP5_FIFO() bfin_read16(USB_EP5_FIFO)
1181#define bfin_write_USB_EP5_FIFO(val) bfin_write16(USB_EP5_FIFO, val)
1182#define bfin_read_USB_EP6_FIFO() bfin_read16(USB_EP6_FIFO)
1183#define bfin_write_USB_EP6_FIFO(val) bfin_write16(USB_EP6_FIFO, val)
1184#define bfin_read_USB_EP7_FIFO() bfin_read16(USB_EP7_FIFO)
1185#define bfin_write_USB_EP7_FIFO(val) bfin_write16(USB_EP7_FIFO, val)
1186
1187/* USB OTG Control Registers */
1188
1189#define bfin_read_USB_OTG_DEV_CTL() bfin_read16(USB_OTG_DEV_CTL)
1190#define bfin_write_USB_OTG_DEV_CTL(val) bfin_write16(USB_OTG_DEV_CTL, val)
1191#define bfin_read_USB_OTG_VBUS_IRQ() bfin_read16(USB_OTG_VBUS_IRQ)
1192#define bfin_write_USB_OTG_VBUS_IRQ(val) bfin_write16(USB_OTG_VBUS_IRQ, val)
1193#define bfin_read_USB_OTG_VBUS_MASK() bfin_read16(USB_OTG_VBUS_MASK)
1194#define bfin_write_USB_OTG_VBUS_MASK(val) bfin_write16(USB_OTG_VBUS_MASK, val)
1195
1196/* USB Phy Control Registers */
1197
1198#define bfin_read_USB_LINKINFO() bfin_read16(USB_LINKINFO)
1199#define bfin_write_USB_LINKINFO(val) bfin_write16(USB_LINKINFO, val)
1200#define bfin_read_USB_VPLEN() bfin_read16(USB_VPLEN)
1201#define bfin_write_USB_VPLEN(val) bfin_write16(USB_VPLEN, val)
1202#define bfin_read_USB_HS_EOF1() bfin_read16(USB_HS_EOF1)
1203#define bfin_write_USB_HS_EOF1(val) bfin_write16(USB_HS_EOF1, val)
1204#define bfin_read_USB_FS_EOF1() bfin_read16(USB_FS_EOF1)
1205#define bfin_write_USB_FS_EOF1(val) bfin_write16(USB_FS_EOF1, val)
1206#define bfin_read_USB_LS_EOF1() bfin_read16(USB_LS_EOF1)
1207#define bfin_write_USB_LS_EOF1(val) bfin_write16(USB_LS_EOF1, val)
1208
1209/* (APHY_CNTRL is for ADI usage only) */
1210
1211#define bfin_read_USB_APHY_CNTRL() bfin_read16(USB_APHY_CNTRL)
1212#define bfin_write_USB_APHY_CNTRL(val) bfin_write16(USB_APHY_CNTRL, val)
1213
1214/* (APHY_CALIB is for ADI usage only) */
1215
1216#define bfin_read_USB_APHY_CALIB() bfin_read16(USB_APHY_CALIB)
1217#define bfin_write_USB_APHY_CALIB(val) bfin_write16(USB_APHY_CALIB, val)
1218#define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2)
1219#define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val)
1220
1221/* (PHY_TEST is for ADI usage only) */
1222
1223#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST)
1224#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val)
1225#define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL)
1226#define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val)
1227#define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV)
1228#define bfin_write_USB_SRP_CLKDIV(val) bfin_write16(USB_SRP_CLKDIV, val)
1229
1230/* USB Endbfin_read_()oint 0 Control Registers */
1231
1232#define bfin_read_USB_EP_NI0_TXMAXP() bfin_read16(USB_EP_NI0_TXMAXP)
1233#define bfin_write_USB_EP_NI0_TXMAXP(val) bfin_write16(USB_EP_NI0_TXMAXP, val)
1234#define bfin_read_USB_EP_NI0_TXCSR() bfin_read16(USB_EP_NI0_TXCSR)
1235#define bfin_write_USB_EP_NI0_TXCSR(val) bfin_write16(USB_EP_NI0_TXCSR, val)
1236#define bfin_read_USB_EP_NI0_RXMAXP() bfin_read16(USB_EP_NI0_RXMAXP)
1237#define bfin_write_USB_EP_NI0_RXMAXP(val) bfin_write16(USB_EP_NI0_RXMAXP, val)
1238#define bfin_read_USB_EP_NI0_RXCSR() bfin_read16(USB_EP_NI0_RXCSR)
1239#define bfin_write_USB_EP_NI0_RXCSR(val) bfin_write16(USB_EP_NI0_RXCSR, val)
1240#define bfin_read_USB_EP_NI0_RXCOUNT() bfin_read16(USB_EP_NI0_RXCOUNT)
1241#define bfin_write_USB_EP_NI0_RXCOUNT(val) bfin_write16(USB_EP_NI0_RXCOUNT, val)
1242#define bfin_read_USB_EP_NI0_TXTYPE() bfin_read16(USB_EP_NI0_TXTYPE)
1243#define bfin_write_USB_EP_NI0_TXTYPE(val) bfin_write16(USB_EP_NI0_TXTYPE, val)
1244#define bfin_read_USB_EP_NI0_TXINTERVAL() bfin_read16(USB_EP_NI0_TXINTERVAL)
1245#define bfin_write_USB_EP_NI0_TXINTERVAL(val) bfin_write16(USB_EP_NI0_TXINTERVAL, val)
1246#define bfin_read_USB_EP_NI0_RXTYPE() bfin_read16(USB_EP_NI0_RXTYPE)
1247#define bfin_write_USB_EP_NI0_RXTYPE(val) bfin_write16(USB_EP_NI0_RXTYPE, val)
1248#define bfin_read_USB_EP_NI0_RXINTERVAL() bfin_read16(USB_EP_NI0_RXINTERVAL)
1249#define bfin_write_USB_EP_NI0_RXINTERVAL(val) bfin_write16(USB_EP_NI0_RXINTERVAL, val)
1250
1251/* USB Endbfin_read_()oint 1 Control Registers */
1252
1253#define bfin_read_USB_EP_NI0_TXCOUNT() bfin_read16(USB_EP_NI0_TXCOUNT)
1254#define bfin_write_USB_EP_NI0_TXCOUNT(val) bfin_write16(USB_EP_NI0_TXCOUNT, val)
1255#define bfin_read_USB_EP_NI1_TXMAXP() bfin_read16(USB_EP_NI1_TXMAXP)
1256#define bfin_write_USB_EP_NI1_TXMAXP(val) bfin_write16(USB_EP_NI1_TXMAXP, val)
1257#define bfin_read_USB_EP_NI1_TXCSR() bfin_read16(USB_EP_NI1_TXCSR)
1258#define bfin_write_USB_EP_NI1_TXCSR(val) bfin_write16(USB_EP_NI1_TXCSR, val)
1259#define bfin_read_USB_EP_NI1_RXMAXP() bfin_read16(USB_EP_NI1_RXMAXP)
1260#define bfin_write_USB_EP_NI1_RXMAXP(val) bfin_write16(USB_EP_NI1_RXMAXP, val)
1261#define bfin_read_USB_EP_NI1_RXCSR() bfin_read16(USB_EP_NI1_RXCSR)
1262#define bfin_write_USB_EP_NI1_RXCSR(val) bfin_write16(USB_EP_NI1_RXCSR, val)
1263#define bfin_read_USB_EP_NI1_RXCOUNT() bfin_read16(USB_EP_NI1_RXCOUNT)
1264#define bfin_write_USB_EP_NI1_RXCOUNT(val) bfin_write16(USB_EP_NI1_RXCOUNT, val)
1265#define bfin_read_USB_EP_NI1_TXTYPE() bfin_read16(USB_EP_NI1_TXTYPE)
1266#define bfin_write_USB_EP_NI1_TXTYPE(val) bfin_write16(USB_EP_NI1_TXTYPE, val)
1267#define bfin_read_USB_EP_NI1_TXINTERVAL() bfin_read16(USB_EP_NI1_TXINTERVAL)
1268#define bfin_write_USB_EP_NI1_TXINTERVAL(val) bfin_write16(USB_EP_NI1_TXINTERVAL, val)
1269#define bfin_read_USB_EP_NI1_RXTYPE() bfin_read16(USB_EP_NI1_RXTYPE)
1270#define bfin_write_USB_EP_NI1_RXTYPE(val) bfin_write16(USB_EP_NI1_RXTYPE, val)
1271#define bfin_read_USB_EP_NI1_RXINTERVAL() bfin_read16(USB_EP_NI1_RXINTERVAL)
1272#define bfin_write_USB_EP_NI1_RXINTERVAL(val) bfin_write16(USB_EP_NI1_RXINTERVAL, val)
1273
1274/* USB Endbfin_read_()oint 2 Control Registers */
1275
1276#define bfin_read_USB_EP_NI1_TXCOUNT() bfin_read16(USB_EP_NI1_TXCOUNT)
1277#define bfin_write_USB_EP_NI1_TXCOUNT(val) bfin_write16(USB_EP_NI1_TXCOUNT, val)
1278#define bfin_read_USB_EP_NI2_TXMAXP() bfin_read16(USB_EP_NI2_TXMAXP)
1279#define bfin_write_USB_EP_NI2_TXMAXP(val) bfin_write16(USB_EP_NI2_TXMAXP, val)
1280#define bfin_read_USB_EP_NI2_TXCSR() bfin_read16(USB_EP_NI2_TXCSR)
1281#define bfin_write_USB_EP_NI2_TXCSR(val) bfin_write16(USB_EP_NI2_TXCSR, val)
1282#define bfin_read_USB_EP_NI2_RXMAXP() bfin_read16(USB_EP_NI2_RXMAXP)
1283#define bfin_write_USB_EP_NI2_RXMAXP(val) bfin_write16(USB_EP_NI2_RXMAXP, val)
1284#define bfin_read_USB_EP_NI2_RXCSR() bfin_read16(USB_EP_NI2_RXCSR)
1285#define bfin_write_USB_EP_NI2_RXCSR(val) bfin_write16(USB_EP_NI2_RXCSR, val)
1286#define bfin_read_USB_EP_NI2_RXCOUNT() bfin_read16(USB_EP_NI2_RXCOUNT)
1287#define bfin_write_USB_EP_NI2_RXCOUNT(val) bfin_write16(USB_EP_NI2_RXCOUNT, val)
1288#define bfin_read_USB_EP_NI2_TXTYPE() bfin_read16(USB_EP_NI2_TXTYPE)
1289#define bfin_write_USB_EP_NI2_TXTYPE(val) bfin_write16(USB_EP_NI2_TXTYPE, val)
1290#define bfin_read_USB_EP_NI2_TXINTERVAL() bfin_read16(USB_EP_NI2_TXINTERVAL)
1291#define bfin_write_USB_EP_NI2_TXINTERVAL(val) bfin_write16(USB_EP_NI2_TXINTERVAL, val)
1292#define bfin_read_USB_EP_NI2_RXTYPE() bfin_read16(USB_EP_NI2_RXTYPE)
1293#define bfin_write_USB_EP_NI2_RXTYPE(val) bfin_write16(USB_EP_NI2_RXTYPE, val)
1294#define bfin_read_USB_EP_NI2_RXINTERVAL() bfin_read16(USB_EP_NI2_RXINTERVAL)
1295#define bfin_write_USB_EP_NI2_RXINTERVAL(val) bfin_write16(USB_EP_NI2_RXINTERVAL, val)
1296
1297/* USB Endbfin_read_()oint 3 Control Registers */
1298
1299#define bfin_read_USB_EP_NI2_TXCOUNT() bfin_read16(USB_EP_NI2_TXCOUNT)
1300#define bfin_write_USB_EP_NI2_TXCOUNT(val) bfin_write16(USB_EP_NI2_TXCOUNT, val)
1301#define bfin_read_USB_EP_NI3_TXMAXP() bfin_read16(USB_EP_NI3_TXMAXP)
1302#define bfin_write_USB_EP_NI3_TXMAXP(val) bfin_write16(USB_EP_NI3_TXMAXP, val)
1303#define bfin_read_USB_EP_NI3_TXCSR() bfin_read16(USB_EP_NI3_TXCSR)
1304#define bfin_write_USB_EP_NI3_TXCSR(val) bfin_write16(USB_EP_NI3_TXCSR, val)
1305#define bfin_read_USB_EP_NI3_RXMAXP() bfin_read16(USB_EP_NI3_RXMAXP)
1306#define bfin_write_USB_EP_NI3_RXMAXP(val) bfin_write16(USB_EP_NI3_RXMAXP, val)
1307#define bfin_read_USB_EP_NI3_RXCSR() bfin_read16(USB_EP_NI3_RXCSR)
1308#define bfin_write_USB_EP_NI3_RXCSR(val) bfin_write16(USB_EP_NI3_RXCSR, val)
1309#define bfin_read_USB_EP_NI3_RXCOUNT() bfin_read16(USB_EP_NI3_RXCOUNT)
1310#define bfin_write_USB_EP_NI3_RXCOUNT(val) bfin_write16(USB_EP_NI3_RXCOUNT, val)
1311#define bfin_read_USB_EP_NI3_TXTYPE() bfin_read16(USB_EP_NI3_TXTYPE)
1312#define bfin_write_USB_EP_NI3_TXTYPE(val) bfin_write16(USB_EP_NI3_TXTYPE, val)
1313#define bfin_read_USB_EP_NI3_TXINTERVAL() bfin_read16(USB_EP_NI3_TXINTERVAL)
1314#define bfin_write_USB_EP_NI3_TXINTERVAL(val) bfin_write16(USB_EP_NI3_TXINTERVAL, val)
1315#define bfin_read_USB_EP_NI3_RXTYPE() bfin_read16(USB_EP_NI3_RXTYPE)
1316#define bfin_write_USB_EP_NI3_RXTYPE(val) bfin_write16(USB_EP_NI3_RXTYPE, val)
1317#define bfin_read_USB_EP_NI3_RXINTERVAL() bfin_read16(USB_EP_NI3_RXINTERVAL)
1318#define bfin_write_USB_EP_NI3_RXINTERVAL(val) bfin_write16(USB_EP_NI3_RXINTERVAL, val)
1319
1320/* USB Endbfin_read_()oint 4 Control Registers */
1321
1322#define bfin_read_USB_EP_NI3_TXCOUNT() bfin_read16(USB_EP_NI3_TXCOUNT)
1323#define bfin_write_USB_EP_NI3_TXCOUNT(val) bfin_write16(USB_EP_NI3_TXCOUNT, val)
1324#define bfin_read_USB_EP_NI4_TXMAXP() bfin_read16(USB_EP_NI4_TXMAXP)
1325#define bfin_write_USB_EP_NI4_TXMAXP(val) bfin_write16(USB_EP_NI4_TXMAXP, val)
1326#define bfin_read_USB_EP_NI4_TXCSR() bfin_read16(USB_EP_NI4_TXCSR)
1327#define bfin_write_USB_EP_NI4_TXCSR(val) bfin_write16(USB_EP_NI4_TXCSR, val)
1328#define bfin_read_USB_EP_NI4_RXMAXP() bfin_read16(USB_EP_NI4_RXMAXP)
1329#define bfin_write_USB_EP_NI4_RXMAXP(val) bfin_write16(USB_EP_NI4_RXMAXP, val)
1330#define bfin_read_USB_EP_NI4_RXCSR() bfin_read16(USB_EP_NI4_RXCSR)
1331#define bfin_write_USB_EP_NI4_RXCSR(val) bfin_write16(USB_EP_NI4_RXCSR, val)
1332#define bfin_read_USB_EP_NI4_RXCOUNT() bfin_read16(USB_EP_NI4_RXCOUNT)
1333#define bfin_write_USB_EP_NI4_RXCOUNT(val) bfin_write16(USB_EP_NI4_RXCOUNT, val)
1334#define bfin_read_USB_EP_NI4_TXTYPE() bfin_read16(USB_EP_NI4_TXTYPE)
1335#define bfin_write_USB_EP_NI4_TXTYPE(val) bfin_write16(USB_EP_NI4_TXTYPE, val)
1336#define bfin_read_USB_EP_NI4_TXINTERVAL() bfin_read16(USB_EP_NI4_TXINTERVAL)
1337#define bfin_write_USB_EP_NI4_TXINTERVAL(val) bfin_write16(USB_EP_NI4_TXINTERVAL, val)
1338#define bfin_read_USB_EP_NI4_RXTYPE() bfin_read16(USB_EP_NI4_RXTYPE)
1339#define bfin_write_USB_EP_NI4_RXTYPE(val) bfin_write16(USB_EP_NI4_RXTYPE, val)
1340#define bfin_read_USB_EP_NI4_RXINTERVAL() bfin_read16(USB_EP_NI4_RXINTERVAL)
1341#define bfin_write_USB_EP_NI4_RXINTERVAL(val) bfin_write16(USB_EP_NI4_RXINTERVAL, val)
1342
1343/* USB Endbfin_read_()oint 5 Control Registers */
1344
1345#define bfin_read_USB_EP_NI4_TXCOUNT() bfin_read16(USB_EP_NI4_TXCOUNT)
1346#define bfin_write_USB_EP_NI4_TXCOUNT(val) bfin_write16(USB_EP_NI4_TXCOUNT, val)
1347#define bfin_read_USB_EP_NI5_TXMAXP() bfin_read16(USB_EP_NI5_TXMAXP)
1348#define bfin_write_USB_EP_NI5_TXMAXP(val) bfin_write16(USB_EP_NI5_TXMAXP, val)
1349#define bfin_read_USB_EP_NI5_TXCSR() bfin_read16(USB_EP_NI5_TXCSR)
1350#define bfin_write_USB_EP_NI5_TXCSR(val) bfin_write16(USB_EP_NI5_TXCSR, val)
1351#define bfin_read_USB_EP_NI5_RXMAXP() bfin_read16(USB_EP_NI5_RXMAXP)
1352#define bfin_write_USB_EP_NI5_RXMAXP(val) bfin_write16(USB_EP_NI5_RXMAXP, val)
1353#define bfin_read_USB_EP_NI5_RXCSR() bfin_read16(USB_EP_NI5_RXCSR)
1354#define bfin_write_USB_EP_NI5_RXCSR(val) bfin_write16(USB_EP_NI5_RXCSR, val)
1355#define bfin_read_USB_EP_NI5_RXCOUNT() bfin_read16(USB_EP_NI5_RXCOUNT)
1356#define bfin_write_USB_EP_NI5_RXCOUNT(val) bfin_write16(USB_EP_NI5_RXCOUNT, val)
1357#define bfin_read_USB_EP_NI5_TXTYPE() bfin_read16(USB_EP_NI5_TXTYPE)
1358#define bfin_write_USB_EP_NI5_TXTYPE(val) bfin_write16(USB_EP_NI5_TXTYPE, val)
1359#define bfin_read_USB_EP_NI5_TXINTERVAL() bfin_read16(USB_EP_NI5_TXINTERVAL)
1360#define bfin_write_USB_EP_NI5_TXINTERVAL(val) bfin_write16(USB_EP_NI5_TXINTERVAL, val)
1361#define bfin_read_USB_EP_NI5_RXTYPE() bfin_read16(USB_EP_NI5_RXTYPE)
1362#define bfin_write_USB_EP_NI5_RXTYPE(val) bfin_write16(USB_EP_NI5_RXTYPE, val)
1363#define bfin_read_USB_EP_NI5_RXINTERVAL() bfin_read16(USB_EP_NI5_RXINTERVAL)
1364#define bfin_write_USB_EP_NI5_RXINTERVAL(val) bfin_write16(USB_EP_NI5_RXINTERVAL, val)
1365
1366/* USB Endbfin_read_()oint 6 Control Registers */
1367
1368#define bfin_read_USB_EP_NI5_TXCOUNT() bfin_read16(USB_EP_NI5_TXCOUNT)
1369#define bfin_write_USB_EP_NI5_TXCOUNT(val) bfin_write16(USB_EP_NI5_TXCOUNT, val)
1370#define bfin_read_USB_EP_NI6_TXMAXP() bfin_read16(USB_EP_NI6_TXMAXP)
1371#define bfin_write_USB_EP_NI6_TXMAXP(val) bfin_write16(USB_EP_NI6_TXMAXP, val)
1372#define bfin_read_USB_EP_NI6_TXCSR() bfin_read16(USB_EP_NI6_TXCSR)
1373#define bfin_write_USB_EP_NI6_TXCSR(val) bfin_write16(USB_EP_NI6_TXCSR, val)
1374#define bfin_read_USB_EP_NI6_RXMAXP() bfin_read16(USB_EP_NI6_RXMAXP)
1375#define bfin_write_USB_EP_NI6_RXMAXP(val) bfin_write16(USB_EP_NI6_RXMAXP, val)
1376#define bfin_read_USB_EP_NI6_RXCSR() bfin_read16(USB_EP_NI6_RXCSR)
1377#define bfin_write_USB_EP_NI6_RXCSR(val) bfin_write16(USB_EP_NI6_RXCSR, val)
1378#define bfin_read_USB_EP_NI6_RXCOUNT() bfin_read16(USB_EP_NI6_RXCOUNT)
1379#define bfin_write_USB_EP_NI6_RXCOUNT(val) bfin_write16(USB_EP_NI6_RXCOUNT, val)
1380#define bfin_read_USB_EP_NI6_TXTYPE() bfin_read16(USB_EP_NI6_TXTYPE)
1381#define bfin_write_USB_EP_NI6_TXTYPE(val) bfin_write16(USB_EP_NI6_TXTYPE, val)
1382#define bfin_read_USB_EP_NI6_TXINTERVAL() bfin_read16(USB_EP_NI6_TXINTERVAL)
1383#define bfin_write_USB_EP_NI6_TXINTERVAL(val) bfin_write16(USB_EP_NI6_TXINTERVAL, val)
1384#define bfin_read_USB_EP_NI6_RXTYPE() bfin_read16(USB_EP_NI6_RXTYPE)
1385#define bfin_write_USB_EP_NI6_RXTYPE(val) bfin_write16(USB_EP_NI6_RXTYPE, val)
1386#define bfin_read_USB_EP_NI6_RXINTERVAL() bfin_read16(USB_EP_NI6_RXINTERVAL)
1387#define bfin_write_USB_EP_NI6_RXINTERVAL(val) bfin_write16(USB_EP_NI6_RXINTERVAL, val)
1388
1389/* USB Endbfin_read_()oint 7 Control Registers */
1390
1391#define bfin_read_USB_EP_NI6_TXCOUNT() bfin_read16(USB_EP_NI6_TXCOUNT)
1392#define bfin_write_USB_EP_NI6_TXCOUNT(val) bfin_write16(USB_EP_NI6_TXCOUNT, val)
1393#define bfin_read_USB_EP_NI7_TXMAXP() bfin_read16(USB_EP_NI7_TXMAXP)
1394#define bfin_write_USB_EP_NI7_TXMAXP(val) bfin_write16(USB_EP_NI7_TXMAXP, val)
1395#define bfin_read_USB_EP_NI7_TXCSR() bfin_read16(USB_EP_NI7_TXCSR)
1396#define bfin_write_USB_EP_NI7_TXCSR(val) bfin_write16(USB_EP_NI7_TXCSR, val)
1397#define bfin_read_USB_EP_NI7_RXMAXP() bfin_read16(USB_EP_NI7_RXMAXP)
1398#define bfin_write_USB_EP_NI7_RXMAXP(val) bfin_write16(USB_EP_NI7_RXMAXP, val)
1399#define bfin_read_USB_EP_NI7_RXCSR() bfin_read16(USB_EP_NI7_RXCSR)
1400#define bfin_write_USB_EP_NI7_RXCSR(val) bfin_write16(USB_EP_NI7_RXCSR, val)
1401#define bfin_read_USB_EP_NI7_RXCOUNT() bfin_read16(USB_EP_NI7_RXCOUNT)
1402#define bfin_write_USB_EP_NI7_RXCOUNT(val) bfin_write16(USB_EP_NI7_RXCOUNT, val)
1403#define bfin_read_USB_EP_NI7_TXTYPE() bfin_read16(USB_EP_NI7_TXTYPE)
1404#define bfin_write_USB_EP_NI7_TXTYPE(val) bfin_write16(USB_EP_NI7_TXTYPE, val)
1405#define bfin_read_USB_EP_NI7_TXINTERVAL() bfin_read16(USB_EP_NI7_TXINTERVAL)
1406#define bfin_write_USB_EP_NI7_TXINTERVAL(val) bfin_write16(USB_EP_NI7_TXINTERVAL, val)
1407#define bfin_read_USB_EP_NI7_RXTYPE() bfin_read16(USB_EP_NI7_RXTYPE)
1408#define bfin_write_USB_EP_NI7_RXTYPE(val) bfin_write16(USB_EP_NI7_RXTYPE, val)
1409#define bfin_read_USB_EP_NI7_RXINTERVAL() bfin_read16(USB_EP_NI7_RXINTERVAL)
1410#define bfin_write_USB_EP_NI7_RXINTERVAL(val) bfin_write16(USB_EP_NI7_RXINTERVAL, val)
1411#define bfin_read_USB_EP_NI7_TXCOUNT() bfin_read16(USB_EP_NI7_TXCOUNT)
1412#define bfin_write_USB_EP_NI7_TXCOUNT(val) bfin_write16(USB_EP_NI7_TXCOUNT, val)
1413#define bfin_read_USB_DMA_INTERRUPT() bfin_read16(USB_DMA_INTERRUPT)
1414#define bfin_write_USB_DMA_INTERRUPT(val) bfin_write16(USB_DMA_INTERRUPT, val)
1415
1416/* USB Channel 0 Config Registers */
1417
1418#define bfin_read_USB_DMA0CONTROL() bfin_read16(USB_DMA0CONTROL)
1419#define bfin_write_USB_DMA0CONTROL(val) bfin_write16(USB_DMA0CONTROL, val)
1420#define bfin_read_USB_DMA0ADDRLOW() bfin_read16(USB_DMA0ADDRLOW)
1421#define bfin_write_USB_DMA0ADDRLOW(val) bfin_write16(USB_DMA0ADDRLOW, val)
1422#define bfin_read_USB_DMA0ADDRHIGH() bfin_read16(USB_DMA0ADDRHIGH)
1423#define bfin_write_USB_DMA0ADDRHIGH(val) bfin_write16(USB_DMA0ADDRHIGH, val)
1424#define bfin_read_USB_DMA0COUNTLOW() bfin_read16(USB_DMA0COUNTLOW)
1425#define bfin_write_USB_DMA0COUNTLOW(val) bfin_write16(USB_DMA0COUNTLOW, val)
1426#define bfin_read_USB_DMA0COUNTHIGH() bfin_read16(USB_DMA0COUNTHIGH)
1427#define bfin_write_USB_DMA0COUNTHIGH(val) bfin_write16(USB_DMA0COUNTHIGH, val)
1428
1429/* USB Channel 1 Config Registers */
1430
1431#define bfin_read_USB_DMA1CONTROL() bfin_read16(USB_DMA1CONTROL)
1432#define bfin_write_USB_DMA1CONTROL(val) bfin_write16(USB_DMA1CONTROL, val)
1433#define bfin_read_USB_DMA1ADDRLOW() bfin_read16(USB_DMA1ADDRLOW)
1434#define bfin_write_USB_DMA1ADDRLOW(val) bfin_write16(USB_DMA1ADDRLOW, val)
1435#define bfin_read_USB_DMA1ADDRHIGH() bfin_read16(USB_DMA1ADDRHIGH)
1436#define bfin_write_USB_DMA1ADDRHIGH(val) bfin_write16(USB_DMA1ADDRHIGH, val)
1437#define bfin_read_USB_DMA1COUNTLOW() bfin_read16(USB_DMA1COUNTLOW)
1438#define bfin_write_USB_DMA1COUNTLOW(val) bfin_write16(USB_DMA1COUNTLOW, val)
1439#define bfin_read_USB_DMA1COUNTHIGH() bfin_read16(USB_DMA1COUNTHIGH)
1440#define bfin_write_USB_DMA1COUNTHIGH(val) bfin_write16(USB_DMA1COUNTHIGH, val)
1441
1442/* USB Channel 2 Config Registers */
1443
1444#define bfin_read_USB_DMA2CONTROL() bfin_read16(USB_DMA2CONTROL)
1445#define bfin_write_USB_DMA2CONTROL(val) bfin_write16(USB_DMA2CONTROL, val)
1446#define bfin_read_USB_DMA2ADDRLOW() bfin_read16(USB_DMA2ADDRLOW)
1447#define bfin_write_USB_DMA2ADDRLOW(val) bfin_write16(USB_DMA2ADDRLOW, val)
1448#define bfin_read_USB_DMA2ADDRHIGH() bfin_read16(USB_DMA2ADDRHIGH)
1449#define bfin_write_USB_DMA2ADDRHIGH(val) bfin_write16(USB_DMA2ADDRHIGH, val)
1450#define bfin_read_USB_DMA2COUNTLOW() bfin_read16(USB_DMA2COUNTLOW)
1451#define bfin_write_USB_DMA2COUNTLOW(val) bfin_write16(USB_DMA2COUNTLOW, val)
1452#define bfin_read_USB_DMA2COUNTHIGH() bfin_read16(USB_DMA2COUNTHIGH)
1453#define bfin_write_USB_DMA2COUNTHIGH(val) bfin_write16(USB_DMA2COUNTHIGH, val)
1454
1455/* USB Channel 3 Config Registers */
1456
1457#define bfin_read_USB_DMA3CONTROL() bfin_read16(USB_DMA3CONTROL)
1458#define bfin_write_USB_DMA3CONTROL(val) bfin_write16(USB_DMA3CONTROL, val)
1459#define bfin_read_USB_DMA3ADDRLOW() bfin_read16(USB_DMA3ADDRLOW)
1460#define bfin_write_USB_DMA3ADDRLOW(val) bfin_write16(USB_DMA3ADDRLOW, val)
1461#define bfin_read_USB_DMA3ADDRHIGH() bfin_read16(USB_DMA3ADDRHIGH)
1462#define bfin_write_USB_DMA3ADDRHIGH(val) bfin_write16(USB_DMA3ADDRHIGH, val)
1463#define bfin_read_USB_DMA3COUNTLOW() bfin_read16(USB_DMA3COUNTLOW)
1464#define bfin_write_USB_DMA3COUNTLOW(val) bfin_write16(USB_DMA3COUNTLOW, val)
1465#define bfin_read_USB_DMA3COUNTHIGH() bfin_read16(USB_DMA3COUNTHIGH)
1466#define bfin_write_USB_DMA3COUNTHIGH(val) bfin_write16(USB_DMA3COUNTHIGH, val)
1467
1468/* USB Channel 4 Config Registers */
1469
1470#define bfin_read_USB_DMA4CONTROL() bfin_read16(USB_DMA4CONTROL)
1471#define bfin_write_USB_DMA4CONTROL(val) bfin_write16(USB_DMA4CONTROL, val)
1472#define bfin_read_USB_DMA4ADDRLOW() bfin_read16(USB_DMA4ADDRLOW)
1473#define bfin_write_USB_DMA4ADDRLOW(val) bfin_write16(USB_DMA4ADDRLOW, val)
1474#define bfin_read_USB_DMA4ADDRHIGH() bfin_read16(USB_DMA4ADDRHIGH)
1475#define bfin_write_USB_DMA4ADDRHIGH(val) bfin_write16(USB_DMA4ADDRHIGH, val)
1476#define bfin_read_USB_DMA4COUNTLOW() bfin_read16(USB_DMA4COUNTLOW)
1477#define bfin_write_USB_DMA4COUNTLOW(val) bfin_write16(USB_DMA4COUNTLOW, val)
1478#define bfin_read_USB_DMA4COUNTHIGH() bfin_read16(USB_DMA4COUNTHIGH)
1479#define bfin_write_USB_DMA4COUNTHIGH(val) bfin_write16(USB_DMA4COUNTHIGH, val)
1480
1481/* USB Channel 5 Config Registers */
1482
1483#define bfin_read_USB_DMA5CONTROL() bfin_read16(USB_DMA5CONTROL)
1484#define bfin_write_USB_DMA5CONTROL(val) bfin_write16(USB_DMA5CONTROL, val)
1485#define bfin_read_USB_DMA5ADDRLOW() bfin_read16(USB_DMA5ADDRLOW)
1486#define bfin_write_USB_DMA5ADDRLOW(val) bfin_write16(USB_DMA5ADDRLOW, val)
1487#define bfin_read_USB_DMA5ADDRHIGH() bfin_read16(USB_DMA5ADDRHIGH)
1488#define bfin_write_USB_DMA5ADDRHIGH(val) bfin_write16(USB_DMA5ADDRHIGH, val)
1489#define bfin_read_USB_DMA5COUNTLOW() bfin_read16(USB_DMA5COUNTLOW)
1490#define bfin_write_USB_DMA5COUNTLOW(val) bfin_write16(USB_DMA5COUNTLOW, val)
1491#define bfin_read_USB_DMA5COUNTHIGH() bfin_read16(USB_DMA5COUNTHIGH)
1492#define bfin_write_USB_DMA5COUNTHIGH(val) bfin_write16(USB_DMA5COUNTHIGH, val)
1493
1494/* USB Channel 6 Config Registers */
1495
1496#define bfin_read_USB_DMA6CONTROL() bfin_read16(USB_DMA6CONTROL)
1497#define bfin_write_USB_DMA6CONTROL(val) bfin_write16(USB_DMA6CONTROL, val)
1498#define bfin_read_USB_DMA6ADDRLOW() bfin_read16(USB_DMA6ADDRLOW)
1499#define bfin_write_USB_DMA6ADDRLOW(val) bfin_write16(USB_DMA6ADDRLOW, val)
1500#define bfin_read_USB_DMA6ADDRHIGH() bfin_read16(USB_DMA6ADDRHIGH)
1501#define bfin_write_USB_DMA6ADDRHIGH(val) bfin_write16(USB_DMA6ADDRHIGH, val)
1502#define bfin_read_USB_DMA6COUNTLOW() bfin_read16(USB_DMA6COUNTLOW)
1503#define bfin_write_USB_DMA6COUNTLOW(val) bfin_write16(USB_DMA6COUNTLOW, val)
1504#define bfin_read_USB_DMA6COUNTHIGH() bfin_read16(USB_DMA6COUNTHIGH)
1505#define bfin_write_USB_DMA6COUNTHIGH(val) bfin_write16(USB_DMA6COUNTHIGH, val)
1506
1507/* USB Channel 7 Config Registers */
1508
1509#define bfin_read_USB_DMA7CONTROL() bfin_read16(USB_DMA7CONTROL)
1510#define bfin_write_USB_DMA7CONTROL(val) bfin_write16(USB_DMA7CONTROL, val)
1511#define bfin_read_USB_DMA7ADDRLOW() bfin_read16(USB_DMA7ADDRLOW)
1512#define bfin_write_USB_DMA7ADDRLOW(val) bfin_write16(USB_DMA7ADDRLOW, val)
1513#define bfin_read_USB_DMA7ADDRHIGH() bfin_read16(USB_DMA7ADDRHIGH)
1514#define bfin_write_USB_DMA7ADDRHIGH(val) bfin_write16(USB_DMA7ADDRHIGH, val)
1515#define bfin_read_USB_DMA7COUNTLOW() bfin_read16(USB_DMA7COUNTLOW)
1516#define bfin_write_USB_DMA7COUNTLOW(val) bfin_write16(USB_DMA7COUNTLOW, val)
1517#define bfin_read_USB_DMA7COUNTHIGH() bfin_read16(USB_DMA7COUNTHIGH)
1518#define bfin_write_USB_DMA7COUNTHIGH(val) bfin_write16(USB_DMA7COUNTHIGH, val)
1519
1520/* Keybfin_read_()ad Registers */
1521
1522#define bfin_read_KPAD_CTL() bfin_read16(KPAD_CTL)
1523#define bfin_write_KPAD_CTL(val) bfin_write16(KPAD_CTL, val)
1524#define bfin_read_KPAD_PRESCALE() bfin_read16(KPAD_PRESCALE)
1525#define bfin_write_KPAD_PRESCALE(val) bfin_write16(KPAD_PRESCALE, val)
1526#define bfin_read_KPAD_MSEL() bfin_read16(KPAD_MSEL)
1527#define bfin_write_KPAD_MSEL(val) bfin_write16(KPAD_MSEL, val)
1528#define bfin_read_KPAD_ROWCOL() bfin_read16(KPAD_ROWCOL)
1529#define bfin_write_KPAD_ROWCOL(val) bfin_write16(KPAD_ROWCOL, val)
1530#define bfin_read_KPAD_STAT() bfin_read16(KPAD_STAT)
1531#define bfin_write_KPAD_STAT(val) bfin_write16(KPAD_STAT, val)
1532#define bfin_read_KPAD_SOFTEVAL() bfin_read16(KPAD_SOFTEVAL)
1533#define bfin_write_KPAD_SOFTEVAL(val) bfin_write16(KPAD_SOFTEVAL, val)
1534
1535/* Pixel Combfin_read_()ositor (PIXC) Registers */
1536
1537#define bfin_read_PIXC_CTL() bfin_read16(PIXC_CTL)
1538#define bfin_write_PIXC_CTL(val) bfin_write16(PIXC_CTL, val)
1539#define bfin_read_PIXC_PPL() bfin_read16(PIXC_PPL)
1540#define bfin_write_PIXC_PPL(val) bfin_write16(PIXC_PPL, val)
1541#define bfin_read_PIXC_LPF() bfin_read16(PIXC_LPF)
1542#define bfin_write_PIXC_LPF(val) bfin_write16(PIXC_LPF, val)
1543#define bfin_read_PIXC_AHSTART() bfin_read16(PIXC_AHSTART)
1544#define bfin_write_PIXC_AHSTART(val) bfin_write16(PIXC_AHSTART, val)
1545#define bfin_read_PIXC_AHEND() bfin_read16(PIXC_AHEND)
1546#define bfin_write_PIXC_AHEND(val) bfin_write16(PIXC_AHEND, val)
1547#define bfin_read_PIXC_AVSTART() bfin_read16(PIXC_AVSTART)
1548#define bfin_write_PIXC_AVSTART(val) bfin_write16(PIXC_AVSTART, val)
1549#define bfin_read_PIXC_AVEND() bfin_read16(PIXC_AVEND)
1550#define bfin_write_PIXC_AVEND(val) bfin_write16(PIXC_AVEND, val)
1551#define bfin_read_PIXC_ATRANSP() bfin_read16(PIXC_ATRANSP)
1552#define bfin_write_PIXC_ATRANSP(val) bfin_write16(PIXC_ATRANSP, val)
1553#define bfin_read_PIXC_BHSTART() bfin_read16(PIXC_BHSTART)
1554#define bfin_write_PIXC_BHSTART(val) bfin_write16(PIXC_BHSTART, val)
1555#define bfin_read_PIXC_BHEND() bfin_read16(PIXC_BHEND)
1556#define bfin_write_PIXC_BHEND(val) bfin_write16(PIXC_BHEND, val)
1557#define bfin_read_PIXC_BVSTART() bfin_read16(PIXC_BVSTART)
1558#define bfin_write_PIXC_BVSTART(val) bfin_write16(PIXC_BVSTART, val)
1559#define bfin_read_PIXC_BVEND() bfin_read16(PIXC_BVEND)
1560#define bfin_write_PIXC_BVEND(val) bfin_write16(PIXC_BVEND, val)
1561#define bfin_read_PIXC_BTRANSP() bfin_read16(PIXC_BTRANSP)
1562#define bfin_write_PIXC_BTRANSP(val) bfin_write16(PIXC_BTRANSP, val)
1563#define bfin_read_PIXC_INTRSTAT() bfin_read16(PIXC_INTRSTAT)
1564#define bfin_write_PIXC_INTRSTAT(val) bfin_write16(PIXC_INTRSTAT, val)
1565#define bfin_read_PIXC_RYCON() bfin_read32(PIXC_RYCON)
1566#define bfin_write_PIXC_RYCON(val) bfin_write32(PIXC_RYCON, val)
1567#define bfin_read_PIXC_GUCON() bfin_read32(PIXC_GUCON)
1568#define bfin_write_PIXC_GUCON(val) bfin_write32(PIXC_GUCON, val)
1569#define bfin_read_PIXC_BVCON() bfin_read32(PIXC_BVCON)
1570#define bfin_write_PIXC_BVCON(val) bfin_write32(PIXC_BVCON, val)
1571#define bfin_read_PIXC_CCBIAS() bfin_read32(PIXC_CCBIAS)
1572#define bfin_write_PIXC_CCBIAS(val) bfin_write32(PIXC_CCBIAS, val)
1573#define bfin_read_PIXC_TC() bfin_read32(PIXC_TC)
1574#define bfin_write_PIXC_TC(val) bfin_write32(PIXC_TC, val)
1575
1576/* Handshake MDMA 0 Registers */
1577
1578#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
1579#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
1580#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
1581#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT, val)
1582#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
1583#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT, val)
1584#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
1585#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
1586#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
1587#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
1588#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
1589#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT, val)
1590#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
1591#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT, val)
1592
1593/* Handshake MDMA 1 Registers */
1594
1595#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
1596#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
1597#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
1598#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT, val)
1599#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
1600#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT, val)
1601#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
1602#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
1603#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
1604#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
1605#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
1606#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT, val)
1607#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
1608#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT, val)
1609
1610#endif /* _CDEF_BF548_H */
diff --git a/include/asm-blackfin/mach-bf548/cdefBF549.h b/include/asm-blackfin/mach-bf548/cdefBF549.h
new file mode 100644
index 000000000000..2ab5b7c00820
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/cdefBF549.h
@@ -0,0 +1,1896 @@
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#define bfin_read_TWI1_CLKDIV() bfin_read16(TWI1_CLKDIV)
189#define bfin_write_TWI1_CLKDIV(val) bfin_write16(TWI1_CLKDIV, val)
190#define bfin_read_TWI1_CONTROL() bfin_read16(TWI1_CONTROL)
191#define bfin_write_TWI1_CONTROL(val) bfin_write16(TWI1_CONTROL, val)
192#define bfin_read_TWI1_SLAVE_CTRL() bfin_read16(TWI1_SLAVE_CTRL)
193#define bfin_write_TWI1_SLAVE_CTRL(val) bfin_write16(TWI1_SLAVE_CTRL, val)
194#define bfin_read_TWI1_SLAVE_STAT() bfin_read16(TWI1_SLAVE_STAT)
195#define bfin_write_TWI1_SLAVE_STAT(val) bfin_write16(TWI1_SLAVE_STAT, val)
196#define bfin_read_TWI1_SLAVE_ADDR() bfin_read16(TWI1_SLAVE_ADDR)
197#define bfin_write_TWI1_SLAVE_ADDR(val) bfin_write16(TWI1_SLAVE_ADDR, val)
198#define bfin_read_TWI1_MASTER_CTRL() bfin_read16(TWI1_MASTER_CTRL)
199#define bfin_write_TWI1_MASTER_CTRL(val) bfin_write16(TWI1_MASTER_CTRL, val)
200#define bfin_read_TWI1_MASTER_STAT() bfin_read16(TWI1_MASTER_STAT)
201#define bfin_write_TWI1_MASTER_STAT(val) bfin_write16(TWI1_MASTER_STAT, val)
202#define bfin_read_TWI1_MASTER_ADDR() bfin_read16(TWI1_MASTER_ADDR)
203#define bfin_write_TWI1_MASTER_ADDR(val) bfin_write16(TWI1_MASTER_ADDR, val)
204#define bfin_read_TWI1_INT_STAT() bfin_read16(TWI1_INT_STAT)
205#define bfin_write_TWI1_INT_STAT(val) bfin_write16(TWI1_INT_STAT, val)
206#define bfin_read_TWI1_INT_MASK() bfin_read16(TWI1_INT_MASK)
207#define bfin_write_TWI1_INT_MASK(val) bfin_write16(TWI1_INT_MASK, val)
208#define bfin_read_TWI1_FIFO_CTRL() bfin_read16(TWI1_FIFO_CTRL)
209#define bfin_write_TWI1_FIFO_CTRL(val) bfin_write16(TWI1_FIFO_CTRL, val)
210#define bfin_read_TWI1_FIFO_STAT() bfin_read16(TWI1_FIFO_STAT)
211#define bfin_write_TWI1_FIFO_STAT(val) bfin_write16(TWI1_FIFO_STAT, val)
212#define bfin_read_TWI1_XMT_DATA8() bfin_read16(TWI1_XMT_DATA8)
213#define bfin_write_TWI1_XMT_DATA8(val) bfin_write16(TWI1_XMT_DATA8, val)
214#define bfin_read_TWI1_XMT_DATA16() bfin_read16(TWI1_XMT_DATA16)
215#define bfin_write_TWI1_XMT_DATA16(val) bfin_write16(TWI1_XMT_DATA16, val)
216#define bfin_read_TWI1_RCV_DATA8() bfin_read16(TWI1_RCV_DATA8)
217#define bfin_write_TWI1_RCV_DATA8(val) bfin_write16(TWI1_RCV_DATA8, val)
218#define bfin_read_TWI1_RCV_DATA16() bfin_read16(TWI1_RCV_DATA16)
219#define bfin_write_TWI1_RCV_DATA16(val) bfin_write16(TWI1_RCV_DATA16, val)
220
221/* SPI2 Registers */
222
223#define bfin_read_SPI2_CTL() bfin_read16(SPI2_CTL)
224#define bfin_write_SPI2_CTL(val) bfin_write16(SPI2_CTL, val)
225#define bfin_read_SPI2_FLG() bfin_read16(SPI2_FLG)
226#define bfin_write_SPI2_FLG(val) bfin_write16(SPI2_FLG, val)
227#define bfin_read_SPI2_STAT() bfin_read16(SPI2_STAT)
228#define bfin_write_SPI2_STAT(val) bfin_write16(SPI2_STAT, val)
229#define bfin_read_SPI2_TDBR() bfin_read16(SPI2_TDBR)
230#define bfin_write_SPI2_TDBR(val) bfin_write16(SPI2_TDBR, val)
231#define bfin_read_SPI2_RDBR() bfin_read16(SPI2_RDBR)
232#define bfin_write_SPI2_RDBR(val) bfin_write16(SPI2_RDBR, val)
233#define bfin_read_SPI2_BAUD() bfin_read16(SPI2_BAUD)
234#define bfin_write_SPI2_BAUD(val) bfin_write16(SPI2_BAUD, val)
235#define bfin_read_SPI2_SHADOW() bfin_read16(SPI2_SHADOW)
236#define bfin_write_SPI2_SHADOW(val) bfin_write16(SPI2_SHADOW, val)
237
238/* MXVR Registers */
239
240#define bfin_read_MXVR_CONFIG() bfin_read16(MXVR_CONFIG)
241#define bfin_write_MXVR_CONFIG(val) bfin_write16(MXVR_CONFIG, val)
242#define bfin_read_MXVR_STATE_0() bfin_read32(MXVR_STATE_0)
243#define bfin_write_MXVR_STATE_0(val) bfin_write32(MXVR_STATE_0, val)
244#define bfin_read_MXVR_STATE_1() bfin_read32(MXVR_STATE_1)
245#define bfin_write_MXVR_STATE_1(val) bfin_write32(MXVR_STATE_1, val)
246#define bfin_read_MXVR_INT_STAT_0() bfin_read32(MXVR_INT_STAT_0)
247#define bfin_write_MXVR_INT_STAT_0(val) bfin_write32(MXVR_INT_STAT_0, val)
248#define bfin_read_MXVR_INT_STAT_1() bfin_read32(MXVR_INT_STAT_1)
249#define bfin_write_MXVR_INT_STAT_1(val) bfin_write32(MXVR_INT_STAT_1, val)
250#define bfin_read_MXVR_INT_EN_0() bfin_read32(MXVR_INT_EN_0)
251#define bfin_write_MXVR_INT_EN_0(val) bfin_write32(MXVR_INT_EN_0, val)
252#define bfin_read_MXVR_INT_EN_1() bfin_read32(MXVR_INT_EN_1)
253#define bfin_write_MXVR_INT_EN_1(val) bfin_write32(MXVR_INT_EN_1, val)
254#define bfin_read_MXVR_POSITION() bfin_read16(MXVR_POSITION)
255#define bfin_write_MXVR_POSITION(val) bfin_write16(MXVR_POSITION, val)
256#define bfin_read_MXVR_MAX_POSITION() bfin_read16(MXVR_MAX_POSITION)
257#define bfin_write_MXVR_MAX_POSITION(val) bfin_write16(MXVR_MAX_POSITION, val)
258#define bfin_read_MXVR_DELAY() bfin_read16(MXVR_DELAY)
259#define bfin_write_MXVR_DELAY(val) bfin_write16(MXVR_DELAY, val)
260#define bfin_read_MXVR_MAX_DELAY() bfin_read16(MXVR_MAX_DELAY)
261#define bfin_write_MXVR_MAX_DELAY(val) bfin_write16(MXVR_MAX_DELAY, val)
262#define bfin_read_MXVR_LADDR() bfin_read32(MXVR_LADDR)
263#define bfin_write_MXVR_LADDR(val) bfin_write32(MXVR_LADDR, val)
264#define bfin_read_MXVR_GADDR() bfin_read16(MXVR_GADDR)
265#define bfin_write_MXVR_GADDR(val) bfin_write16(MXVR_GADDR, val)
266#define bfin_read_MXVR_AADDR() bfin_read32(MXVR_AADDR)
267#define bfin_write_MXVR_AADDR(val) bfin_write32(MXVR_AADDR, val)
268
269/* MXVR Allocation Table Registers */
270
271#define bfin_read_MXVR_ALLOC_0() bfin_read32(MXVR_ALLOC_0)
272#define bfin_write_MXVR_ALLOC_0(val) bfin_write32(MXVR_ALLOC_0, val)
273#define bfin_read_MXVR_ALLOC_1() bfin_read32(MXVR_ALLOC_1)
274#define bfin_write_MXVR_ALLOC_1(val) bfin_write32(MXVR_ALLOC_1, val)
275#define bfin_read_MXVR_ALLOC_2() bfin_read32(MXVR_ALLOC_2)
276#define bfin_write_MXVR_ALLOC_2(val) bfin_write32(MXVR_ALLOC_2, val)
277#define bfin_read_MXVR_ALLOC_3() bfin_read32(MXVR_ALLOC_3)
278#define bfin_write_MXVR_ALLOC_3(val) bfin_write32(MXVR_ALLOC_3, val)
279#define bfin_read_MXVR_ALLOC_4() bfin_read32(MXVR_ALLOC_4)
280#define bfin_write_MXVR_ALLOC_4(val) bfin_write32(MXVR_ALLOC_4, val)
281#define bfin_read_MXVR_ALLOC_5() bfin_read32(MXVR_ALLOC_5)
282#define bfin_write_MXVR_ALLOC_5(val) bfin_write32(MXVR_ALLOC_5, val)
283#define bfin_read_MXVR_ALLOC_6() bfin_read32(MXVR_ALLOC_6)
284#define bfin_write_MXVR_ALLOC_6(val) bfin_write32(MXVR_ALLOC_6, val)
285#define bfin_read_MXVR_ALLOC_7() bfin_read32(MXVR_ALLOC_7)
286#define bfin_write_MXVR_ALLOC_7(val) bfin_write32(MXVR_ALLOC_7, val)
287#define bfin_read_MXVR_ALLOC_8() bfin_read32(MXVR_ALLOC_8)
288#define bfin_write_MXVR_ALLOC_8(val) bfin_write32(MXVR_ALLOC_8, val)
289#define bfin_read_MXVR_ALLOC_9() bfin_read32(MXVR_ALLOC_9)
290#define bfin_write_MXVR_ALLOC_9(val) bfin_write32(MXVR_ALLOC_9, val)
291#define bfin_read_MXVR_ALLOC_10() bfin_read32(MXVR_ALLOC_10)
292#define bfin_write_MXVR_ALLOC_10(val) bfin_write32(MXVR_ALLOC_10, val)
293#define bfin_read_MXVR_ALLOC_11() bfin_read32(MXVR_ALLOC_11)
294#define bfin_write_MXVR_ALLOC_11(val) bfin_write32(MXVR_ALLOC_11, val)
295#define bfin_read_MXVR_ALLOC_12() bfin_read32(MXVR_ALLOC_12)
296#define bfin_write_MXVR_ALLOC_12(val) bfin_write32(MXVR_ALLOC_12, val)
297#define bfin_read_MXVR_ALLOC_13() bfin_read32(MXVR_ALLOC_13)
298#define bfin_write_MXVR_ALLOC_13(val) bfin_write32(MXVR_ALLOC_13, val)
299#define bfin_read_MXVR_ALLOC_14() bfin_read32(MXVR_ALLOC_14)
300#define bfin_write_MXVR_ALLOC_14(val) bfin_write32(MXVR_ALLOC_14, val)
301
302/* MXVR Channel Assign Registers */
303
304#define bfin_read_MXVR_SYNC_LCHAN_0() bfin_read32(MXVR_SYNC_LCHAN_0)
305#define bfin_write_MXVR_SYNC_LCHAN_0(val) bfin_write32(MXVR_SYNC_LCHAN_0, val)
306#define bfin_read_MXVR_SYNC_LCHAN_1() bfin_read32(MXVR_SYNC_LCHAN_1)
307#define bfin_write_MXVR_SYNC_LCHAN_1(val) bfin_write32(MXVR_SYNC_LCHAN_1, val)
308#define bfin_read_MXVR_SYNC_LCHAN_2() bfin_read32(MXVR_SYNC_LCHAN_2)
309#define bfin_write_MXVR_SYNC_LCHAN_2(val) bfin_write32(MXVR_SYNC_LCHAN_2, val)
310#define bfin_read_MXVR_SYNC_LCHAN_3() bfin_read32(MXVR_SYNC_LCHAN_3)
311#define bfin_write_MXVR_SYNC_LCHAN_3(val) bfin_write32(MXVR_SYNC_LCHAN_3, val)
312#define bfin_read_MXVR_SYNC_LCHAN_4() bfin_read32(MXVR_SYNC_LCHAN_4)
313#define bfin_write_MXVR_SYNC_LCHAN_4(val) bfin_write32(MXVR_SYNC_LCHAN_4, val)
314#define bfin_read_MXVR_SYNC_LCHAN_5() bfin_read32(MXVR_SYNC_LCHAN_5)
315#define bfin_write_MXVR_SYNC_LCHAN_5(val) bfin_write32(MXVR_SYNC_LCHAN_5, val)
316#define bfin_read_MXVR_SYNC_LCHAN_6() bfin_read32(MXVR_SYNC_LCHAN_6)
317#define bfin_write_MXVR_SYNC_LCHAN_6(val) bfin_write32(MXVR_SYNC_LCHAN_6, val)
318#define bfin_read_MXVR_SYNC_LCHAN_7() bfin_read32(MXVR_SYNC_LCHAN_7)
319#define bfin_write_MXVR_SYNC_LCHAN_7(val) bfin_write32(MXVR_SYNC_LCHAN_7, val)
320
321/* MXVR DMA0 Registers */
322
323#define bfin_read_MXVR_DMA0_CONFIG() bfin_read32(MXVR_DMA0_CONFIG)
324#define bfin_write_MXVR_DMA0_CONFIG(val) bfin_write32(MXVR_DMA0_CONFIG, val)
325#define bfin_read_MXVR_DMA0_START_ADDR() bfin_read32(MXVR_DMA0_START_ADDR)
326#define bfin_write_MXVR_DMA0_START_ADDR(val) bfin_write32(MXVR_DMA0_START_ADDR)
327#define bfin_read_MXVR_DMA0_COUNT() bfin_read16(MXVR_DMA0_COUNT)
328#define bfin_write_MXVR_DMA0_COUNT(val) bfin_write16(MXVR_DMA0_COUNT, val)
329#define bfin_read_MXVR_DMA0_CURR_ADDR() bfin_read32(MXVR_DMA0_CURR_ADDR)
330#define bfin_write_MXVR_DMA0_CURR_ADDR(val) bfin_write32(MXVR_DMA0_CURR_ADDR)
331#define bfin_read_MXVR_DMA0_CURR_COUNT() bfin_read16(MXVR_DMA0_CURR_COUNT)
332#define bfin_write_MXVR_DMA0_CURR_COUNT(val) bfin_write16(MXVR_DMA0_CURR_COUNT, val)
333
334/* MXVR DMA1 Registers */
335
336#define bfin_read_MXVR_DMA1_CONFIG() bfin_read32(MXVR_DMA1_CONFIG)
337#define bfin_write_MXVR_DMA1_CONFIG(val) bfin_write32(MXVR_DMA1_CONFIG, val)
338#define bfin_read_MXVR_DMA1_START_ADDR() bfin_read32(MXVR_DMA1_START_ADDR)
339#define bfin_write_MXVR_DMA1_START_ADDR(val) bfin_write32(MXVR_DMA1_START_ADDR)
340#define bfin_read_MXVR_DMA1_COUNT() bfin_read16(MXVR_DMA1_COUNT)
341#define bfin_write_MXVR_DMA1_COUNT(val) bfin_write16(MXVR_DMA1_COUNT, val)
342#define bfin_read_MXVR_DMA1_CURR_ADDR() bfin_read32(MXVR_DMA1_CURR_ADDR)
343#define bfin_write_MXVR_DMA1_CURR_ADDR(val) bfin_write32(MXVR_DMA1_CURR_ADDR)
344#define bfin_read_MXVR_DMA1_CURR_COUNT() bfin_read16(MXVR_DMA1_CURR_COUNT)
345#define bfin_write_MXVR_DMA1_CURR_COUNT(val) bfin_write16(MXVR_DMA1_CURR_COUNT, val)
346
347/* MXVR DMA2 Registers */
348
349#define bfin_read_MXVR_DMA2_CONFIG() bfin_read32(MXVR_DMA2_CONFIG)
350#define bfin_write_MXVR_DMA2_CONFIG(val) bfin_write32(MXVR_DMA2_CONFIG, val)
351#define bfin_read_MXVR_DMA2_START_ADDR() bfin_read32(MXVR_DMA2_START_ADDR)
352#define bfin_write_MXVR_DMA2_START_ADDR(val) bfin_write32(MXVR_DMA2_START_ADDR)
353#define bfin_read_MXVR_DMA2_COUNT() bfin_read16(MXVR_DMA2_COUNT)
354#define bfin_write_MXVR_DMA2_COUNT(val) bfin_write16(MXVR_DMA2_COUNT, val)
355#define bfin_read_MXVR_DMA2_CURR_ADDR() bfin_read32(MXVR_DMA2_CURR_ADDR)
356#define bfin_write_MXVR_DMA2_CURR_ADDR(val) bfin_write32(MXVR_DMA2_CURR_ADDR)
357#define bfin_read_MXVR_DMA2_CURR_COUNT() bfin_read16(MXVR_DMA2_CURR_COUNT)
358#define bfin_write_MXVR_DMA2_CURR_COUNT(val) bfin_write16(MXVR_DMA2_CURR_COUNT, val)
359
360/* MXVR DMA3 Registers */
361
362#define bfin_read_MXVR_DMA3_CONFIG() bfin_read32(MXVR_DMA3_CONFIG)
363#define bfin_write_MXVR_DMA3_CONFIG(val) bfin_write32(MXVR_DMA3_CONFIG, val)
364#define bfin_read_MXVR_DMA3_START_ADDR() bfin_read32(MXVR_DMA3_START_ADDR)
365#define bfin_write_MXVR_DMA3_START_ADDR(val) bfin_write32(MXVR_DMA3_START_ADDR)
366#define bfin_read_MXVR_DMA3_COUNT() bfin_read16(MXVR_DMA3_COUNT)
367#define bfin_write_MXVR_DMA3_COUNT(val) bfin_write16(MXVR_DMA3_COUNT, val)
368#define bfin_read_MXVR_DMA3_CURR_ADDR() bfin_read32(MXVR_DMA3_CURR_ADDR)
369#define bfin_write_MXVR_DMA3_CURR_ADDR(val) bfin_write32(MXVR_DMA3_CURR_ADDR)
370#define bfin_read_MXVR_DMA3_CURR_COUNT() bfin_read16(MXVR_DMA3_CURR_COUNT)
371#define bfin_write_MXVR_DMA3_CURR_COUNT(val) bfin_write16(MXVR_DMA3_CURR_COUNT, val)
372
373/* MXVR DMA4 Registers */
374
375#define bfin_read_MXVR_DMA4_CONFIG() bfin_read32(MXVR_DMA4_CONFIG)
376#define bfin_write_MXVR_DMA4_CONFIG(val) bfin_write32(MXVR_DMA4_CONFIG, val)
377#define bfin_read_MXVR_DMA4_START_ADDR() bfin_read32(MXVR_DMA4_START_ADDR)
378#define bfin_write_MXVR_DMA4_START_ADDR(val) bfin_write32(MXVR_DMA4_START_ADDR)
379#define bfin_read_MXVR_DMA4_COUNT() bfin_read16(MXVR_DMA4_COUNT)
380#define bfin_write_MXVR_DMA4_COUNT(val) bfin_write16(MXVR_DMA4_COUNT, val)
381#define bfin_read_MXVR_DMA4_CURR_ADDR() bfin_read32(MXVR_DMA4_CURR_ADDR)
382#define bfin_write_MXVR_DMA4_CURR_ADDR(val) bfin_write32(MXVR_DMA4_CURR_ADDR)
383#define bfin_read_MXVR_DMA4_CURR_COUNT() bfin_read16(MXVR_DMA4_CURR_COUNT)
384#define bfin_write_MXVR_DMA4_CURR_COUNT(val) bfin_write16(MXVR_DMA4_CURR_COUNT, val)
385
386/* MXVR DMA5 Registers */
387
388#define bfin_read_MXVR_DMA5_CONFIG() bfin_read32(MXVR_DMA5_CONFIG)
389#define bfin_write_MXVR_DMA5_CONFIG(val) bfin_write32(MXVR_DMA5_CONFIG, val)
390#define bfin_read_MXVR_DMA5_START_ADDR() bfin_read32(MXVR_DMA5_START_ADDR)
391#define bfin_write_MXVR_DMA5_START_ADDR(val) bfin_write32(MXVR_DMA5_START_ADDR)
392#define bfin_read_MXVR_DMA5_COUNT() bfin_read16(MXVR_DMA5_COUNT)
393#define bfin_write_MXVR_DMA5_COUNT(val) bfin_write16(MXVR_DMA5_COUNT, val)
394#define bfin_read_MXVR_DMA5_CURR_ADDR() bfin_read32(MXVR_DMA5_CURR_ADDR)
395#define bfin_write_MXVR_DMA5_CURR_ADDR(val) bfin_write32(MXVR_DMA5_CURR_ADDR)
396#define bfin_read_MXVR_DMA5_CURR_COUNT() bfin_read16(MXVR_DMA5_CURR_COUNT)
397#define bfin_write_MXVR_DMA5_CURR_COUNT(val) bfin_write16(MXVR_DMA5_CURR_COUNT, val)
398
399/* MXVR DMA6 Registers */
400
401#define bfin_read_MXVR_DMA6_CONFIG() bfin_read32(MXVR_DMA6_CONFIG)
402#define bfin_write_MXVR_DMA6_CONFIG(val) bfin_write32(MXVR_DMA6_CONFIG, val)
403#define bfin_read_MXVR_DMA6_START_ADDR() bfin_read32(MXVR_DMA6_START_ADDR)
404#define bfin_write_MXVR_DMA6_START_ADDR(val) bfin_write32(MXVR_DMA6_START_ADDR)
405#define bfin_read_MXVR_DMA6_COUNT() bfin_read16(MXVR_DMA6_COUNT)
406#define bfin_write_MXVR_DMA6_COUNT(val) bfin_write16(MXVR_DMA6_COUNT, val)
407#define bfin_read_MXVR_DMA6_CURR_ADDR() bfin_read32(MXVR_DMA6_CURR_ADDR)
408#define bfin_write_MXVR_DMA6_CURR_ADDR(val) bfin_write32(MXVR_DMA6_CURR_ADDR)
409#define bfin_read_MXVR_DMA6_CURR_COUNT() bfin_read16(MXVR_DMA6_CURR_COUNT)
410#define bfin_write_MXVR_DMA6_CURR_COUNT(val) bfin_write16(MXVR_DMA6_CURR_COUNT, val)
411
412/* MXVR DMA7 Registers */
413
414#define bfin_read_MXVR_DMA7_CONFIG() bfin_read32(MXVR_DMA7_CONFIG)
415#define bfin_write_MXVR_DMA7_CONFIG(val) bfin_write32(MXVR_DMA7_CONFIG, val)
416#define bfin_read_MXVR_DMA7_START_ADDR() bfin_read32(MXVR_DMA7_START_ADDR)
417#define bfin_write_MXVR_DMA7_START_ADDR(val) bfin_write32(MXVR_DMA7_START_ADDR)
418#define bfin_read_MXVR_DMA7_COUNT() bfin_read16(MXVR_DMA7_COUNT)
419#define bfin_write_MXVR_DMA7_COUNT(val) bfin_write16(MXVR_DMA7_COUNT, val)
420#define bfin_read_MXVR_DMA7_CURR_ADDR() bfin_read32(MXVR_DMA7_CURR_ADDR)
421#define bfin_write_MXVR_DMA7_CURR_ADDR(val) bfin_write32(MXVR_DMA7_CURR_ADDR)
422#define bfin_read_MXVR_DMA7_CURR_COUNT() bfin_read16(MXVR_DMA7_CURR_COUNT)
423#define bfin_write_MXVR_DMA7_CURR_COUNT(val) bfin_write16(MXVR_DMA7_CURR_COUNT, val)
424
425/* MXVR Asynch Packet Registers */
426
427#define bfin_read_MXVR_AP_CTL() bfin_read16(MXVR_AP_CTL)
428#define bfin_write_MXVR_AP_CTL(val) bfin_write16(MXVR_AP_CTL, val)
429#define bfin_read_MXVR_APRB_START_ADDR() bfin_read32(MXVR_APRB_START_ADDR)
430#define bfin_write_MXVR_APRB_START_ADDR(val) bfin_write32(MXVR_APRB_START_ADDR)
431#define bfin_read_MXVR_APRB_CURR_ADDR() bfin_read32(MXVR_APRB_CURR_ADDR)
432#define bfin_write_MXVR_APRB_CURR_ADDR(val) bfin_write32(MXVR_APRB_CURR_ADDR)
433#define bfin_read_MXVR_APTB_START_ADDR() bfin_read32(MXVR_APTB_START_ADDR)
434#define bfin_write_MXVR_APTB_START_ADDR(val) bfin_write32(MXVR_APTB_START_ADDR)
435#define bfin_read_MXVR_APTB_CURR_ADDR() bfin_read32(MXVR_APTB_CURR_ADDR)
436#define bfin_write_MXVR_APTB_CURR_ADDR(val) bfin_write32(MXVR_APTB_CURR_ADDR)
437
438/* MXVR Control Message Registers */
439
440#define bfin_read_MXVR_CM_CTL() bfin_read32(MXVR_CM_CTL)
441#define bfin_write_MXVR_CM_CTL(val) bfin_write32(MXVR_CM_CTL, val)
442#define bfin_read_MXVR_CMRB_START_ADDR() bfin_read32(MXVR_CMRB_START_ADDR)
443#define bfin_write_MXVR_CMRB_START_ADDR(val) bfin_write32(MXVR_CMRB_START_ADDR)
444#define bfin_read_MXVR_CMRB_CURR_ADDR() bfin_read32(MXVR_CMRB_CURR_ADDR)
445#define bfin_write_MXVR_CMRB_CURR_ADDR(val) bfin_write32(MXVR_CMRB_CURR_ADDR)
446#define bfin_read_MXVR_CMTB_START_ADDR() bfin_read32(MXVR_CMTB_START_ADDR)
447#define bfin_write_MXVR_CMTB_START_ADDR(val) bfin_write32(MXVR_CMTB_START_ADDR)
448#define bfin_read_MXVR_CMTB_CURR_ADDR() bfin_read32(MXVR_CMTB_CURR_ADDR)
449#define bfin_write_MXVR_CMTB_CURR_ADDR(val) bfin_write32(MXVR_CMTB_CURR_ADDR)
450
451/* MXVR Remote Read Registers */
452
453#define bfin_read_MXVR_RRDB_START_ADDR() bfin_read32(MXVR_RRDB_START_ADDR)
454#define bfin_write_MXVR_RRDB_START_ADDR(val) bfin_write32(MXVR_RRDB_START_ADDR)
455#define bfin_read_MXVR_RRDB_CURR_ADDR() bfin_read32(MXVR_RRDB_CURR_ADDR)
456#define bfin_write_MXVR_RRDB_CURR_ADDR(val) bfin_write32(MXVR_RRDB_CURR_ADDR)
457
458/* MXVR Pattern Data Registers */
459
460#define bfin_read_MXVR_PAT_DATA_0() bfin_read32(MXVR_PAT_DATA_0)
461#define bfin_write_MXVR_PAT_DATA_0(val) bfin_write32(MXVR_PAT_DATA_0, val)
462#define bfin_read_MXVR_PAT_EN_0() bfin_read32(MXVR_PAT_EN_0)
463#define bfin_write_MXVR_PAT_EN_0(val) bfin_write32(MXVR_PAT_EN_0, val)
464#define bfin_read_MXVR_PAT_DATA_1() bfin_read32(MXVR_PAT_DATA_1)
465#define bfin_write_MXVR_PAT_DATA_1(val) bfin_write32(MXVR_PAT_DATA_1, val)
466#define bfin_read_MXVR_PAT_EN_1() bfin_read32(MXVR_PAT_EN_1)
467#define bfin_write_MXVR_PAT_EN_1(val) bfin_write32(MXVR_PAT_EN_1, val)
468
469/* MXVR Frame Counter Registers */
470
471#define bfin_read_MXVR_FRAME_CNT_0() bfin_read16(MXVR_FRAME_CNT_0)
472#define bfin_write_MXVR_FRAME_CNT_0(val) bfin_write16(MXVR_FRAME_CNT_0, val)
473#define bfin_read_MXVR_FRAME_CNT_1() bfin_read16(MXVR_FRAME_CNT_1)
474#define bfin_write_MXVR_FRAME_CNT_1(val) bfin_write16(MXVR_FRAME_CNT_1, val)
475
476/* MXVR Routing Table Registers */
477
478#define bfin_read_MXVR_ROUTING_0() bfin_read32(MXVR_ROUTING_0)
479#define bfin_write_MXVR_ROUTING_0(val) bfin_write32(MXVR_ROUTING_0, val)
480#define bfin_read_MXVR_ROUTING_1() bfin_read32(MXVR_ROUTING_1)
481#define bfin_write_MXVR_ROUTING_1(val) bfin_write32(MXVR_ROUTING_1, val)
482#define bfin_read_MXVR_ROUTING_2() bfin_read32(MXVR_ROUTING_2)
483#define bfin_write_MXVR_ROUTING_2(val) bfin_write32(MXVR_ROUTING_2, val)
484#define bfin_read_MXVR_ROUTING_3() bfin_read32(MXVR_ROUTING_3)
485#define bfin_write_MXVR_ROUTING_3(val) bfin_write32(MXVR_ROUTING_3, val)
486#define bfin_read_MXVR_ROUTING_4() bfin_read32(MXVR_ROUTING_4)
487#define bfin_write_MXVR_ROUTING_4(val) bfin_write32(MXVR_ROUTING_4, val)
488#define bfin_read_MXVR_ROUTING_5() bfin_read32(MXVR_ROUTING_5)
489#define bfin_write_MXVR_ROUTING_5(val) bfin_write32(MXVR_ROUTING_5, val)
490#define bfin_read_MXVR_ROUTING_6() bfin_read32(MXVR_ROUTING_6)
491#define bfin_write_MXVR_ROUTING_6(val) bfin_write32(MXVR_ROUTING_6, val)
492#define bfin_read_MXVR_ROUTING_7() bfin_read32(MXVR_ROUTING_7)
493#define bfin_write_MXVR_ROUTING_7(val) bfin_write32(MXVR_ROUTING_7, val)
494#define bfin_read_MXVR_ROUTING_8() bfin_read32(MXVR_ROUTING_8)
495#define bfin_write_MXVR_ROUTING_8(val) bfin_write32(MXVR_ROUTING_8, val)
496#define bfin_read_MXVR_ROUTING_9() bfin_read32(MXVR_ROUTING_9)
497#define bfin_write_MXVR_ROUTING_9(val) bfin_write32(MXVR_ROUTING_9, val)
498#define bfin_read_MXVR_ROUTING_10() bfin_read32(MXVR_ROUTING_10)
499#define bfin_write_MXVR_ROUTING_10(val) bfin_write32(MXVR_ROUTING_10, val)
500#define bfin_read_MXVR_ROUTING_11() bfin_read32(MXVR_ROUTING_11)
501#define bfin_write_MXVR_ROUTING_11(val) bfin_write32(MXVR_ROUTING_11, val)
502#define bfin_read_MXVR_ROUTING_12() bfin_read32(MXVR_ROUTING_12)
503#define bfin_write_MXVR_ROUTING_12(val) bfin_write32(MXVR_ROUTING_12, val)
504#define bfin_read_MXVR_ROUTING_13() bfin_read32(MXVR_ROUTING_13)
505#define bfin_write_MXVR_ROUTING_13(val) bfin_write32(MXVR_ROUTING_13, val)
506#define bfin_read_MXVR_ROUTING_14() bfin_read32(MXVR_ROUTING_14)
507#define bfin_write_MXVR_ROUTING_14(val) bfin_write32(MXVR_ROUTING_14, val)
508
509/* MXVR Counter-Clock-Control Registers */
510
511#define bfin_read_MXVR_BLOCK_CNT() bfin_read16(MXVR_BLOCK_CNT)
512#define bfin_write_MXVR_BLOCK_CNT(val) bfin_write16(MXVR_BLOCK_CNT, val)
513#define bfin_read_MXVR_CLK_CTL() bfin_read32(MXVR_CLK_CTL)
514#define bfin_write_MXVR_CLK_CTL(val) bfin_write32(MXVR_CLK_CTL, val)
515#define bfin_read_MXVR_CDRPLL_CTL() bfin_read32(MXVR_CDRPLL_CTL)
516#define bfin_write_MXVR_CDRPLL_CTL(val) bfin_write32(MXVR_CDRPLL_CTL, val)
517#define bfin_read_MXVR_FMPLL_CTL() bfin_read32(MXVR_FMPLL_CTL)
518#define bfin_write_MXVR_FMPLL_CTL(val) bfin_write32(MXVR_FMPLL_CTL, val)
519#define bfin_read_MXVR_PIN_CTL() bfin_read16(MXVR_PIN_CTL)
520#define bfin_write_MXVR_PIN_CTL(val) bfin_write16(MXVR_PIN_CTL, val)
521#define bfin_read_MXVR_SCLK_CNT() bfin_read16(MXVR_SCLK_CNT)
522#define bfin_write_MXVR_SCLK_CNT(val) bfin_write16(MXVR_SCLK_CNT, val)
523
524/* CAN Controller 1 Config 1 Registers */
525
526#define bfin_read_CAN1_MC1() bfin_read16(CAN1_MC1)
527#define bfin_write_CAN1_MC1(val) bfin_write16(CAN1_MC1, val)
528#define bfin_read_CAN1_MD1() bfin_read16(CAN1_MD1)
529#define bfin_write_CAN1_MD1(val) bfin_write16(CAN1_MD1, val)
530#define bfin_read_CAN1_TRS1() bfin_read16(CAN1_TRS1)
531#define bfin_write_CAN1_TRS1(val) bfin_write16(CAN1_TRS1, val)
532#define bfin_read_CAN1_TRR1() bfin_read16(CAN1_TRR1)
533#define bfin_write_CAN1_TRR1(val) bfin_write16(CAN1_TRR1, val)
534#define bfin_read_CAN1_TA1() bfin_read16(CAN1_TA1)
535#define bfin_write_CAN1_TA1(val) bfin_write16(CAN1_TA1, val)
536#define bfin_read_CAN1_AA1() bfin_read16(CAN1_AA1)
537#define bfin_write_CAN1_AA1(val) bfin_write16(CAN1_AA1, val)
538#define bfin_read_CAN1_RMP1() bfin_read16(CAN1_RMP1)
539#define bfin_write_CAN1_RMP1(val) bfin_write16(CAN1_RMP1, val)
540#define bfin_read_CAN1_RML1() bfin_read16(CAN1_RML1)
541#define bfin_write_CAN1_RML1(val) bfin_write16(CAN1_RML1, val)
542#define bfin_read_CAN1_MBTIF1() bfin_read16(CAN1_MBTIF1)
543#define bfin_write_CAN1_MBTIF1(val) bfin_write16(CAN1_MBTIF1, val)
544#define bfin_read_CAN1_MBRIF1() bfin_read16(CAN1_MBRIF1)
545#define bfin_write_CAN1_MBRIF1(val) bfin_write16(CAN1_MBRIF1, val)
546#define bfin_read_CAN1_MBIM1() bfin_read16(CAN1_MBIM1)
547#define bfin_write_CAN1_MBIM1(val) bfin_write16(CAN1_MBIM1, val)
548#define bfin_read_CAN1_RFH1() bfin_read16(CAN1_RFH1)
549#define bfin_write_CAN1_RFH1(val) bfin_write16(CAN1_RFH1, val)
550#define bfin_read_CAN1_OPSS1() bfin_read16(CAN1_OPSS1)
551#define bfin_write_CAN1_OPSS1(val) bfin_write16(CAN1_OPSS1, val)
552
553/* CAN Controller 1 Config 2 Registers */
554
555#define bfin_read_CAN1_MC2() bfin_read16(CAN1_MC2)
556#define bfin_write_CAN1_MC2(val) bfin_write16(CAN1_MC2, val)
557#define bfin_read_CAN1_MD2() bfin_read16(CAN1_MD2)
558#define bfin_write_CAN1_MD2(val) bfin_write16(CAN1_MD2, val)
559#define bfin_read_CAN1_TRS2() bfin_read16(CAN1_TRS2)
560#define bfin_write_CAN1_TRS2(val) bfin_write16(CAN1_TRS2, val)
561#define bfin_read_CAN1_TRR2() bfin_read16(CAN1_TRR2)
562#define bfin_write_CAN1_TRR2(val) bfin_write16(CAN1_TRR2, val)
563#define bfin_read_CAN1_TA2() bfin_read16(CAN1_TA2)
564#define bfin_write_CAN1_TA2(val) bfin_write16(CAN1_TA2, val)
565#define bfin_read_CAN1_AA2() bfin_read16(CAN1_AA2)
566#define bfin_write_CAN1_AA2(val) bfin_write16(CAN1_AA2, val)
567#define bfin_read_CAN1_RMP2() bfin_read16(CAN1_RMP2)
568#define bfin_write_CAN1_RMP2(val) bfin_write16(CAN1_RMP2, val)
569#define bfin_read_CAN1_RML2() bfin_read16(CAN1_RML2)
570#define bfin_write_CAN1_RML2(val) bfin_write16(CAN1_RML2, val)
571#define bfin_read_CAN1_MBTIF2() bfin_read16(CAN1_MBTIF2)
572#define bfin_write_CAN1_MBTIF2(val) bfin_write16(CAN1_MBTIF2, val)
573#define bfin_read_CAN1_MBRIF2() bfin_read16(CAN1_MBRIF2)
574#define bfin_write_CAN1_MBRIF2(val) bfin_write16(CAN1_MBRIF2, val)
575#define bfin_read_CAN1_MBIM2() bfin_read16(CAN1_MBIM2)
576#define bfin_write_CAN1_MBIM2(val) bfin_write16(CAN1_MBIM2, val)
577#define bfin_read_CAN1_RFH2() bfin_read16(CAN1_RFH2)
578#define bfin_write_CAN1_RFH2(val) bfin_write16(CAN1_RFH2, val)
579#define bfin_read_CAN1_OPSS2() bfin_read16(CAN1_OPSS2)
580#define bfin_write_CAN1_OPSS2(val) bfin_write16(CAN1_OPSS2, val)
581
582/* CAN Controller 1 Clock/Interrubfin_read_()t/Counter Registers */
583
584#define bfin_read_CAN1_CLOCK() bfin_read16(CAN1_CLOCK)
585#define bfin_write_CAN1_CLOCK(val) bfin_write16(CAN1_CLOCK, val)
586#define bfin_read_CAN1_TIMING() bfin_read16(CAN1_TIMING)
587#define bfin_write_CAN1_TIMING(val) bfin_write16(CAN1_TIMING, val)
588#define bfin_read_CAN1_DEBUG() bfin_read16(CAN1_DEBUG)
589#define bfin_write_CAN1_DEBUG(val) bfin_write16(CAN1_DEBUG, val)
590#define bfin_read_CAN1_STATUS() bfin_read16(CAN1_STATUS)
591#define bfin_write_CAN1_STATUS(val) bfin_write16(CAN1_STATUS, val)
592#define bfin_read_CAN1_CEC() bfin_read16(CAN1_CEC)
593#define bfin_write_CAN1_CEC(val) bfin_write16(CAN1_CEC, val)
594#define bfin_read_CAN1_GIS() bfin_read16(CAN1_GIS)
595#define bfin_write_CAN1_GIS(val) bfin_write16(CAN1_GIS, val)
596#define bfin_read_CAN1_GIM() bfin_read16(CAN1_GIM)
597#define bfin_write_CAN1_GIM(val) bfin_write16(CAN1_GIM, val)
598#define bfin_read_CAN1_GIF() bfin_read16(CAN1_GIF)
599#define bfin_write_CAN1_GIF(val) bfin_write16(CAN1_GIF, val)
600#define bfin_read_CAN1_CONTROL() bfin_read16(CAN1_CONTROL)
601#define bfin_write_CAN1_CONTROL(val) bfin_write16(CAN1_CONTROL, val)
602#define bfin_read_CAN1_INTR() bfin_read16(CAN1_INTR)
603#define bfin_write_CAN1_INTR(val) bfin_write16(CAN1_INTR, val)
604#define bfin_read_CAN1_MBTD() bfin_read16(CAN1_MBTD)
605#define bfin_write_CAN1_MBTD(val) bfin_write16(CAN1_MBTD, val)
606#define bfin_read_CAN1_EWR() bfin_read16(CAN1_EWR)
607#define bfin_write_CAN1_EWR(val) bfin_write16(CAN1_EWR, val)
608#define bfin_read_CAN1_ESR() bfin_read16(CAN1_ESR)
609#define bfin_write_CAN1_ESR(val) bfin_write16(CAN1_ESR, val)
610#define bfin_read_CAN1_UCCNT() bfin_read16(CAN1_UCCNT)
611#define bfin_write_CAN1_UCCNT(val) bfin_write16(CAN1_UCCNT, val)
612#define bfin_read_CAN1_UCRC() bfin_read16(CAN1_UCRC)
613#define bfin_write_CAN1_UCRC(val) bfin_write16(CAN1_UCRC, val)
614#define bfin_read_CAN1_UCCNF() bfin_read16(CAN1_UCCNF)
615#define bfin_write_CAN1_UCCNF(val) bfin_write16(CAN1_UCCNF, val)
616
617/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
618
619#define bfin_read_CAN1_AM00L() bfin_read16(CAN1_AM00L)
620#define bfin_write_CAN1_AM00L(val) bfin_write16(CAN1_AM00L, val)
621#define bfin_read_CAN1_AM00H() bfin_read16(CAN1_AM00H)
622#define bfin_write_CAN1_AM00H(val) bfin_write16(CAN1_AM00H, val)
623#define bfin_read_CAN1_AM01L() bfin_read16(CAN1_AM01L)
624#define bfin_write_CAN1_AM01L(val) bfin_write16(CAN1_AM01L, val)
625#define bfin_read_CAN1_AM01H() bfin_read16(CAN1_AM01H)
626#define bfin_write_CAN1_AM01H(val) bfin_write16(CAN1_AM01H, val)
627#define bfin_read_CAN1_AM02L() bfin_read16(CAN1_AM02L)
628#define bfin_write_CAN1_AM02L(val) bfin_write16(CAN1_AM02L, val)
629#define bfin_read_CAN1_AM02H() bfin_read16(CAN1_AM02H)
630#define bfin_write_CAN1_AM02H(val) bfin_write16(CAN1_AM02H, val)
631#define bfin_read_CAN1_AM03L() bfin_read16(CAN1_AM03L)
632#define bfin_write_CAN1_AM03L(val) bfin_write16(CAN1_AM03L, val)
633#define bfin_read_CAN1_AM03H() bfin_read16(CAN1_AM03H)
634#define bfin_write_CAN1_AM03H(val) bfin_write16(CAN1_AM03H, val)
635#define bfin_read_CAN1_AM04L() bfin_read16(CAN1_AM04L)
636#define bfin_write_CAN1_AM04L(val) bfin_write16(CAN1_AM04L, val)
637#define bfin_read_CAN1_AM04H() bfin_read16(CAN1_AM04H)
638#define bfin_write_CAN1_AM04H(val) bfin_write16(CAN1_AM04H, val)
639#define bfin_read_CAN1_AM05L() bfin_read16(CAN1_AM05L)
640#define bfin_write_CAN1_AM05L(val) bfin_write16(CAN1_AM05L, val)
641#define bfin_read_CAN1_AM05H() bfin_read16(CAN1_AM05H)
642#define bfin_write_CAN1_AM05H(val) bfin_write16(CAN1_AM05H, val)
643#define bfin_read_CAN1_AM06L() bfin_read16(CAN1_AM06L)
644#define bfin_write_CAN1_AM06L(val) bfin_write16(CAN1_AM06L, val)
645#define bfin_read_CAN1_AM06H() bfin_read16(CAN1_AM06H)
646#define bfin_write_CAN1_AM06H(val) bfin_write16(CAN1_AM06H, val)
647#define bfin_read_CAN1_AM07L() bfin_read16(CAN1_AM07L)
648#define bfin_write_CAN1_AM07L(val) bfin_write16(CAN1_AM07L, val)
649#define bfin_read_CAN1_AM07H() bfin_read16(CAN1_AM07H)
650#define bfin_write_CAN1_AM07H(val) bfin_write16(CAN1_AM07H, val)
651#define bfin_read_CAN1_AM08L() bfin_read16(CAN1_AM08L)
652#define bfin_write_CAN1_AM08L(val) bfin_write16(CAN1_AM08L, val)
653#define bfin_read_CAN1_AM08H() bfin_read16(CAN1_AM08H)
654#define bfin_write_CAN1_AM08H(val) bfin_write16(CAN1_AM08H, val)
655#define bfin_read_CAN1_AM09L() bfin_read16(CAN1_AM09L)
656#define bfin_write_CAN1_AM09L(val) bfin_write16(CAN1_AM09L, val)
657#define bfin_read_CAN1_AM09H() bfin_read16(CAN1_AM09H)
658#define bfin_write_CAN1_AM09H(val) bfin_write16(CAN1_AM09H, val)
659#define bfin_read_CAN1_AM10L() bfin_read16(CAN1_AM10L)
660#define bfin_write_CAN1_AM10L(val) bfin_write16(CAN1_AM10L, val)
661#define bfin_read_CAN1_AM10H() bfin_read16(CAN1_AM10H)
662#define bfin_write_CAN1_AM10H(val) bfin_write16(CAN1_AM10H, val)
663#define bfin_read_CAN1_AM11L() bfin_read16(CAN1_AM11L)
664#define bfin_write_CAN1_AM11L(val) bfin_write16(CAN1_AM11L, val)
665#define bfin_read_CAN1_AM11H() bfin_read16(CAN1_AM11H)
666#define bfin_write_CAN1_AM11H(val) bfin_write16(CAN1_AM11H, val)
667#define bfin_read_CAN1_AM12L() bfin_read16(CAN1_AM12L)
668#define bfin_write_CAN1_AM12L(val) bfin_write16(CAN1_AM12L, val)
669#define bfin_read_CAN1_AM12H() bfin_read16(CAN1_AM12H)
670#define bfin_write_CAN1_AM12H(val) bfin_write16(CAN1_AM12H, val)
671#define bfin_read_CAN1_AM13L() bfin_read16(CAN1_AM13L)
672#define bfin_write_CAN1_AM13L(val) bfin_write16(CAN1_AM13L, val)
673#define bfin_read_CAN1_AM13H() bfin_read16(CAN1_AM13H)
674#define bfin_write_CAN1_AM13H(val) bfin_write16(CAN1_AM13H, val)
675#define bfin_read_CAN1_AM14L() bfin_read16(CAN1_AM14L)
676#define bfin_write_CAN1_AM14L(val) bfin_write16(CAN1_AM14L, val)
677#define bfin_read_CAN1_AM14H() bfin_read16(CAN1_AM14H)
678#define bfin_write_CAN1_AM14H(val) bfin_write16(CAN1_AM14H, val)
679#define bfin_read_CAN1_AM15L() bfin_read16(CAN1_AM15L)
680#define bfin_write_CAN1_AM15L(val) bfin_write16(CAN1_AM15L, val)
681#define bfin_read_CAN1_AM15H() bfin_read16(CAN1_AM15H)
682#define bfin_write_CAN1_AM15H(val) bfin_write16(CAN1_AM15H, val)
683
684/* CAN Controller 1 Mailbox Accebfin_read_()tance Registers */
685
686#define bfin_read_CAN1_AM16L() bfin_read16(CAN1_AM16L)
687#define bfin_write_CAN1_AM16L(val) bfin_write16(CAN1_AM16L, val)
688#define bfin_read_CAN1_AM16H() bfin_read16(CAN1_AM16H)
689#define bfin_write_CAN1_AM16H(val) bfin_write16(CAN1_AM16H, val)
690#define bfin_read_CAN1_AM17L() bfin_read16(CAN1_AM17L)
691#define bfin_write_CAN1_AM17L(val) bfin_write16(CAN1_AM17L, val)
692#define bfin_read_CAN1_AM17H() bfin_read16(CAN1_AM17H)
693#define bfin_write_CAN1_AM17H(val) bfin_write16(CAN1_AM17H, val)
694#define bfin_read_CAN1_AM18L() bfin_read16(CAN1_AM18L)
695#define bfin_write_CAN1_AM18L(val) bfin_write16(CAN1_AM18L, val)
696#define bfin_read_CAN1_AM18H() bfin_read16(CAN1_AM18H)
697#define bfin_write_CAN1_AM18H(val) bfin_write16(CAN1_AM18H, val)
698#define bfin_read_CAN1_AM19L() bfin_read16(CAN1_AM19L)
699#define bfin_write_CAN1_AM19L(val) bfin_write16(CAN1_AM19L, val)
700#define bfin_read_CAN1_AM19H() bfin_read16(CAN1_AM19H)
701#define bfin_write_CAN1_AM19H(val) bfin_write16(CAN1_AM19H, val)
702#define bfin_read_CAN1_AM20L() bfin_read16(CAN1_AM20L)
703#define bfin_write_CAN1_AM20L(val) bfin_write16(CAN1_AM20L, val)
704#define bfin_read_CAN1_AM20H() bfin_read16(CAN1_AM20H)
705#define bfin_write_CAN1_AM20H(val) bfin_write16(CAN1_AM20H, val)
706#define bfin_read_CAN1_AM21L() bfin_read16(CAN1_AM21L)
707#define bfin_write_CAN1_AM21L(val) bfin_write16(CAN1_AM21L, val)
708#define bfin_read_CAN1_AM21H() bfin_read16(CAN1_AM21H)
709#define bfin_write_CAN1_AM21H(val) bfin_write16(CAN1_AM21H, val)
710#define bfin_read_CAN1_AM22L() bfin_read16(CAN1_AM22L)
711#define bfin_write_CAN1_AM22L(val) bfin_write16(CAN1_AM22L, val)
712#define bfin_read_CAN1_AM22H() bfin_read16(CAN1_AM22H)
713#define bfin_write_CAN1_AM22H(val) bfin_write16(CAN1_AM22H, val)
714#define bfin_read_CAN1_AM23L() bfin_read16(CAN1_AM23L)
715#define bfin_write_CAN1_AM23L(val) bfin_write16(CAN1_AM23L, val)
716#define bfin_read_CAN1_AM23H() bfin_read16(CAN1_AM23H)
717#define bfin_write_CAN1_AM23H(val) bfin_write16(CAN1_AM23H, val)
718#define bfin_read_CAN1_AM24L() bfin_read16(CAN1_AM24L)
719#define bfin_write_CAN1_AM24L(val) bfin_write16(CAN1_AM24L, val)
720#define bfin_read_CAN1_AM24H() bfin_read16(CAN1_AM24H)
721#define bfin_write_CAN1_AM24H(val) bfin_write16(CAN1_AM24H, val)
722#define bfin_read_CAN1_AM25L() bfin_read16(CAN1_AM25L)
723#define bfin_write_CAN1_AM25L(val) bfin_write16(CAN1_AM25L, val)
724#define bfin_read_CAN1_AM25H() bfin_read16(CAN1_AM25H)
725#define bfin_write_CAN1_AM25H(val) bfin_write16(CAN1_AM25H, val)
726#define bfin_read_CAN1_AM26L() bfin_read16(CAN1_AM26L)
727#define bfin_write_CAN1_AM26L(val) bfin_write16(CAN1_AM26L, val)
728#define bfin_read_CAN1_AM26H() bfin_read16(CAN1_AM26H)
729#define bfin_write_CAN1_AM26H(val) bfin_write16(CAN1_AM26H, val)
730#define bfin_read_CAN1_AM27L() bfin_read16(CAN1_AM27L)
731#define bfin_write_CAN1_AM27L(val) bfin_write16(CAN1_AM27L, val)
732#define bfin_read_CAN1_AM27H() bfin_read16(CAN1_AM27H)
733#define bfin_write_CAN1_AM27H(val) bfin_write16(CAN1_AM27H, val)
734#define bfin_read_CAN1_AM28L() bfin_read16(CAN1_AM28L)
735#define bfin_write_CAN1_AM28L(val) bfin_write16(CAN1_AM28L, val)
736#define bfin_read_CAN1_AM28H() bfin_read16(CAN1_AM28H)
737#define bfin_write_CAN1_AM28H(val) bfin_write16(CAN1_AM28H, val)
738#define bfin_read_CAN1_AM29L() bfin_read16(CAN1_AM29L)
739#define bfin_write_CAN1_AM29L(val) bfin_write16(CAN1_AM29L, val)
740#define bfin_read_CAN1_AM29H() bfin_read16(CAN1_AM29H)
741#define bfin_write_CAN1_AM29H(val) bfin_write16(CAN1_AM29H, val)
742#define bfin_read_CAN1_AM30L() bfin_read16(CAN1_AM30L)
743#define bfin_write_CAN1_AM30L(val) bfin_write16(CAN1_AM30L, val)
744#define bfin_read_CAN1_AM30H() bfin_read16(CAN1_AM30H)
745#define bfin_write_CAN1_AM30H(val) bfin_write16(CAN1_AM30H, val)
746#define bfin_read_CAN1_AM31L() bfin_read16(CAN1_AM31L)
747#define bfin_write_CAN1_AM31L(val) bfin_write16(CAN1_AM31L, val)
748#define bfin_read_CAN1_AM31H() bfin_read16(CAN1_AM31H)
749#define bfin_write_CAN1_AM31H(val) bfin_write16(CAN1_AM31H, val)
750
751/* CAN Controller 1 Mailbox Data Registers */
752
753#define bfin_read_CAN1_MB00_DATA0() bfin_read16(CAN1_MB00_DATA0)
754#define bfin_write_CAN1_MB00_DATA0(val) bfin_write16(CAN1_MB00_DATA0, val)
755#define bfin_read_CAN1_MB00_DATA1() bfin_read16(CAN1_MB00_DATA1)
756#define bfin_write_CAN1_MB00_DATA1(val) bfin_write16(CAN1_MB00_DATA1, val)
757#define bfin_read_CAN1_MB00_DATA2() bfin_read16(CAN1_MB00_DATA2)
758#define bfin_write_CAN1_MB00_DATA2(val) bfin_write16(CAN1_MB00_DATA2, val)
759#define bfin_read_CAN1_MB00_DATA3() bfin_read16(CAN1_MB00_DATA3)
760#define bfin_write_CAN1_MB00_DATA3(val) bfin_write16(CAN1_MB00_DATA3, val)
761#define bfin_read_CAN1_MB00_LENGTH() bfin_read16(CAN1_MB00_LENGTH)
762#define bfin_write_CAN1_MB00_LENGTH(val) bfin_write16(CAN1_MB00_LENGTH, val)
763#define bfin_read_CAN1_MB00_TIMESTAMP() bfin_read16(CAN1_MB00_TIMESTAMP)
764#define bfin_write_CAN1_MB00_TIMESTAMP(val) bfin_write16(CAN1_MB00_TIMESTAMP, val)
765#define bfin_read_CAN1_MB00_ID0() bfin_read16(CAN1_MB00_ID0)
766#define bfin_write_CAN1_MB00_ID0(val) bfin_write16(CAN1_MB00_ID0, val)
767#define bfin_read_CAN1_MB00_ID1() bfin_read16(CAN1_MB00_ID1)
768#define bfin_write_CAN1_MB00_ID1(val) bfin_write16(CAN1_MB00_ID1, val)
769#define bfin_read_CAN1_MB01_DATA0() bfin_read16(CAN1_MB01_DATA0)
770#define bfin_write_CAN1_MB01_DATA0(val) bfin_write16(CAN1_MB01_DATA0, val)
771#define bfin_read_CAN1_MB01_DATA1() bfin_read16(CAN1_MB01_DATA1)
772#define bfin_write_CAN1_MB01_DATA1(val) bfin_write16(CAN1_MB01_DATA1, val)
773#define bfin_read_CAN1_MB01_DATA2() bfin_read16(CAN1_MB01_DATA2)
774#define bfin_write_CAN1_MB01_DATA2(val) bfin_write16(CAN1_MB01_DATA2, val)
775#define bfin_read_CAN1_MB01_DATA3() bfin_read16(CAN1_MB01_DATA3)
776#define bfin_write_CAN1_MB01_DATA3(val) bfin_write16(CAN1_MB01_DATA3, val)
777#define bfin_read_CAN1_MB01_LENGTH() bfin_read16(CAN1_MB01_LENGTH)
778#define bfin_write_CAN1_MB01_LENGTH(val) bfin_write16(CAN1_MB01_LENGTH, val)
779#define bfin_read_CAN1_MB01_TIMESTAMP() bfin_read16(CAN1_MB01_TIMESTAMP)
780#define bfin_write_CAN1_MB01_TIMESTAMP(val) bfin_write16(CAN1_MB01_TIMESTAMP, val)
781#define bfin_read_CAN1_MB01_ID0() bfin_read16(CAN1_MB01_ID0)
782#define bfin_write_CAN1_MB01_ID0(val) bfin_write16(CAN1_MB01_ID0, val)
783#define bfin_read_CAN1_MB01_ID1() bfin_read16(CAN1_MB01_ID1)
784#define bfin_write_CAN1_MB01_ID1(val) bfin_write16(CAN1_MB01_ID1, val)
785#define bfin_read_CAN1_MB02_DATA0() bfin_read16(CAN1_MB02_DATA0)
786#define bfin_write_CAN1_MB02_DATA0(val) bfin_write16(CAN1_MB02_DATA0, val)
787#define bfin_read_CAN1_MB02_DATA1() bfin_read16(CAN1_MB02_DATA1)
788#define bfin_write_CAN1_MB02_DATA1(val) bfin_write16(CAN1_MB02_DATA1, val)
789#define bfin_read_CAN1_MB02_DATA2() bfin_read16(CAN1_MB02_DATA2)
790#define bfin_write_CAN1_MB02_DATA2(val) bfin_write16(CAN1_MB02_DATA2, val)
791#define bfin_read_CAN1_MB02_DATA3() bfin_read16(CAN1_MB02_DATA3)
792#define bfin_write_CAN1_MB02_DATA3(val) bfin_write16(CAN1_MB02_DATA3, val)
793#define bfin_read_CAN1_MB02_LENGTH() bfin_read16(CAN1_MB02_LENGTH)
794#define bfin_write_CAN1_MB02_LENGTH(val) bfin_write16(CAN1_MB02_LENGTH, val)
795#define bfin_read_CAN1_MB02_TIMESTAMP() bfin_read16(CAN1_MB02_TIMESTAMP)
796#define bfin_write_CAN1_MB02_TIMESTAMP(val) bfin_write16(CAN1_MB02_TIMESTAMP, val)
797#define bfin_read_CAN1_MB02_ID0() bfin_read16(CAN1_MB02_ID0)
798#define bfin_write_CAN1_MB02_ID0(val) bfin_write16(CAN1_MB02_ID0, val)
799#define bfin_read_CAN1_MB02_ID1() bfin_read16(CAN1_MB02_ID1)
800#define bfin_write_CAN1_MB02_ID1(val) bfin_write16(CAN1_MB02_ID1, val)
801#define bfin_read_CAN1_MB03_DATA0() bfin_read16(CAN1_MB03_DATA0)
802#define bfin_write_CAN1_MB03_DATA0(val) bfin_write16(CAN1_MB03_DATA0, val)
803#define bfin_read_CAN1_MB03_DATA1() bfin_read16(CAN1_MB03_DATA1)
804#define bfin_write_CAN1_MB03_DATA1(val) bfin_write16(CAN1_MB03_DATA1, val)
805#define bfin_read_CAN1_MB03_DATA2() bfin_read16(CAN1_MB03_DATA2)
806#define bfin_write_CAN1_MB03_DATA2(val) bfin_write16(CAN1_MB03_DATA2, val)
807#define bfin_read_CAN1_MB03_DATA3() bfin_read16(CAN1_MB03_DATA3)
808#define bfin_write_CAN1_MB03_DATA3(val) bfin_write16(CAN1_MB03_DATA3, val)
809#define bfin_read_CAN1_MB03_LENGTH() bfin_read16(CAN1_MB03_LENGTH)
810#define bfin_write_CAN1_MB03_LENGTH(val) bfin_write16(CAN1_MB03_LENGTH, val)
811#define bfin_read_CAN1_MB03_TIMESTAMP() bfin_read16(CAN1_MB03_TIMESTAMP)
812#define bfin_write_CAN1_MB03_TIMESTAMP(val) bfin_write16(CAN1_MB03_TIMESTAMP, val)
813#define bfin_read_CAN1_MB03_ID0() bfin_read16(CAN1_MB03_ID0)
814#define bfin_write_CAN1_MB03_ID0(val) bfin_write16(CAN1_MB03_ID0, val)
815#define bfin_read_CAN1_MB03_ID1() bfin_read16(CAN1_MB03_ID1)
816#define bfin_write_CAN1_MB03_ID1(val) bfin_write16(CAN1_MB03_ID1, val)
817#define bfin_read_CAN1_MB04_DATA0() bfin_read16(CAN1_MB04_DATA0)
818#define bfin_write_CAN1_MB04_DATA0(val) bfin_write16(CAN1_MB04_DATA0, val)
819#define bfin_read_CAN1_MB04_DATA1() bfin_read16(CAN1_MB04_DATA1)
820#define bfin_write_CAN1_MB04_DATA1(val) bfin_write16(CAN1_MB04_DATA1, val)
821#define bfin_read_CAN1_MB04_DATA2() bfin_read16(CAN1_MB04_DATA2)
822#define bfin_write_CAN1_MB04_DATA2(val) bfin_write16(CAN1_MB04_DATA2, val)
823#define bfin_read_CAN1_MB04_DATA3() bfin_read16(CAN1_MB04_DATA3)
824#define bfin_write_CAN1_MB04_DATA3(val) bfin_write16(CAN1_MB04_DATA3, val)
825#define bfin_read_CAN1_MB04_LENGTH() bfin_read16(CAN1_MB04_LENGTH)
826#define bfin_write_CAN1_MB04_LENGTH(val) bfin_write16(CAN1_MB04_LENGTH, val)
827#define bfin_read_CAN1_MB04_TIMESTAMP() bfin_read16(CAN1_MB04_TIMESTAMP)
828#define bfin_write_CAN1_MB04_TIMESTAMP(val) bfin_write16(CAN1_MB04_TIMESTAMP, val)
829#define bfin_read_CAN1_MB04_ID0() bfin_read16(CAN1_MB04_ID0)
830#define bfin_write_CAN1_MB04_ID0(val) bfin_write16(CAN1_MB04_ID0, val)
831#define bfin_read_CAN1_MB04_ID1() bfin_read16(CAN1_MB04_ID1)
832#define bfin_write_CAN1_MB04_ID1(val) bfin_write16(CAN1_MB04_ID1, val)
833#define bfin_read_CAN1_MB05_DATA0() bfin_read16(CAN1_MB05_DATA0)
834#define bfin_write_CAN1_MB05_DATA0(val) bfin_write16(CAN1_MB05_DATA0, val)
835#define bfin_read_CAN1_MB05_DATA1() bfin_read16(CAN1_MB05_DATA1)
836#define bfin_write_CAN1_MB05_DATA1(val) bfin_write16(CAN1_MB05_DATA1, val)
837#define bfin_read_CAN1_MB05_DATA2() bfin_read16(CAN1_MB05_DATA2)
838#define bfin_write_CAN1_MB05_DATA2(val) bfin_write16(CAN1_MB05_DATA2, val)
839#define bfin_read_CAN1_MB05_DATA3() bfin_read16(CAN1_MB05_DATA3)
840#define bfin_write_CAN1_MB05_DATA3(val) bfin_write16(CAN1_MB05_DATA3, val)
841#define bfin_read_CAN1_MB05_LENGTH() bfin_read16(CAN1_MB05_LENGTH)
842#define bfin_write_CAN1_MB05_LENGTH(val) bfin_write16(CAN1_MB05_LENGTH, val)
843#define bfin_read_CAN1_MB05_TIMESTAMP() bfin_read16(CAN1_MB05_TIMESTAMP)
844#define bfin_write_CAN1_MB05_TIMESTAMP(val) bfin_write16(CAN1_MB05_TIMESTAMP, val)
845#define bfin_read_CAN1_MB05_ID0() bfin_read16(CAN1_MB05_ID0)
846#define bfin_write_CAN1_MB05_ID0(val) bfin_write16(CAN1_MB05_ID0, val)
847#define bfin_read_CAN1_MB05_ID1() bfin_read16(CAN1_MB05_ID1)
848#define bfin_write_CAN1_MB05_ID1(val) bfin_write16(CAN1_MB05_ID1, val)
849#define bfin_read_CAN1_MB06_DATA0() bfin_read16(CAN1_MB06_DATA0)
850#define bfin_write_CAN1_MB06_DATA0(val) bfin_write16(CAN1_MB06_DATA0, val)
851#define bfin_read_CAN1_MB06_DATA1() bfin_read16(CAN1_MB06_DATA1)
852#define bfin_write_CAN1_MB06_DATA1(val) bfin_write16(CAN1_MB06_DATA1, val)
853#define bfin_read_CAN1_MB06_DATA2() bfin_read16(CAN1_MB06_DATA2)
854#define bfin_write_CAN1_MB06_DATA2(val) bfin_write16(CAN1_MB06_DATA2, val)
855#define bfin_read_CAN1_MB06_DATA3() bfin_read16(CAN1_MB06_DATA3)
856#define bfin_write_CAN1_MB06_DATA3(val) bfin_write16(CAN1_MB06_DATA3, val)
857#define bfin_read_CAN1_MB06_LENGTH() bfin_read16(CAN1_MB06_LENGTH)
858#define bfin_write_CAN1_MB06_LENGTH(val) bfin_write16(CAN1_MB06_LENGTH, val)
859#define bfin_read_CAN1_MB06_TIMESTAMP() bfin_read16(CAN1_MB06_TIMESTAMP)
860#define bfin_write_CAN1_MB06_TIMESTAMP(val) bfin_write16(CAN1_MB06_TIMESTAMP, val)
861#define bfin_read_CAN1_MB06_ID0() bfin_read16(CAN1_MB06_ID0)
862#define bfin_write_CAN1_MB06_ID0(val) bfin_write16(CAN1_MB06_ID0, val)
863#define bfin_read_CAN1_MB06_ID1() bfin_read16(CAN1_MB06_ID1)
864#define bfin_write_CAN1_MB06_ID1(val) bfin_write16(CAN1_MB06_ID1, val)
865#define bfin_read_CAN1_MB07_DATA0() bfin_read16(CAN1_MB07_DATA0)
866#define bfin_write_CAN1_MB07_DATA0(val) bfin_write16(CAN1_MB07_DATA0, val)
867#define bfin_read_CAN1_MB07_DATA1() bfin_read16(CAN1_MB07_DATA1)
868#define bfin_write_CAN1_MB07_DATA1(val) bfin_write16(CAN1_MB07_DATA1, val)
869#define bfin_read_CAN1_MB07_DATA2() bfin_read16(CAN1_MB07_DATA2)
870#define bfin_write_CAN1_MB07_DATA2(val) bfin_write16(CAN1_MB07_DATA2, val)
871#define bfin_read_CAN1_MB07_DATA3() bfin_read16(CAN1_MB07_DATA3)
872#define bfin_write_CAN1_MB07_DATA3(val) bfin_write16(CAN1_MB07_DATA3, val)
873#define bfin_read_CAN1_MB07_LENGTH() bfin_read16(CAN1_MB07_LENGTH)
874#define bfin_write_CAN1_MB07_LENGTH(val) bfin_write16(CAN1_MB07_LENGTH, val)
875#define bfin_read_CAN1_MB07_TIMESTAMP() bfin_read16(CAN1_MB07_TIMESTAMP)
876#define bfin_write_CAN1_MB07_TIMESTAMP(val) bfin_write16(CAN1_MB07_TIMESTAMP, val)
877#define bfin_read_CAN1_MB07_ID0() bfin_read16(CAN1_MB07_ID0)
878#define bfin_write_CAN1_MB07_ID0(val) bfin_write16(CAN1_MB07_ID0, val)
879#define bfin_read_CAN1_MB07_ID1() bfin_read16(CAN1_MB07_ID1)
880#define bfin_write_CAN1_MB07_ID1(val) bfin_write16(CAN1_MB07_ID1, val)
881#define bfin_read_CAN1_MB08_DATA0() bfin_read16(CAN1_MB08_DATA0)
882#define bfin_write_CAN1_MB08_DATA0(val) bfin_write16(CAN1_MB08_DATA0, val)
883#define bfin_read_CAN1_MB08_DATA1() bfin_read16(CAN1_MB08_DATA1)
884#define bfin_write_CAN1_MB08_DATA1(val) bfin_write16(CAN1_MB08_DATA1, val)
885#define bfin_read_CAN1_MB08_DATA2() bfin_read16(CAN1_MB08_DATA2)
886#define bfin_write_CAN1_MB08_DATA2(val) bfin_write16(CAN1_MB08_DATA2, val)
887#define bfin_read_CAN1_MB08_DATA3() bfin_read16(CAN1_MB08_DATA3)
888#define bfin_write_CAN1_MB08_DATA3(val) bfin_write16(CAN1_MB08_DATA3, val)
889#define bfin_read_CAN1_MB08_LENGTH() bfin_read16(CAN1_MB08_LENGTH)
890#define bfin_write_CAN1_MB08_LENGTH(val) bfin_write16(CAN1_MB08_LENGTH, val)
891#define bfin_read_CAN1_MB08_TIMESTAMP() bfin_read16(CAN1_MB08_TIMESTAMP)
892#define bfin_write_CAN1_MB08_TIMESTAMP(val) bfin_write16(CAN1_MB08_TIMESTAMP, val)
893#define bfin_read_CAN1_MB08_ID0() bfin_read16(CAN1_MB08_ID0)
894#define bfin_write_CAN1_MB08_ID0(val) bfin_write16(CAN1_MB08_ID0, val)
895#define bfin_read_CAN1_MB08_ID1() bfin_read16(CAN1_MB08_ID1)
896#define bfin_write_CAN1_MB08_ID1(val) bfin_write16(CAN1_MB08_ID1, val)
897#define bfin_read_CAN1_MB09_DATA0() bfin_read16(CAN1_MB09_DATA0)
898#define bfin_write_CAN1_MB09_DATA0(val) bfin_write16(CAN1_MB09_DATA0, val)
899#define bfin_read_CAN1_MB09_DATA1() bfin_read16(CAN1_MB09_DATA1)
900#define bfin_write_CAN1_MB09_DATA1(val) bfin_write16(CAN1_MB09_DATA1, val)
901#define bfin_read_CAN1_MB09_DATA2() bfin_read16(CAN1_MB09_DATA2)
902#define bfin_write_CAN1_MB09_DATA2(val) bfin_write16(CAN1_MB09_DATA2, val)
903#define bfin_read_CAN1_MB09_DATA3() bfin_read16(CAN1_MB09_DATA3)
904#define bfin_write_CAN1_MB09_DATA3(val) bfin_write16(CAN1_MB09_DATA3, val)
905#define bfin_read_CAN1_MB09_LENGTH() bfin_read16(CAN1_MB09_LENGTH)
906#define bfin_write_CAN1_MB09_LENGTH(val) bfin_write16(CAN1_MB09_LENGTH, val)
907#define bfin_read_CAN1_MB09_TIMESTAMP() bfin_read16(CAN1_MB09_TIMESTAMP)
908#define bfin_write_CAN1_MB09_TIMESTAMP(val) bfin_write16(CAN1_MB09_TIMESTAMP, val)
909#define bfin_read_CAN1_MB09_ID0() bfin_read16(CAN1_MB09_ID0)
910#define bfin_write_CAN1_MB09_ID0(val) bfin_write16(CAN1_MB09_ID0, val)
911#define bfin_read_CAN1_MB09_ID1() bfin_read16(CAN1_MB09_ID1)
912#define bfin_write_CAN1_MB09_ID1(val) bfin_write16(CAN1_MB09_ID1, val)
913#define bfin_read_CAN1_MB10_DATA0() bfin_read16(CAN1_MB10_DATA0)
914#define bfin_write_CAN1_MB10_DATA0(val) bfin_write16(CAN1_MB10_DATA0, val)
915#define bfin_read_CAN1_MB10_DATA1() bfin_read16(CAN1_MB10_DATA1)
916#define bfin_write_CAN1_MB10_DATA1(val) bfin_write16(CAN1_MB10_DATA1, val)
917#define bfin_read_CAN1_MB10_DATA2() bfin_read16(CAN1_MB10_DATA2)
918#define bfin_write_CAN1_MB10_DATA2(val) bfin_write16(CAN1_MB10_DATA2, val)
919#define bfin_read_CAN1_MB10_DATA3() bfin_read16(CAN1_MB10_DATA3)
920#define bfin_write_CAN1_MB10_DATA3(val) bfin_write16(CAN1_MB10_DATA3, val)
921#define bfin_read_CAN1_MB10_LENGTH() bfin_read16(CAN1_MB10_LENGTH)
922#define bfin_write_CAN1_MB10_LENGTH(val) bfin_write16(CAN1_MB10_LENGTH, val)
923#define bfin_read_CAN1_MB10_TIMESTAMP() bfin_read16(CAN1_MB10_TIMESTAMP)
924#define bfin_write_CAN1_MB10_TIMESTAMP(val) bfin_write16(CAN1_MB10_TIMESTAMP, val)
925#define bfin_read_CAN1_MB10_ID0() bfin_read16(CAN1_MB10_ID0)
926#define bfin_write_CAN1_MB10_ID0(val) bfin_write16(CAN1_MB10_ID0, val)
927#define bfin_read_CAN1_MB10_ID1() bfin_read16(CAN1_MB10_ID1)
928#define bfin_write_CAN1_MB10_ID1(val) bfin_write16(CAN1_MB10_ID1, val)
929#define bfin_read_CAN1_MB11_DATA0() bfin_read16(CAN1_MB11_DATA0)
930#define bfin_write_CAN1_MB11_DATA0(val) bfin_write16(CAN1_MB11_DATA0, val)
931#define bfin_read_CAN1_MB11_DATA1() bfin_read16(CAN1_MB11_DATA1)
932#define bfin_write_CAN1_MB11_DATA1(val) bfin_write16(CAN1_MB11_DATA1, val)
933#define bfin_read_CAN1_MB11_DATA2() bfin_read16(CAN1_MB11_DATA2)
934#define bfin_write_CAN1_MB11_DATA2(val) bfin_write16(CAN1_MB11_DATA2, val)
935#define bfin_read_CAN1_MB11_DATA3() bfin_read16(CAN1_MB11_DATA3)
936#define bfin_write_CAN1_MB11_DATA3(val) bfin_write16(CAN1_MB11_DATA3, val)
937#define bfin_read_CAN1_MB11_LENGTH() bfin_read16(CAN1_MB11_LENGTH)
938#define bfin_write_CAN1_MB11_LENGTH(val) bfin_write16(CAN1_MB11_LENGTH, val)
939#define bfin_read_CAN1_MB11_TIMESTAMP() bfin_read16(CAN1_MB11_TIMESTAMP)
940#define bfin_write_CAN1_MB11_TIMESTAMP(val) bfin_write16(CAN1_MB11_TIMESTAMP, val)
941#define bfin_read_CAN1_MB11_ID0() bfin_read16(CAN1_MB11_ID0)
942#define bfin_write_CAN1_MB11_ID0(val) bfin_write16(CAN1_MB11_ID0, val)
943#define bfin_read_CAN1_MB11_ID1() bfin_read16(CAN1_MB11_ID1)
944#define bfin_write_CAN1_MB11_ID1(val) bfin_write16(CAN1_MB11_ID1, val)
945#define bfin_read_CAN1_MB12_DATA0() bfin_read16(CAN1_MB12_DATA0)
946#define bfin_write_CAN1_MB12_DATA0(val) bfin_write16(CAN1_MB12_DATA0, val)
947#define bfin_read_CAN1_MB12_DATA1() bfin_read16(CAN1_MB12_DATA1)
948#define bfin_write_CAN1_MB12_DATA1(val) bfin_write16(CAN1_MB12_DATA1, val)
949#define bfin_read_CAN1_MB12_DATA2() bfin_read16(CAN1_MB12_DATA2)
950#define bfin_write_CAN1_MB12_DATA2(val) bfin_write16(CAN1_MB12_DATA2, val)
951#define bfin_read_CAN1_MB12_DATA3() bfin_read16(CAN1_MB12_DATA3)
952#define bfin_write_CAN1_MB12_DATA3(val) bfin_write16(CAN1_MB12_DATA3, val)
953#define bfin_read_CAN1_MB12_LENGTH() bfin_read16(CAN1_MB12_LENGTH)
954#define bfin_write_CAN1_MB12_LENGTH(val) bfin_write16(CAN1_MB12_LENGTH, val)
955#define bfin_read_CAN1_MB12_TIMESTAMP() bfin_read16(CAN1_MB12_TIMESTAMP)
956#define bfin_write_CAN1_MB12_TIMESTAMP(val) bfin_write16(CAN1_MB12_TIMESTAMP, val)
957#define bfin_read_CAN1_MB12_ID0() bfin_read16(CAN1_MB12_ID0)
958#define bfin_write_CAN1_MB12_ID0(val) bfin_write16(CAN1_MB12_ID0, val)
959#define bfin_read_CAN1_MB12_ID1() bfin_read16(CAN1_MB12_ID1)
960#define bfin_write_CAN1_MB12_ID1(val) bfin_write16(CAN1_MB12_ID1, val)
961#define bfin_read_CAN1_MB13_DATA0() bfin_read16(CAN1_MB13_DATA0)
962#define bfin_write_CAN1_MB13_DATA0(val) bfin_write16(CAN1_MB13_DATA0, val)
963#define bfin_read_CAN1_MB13_DATA1() bfin_read16(CAN1_MB13_DATA1)
964#define bfin_write_CAN1_MB13_DATA1(val) bfin_write16(CAN1_MB13_DATA1, val)
965#define bfin_read_CAN1_MB13_DATA2() bfin_read16(CAN1_MB13_DATA2)
966#define bfin_write_CAN1_MB13_DATA2(val) bfin_write16(CAN1_MB13_DATA2, val)
967#define bfin_read_CAN1_MB13_DATA3() bfin_read16(CAN1_MB13_DATA3)
968#define bfin_write_CAN1_MB13_DATA3(val) bfin_write16(CAN1_MB13_DATA3, val)
969#define bfin_read_CAN1_MB13_LENGTH() bfin_read16(CAN1_MB13_LENGTH)
970#define bfin_write_CAN1_MB13_LENGTH(val) bfin_write16(CAN1_MB13_LENGTH, val)
971#define bfin_read_CAN1_MB13_TIMESTAMP() bfin_read16(CAN1_MB13_TIMESTAMP)
972#define bfin_write_CAN1_MB13_TIMESTAMP(val) bfin_write16(CAN1_MB13_TIMESTAMP, val)
973#define bfin_read_CAN1_MB13_ID0() bfin_read16(CAN1_MB13_ID0)
974#define bfin_write_CAN1_MB13_ID0(val) bfin_write16(CAN1_MB13_ID0, val)
975#define bfin_read_CAN1_MB13_ID1() bfin_read16(CAN1_MB13_ID1)
976#define bfin_write_CAN1_MB13_ID1(val) bfin_write16(CAN1_MB13_ID1, val)
977#define bfin_read_CAN1_MB14_DATA0() bfin_read16(CAN1_MB14_DATA0)
978#define bfin_write_CAN1_MB14_DATA0(val) bfin_write16(CAN1_MB14_DATA0, val)
979#define bfin_read_CAN1_MB14_DATA1() bfin_read16(CAN1_MB14_DATA1)
980#define bfin_write_CAN1_MB14_DATA1(val) bfin_write16(CAN1_MB14_DATA1, val)
981#define bfin_read_CAN1_MB14_DATA2() bfin_read16(CAN1_MB14_DATA2)
982#define bfin_write_CAN1_MB14_DATA2(val) bfin_write16(CAN1_MB14_DATA2, val)
983#define bfin_read_CAN1_MB14_DATA3() bfin_read16(CAN1_MB14_DATA3)
984#define bfin_write_CAN1_MB14_DATA3(val) bfin_write16(CAN1_MB14_DATA3, val)
985#define bfin_read_CAN1_MB14_LENGTH() bfin_read16(CAN1_MB14_LENGTH)
986#define bfin_write_CAN1_MB14_LENGTH(val) bfin_write16(CAN1_MB14_LENGTH, val)
987#define bfin_read_CAN1_MB14_TIMESTAMP() bfin_read16(CAN1_MB14_TIMESTAMP)
988#define bfin_write_CAN1_MB14_TIMESTAMP(val) bfin_write16(CAN1_MB14_TIMESTAMP, val)
989#define bfin_read_CAN1_MB14_ID0() bfin_read16(CAN1_MB14_ID0)
990#define bfin_write_CAN1_MB14_ID0(val) bfin_write16(CAN1_MB14_ID0, val)
991#define bfin_read_CAN1_MB14_ID1() bfin_read16(CAN1_MB14_ID1)
992#define bfin_write_CAN1_MB14_ID1(val) bfin_write16(CAN1_MB14_ID1, val)
993#define bfin_read_CAN1_MB15_DATA0() bfin_read16(CAN1_MB15_DATA0)
994#define bfin_write_CAN1_MB15_DATA0(val) bfin_write16(CAN1_MB15_DATA0, val)
995#define bfin_read_CAN1_MB15_DATA1() bfin_read16(CAN1_MB15_DATA1)
996#define bfin_write_CAN1_MB15_DATA1(val) bfin_write16(CAN1_MB15_DATA1, val)
997#define bfin_read_CAN1_MB15_DATA2() bfin_read16(CAN1_MB15_DATA2)
998#define bfin_write_CAN1_MB15_DATA2(val) bfin_write16(CAN1_MB15_DATA2, val)
999#define bfin_read_CAN1_MB15_DATA3() bfin_read16(CAN1_MB15_DATA3)
1000#define bfin_write_CAN1_MB15_DATA3(val) bfin_write16(CAN1_MB15_DATA3, val)
1001#define bfin_read_CAN1_MB15_LENGTH() bfin_read16(CAN1_MB15_LENGTH)
1002#define bfin_write_CAN1_MB15_LENGTH(val) bfin_write16(CAN1_MB15_LENGTH, val)
1003#define bfin_read_CAN1_MB15_TIMESTAMP() bfin_read16(CAN1_MB15_TIMESTAMP)
1004#define bfin_write_CAN1_MB15_TIMESTAMP(val) bfin_write16(CAN1_MB15_TIMESTAMP, val)
1005#define bfin_read_CAN1_MB15_ID0() bfin_read16(CAN1_MB15_ID0)
1006#define bfin_write_CAN1_MB15_ID0(val) bfin_write16(CAN1_MB15_ID0, val)
1007#define bfin_read_CAN1_MB15_ID1() bfin_read16(CAN1_MB15_ID1)
1008#define bfin_write_CAN1_MB15_ID1(val) bfin_write16(CAN1_MB15_ID1, val)
1009
1010/* CAN Controller 1 Mailbox Data Registers */
1011
1012#define bfin_read_CAN1_MB16_DATA0() bfin_read16(CAN1_MB16_DATA0)
1013#define bfin_write_CAN1_MB16_DATA0(val) bfin_write16(CAN1_MB16_DATA0, val)
1014#define bfin_read_CAN1_MB16_DATA1() bfin_read16(CAN1_MB16_DATA1)
1015#define bfin_write_CAN1_MB16_DATA1(val) bfin_write16(CAN1_MB16_DATA1, val)
1016#define bfin_read_CAN1_MB16_DATA2() bfin_read16(CAN1_MB16_DATA2)
1017#define bfin_write_CAN1_MB16_DATA2(val) bfin_write16(CAN1_MB16_DATA2, val)
1018#define bfin_read_CAN1_MB16_DATA3() bfin_read16(CAN1_MB16_DATA3)
1019#define bfin_write_CAN1_MB16_DATA3(val) bfin_write16(CAN1_MB16_DATA3, val)
1020#define bfin_read_CAN1_MB16_LENGTH() bfin_read16(CAN1_MB16_LENGTH)
1021#define bfin_write_CAN1_MB16_LENGTH(val) bfin_write16(CAN1_MB16_LENGTH, val)
1022#define bfin_read_CAN1_MB16_TIMESTAMP() bfin_read16(CAN1_MB16_TIMESTAMP)
1023#define bfin_write_CAN1_MB16_TIMESTAMP(val) bfin_write16(CAN1_MB16_TIMESTAMP, val)
1024#define bfin_read_CAN1_MB16_ID0() bfin_read16(CAN1_MB16_ID0)
1025#define bfin_write_CAN1_MB16_ID0(val) bfin_write16(CAN1_MB16_ID0, val)
1026#define bfin_read_CAN1_MB16_ID1() bfin_read16(CAN1_MB16_ID1)
1027#define bfin_write_CAN1_MB16_ID1(val) bfin_write16(CAN1_MB16_ID1, val)
1028#define bfin_read_CAN1_MB17_DATA0() bfin_read16(CAN1_MB17_DATA0)
1029#define bfin_write_CAN1_MB17_DATA0(val) bfin_write16(CAN1_MB17_DATA0, val)
1030#define bfin_read_CAN1_MB17_DATA1() bfin_read16(CAN1_MB17_DATA1)
1031#define bfin_write_CAN1_MB17_DATA1(val) bfin_write16(CAN1_MB17_DATA1, val)
1032#define bfin_read_CAN1_MB17_DATA2() bfin_read16(CAN1_MB17_DATA2)
1033#define bfin_write_CAN1_MB17_DATA2(val) bfin_write16(CAN1_MB17_DATA2, val)
1034#define bfin_read_CAN1_MB17_DATA3() bfin_read16(CAN1_MB17_DATA3)
1035#define bfin_write_CAN1_MB17_DATA3(val) bfin_write16(CAN1_MB17_DATA3, val)
1036#define bfin_read_CAN1_MB17_LENGTH() bfin_read16(CAN1_MB17_LENGTH)
1037#define bfin_write_CAN1_MB17_LENGTH(val) bfin_write16(CAN1_MB17_LENGTH, val)
1038#define bfin_read_CAN1_MB17_TIMESTAMP() bfin_read16(CAN1_MB17_TIMESTAMP)
1039#define bfin_write_CAN1_MB17_TIMESTAMP(val) bfin_write16(CAN1_MB17_TIMESTAMP, val)
1040#define bfin_read_CAN1_MB17_ID0() bfin_read16(CAN1_MB17_ID0)
1041#define bfin_write_CAN1_MB17_ID0(val) bfin_write16(CAN1_MB17_ID0, val)
1042#define bfin_read_CAN1_MB17_ID1() bfin_read16(CAN1_MB17_ID1)
1043#define bfin_write_CAN1_MB17_ID1(val) bfin_write16(CAN1_MB17_ID1, val)
1044#define bfin_read_CAN1_MB18_DATA0() bfin_read16(CAN1_MB18_DATA0)
1045#define bfin_write_CAN1_MB18_DATA0(val) bfin_write16(CAN1_MB18_DATA0, val)
1046#define bfin_read_CAN1_MB18_DATA1() bfin_read16(CAN1_MB18_DATA1)
1047#define bfin_write_CAN1_MB18_DATA1(val) bfin_write16(CAN1_MB18_DATA1, val)
1048#define bfin_read_CAN1_MB18_DATA2() bfin_read16(CAN1_MB18_DATA2)
1049#define bfin_write_CAN1_MB18_DATA2(val) bfin_write16(CAN1_MB18_DATA2, val)
1050#define bfin_read_CAN1_MB18_DATA3() bfin_read16(CAN1_MB18_DATA3)
1051#define bfin_write_CAN1_MB18_DATA3(val) bfin_write16(CAN1_MB18_DATA3, val)
1052#define bfin_read_CAN1_MB18_LENGTH() bfin_read16(CAN1_MB18_LENGTH)
1053#define bfin_write_CAN1_MB18_LENGTH(val) bfin_write16(CAN1_MB18_LENGTH, val)
1054#define bfin_read_CAN1_MB18_TIMESTAMP() bfin_read16(CAN1_MB18_TIMESTAMP)
1055#define bfin_write_CAN1_MB18_TIMESTAMP(val) bfin_write16(CAN1_MB18_TIMESTAMP, val)
1056#define bfin_read_CAN1_MB18_ID0() bfin_read16(CAN1_MB18_ID0)
1057#define bfin_write_CAN1_MB18_ID0(val) bfin_write16(CAN1_MB18_ID0, val)
1058#define bfin_read_CAN1_MB18_ID1() bfin_read16(CAN1_MB18_ID1)
1059#define bfin_write_CAN1_MB18_ID1(val) bfin_write16(CAN1_MB18_ID1, val)
1060#define bfin_read_CAN1_MB19_DATA0() bfin_read16(CAN1_MB19_DATA0)
1061#define bfin_write_CAN1_MB19_DATA0(val) bfin_write16(CAN1_MB19_DATA0, val)
1062#define bfin_read_CAN1_MB19_DATA1() bfin_read16(CAN1_MB19_DATA1)
1063#define bfin_write_CAN1_MB19_DATA1(val) bfin_write16(CAN1_MB19_DATA1, val)
1064#define bfin_read_CAN1_MB19_DATA2() bfin_read16(CAN1_MB19_DATA2)
1065#define bfin_write_CAN1_MB19_DATA2(val) bfin_write16(CAN1_MB19_DATA2, val)
1066#define bfin_read_CAN1_MB19_DATA3() bfin_read16(CAN1_MB19_DATA3)
1067#define bfin_write_CAN1_MB19_DATA3(val) bfin_write16(CAN1_MB19_DATA3, val)
1068#define bfin_read_CAN1_MB19_LENGTH() bfin_read16(CAN1_MB19_LENGTH)
1069#define bfin_write_CAN1_MB19_LENGTH(val) bfin_write16(CAN1_MB19_LENGTH, val)
1070#define bfin_read_CAN1_MB19_TIMESTAMP() bfin_read16(CAN1_MB19_TIMESTAMP)
1071#define bfin_write_CAN1_MB19_TIMESTAMP(val) bfin_write16(CAN1_MB19_TIMESTAMP, val)
1072#define bfin_read_CAN1_MB19_ID0() bfin_read16(CAN1_MB19_ID0)
1073#define bfin_write_CAN1_MB19_ID0(val) bfin_write16(CAN1_MB19_ID0, val)
1074#define bfin_read_CAN1_MB19_ID1() bfin_read16(CAN1_MB19_ID1)
1075#define bfin_write_CAN1_MB19_ID1(val) bfin_write16(CAN1_MB19_ID1, val)
1076#define bfin_read_CAN1_MB20_DATA0() bfin_read16(CAN1_MB20_DATA0)
1077#define bfin_write_CAN1_MB20_DATA0(val) bfin_write16(CAN1_MB20_DATA0, val)
1078#define bfin_read_CAN1_MB20_DATA1() bfin_read16(CAN1_MB20_DATA1)
1079#define bfin_write_CAN1_MB20_DATA1(val) bfin_write16(CAN1_MB20_DATA1, val)
1080#define bfin_read_CAN1_MB20_DATA2() bfin_read16(CAN1_MB20_DATA2)
1081#define bfin_write_CAN1_MB20_DATA2(val) bfin_write16(CAN1_MB20_DATA2, val)
1082#define bfin_read_CAN1_MB20_DATA3() bfin_read16(CAN1_MB20_DATA3)
1083#define bfin_write_CAN1_MB20_DATA3(val) bfin_write16(CAN1_MB20_DATA3, val)
1084#define bfin_read_CAN1_MB20_LENGTH() bfin_read16(CAN1_MB20_LENGTH)
1085#define bfin_write_CAN1_MB20_LENGTH(val) bfin_write16(CAN1_MB20_LENGTH, val)
1086#define bfin_read_CAN1_MB20_TIMESTAMP() bfin_read16(CAN1_MB20_TIMESTAMP)
1087#define bfin_write_CAN1_MB20_TIMESTAMP(val) bfin_write16(CAN1_MB20_TIMESTAMP, val)
1088#define bfin_read_CAN1_MB20_ID0() bfin_read16(CAN1_MB20_ID0)
1089#define bfin_write_CAN1_MB20_ID0(val) bfin_write16(CAN1_MB20_ID0, val)
1090#define bfin_read_CAN1_MB20_ID1() bfin_read16(CAN1_MB20_ID1)
1091#define bfin_write_CAN1_MB20_ID1(val) bfin_write16(CAN1_MB20_ID1, val)
1092#define bfin_read_CAN1_MB21_DATA0() bfin_read16(CAN1_MB21_DATA0)
1093#define bfin_write_CAN1_MB21_DATA0(val) bfin_write16(CAN1_MB21_DATA0, val)
1094#define bfin_read_CAN1_MB21_DATA1() bfin_read16(CAN1_MB21_DATA1)
1095#define bfin_write_CAN1_MB21_DATA1(val) bfin_write16(CAN1_MB21_DATA1, val)
1096#define bfin_read_CAN1_MB21_DATA2() bfin_read16(CAN1_MB21_DATA2)
1097#define bfin_write_CAN1_MB21_DATA2(val) bfin_write16(CAN1_MB21_DATA2, val)
1098#define bfin_read_CAN1_MB21_DATA3() bfin_read16(CAN1_MB21_DATA3)
1099#define bfin_write_CAN1_MB21_DATA3(val) bfin_write16(CAN1_MB21_DATA3, val)
1100#define bfin_read_CAN1_MB21_LENGTH() bfin_read16(CAN1_MB21_LENGTH)
1101#define bfin_write_CAN1_MB21_LENGTH(val) bfin_write16(CAN1_MB21_LENGTH, val)
1102#define bfin_read_CAN1_MB21_TIMESTAMP() bfin_read16(CAN1_MB21_TIMESTAMP)
1103#define bfin_write_CAN1_MB21_TIMESTAMP(val) bfin_write16(CAN1_MB21_TIMESTAMP, val)
1104#define bfin_read_CAN1_MB21_ID0() bfin_read16(CAN1_MB21_ID0)
1105#define bfin_write_CAN1_MB21_ID0(val) bfin_write16(CAN1_MB21_ID0, val)
1106#define bfin_read_CAN1_MB21_ID1() bfin_read16(CAN1_MB21_ID1)
1107#define bfin_write_CAN1_MB21_ID1(val) bfin_write16(CAN1_MB21_ID1, val)
1108#define bfin_read_CAN1_MB22_DATA0() bfin_read16(CAN1_MB22_DATA0)
1109#define bfin_write_CAN1_MB22_DATA0(val) bfin_write16(CAN1_MB22_DATA0, val)
1110#define bfin_read_CAN1_MB22_DATA1() bfin_read16(CAN1_MB22_DATA1)
1111#define bfin_write_CAN1_MB22_DATA1(val) bfin_write16(CAN1_MB22_DATA1, val)
1112#define bfin_read_CAN1_MB22_DATA2() bfin_read16(CAN1_MB22_DATA2)
1113#define bfin_write_CAN1_MB22_DATA2(val) bfin_write16(CAN1_MB22_DATA2, val)
1114#define bfin_read_CAN1_MB22_DATA3() bfin_read16(CAN1_MB22_DATA3)
1115#define bfin_write_CAN1_MB22_DATA3(val) bfin_write16(CAN1_MB22_DATA3, val)
1116#define bfin_read_CAN1_MB22_LENGTH() bfin_read16(CAN1_MB22_LENGTH)
1117#define bfin_write_CAN1_MB22_LENGTH(val) bfin_write16(CAN1_MB22_LENGTH, val)
1118#define bfin_read_CAN1_MB22_TIMESTAMP() bfin_read16(CAN1_MB22_TIMESTAMP)
1119#define bfin_write_CAN1_MB22_TIMESTAMP(val) bfin_write16(CAN1_MB22_TIMESTAMP, val)
1120#define bfin_read_CAN1_MB22_ID0() bfin_read16(CAN1_MB22_ID0)
1121#define bfin_write_CAN1_MB22_ID0(val) bfin_write16(CAN1_MB22_ID0, val)
1122#define bfin_read_CAN1_MB22_ID1() bfin_read16(CAN1_MB22_ID1)
1123#define bfin_write_CAN1_MB22_ID1(val) bfin_write16(CAN1_MB22_ID1, val)
1124#define bfin_read_CAN1_MB23_DATA0() bfin_read16(CAN1_MB23_DATA0)
1125#define bfin_write_CAN1_MB23_DATA0(val) bfin_write16(CAN1_MB23_DATA0, val)
1126#define bfin_read_CAN1_MB23_DATA1() bfin_read16(CAN1_MB23_DATA1)
1127#define bfin_write_CAN1_MB23_DATA1(val) bfin_write16(CAN1_MB23_DATA1, val)
1128#define bfin_read_CAN1_MB23_DATA2() bfin_read16(CAN1_MB23_DATA2)
1129#define bfin_write_CAN1_MB23_DATA2(val) bfin_write16(CAN1_MB23_DATA2, val)
1130#define bfin_read_CAN1_MB23_DATA3() bfin_read16(CAN1_MB23_DATA3)
1131#define bfin_write_CAN1_MB23_DATA3(val) bfin_write16(CAN1_MB23_DATA3, val)
1132#define bfin_read_CAN1_MB23_LENGTH() bfin_read16(CAN1_MB23_LENGTH)
1133#define bfin_write_CAN1_MB23_LENGTH(val) bfin_write16(CAN1_MB23_LENGTH, val)
1134#define bfin_read_CAN1_MB23_TIMESTAMP() bfin_read16(CAN1_MB23_TIMESTAMP)
1135#define bfin_write_CAN1_MB23_TIMESTAMP(val) bfin_write16(CAN1_MB23_TIMESTAMP, val)
1136#define bfin_read_CAN1_MB23_ID0() bfin_read16(CAN1_MB23_ID0)
1137#define bfin_write_CAN1_MB23_ID0(val) bfin_write16(CAN1_MB23_ID0, val)
1138#define bfin_read_CAN1_MB23_ID1() bfin_read16(CAN1_MB23_ID1)
1139#define bfin_write_CAN1_MB23_ID1(val) bfin_write16(CAN1_MB23_ID1, val)
1140#define bfin_read_CAN1_MB24_DATA0() bfin_read16(CAN1_MB24_DATA0)
1141#define bfin_write_CAN1_MB24_DATA0(val) bfin_write16(CAN1_MB24_DATA0, val)
1142#define bfin_read_CAN1_MB24_DATA1() bfin_read16(CAN1_MB24_DATA1)
1143#define bfin_write_CAN1_MB24_DATA1(val) bfin_write16(CAN1_MB24_DATA1, val)
1144#define bfin_read_CAN1_MB24_DATA2() bfin_read16(CAN1_MB24_DATA2)
1145#define bfin_write_CAN1_MB24_DATA2(val) bfin_write16(CAN1_MB24_DATA2, val)
1146#define bfin_read_CAN1_MB24_DATA3() bfin_read16(CAN1_MB24_DATA3)
1147#define bfin_write_CAN1_MB24_DATA3(val) bfin_write16(CAN1_MB24_DATA3, val)
1148#define bfin_read_CAN1_MB24_LENGTH() bfin_read16(CAN1_MB24_LENGTH)
1149#define bfin_write_CAN1_MB24_LENGTH(val) bfin_write16(CAN1_MB24_LENGTH, val)
1150#define bfin_read_CAN1_MB24_TIMESTAMP() bfin_read16(CAN1_MB24_TIMESTAMP)
1151#define bfin_write_CAN1_MB24_TIMESTAMP(val) bfin_write16(CAN1_MB24_TIMESTAMP, val)
1152#define bfin_read_CAN1_MB24_ID0() bfin_read16(CAN1_MB24_ID0)
1153#define bfin_write_CAN1_MB24_ID0(val) bfin_write16(CAN1_MB24_ID0, val)
1154#define bfin_read_CAN1_MB24_ID1() bfin_read16(CAN1_MB24_ID1)
1155#define bfin_write_CAN1_MB24_ID1(val) bfin_write16(CAN1_MB24_ID1, val)
1156#define bfin_read_CAN1_MB25_DATA0() bfin_read16(CAN1_MB25_DATA0)
1157#define bfin_write_CAN1_MB25_DATA0(val) bfin_write16(CAN1_MB25_DATA0, val)
1158#define bfin_read_CAN1_MB25_DATA1() bfin_read16(CAN1_MB25_DATA1)
1159#define bfin_write_CAN1_MB25_DATA1(val) bfin_write16(CAN1_MB25_DATA1, val)
1160#define bfin_read_CAN1_MB25_DATA2() bfin_read16(CAN1_MB25_DATA2)
1161#define bfin_write_CAN1_MB25_DATA2(val) bfin_write16(CAN1_MB25_DATA2, val)
1162#define bfin_read_CAN1_MB25_DATA3() bfin_read16(CAN1_MB25_DATA3)
1163#define bfin_write_CAN1_MB25_DATA3(val) bfin_write16(CAN1_MB25_DATA3, val)
1164#define bfin_read_CAN1_MB25_LENGTH() bfin_read16(CAN1_MB25_LENGTH)
1165#define bfin_write_CAN1_MB25_LENGTH(val) bfin_write16(CAN1_MB25_LENGTH, val)
1166#define bfin_read_CAN1_MB25_TIMESTAMP() bfin_read16(CAN1_MB25_TIMESTAMP)
1167#define bfin_write_CAN1_MB25_TIMESTAMP(val) bfin_write16(CAN1_MB25_TIMESTAMP, val)
1168#define bfin_read_CAN1_MB25_ID0() bfin_read16(CAN1_MB25_ID0)
1169#define bfin_write_CAN1_MB25_ID0(val) bfin_write16(CAN1_MB25_ID0, val)
1170#define bfin_read_CAN1_MB25_ID1() bfin_read16(CAN1_MB25_ID1)
1171#define bfin_write_CAN1_MB25_ID1(val) bfin_write16(CAN1_MB25_ID1, val)
1172#define bfin_read_CAN1_MB26_DATA0() bfin_read16(CAN1_MB26_DATA0)
1173#define bfin_write_CAN1_MB26_DATA0(val) bfin_write16(CAN1_MB26_DATA0, val)
1174#define bfin_read_CAN1_MB26_DATA1() bfin_read16(CAN1_MB26_DATA1)
1175#define bfin_write_CAN1_MB26_DATA1(val) bfin_write16(CAN1_MB26_DATA1, val)
1176#define bfin_read_CAN1_MB26_DATA2() bfin_read16(CAN1_MB26_DATA2)
1177#define bfin_write_CAN1_MB26_DATA2(val) bfin_write16(CAN1_MB26_DATA2, val)
1178#define bfin_read_CAN1_MB26_DATA3() bfin_read16(CAN1_MB26_DATA3)
1179#define bfin_write_CAN1_MB26_DATA3(val) bfin_write16(CAN1_MB26_DATA3, val)
1180#define bfin_read_CAN1_MB26_LENGTH() bfin_read16(CAN1_MB26_LENGTH)
1181#define bfin_write_CAN1_MB26_LENGTH(val) bfin_write16(CAN1_MB26_LENGTH, val)
1182#define bfin_read_CAN1_MB26_TIMESTAMP() bfin_read16(CAN1_MB26_TIMESTAMP)
1183#define bfin_write_CAN1_MB26_TIMESTAMP(val) bfin_write16(CAN1_MB26_TIMESTAMP, val)
1184#define bfin_read_CAN1_MB26_ID0() bfin_read16(CAN1_MB26_ID0)
1185#define bfin_write_CAN1_MB26_ID0(val) bfin_write16(CAN1_MB26_ID0, val)
1186#define bfin_read_CAN1_MB26_ID1() bfin_read16(CAN1_MB26_ID1)
1187#define bfin_write_CAN1_MB26_ID1(val) bfin_write16(CAN1_MB26_ID1, val)
1188#define bfin_read_CAN1_MB27_DATA0() bfin_read16(CAN1_MB27_DATA0)
1189#define bfin_write_CAN1_MB27_DATA0(val) bfin_write16(CAN1_MB27_DATA0, val)
1190#define bfin_read_CAN1_MB27_DATA1() bfin_read16(CAN1_MB27_DATA1)
1191#define bfin_write_CAN1_MB27_DATA1(val) bfin_write16(CAN1_MB27_DATA1, val)
1192#define bfin_read_CAN1_MB27_DATA2() bfin_read16(CAN1_MB27_DATA2)
1193#define bfin_write_CAN1_MB27_DATA2(val) bfin_write16(CAN1_MB27_DATA2, val)
1194#define bfin_read_CAN1_MB27_DATA3() bfin_read16(CAN1_MB27_DATA3)
1195#define bfin_write_CAN1_MB27_DATA3(val) bfin_write16(CAN1_MB27_DATA3, val)
1196#define bfin_read_CAN1_MB27_LENGTH() bfin_read16(CAN1_MB27_LENGTH)
1197#define bfin_write_CAN1_MB27_LENGTH(val) bfin_write16(CAN1_MB27_LENGTH, val)
1198#define bfin_read_CAN1_MB27_TIMESTAMP() bfin_read16(CAN1_MB27_TIMESTAMP)
1199#define bfin_write_CAN1_MB27_TIMESTAMP(val) bfin_write16(CAN1_MB27_TIMESTAMP, val)
1200#define bfin_read_CAN1_MB27_ID0() bfin_read16(CAN1_MB27_ID0)
1201#define bfin_write_CAN1_MB27_ID0(val) bfin_write16(CAN1_MB27_ID0, val)
1202#define bfin_read_CAN1_MB27_ID1() bfin_read16(CAN1_MB27_ID1)
1203#define bfin_write_CAN1_MB27_ID1(val) bfin_write16(CAN1_MB27_ID1, val)
1204#define bfin_read_CAN1_MB28_DATA0() bfin_read16(CAN1_MB28_DATA0)
1205#define bfin_write_CAN1_MB28_DATA0(val) bfin_write16(CAN1_MB28_DATA0, val)
1206#define bfin_read_CAN1_MB28_DATA1() bfin_read16(CAN1_MB28_DATA1)
1207#define bfin_write_CAN1_MB28_DATA1(val) bfin_write16(CAN1_MB28_DATA1, val)
1208#define bfin_read_CAN1_MB28_DATA2() bfin_read16(CAN1_MB28_DATA2)
1209#define bfin_write_CAN1_MB28_DATA2(val) bfin_write16(CAN1_MB28_DATA2, val)
1210#define bfin_read_CAN1_MB28_DATA3() bfin_read16(CAN1_MB28_DATA3)
1211#define bfin_write_CAN1_MB28_DATA3(val) bfin_write16(CAN1_MB28_DATA3, val)
1212#define bfin_read_CAN1_MB28_LENGTH() bfin_read16(CAN1_MB28_LENGTH)
1213#define bfin_write_CAN1_MB28_LENGTH(val) bfin_write16(CAN1_MB28_LENGTH, val)
1214#define bfin_read_CAN1_MB28_TIMESTAMP() bfin_read16(CAN1_MB28_TIMESTAMP)
1215#define bfin_write_CAN1_MB28_TIMESTAMP(val) bfin_write16(CAN1_MB28_TIMESTAMP, val)
1216#define bfin_read_CAN1_MB28_ID0() bfin_read16(CAN1_MB28_ID0)
1217#define bfin_write_CAN1_MB28_ID0(val) bfin_write16(CAN1_MB28_ID0, val)
1218#define bfin_read_CAN1_MB28_ID1() bfin_read16(CAN1_MB28_ID1)
1219#define bfin_write_CAN1_MB28_ID1(val) bfin_write16(CAN1_MB28_ID1, val)
1220#define bfin_read_CAN1_MB29_DATA0() bfin_read16(CAN1_MB29_DATA0)
1221#define bfin_write_CAN1_MB29_DATA0(val) bfin_write16(CAN1_MB29_DATA0, val)
1222#define bfin_read_CAN1_MB29_DATA1() bfin_read16(CAN1_MB29_DATA1)
1223#define bfin_write_CAN1_MB29_DATA1(val) bfin_write16(CAN1_MB29_DATA1, val)
1224#define bfin_read_CAN1_MB29_DATA2() bfin_read16(CAN1_MB29_DATA2)
1225#define bfin_write_CAN1_MB29_DATA2(val) bfin_write16(CAN1_MB29_DATA2, val)
1226#define bfin_read_CAN1_MB29_DATA3() bfin_read16(CAN1_MB29_DATA3)
1227#define bfin_write_CAN1_MB29_DATA3(val) bfin_write16(CAN1_MB29_DATA3, val)
1228#define bfin_read_CAN1_MB29_LENGTH() bfin_read16(CAN1_MB29_LENGTH)
1229#define bfin_write_CAN1_MB29_LENGTH(val) bfin_write16(CAN1_MB29_LENGTH, val)
1230#define bfin_read_CAN1_MB29_TIMESTAMP() bfin_read16(CAN1_MB29_TIMESTAMP)
1231#define bfin_write_CAN1_MB29_TIMESTAMP(val) bfin_write16(CAN1_MB29_TIMESTAMP, val)
1232#define bfin_read_CAN1_MB29_ID0() bfin_read16(CAN1_MB29_ID0)
1233#define bfin_write_CAN1_MB29_ID0(val) bfin_write16(CAN1_MB29_ID0, val)
1234#define bfin_read_CAN1_MB29_ID1() bfin_read16(CAN1_MB29_ID1)
1235#define bfin_write_CAN1_MB29_ID1(val) bfin_write16(CAN1_MB29_ID1, val)
1236#define bfin_read_CAN1_MB30_DATA0() bfin_read16(CAN1_MB30_DATA0)
1237#define bfin_write_CAN1_MB30_DATA0(val) bfin_write16(CAN1_MB30_DATA0, val)
1238#define bfin_read_CAN1_MB30_DATA1() bfin_read16(CAN1_MB30_DATA1)
1239#define bfin_write_CAN1_MB30_DATA1(val) bfin_write16(CAN1_MB30_DATA1, val)
1240#define bfin_read_CAN1_MB30_DATA2() bfin_read16(CAN1_MB30_DATA2)
1241#define bfin_write_CAN1_MB30_DATA2(val) bfin_write16(CAN1_MB30_DATA2, val)
1242#define bfin_read_CAN1_MB30_DATA3() bfin_read16(CAN1_MB30_DATA3)
1243#define bfin_write_CAN1_MB30_DATA3(val) bfin_write16(CAN1_MB30_DATA3, val)
1244#define bfin_read_CAN1_MB30_LENGTH() bfin_read16(CAN1_MB30_LENGTH)
1245#define bfin_write_CAN1_MB30_LENGTH(val) bfin_write16(CAN1_MB30_LENGTH, val)
1246#define bfin_read_CAN1_MB30_TIMESTAMP() bfin_read16(CAN1_MB30_TIMESTAMP)
1247#define bfin_write_CAN1_MB30_TIMESTAMP(val) bfin_write16(CAN1_MB30_TIMESTAMP, val)
1248#define bfin_read_CAN1_MB30_ID0() bfin_read16(CAN1_MB30_ID0)
1249#define bfin_write_CAN1_MB30_ID0(val) bfin_write16(CAN1_MB30_ID0, val)
1250#define bfin_read_CAN1_MB30_ID1() bfin_read16(CAN1_MB30_ID1)
1251#define bfin_write_CAN1_MB30_ID1(val) bfin_write16(CAN1_MB30_ID1, val)
1252#define bfin_read_CAN1_MB31_DATA0() bfin_read16(CAN1_MB31_DATA0)
1253#define bfin_write_CAN1_MB31_DATA0(val) bfin_write16(CAN1_MB31_DATA0, val)
1254#define bfin_read_CAN1_MB31_DATA1() bfin_read16(CAN1_MB31_DATA1)
1255#define bfin_write_CAN1_MB31_DATA1(val) bfin_write16(CAN1_MB31_DATA1, val)
1256#define bfin_read_CAN1_MB31_DATA2() bfin_read16(CAN1_MB31_DATA2)
1257#define bfin_write_CAN1_MB31_DATA2(val) bfin_write16(CAN1_MB31_DATA2, val)
1258#define bfin_read_CAN1_MB31_DATA3() bfin_read16(CAN1_MB31_DATA3)
1259#define bfin_write_CAN1_MB31_DATA3(val) bfin_write16(CAN1_MB31_DATA3, val)
1260#define bfin_read_CAN1_MB31_LENGTH() bfin_read16(CAN1_MB31_LENGTH)
1261#define bfin_write_CAN1_MB31_LENGTH(val) bfin_write16(CAN1_MB31_LENGTH, val)
1262#define bfin_read_CAN1_MB31_TIMESTAMP() bfin_read16(CAN1_MB31_TIMESTAMP)
1263#define bfin_write_CAN1_MB31_TIMESTAMP(val) bfin_write16(CAN1_MB31_TIMESTAMP, val)
1264#define bfin_read_CAN1_MB31_ID0() bfin_read16(CAN1_MB31_ID0)
1265#define bfin_write_CAN1_MB31_ID0(val) bfin_write16(CAN1_MB31_ID0, val)
1266#define bfin_read_CAN1_MB31_ID1() bfin_read16(CAN1_MB31_ID1)
1267#define bfin_write_CAN1_MB31_ID1(val) bfin_write16(CAN1_MB31_ID1, val)
1268
1269/* ATAPI Registers */
1270
1271#define bfin_read_ATAPI_CONTROL() bfin_read16(ATAPI_CONTROL)
1272#define bfin_write_ATAPI_CONTROL(val) bfin_write16(ATAPI_CONTROL, val)
1273#define bfin_read_ATAPI_STATUS() bfin_read16(ATAPI_STATUS)
1274#define bfin_write_ATAPI_STATUS(val) bfin_write16(ATAPI_STATUS, val)
1275#define bfin_read_ATAPI_DEV_ADDR() bfin_read16(ATAPI_DEV_ADDR)
1276#define bfin_write_ATAPI_DEV_ADDR(val) bfin_write16(ATAPI_DEV_ADDR, val)
1277#define bfin_read_ATAPI_DEV_TXBUF() bfin_read16(ATAPI_DEV_TXBUF)
1278#define bfin_write_ATAPI_DEV_TXBUF(val) bfin_write16(ATAPI_DEV_TXBUF, val)
1279#define bfin_read_ATAPI_DEV_RXBUF() bfin_read16(ATAPI_DEV_RXBUF)
1280#define bfin_write_ATAPI_DEV_RXBUF(val) bfin_write16(ATAPI_DEV_RXBUF, val)
1281#define bfin_read_ATAPI_INT_MASK() bfin_read16(ATAPI_INT_MASK)
1282#define bfin_write_ATAPI_INT_MASK(val) bfin_write16(ATAPI_INT_MASK, val)
1283#define bfin_read_ATAPI_INT_STATUS() bfin_read16(ATAPI_INT_STATUS)
1284#define bfin_write_ATAPI_INT_STATUS(val) bfin_write16(ATAPI_INT_STATUS, val)
1285#define bfin_read_ATAPI_XFER_LEN() bfin_read16(ATAPI_XFER_LEN)
1286#define bfin_write_ATAPI_XFER_LEN(val) bfin_write16(ATAPI_XFER_LEN, val)
1287#define bfin_read_ATAPI_LINE_STATUS() bfin_read16(ATAPI_LINE_STATUS)
1288#define bfin_write_ATAPI_LINE_STATUS(val) bfin_write16(ATAPI_LINE_STATUS, val)
1289#define bfin_read_ATAPI_SM_STATE() bfin_read16(ATAPI_SM_STATE)
1290#define bfin_write_ATAPI_SM_STATE(val) bfin_write16(ATAPI_SM_STATE, val)
1291#define bfin_read_ATAPI_TERMINATE() bfin_read16(ATAPI_TERMINATE)
1292#define bfin_write_ATAPI_TERMINATE(val) bfin_write16(ATAPI_TERMINATE, val)
1293#define bfin_read_ATAPI_PIO_TFRCNT() bfin_read16(ATAPI_PIO_TFRCNT)
1294#define bfin_write_ATAPI_PIO_TFRCNT(val) bfin_write16(ATAPI_PIO_TFRCNT, val)
1295#define bfin_read_ATAPI_DMA_TFRCNT() bfin_read16(ATAPI_DMA_TFRCNT)
1296#define bfin_write_ATAPI_DMA_TFRCNT(val) bfin_write16(ATAPI_DMA_TFRCNT, val)
1297#define bfin_read_ATAPI_UMAIN_TFRCNT() bfin_read16(ATAPI_UMAIN_TFRCNT)
1298#define bfin_write_ATAPI_UMAIN_TFRCNT(val) bfin_write16(ATAPI_UMAIN_TFRCNT, val)
1299#define bfin_read_ATAPI_UDMAOUT_TFRCNT() bfin_read16(ATAPI_UDMAOUT_TFRCNT)
1300#define bfin_write_ATAPI_UDMAOUT_TFRCNT(val) bfin_write16(ATAPI_UDMAOUT_TFRCNT, val)
1301#define bfin_read_ATAPI_REG_TIM_0() bfin_read16(ATAPI_REG_TIM_0)
1302#define bfin_write_ATAPI_REG_TIM_0(val) bfin_write16(ATAPI_REG_TIM_0, val)
1303#define bfin_read_ATAPI_PIO_TIM_0() bfin_read16(ATAPI_PIO_TIM_0)
1304#define bfin_write_ATAPI_PIO_TIM_0(val) bfin_write16(ATAPI_PIO_TIM_0, val)
1305#define bfin_read_ATAPI_PIO_TIM_1() bfin_read16(ATAPI_PIO_TIM_1)
1306#define bfin_write_ATAPI_PIO_TIM_1(val) bfin_write16(ATAPI_PIO_TIM_1, val)
1307#define bfin_read_ATAPI_MULTI_TIM_0() bfin_read16(ATAPI_MULTI_TIM_0)
1308#define bfin_write_ATAPI_MULTI_TIM_0(val) bfin_write16(ATAPI_MULTI_TIM_0, val)
1309#define bfin_read_ATAPI_MULTI_TIM_1() bfin_read16(ATAPI_MULTI_TIM_1)
1310#define bfin_write_ATAPI_MULTI_TIM_1(val) bfin_write16(ATAPI_MULTI_TIM_1, val)
1311#define bfin_read_ATAPI_MULTI_TIM_2() bfin_read16(ATAPI_MULTI_TIM_2)
1312#define bfin_write_ATAPI_MULTI_TIM_2(val) bfin_write16(ATAPI_MULTI_TIM_2, val)
1313#define bfin_read_ATAPI_ULTRA_TIM_0() bfin_read16(ATAPI_ULTRA_TIM_0)
1314#define bfin_write_ATAPI_ULTRA_TIM_0(val) bfin_write16(ATAPI_ULTRA_TIM_0, val)
1315#define bfin_read_ATAPI_ULTRA_TIM_1() bfin_read16(ATAPI_ULTRA_TIM_1)
1316#define bfin_write_ATAPI_ULTRA_TIM_1(val) bfin_write16(ATAPI_ULTRA_TIM_1, val)
1317#define bfin_read_ATAPI_ULTRA_TIM_2() bfin_read16(ATAPI_ULTRA_TIM_2)
1318#define bfin_write_ATAPI_ULTRA_TIM_2(val) bfin_write16(ATAPI_ULTRA_TIM_2, val)
1319#define bfin_read_ATAPI_ULTRA_TIM_3() bfin_read16(ATAPI_ULTRA_TIM_3)
1320#define bfin_write_ATAPI_ULTRA_TIM_3(val) bfin_write16(ATAPI_ULTRA_TIM_3, val)
1321
1322/* SDH Registers */
1323
1324#define bfin_read_SDH_PWR_CTL() bfin_read16(SDH_PWR_CTL)
1325#define bfin_write_SDH_PWR_CTL(val) bfin_write16(SDH_PWR_CTL, val)
1326#define bfin_read_SDH_CLK_CTL() bfin_read16(SDH_CLK_CTL)
1327#define bfin_write_SDH_CLK_CTL(val) bfin_write16(SDH_CLK_CTL, val)
1328#define bfin_read_SDH_ARGUMENT() bfin_read32(SDH_ARGUMENT)
1329#define bfin_write_SDH_ARGUMENT(val) bfin_write32(SDH_ARGUMENT, val)
1330#define bfin_read_SDH_COMMAND() bfin_read16(SDH_COMMAND)
1331#define bfin_write_SDH_COMMAND(val) bfin_write16(SDH_COMMAND, val)
1332#define bfin_read_SDH_RESP_CMD() bfin_read16(SDH_RESP_CMD)
1333#define bfin_write_SDH_RESP_CMD(val) bfin_write16(SDH_RESP_CMD, val)
1334#define bfin_read_SDH_RESPONSE0() bfin_read32(SDH_RESPONSE0)
1335#define bfin_write_SDH_RESPONSE0(val) bfin_write32(SDH_RESPONSE0, val)
1336#define bfin_read_SDH_RESPONSE1() bfin_read32(SDH_RESPONSE1)
1337#define bfin_write_SDH_RESPONSE1(val) bfin_write32(SDH_RESPONSE1, val)
1338#define bfin_read_SDH_RESPONSE2() bfin_read32(SDH_RESPONSE2)
1339#define bfin_write_SDH_RESPONSE2(val) bfin_write32(SDH_RESPONSE2, val)
1340#define bfin_read_SDH_RESPONSE3() bfin_read32(SDH_RESPONSE3)
1341#define bfin_write_SDH_RESPONSE3(val) bfin_write32(SDH_RESPONSE3, val)
1342#define bfin_read_SDH_DATA_TIMER() bfin_read32(SDH_DATA_TIMER)
1343#define bfin_write_SDH_DATA_TIMER(val) bfin_write32(SDH_DATA_TIMER, val)
1344#define bfin_read_SDH_DATA_LGTH() bfin_read16(SDH_DATA_LGTH)
1345#define bfin_write_SDH_DATA_LGTH(val) bfin_write16(SDH_DATA_LGTH, val)
1346#define bfin_read_SDH_DATA_CTL() bfin_read16(SDH_DATA_CTL)
1347#define bfin_write_SDH_DATA_CTL(val) bfin_write16(SDH_DATA_CTL, val)
1348#define bfin_read_SDH_DATA_CNT() bfin_read16(SDH_DATA_CNT)
1349#define bfin_write_SDH_DATA_CNT(val) bfin_write16(SDH_DATA_CNT, val)
1350#define bfin_read_SDH_STATUS() bfin_read32(SDH_STATUS)
1351#define bfin_write_SDH_STATUS(val) bfin_write32(SDH_STATUS, val)
1352#define bfin_read_SDH_STATUS_CLR() bfin_read16(SDH_STATUS_CLR)
1353#define bfin_write_SDH_STATUS_CLR(val) bfin_write16(SDH_STATUS_CLR, val)
1354#define bfin_read_SDH_MASK0() bfin_read32(SDH_MASK0)
1355#define bfin_write_SDH_MASK0(val) bfin_write32(SDH_MASK0, val)
1356#define bfin_read_SDH_MASK1() bfin_read32(SDH_MASK1)
1357#define bfin_write_SDH_MASK1(val) bfin_write32(SDH_MASK1, val)
1358#define bfin_read_SDH_FIFO_CNT() bfin_read16(SDH_FIFO_CNT)
1359#define bfin_write_SDH_FIFO_CNT(val) bfin_write16(SDH_FIFO_CNT, val)
1360#define bfin_read_SDH_FIFO() bfin_read32(SDH_FIFO)
1361#define bfin_write_SDH_FIFO(val) bfin_write32(SDH_FIFO, val)
1362#define bfin_read_SDH_E_STATUS() bfin_read16(SDH_E_STATUS)
1363#define bfin_write_SDH_E_STATUS(val) bfin_write16(SDH_E_STATUS, val)
1364#define bfin_read_SDH_E_MASK() bfin_read16(SDH_E_MASK)
1365#define bfin_write_SDH_E_MASK(val) bfin_write16(SDH_E_MASK, val)
1366#define bfin_read_SDH_CFG() bfin_read16(SDH_CFG)
1367#define bfin_write_SDH_CFG(val) bfin_write16(SDH_CFG, val)
1368#define bfin_read_SDH_RD_WAIT_EN() bfin_read16(SDH_RD_WAIT_EN)
1369#define bfin_write_SDH_RD_WAIT_EN(val) bfin_write16(SDH_RD_WAIT_EN, val)
1370#define bfin_read_SDH_PID0() bfin_read16(SDH_PID0)
1371#define bfin_write_SDH_PID0(val) bfin_write16(SDH_PID0, val)
1372#define bfin_read_SDH_PID1() bfin_read16(SDH_PID1)
1373#define bfin_write_SDH_PID1(val) bfin_write16(SDH_PID1, val)
1374#define bfin_read_SDH_PID2() bfin_read16(SDH_PID2)
1375#define bfin_write_SDH_PID2(val) bfin_write16(SDH_PID2, val)
1376#define bfin_read_SDH_PID3() bfin_read16(SDH_PID3)
1377#define bfin_write_SDH_PID3(val) bfin_write16(SDH_PID3, val)
1378#define bfin_read_SDH_PID4() bfin_read16(SDH_PID4)
1379#define bfin_write_SDH_PID4(val) bfin_write16(SDH_PID4, val)
1380#define bfin_read_SDH_PID5() bfin_read16(SDH_PID5)
1381#define bfin_write_SDH_PID5(val) bfin_write16(SDH_PID5, val)
1382#define bfin_read_SDH_PID6() bfin_read16(SDH_PID6)
1383#define bfin_write_SDH_PID6(val) bfin_write16(SDH_PID6, val)
1384#define bfin_read_SDH_PID7() bfin_read16(SDH_PID7)
1385#define bfin_write_SDH_PID7(val) bfin_write16(SDH_PID7, val)
1386
1387/* HOST Port Registers */
1388
1389#define bfin_read_HOST_CONTROL() bfin_read16(HOST_CONTROL)
1390#define bfin_write_HOST_CONTROL(val) bfin_write16(HOST_CONTROL, val)
1391#define bfin_read_HOST_STATUS() bfin_read16(HOST_STATUS)
1392#define bfin_write_HOST_STATUS(val) bfin_write16(HOST_STATUS, val)
1393#define bfin_read_HOST_TIMEOUT() bfin_read16(HOST_TIMEOUT)
1394#define bfin_write_HOST_TIMEOUT(val) bfin_write16(HOST_TIMEOUT, val)
1395
1396/* USB Control Registers */
1397
1398#define bfin_read_USB_FADDR() bfin_read16(USB_FADDR)
1399#define bfin_write_USB_FADDR(val) bfin_write16(USB_FADDR, val)
1400#define bfin_read_USB_POWER() bfin_read16(USB_POWER)
1401#define bfin_write_USB_POWER(val) bfin_write16(USB_POWER, val)
1402#define bfin_read_USB_INTRTX() bfin_read16(USB_INTRTX)
1403#define bfin_write_USB_INTRTX(val) bfin_write16(USB_INTRTX, val)
1404#define bfin_read_USB_INTRRX() bfin_read16(USB_INTRRX)
1405#define bfin_write_USB_INTRRX(val) bfin_write16(USB_INTRRX, val)
1406#define bfin_read_USB_INTRTXE() bfin_read16(USB_INTRTXE)
1407#define bfin_write_USB_INTRTXE(val) bfin_write16(USB_INTRTXE, val)
1408#define bfin_read_USB_INTRRXE() bfin_read16(USB_INTRRXE)
1409#define bfin_write_USB_INTRRXE(val) bfin_write16(USB_INTRRXE, val)
1410#define bfin_read_USB_INTRUSB() bfin_read16(USB_INTRUSB)
1411#define bfin_write_USB_INTRUSB(val) bfin_write16(USB_INTRUSB, val)
1412#define bfin_read_USB_INTRUSBE() bfin_read16(USB_INTRUSBE)
1413#define bfin_write_USB_INTRUSBE(val) bfin_write16(USB_INTRUSBE, val)
1414#define bfin_read_USB_FRAME() bfin_read16(USB_FRAME)
1415#define bfin_write_USB_FRAME(val) bfin_write16(USB_FRAME, val)
1416#define bfin_read_USB_INDEX() bfin_read16(USB_INDEX)
1417#define bfin_write_USB_INDEX(val) bfin_write16(USB_INDEX, val)
1418#define bfin_read_USB_TESTMODE() bfin_read16(USB_TESTMODE)
1419#define bfin_write_USB_TESTMODE(val) bfin_write16(USB_TESTMODE, val)
1420#define bfin_read_USB_GLOBINTR() bfin_read16(USB_GLOBINTR)
1421#define bfin_write_USB_GLOBINTR(val) bfin_write16(USB_GLOBINTR, val)
1422#define bfin_read_USB_GLOBAL_CTL() bfin_read16(USB_GLOBAL_CTL)
1423#define bfin_write_USB_GLOBAL_CTL(val) bfin_write16(USB_GLOBAL_CTL, val)
1424
1425/* USB Packet Control Registers */
1426
1427#define bfin_read_USB_TX_MAX_PACKET() bfin_read16(USB_TX_MAX_PACKET)
1428#define bfin_write_USB_TX_MAX_PACKET(val) bfin_write16(USB_TX_MAX_PACKET, val)
1429#define bfin_read_USB_CSR0() bfin_read16(USB_CSR0)
1430#define bfin_write_USB_CSR0(val) bfin_write16(USB_CSR0, val)
1431#define bfin_read_USB_TXCSR() bfin_read16(USB_TXCSR)
1432#define bfin_write_USB_TXCSR(val) bfin_write16(USB_TXCSR, val)
1433#define bfin_read_USB_RX_MAX_PACKET() bfin_read16(USB_RX_MAX_PACKET)
1434#define bfin_write_USB_RX_MAX_PACKET(val) bfin_write16(USB_RX_MAX_PACKET, val)
1435#define bfin_read_USB_RXCSR() bfin_read16(USB_RXCSR)
1436#define bfin_write_USB_RXCSR(val) bfin_write16(USB_RXCSR, val)
1437#define bfin_read_USB_COUNT0() bfin_read16(USB_COUNT0)
1438#define bfin_write_USB_COUNT0(val) bfin_write16(USB_COUNT0, val)
1439#define bfin_read_USB_RXCOUNT() bfin_read16(USB_RXCOUNT)
1440#define bfin_write_USB_RXCOUNT(val) bfin_write16(USB_RXCOUNT, val)
1441#define bfin_read_USB_TXTYPE() bfin_read16(USB_TXTYPE)
1442#define bfin_write_USB_TXTYPE(val) bfin_write16(USB_TXTYPE, val)
1443#define bfin_read_USB_NAKLIMIT0() bfin_read16(USB_NAKLIMIT0)
1444#define bfin_write_USB_NAKLIMIT0(val) bfin_write16(USB_NAKLIMIT0, val)
1445#define bfin_read_USB_TXINTERVAL() bfin_read16(USB_TXINTERVAL)
1446#define bfin_write_USB_TXINTERVAL(val) bfin_write16(USB_TXINTERVAL, val)
1447#define bfin_read_USB_RXTYPE() bfin_read16(USB_RXTYPE)
1448#define bfin_write_USB_RXTYPE(val) bfin_write16(USB_RXTYPE, val)
1449#define bfin_read_USB_RXINTERVAL() bfin_read16(USB_RXINTERVAL)
1450#define bfin_write_USB_RXINTERVAL(val) bfin_write16(USB_RXINTERVAL, val)
1451#define bfin_read_USB_TXCOUNT() bfin_read16(USB_TXCOUNT)
1452#define bfin_write_USB_TXCOUNT(val) bfin_write16(USB_TXCOUNT, val)
1453
1454/* USB Endbfin_read_()oint FIFO Registers */
1455
1456#define bfin_read_USB_EP0_FIFO() bfin_read16(USB_EP0_FIFO)
1457#define bfin_write_USB_EP0_FIFO(val) bfin_write16(USB_EP0_FIFO, val)
1458#define bfin_read_USB_EP1_FIFO() bfin_read16(USB_EP1_FIFO)
1459#define bfin_write_USB_EP1_FIFO(val) bfin_write16(USB_EP1_FIFO, val)
1460#define bfin_read_USB_EP2_FIFO() bfin_read16(USB_EP2_FIFO)
1461#define bfin_write_USB_EP2_FIFO(val) bfin_write16(USB_EP2_FIFO, val)
1462#define bfin_read_USB_EP3_FIFO() bfin_read16(USB_EP3_FIFO)
1463#define bfin_write_USB_EP3_FIFO(val) bfin_write16(USB_EP3_FIFO, val)
1464#define bfin_read_USB_EP4_FIFO() bfin_read16(USB_EP4_FIFO)
1465#define bfin_write_USB_EP4_FIFO(val) bfin_write16(USB_EP4_FIFO, val)
1466#define bfin_read_USB_EP5_FIFO() bfin_read16(USB_EP5_FIFO)
1467#define bfin_write_USB_EP5_FIFO(val) bfin_write16(USB_EP5_FIFO, val)
1468#define bfin_read_USB_EP6_FIFO() bfin_read16(USB_EP6_FIFO)
1469#define bfin_write_USB_EP6_FIFO(val) bfin_write16(USB_EP6_FIFO, val)
1470#define bfin_read_USB_EP7_FIFO() bfin_read16(USB_EP7_FIFO)
1471#define bfin_write_USB_EP7_FIFO(val) bfin_write16(USB_EP7_FIFO, val)
1472
1473/* USB OTG Control Registers */
1474
1475#define bfin_read_USB_OTG_DEV_CTL() bfin_read16(USB_OTG_DEV_CTL)
1476#define bfin_write_USB_OTG_DEV_CTL(val) bfin_write16(USB_OTG_DEV_CTL, val)
1477#define bfin_read_USB_OTG_VBUS_IRQ() bfin_read16(USB_OTG_VBUS_IRQ)
1478#define bfin_write_USB_OTG_VBUS_IRQ(val) bfin_write16(USB_OTG_VBUS_IRQ, val)
1479#define bfin_read_USB_OTG_VBUS_MASK() bfin_read16(USB_OTG_VBUS_MASK)
1480#define bfin_write_USB_OTG_VBUS_MASK(val) bfin_write16(USB_OTG_VBUS_MASK, val)
1481
1482/* USB Phy Control Registers */
1483
1484#define bfin_read_USB_LINKINFO() bfin_read16(USB_LINKINFO)
1485#define bfin_write_USB_LINKINFO(val) bfin_write16(USB_LINKINFO, val)
1486#define bfin_read_USB_VPLEN() bfin_read16(USB_VPLEN)
1487#define bfin_write_USB_VPLEN(val) bfin_write16(USB_VPLEN, val)
1488#define bfin_read_USB_HS_EOF1() bfin_read16(USB_HS_EOF1)
1489#define bfin_write_USB_HS_EOF1(val) bfin_write16(USB_HS_EOF1, val)
1490#define bfin_read_USB_FS_EOF1() bfin_read16(USB_FS_EOF1)
1491#define bfin_write_USB_FS_EOF1(val) bfin_write16(USB_FS_EOF1, val)
1492#define bfin_read_USB_LS_EOF1() bfin_read16(USB_LS_EOF1)
1493#define bfin_write_USB_LS_EOF1(val) bfin_write16(USB_LS_EOF1, val)
1494
1495/* (APHY_CNTRL is for ADI usage only) */
1496
1497#define bfin_read_USB_APHY_CNTRL() bfin_read16(USB_APHY_CNTRL)
1498#define bfin_write_USB_APHY_CNTRL(val) bfin_write16(USB_APHY_CNTRL, val)
1499
1500/* (APHY_CALIB is for ADI usage only) */
1501
1502#define bfin_read_USB_APHY_CALIB() bfin_read16(USB_APHY_CALIB)
1503#define bfin_write_USB_APHY_CALIB(val) bfin_write16(USB_APHY_CALIB, val)
1504#define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2)
1505#define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val)
1506
1507/* (PHY_TEST is for ADI usage only) */
1508
1509#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST)
1510#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val)
1511#define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL)
1512#define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val)
1513#define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV)
1514#define bfin_write_USB_SRP_CLKDIV(val) bfin_write16(USB_SRP_CLKDIV, val)
1515
1516/* USB Endbfin_read_()oint 0 Control Registers */
1517
1518#define bfin_read_USB_EP_NI0_TXMAXP() bfin_read16(USB_EP_NI0_TXMAXP)
1519#define bfin_write_USB_EP_NI0_TXMAXP(val) bfin_write16(USB_EP_NI0_TXMAXP, val)
1520#define bfin_read_USB_EP_NI0_TXCSR() bfin_read16(USB_EP_NI0_TXCSR)
1521#define bfin_write_USB_EP_NI0_TXCSR(val) bfin_write16(USB_EP_NI0_TXCSR, val)
1522#define bfin_read_USB_EP_NI0_RXMAXP() bfin_read16(USB_EP_NI0_RXMAXP)
1523#define bfin_write_USB_EP_NI0_RXMAXP(val) bfin_write16(USB_EP_NI0_RXMAXP, val)
1524#define bfin_read_USB_EP_NI0_RXCSR() bfin_read16(USB_EP_NI0_RXCSR)
1525#define bfin_write_USB_EP_NI0_RXCSR(val) bfin_write16(USB_EP_NI0_RXCSR, val)
1526#define bfin_read_USB_EP_NI0_RXCOUNT() bfin_read16(USB_EP_NI0_RXCOUNT)
1527#define bfin_write_USB_EP_NI0_RXCOUNT(val) bfin_write16(USB_EP_NI0_RXCOUNT, val)
1528#define bfin_read_USB_EP_NI0_TXTYPE() bfin_read16(USB_EP_NI0_TXTYPE)
1529#define bfin_write_USB_EP_NI0_TXTYPE(val) bfin_write16(USB_EP_NI0_TXTYPE, val)
1530#define bfin_read_USB_EP_NI0_TXINTERVAL() bfin_read16(USB_EP_NI0_TXINTERVAL)
1531#define bfin_write_USB_EP_NI0_TXINTERVAL(val) bfin_write16(USB_EP_NI0_TXINTERVAL, val)
1532#define bfin_read_USB_EP_NI0_RXTYPE() bfin_read16(USB_EP_NI0_RXTYPE)
1533#define bfin_write_USB_EP_NI0_RXTYPE(val) bfin_write16(USB_EP_NI0_RXTYPE, val)
1534#define bfin_read_USB_EP_NI0_RXINTERVAL() bfin_read16(USB_EP_NI0_RXINTERVAL)
1535#define bfin_write_USB_EP_NI0_RXINTERVAL(val) bfin_write16(USB_EP_NI0_RXINTERVAL, val)
1536
1537/* USB Endbfin_read_()oint 1 Control Registers */
1538
1539#define bfin_read_USB_EP_NI0_TXCOUNT() bfin_read16(USB_EP_NI0_TXCOUNT)
1540#define bfin_write_USB_EP_NI0_TXCOUNT(val) bfin_write16(USB_EP_NI0_TXCOUNT, val)
1541#define bfin_read_USB_EP_NI1_TXMAXP() bfin_read16(USB_EP_NI1_TXMAXP)
1542#define bfin_write_USB_EP_NI1_TXMAXP(val) bfin_write16(USB_EP_NI1_TXMAXP, val)
1543#define bfin_read_USB_EP_NI1_TXCSR() bfin_read16(USB_EP_NI1_TXCSR)
1544#define bfin_write_USB_EP_NI1_TXCSR(val) bfin_write16(USB_EP_NI1_TXCSR, val)
1545#define bfin_read_USB_EP_NI1_RXMAXP() bfin_read16(USB_EP_NI1_RXMAXP)
1546#define bfin_write_USB_EP_NI1_RXMAXP(val) bfin_write16(USB_EP_NI1_RXMAXP, val)
1547#define bfin_read_USB_EP_NI1_RXCSR() bfin_read16(USB_EP_NI1_RXCSR)
1548#define bfin_write_USB_EP_NI1_RXCSR(val) bfin_write16(USB_EP_NI1_RXCSR, val)
1549#define bfin_read_USB_EP_NI1_RXCOUNT() bfin_read16(USB_EP_NI1_RXCOUNT)
1550#define bfin_write_USB_EP_NI1_RXCOUNT(val) bfin_write16(USB_EP_NI1_RXCOUNT, val)
1551#define bfin_read_USB_EP_NI1_TXTYPE() bfin_read16(USB_EP_NI1_TXTYPE)
1552#define bfin_write_USB_EP_NI1_TXTYPE(val) bfin_write16(USB_EP_NI1_TXTYPE, val)
1553#define bfin_read_USB_EP_NI1_TXINTERVAL() bfin_read16(USB_EP_NI1_TXINTERVAL)
1554#define bfin_write_USB_EP_NI1_TXINTERVAL(val) bfin_write16(USB_EP_NI1_TXINTERVAL, val)
1555#define bfin_read_USB_EP_NI1_RXTYPE() bfin_read16(USB_EP_NI1_RXTYPE)
1556#define bfin_write_USB_EP_NI1_RXTYPE(val) bfin_write16(USB_EP_NI1_RXTYPE, val)
1557#define bfin_read_USB_EP_NI1_RXINTERVAL() bfin_read16(USB_EP_NI1_RXINTERVAL)
1558#define bfin_write_USB_EP_NI1_RXINTERVAL(val) bfin_write16(USB_EP_NI1_RXINTERVAL, val)
1559
1560/* USB Endbfin_read_()oint 2 Control Registers */
1561
1562#define bfin_read_USB_EP_NI1_TXCOUNT() bfin_read16(USB_EP_NI1_TXCOUNT)
1563#define bfin_write_USB_EP_NI1_TXCOUNT(val) bfin_write16(USB_EP_NI1_TXCOUNT, val)
1564#define bfin_read_USB_EP_NI2_TXMAXP() bfin_read16(USB_EP_NI2_TXMAXP)
1565#define bfin_write_USB_EP_NI2_TXMAXP(val) bfin_write16(USB_EP_NI2_TXMAXP, val)
1566#define bfin_read_USB_EP_NI2_TXCSR() bfin_read16(USB_EP_NI2_TXCSR)
1567#define bfin_write_USB_EP_NI2_TXCSR(val) bfin_write16(USB_EP_NI2_TXCSR, val)
1568#define bfin_read_USB_EP_NI2_RXMAXP() bfin_read16(USB_EP_NI2_RXMAXP)
1569#define bfin_write_USB_EP_NI2_RXMAXP(val) bfin_write16(USB_EP_NI2_RXMAXP, val)
1570#define bfin_read_USB_EP_NI2_RXCSR() bfin_read16(USB_EP_NI2_RXCSR)
1571#define bfin_write_USB_EP_NI2_RXCSR(val) bfin_write16(USB_EP_NI2_RXCSR, val)
1572#define bfin_read_USB_EP_NI2_RXCOUNT() bfin_read16(USB_EP_NI2_RXCOUNT)
1573#define bfin_write_USB_EP_NI2_RXCOUNT(val) bfin_write16(USB_EP_NI2_RXCOUNT, val)
1574#define bfin_read_USB_EP_NI2_TXTYPE() bfin_read16(USB_EP_NI2_TXTYPE)
1575#define bfin_write_USB_EP_NI2_TXTYPE(val) bfin_write16(USB_EP_NI2_TXTYPE, val)
1576#define bfin_read_USB_EP_NI2_TXINTERVAL() bfin_read16(USB_EP_NI2_TXINTERVAL)
1577#define bfin_write_USB_EP_NI2_TXINTERVAL(val) bfin_write16(USB_EP_NI2_TXINTERVAL, val)
1578#define bfin_read_USB_EP_NI2_RXTYPE() bfin_read16(USB_EP_NI2_RXTYPE)
1579#define bfin_write_USB_EP_NI2_RXTYPE(val) bfin_write16(USB_EP_NI2_RXTYPE, val)
1580#define bfin_read_USB_EP_NI2_RXINTERVAL() bfin_read16(USB_EP_NI2_RXINTERVAL)
1581#define bfin_write_USB_EP_NI2_RXINTERVAL(val) bfin_write16(USB_EP_NI2_RXINTERVAL, val)
1582
1583/* USB Endbfin_read_()oint 3 Control Registers */
1584
1585#define bfin_read_USB_EP_NI2_TXCOUNT() bfin_read16(USB_EP_NI2_TXCOUNT)
1586#define bfin_write_USB_EP_NI2_TXCOUNT(val) bfin_write16(USB_EP_NI2_TXCOUNT, val)
1587#define bfin_read_USB_EP_NI3_TXMAXP() bfin_read16(USB_EP_NI3_TXMAXP)
1588#define bfin_write_USB_EP_NI3_TXMAXP(val) bfin_write16(USB_EP_NI3_TXMAXP, val)
1589#define bfin_read_USB_EP_NI3_TXCSR() bfin_read16(USB_EP_NI3_TXCSR)
1590#define bfin_write_USB_EP_NI3_TXCSR(val) bfin_write16(USB_EP_NI3_TXCSR, val)
1591#define bfin_read_USB_EP_NI3_RXMAXP() bfin_read16(USB_EP_NI3_RXMAXP)
1592#define bfin_write_USB_EP_NI3_RXMAXP(val) bfin_write16(USB_EP_NI3_RXMAXP, val)
1593#define bfin_read_USB_EP_NI3_RXCSR() bfin_read16(USB_EP_NI3_RXCSR)
1594#define bfin_write_USB_EP_NI3_RXCSR(val) bfin_write16(USB_EP_NI3_RXCSR, val)
1595#define bfin_read_USB_EP_NI3_RXCOUNT() bfin_read16(USB_EP_NI3_RXCOUNT)
1596#define bfin_write_USB_EP_NI3_RXCOUNT(val) bfin_write16(USB_EP_NI3_RXCOUNT, val)
1597#define bfin_read_USB_EP_NI3_TXTYPE() bfin_read16(USB_EP_NI3_TXTYPE)
1598#define bfin_write_USB_EP_NI3_TXTYPE(val) bfin_write16(USB_EP_NI3_TXTYPE, val)
1599#define bfin_read_USB_EP_NI3_TXINTERVAL() bfin_read16(USB_EP_NI3_TXINTERVAL)
1600#define bfin_write_USB_EP_NI3_TXINTERVAL(val) bfin_write16(USB_EP_NI3_TXINTERVAL, val)
1601#define bfin_read_USB_EP_NI3_RXTYPE() bfin_read16(USB_EP_NI3_RXTYPE)
1602#define bfin_write_USB_EP_NI3_RXTYPE(val) bfin_write16(USB_EP_NI3_RXTYPE, val)
1603#define bfin_read_USB_EP_NI3_RXINTERVAL() bfin_read16(USB_EP_NI3_RXINTERVAL)
1604#define bfin_write_USB_EP_NI3_RXINTERVAL(val) bfin_write16(USB_EP_NI3_RXINTERVAL, val)
1605
1606/* USB Endbfin_read_()oint 4 Control Registers */
1607
1608#define bfin_read_USB_EP_NI3_TXCOUNT() bfin_read16(USB_EP_NI3_TXCOUNT)
1609#define bfin_write_USB_EP_NI3_TXCOUNT(val) bfin_write16(USB_EP_NI3_TXCOUNT, val)
1610#define bfin_read_USB_EP_NI4_TXMAXP() bfin_read16(USB_EP_NI4_TXMAXP)
1611#define bfin_write_USB_EP_NI4_TXMAXP(val) bfin_write16(USB_EP_NI4_TXMAXP, val)
1612#define bfin_read_USB_EP_NI4_TXCSR() bfin_read16(USB_EP_NI4_TXCSR)
1613#define bfin_write_USB_EP_NI4_TXCSR(val) bfin_write16(USB_EP_NI4_TXCSR, val)
1614#define bfin_read_USB_EP_NI4_RXMAXP() bfin_read16(USB_EP_NI4_RXMAXP)
1615#define bfin_write_USB_EP_NI4_RXMAXP(val) bfin_write16(USB_EP_NI4_RXMAXP, val)
1616#define bfin_read_USB_EP_NI4_RXCSR() bfin_read16(USB_EP_NI4_RXCSR)
1617#define bfin_write_USB_EP_NI4_RXCSR(val) bfin_write16(USB_EP_NI4_RXCSR, val)
1618#define bfin_read_USB_EP_NI4_RXCOUNT() bfin_read16(USB_EP_NI4_RXCOUNT)
1619#define bfin_write_USB_EP_NI4_RXCOUNT(val) bfin_write16(USB_EP_NI4_RXCOUNT, val)
1620#define bfin_read_USB_EP_NI4_TXTYPE() bfin_read16(USB_EP_NI4_TXTYPE)
1621#define bfin_write_USB_EP_NI4_TXTYPE(val) bfin_write16(USB_EP_NI4_TXTYPE, val)
1622#define bfin_read_USB_EP_NI4_TXINTERVAL() bfin_read16(USB_EP_NI4_TXINTERVAL)
1623#define bfin_write_USB_EP_NI4_TXINTERVAL(val) bfin_write16(USB_EP_NI4_TXINTERVAL, val)
1624#define bfin_read_USB_EP_NI4_RXTYPE() bfin_read16(USB_EP_NI4_RXTYPE)
1625#define bfin_write_USB_EP_NI4_RXTYPE(val) bfin_write16(USB_EP_NI4_RXTYPE, val)
1626#define bfin_read_USB_EP_NI4_RXINTERVAL() bfin_read16(USB_EP_NI4_RXINTERVAL)
1627#define bfin_write_USB_EP_NI4_RXINTERVAL(val) bfin_write16(USB_EP_NI4_RXINTERVAL, val)
1628
1629/* USB Endbfin_read_()oint 5 Control Registers */
1630
1631#define bfin_read_USB_EP_NI4_TXCOUNT() bfin_read16(USB_EP_NI4_TXCOUNT)
1632#define bfin_write_USB_EP_NI4_TXCOUNT(val) bfin_write16(USB_EP_NI4_TXCOUNT, val)
1633#define bfin_read_USB_EP_NI5_TXMAXP() bfin_read16(USB_EP_NI5_TXMAXP)
1634#define bfin_write_USB_EP_NI5_TXMAXP(val) bfin_write16(USB_EP_NI5_TXMAXP, val)
1635#define bfin_read_USB_EP_NI5_TXCSR() bfin_read16(USB_EP_NI5_TXCSR)
1636#define bfin_write_USB_EP_NI5_TXCSR(val) bfin_write16(USB_EP_NI5_TXCSR, val)
1637#define bfin_read_USB_EP_NI5_RXMAXP() bfin_read16(USB_EP_NI5_RXMAXP)
1638#define bfin_write_USB_EP_NI5_RXMAXP(val) bfin_write16(USB_EP_NI5_RXMAXP, val)
1639#define bfin_read_USB_EP_NI5_RXCSR() bfin_read16(USB_EP_NI5_RXCSR)
1640#define bfin_write_USB_EP_NI5_RXCSR(val) bfin_write16(USB_EP_NI5_RXCSR, val)
1641#define bfin_read_USB_EP_NI5_RXCOUNT() bfin_read16(USB_EP_NI5_RXCOUNT)
1642#define bfin_write_USB_EP_NI5_RXCOUNT(val) bfin_write16(USB_EP_NI5_RXCOUNT, val)
1643#define bfin_read_USB_EP_NI5_TXTYPE() bfin_read16(USB_EP_NI5_TXTYPE)
1644#define bfin_write_USB_EP_NI5_TXTYPE(val) bfin_write16(USB_EP_NI5_TXTYPE, val)
1645#define bfin_read_USB_EP_NI5_TXINTERVAL() bfin_read16(USB_EP_NI5_TXINTERVAL)
1646#define bfin_write_USB_EP_NI5_TXINTERVAL(val) bfin_write16(USB_EP_NI5_TXINTERVAL, val)
1647#define bfin_read_USB_EP_NI5_RXTYPE() bfin_read16(USB_EP_NI5_RXTYPE)
1648#define bfin_write_USB_EP_NI5_RXTYPE(val) bfin_write16(USB_EP_NI5_RXTYPE, val)
1649#define bfin_read_USB_EP_NI5_RXINTERVAL() bfin_read16(USB_EP_NI5_RXINTERVAL)
1650#define bfin_write_USB_EP_NI5_RXINTERVAL(val) bfin_write16(USB_EP_NI5_RXINTERVAL, val)
1651
1652/* USB Endbfin_read_()oint 6 Control Registers */
1653
1654#define bfin_read_USB_EP_NI5_TXCOUNT() bfin_read16(USB_EP_NI5_TXCOUNT)
1655#define bfin_write_USB_EP_NI5_TXCOUNT(val) bfin_write16(USB_EP_NI5_TXCOUNT, val)
1656#define bfin_read_USB_EP_NI6_TXMAXP() bfin_read16(USB_EP_NI6_TXMAXP)
1657#define bfin_write_USB_EP_NI6_TXMAXP(val) bfin_write16(USB_EP_NI6_TXMAXP, val)
1658#define bfin_read_USB_EP_NI6_TXCSR() bfin_read16(USB_EP_NI6_TXCSR)
1659#define bfin_write_USB_EP_NI6_TXCSR(val) bfin_write16(USB_EP_NI6_TXCSR, val)
1660#define bfin_read_USB_EP_NI6_RXMAXP() bfin_read16(USB_EP_NI6_RXMAXP)
1661#define bfin_write_USB_EP_NI6_RXMAXP(val) bfin_write16(USB_EP_NI6_RXMAXP, val)
1662#define bfin_read_USB_EP_NI6_RXCSR() bfin_read16(USB_EP_NI6_RXCSR)
1663#define bfin_write_USB_EP_NI6_RXCSR(val) bfin_write16(USB_EP_NI6_RXCSR, val)
1664#define bfin_read_USB_EP_NI6_RXCOUNT() bfin_read16(USB_EP_NI6_RXCOUNT)
1665#define bfin_write_USB_EP_NI6_RXCOUNT(val) bfin_write16(USB_EP_NI6_RXCOUNT, val)
1666#define bfin_read_USB_EP_NI6_TXTYPE() bfin_read16(USB_EP_NI6_TXTYPE)
1667#define bfin_write_USB_EP_NI6_TXTYPE(val) bfin_write16(USB_EP_NI6_TXTYPE, val)
1668#define bfin_read_USB_EP_NI6_TXINTERVAL() bfin_read16(USB_EP_NI6_TXINTERVAL)
1669#define bfin_write_USB_EP_NI6_TXINTERVAL(val) bfin_write16(USB_EP_NI6_TXINTERVAL, val)
1670#define bfin_read_USB_EP_NI6_RXTYPE() bfin_read16(USB_EP_NI6_RXTYPE)
1671#define bfin_write_USB_EP_NI6_RXTYPE(val) bfin_write16(USB_EP_NI6_RXTYPE, val)
1672#define bfin_read_USB_EP_NI6_RXINTERVAL() bfin_read16(USB_EP_NI6_RXINTERVAL)
1673#define bfin_write_USB_EP_NI6_RXINTERVAL(val) bfin_write16(USB_EP_NI6_RXINTERVAL, val)
1674
1675/* USB Endbfin_read_()oint 7 Control Registers */
1676
1677#define bfin_read_USB_EP_NI6_TXCOUNT() bfin_read16(USB_EP_NI6_TXCOUNT)
1678#define bfin_write_USB_EP_NI6_TXCOUNT(val) bfin_write16(USB_EP_NI6_TXCOUNT, val)
1679#define bfin_read_USB_EP_NI7_TXMAXP() bfin_read16(USB_EP_NI7_TXMAXP)
1680#define bfin_write_USB_EP_NI7_TXMAXP(val) bfin_write16(USB_EP_NI7_TXMAXP, val)
1681#define bfin_read_USB_EP_NI7_TXCSR() bfin_read16(USB_EP_NI7_TXCSR)
1682#define bfin_write_USB_EP_NI7_TXCSR(val) bfin_write16(USB_EP_NI7_TXCSR, val)
1683#define bfin_read_USB_EP_NI7_RXMAXP() bfin_read16(USB_EP_NI7_RXMAXP)
1684#define bfin_write_USB_EP_NI7_RXMAXP(val) bfin_write16(USB_EP_NI7_RXMAXP, val)
1685#define bfin_read_USB_EP_NI7_RXCSR() bfin_read16(USB_EP_NI7_RXCSR)
1686#define bfin_write_USB_EP_NI7_RXCSR(val) bfin_write16(USB_EP_NI7_RXCSR, val)
1687#define bfin_read_USB_EP_NI7_RXCOUNT() bfin_read16(USB_EP_NI7_RXCOUNT)
1688#define bfin_write_USB_EP_NI7_RXCOUNT(val) bfin_write16(USB_EP_NI7_RXCOUNT, val)
1689#define bfin_read_USB_EP_NI7_TXTYPE() bfin_read16(USB_EP_NI7_TXTYPE)
1690#define bfin_write_USB_EP_NI7_TXTYPE(val) bfin_write16(USB_EP_NI7_TXTYPE, val)
1691#define bfin_read_USB_EP_NI7_TXINTERVAL() bfin_read16(USB_EP_NI7_TXINTERVAL)
1692#define bfin_write_USB_EP_NI7_TXINTERVAL(val) bfin_write16(USB_EP_NI7_TXINTERVAL, val)
1693#define bfin_read_USB_EP_NI7_RXTYPE() bfin_read16(USB_EP_NI7_RXTYPE)
1694#define bfin_write_USB_EP_NI7_RXTYPE(val) bfin_write16(USB_EP_NI7_RXTYPE, val)
1695#define bfin_read_USB_EP_NI7_RXINTERVAL() bfin_read16(USB_EP_NI7_RXINTERVAL)
1696#define bfin_write_USB_EP_NI7_RXINTERVAL(val) bfin_write16(USB_EP_NI7_RXINTERVAL, val)
1697#define bfin_read_USB_EP_NI7_TXCOUNT() bfin_read16(USB_EP_NI7_TXCOUNT)
1698#define bfin_write_USB_EP_NI7_TXCOUNT(val) bfin_write16(USB_EP_NI7_TXCOUNT, val)
1699#define bfin_read_USB_DMA_INTERRUPT() bfin_read16(USB_DMA_INTERRUPT)
1700#define bfin_write_USB_DMA_INTERRUPT(val) bfin_write16(USB_DMA_INTERRUPT, val)
1701
1702/* USB Channel 0 Config Registers */
1703
1704#define bfin_read_USB_DMA0CONTROL() bfin_read16(USB_DMA0CONTROL)
1705#define bfin_write_USB_DMA0CONTROL(val) bfin_write16(USB_DMA0CONTROL, val)
1706#define bfin_read_USB_DMA0ADDRLOW() bfin_read16(USB_DMA0ADDRLOW)
1707#define bfin_write_USB_DMA0ADDRLOW(val) bfin_write16(USB_DMA0ADDRLOW, val)
1708#define bfin_read_USB_DMA0ADDRHIGH() bfin_read16(USB_DMA0ADDRHIGH)
1709#define bfin_write_USB_DMA0ADDRHIGH(val) bfin_write16(USB_DMA0ADDRHIGH, val)
1710#define bfin_read_USB_DMA0COUNTLOW() bfin_read16(USB_DMA0COUNTLOW)
1711#define bfin_write_USB_DMA0COUNTLOW(val) bfin_write16(USB_DMA0COUNTLOW, val)
1712#define bfin_read_USB_DMA0COUNTHIGH() bfin_read16(USB_DMA0COUNTHIGH)
1713#define bfin_write_USB_DMA0COUNTHIGH(val) bfin_write16(USB_DMA0COUNTHIGH, val)
1714
1715/* USB Channel 1 Config Registers */
1716
1717#define bfin_read_USB_DMA1CONTROL() bfin_read16(USB_DMA1CONTROL)
1718#define bfin_write_USB_DMA1CONTROL(val) bfin_write16(USB_DMA1CONTROL, val)
1719#define bfin_read_USB_DMA1ADDRLOW() bfin_read16(USB_DMA1ADDRLOW)
1720#define bfin_write_USB_DMA1ADDRLOW(val) bfin_write16(USB_DMA1ADDRLOW, val)
1721#define bfin_read_USB_DMA1ADDRHIGH() bfin_read16(USB_DMA1ADDRHIGH)
1722#define bfin_write_USB_DMA1ADDRHIGH(val) bfin_write16(USB_DMA1ADDRHIGH, val)
1723#define bfin_read_USB_DMA1COUNTLOW() bfin_read16(USB_DMA1COUNTLOW)
1724#define bfin_write_USB_DMA1COUNTLOW(val) bfin_write16(USB_DMA1COUNTLOW, val)
1725#define bfin_read_USB_DMA1COUNTHIGH() bfin_read16(USB_DMA1COUNTHIGH)
1726#define bfin_write_USB_DMA1COUNTHIGH(val) bfin_write16(USB_DMA1COUNTHIGH, val)
1727
1728/* USB Channel 2 Config Registers */
1729
1730#define bfin_read_USB_DMA2CONTROL() bfin_read16(USB_DMA2CONTROL)
1731#define bfin_write_USB_DMA2CONTROL(val) bfin_write16(USB_DMA2CONTROL, val)
1732#define bfin_read_USB_DMA2ADDRLOW() bfin_read16(USB_DMA2ADDRLOW)
1733#define bfin_write_USB_DMA2ADDRLOW(val) bfin_write16(USB_DMA2ADDRLOW, val)
1734#define bfin_read_USB_DMA2ADDRHIGH() bfin_read16(USB_DMA2ADDRHIGH)
1735#define bfin_write_USB_DMA2ADDRHIGH(val) bfin_write16(USB_DMA2ADDRHIGH, val)
1736#define bfin_read_USB_DMA2COUNTLOW() bfin_read16(USB_DMA2COUNTLOW)
1737#define bfin_write_USB_DMA2COUNTLOW(val) bfin_write16(USB_DMA2COUNTLOW, val)
1738#define bfin_read_USB_DMA2COUNTHIGH() bfin_read16(USB_DMA2COUNTHIGH)
1739#define bfin_write_USB_DMA2COUNTHIGH(val) bfin_write16(USB_DMA2COUNTHIGH, val)
1740
1741/* USB Channel 3 Config Registers */
1742
1743#define bfin_read_USB_DMA3CONTROL() bfin_read16(USB_DMA3CONTROL)
1744#define bfin_write_USB_DMA3CONTROL(val) bfin_write16(USB_DMA3CONTROL, val)
1745#define bfin_read_USB_DMA3ADDRLOW() bfin_read16(USB_DMA3ADDRLOW)
1746#define bfin_write_USB_DMA3ADDRLOW(val) bfin_write16(USB_DMA3ADDRLOW, val)
1747#define bfin_read_USB_DMA3ADDRHIGH() bfin_read16(USB_DMA3ADDRHIGH)
1748#define bfin_write_USB_DMA3ADDRHIGH(val) bfin_write16(USB_DMA3ADDRHIGH, val)
1749#define bfin_read_USB_DMA3COUNTLOW() bfin_read16(USB_DMA3COUNTLOW)
1750#define bfin_write_USB_DMA3COUNTLOW(val) bfin_write16(USB_DMA3COUNTLOW, val)
1751#define bfin_read_USB_DMA3COUNTHIGH() bfin_read16(USB_DMA3COUNTHIGH)
1752#define bfin_write_USB_DMA3COUNTHIGH(val) bfin_write16(USB_DMA3COUNTHIGH, val)
1753
1754/* USB Channel 4 Config Registers */
1755
1756#define bfin_read_USB_DMA4CONTROL() bfin_read16(USB_DMA4CONTROL)
1757#define bfin_write_USB_DMA4CONTROL(val) bfin_write16(USB_DMA4CONTROL, val)
1758#define bfin_read_USB_DMA4ADDRLOW() bfin_read16(USB_DMA4ADDRLOW)
1759#define bfin_write_USB_DMA4ADDRLOW(val) bfin_write16(USB_DMA4ADDRLOW, val)
1760#define bfin_read_USB_DMA4ADDRHIGH() bfin_read16(USB_DMA4ADDRHIGH)
1761#define bfin_write_USB_DMA4ADDRHIGH(val) bfin_write16(USB_DMA4ADDRHIGH, val)
1762#define bfin_read_USB_DMA4COUNTLOW() bfin_read16(USB_DMA4COUNTLOW)
1763#define bfin_write_USB_DMA4COUNTLOW(val) bfin_write16(USB_DMA4COUNTLOW, val)
1764#define bfin_read_USB_DMA4COUNTHIGH() bfin_read16(USB_DMA4COUNTHIGH)
1765#define bfin_write_USB_DMA4COUNTHIGH(val) bfin_write16(USB_DMA4COUNTHIGH, val)
1766
1767/* USB Channel 5 Config Registers */
1768
1769#define bfin_read_USB_DMA5CONTROL() bfin_read16(USB_DMA5CONTROL)
1770#define bfin_write_USB_DMA5CONTROL(val) bfin_write16(USB_DMA5CONTROL, val)
1771#define bfin_read_USB_DMA5ADDRLOW() bfin_read16(USB_DMA5ADDRLOW)
1772#define bfin_write_USB_DMA5ADDRLOW(val) bfin_write16(USB_DMA5ADDRLOW, val)
1773#define bfin_read_USB_DMA5ADDRHIGH() bfin_read16(USB_DMA5ADDRHIGH)
1774#define bfin_write_USB_DMA5ADDRHIGH(val) bfin_write16(USB_DMA5ADDRHIGH, val)
1775#define bfin_read_USB_DMA5COUNTLOW() bfin_read16(USB_DMA5COUNTLOW)
1776#define bfin_write_USB_DMA5COUNTLOW(val) fin_write16(USB_DMA5COUNTLOW, val)
1777#define bfin_read_USB_DMA5COUNTHIGH() bfin_read16(USB_DMA5COUNTHIGH)
1778#define bfin_write_USB_DMA5COUNTHIGH(val) bfin_write16(USB_DMA5COUNTHIGH, val)
1779
1780/* USB Channel 6 Config Registers */
1781
1782#define bfin_read_USB_DMA6CONTROL() bfin_read16(USB_DMA6CONTROL)
1783#define bfin_write_USB_DMA6CONTROL(val) bfin_write16(USB_DMA6CONTROL, val)
1784#define bfin_read_USB_DMA6ADDRLOW() bfin_read16(USB_DMA6ADDRLOW)
1785#define bfin_write_USB_DMA6ADDRLOW(val) bfin_write16(USB_DMA6ADDRLOW, val)
1786#define bfin_read_USB_DMA6ADDRHIGH() bfin_read16(USB_DMA6ADDRHIGH)
1787#define bfin_write_USB_DMA6ADDRHIGH(val) bfin_write16(USB_DMA6ADDRHIGH, val)
1788#define bfin_read_USB_DMA6COUNTLOW() bfin_read16(USB_DMA6COUNTLOW)
1789#define bfin_write_USB_DMA6COUNTLOW(val) bfin_write16(USB_DMA6COUNTLOW, val)
1790#define bfin_read_USB_DMA6COUNTHIGH() bfin_read16(USB_DMA6COUNTHIGH)
1791#define bfin_write_USB_DMA6COUNTHIGH(val) bfin_write16(USB_DMA6COUNTHIGH, val)
1792
1793/* USB Channel 7 Config Registers */
1794
1795#define bfin_read_USB_DMA7CONTROL() bfin_read16(USB_DMA7CONTROL)
1796#define bfin_write_USB_DMA7CONTROL(val) bfin_write16(USB_DMA7CONTROL, val)
1797#define bfin_read_USB_DMA7ADDRLOW() bfin_read16(USB_DMA7ADDRLOW)
1798#define bfin_write_USB_DMA7ADDRLOW(val) bfin_write16(USB_DMA7ADDRLOW, val)
1799#define bfin_read_USB_DMA7ADDRHIGH() bfin_read16(USB_DMA7ADDRHIGH)
1800#define bfin_write_USB_DMA7ADDRHIGH(val) bfin_write16(USB_DMA7ADDRHIGH, val)
1801#define bfin_read_USB_DMA7COUNTLOW() bfin_read16(USB_DMA7COUNTLOW)
1802#define bfin_write_USB_DMA7COUNTLOW(val) bfin_write16(USB_DMA7COUNTLOW, val)
1803#define bfin_read_USB_DMA7COUNTHIGH() bfin_read16(USB_DMA7COUNTHIGH)
1804#define bfin_write_USB_DMA7COUNTHIGH(val) bfin_write16(USB_DMA7COUNTHIGH, val)
1805
1806/* Keybfin_read_()ad Registers */
1807
1808#define bfin_read_KPAD_CTL() bfin_read16(KPAD_CTL)
1809#define bfin_write_KPAD_CTL(val) bfin_write16(KPAD_CTL, val)
1810#define bfin_read_KPAD_PRESCALE() bfin_read16(KPAD_PRESCALE)
1811#define bfin_write_KPAD_PRESCALE(val) bfin_write16(KPAD_PRESCALE, val)
1812#define bfin_read_KPAD_MSEL() bfin_read16(KPAD_MSEL)
1813#define bfin_write_KPAD_MSEL(val) bfin_write16(KPAD_MSEL, val)
1814#define bfin_read_KPAD_ROWCOL() bfin_read16(KPAD_ROWCOL)
1815#define bfin_write_KPAD_ROWCOL(val) bfin_write16(KPAD_ROWCOL, val)
1816#define bfin_read_KPAD_STAT() bfin_read16(KPAD_STAT)
1817#define bfin_write_KPAD_STAT(val) bfin_write16(KPAD_STAT, val)
1818#define bfin_read_KPAD_SOFTEVAL() bfin_read16(KPAD_SOFTEVAL)
1819#define bfin_write_KPAD_SOFTEVAL(val) bfin_write16(KPAD_SOFTEVAL, val)
1820
1821/* Pixel Combfin_read_()ositor (PIXC) Registers */
1822
1823#define bfin_read_PIXC_CTL() bfin_read16(PIXC_CTL)
1824#define bfin_write_PIXC_CTL(val) bfin_write16(PIXC_CTL, val)
1825#define bfin_read_PIXC_PPL() bfin_read16(PIXC_PPL)
1826#define bfin_write_PIXC_PPL(val) bfin_write16(PIXC_PPL, val)
1827#define bfin_read_PIXC_LPF() bfin_read16(PIXC_LPF)
1828#define bfin_write_PIXC_LPF(val) bfin_write16(PIXC_LPF, val)
1829#define bfin_read_PIXC_AHSTART() bfin_read16(PIXC_AHSTART)
1830#define bfin_write_PIXC_AHSTART(val) bfin_write16(PIXC_AHSTART, val)
1831#define bfin_read_PIXC_AHEND() bfin_read16(PIXC_AHEND)
1832#define bfin_write_PIXC_AHEND(val) bfin_write16(PIXC_AHEND, val)
1833#define bfin_read_PIXC_AVSTART() bfin_read16(PIXC_AVSTART)
1834#define bfin_write_PIXC_AVSTART(val) bfin_write16(PIXC_AVSTART, val)
1835#define bfin_read_PIXC_AVEND() bfin_read16(PIXC_AVEND)
1836#define bfin_write_PIXC_AVEND(val) bfin_write16(PIXC_AVEND, val)
1837#define bfin_read_PIXC_ATRANSP() bfin_read16(PIXC_ATRANSP)
1838#define bfin_write_PIXC_ATRANSP(val) bfin_write16(PIXC_ATRANSP, val)
1839#define bfin_read_PIXC_BHSTART() bfin_read16(PIXC_BHSTART)
1840#define bfin_write_PIXC_BHSTART(val) bfin_write16(PIXC_BHSTART, val)
1841#define bfin_read_PIXC_BHEND() bfin_read16(PIXC_BHEND)
1842#define bfin_write_PIXC_BHEND(val) bfin_write16(PIXC_BHEND, val)
1843#define bfin_read_PIXC_BVSTART() bfin_read16(PIXC_BVSTART)
1844#define bfin_write_PIXC_BVSTART(val) bfin_write16(PIXC_BVSTART, val)
1845#define bfin_read_PIXC_BVEND() bfin_read16(PIXC_BVEND)
1846#define bfin_write_PIXC_BVEND(val) bfin_write16(PIXC_BVEND, val)
1847#define bfin_read_PIXC_BTRANSP() bfin_read16(PIXC_BTRANSP)
1848#define bfin_write_PIXC_BTRANSP(val) bfin_write16(PIXC_BTRANSP, val)
1849#define bfin_read_PIXC_INTRSTAT() bfin_read16(PIXC_INTRSTAT)
1850#define bfin_write_PIXC_INTRSTAT(val) bfin_write16(PIXC_INTRSTAT, val)
1851#define bfin_read_PIXC_RYCON() bfin_read32(PIXC_RYCON)
1852#define bfin_write_PIXC_RYCON(val) bfin_write32(PIXC_RYCON, val)
1853#define bfin_read_PIXC_GUCON() bfin_read32(PIXC_GUCON)
1854#define bfin_write_PIXC_GUCON(val) bfin_write32(PIXC_GUCON, val)
1855#define bfin_read_PIXC_BVCON() bfin_read32(PIXC_BVCON)
1856#define bfin_write_PIXC_BVCON(val) bfin_write32(PIXC_BVCON, val)
1857#define bfin_read_PIXC_CCBIAS() bfin_read32(PIXC_CCBIAS)
1858#define bfin_write_PIXC_CCBIAS(val) bfin_write32(PIXC_CCBIAS, val)
1859#define bfin_read_PIXC_TC() bfin_read32(PIXC_TC)
1860#define bfin_write_PIXC_TC(val) bfin_write32(PIXC_TC, val)
1861
1862/* Handshake MDMA 0 Registers */
1863
1864#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
1865#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
1866#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
1867#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT, val)
1868#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
1869#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT, val)
1870#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
1871#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
1872#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
1873#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
1874#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
1875#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT, val)
1876#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
1877#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT, val)
1878
1879/* Handshake MDMA 1 Registers */
1880
1881#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
1882#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
1883#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
1884#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT, val)
1885#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
1886#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT, val)
1887#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
1888#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
1889#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
1890#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
1891#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
1892#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT, val)
1893#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
1894#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT, val)
1895
1896#endif /* _CDEF_BF549_H */
diff --git a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
new file mode 100644
index 000000000000..6bbcefeb3627
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
@@ -0,0 +1,2722 @@
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 <defBF54x_base.h>
35
36/* ************************************************************** */
37/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x */
38/* ************************************************************** */
39
40/* PLL Registers */
41
42#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
43#define bfin_write_PLL_CTL(val) bfin_write16(PLL_CTL, val)
44#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
45#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
46#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
47#define bfin_write_VR_CTL(val) bfin_write16(VR_CTL, val)
48#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
49#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
50#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
51#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT, val)
52
53/* Debug/MP/Emulation Registers (0xFFC00014 - 0xFFC00014) */
54
55#define bfin_read_CHIPID() bfin_read32(CHIPID)
56#define bfin_write_CHIPID(val) bfin_write32(CHIPID, val)
57
58/* System Reset and Interrubfin_read_()t Controller (0xFFC00100 - 0xFFC00104) */
59
60#define bfin_read_SWRST() bfin_read16(SWRST)
61#define bfin_write_SWRST(val) bfin_write16(SWRST, val)
62#define bfin_read_SYSCR() bfin_read16(SYSCR)
63#define bfin_write_SYSCR(val) bfin_write16(SYSCR, val)
64
65/* SIC Registers */
66
67#define bfin_read_SIC_IMASK0() bfin_read32(SIC_IMASK0)
68#define bfin_write_SIC_IMASK0(val) bfin_write32(SIC_IMASK0, val)
69#define bfin_read_SIC_IMASK1() bfin_read32(SIC_IMASK1)
70#define bfin_write_SIC_IMASK1(val) bfin_write32(SIC_IMASK1, val)
71#define bfin_read_SIC_IMASK2() bfin_read32(SIC_IMASK2)
72#define bfin_write_SIC_IMASK2(val) bfin_write32(SIC_IMASK2, val)
73#define bfin_read_SIC_ISR0() bfin_read32(SIC_ISR0)
74#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val)
75#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1)
76#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val)
77#define bfin_read_SIC_ISR2() bfin_read32(SIC_ISR2)
78#define bfin_write_SIC_ISR2(val) bfin_write32(SIC_ISR2, val)
79#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0)
80#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val)
81#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1)
82#define bfin_write_SIC_IWR1(val) bfin_write32(SIC_IWR1, val)
83#define bfin_read_SIC_IWR2() bfin_read32(SIC_IWR2)
84#define bfin_write_SIC_IWR2(val) bfin_write32(SIC_IWR2, val)
85#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
86#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0, val)
87#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
88#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1, val)
89#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
90#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2, val)
91#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
92#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3, val)
93#define bfin_read_SIC_IAR4() bfin_read32(SIC_IAR4)
94#define bfin_write_SIC_IAR4(val) bfin_write32(SIC_IAR4, val)
95#define bfin_read_SIC_IAR5() bfin_read32(SIC_IAR5)
96#define bfin_write_SIC_IAR5(val) bfin_write32(SIC_IAR5, val)
97#define bfin_read_SIC_IAR6() bfin_read32(SIC_IAR6)
98#define bfin_write_SIC_IAR6(val) bfin_write32(SIC_IAR6, val)
99#define bfin_read_SIC_IAR7() bfin_read32(SIC_IAR7)
100#define bfin_write_SIC_IAR7(val) bfin_write32(SIC_IAR7, val)
101#define bfin_read_SIC_IAR8() bfin_read32(SIC_IAR8)
102#define bfin_write_SIC_IAR8(val) bfin_write32(SIC_IAR8, val)
103#define bfin_read_SIC_IAR9() bfin_read32(SIC_IAR9)
104#define bfin_write_SIC_IAR9(val) bfin_write32(SIC_IAR9, val)
105#define bfin_read_SIC_IAR10() bfin_read32(SIC_IAR10)
106#define bfin_write_SIC_IAR10(val) bfin_write32(SIC_IAR10, val)
107#define bfin_read_SIC_IAR11() bfin_read32(SIC_IAR11)
108#define bfin_write_SIC_IAR11(val) bfin_write32(SIC_IAR11, val)
109
110/* Watchdog Timer Registers */
111
112#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
113#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL, val)
114#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
115#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT, val)
116#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
117#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT, val)
118
119/* RTC Registers */
120
121#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
122#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT, val)
123#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
124#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL, val)
125#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
126#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT, val)
127#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
128#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT, val)
129#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
130#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM, val)
131#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
132#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN, val)
133
134/* UART0 Registers */
135
136#define bfin_read_UART0_DLL() bfin_read16(UART0_DLL)
137#define bfin_write_UART0_DLL(val) bfin_write16(UART0_DLL, val)
138#define bfin_read_UART0_DLH() bfin_read16(UART0_DLH)
139#define bfin_write_UART0_DLH(val) bfin_write16(UART0_DLH, val)
140#define bfin_read_UART0_GCTL() bfin_read16(UART0_GCTL)
141#define bfin_write_UART0_GCTL(val) bfin_write16(UART0_GCTL, val)
142#define bfin_read_UART0_LCR() bfin_read16(UART0_LCR)
143#define bfin_write_UART0_LCR(val) bfin_write16(UART0_LCR, val)
144#define bfin_read_UART0_MCR() bfin_read16(UART0_MCR)
145#define bfin_write_UART0_MCR(val) bfin_write16(UART0_MCR, val)
146#define bfin_read_UART0_LSR() bfin_read16(UART0_LSR)
147#define bfin_write_UART0_LSR(val) bfin_write16(UART0_LSR, val)
148#define bfin_read_UART0_MSR() bfin_read16(UART0_MSR)
149#define bfin_write_UART0_MSR(val) bfin_write16(UART0_MSR, val)
150#define bfin_read_UART0_SCR() bfin_read16(UART0_SCR)
151#define bfin_write_UART0_SCR(val) bfin_write16(UART0_SCR, val)
152#define bfin_read_UART0_IER_SET() bfin_read16(UART0_IER_SET)
153#define bfin_write_UART0_IER_SET(val) bfin_write16(UART0_IER_SET, val)
154#define bfin_read_UART0_IER_CLEAR() bfin_read16(UART0_IER_CLEAR)
155#define bfin_write_UART0_IER_CLEAR(val) bfin_write16(UART0_IER_CLEAR, val)
156#define bfin_read_UART0_THR() bfin_read16(UART0_THR)
157#define bfin_write_UART0_THR(val) bfin_write16(UART0_THR, val)
158#define bfin_read_UART0_RBR() bfin_read16(UART0_RBR)
159#define bfin_write_UART0_RBR(val) bfin_write16(UART0_RBR, val)
160
161/* SPI0 Registers */
162
163#define bfin_read_SPI0_CTL() bfin_read16(SPI0_CTL)
164#define bfin_write_SPI0_CTL(val) bfin_write16(SPI0_CTL, val)
165#define bfin_read_SPI0_FLG() bfin_read16(SPI0_FLG)
166#define bfin_write_SPI0_FLG(val) bfin_write16(SPI0_FLG, val)
167#define bfin_read_SPI0_STAT() bfin_read16(SPI0_STAT)
168#define bfin_write_SPI0_STAT(val) bfin_write16(SPI0_STAT, val)
169#define bfin_read_SPI0_TDBR() bfin_read16(SPI0_TDBR)
170#define bfin_write_SPI0_TDBR(val) bfin_write16(SPI0_TDBR, val)
171#define bfin_read_SPI0_RDBR() bfin_read16(SPI0_RDBR)
172#define bfin_write_SPI0_RDBR(val) bfin_write16(SPI0_RDBR, val)
173#define bfin_read_SPI0_BAUD() bfin_read16(SPI0_BAUD)
174#define bfin_write_SPI0_BAUD(val) bfin_write16(SPI0_BAUD, val)
175#define bfin_read_SPI0_SHADOW() bfin_read16(SPI0_SHADOW)
176#define bfin_write_SPI0_SHADOW(val) bfin_write16(SPI0_SHADOW, val)
177
178/* Timer Groubfin_read_() of 3 registers are not defined in the shared file because they are not available on the ADSP-BF542 processor */
179
180/* Two Wire Interface Registers (TWI0) */
181
182#define bfin_read_TWI0_CLKDIV() bfin_read16(TWI0_CLKDIV)
183#define bfin_write_TWI0_CLKDIV(val) bfin_write16(TWI0_CLKDIV, val)
184#define bfin_read_TWI0_CONTROL() bfin_read16(TWI0_CONTROL)
185#define bfin_write_TWI0_CONTROL(val) bfin_write16(TWI0_CONTROL, val)
186#define bfin_read_TWI0_SLAVE_CTRL() bfin_read16(TWI0_SLAVE_CTRL)
187#define bfin_write_TWI0_SLAVE_CTRL(val) bfin_write16(TWI0_SLAVE_CTRL, val)
188#define bfin_read_TWI0_SLAVE_STAT() bfin_read16(TWI0_SLAVE_STAT)
189#define bfin_write_TWI0_SLAVE_STAT(val) bfin_write16(TWI0_SLAVE_STAT, val)
190#define bfin_read_TWI0_SLAVE_ADDR() bfin_read16(TWI0_SLAVE_ADDR)
191#define bfin_write_TWI0_SLAVE_ADDR(val) bfin_write16(TWI0_SLAVE_ADDR, val)
192#define bfin_read_TWI0_MASTER_CTRL() bfin_read16(TWI0_MASTER_CTRL)
193#define bfin_write_TWI0_MASTER_CTRL(val) bfin_write16(TWI0_MASTER_CTRL, val)
194#define bfin_read_TWI0_MASTER_STAT() bfin_read16(TWI0_MASTER_STAT)
195#define bfin_write_TWI0_MASTER_STAT(val) bfin_write16(TWI0_MASTER_STAT, val)
196#define bfin_read_TWI0_MASTER_ADDR() bfin_read16(TWI0_MASTER_ADDR)
197#define bfin_write_TWI0_MASTER_ADDR(val) bfin_write16(TWI0_MASTER_ADDR, val)
198#define bfin_read_TWI0_INT_STAT() bfin_read16(TWI0_INT_STAT)
199#define bfin_write_TWI0_INT_STAT(val) bfin_write16(TWI0_INT_STAT, val)
200#define bfin_read_TWI0_INT_MASK() bfin_read16(TWI0_INT_MASK)
201#define bfin_write_TWI0_INT_MASK(val) bfin_write16(TWI0_INT_MASK, val)
202#define bfin_read_TWI0_FIFO_CTRL() bfin_read16(TWI0_FIFO_CTRL)
203#define bfin_write_TWI0_FIFO_CTRL(val) bfin_write16(TWI0_FIFO_CTRL, val)
204#define bfin_read_TWI0_FIFO_STAT() bfin_read16(TWI0_FIFO_STAT)
205#define bfin_write_TWI0_FIFO_STAT(val) bfin_write16(TWI0_FIFO_STAT, val)
206#define bfin_read_TWI0_XMT_DATA8() bfin_read16(TWI0_XMT_DATA8)
207#define bfin_write_TWI0_XMT_DATA8(val) bfin_write16(TWI0_XMT_DATA8, val)
208#define bfin_read_TWI0_XMT_DATA16() bfin_read16(TWI0_XMT_DATA16)
209#define bfin_write_TWI0_XMT_DATA16(val) bfin_write16(TWI0_XMT_DATA16, val)
210#define bfin_read_TWI0_RCV_DATA8() bfin_read16(TWI0_RCV_DATA8)
211#define bfin_write_TWI0_RCV_DATA8(val) bfin_write16(TWI0_RCV_DATA8, val)
212#define bfin_read_TWI0_RCV_DATA16() bfin_read16(TWI0_RCV_DATA16)
213#define bfin_write_TWI0_RCV_DATA16(val) bfin_write16(TWI0_RCV_DATA16, val)
214
215/* SPORT0 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 bfin_read_()rocessors */
216
217/* SPORT1 Registers */
218
219#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
220#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1, val)
221#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
222#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2, val)
223#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
224#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
225#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
226#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV, val)
227#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
228#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX, val)
229#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
230#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX, val)
231#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
232#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1, val)
233#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
234#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2, val)
235#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
236#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
237#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
238#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV, val)
239#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
240#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT, val)
241#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
242#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL, val)
243#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
244#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1, val)
245#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
246#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2, val)
247#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
248#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0, val)
249#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
250#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1, val)
251#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
252#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2, val)
253#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
254#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3, val)
255#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
256#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0, val)
257#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
258#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1, val)
259#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
260#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2, val)
261#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
262#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3, val)
263
264/* Asynchronous Memory Control Registers */
265
266#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
267#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL, val)
268#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
269#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0, val)
270#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
271#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1, val)
272#define bfin_read_EBIU_MBSCTL() bfin_read16(EBIU_MBSCTL)
273#define bfin_write_EBIU_MBSCTL(val) bfin_write16(EBIU_MBSCTL, val)
274#define bfin_read_EBIU_ARBSTAT() bfin_read32(EBIU_ARBSTAT)
275#define bfin_write_EBIU_ARBSTAT(val) bfin_write32(EBIU_ARBSTAT, val)
276#define bfin_read_EBIU_MODE() bfin_read32(EBIU_MODE)
277#define bfin_write_EBIU_MODE(val) bfin_write32(EBIU_MODE, val)
278#define bfin_read_EBIU_FCTL() bfin_read16(EBIU_FCTL)
279#define bfin_write_EBIU_FCTL(val) bfin_write16(EBIU_FCTL, val)
280
281/* DDR Memory Control Registers */
282
283#define bfin_read_EBIU_DDRCTL0() bfin_read32(EBIU_DDRCTL0)
284#define bfin_write_EBIU_DDRCTL0(val) bfin_write32(EBIU_DDRCTL0, val)
285#define bfin_read_EBIU_DDRCTL1() bfin_read32(EBIU_DDRCTL1)
286#define bfin_write_EBIU_DDRCTL1(val) bfin_write32(EBIU_DDRCTL1, val)
287#define bfin_read_EBIU_DDRCTL2() bfin_read32(EBIU_DDRCTL2)
288#define bfin_write_EBIU_DDRCTL2(val) bfin_write32(EBIU_DDRCTL2, val)
289#define bfin_read_EBIU_DDRCTL3() bfin_read32(EBIU_DDRCTL3)
290#define bfin_write_EBIU_DDRCTL3(val) bfin_write32(EBIU_DDRCTL3, val)
291#define bfin_read_EBIU_DDRQUE() bfin_read32(EBIU_DDRQUE)
292#define bfin_write_EBIU_DDRQUE(val) bfin_write32(EBIU_DDRQUE, val)
293#define bfin_read_EBIU_ERRADD() bfin_read32(EBIU_ERRADD)
294#define bfin_write_EBIU_ERRADD(val) bfin_write32(EBIU_ERRADD)
295#define bfin_read_EBIU_ERRMST() bfin_read16(EBIU_ERRMST)
296#define bfin_write_EBIU_ERRMST(val) bfin_write16(EBIU_ERRMST, val)
297#define bfin_read_EBIU_RSTCTL() bfin_read16(EBIU_RSTCTL)
298#define bfin_write_EBIU_RSTCTL(val) bfin_write16(EBIU_RSTCTL, val)
299
300/* DDR BankRead and Write Count Registers */
301
302#define bfin_read_EBIU_DDRBRC0() bfin_read32(EBIU_DDRBRC0)
303#define bfin_write_EBIU_DDRBRC0(val) bfin_write32(EBIU_DDRBRC0, val)
304#define bfin_read_EBIU_DDRBRC1() bfin_read32(EBIU_DDRBRC1)
305#define bfin_write_EBIU_DDRBRC1(val) bfin_write32(EBIU_DDRBRC1, val)
306#define bfin_read_EBIU_DDRBRC2() bfin_read32(EBIU_DDRBRC2)
307#define bfin_write_EBIU_DDRBRC2(val) bfin_write32(EBIU_DDRBRC2, val)
308#define bfin_read_EBIU_DDRBRC3() bfin_read32(EBIU_DDRBRC3)
309#define bfin_write_EBIU_DDRBRC3(val) bfin_write32(EBIU_DDRBRC3, val)
310#define bfin_read_EBIU_DDRBRC4() bfin_read32(EBIU_DDRBRC4)
311#define bfin_write_EBIU_DDRBRC4(val) bfin_write32(EBIU_DDRBRC4, val)
312#define bfin_read_EBIU_DDRBRC5() bfin_read32(EBIU_DDRBRC5)
313#define bfin_write_EBIU_DDRBRC5(val) bfin_write32(EBIU_DDRBRC5, val)
314#define bfin_read_EBIU_DDRBRC6() bfin_read32(EBIU_DDRBRC6)
315#define bfin_write_EBIU_DDRBRC6(val) bfin_write32(EBIU_DDRBRC6, val)
316#define bfin_read_EBIU_DDRBRC7() bfin_read32(EBIU_DDRBRC7)
317#define bfin_write_EBIU_DDRBRC7(val) bfin_write32(EBIU_DDRBRC7, val)
318#define bfin_read_EBIU_DDRBWC0() bfin_read32(EBIU_DDRBWC0)
319#define bfin_write_EBIU_DDRBWC0(val) bfin_write32(EBIU_DDRBWC0, val)
320#define bfin_read_EBIU_DDRBWC1() bfin_read32(EBIU_DDRBWC1)
321#define bfin_write_EBIU_DDRBWC1(val) bfin_write32(EBIU_DDRBWC1, val)
322#define bfin_read_EBIU_DDRBWC2() bfin_read32(EBIU_DDRBWC2)
323#define bfin_write_EBIU_DDRBWC2(val) bfin_write32(EBIU_DDRBWC2, val)
324#define bfin_read_EBIU_DDRBWC3() bfin_read32(EBIU_DDRBWC3)
325#define bfin_write_EBIU_DDRBWC3(val) bfin_write32(EBIU_DDRBWC3, val)
326#define bfin_read_EBIU_DDRBWC4() bfin_read32(EBIU_DDRBWC4)
327#define bfin_write_EBIU_DDRBWC4(val) bfin_write32(EBIU_DDRBWC4, val)
328#define bfin_read_EBIU_DDRBWC5() bfin_read32(EBIU_DDRBWC5)
329#define bfin_write_EBIU_DDRBWC5(val) bfin_write32(EBIU_DDRBWC5, val)
330#define bfin_read_EBIU_DDRBWC6() bfin_read32(EBIU_DDRBWC6)
331#define bfin_write_EBIU_DDRBWC6(val) bfin_write32(EBIU_DDRBWC6, val)
332#define bfin_read_EBIU_DDRBWC7() bfin_read32(EBIU_DDRBWC7)
333#define bfin_write_EBIU_DDRBWC7(val) bfin_write32(EBIU_DDRBWC7, val)
334#define bfin_read_EBIU_DDRACCT() bfin_read32(EBIU_DDRACCT)
335#define bfin_write_EBIU_DDRACCT(val) bfin_write32(EBIU_DDRACCT, val)
336#define bfin_read_EBIU_DDRTACT() bfin_read32(EBIU_DDRTACT)
337#define bfin_write_EBIU_DDRTACT(val) bfin_write32(EBIU_DDRTACT, val)
338#define bfin_read_EBIU_DDRARCT() bfin_read32(EBIU_DDRARCT)
339#define bfin_write_EBIU_DDRARCT(val) bfin_write32(EBIU_DDRARCT, val)
340#define bfin_read_EBIU_DDRGC0() bfin_read32(EBIU_DDRGC0)
341#define bfin_write_EBIU_DDRGC0(val) bfin_write32(EBIU_DDRGC0, val)
342#define bfin_read_EBIU_DDRGC1() bfin_read32(EBIU_DDRGC1)
343#define bfin_write_EBIU_DDRGC1(val) bfin_write32(EBIU_DDRGC1, val)
344#define bfin_read_EBIU_DDRGC2() bfin_read32(EBIU_DDRGC2)
345#define bfin_write_EBIU_DDRGC2(val) bfin_write32(EBIU_DDRGC2, val)
346#define bfin_read_EBIU_DDRGC3() bfin_read32(EBIU_DDRGC3)
347#define bfin_write_EBIU_DDRGC3(val) bfin_write32(EBIU_DDRGC3, val)
348#define bfin_read_EBIU_DDRMCEN() bfin_read32(EBIU_DDRMCEN)
349#define bfin_write_EBIU_DDRMCEN(val) bfin_write32(EBIU_DDRMCEN, val)
350#define bfin_read_EBIU_DDRMCCL() bfin_read32(EBIU_DDRMCCL)
351#define bfin_write_EBIU_DDRMCCL(val) bfin_write32(EBIU_DDRMCCL, val)
352
353/* DMAC0 Registers */
354
355#define bfin_read_DMAC0_TCPER() bfin_read16(DMAC0_TCPER)
356#define bfin_write_DMAC0_TCPER(val) bfin_write16(DMAC0_TCPER, val)
357#define bfin_read_DMAC0_TCCNT() bfin_read16(DMAC0_TCCNT)
358#define bfin_write_DMAC0_TCCNT(val) bfin_write16(DMAC0_TCCNT, val)
359
360/* DMA Channel 0 Registers */
361
362#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_read32(DMA0_NEXT_DESC_PTR)
363#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_write32(DMA0_NEXT_DESC_PTR)
364#define bfin_read_DMA0_START_ADDR() bfin_read32(DMA0_START_ADDR)
365#define bfin_write_DMA0_START_ADDR(val) bfin_write32(DMA0_START_ADDR)
366#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
367#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG, val)
368#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
369#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT, val)
370#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
371#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY)
372#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
373#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT, val)
374#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
375#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY)
376#define bfin_read_DMA0_CURR_DESC_PTR() bfin_read32(DMA0_CURR_DESC_PTR)
377#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_write32(DMA0_CURR_DESC_PTR)
378#define bfin_read_DMA0_CURR_ADDR() bfin_read32(DMA0_CURR_ADDR)
379#define bfin_write_DMA0_CURR_ADDR(val) bfin_write32(DMA0_CURR_ADDR)
380#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
381#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
382#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
383#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
384#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
385#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
386#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
387#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
388
389/* DMA Channel 1 Registers */
390
391#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_read32(DMA1_NEXT_DESC_PTR)
392#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_write32(DMA1_NEXT_DESC_PTR)
393#define bfin_read_DMA1_START_ADDR() bfin_read32(DMA1_START_ADDR)
394#define bfin_write_DMA1_START_ADDR(val) bfin_write32(DMA1_START_ADDR)
395#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
396#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG, val)
397#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
398#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT, val)
399#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
400#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY)
401#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
402#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT, val)
403#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
404#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY)
405#define bfin_read_DMA1_CURR_DESC_PTR() bfin_read32(DMA1_CURR_DESC_PTR)
406#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_write32(DMA1_CURR_DESC_PTR)
407#define bfin_read_DMA1_CURR_ADDR() bfin_read32(DMA1_CURR_ADDR)
408#define bfin_write_DMA1_CURR_ADDR(val) bfin_write32(DMA1_CURR_ADDR)
409#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
410#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
411#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
412#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
413#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
414#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
415#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
416#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
417
418/* DMA Channel 2 Registers */
419
420#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_read32(DMA2_NEXT_DESC_PTR)
421#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_write32(DMA2_NEXT_DESC_PTR)
422#define bfin_read_DMA2_START_ADDR() bfin_read32(DMA2_START_ADDR)
423#define bfin_write_DMA2_START_ADDR(val) bfin_write32(DMA2_START_ADDR)
424#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
425#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG, val)
426#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
427#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT, val)
428#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
429#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY)
430#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
431#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT, val)
432#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
433#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY)
434#define bfin_read_DMA2_CURR_DESC_PTR() bfin_read32(DMA2_CURR_DESC_PTR)
435#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_write32(DMA2_CURR_DESC_PTR)
436#define bfin_read_DMA2_CURR_ADDR() bfin_read32(DMA2_CURR_ADDR)
437#define bfin_write_DMA2_CURR_ADDR(val) bfin_write32(DMA2_CURR_ADDR)
438#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
439#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
440#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
441#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
442#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
443#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
444#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
445#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
446
447/* DMA Channel 3 Registers */
448
449#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_read32(DMA3_NEXT_DESC_PTR)
450#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_write32(DMA3_NEXT_DESC_PTR)
451#define bfin_read_DMA3_START_ADDR() bfin_read32(DMA3_START_ADDR)
452#define bfin_write_DMA3_START_ADDR(val) bfin_write32(DMA3_START_ADDR)
453#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
454#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG, val)
455#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
456#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT, val)
457#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
458#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY)
459#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
460#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT, val)
461#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
462#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY)
463#define bfin_read_DMA3_CURR_DESC_PTR() bfin_read32(DMA3_CURR_DESC_PTR)
464#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_write32(DMA3_CURR_DESC_PTR)
465#define bfin_read_DMA3_CURR_ADDR() bfin_read32(DMA3_CURR_ADDR)
466#define bfin_write_DMA3_CURR_ADDR(val) bfin_write32(DMA3_CURR_ADDR)
467#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
468#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
469#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
470#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
471#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
472#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
473#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
474#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
475
476/* DMA Channel 4 Registers */
477
478#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_read32(DMA4_NEXT_DESC_PTR)
479#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_write32(DMA4_NEXT_DESC_PTR)
480#define bfin_read_DMA4_START_ADDR() bfin_read32(DMA4_START_ADDR)
481#define bfin_write_DMA4_START_ADDR(val) bfin_write32(DMA4_START_ADDR)
482#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
483#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG, val)
484#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
485#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT, val)
486#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
487#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY)
488#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
489#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT, val)
490#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
491#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY)
492#define bfin_read_DMA4_CURR_DESC_PTR() bfin_read32(DMA4_CURR_DESC_PTR)
493#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_write32(DMA4_CURR_DESC_PTR)
494#define bfin_read_DMA4_CURR_ADDR() bfin_read32(DMA4_CURR_ADDR)
495#define bfin_write_DMA4_CURR_ADDR(val) bfin_write32(DMA4_CURR_ADDR)
496#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
497#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
498#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
499#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
500#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
501#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
502#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
503#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
504
505/* DMA Channel 5 Registers */
506
507#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_read32(DMA5_NEXT_DESC_PTR)
508#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_write32(DMA5_NEXT_DESC_PTR)
509#define bfin_read_DMA5_START_ADDR() bfin_read32(DMA5_START_ADDR)
510#define bfin_write_DMA5_START_ADDR(val) bfin_write32(DMA5_START_ADDR)
511#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
512#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG, val)
513#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
514#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT, val)
515#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
516#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY)
517#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
518#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT, val)
519#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
520#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY)
521#define bfin_read_DMA5_CURR_DESC_PTR() bfin_read32(DMA5_CURR_DESC_PTR)
522#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_write32(DMA5_CURR_DESC_PTR)
523#define bfin_read_DMA5_CURR_ADDR() bfin_read32(DMA5_CURR_ADDR)
524#define bfin_write_DMA5_CURR_ADDR(val) bfin_write32(DMA5_CURR_ADDR)
525#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
526#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
527#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
528#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
529#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
530#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
531#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
532#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
533
534/* DMA Channel 6 Registers */
535
536#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
537#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR)
538#define bfin_read_DMA6_START_ADDR() bfin_read32(DMA6_START_ADDR)
539#define bfin_write_DMA6_START_ADDR(val) bfin_write32(DMA6_START_ADDR)
540#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
541#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG, val)
542#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
543#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT, val)
544#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
545#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY)
546#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
547#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT, val)
548#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
549#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY)
550#define bfin_read_DMA6_CURR_DESC_PTR() bfin_read32(DMA6_CURR_DESC_PTR)
551#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_write32(DMA6_CURR_DESC_PTR)
552#define bfin_read_DMA6_CURR_ADDR() bfin_read32(DMA6_CURR_ADDR)
553#define bfin_write_DMA6_CURR_ADDR(val) bfin_write32(DMA6_CURR_ADDR)
554#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
555#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
556#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
557#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
558#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
559#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
560#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
561#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
562
563/* DMA Channel 7 Registers */
564
565#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_read32(DMA7_NEXT_DESC_PTR)
566#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_write32(DMA7_NEXT_DESC_PTR)
567#define bfin_read_DMA7_START_ADDR() bfin_read32(DMA7_START_ADDR)
568#define bfin_write_DMA7_START_ADDR(val) bfin_write32(DMA7_START_ADDR)
569#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
570#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG, val)
571#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
572#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT, val)
573#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
574#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY)
575#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
576#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT, val)
577#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
578#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY)
579#define bfin_read_DMA7_CURR_DESC_PTR() bfin_read32(DMA7_CURR_DESC_PTR)
580#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_write32(DMA7_CURR_DESC_PTR)
581#define bfin_read_DMA7_CURR_ADDR() bfin_read32(DMA7_CURR_ADDR)
582#define bfin_write_DMA7_CURR_ADDR(val) bfin_write32(DMA7_CURR_ADDR)
583#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
584#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
585#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
586#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
587#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
588#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
589#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
590#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
591
592/* DMA Channel 8 Registers */
593
594#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_read32(DMA8_NEXT_DESC_PTR)
595#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_write32(DMA8_NEXT_DESC_PTR)
596#define bfin_read_DMA8_START_ADDR() bfin_read32(DMA8_START_ADDR)
597#define bfin_write_DMA8_START_ADDR(val) bfin_write32(DMA8_START_ADDR)
598#define bfin_read_DMA8_CONFIG() bfin_read16(DMA8_CONFIG)
599#define bfin_write_DMA8_CONFIG(val) bfin_write16(DMA8_CONFIG, val)
600#define bfin_read_DMA8_X_COUNT() bfin_read16(DMA8_X_COUNT)
601#define bfin_write_DMA8_X_COUNT(val) bfin_write16(DMA8_X_COUNT, val)
602#define bfin_read_DMA8_X_MODIFY() bfin_read16(DMA8_X_MODIFY)
603#define bfin_write_DMA8_X_MODIFY(val) bfin_write16(DMA8_X_MODIFY)
604#define bfin_read_DMA8_Y_COUNT() bfin_read16(DMA8_Y_COUNT)
605#define bfin_write_DMA8_Y_COUNT(val) bfin_write16(DMA8_Y_COUNT, val)
606#define bfin_read_DMA8_Y_MODIFY() bfin_read16(DMA8_Y_MODIFY)
607#define bfin_write_DMA8_Y_MODIFY(val) bfin_write16(DMA8_Y_MODIFY)
608#define bfin_read_DMA8_CURR_DESC_PTR() bfin_read32(DMA8_CURR_DESC_PTR)
609#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_write32(DMA8_CURR_DESC_PTR)
610#define bfin_read_DMA8_CURR_ADDR() bfin_read32(DMA8_CURR_ADDR)
611#define bfin_write_DMA8_CURR_ADDR(val) bfin_write32(DMA8_CURR_ADDR)
612#define bfin_read_DMA8_IRQ_STATUS() bfin_read16(DMA8_IRQ_STATUS)
613#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
614#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
615#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
616#define bfin_read_DMA8_CURR_X_COUNT() bfin_read16(DMA8_CURR_X_COUNT)
617#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
618#define bfin_read_DMA8_CURR_Y_COUNT() bfin_read16(DMA8_CURR_Y_COUNT)
619#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
620
621/* DMA Channel 9 Registers */
622
623#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_read32(DMA9_NEXT_DESC_PTR)
624#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_write32(DMA9_NEXT_DESC_PTR)
625#define bfin_read_DMA9_START_ADDR() bfin_read32(DMA9_START_ADDR)
626#define bfin_write_DMA9_START_ADDR(val) bfin_write32(DMA9_START_ADDR)
627#define bfin_read_DMA9_CONFIG() bfin_read16(DMA9_CONFIG)
628#define bfin_write_DMA9_CONFIG(val) bfin_write16(DMA9_CONFIG, val)
629#define bfin_read_DMA9_X_COUNT() bfin_read16(DMA9_X_COUNT)
630#define bfin_write_DMA9_X_COUNT(val) bfin_write16(DMA9_X_COUNT, val)
631#define bfin_read_DMA9_X_MODIFY() bfin_read16(DMA9_X_MODIFY)
632#define bfin_write_DMA9_X_MODIFY(val) bfin_write16(DMA9_X_MODIFY)
633#define bfin_read_DMA9_Y_COUNT() bfin_read16(DMA9_Y_COUNT)
634#define bfin_write_DMA9_Y_COUNT(val) bfin_write16(DMA9_Y_COUNT, val)
635#define bfin_read_DMA9_Y_MODIFY() bfin_read16(DMA9_Y_MODIFY)
636#define bfin_write_DMA9_Y_MODIFY(val) bfin_write16(DMA9_Y_MODIFY)
637#define bfin_read_DMA9_CURR_DESC_PTR() bfin_read32(DMA9_CURR_DESC_PTR)
638#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_write32(DMA9_CURR_DESC_PTR)
639#define bfin_read_DMA9_CURR_ADDR() bfin_read32(DMA9_CURR_ADDR)
640#define bfin_write_DMA9_CURR_ADDR(val) bfin_write32(DMA9_CURR_ADDR)
641#define bfin_read_DMA9_IRQ_STATUS() bfin_read16(DMA9_IRQ_STATUS)
642#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
643#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
644#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
645#define bfin_read_DMA9_CURR_X_COUNT() bfin_read16(DMA9_CURR_X_COUNT)
646#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
647#define bfin_read_DMA9_CURR_Y_COUNT() bfin_read16(DMA9_CURR_Y_COUNT)
648#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
649
650/* DMA Channel 10 Registers */
651
652#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_read32(DMA10_NEXT_DESC_PTR)
653#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_write32(DMA10_NEXT_DESC_PTR)
654#define bfin_read_DMA10_START_ADDR() bfin_read32(DMA10_START_ADDR)
655#define bfin_write_DMA10_START_ADDR(val) bfin_write32(DMA10_START_ADDR)
656#define bfin_read_DMA10_CONFIG() bfin_read16(DMA10_CONFIG)
657#define bfin_write_DMA10_CONFIG(val) bfin_write16(DMA10_CONFIG, val)
658#define bfin_read_DMA10_X_COUNT() bfin_read16(DMA10_X_COUNT)
659#define bfin_write_DMA10_X_COUNT(val) bfin_write16(DMA10_X_COUNT, val)
660#define bfin_read_DMA10_X_MODIFY() bfin_read16(DMA10_X_MODIFY)
661#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY)
662#define bfin_read_DMA10_Y_COUNT() bfin_read16(DMA10_Y_COUNT)
663#define bfin_write_DMA10_Y_COUNT(val) bfin_write16(DMA10_Y_COUNT, val)
664#define bfin_read_DMA10_Y_MODIFY() bfin_read16(DMA10_Y_MODIFY)
665#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY)
666#define bfin_read_DMA10_CURR_DESC_PTR() bfin_read32(DMA10_CURR_DESC_PTR)
667#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_write32(DMA10_CURR_DESC_PTR)
668#define bfin_read_DMA10_CURR_ADDR() bfin_read32(DMA10_CURR_ADDR)
669#define bfin_write_DMA10_CURR_ADDR(val) bfin_write32(DMA10_CURR_ADDR)
670#define bfin_read_DMA10_IRQ_STATUS() bfin_read16(DMA10_IRQ_STATUS)
671#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
672#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
673#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
674#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
675#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
676#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
677#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
678
679/* DMA Channel 11 Registers */
680
681#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_read32(DMA11_NEXT_DESC_PTR)
682#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_write32(DMA11_NEXT_DESC_PTR)
683#define bfin_read_DMA11_START_ADDR() bfin_read32(DMA11_START_ADDR)
684#define bfin_write_DMA11_START_ADDR(val) bfin_write32(DMA11_START_ADDR)
685#define bfin_read_DMA11_CONFIG() bfin_read16(DMA11_CONFIG)
686#define bfin_write_DMA11_CONFIG(val) bfin_write16(DMA11_CONFIG, val)
687#define bfin_read_DMA11_X_COUNT() bfin_read16(DMA11_X_COUNT)
688#define bfin_write_DMA11_X_COUNT(val) bfin_write16(DMA11_X_COUNT, val)
689#define bfin_read_DMA11_X_MODIFY() bfin_read16(DMA11_X_MODIFY)
690#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY)
691#define bfin_read_DMA11_Y_COUNT() bfin_read16(DMA11_Y_COUNT)
692#define bfin_write_DMA11_Y_COUNT(val) bfin_write16(DMA11_Y_COUNT, val)
693#define bfin_read_DMA11_Y_MODIFY() bfin_read16(DMA11_Y_MODIFY)
694#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY)
695#define bfin_read_DMA11_CURR_DESC_PTR() bfin_read32(DMA11_CURR_DESC_PTR)
696#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_write32(DMA11_CURR_DESC_PTR)
697#define bfin_read_DMA11_CURR_ADDR() bfin_read32(DMA11_CURR_ADDR)
698#define bfin_write_DMA11_CURR_ADDR(val) bfin_write32(DMA11_CURR_ADDR)
699#define bfin_read_DMA11_IRQ_STATUS() bfin_read16(DMA11_IRQ_STATUS)
700#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
701#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
702#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
703#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
704#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
705#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
706#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
707
708/* MDMA Stream 0 Registers */
709
710#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
711#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR)
712#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
713#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR)
714#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
715#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
716#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
717#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
718#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
719#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY)
720#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
721#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
722#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
723#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY)
724#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
725#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR)
726#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
727#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR)
728#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
729#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
730#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
731#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP, val)
732#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
733#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT, val)
734#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
735#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
736#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
737#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR)
738#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
739#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR)
740#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
741#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
742#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
743#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
744#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
745#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY)
746#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
747#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
748#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
749#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY)
750#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
751#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR)
752#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
753#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR)
754#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
755#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val)
756#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
757#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP, val)
758#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
759#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT, val)
760#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
761#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT, val)
762
763/* MDMA Stream 1 Registers */
764
765#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
766#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR)
767#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
768#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR)
769#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
770#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
771#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
772#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT, val)
773#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
774#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY)
775#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
776#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT, val)
777#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
778#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY)
779#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
780#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR)
781#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
782#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR)
783#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
784#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
785#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
786#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP, val)
787#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
788#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT, val)
789#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
790#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
791#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
792#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR)
793#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
794#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR)
795#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
796#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
797#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
798#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT, val)
799#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
800#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY)
801#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
802#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT, val)
803#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
804#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY)
805#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
806#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR)
807#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
808#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR)
809#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
810#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
811#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
812#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP, val)
813#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
814#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT, val)
815#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
816#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT, val)
817
818/* EPPI1 Registers */
819
820#define bfin_read_EPPI1_STATUS() bfin_read16(EPPI1_STATUS)
821#define bfin_write_EPPI1_STATUS(val) bfin_write16(EPPI1_STATUS, val)
822#define bfin_read_EPPI1_HCOUNT() bfin_read16(EPPI1_HCOUNT)
823#define bfin_write_EPPI1_HCOUNT(val) bfin_write16(EPPI1_HCOUNT, val)
824#define bfin_read_EPPI1_HDELAY() bfin_read16(EPPI1_HDELAY)
825#define bfin_write_EPPI1_HDELAY(val) bfin_write16(EPPI1_HDELAY, val)
826#define bfin_read_EPPI1_VCOUNT() bfin_read16(EPPI1_VCOUNT)
827#define bfin_write_EPPI1_VCOUNT(val) bfin_write16(EPPI1_VCOUNT, val)
828#define bfin_read_EPPI1_VDELAY() bfin_read16(EPPI1_VDELAY)
829#define bfin_write_EPPI1_VDELAY(val) bfin_write16(EPPI1_VDELAY, val)
830#define bfin_read_EPPI1_FRAME() bfin_read16(EPPI1_FRAME)
831#define bfin_write_EPPI1_FRAME(val) bfin_write16(EPPI1_FRAME, val)
832#define bfin_read_EPPI1_LINE() bfin_read16(EPPI1_LINE)
833#define bfin_write_EPPI1_LINE(val) bfin_write16(EPPI1_LINE, val)
834#define bfin_read_EPPI1_CLKDIV() bfin_read16(EPPI1_CLKDIV)
835#define bfin_write_EPPI1_CLKDIV(val) bfin_write16(EPPI1_CLKDIV, val)
836#define bfin_read_EPPI1_CONTROL() bfin_read32(EPPI1_CONTROL)
837#define bfin_write_EPPI1_CONTROL(val) bfin_write32(EPPI1_CONTROL, val)
838#define bfin_read_EPPI1_FS1W_HBL() bfin_read32(EPPI1_FS1W_HBL)
839#define bfin_write_EPPI1_FS1W_HBL(val) bfin_write32(EPPI1_FS1W_HBL, val)
840#define bfin_read_EPPI1_FS1P_AVPL() bfin_read32(EPPI1_FS1P_AVPL)
841#define bfin_write_EPPI1_FS1P_AVPL(val) bfin_write32(EPPI1_FS1P_AVPL, val)
842#define bfin_read_EPPI1_FS2W_LVB() bfin_read32(EPPI1_FS2W_LVB)
843#define bfin_write_EPPI1_FS2W_LVB(val) bfin_write32(EPPI1_FS2W_LVB, val)
844#define bfin_read_EPPI1_FS2P_LAVF() bfin_read32(EPPI1_FS2P_LAVF)
845#define bfin_write_EPPI1_FS2P_LAVF(val) bfin_write32(EPPI1_FS2P_LAVF, val)
846#define bfin_read_EPPI1_CLIP() bfin_read32(EPPI1_CLIP)
847#define bfin_write_EPPI1_CLIP(val) bfin_write32(EPPI1_CLIP, val)
848
849/* Port Interrubfin_read_()t 0 Registers (32-bit) */
850
851#define bfin_read_PINT0_MASK_SET() bfin_read32(PINT0_MASK_SET)
852#define bfin_write_PINT0_MASK_SET(val) bfin_write32(PINT0_MASK_SET, val)
853#define bfin_read_PINT0_MASK_CLEAR() bfin_read32(PINT0_MASK_CLEAR)
854#define bfin_write_PINT0_MASK_CLEAR(val) bfin_write32(PINT0_MASK_CLEAR, val)
855#define bfin_read_PINT0_REQUEST() bfin_read32(PINT0_REQUEST)
856#define bfin_write_PINT0_REQUEST(val) bfin_write32(PINT0_REQUEST, val)
857#define bfin_read_PINT0_ASSIGN() bfin_read32(PINT0_ASSIGN)
858#define bfin_write_PINT0_ASSIGN(val) bfin_write32(PINT0_ASSIGN, val)
859#define bfin_read_PINT0_EDGE_SET() bfin_read32(PINT0_EDGE_SET)
860#define bfin_write_PINT0_EDGE_SET(val) bfin_write32(PINT0_EDGE_SET, val)
861#define bfin_read_PINT0_EDGE_CLEAR() bfin_read32(PINT0_EDGE_CLEAR)
862#define bfin_write_PINT0_EDGE_CLEAR(val) bfin_write32(PINT0_EDGE_CLEAR, val)
863#define bfin_read_PINT0_INVERT_SET() bfin_read32(PINT0_INVERT_SET)
864#define bfin_write_PINT0_INVERT_SET(val) bfin_write32(PINT0_INVERT_SET, val)
865#define bfin_read_PINT0_INVERT_CLEAR() bfin_read32(PINT0_INVERT_CLEAR)
866#define bfin_write_PINT0_INVERT_CLEAR(val) bfin_write32(PINT0_INVERT_CLEAR, val)
867#define bfin_read_PINT0_PINSTATE() bfin_read32(PINT0_PINSTATE)
868#define bfin_write_PINT0_PINSTATE(val) bfin_write32(PINT0_PINSTATE, val)
869#define bfin_read_PINT0_LATCH() bfin_read32(PINT0_LATCH)
870#define bfin_write_PINT0_LATCH(val) bfin_write32(PINT0_LATCH, val)
871
872/* Port Interrubfin_read_()t 1 Registers (32-bit) */
873
874#define bfin_read_PINT1_MASK_SET() bfin_read32(PINT1_MASK_SET)
875#define bfin_write_PINT1_MASK_SET(val) bfin_write32(PINT1_MASK_SET, val)
876#define bfin_read_PINT1_MASK_CLEAR() bfin_read32(PINT1_MASK_CLEAR)
877#define bfin_write_PINT1_MASK_CLEAR(val) bfin_write32(PINT1_MASK_CLEAR, val)
878#define bfin_read_PINT1_REQUEST() bfin_read32(PINT1_REQUEST)
879#define bfin_write_PINT1_REQUEST(val) bfin_write32(PINT1_REQUEST, val)
880#define bfin_read_PINT1_ASSIGN() bfin_read32(PINT1_ASSIGN)
881#define bfin_write_PINT1_ASSIGN(val) bfin_write32(PINT1_ASSIGN, val)
882#define bfin_read_PINT1_EDGE_SET() bfin_read32(PINT1_EDGE_SET)
883#define bfin_write_PINT1_EDGE_SET(val) bfin_write32(PINT1_EDGE_SET, val)
884#define bfin_read_PINT1_EDGE_CLEAR() bfin_read32(PINT1_EDGE_CLEAR)
885#define bfin_write_PINT1_EDGE_CLEAR(val) bfin_write32(PINT1_EDGE_CLEAR, val)
886#define bfin_read_PINT1_INVERT_SET() bfin_read32(PINT1_INVERT_SET)
887#define bfin_write_PINT1_INVERT_SET(val) bfin_write32(PINT1_INVERT_SET, val)
888#define bfin_read_PINT1_INVERT_CLEAR() bfin_read32(PINT1_INVERT_CLEAR)
889#define bfin_write_PINT1_INVERT_CLEAR(val) bfin_write32(PINT1_INVERT_CLEAR, val)
890#define bfin_read_PINT1_PINSTATE() bfin_read32(PINT1_PINSTATE)
891#define bfin_write_PINT1_PINSTATE(val) bfin_write32(PINT1_PINSTATE, val)
892#define bfin_read_PINT1_LATCH() bfin_read32(PINT1_LATCH)
893#define bfin_write_PINT1_LATCH(val) bfin_write32(PINT1_LATCH, val)
894
895/* Port Interrubfin_read_()t 2 Registers (32-bit) */
896
897#define bfin_read_PINT2_MASK_SET() bfin_read32(PINT2_MASK_SET)
898#define bfin_write_PINT2_MASK_SET(val) bfin_write32(PINT2_MASK_SET, val)
899#define bfin_read_PINT2_MASK_CLEAR() bfin_read32(PINT2_MASK_CLEAR)
900#define bfin_write_PINT2_MASK_CLEAR(val) bfin_write32(PINT2_MASK_CLEAR, val)
901#define bfin_read_PINT2_REQUEST() bfin_read32(PINT2_REQUEST)
902#define bfin_write_PINT2_REQUEST(val) bfin_write32(PINT2_REQUEST, val)
903#define bfin_read_PINT2_ASSIGN() bfin_read32(PINT2_ASSIGN)
904#define bfin_write_PINT2_ASSIGN(val) bfin_write32(PINT2_ASSIGN, val)
905#define bfin_read_PINT2_EDGE_SET() bfin_read32(PINT2_EDGE_SET)
906#define bfin_write_PINT2_EDGE_SET(val) bfin_write32(PINT2_EDGE_SET, val)
907#define bfin_read_PINT2_EDGE_CLEAR() bfin_read32(PINT2_EDGE_CLEAR)
908#define bfin_write_PINT2_EDGE_CLEAR(val) bfin_write32(PINT2_EDGE_CLEAR, val)
909#define bfin_read_PINT2_INVERT_SET() bfin_read32(PINT2_INVERT_SET)
910#define bfin_write_PINT2_INVERT_SET(val) bfin_write32(PINT2_INVERT_SET, val)
911#define bfin_read_PINT2_INVERT_CLEAR() bfin_read32(PINT2_INVERT_CLEAR)
912#define bfin_write_PINT2_INVERT_CLEAR(val) bfin_write32(PINT2_INVERT_CLEAR, val)
913#define bfin_read_PINT2_PINSTATE() bfin_read32(PINT2_PINSTATE)
914#define bfin_write_PINT2_PINSTATE(val) bfin_write32(PINT2_PINSTATE, val)
915#define bfin_read_PINT2_LATCH() bfin_read32(PINT2_LATCH)
916#define bfin_write_PINT2_LATCH(val) bfin_write32(PINT2_LATCH, val)
917
918/* Port Interrubfin_read_()t 3 Registers (32-bit) */
919
920#define bfin_read_PINT3_MASK_SET() bfin_read32(PINT3_MASK_SET)
921#define bfin_write_PINT3_MASK_SET(val) bfin_write32(PINT3_MASK_SET, val)
922#define bfin_read_PINT3_MASK_CLEAR() bfin_read32(PINT3_MASK_CLEAR)
923#define bfin_write_PINT3_MASK_CLEAR(val) bfin_write32(PINT3_MASK_CLEAR, val)
924#define bfin_read_PINT3_REQUEST() bfin_read32(PINT3_REQUEST)
925#define bfin_write_PINT3_REQUEST(val) bfin_write32(PINT3_REQUEST, val)
926#define bfin_read_PINT3_ASSIGN() bfin_read32(PINT3_ASSIGN)
927#define bfin_write_PINT3_ASSIGN(val) bfin_write32(PINT3_ASSIGN, val)
928#define bfin_read_PINT3_EDGE_SET() bfin_read32(PINT3_EDGE_SET)
929#define bfin_write_PINT3_EDGE_SET(val) bfin_write32(PINT3_EDGE_SET, val)
930#define bfin_read_PINT3_EDGE_CLEAR() bfin_read32(PINT3_EDGE_CLEAR)
931#define bfin_write_PINT3_EDGE_CLEAR(val) bfin_write32(PINT3_EDGE_CLEAR, val)
932#define bfin_read_PINT3_INVERT_SET() bfin_read32(PINT3_INVERT_SET)
933#define bfin_write_PINT3_INVERT_SET(val) bfin_write32(PINT3_INVERT_SET, val)
934#define bfin_read_PINT3_INVERT_CLEAR() bfin_read32(PINT3_INVERT_CLEAR)
935#define bfin_write_PINT3_INVERT_CLEAR(val) bfin_write32(PINT3_INVERT_CLEAR, val)
936#define bfin_read_PINT3_PINSTATE() bfin_read32(PINT3_PINSTATE)
937#define bfin_write_PINT3_PINSTATE(val) bfin_write32(PINT3_PINSTATE, val)
938#define bfin_read_PINT3_LATCH() bfin_read32(PINT3_LATCH)
939#define bfin_write_PINT3_LATCH(val) bfin_write32(PINT3_LATCH, val)
940
941/* Port A Registers */
942
943#define bfin_read_PORTA_FER() bfin_read16(PORTA_FER)
944#define bfin_write_PORTA_FER(val) bfin_write16(PORTA_FER, val)
945#define bfin_read_PORTA() bfin_read16(PORTA)
946#define bfin_write_PORTA(val) bfin_write16(PORTA, val)
947#define bfin_read_PORTA_SET() bfin_read16(PORTA_SET)
948#define bfin_write_PORTA_SET(val) bfin_write16(PORTA_SET, val)
949#define bfin_read_PORTA_CLEAR() bfin_read16(PORTA_CLEAR)
950#define bfin_write_PORTA_CLEAR(val) bfin_write16(PORTA_CLEAR, val)
951#define bfin_read_PORTA_DIR_SET() bfin_read16(PORTA_DIR_SET)
952#define bfin_write_PORTA_DIR_SET(val) bfin_write16(PORTA_DIR_SET, val)
953#define bfin_read_PORTA_DIR_CLEAR() bfin_read16(PORTA_DIR_CLEAR)
954#define bfin_write_PORTA_DIR_CLEAR(val) bfin_write16(PORTA_DIR_CLEAR, val)
955#define bfin_read_PORTA_INEN() bfin_read16(PORTA_INEN)
956#define bfin_write_PORTA_INEN(val) bfin_write16(PORTA_INEN, val)
957#define bfin_read_PORTA_MUX() bfin_read32(PORTA_MUX)
958#define bfin_write_PORTA_MUX(val) bfin_write32(PORTA_MUX, val)
959
960/* Port B Registers */
961
962#define bfin_read_PORTB_FER() bfin_read16(PORTB_FER)
963#define bfin_write_PORTB_FER(val) bfin_write16(PORTB_FER, val)
964#define bfin_read_PORTB() bfin_read16(PORTB)
965#define bfin_write_PORTB(val) bfin_write16(PORTB, val)
966#define bfin_read_PORTB_SET() bfin_read16(PORTB_SET)
967#define bfin_write_PORTB_SET(val) bfin_write16(PORTB_SET, val)
968#define bfin_read_PORTB_CLEAR() bfin_read16(PORTB_CLEAR)
969#define bfin_write_PORTB_CLEAR(val) bfin_write16(PORTB_CLEAR, val)
970#define bfin_read_PORTB_DIR_SET() bfin_read16(PORTB_DIR_SET)
971#define bfin_write_PORTB_DIR_SET(val) bfin_write16(PORTB_DIR_SET, val)
972#define bfin_read_PORTB_DIR_CLEAR() bfin_read16(PORTB_DIR_CLEAR)
973#define bfin_write_PORTB_DIR_CLEAR(val) bfin_write16(PORTB_DIR_CLEAR, val)
974#define bfin_read_PORTB_INEN() bfin_read16(PORTB_INEN)
975#define bfin_write_PORTB_INEN(val) bfin_write16(PORTB_INEN, val)
976#define bfin_read_PORTB_MUX() bfin_read32(PORTB_MUX)
977#define bfin_write_PORTB_MUX(val) bfin_write32(PORTB_MUX, val)
978
979/* Port C Registers */
980
981#define bfin_read_PORTC_FER() bfin_read16(PORTC_FER)
982#define bfin_write_PORTC_FER(val) bfin_write16(PORTC_FER, val)
983#define bfin_read_PORTC() bfin_read16(PORTC)
984#define bfin_write_PORTC(val) bfin_write16(PORTC, val)
985#define bfin_read_PORTC_SET() bfin_read16(PORTC_SET)
986#define bfin_write_PORTC_SET(val) bfin_write16(PORTC_SET, val)
987#define bfin_read_PORTC_CLEAR() bfin_read16(PORTC_CLEAR)
988#define bfin_write_PORTC_CLEAR(val) bfin_write16(PORTC_CLEAR, val)
989#define bfin_read_PORTC_DIR_SET() bfin_read16(PORTC_DIR_SET)
990#define bfin_write_PORTC_DIR_SET(val) bfin_write16(PORTC_DIR_SET, val)
991#define bfin_read_PORTC_DIR_CLEAR() bfin_read16(PORTC_DIR_CLEAR)
992#define bfin_write_PORTC_DIR_CLEAR(val) bfin_write16(PORTC_DIR_CLEAR, val)
993#define bfin_read_PORTC_INEN() bfin_read16(PORTC_INEN)
994#define bfin_write_PORTC_INEN(val) bfin_write16(PORTC_INEN, val)
995#define bfin_read_PORTC_MUX() bfin_read32(PORTC_MUX)
996#define bfin_write_PORTC_MUX(val) bfin_write32(PORTC_MUX, val)
997
998/* Port D Registers */
999
1000#define bfin_read_PORTD_FER() bfin_read16(PORTD_FER)
1001#define bfin_write_PORTD_FER(val) bfin_write16(PORTD_FER, val)
1002#define bfin_read_PORTD() bfin_read16(PORTD)
1003#define bfin_write_PORTD(val) bfin_write16(PORTD, val)
1004#define bfin_read_PORTD_SET() bfin_read16(PORTD_SET)
1005#define bfin_write_PORTD_SET(val) bfin_write16(PORTD_SET, val)
1006#define bfin_read_PORTD_CLEAR() bfin_read16(PORTD_CLEAR)
1007#define bfin_write_PORTD_CLEAR(val) bfin_write16(PORTD_CLEAR, val)
1008#define bfin_read_PORTD_DIR_SET() bfin_read16(PORTD_DIR_SET)
1009#define bfin_write_PORTD_DIR_SET(val) bfin_write16(PORTD_DIR_SET, val)
1010#define bfin_read_PORTD_DIR_CLEAR() bfin_read16(PORTD_DIR_CLEAR)
1011#define bfin_write_PORTD_DIR_CLEAR(val) bfin_write16(PORTD_DIR_CLEAR, val)
1012#define bfin_read_PORTD_INEN() bfin_read16(PORTD_INEN)
1013#define bfin_write_PORTD_INEN(val) bfin_write16(PORTD_INEN, val)
1014#define bfin_read_PORTD_MUX() bfin_read32(PORTD_MUX)
1015#define bfin_write_PORTD_MUX(val) bfin_write32(PORTD_MUX, val)
1016
1017/* Port E Registers */
1018
1019#define bfin_read_PORTE_FER() bfin_read16(PORTE_FER)
1020#define bfin_write_PORTE_FER(val) bfin_write16(PORTE_FER, val)
1021#define bfin_read_PORTE() bfin_read16(PORTE)
1022#define bfin_write_PORTE(val) bfin_write16(PORTE, val)
1023#define bfin_read_PORTE_SET() bfin_read16(PORTE_SET)
1024#define bfin_write_PORTE_SET(val) bfin_write16(PORTE_SET, val)
1025#define bfin_read_PORTE_CLEAR() bfin_read16(PORTE_CLEAR)
1026#define bfin_write_PORTE_CLEAR(val) bfin_write16(PORTE_CLEAR, val)
1027#define bfin_read_PORTE_DIR_SET() bfin_read16(PORTE_DIR_SET)
1028#define bfin_write_PORTE_DIR_SET(val) bfin_write16(PORTE_DIR_SET, val)
1029#define bfin_read_PORTE_DIR_CLEAR() bfin_read16(PORTE_DIR_CLEAR)
1030#define bfin_write_PORTE_DIR_CLEAR(val) bfin_write16(PORTE_DIR_CLEAR, val)
1031#define bfin_read_PORTE_INEN() bfin_read16(PORTE_INEN)
1032#define bfin_write_PORTE_INEN(val) bfin_write16(PORTE_INEN, val)
1033#define bfin_read_PORTE_MUX() bfin_read32(PORTE_MUX)
1034#define bfin_write_PORTE_MUX(val) bfin_write32(PORTE_MUX, val)
1035
1036/* Port F Registers */
1037
1038#define bfin_read_PORTF_FER() bfin_read16(PORTF_FER)
1039#define bfin_write_PORTF_FER(val) bfin_write16(PORTF_FER, val)
1040#define bfin_read_PORTF() bfin_read16(PORTF)
1041#define bfin_write_PORTF(val) bfin_write16(PORTF, val)
1042#define bfin_read_PORTF_SET() bfin_read16(PORTF_SET)
1043#define bfin_write_PORTF_SET(val) bfin_write16(PORTF_SET, val)
1044#define bfin_read_PORTF_CLEAR() bfin_read16(PORTF_CLEAR)
1045#define bfin_write_PORTF_CLEAR(val) bfin_write16(PORTF_CLEAR, val)
1046#define bfin_read_PORTF_DIR_SET() bfin_read16(PORTF_DIR_SET)
1047#define bfin_write_PORTF_DIR_SET(val) bfin_write16(PORTF_DIR_SET, val)
1048#define bfin_read_PORTF_DIR_CLEAR() bfin_read16(PORTF_DIR_CLEAR)
1049#define bfin_write_PORTF_DIR_CLEAR(val) bfin_write16(PORTF_DIR_CLEAR, val)
1050#define bfin_read_PORTF_INEN() bfin_read16(PORTF_INEN)
1051#define bfin_write_PORTF_INEN(val) bfin_write16(PORTF_INEN, val)
1052#define bfin_read_PORTF_MUX() bfin_read32(PORTF_MUX)
1053#define bfin_write_PORTF_MUX(val) bfin_write32(PORTF_MUX, val)
1054
1055/* Port G Registers */
1056
1057#define bfin_read_PORTG_FER() bfin_read16(PORTG_FER)
1058#define bfin_write_PORTG_FER(val) bfin_write16(PORTG_FER, val)
1059#define bfin_read_PORTG() bfin_read16(PORTG)
1060#define bfin_write_PORTG(val) bfin_write16(PORTG, val)
1061#define bfin_read_PORTG_SET() bfin_read16(PORTG_SET)
1062#define bfin_write_PORTG_SET(val) bfin_write16(PORTG_SET, val)
1063#define bfin_read_PORTG_CLEAR() bfin_read16(PORTG_CLEAR)
1064#define bfin_write_PORTG_CLEAR(val) bfin_write16(PORTG_CLEAR, val)
1065#define bfin_read_PORTG_DIR_SET() bfin_read16(PORTG_DIR_SET)
1066#define bfin_write_PORTG_DIR_SET(val) bfin_write16(PORTG_DIR_SET, val)
1067#define bfin_read_PORTG_DIR_CLEAR() bfin_read16(PORTG_DIR_CLEAR)
1068#define bfin_write_PORTG_DIR_CLEAR(val) bfin_write16(PORTG_DIR_CLEAR, val)
1069#define bfin_read_PORTG_INEN() bfin_read16(PORTG_INEN)
1070#define bfin_write_PORTG_INEN(val) bfin_write16(PORTG_INEN, val)
1071#define bfin_read_PORTG_MUX() bfin_read32(PORTG_MUX)
1072#define bfin_write_PORTG_MUX(val) bfin_write32(PORTG_MUX, val)
1073
1074/* Port H Registers */
1075
1076#define bfin_read_PORTH_FER() bfin_read16(PORTH_FER)
1077#define bfin_write_PORTH_FER(val) bfin_write16(PORTH_FER, val)
1078#define bfin_read_PORTH() bfin_read16(PORTH)
1079#define bfin_write_PORTH(val) bfin_write16(PORTH, val)
1080#define bfin_read_PORTH_SET() bfin_read16(PORTH_SET)
1081#define bfin_write_PORTH_SET(val) bfin_write16(PORTH_SET, val)
1082#define bfin_read_PORTH_CLEAR() bfin_read16(PORTH_CLEAR)
1083#define bfin_write_PORTH_CLEAR(val) bfin_write16(PORTH_CLEAR, val)
1084#define bfin_read_PORTH_DIR_SET() bfin_read16(PORTH_DIR_SET)
1085#define bfin_write_PORTH_DIR_SET(val) bfin_write16(PORTH_DIR_SET, val)
1086#define bfin_read_PORTH_DIR_CLEAR() bfin_read16(PORTH_DIR_CLEAR)
1087#define bfin_write_PORTH_DIR_CLEAR(val) bfin_write16(PORTH_DIR_CLEAR, val)
1088#define bfin_read_PORTH_INEN() bfin_read16(PORTH_INEN)
1089#define bfin_write_PORTH_INEN(val) bfin_write16(PORTH_INEN, val)
1090#define bfin_read_PORTH_MUX() bfin_read32(PORTH_MUX)
1091#define bfin_write_PORTH_MUX(val) bfin_write32(PORTH_MUX, val)
1092
1093/* Port I Registers */
1094
1095#define bfin_read_PORTI_FER() bfin_read16(PORTI_FER)
1096#define bfin_write_PORTI_FER(val) bfin_write16(PORTI_FER, val)
1097#define bfin_read_PORTI() bfin_read16(PORTI)
1098#define bfin_write_PORTI(val) bfin_write16(PORTI, val)
1099#define bfin_read_PORTI_SET() bfin_read16(PORTI_SET)
1100#define bfin_write_PORTI_SET(val) bfin_write16(PORTI_SET, val)
1101#define bfin_read_PORTI_CLEAR() bfin_read16(PORTI_CLEAR)
1102#define bfin_write_PORTI_CLEAR(val) bfin_write16(PORTI_CLEAR, val)
1103#define bfin_read_PORTI_DIR_SET() bfin_read16(PORTI_DIR_SET)
1104#define bfin_write_PORTI_DIR_SET(val) bfin_write16(PORTI_DIR_SET, val)
1105#define bfin_read_PORTI_DIR_CLEAR() bfin_read16(PORTI_DIR_CLEAR)
1106#define bfin_write_PORTI_DIR_CLEAR(val) bfin_write16(PORTI_DIR_CLEAR, val)
1107#define bfin_read_PORTI_INEN() bfin_read16(PORTI_INEN)
1108#define bfin_write_PORTI_INEN(val) bfin_write16(PORTI_INEN, val)
1109#define bfin_read_PORTI_MUX() bfin_read32(PORTI_MUX)
1110#define bfin_write_PORTI_MUX(val) bfin_write32(PORTI_MUX, val)
1111
1112/* Port J Registers */
1113
1114#define bfin_read_PORTJ_FER() bfin_read16(PORTJ_FER)
1115#define bfin_write_PORTJ_FER(val) bfin_write16(PORTJ_FER, val)
1116#define bfin_read_PORTJ() bfin_read16(PORTJ)
1117#define bfin_write_PORTJ(val) bfin_write16(PORTJ, val)
1118#define bfin_read_PORTJ_SET() bfin_read16(PORTJ_SET)
1119#define bfin_write_PORTJ_SET(val) bfin_write16(PORTJ_SET, val)
1120#define bfin_read_PORTJ_CLEAR() bfin_read16(PORTJ_CLEAR)
1121#define bfin_write_PORTJ_CLEAR(val) bfin_write16(PORTJ_CLEAR, val)
1122#define bfin_read_PORTJ_DIR_SET() bfin_read16(PORTJ_DIR_SET)
1123#define bfin_write_PORTJ_DIR_SET(val) bfin_write16(PORTJ_DIR_SET, val)
1124#define bfin_read_PORTJ_DIR_CLEAR() bfin_read16(PORTJ_DIR_CLEAR)
1125#define bfin_write_PORTJ_DIR_CLEAR(val) bfin_write16(PORTJ_DIR_CLEAR, val)
1126#define bfin_read_PORTJ_INEN() bfin_read16(PORTJ_INEN)
1127#define bfin_write_PORTJ_INEN(val) bfin_write16(PORTJ_INEN, val)
1128#define bfin_read_PORTJ_MUX() bfin_read32(PORTJ_MUX)
1129#define bfin_write_PORTJ_MUX(val) bfin_write32(PORTJ_MUX, val)
1130
1131/* PWM Timer Registers */
1132
1133#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
1134#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG, val)
1135#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
1136#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
1137#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
1138#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD, val)
1139#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
1140#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH, val)
1141#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
1142#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG, val)
1143#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
1144#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
1145#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
1146#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD, val)
1147#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
1148#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH, val)
1149#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
1150#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG, val)
1151#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
1152#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
1153#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
1154#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD, val)
1155#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
1156#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH, val)
1157#define bfin_read_TIMER3_CONFIG() bfin_read16(TIMER3_CONFIG)
1158#define bfin_write_TIMER3_CONFIG(val) bfin_write16(TIMER3_CONFIG, val)
1159#define bfin_read_TIMER3_COUNTER() bfin_read32(TIMER3_COUNTER)
1160#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER, val)
1161#define bfin_read_TIMER3_PERIOD() bfin_read32(TIMER3_PERIOD)
1162#define bfin_write_TIMER3_PERIOD(val) bfin_write32(TIMER3_PERIOD, val)
1163#define bfin_read_TIMER3_WIDTH() bfin_read32(TIMER3_WIDTH)
1164#define bfin_write_TIMER3_WIDTH(val) bfin_write32(TIMER3_WIDTH, val)
1165#define bfin_read_TIMER4_CONFIG() bfin_read16(TIMER4_CONFIG)
1166#define bfin_write_TIMER4_CONFIG(val) bfin_write16(TIMER4_CONFIG, val)
1167#define bfin_read_TIMER4_COUNTER() bfin_read32(TIMER4_COUNTER)
1168#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER, val)
1169#define bfin_read_TIMER4_PERIOD() bfin_read32(TIMER4_PERIOD)
1170#define bfin_write_TIMER4_PERIOD(val) bfin_write32(TIMER4_PERIOD, val)
1171#define bfin_read_TIMER4_WIDTH() bfin_read32(TIMER4_WIDTH)
1172#define bfin_write_TIMER4_WIDTH(val) bfin_write32(TIMER4_WIDTH, val)
1173#define bfin_read_TIMER5_CONFIG() bfin_read16(TIMER5_CONFIG)
1174#define bfin_write_TIMER5_CONFIG(val) bfin_write16(TIMER5_CONFIG, val)
1175#define bfin_read_TIMER5_COUNTER() bfin_read32(TIMER5_COUNTER)
1176#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER, val)
1177#define bfin_read_TIMER5_PERIOD() bfin_read32(TIMER5_PERIOD)
1178#define bfin_write_TIMER5_PERIOD(val) bfin_write32(TIMER5_PERIOD, val)
1179#define bfin_read_TIMER5_WIDTH() bfin_read32(TIMER5_WIDTH)
1180#define bfin_write_TIMER5_WIDTH(val) bfin_write32(TIMER5_WIDTH, val)
1181#define bfin_read_TIMER6_CONFIG() bfin_read16(TIMER6_CONFIG)
1182#define bfin_write_TIMER6_CONFIG(val) bfin_write16(TIMER6_CONFIG, val)
1183#define bfin_read_TIMER6_COUNTER() bfin_read32(TIMER6_COUNTER)
1184#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER, val)
1185#define bfin_read_TIMER6_PERIOD() bfin_read32(TIMER6_PERIOD)
1186#define bfin_write_TIMER6_PERIOD(val) bfin_write32(TIMER6_PERIOD, val)
1187#define bfin_read_TIMER6_WIDTH() bfin_read32(TIMER6_WIDTH)
1188#define bfin_write_TIMER6_WIDTH(val) bfin_write32(TIMER6_WIDTH, val)
1189#define bfin_read_TIMER7_CONFIG() bfin_read16(TIMER7_CONFIG)
1190#define bfin_write_TIMER7_CONFIG(val) bfin_write16(TIMER7_CONFIG, val)
1191#define bfin_read_TIMER7_COUNTER() bfin_read32(TIMER7_COUNTER)
1192#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER, val)
1193#define bfin_read_TIMER7_PERIOD() bfin_read32(TIMER7_PERIOD)
1194#define bfin_write_TIMER7_PERIOD(val) bfin_write32(TIMER7_PERIOD, val)
1195#define bfin_read_TIMER7_WIDTH() bfin_read32(TIMER7_WIDTH)
1196#define bfin_write_TIMER7_WIDTH(val) bfin_write32(TIMER7_WIDTH, val)
1197
1198/* Timer Groubfin_read_() of 8 */
1199
1200#define bfin_read_TIMER_ENABLE0() bfin_read16(TIMER_ENABLE0)
1201#define bfin_write_TIMER_ENABLE0(val) bfin_write16(TIMER_ENABLE0, val)
1202#define bfin_read_TIMER_DISABLE0() bfin_read16(TIMER_DISABLE0)
1203#define bfin_write_TIMER_DISABLE0(val) bfin_write16(TIMER_DISABLE0, val)
1204#define bfin_read_TIMER_STATUS0() bfin_read32(TIMER_STATUS0)
1205#define bfin_write_TIMER_STATUS0(val) bfin_write32(TIMER_STATUS0, val)
1206
1207/* DMAC1 Registers */
1208
1209#define bfin_read_DMAC1_TCPER() bfin_read16(DMAC1_TCPER)
1210#define bfin_write_DMAC1_TCPER(val) bfin_write16(DMAC1_TCPER, val)
1211#define bfin_read_DMAC1_TCCNT() bfin_read16(DMAC1_TCCNT)
1212#define bfin_write_DMAC1_TCCNT(val) bfin_write16(DMAC1_TCCNT, val)
1213
1214/* DMA Channel 12 Registers */
1215
1216#define bfin_read_DMA12_NEXT_DESC_PTR() bfin_read32(DMA12_NEXT_DESC_PTR)
1217#define bfin_write_DMA12_NEXT_DESC_PTR(val) bfin_write32(DMA12_NEXT_DESC_PTR)
1218#define bfin_read_DMA12_START_ADDR() bfin_read32(DMA12_START_ADDR)
1219#define bfin_write_DMA12_START_ADDR(val) bfin_write32(DMA12_START_ADDR)
1220#define bfin_read_DMA12_CONFIG() bfin_read16(DMA12_CONFIG)
1221#define bfin_write_DMA12_CONFIG(val) bfin_write16(DMA12_CONFIG, val)
1222#define bfin_read_DMA12_X_COUNT() bfin_read16(DMA12_X_COUNT)
1223#define bfin_write_DMA12_X_COUNT(val) bfin_write16(DMA12_X_COUNT, val)
1224#define bfin_read_DMA12_X_MODIFY() bfin_read16(DMA12_X_MODIFY)
1225#define bfin_write_DMA12_X_MODIFY(val) bfin_write16(DMA12_X_MODIFY)
1226#define bfin_read_DMA12_Y_COUNT() bfin_read16(DMA12_Y_COUNT)
1227#define bfin_write_DMA12_Y_COUNT(val) bfin_write16(DMA12_Y_COUNT, val)
1228#define bfin_read_DMA12_Y_MODIFY() bfin_read16(DMA12_Y_MODIFY)
1229#define bfin_write_DMA12_Y_MODIFY(val) bfin_write16(DMA12_Y_MODIFY)
1230#define bfin_read_DMA12_CURR_DESC_PTR() bfin_read32(DMA12_CURR_DESC_PTR)
1231#define bfin_write_DMA12_CURR_DESC_PTR(val) bfin_write32(DMA12_CURR_DESC_PTR)
1232#define bfin_read_DMA12_CURR_ADDR() bfin_read32(DMA12_CURR_ADDR)
1233#define bfin_write_DMA12_CURR_ADDR(val) bfin_write32(DMA12_CURR_ADDR)
1234#define bfin_read_DMA12_IRQ_STATUS() bfin_read16(DMA12_IRQ_STATUS)
1235#define bfin_write_DMA12_IRQ_STATUS(val) bfin_write16(DMA12_IRQ_STATUS, val)
1236#define bfin_read_DMA12_PERIPHERAL_MAP() bfin_read16(DMA12_PERIPHERAL_MAP)
1237#define bfin_write_DMA12_PERIPHERAL_MAP(val) bfin_write16(DMA12_PERIPHERAL_MAP, val)
1238#define bfin_read_DMA12_CURR_X_COUNT() bfin_read16(DMA12_CURR_X_COUNT)
1239#define bfin_write_DMA12_CURR_X_COUNT(val) bfin_write16(DMA12_CURR_X_COUNT, val)
1240#define bfin_read_DMA12_CURR_Y_COUNT() bfin_read16(DMA12_CURR_Y_COUNT)
1241#define bfin_write_DMA12_CURR_Y_COUNT(val) bfin_write16(DMA12_CURR_Y_COUNT, val)
1242
1243/* DMA Channel 13 Registers */
1244
1245#define bfin_read_DMA13_NEXT_DESC_PTR() bfin_read32(DMA13_NEXT_DESC_PTR)
1246#define bfin_write_DMA13_NEXT_DESC_PTR(val) bfin_write32(DMA13_NEXT_DESC_PTR)
1247#define bfin_read_DMA13_START_ADDR() bfin_read32(DMA13_START_ADDR)
1248#define bfin_write_DMA13_START_ADDR(val) bfin_write32(DMA13_START_ADDR)
1249#define bfin_read_DMA13_CONFIG() bfin_read16(DMA13_CONFIG)
1250#define bfin_write_DMA13_CONFIG(val) bfin_write16(DMA13_CONFIG, val)
1251#define bfin_read_DMA13_X_COUNT() bfin_read16(DMA13_X_COUNT)
1252#define bfin_write_DMA13_X_COUNT(val) bfin_write16(DMA13_X_COUNT, val)
1253#define bfin_read_DMA13_X_MODIFY() bfin_read16(DMA13_X_MODIFY)
1254#define bfin_write_DMA13_X_MODIFY(val) bfin_write16(DMA13_X_MODIFY)
1255#define bfin_read_DMA13_Y_COUNT() bfin_read16(DMA13_Y_COUNT)
1256#define bfin_write_DMA13_Y_COUNT(val) bfin_write16(DMA13_Y_COUNT, val)
1257#define bfin_read_DMA13_Y_MODIFY() bfin_read16(DMA13_Y_MODIFY)
1258#define bfin_write_DMA13_Y_MODIFY(val) bfin_write16(DMA13_Y_MODIFY)
1259#define bfin_read_DMA13_CURR_DESC_PTR() bfin_read32(DMA13_CURR_DESC_PTR)
1260#define bfin_write_DMA13_CURR_DESC_PTR(val) bfin_write32(DMA13_CURR_DESC_PTR)
1261#define bfin_read_DMA13_CURR_ADDR() bfin_read32(DMA13_CURR_ADDR)
1262#define bfin_write_DMA13_CURR_ADDR(val) bfin_write32(DMA13_CURR_ADDR)
1263#define bfin_read_DMA13_IRQ_STATUS() bfin_read16(DMA13_IRQ_STATUS)
1264#define bfin_write_DMA13_IRQ_STATUS(val) bfin_write16(DMA13_IRQ_STATUS, val)
1265#define bfin_read_DMA13_PERIPHERAL_MAP() bfin_read16(DMA13_PERIPHERAL_MAP)
1266#define bfin_write_DMA13_PERIPHERAL_MAP(val) bfin_write16(DMA13_PERIPHERAL_MAP, val)
1267#define bfin_read_DMA13_CURR_X_COUNT() bfin_read16(DMA13_CURR_X_COUNT)
1268#define bfin_write_DMA13_CURR_X_COUNT(val) bfin_write16(DMA13_CURR_X_COUNT, val)
1269#define bfin_read_DMA13_CURR_Y_COUNT() bfin_read16(DMA13_CURR_Y_COUNT)
1270#define bfin_write_DMA13_CURR_Y_COUNT(val) bfin_write16(DMA13_CURR_Y_COUNT, val)
1271
1272/* DMA Channel 14 Registers */
1273
1274#define bfin_read_DMA14_NEXT_DESC_PTR() bfin_read32(DMA14_NEXT_DESC_PTR)
1275#define bfin_write_DMA14_NEXT_DESC_PTR(val) bfin_write32(DMA14_NEXT_DESC_PTR)
1276#define bfin_read_DMA14_START_ADDR() bfin_read32(DMA14_START_ADDR)
1277#define bfin_write_DMA14_START_ADDR(val) bfin_write32(DMA14_START_ADDR)
1278#define bfin_read_DMA14_CONFIG() bfin_read16(DMA14_CONFIG)
1279#define bfin_write_DMA14_CONFIG(val) bfin_write16(DMA14_CONFIG, val)
1280#define bfin_read_DMA14_X_COUNT() bfin_read16(DMA14_X_COUNT)
1281#define bfin_write_DMA14_X_COUNT(val) bfin_write16(DMA14_X_COUNT, val)
1282#define bfin_read_DMA14_X_MODIFY() bfin_read16(DMA14_X_MODIFY)
1283#define bfin_write_DMA14_X_MODIFY(val) bfin_write16(DMA14_X_MODIFY)
1284#define bfin_read_DMA14_Y_COUNT() bfin_read16(DMA14_Y_COUNT)
1285#define bfin_write_DMA14_Y_COUNT(val) bfin_write16(DMA14_Y_COUNT, val)
1286#define bfin_read_DMA14_Y_MODIFY() bfin_read16(DMA14_Y_MODIFY)
1287#define bfin_write_DMA14_Y_MODIFY(val) bfin_write16(DMA14_Y_MODIFY)
1288#define bfin_read_DMA14_CURR_DESC_PTR() bfin_read32(DMA14_CURR_DESC_PTR)
1289#define bfin_write_DMA14_CURR_DESC_PTR(val) bfin_write32(DMA14_CURR_DESC_PTR)
1290#define bfin_read_DMA14_CURR_ADDR() bfin_read32(DMA14_CURR_ADDR)
1291#define bfin_write_DMA14_CURR_ADDR(val) bfin_write32(DMA14_CURR_ADDR)
1292#define bfin_read_DMA14_IRQ_STATUS() bfin_read16(DMA14_IRQ_STATUS)
1293#define bfin_write_DMA14_IRQ_STATUS(val) bfin_write16(DMA14_IRQ_STATUS, val)
1294#define bfin_read_DMA14_PERIPHERAL_MAP() bfin_read16(DMA14_PERIPHERAL_MAP)
1295#define bfin_write_DMA14_PERIPHERAL_MAP(val) bfin_write16(DMA14_PERIPHERAL_MAP, val)
1296#define bfin_read_DMA14_CURR_X_COUNT() bfin_read16(DMA14_CURR_X_COUNT)
1297#define bfin_write_DMA14_CURR_X_COUNT(val) bfin_write16(DMA14_CURR_X_COUNT, val)
1298#define bfin_read_DMA14_CURR_Y_COUNT() bfin_read16(DMA14_CURR_Y_COUNT)
1299#define bfin_write_DMA14_CURR_Y_COUNT(val) bfin_write16(DMA14_CURR_Y_COUNT, val)
1300
1301/* DMA Channel 15 Registers */
1302
1303#define bfin_read_DMA15_NEXT_DESC_PTR() bfin_read32(DMA15_NEXT_DESC_PTR)
1304#define bfin_write_DMA15_NEXT_DESC_PTR(val) bfin_write32(DMA15_NEXT_DESC_PTR)
1305#define bfin_read_DMA15_START_ADDR() bfin_read32(DMA15_START_ADDR)
1306#define bfin_write_DMA15_START_ADDR(val) bfin_write32(DMA15_START_ADDR)
1307#define bfin_read_DMA15_CONFIG() bfin_read16(DMA15_CONFIG)
1308#define bfin_write_DMA15_CONFIG(val) bfin_write16(DMA15_CONFIG, val)
1309#define bfin_read_DMA15_X_COUNT() bfin_read16(DMA15_X_COUNT)
1310#define bfin_write_DMA15_X_COUNT(val) bfin_write16(DMA15_X_COUNT, val)
1311#define bfin_read_DMA15_X_MODIFY() bfin_read16(DMA15_X_MODIFY)
1312#define bfin_write_DMA15_X_MODIFY(val) bfin_write16(DMA15_X_MODIFY)
1313#define bfin_read_DMA15_Y_COUNT() bfin_read16(DMA15_Y_COUNT)
1314#define bfin_write_DMA15_Y_COUNT(val) bfin_write16(DMA15_Y_COUNT, val)
1315#define bfin_read_DMA15_Y_MODIFY() bfin_read16(DMA15_Y_MODIFY)
1316#define bfin_write_DMA15_Y_MODIFY(val) bfin_write16(DMA15_Y_MODIFY)
1317#define bfin_read_DMA15_CURR_DESC_PTR() bfin_read32(DMA15_CURR_DESC_PTR)
1318#define bfin_write_DMA15_CURR_DESC_PTR(val) bfin_write32(DMA15_CURR_DESC_PTR)
1319#define bfin_read_DMA15_CURR_ADDR() bfin_read32(DMA15_CURR_ADDR)
1320#define bfin_write_DMA15_CURR_ADDR(val) bfin_write32(DMA15_CURR_ADDR)
1321#define bfin_read_DMA15_IRQ_STATUS() bfin_read16(DMA15_IRQ_STATUS)
1322#define bfin_write_DMA15_IRQ_STATUS(val) bfin_write16(DMA15_IRQ_STATUS, val)
1323#define bfin_read_DMA15_PERIPHERAL_MAP() bfin_read16(DMA15_PERIPHERAL_MAP)
1324#define bfin_write_DMA15_PERIPHERAL_MAP(val) bfin_write16(DMA15_PERIPHERAL_MAP, val)
1325#define bfin_read_DMA15_CURR_X_COUNT() bfin_read16(DMA15_CURR_X_COUNT)
1326#define bfin_write_DMA15_CURR_X_COUNT(val) bfin_write16(DMA15_CURR_X_COUNT, val)
1327#define bfin_read_DMA15_CURR_Y_COUNT() bfin_read16(DMA15_CURR_Y_COUNT)
1328#define bfin_write_DMA15_CURR_Y_COUNT(val) bfin_write16(DMA15_CURR_Y_COUNT, val)
1329
1330/* DMA Channel 16 Registers */
1331
1332#define bfin_read_DMA16_NEXT_DESC_PTR() bfin_read32(DMA16_NEXT_DESC_PTR)
1333#define bfin_write_DMA16_NEXT_DESC_PTR(val) bfin_write32(DMA16_NEXT_DESC_PTR)
1334#define bfin_read_DMA16_START_ADDR() bfin_read32(DMA16_START_ADDR)
1335#define bfin_write_DMA16_START_ADDR(val) bfin_write32(DMA16_START_ADDR)
1336#define bfin_read_DMA16_CONFIG() bfin_read16(DMA16_CONFIG)
1337#define bfin_write_DMA16_CONFIG(val) bfin_write16(DMA16_CONFIG, val)
1338#define bfin_read_DMA16_X_COUNT() bfin_read16(DMA16_X_COUNT)
1339#define bfin_write_DMA16_X_COUNT(val) bfin_write16(DMA16_X_COUNT, val)
1340#define bfin_read_DMA16_X_MODIFY() bfin_read16(DMA16_X_MODIFY)
1341#define bfin_write_DMA16_X_MODIFY(val) bfin_write16(DMA16_X_MODIFY)
1342#define bfin_read_DMA16_Y_COUNT() bfin_read16(DMA16_Y_COUNT)
1343#define bfin_write_DMA16_Y_COUNT(val) bfin_write16(DMA16_Y_COUNT, val)
1344#define bfin_read_DMA16_Y_MODIFY() bfin_read16(DMA16_Y_MODIFY)
1345#define bfin_write_DMA16_Y_MODIFY(val) bfin_write16(DMA16_Y_MODIFY)
1346#define bfin_read_DMA16_CURR_DESC_PTR() bfin_read32(DMA16_CURR_DESC_PTR)
1347#define bfin_write_DMA16_CURR_DESC_PTR(val) bfin_write32(DMA16_CURR_DESC_PTR)
1348#define bfin_read_DMA16_CURR_ADDR() bfin_read32(DMA16_CURR_ADDR)
1349#define bfin_write_DMA16_CURR_ADDR(val) bfin_write32(DMA16_CURR_ADDR)
1350#define bfin_read_DMA16_IRQ_STATUS() bfin_read16(DMA16_IRQ_STATUS)
1351#define bfin_write_DMA16_IRQ_STATUS(val) bfin_write16(DMA16_IRQ_STATUS, val)
1352#define bfin_read_DMA16_PERIPHERAL_MAP() bfin_read16(DMA16_PERIPHERAL_MAP)
1353#define bfin_write_DMA16_PERIPHERAL_MAP(val) bfin_write16(DMA16_PERIPHERAL_MAP, val)
1354#define bfin_read_DMA16_CURR_X_COUNT() bfin_read16(DMA16_CURR_X_COUNT)
1355#define bfin_write_DMA16_CURR_X_COUNT(val) bfin_write16(DMA16_CURR_X_COUNT, val)
1356#define bfin_read_DMA16_CURR_Y_COUNT() bfin_read16(DMA16_CURR_Y_COUNT)
1357#define bfin_write_DMA16_CURR_Y_COUNT(val) bfin_write16(DMA16_CURR_Y_COUNT, val)
1358
1359/* DMA Channel 17 Registers */
1360
1361#define bfin_read_DMA17_NEXT_DESC_PTR() bfin_read32(DMA17_NEXT_DESC_PTR)
1362#define bfin_write_DMA17_NEXT_DESC_PTR(val) bfin_write32(DMA17_NEXT_DESC_PTR)
1363#define bfin_read_DMA17_START_ADDR() bfin_read32(DMA17_START_ADDR)
1364#define bfin_write_DMA17_START_ADDR(val) bfin_write32(DMA17_START_ADDR)
1365#define bfin_read_DMA17_CONFIG() bfin_read16(DMA17_CONFIG)
1366#define bfin_write_DMA17_CONFIG(val) bfin_write16(DMA17_CONFIG, val)
1367#define bfin_read_DMA17_X_COUNT() bfin_read16(DMA17_X_COUNT)
1368#define bfin_write_DMA17_X_COUNT(val) bfin_write16(DMA17_X_COUNT, val)
1369#define bfin_read_DMA17_X_MODIFY() bfin_read16(DMA17_X_MODIFY)
1370#define bfin_write_DMA17_X_MODIFY(val) bfin_write16(DMA17_X_MODIFY)
1371#define bfin_read_DMA17_Y_COUNT() bfin_read16(DMA17_Y_COUNT)
1372#define bfin_write_DMA17_Y_COUNT(val) bfin_write16(DMA17_Y_COUNT, val)
1373#define bfin_read_DMA17_Y_MODIFY() bfin_read16(DMA17_Y_MODIFY)
1374#define bfin_write_DMA17_Y_MODIFY(val) bfin_write16(DMA17_Y_MODIFY)
1375#define bfin_read_DMA17_CURR_DESC_PTR() bfin_read32(DMA17_CURR_DESC_PTR)
1376#define bfin_write_DMA17_CURR_DESC_PTR(val) bfin_write32(DMA17_CURR_DESC_PTR)
1377#define bfin_read_DMA17_CURR_ADDR() bfin_read32(DMA17_CURR_ADDR)
1378#define bfin_write_DMA17_CURR_ADDR(val) bfin_write32(DMA17_CURR_ADDR)
1379#define bfin_read_DMA17_IRQ_STATUS() bfin_read16(DMA17_IRQ_STATUS)
1380#define bfin_write_DMA17_IRQ_STATUS(val) bfin_write16(DMA17_IRQ_STATUS, val)
1381#define bfin_read_DMA17_PERIPHERAL_MAP() bfin_read16(DMA17_PERIPHERAL_MAP)
1382#define bfin_write_DMA17_PERIPHERAL_MAP(val) bfin_write16(DMA17_PERIPHERAL_MAP, val)
1383#define bfin_read_DMA17_CURR_X_COUNT() bfin_read16(DMA17_CURR_X_COUNT)
1384#define bfin_write_DMA17_CURR_X_COUNT(val) bfin_write16(DMA17_CURR_X_COUNT, val)
1385#define bfin_read_DMA17_CURR_Y_COUNT() bfin_read16(DMA17_CURR_Y_COUNT)
1386#define bfin_write_DMA17_CURR_Y_COUNT(val) bfin_write16(DMA17_CURR_Y_COUNT, val)
1387
1388/* DMA Channel 18 Registers */
1389
1390#define bfin_read_DMA18_NEXT_DESC_PTR() bfin_read32(DMA18_NEXT_DESC_PTR)
1391#define bfin_write_DMA18_NEXT_DESC_PTR(val) bfin_write32(DMA18_NEXT_DESC_PTR)
1392#define bfin_read_DMA18_START_ADDR() bfin_read32(DMA18_START_ADDR)
1393#define bfin_write_DMA18_START_ADDR(val) bfin_write32(DMA18_START_ADDR)
1394#define bfin_read_DMA18_CONFIG() bfin_read16(DMA18_CONFIG)
1395#define bfin_write_DMA18_CONFIG(val) bfin_write16(DMA18_CONFIG, val)
1396#define bfin_read_DMA18_X_COUNT() bfin_read16(DMA18_X_COUNT)
1397#define bfin_write_DMA18_X_COUNT(val) bfin_write16(DMA18_X_COUNT, val)
1398#define bfin_read_DMA18_X_MODIFY() bfin_read16(DMA18_X_MODIFY)
1399#define bfin_write_DMA18_X_MODIFY(val) bfin_write16(DMA18_X_MODIFY)
1400#define bfin_read_DMA18_Y_COUNT() bfin_read16(DMA18_Y_COUNT)
1401#define bfin_write_DMA18_Y_COUNT(val) bfin_write16(DMA18_Y_COUNT, val)
1402#define bfin_read_DMA18_Y_MODIFY() bfin_read16(DMA18_Y_MODIFY)
1403#define bfin_write_DMA18_Y_MODIFY(val) bfin_write16(DMA18_Y_MODIFY)
1404#define bfin_read_DMA18_CURR_DESC_PTR() bfin_read32(DMA18_CURR_DESC_PTR)
1405#define bfin_write_DMA18_CURR_DESC_PTR(val) bfin_write32(DMA18_CURR_DESC_PTR)
1406#define bfin_read_DMA18_CURR_ADDR() bfin_read32(DMA18_CURR_ADDR)
1407#define bfin_write_DMA18_CURR_ADDR(val) bfin_write32(DMA18_CURR_ADDR)
1408#define bfin_read_DMA18_IRQ_STATUS() bfin_read16(DMA18_IRQ_STATUS)
1409#define bfin_write_DMA18_IRQ_STATUS(val) bfin_write16(DMA18_IRQ_STATUS, val)
1410#define bfin_read_DMA18_PERIPHERAL_MAP() bfin_read16(DMA18_PERIPHERAL_MAP)
1411#define bfin_write_DMA18_PERIPHERAL_MAP(val) bfin_write16(DMA18_PERIPHERAL_MAP, val)
1412#define bfin_read_DMA18_CURR_X_COUNT() bfin_read16(DMA18_CURR_X_COUNT)
1413#define bfin_write_DMA18_CURR_X_COUNT(val) bfin_write16(DMA18_CURR_X_COUNT, val)
1414#define bfin_read_DMA18_CURR_Y_COUNT() bfin_read16(DMA18_CURR_Y_COUNT)
1415#define bfin_write_DMA18_CURR_Y_COUNT(val) bfin_write16(DMA18_CURR_Y_COUNT, val)
1416
1417/* DMA Channel 19 Registers */
1418
1419#define bfin_read_DMA19_NEXT_DESC_PTR() bfin_read32(DMA19_NEXT_DESC_PTR)
1420#define bfin_write_DMA19_NEXT_DESC_PTR(val) bfin_write32(DMA19_NEXT_DESC_PTR)
1421#define bfin_read_DMA19_START_ADDR() bfin_read32(DMA19_START_ADDR)
1422#define bfin_write_DMA19_START_ADDR(val) bfin_write32(DMA19_START_ADDR)
1423#define bfin_read_DMA19_CONFIG() bfin_read16(DMA19_CONFIG)
1424#define bfin_write_DMA19_CONFIG(val) bfin_write16(DMA19_CONFIG, val)
1425#define bfin_read_DMA19_X_COUNT() bfin_read16(DMA19_X_COUNT)
1426#define bfin_write_DMA19_X_COUNT(val) bfin_write16(DMA19_X_COUNT, val)
1427#define bfin_read_DMA19_X_MODIFY() bfin_read16(DMA19_X_MODIFY)
1428#define bfin_write_DMA19_X_MODIFY(val) bfin_write16(DMA19_X_MODIFY)
1429#define bfin_read_DMA19_Y_COUNT() bfin_read16(DMA19_Y_COUNT)
1430#define bfin_write_DMA19_Y_COUNT(val) bfin_write16(DMA19_Y_COUNT, val)
1431#define bfin_read_DMA19_Y_MODIFY() bfin_read16(DMA19_Y_MODIFY)
1432#define bfin_write_DMA19_Y_MODIFY(val) bfin_write16(DMA19_Y_MODIFY)
1433#define bfin_read_DMA19_CURR_DESC_PTR() bfin_read32(DMA19_CURR_DESC_PTR)
1434#define bfin_write_DMA19_CURR_DESC_PTR(val) bfin_write32(DMA19_CURR_DESC_PTR)
1435#define bfin_read_DMA19_CURR_ADDR() bfin_read32(DMA19_CURR_ADDR)
1436#define bfin_write_DMA19_CURR_ADDR(val) bfin_write32(DMA19_CURR_ADDR)
1437#define bfin_read_DMA19_IRQ_STATUS() bfin_read16(DMA19_IRQ_STATUS)
1438#define bfin_write_DMA19_IRQ_STATUS(val) bfin_write16(DMA19_IRQ_STATUS, val)
1439#define bfin_read_DMA19_PERIPHERAL_MAP() bfin_read16(DMA19_PERIPHERAL_MAP)
1440#define bfin_write_DMA19_PERIPHERAL_MAP(val) bfin_write16(DMA19_PERIPHERAL_MAP, val)
1441#define bfin_read_DMA19_CURR_X_COUNT() bfin_read16(DMA19_CURR_X_COUNT)
1442#define bfin_write_DMA19_CURR_X_COUNT(val) bfin_write16(DMA19_CURR_X_COUNT, val)
1443#define bfin_read_DMA19_CURR_Y_COUNT() bfin_read16(DMA19_CURR_Y_COUNT)
1444#define bfin_write_DMA19_CURR_Y_COUNT(val) bfin_write16(DMA19_CURR_Y_COUNT, val)
1445
1446/* DMA Channel 20 Registers */
1447
1448#define bfin_read_DMA20_NEXT_DESC_PTR() bfin_read32(DMA20_NEXT_DESC_PTR)
1449#define bfin_write_DMA20_NEXT_DESC_PTR(val) bfin_write32(DMA20_NEXT_DESC_PTR)
1450#define bfin_read_DMA20_START_ADDR() bfin_read32(DMA20_START_ADDR)
1451#define bfin_write_DMA20_START_ADDR(val) bfin_write32(DMA20_START_ADDR)
1452#define bfin_read_DMA20_CONFIG() bfin_read16(DMA20_CONFIG)
1453#define bfin_write_DMA20_CONFIG(val) bfin_write16(DMA20_CONFIG, val)
1454#define bfin_read_DMA20_X_COUNT() bfin_read16(DMA20_X_COUNT)
1455#define bfin_write_DMA20_X_COUNT(val) bfin_write16(DMA20_X_COUNT, val)
1456#define bfin_read_DMA20_X_MODIFY() bfin_read16(DMA20_X_MODIFY)
1457#define bfin_write_DMA20_X_MODIFY(val) bfin_write16(DMA20_X_MODIFY)
1458#define bfin_read_DMA20_Y_COUNT() bfin_read16(DMA20_Y_COUNT)
1459#define bfin_write_DMA20_Y_COUNT(val) bfin_write16(DMA20_Y_COUNT, val)
1460#define bfin_read_DMA20_Y_MODIFY() bfin_read16(DMA20_Y_MODIFY)
1461#define bfin_write_DMA20_Y_MODIFY(val) bfin_write16(DMA20_Y_MODIFY)
1462#define bfin_read_DMA20_CURR_DESC_PTR() bfin_read32(DMA20_CURR_DESC_PTR)
1463#define bfin_write_DMA20_CURR_DESC_PTR(val) bfin_write32(DMA20_CURR_DESC_PTR)
1464#define bfin_read_DMA20_CURR_ADDR() bfin_read32(DMA20_CURR_ADDR)
1465#define bfin_write_DMA20_CURR_ADDR(val) bfin_write32(DMA20_CURR_ADDR)
1466#define bfin_read_DMA20_IRQ_STATUS() bfin_read16(DMA20_IRQ_STATUS)
1467#define bfin_write_DMA20_IRQ_STATUS(val) bfin_write16(DMA20_IRQ_STATUS, val)
1468#define bfin_read_DMA20_PERIPHERAL_MAP() bfin_read16(DMA20_PERIPHERAL_MAP)
1469#define bfin_write_DMA20_PERIPHERAL_MAP(val) bfin_write16(DMA20_PERIPHERAL_MAP, val)
1470#define bfin_read_DMA20_CURR_X_COUNT() bfin_read16(DMA20_CURR_X_COUNT)
1471#define bfin_write_DMA20_CURR_X_COUNT(val) bfin_write16(DMA20_CURR_X_COUNT, val)
1472#define bfin_read_DMA20_CURR_Y_COUNT() bfin_read16(DMA20_CURR_Y_COUNT)
1473#define bfin_write_DMA20_CURR_Y_COUNT(val) bfin_write16(DMA20_CURR_Y_COUNT, val)
1474
1475/* DMA Channel 21 Registers */
1476
1477#define bfin_read_DMA21_NEXT_DESC_PTR() bfin_read32(DMA21_NEXT_DESC_PTR)
1478#define bfin_write_DMA21_NEXT_DESC_PTR(val) bfin_write32(DMA21_NEXT_DESC_PTR)
1479#define bfin_read_DMA21_START_ADDR() bfin_read32(DMA21_START_ADDR)
1480#define bfin_write_DMA21_START_ADDR(val) bfin_write32(DMA21_START_ADDR)
1481#define bfin_read_DMA21_CONFIG() bfin_read16(DMA21_CONFIG)
1482#define bfin_write_DMA21_CONFIG(val) bfin_write16(DMA21_CONFIG, val)
1483#define bfin_read_DMA21_X_COUNT() bfin_read16(DMA21_X_COUNT)
1484#define bfin_write_DMA21_X_COUNT(val) bfin_write16(DMA21_X_COUNT, val)
1485#define bfin_read_DMA21_X_MODIFY() bfin_read16(DMA21_X_MODIFY)
1486#define bfin_write_DMA21_X_MODIFY(val) bfin_write16(DMA21_X_MODIFY)
1487#define bfin_read_DMA21_Y_COUNT() bfin_read16(DMA21_Y_COUNT)
1488#define bfin_write_DMA21_Y_COUNT(val) bfin_write16(DMA21_Y_COUNT, val)
1489#define bfin_read_DMA21_Y_MODIFY() bfin_read16(DMA21_Y_MODIFY)
1490#define bfin_write_DMA21_Y_MODIFY(val) bfin_write16(DMA21_Y_MODIFY)
1491#define bfin_read_DMA21_CURR_DESC_PTR() bfin_read32(DMA21_CURR_DESC_PTR)
1492#define bfin_write_DMA21_CURR_DESC_PTR(val) bfin_write32(DMA21_CURR_DESC_PTR)
1493#define bfin_read_DMA21_CURR_ADDR() bfin_read32(DMA21_CURR_ADDR)
1494#define bfin_write_DMA21_CURR_ADDR(val) bfin_write32(DMA21_CURR_ADDR)
1495#define bfin_read_DMA21_IRQ_STATUS() bfin_read16(DMA21_IRQ_STATUS)
1496#define bfin_write_DMA21_IRQ_STATUS(val) bfin_write16(DMA21_IRQ_STATUS, val)
1497#define bfin_read_DMA21_PERIPHERAL_MAP() bfin_read16(DMA21_PERIPHERAL_MAP)
1498#define bfin_write_DMA21_PERIPHERAL_MAP(val) bfin_write16(DMA21_PERIPHERAL_MAP, val)
1499#define bfin_read_DMA21_CURR_X_COUNT() bfin_read16(DMA21_CURR_X_COUNT)
1500#define bfin_write_DMA21_CURR_X_COUNT(val) bfin_write16(DMA21_CURR_X_COUNT, val)
1501#define bfin_read_DMA21_CURR_Y_COUNT() bfin_read16(DMA21_CURR_Y_COUNT)
1502#define bfin_write_DMA21_CURR_Y_COUNT(val) bfin_write16(DMA21_CURR_Y_COUNT, val)
1503
1504/* DMA Channel 22 Registers */
1505
1506#define bfin_read_DMA22_NEXT_DESC_PTR() bfin_read32(DMA22_NEXT_DESC_PTR)
1507#define bfin_write_DMA22_NEXT_DESC_PTR(val) bfin_write32(DMA22_NEXT_DESC_PTR)
1508#define bfin_read_DMA22_START_ADDR() bfin_read32(DMA22_START_ADDR)
1509#define bfin_write_DMA22_START_ADDR(val) bfin_write32(DMA22_START_ADDR)
1510#define bfin_read_DMA22_CONFIG() bfin_read16(DMA22_CONFIG)
1511#define bfin_write_DMA22_CONFIG(val) bfin_write16(DMA22_CONFIG, val)
1512#define bfin_read_DMA22_X_COUNT() bfin_read16(DMA22_X_COUNT)
1513#define bfin_write_DMA22_X_COUNT(val) bfin_write16(DMA22_X_COUNT, val)
1514#define bfin_read_DMA22_X_MODIFY() bfin_read16(DMA22_X_MODIFY)
1515#define bfin_write_DMA22_X_MODIFY(val) bfin_write16(DMA22_X_MODIFY)
1516#define bfin_read_DMA22_Y_COUNT() bfin_read16(DMA22_Y_COUNT)
1517#define bfin_write_DMA22_Y_COUNT(val) bfin_write16(DMA22_Y_COUNT, val)
1518#define bfin_read_DMA22_Y_MODIFY() bfin_read16(DMA22_Y_MODIFY)
1519#define bfin_write_DMA22_Y_MODIFY(val) bfin_write16(DMA22_Y_MODIFY)
1520#define bfin_read_DMA22_CURR_DESC_PTR() bfin_read32(DMA22_CURR_DESC_PTR)
1521#define bfin_write_DMA22_CURR_DESC_PTR(val) bfin_write32(DMA22_CURR_DESC_PTR)
1522#define bfin_read_DMA22_CURR_ADDR() bfin_read32(DMA22_CURR_ADDR)
1523#define bfin_write_DMA22_CURR_ADDR(val) bfin_write32(DMA22_CURR_ADDR)
1524#define bfin_read_DMA22_IRQ_STATUS() bfin_read16(DMA22_IRQ_STATUS)
1525#define bfin_write_DMA22_IRQ_STATUS(val) bfin_write16(DMA22_IRQ_STATUS, val)
1526#define bfin_read_DMA22_PERIPHERAL_MAP() bfin_read16(DMA22_PERIPHERAL_MAP)
1527#define bfin_write_DMA22_PERIPHERAL_MAP(val) bfin_write16(DMA22_PERIPHERAL_MAP, val)
1528#define bfin_read_DMA22_CURR_X_COUNT() bfin_read16(DMA22_CURR_X_COUNT)
1529#define bfin_write_DMA22_CURR_X_COUNT(val) bfin_write16(DMA22_CURR_X_COUNT, val)
1530#define bfin_read_DMA22_CURR_Y_COUNT() bfin_read16(DMA22_CURR_Y_COUNT)
1531#define bfin_write_DMA22_CURR_Y_COUNT(val) bfin_write16(DMA22_CURR_Y_COUNT, val)
1532
1533/* DMA Channel 23 Registers */
1534
1535#define bfin_read_DMA23_NEXT_DESC_PTR() bfin_read32(DMA23_NEXT_DESC_PTR)
1536#define bfin_write_DMA23_NEXT_DESC_PTR(val) bfin_write32(DMA23_NEXT_DESC_PTR)
1537#define bfin_read_DMA23_START_ADDR() bfin_read32(DMA23_START_ADDR)
1538#define bfin_write_DMA23_START_ADDR(val) bfin_write32(DMA23_START_ADDR)
1539#define bfin_read_DMA23_CONFIG() bfin_read16(DMA23_CONFIG)
1540#define bfin_write_DMA23_CONFIG(val) bfin_write16(DMA23_CONFIG, val)
1541#define bfin_read_DMA23_X_COUNT() bfin_read16(DMA23_X_COUNT)
1542#define bfin_write_DMA23_X_COUNT(val) bfin_write16(DMA23_X_COUNT, val)
1543#define bfin_read_DMA23_X_MODIFY() bfin_read16(DMA23_X_MODIFY)
1544#define bfin_write_DMA23_X_MODIFY(val) bfin_write16(DMA23_X_MODIFY)
1545#define bfin_read_DMA23_Y_COUNT() bfin_read16(DMA23_Y_COUNT)
1546#define bfin_write_DMA23_Y_COUNT(val) bfin_write16(DMA23_Y_COUNT, val)
1547#define bfin_read_DMA23_Y_MODIFY() bfin_read16(DMA23_Y_MODIFY)
1548#define bfin_write_DMA23_Y_MODIFY(val) bfin_write16(DMA23_Y_MODIFY)
1549#define bfin_read_DMA23_CURR_DESC_PTR() bfin_read32(DMA23_CURR_DESC_PTR)
1550#define bfin_write_DMA23_CURR_DESC_PTR(val) bfin_write32(DMA23_CURR_DESC_PTR)
1551#define bfin_read_DMA23_CURR_ADDR() bfin_read32(DMA23_CURR_ADDR)
1552#define bfin_write_DMA23_CURR_ADDR(val) bfin_write32(DMA23_CURR_ADDR)
1553#define bfin_read_DMA23_IRQ_STATUS() bfin_read16(DMA23_IRQ_STATUS)
1554#define bfin_write_DMA23_IRQ_STATUS(val) bfin_write16(DMA23_IRQ_STATUS, val)
1555#define bfin_read_DMA23_PERIPHERAL_MAP() bfin_read16(DMA23_PERIPHERAL_MAP)
1556#define bfin_write_DMA23_PERIPHERAL_MAP(val) bfin_write16(DMA23_PERIPHERAL_MAP, val)
1557#define bfin_read_DMA23_CURR_X_COUNT() bfin_read16(DMA23_CURR_X_COUNT)
1558#define bfin_write_DMA23_CURR_X_COUNT(val) bfin_write16(DMA23_CURR_X_COUNT, val)
1559#define bfin_read_DMA23_CURR_Y_COUNT() bfin_read16(DMA23_CURR_Y_COUNT)
1560#define bfin_write_DMA23_CURR_Y_COUNT(val) bfin_write16(DMA23_CURR_Y_COUNT, val)
1561
1562/* MDMA Stream 2 Registers */
1563
1564#define bfin_read_MDMA_D2_NEXT_DESC_PTR() bfin_read32(MDMA_D2_NEXT_DESC_PTR)
1565#define bfin_write_MDMA_D2_NEXT_DESC_PTR(val) bfin_write32(MDMA_D2_NEXT_DESC_PTR)
1566#define bfin_read_MDMA_D2_START_ADDR() bfin_read32(MDMA_D2_START_ADDR)
1567#define bfin_write_MDMA_D2_START_ADDR(val) bfin_write32(MDMA_D2_START_ADDR)
1568#define bfin_read_MDMA_D2_CONFIG() bfin_read16(MDMA_D2_CONFIG)
1569#define bfin_write_MDMA_D2_CONFIG(val) bfin_write16(MDMA_D2_CONFIG, val)
1570#define bfin_read_MDMA_D2_X_COUNT() bfin_read16(MDMA_D2_X_COUNT)
1571#define bfin_write_MDMA_D2_X_COUNT(val) bfin_write16(MDMA_D2_X_COUNT, val)
1572#define bfin_read_MDMA_D2_X_MODIFY() bfin_read16(MDMA_D2_X_MODIFY)
1573#define bfin_write_MDMA_D2_X_MODIFY(val) bfin_write16(MDMA_D2_X_MODIFY)
1574#define bfin_read_MDMA_D2_Y_COUNT() bfin_read16(MDMA_D2_Y_COUNT)
1575#define bfin_write_MDMA_D2_Y_COUNT(val) bfin_write16(MDMA_D2_Y_COUNT, val)
1576#define bfin_read_MDMA_D2_Y_MODIFY() bfin_read16(MDMA_D2_Y_MODIFY)
1577#define bfin_write_MDMA_D2_Y_MODIFY(val) bfin_write16(MDMA_D2_Y_MODIFY)
1578#define bfin_read_MDMA_D2_CURR_DESC_PTR() bfin_read32(MDMA_D2_CURR_DESC_PTR)
1579#define bfin_write_MDMA_D2_CURR_DESC_PTR(val) bfin_write32(MDMA_D2_CURR_DESC_PTR)
1580#define bfin_read_MDMA_D2_CURR_ADDR() bfin_read32(MDMA_D2_CURR_ADDR)
1581#define bfin_write_MDMA_D2_CURR_ADDR(val) bfin_write32(MDMA_D2_CURR_ADDR)
1582#define bfin_read_MDMA_D2_IRQ_STATUS() bfin_read16(MDMA_D2_IRQ_STATUS)
1583#define bfin_write_MDMA_D2_IRQ_STATUS(val) bfin_write16(MDMA_D2_IRQ_STATUS, val)
1584#define bfin_read_MDMA_D2_PERIPHERAL_MAP() bfin_read16(MDMA_D2_PERIPHERAL_MAP)
1585#define bfin_write_MDMA_D2_PERIPHERAL_MAP(val) bfin_write16(MDMA_D2_PERIPHERAL_MAP, val)
1586#define bfin_read_MDMA_D2_CURR_X_COUNT() bfin_read16(MDMA_D2_CURR_X_COUNT)
1587#define bfin_write_MDMA_D2_CURR_X_COUNT(val) bfin_write16(MDMA_D2_CURR_X_COUNT, val)
1588#define bfin_read_MDMA_D2_CURR_Y_COUNT() bfin_read16(MDMA_D2_CURR_Y_COUNT)
1589#define bfin_write_MDMA_D2_CURR_Y_COUNT(val) bfin_write16(MDMA_D2_CURR_Y_COUNT, val)
1590#define bfin_read_MDMA_S2_NEXT_DESC_PTR() bfin_read32(MDMA_S2_NEXT_DESC_PTR)
1591#define bfin_write_MDMA_S2_NEXT_DESC_PTR(val) bfin_write32(MDMA_S2_NEXT_DESC_PTR)
1592#define bfin_read_MDMA_S2_START_ADDR() bfin_read32(MDMA_S2_START_ADDR)
1593#define bfin_write_MDMA_S2_START_ADDR(val) bfin_write32(MDMA_S2_START_ADDR)
1594#define bfin_read_MDMA_S2_CONFIG() bfin_read16(MDMA_S2_CONFIG)
1595#define bfin_write_MDMA_S2_CONFIG(val) bfin_write16(MDMA_S2_CONFIG, val)
1596#define bfin_read_MDMA_S2_X_COUNT() bfin_read16(MDMA_S2_X_COUNT)
1597#define bfin_write_MDMA_S2_X_COUNT(val) bfin_write16(MDMA_S2_X_COUNT, val)
1598#define bfin_read_MDMA_S2_X_MODIFY() bfin_read16(MDMA_S2_X_MODIFY)
1599#define bfin_write_MDMA_S2_X_MODIFY(val) bfin_write16(MDMA_S2_X_MODIFY)
1600#define bfin_read_MDMA_S2_Y_COUNT() bfin_read16(MDMA_S2_Y_COUNT)
1601#define bfin_write_MDMA_S2_Y_COUNT(val) bfin_write16(MDMA_S2_Y_COUNT, val)
1602#define bfin_read_MDMA_S2_Y_MODIFY() bfin_read16(MDMA_S2_Y_MODIFY)
1603#define bfin_write_MDMA_S2_Y_MODIFY(val) bfin_write16(MDMA_S2_Y_MODIFY)
1604#define bfin_read_MDMA_S2_CURR_DESC_PTR() bfin_read32(MDMA_S2_CURR_DESC_PTR)
1605#define bfin_write_MDMA_S2_CURR_DESC_PTR(val) bfin_write32(MDMA_S2_CURR_DESC_PTR)
1606#define bfin_read_MDMA_S2_CURR_ADDR() bfin_read32(MDMA_S2_CURR_ADDR)
1607#define bfin_write_MDMA_S2_CURR_ADDR(val) bfin_write32(MDMA_S2_CURR_ADDR)
1608#define bfin_read_MDMA_S2_IRQ_STATUS() bfin_read16(MDMA_S2_IRQ_STATUS)
1609#define bfin_write_MDMA_S2_IRQ_STATUS(val) bfin_write16(MDMA_S2_IRQ_STATUS, val)
1610#define bfin_read_MDMA_S2_PERIPHERAL_MAP() bfin_read16(MDMA_S2_PERIPHERAL_MAP)
1611#define bfin_write_MDMA_S2_PERIPHERAL_MAP(val) bfin_write16(MDMA_S2_PERIPHERAL_MAP, val)
1612#define bfin_read_MDMA_S2_CURR_X_COUNT() bfin_read16(MDMA_S2_CURR_X_COUNT)
1613#define bfin_write_MDMA_S2_CURR_X_COUNT(val) bfin_write16(MDMA_S2_CURR_X_COUNT, val)
1614#define bfin_read_MDMA_S2_CURR_Y_COUNT() bfin_read16(MDMA_S2_CURR_Y_COUNT)
1615#define bfin_write_MDMA_S2_CURR_Y_COUNT(val) bfin_write16(MDMA_S2_CURR_Y_COUNT, val)
1616
1617/* MDMA Stream 3 Registers */
1618
1619#define bfin_read_MDMA_D3_NEXT_DESC_PTR() bfin_read32(MDMA_D3_NEXT_DESC_PTR)
1620#define bfin_write_MDMA_D3_NEXT_DESC_PTR(val) bfin_write32(MDMA_D3_NEXT_DESC_PTR)
1621#define bfin_read_MDMA_D3_START_ADDR() bfin_read32(MDMA_D3_START_ADDR)
1622#define bfin_write_MDMA_D3_START_ADDR(val) bfin_write32(MDMA_D3_START_ADDR)
1623#define bfin_read_MDMA_D3_CONFIG() bfin_read16(MDMA_D3_CONFIG)
1624#define bfin_write_MDMA_D3_CONFIG(val) bfin_write16(MDMA_D3_CONFIG, val)
1625#define bfin_read_MDMA_D3_X_COUNT() bfin_read16(MDMA_D3_X_COUNT)
1626#define bfin_write_MDMA_D3_X_COUNT(val) bfin_write16(MDMA_D3_X_COUNT, val)
1627#define bfin_read_MDMA_D3_X_MODIFY() bfin_read16(MDMA_D3_X_MODIFY)
1628#define bfin_write_MDMA_D3_X_MODIFY(val) bfin_write16(MDMA_D3_X_MODIFY)
1629#define bfin_read_MDMA_D3_Y_COUNT() bfin_read16(MDMA_D3_Y_COUNT)
1630#define bfin_write_MDMA_D3_Y_COUNT(val) bfin_write16(MDMA_D3_Y_COUNT, val)
1631#define bfin_read_MDMA_D3_Y_MODIFY() bfin_read16(MDMA_D3_Y_MODIFY)
1632#define bfin_write_MDMA_D3_Y_MODIFY(val) bfin_write16(MDMA_D3_Y_MODIFY)
1633#define bfin_read_MDMA_D3_CURR_DESC_PTR() bfin_read32(MDMA_D3_CURR_DESC_PTR)
1634#define bfin_write_MDMA_D3_CURR_DESC_PTR(val) bfin_write32(MDMA_D3_CURR_DESC_PTR)
1635#define bfin_read_MDMA_D3_CURR_ADDR() bfin_read32(MDMA_D3_CURR_ADDR)
1636#define bfin_write_MDMA_D3_CURR_ADDR(val) bfin_write32(MDMA_D3_CURR_ADDR)
1637#define bfin_read_MDMA_D3_IRQ_STATUS() bfin_read16(MDMA_D3_IRQ_STATUS)
1638#define bfin_write_MDMA_D3_IRQ_STATUS(val) bfin_write16(MDMA_D3_IRQ_STATUS, val)
1639#define bfin_read_MDMA_D3_PERIPHERAL_MAP() bfin_read16(MDMA_D3_PERIPHERAL_MAP)
1640#define bfin_write_MDMA_D3_PERIPHERAL_MAP(val) bfin_write16(MDMA_D3_PERIPHERAL_MAP, val)
1641#define bfin_read_MDMA_D3_CURR_X_COUNT() bfin_read16(MDMA_D3_CURR_X_COUNT)
1642#define bfin_write_MDMA_D3_CURR_X_COUNT(val) bfin_write16(MDMA_D3_CURR_X_COUNT, val)
1643#define bfin_read_MDMA_D3_CURR_Y_COUNT() bfin_read16(MDMA_D3_CURR_Y_COUNT)
1644#define bfin_write_MDMA_D3_CURR_Y_COUNT(val) bfin_write16(MDMA_D3_CURR_Y_COUNT, val)
1645#define bfin_read_MDMA_S3_NEXT_DESC_PTR() bfin_read32(MDMA_S3_NEXT_DESC_PTR)
1646#define bfin_write_MDMA_S3_NEXT_DESC_PTR(val) bfin_write32(MDMA_S3_NEXT_DESC_PTR)
1647#define bfin_read_MDMA_S3_START_ADDR() bfin_read32(MDMA_S3_START_ADDR)
1648#define bfin_write_MDMA_S3_START_ADDR(val) bfin_write32(MDMA_S3_START_ADDR)
1649#define bfin_read_MDMA_S3_CONFIG() bfin_read16(MDMA_S3_CONFIG)
1650#define bfin_write_MDMA_S3_CONFIG(val) bfin_write16(MDMA_S3_CONFIG, val)
1651#define bfin_read_MDMA_S3_X_COUNT() bfin_read16(MDMA_S3_X_COUNT)
1652#define bfin_write_MDMA_S3_X_COUNT(val) bfin_write16(MDMA_S3_X_COUNT, val)
1653#define bfin_read_MDMA_S3_X_MODIFY() bfin_read16(MDMA_S3_X_MODIFY)
1654#define bfin_write_MDMA_S3_X_MODIFY(val) bfin_write16(MDMA_S3_X_MODIFY)
1655#define bfin_read_MDMA_S3_Y_COUNT() bfin_read16(MDMA_S3_Y_COUNT)
1656#define bfin_write_MDMA_S3_Y_COUNT(val) bfin_write16(MDMA_S3_Y_COUNT, val)
1657#define bfin_read_MDMA_S3_Y_MODIFY() bfin_read16(MDMA_S3_Y_MODIFY)
1658#define bfin_write_MDMA_S3_Y_MODIFY(val) bfin_write16(MDMA_S3_Y_MODIFY)
1659#define bfin_read_MDMA_S3_CURR_DESC_PTR() bfin_read32(MDMA_S3_CURR_DESC_PTR)
1660#define bfin_write_MDMA_S3_CURR_DESC_PTR(val) bfin_write32(MDMA_S3_CURR_DESC_PTR)
1661#define bfin_read_MDMA_S3_CURR_ADDR() bfin_read32(MDMA_S3_CURR_ADDR)
1662#define bfin_write_MDMA_S3_CURR_ADDR(val) bfin_write32(MDMA_S3_CURR_ADDR)
1663#define bfin_read_MDMA_S3_IRQ_STATUS() bfin_read16(MDMA_S3_IRQ_STATUS)
1664#define bfin_write_MDMA_S3_IRQ_STATUS(val) bfin_write16(MDMA_S3_IRQ_STATUS, val)
1665#define bfin_read_MDMA_S3_PERIPHERAL_MAP() bfin_read16(MDMA_S3_PERIPHERAL_MAP)
1666#define bfin_write_MDMA_S3_PERIPHERAL_MAP(val) bfin_write16(MDMA_S3_PERIPHERAL_MAP, val)
1667#define bfin_read_MDMA_S3_CURR_X_COUNT() bfin_read16(MDMA_S3_CURR_X_COUNT)
1668#define bfin_write_MDMA_S3_CURR_X_COUNT(val) bfin_write16(MDMA_S3_CURR_X_COUNT, val)
1669#define bfin_read_MDMA_S3_CURR_Y_COUNT() bfin_read16(MDMA_S3_CURR_Y_COUNT)
1670#define bfin_write_MDMA_S3_CURR_Y_COUNT(val) bfin_write16(MDMA_S3_CURR_Y_COUNT, val)
1671
1672/* UART1 Registers */
1673
1674#define bfin_read_UART1_DLL() bfin_read16(UART1_DLL)
1675#define bfin_write_UART1_DLL(val) bfin_write16(UART1_DLL, val)
1676#define bfin_read_UART1_DLH() bfin_read16(UART1_DLH)
1677#define bfin_write_UART1_DLH(val) bfin_write16(UART1_DLH, val)
1678#define bfin_read_UART1_GCTL() bfin_read16(UART1_GCTL)
1679#define bfin_write_UART1_GCTL(val) bfin_write16(UART1_GCTL, val)
1680#define bfin_read_UART1_LCR() bfin_read16(UART1_LCR)
1681#define bfin_write_UART1_LCR(val) bfin_write16(UART1_LCR, val)
1682#define bfin_read_UART1_MCR() bfin_read16(UART1_MCR)
1683#define bfin_write_UART1_MCR(val) bfin_write16(UART1_MCR, val)
1684#define bfin_read_UART1_LSR() bfin_read16(UART1_LSR)
1685#define bfin_write_UART1_LSR(val) bfin_write16(UART1_LSR, val)
1686#define bfin_read_UART1_MSR() bfin_read16(UART1_MSR)
1687#define bfin_write_UART1_MSR(val) bfin_write16(UART1_MSR, val)
1688#define bfin_read_UART1_SCR() bfin_read16(UART1_SCR)
1689#define bfin_write_UART1_SCR(val) bfin_write16(UART1_SCR, val)
1690#define bfin_read_UART1_IER_SET() bfin_read16(UART1_IER_SET)
1691#define bfin_write_UART1_IER_SET(val) bfin_write16(UART1_IER_SET, val)
1692#define bfin_read_UART1_IER_CLEAR() bfin_read16(UART1_IER_CLEAR)
1693#define bfin_write_UART1_IER_CLEAR(val) bfin_write16(UART1_IER_CLEAR, val)
1694#define bfin_read_UART1_THR() bfin_read16(UART1_THR)
1695#define bfin_write_UART1_THR(val) bfin_write16(UART1_THR, val)
1696#define bfin_read_UART1_RBR() bfin_read16(UART1_RBR)
1697#define bfin_write_UART1_RBR(val) bfin_write16(UART1_RBR, val)
1698
1699/* UART2 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 bfin_read_()rocessors */
1700
1701/* SPI1 Registers */
1702
1703#define bfin_read_SPI1_CTL() bfin_read16(SPI1_CTL)
1704#define bfin_write_SPI1_CTL(val) bfin_write16(SPI1_CTL, val)
1705#define bfin_read_SPI1_FLG() bfin_read16(SPI1_FLG)
1706#define bfin_write_SPI1_FLG(val) bfin_write16(SPI1_FLG, val)
1707#define bfin_read_SPI1_STAT() bfin_read16(SPI1_STAT)
1708#define bfin_write_SPI1_STAT(val) bfin_write16(SPI1_STAT, val)
1709#define bfin_read_SPI1_TDBR() bfin_read16(SPI1_TDBR)
1710#define bfin_write_SPI1_TDBR(val) bfin_write16(SPI1_TDBR, val)
1711#define bfin_read_SPI1_RDBR() bfin_read16(SPI1_RDBR)
1712#define bfin_write_SPI1_RDBR(val) bfin_write16(SPI1_RDBR, val)
1713#define bfin_read_SPI1_BAUD() bfin_read16(SPI1_BAUD)
1714#define bfin_write_SPI1_BAUD(val) bfin_write16(SPI1_BAUD, val)
1715#define bfin_read_SPI1_SHADOW() bfin_read16(SPI1_SHADOW)
1716#define bfin_write_SPI1_SHADOW(val) bfin_write16(SPI1_SHADOW, val)
1717
1718/* SPORT2 Registers */
1719
1720#define bfin_read_SPORT2_TCR1() bfin_read16(SPORT2_TCR1)
1721#define bfin_write_SPORT2_TCR1(val) bfin_write16(SPORT2_TCR1, val)
1722#define bfin_read_SPORT2_TCR2() bfin_read16(SPORT2_TCR2)
1723#define bfin_write_SPORT2_TCR2(val) bfin_write16(SPORT2_TCR2, val)
1724#define bfin_read_SPORT2_TCLKDIV() bfin_read16(SPORT2_TCLKDIV)
1725#define bfin_write_SPORT2_TCLKDIV(val) bfin_write16(SPORT2_TCLKDIV, val)
1726#define bfin_read_SPORT2_TFSDIV() bfin_read16(SPORT2_TFSDIV)
1727#define bfin_write_SPORT2_TFSDIV(val) bfin_write16(SPORT2_TFSDIV, val)
1728#define bfin_read_SPORT2_TX() bfin_read32(SPORT2_TX)
1729#define bfin_write_SPORT2_TX(val) bfin_write32(SPORT2_TX, val)
1730#define bfin_read_SPORT2_RX() bfin_read32(SPORT2_RX)
1731#define bfin_write_SPORT2_RX(val) bfin_write32(SPORT2_RX, val)
1732#define bfin_read_SPORT2_RCR1() bfin_read16(SPORT2_RCR1)
1733#define bfin_write_SPORT2_RCR1(val) bfin_write16(SPORT2_RCR1, val)
1734#define bfin_read_SPORT2_RCR2() bfin_read16(SPORT2_RCR2)
1735#define bfin_write_SPORT2_RCR2(val) bfin_write16(SPORT2_RCR2, val)
1736#define bfin_read_SPORT2_RCLKDIV() bfin_read16(SPORT2_RCLKDIV)
1737#define bfin_write_SPORT2_RCLKDIV(val) bfin_write16(SPORT2_RCLKDIV, val)
1738#define bfin_read_SPORT2_RFSDIV() bfin_read16(SPORT2_RFSDIV)
1739#define bfin_write_SPORT2_RFSDIV(val) bfin_write16(SPORT2_RFSDIV, val)
1740#define bfin_read_SPORT2_STAT() bfin_read16(SPORT2_STAT)
1741#define bfin_write_SPORT2_STAT(val) bfin_write16(SPORT2_STAT, val)
1742#define bfin_read_SPORT2_CHNL() bfin_read16(SPORT2_CHNL)
1743#define bfin_write_SPORT2_CHNL(val) bfin_write16(SPORT2_CHNL, val)
1744#define bfin_read_SPORT2_MCMC1() bfin_read16(SPORT2_MCMC1)
1745#define bfin_write_SPORT2_MCMC1(val) bfin_write16(SPORT2_MCMC1, val)
1746#define bfin_read_SPORT2_MCMC2() bfin_read16(SPORT2_MCMC2)
1747#define bfin_write_SPORT2_MCMC2(val) bfin_write16(SPORT2_MCMC2, val)
1748#define bfin_read_SPORT2_MTCS0() bfin_read32(SPORT2_MTCS0)
1749#define bfin_write_SPORT2_MTCS0(val) bfin_write32(SPORT2_MTCS0, val)
1750#define bfin_read_SPORT2_MTCS1() bfin_read32(SPORT2_MTCS1)
1751#define bfin_write_SPORT2_MTCS1(val) bfin_write32(SPORT2_MTCS1, val)
1752#define bfin_read_SPORT2_MTCS2() bfin_read32(SPORT2_MTCS2)
1753#define bfin_write_SPORT2_MTCS2(val) bfin_write32(SPORT2_MTCS2, val)
1754#define bfin_read_SPORT2_MTCS3() bfin_read32(SPORT2_MTCS3)
1755#define bfin_write_SPORT2_MTCS3(val) bfin_write32(SPORT2_MTCS3, val)
1756#define bfin_read_SPORT2_MRCS0() bfin_read32(SPORT2_MRCS0)
1757#define bfin_write_SPORT2_MRCS0(val) bfin_write32(SPORT2_MRCS0, val)
1758#define bfin_read_SPORT2_MRCS1() bfin_read32(SPORT2_MRCS1)
1759#define bfin_write_SPORT2_MRCS1(val) bfin_write32(SPORT2_MRCS1, val)
1760#define bfin_read_SPORT2_MRCS2() bfin_read32(SPORT2_MRCS2)
1761#define bfin_write_SPORT2_MRCS2(val) bfin_write32(SPORT2_MRCS2, val)
1762#define bfin_read_SPORT2_MRCS3() bfin_read32(SPORT2_MRCS3)
1763#define bfin_write_SPORT2_MRCS3(val) bfin_write32(SPORT2_MRCS3, val)
1764
1765/* SPORT3 Registers */
1766
1767#define bfin_read_SPORT3_TCR1() bfin_read16(SPORT3_TCR1)
1768#define bfin_write_SPORT3_TCR1(val) bfin_write16(SPORT3_TCR1, val)
1769#define bfin_read_SPORT3_TCR2() bfin_read16(SPORT3_TCR2)
1770#define bfin_write_SPORT3_TCR2(val) bfin_write16(SPORT3_TCR2, val)
1771#define bfin_read_SPORT3_TCLKDIV() bfin_read16(SPORT3_TCLKDIV)
1772#define bfin_write_SPORT3_TCLKDIV(val) bfin_write16(SPORT3_TCLKDIV, val)
1773#define bfin_read_SPORT3_TFSDIV() bfin_read16(SPORT3_TFSDIV)
1774#define bfin_write_SPORT3_TFSDIV(val) bfin_write16(SPORT3_TFSDIV, val)
1775#define bfin_read_SPORT3_TX() bfin_read32(SPORT3_TX)
1776#define bfin_write_SPORT3_TX(val) bfin_write32(SPORT3_TX, val)
1777#define bfin_read_SPORT3_RX() bfin_read32(SPORT3_RX)
1778#define bfin_write_SPORT3_RX(val) bfin_write32(SPORT3_RX, val)
1779#define bfin_read_SPORT3_RCR1() bfin_read16(SPORT3_RCR1)
1780#define bfin_write_SPORT3_RCR1(val) bfin_write16(SPORT3_RCR1, val)
1781#define bfin_read_SPORT3_RCR2() bfin_read16(SPORT3_RCR2)
1782#define bfin_write_SPORT3_RCR2(val) bfin_write16(SPORT3_RCR2, val)
1783#define bfin_read_SPORT3_RCLKDIV() bfin_read16(SPORT3_RCLKDIV)
1784#define bfin_write_SPORT3_RCLKDIV(val) bfin_write16(SPORT3_RCLKDIV, val)
1785#define bfin_read_SPORT3_RFSDIV() bfin_read16(SPORT3_RFSDIV)
1786#define bfin_write_SPORT3_RFSDIV(val) bfin_write16(SPORT3_RFSDIV, val)
1787#define bfin_read_SPORT3_STAT() bfin_read16(SPORT3_STAT)
1788#define bfin_write_SPORT3_STAT(val) bfin_write16(SPORT3_STAT, val)
1789#define bfin_read_SPORT3_CHNL() bfin_read16(SPORT3_CHNL)
1790#define bfin_write_SPORT3_CHNL(val) bfin_write16(SPORT3_CHNL, val)
1791#define bfin_read_SPORT3_MCMC1() bfin_read16(SPORT3_MCMC1)
1792#define bfin_write_SPORT3_MCMC1(val) bfin_write16(SPORT3_MCMC1, val)
1793#define bfin_read_SPORT3_MCMC2() bfin_read16(SPORT3_MCMC2)
1794#define bfin_write_SPORT3_MCMC2(val) bfin_write16(SPORT3_MCMC2, val)
1795#define bfin_read_SPORT3_MTCS0() bfin_read32(SPORT3_MTCS0)
1796#define bfin_write_SPORT3_MTCS0(val) bfin_write32(SPORT3_MTCS0, val)
1797#define bfin_read_SPORT3_MTCS1() bfin_read32(SPORT3_MTCS1)
1798#define bfin_write_SPORT3_MTCS1(val) bfin_write32(SPORT3_MTCS1, val)
1799#define bfin_read_SPORT3_MTCS2() bfin_read32(SPORT3_MTCS2)
1800#define bfin_write_SPORT3_MTCS2(val) bfin_write32(SPORT3_MTCS2, val)
1801#define bfin_read_SPORT3_MTCS3() bfin_read32(SPORT3_MTCS3)
1802#define bfin_write_SPORT3_MTCS3(val) bfin_write32(SPORT3_MTCS3, val)
1803#define bfin_read_SPORT3_MRCS0() bfin_read32(SPORT3_MRCS0)
1804#define bfin_write_SPORT3_MRCS0(val) bfin_write32(SPORT3_MRCS0, val)
1805#define bfin_read_SPORT3_MRCS1() bfin_read32(SPORT3_MRCS1)
1806#define bfin_write_SPORT3_MRCS1(val) bfin_write32(SPORT3_MRCS1, val)
1807#define bfin_read_SPORT3_MRCS2() bfin_read32(SPORT3_MRCS2)
1808#define bfin_write_SPORT3_MRCS2(val) bfin_write32(SPORT3_MRCS2, val)
1809#define bfin_read_SPORT3_MRCS3() bfin_read32(SPORT3_MRCS3)
1810#define bfin_write_SPORT3_MRCS3(val) bfin_write32(SPORT3_MRCS3, val)
1811
1812/* EPPI2 Registers */
1813
1814#define bfin_read_EPPI2_STATUS() bfin_read16(EPPI2_STATUS)
1815#define bfin_write_EPPI2_STATUS(val) bfin_write16(EPPI2_STATUS, val)
1816#define bfin_read_EPPI2_HCOUNT() bfin_read16(EPPI2_HCOUNT)
1817#define bfin_write_EPPI2_HCOUNT(val) bfin_write16(EPPI2_HCOUNT, val)
1818#define bfin_read_EPPI2_HDELAY() bfin_read16(EPPI2_HDELAY)
1819#define bfin_write_EPPI2_HDELAY(val) bfin_write16(EPPI2_HDELAY, val)
1820#define bfin_read_EPPI2_VCOUNT() bfin_read16(EPPI2_VCOUNT)
1821#define bfin_write_EPPI2_VCOUNT(val) bfin_write16(EPPI2_VCOUNT, val)
1822#define bfin_read_EPPI2_VDELAY() bfin_read16(EPPI2_VDELAY)
1823#define bfin_write_EPPI2_VDELAY(val) bfin_write16(EPPI2_VDELAY, val)
1824#define bfin_read_EPPI2_FRAME() bfin_read16(EPPI2_FRAME)
1825#define bfin_write_EPPI2_FRAME(val) bfin_write16(EPPI2_FRAME, val)
1826#define bfin_read_EPPI2_LINE() bfin_read16(EPPI2_LINE)
1827#define bfin_write_EPPI2_LINE(val) bfin_write16(EPPI2_LINE, val)
1828#define bfin_read_EPPI2_CLKDIV() bfin_read16(EPPI2_CLKDIV)
1829#define bfin_write_EPPI2_CLKDIV(val) bfin_write16(EPPI2_CLKDIV, val)
1830#define bfin_read_EPPI2_CONTROL() bfin_read32(EPPI2_CONTROL)
1831#define bfin_write_EPPI2_CONTROL(val) bfin_write32(EPPI2_CONTROL, val)
1832#define bfin_read_EPPI2_FS1W_HBL() bfin_read32(EPPI2_FS1W_HBL)
1833#define bfin_write_EPPI2_FS1W_HBL(val) bfin_write32(EPPI2_FS1W_HBL, val)
1834#define bfin_read_EPPI2_FS1P_AVPL() bfin_read32(EPPI2_FS1P_AVPL)
1835#define bfin_write_EPPI2_FS1P_AVPL(val) bfin_write32(EPPI2_FS1P_AVPL, val)
1836#define bfin_read_EPPI2_FS2W_LVB() bfin_read32(EPPI2_FS2W_LVB)
1837#define bfin_write_EPPI2_FS2W_LVB(val) bfin_write32(EPPI2_FS2W_LVB, val)
1838#define bfin_read_EPPI2_FS2P_LAVF() bfin_read32(EPPI2_FS2P_LAVF)
1839#define bfin_write_EPPI2_FS2P_LAVF(val) bfin_write32(EPPI2_FS2P_LAVF, val)
1840#define bfin_read_EPPI2_CLIP() bfin_read32(EPPI2_CLIP)
1841#define bfin_write_EPPI2_CLIP(val) bfin_write32(EPPI2_CLIP, val)
1842
1843/* CAN Controller 0 Config 1 Registers */
1844
1845#define bfin_read_CAN0_MC1() bfin_read16(CAN0_MC1)
1846#define bfin_write_CAN0_MC1(val) bfin_write16(CAN0_MC1, val)
1847#define bfin_read_CAN0_MD1() bfin_read16(CAN0_MD1)
1848#define bfin_write_CAN0_MD1(val) bfin_write16(CAN0_MD1, val)
1849#define bfin_read_CAN0_TRS1() bfin_read16(CAN0_TRS1)
1850#define bfin_write_CAN0_TRS1(val) bfin_write16(CAN0_TRS1, val)
1851#define bfin_read_CAN0_TRR1() bfin_read16(CAN0_TRR1)
1852#define bfin_write_CAN0_TRR1(val) bfin_write16(CAN0_TRR1, val)
1853#define bfin_read_CAN0_TA1() bfin_read16(CAN0_TA1)
1854#define bfin_write_CAN0_TA1(val) bfin_write16(CAN0_TA1, val)
1855#define bfin_read_CAN0_AA1() bfin_read16(CAN0_AA1)
1856#define bfin_write_CAN0_AA1(val) bfin_write16(CAN0_AA1, val)
1857#define bfin_read_CAN0_RMP1() bfin_read16(CAN0_RMP1)
1858#define bfin_write_CAN0_RMP1(val) bfin_write16(CAN0_RMP1, val)
1859#define bfin_read_CAN0_RML1() bfin_read16(CAN0_RML1)
1860#define bfin_write_CAN0_RML1(val) bfin_write16(CAN0_RML1, val)
1861#define bfin_read_CAN0_MBTIF1() bfin_read16(CAN0_MBTIF1)
1862#define bfin_write_CAN0_MBTIF1(val) bfin_write16(CAN0_MBTIF1, val)
1863#define bfin_read_CAN0_MBRIF1() bfin_read16(CAN0_MBRIF1)
1864#define bfin_write_CAN0_MBRIF1(val) bfin_write16(CAN0_MBRIF1, val)
1865#define bfin_read_CAN0_MBIM1() bfin_read16(CAN0_MBIM1)
1866#define bfin_write_CAN0_MBIM1(val) bfin_write16(CAN0_MBIM1, val)
1867#define bfin_read_CAN0_RFH1() bfin_read16(CAN0_RFH1)
1868#define bfin_write_CAN0_RFH1(val) bfin_write16(CAN0_RFH1, val)
1869#define bfin_read_CAN0_OPSS1() bfin_read16(CAN0_OPSS1)
1870#define bfin_write_CAN0_OPSS1(val) bfin_write16(CAN0_OPSS1, val)
1871
1872/* CAN Controller 0 Config 2 Registers */
1873
1874#define bfin_read_CAN0_MC2() bfin_read16(CAN0_MC2)
1875#define bfin_write_CAN0_MC2(val) bfin_write16(CAN0_MC2, val)
1876#define bfin_read_CAN0_MD2() bfin_read16(CAN0_MD2)
1877#define bfin_write_CAN0_MD2(val) bfin_write16(CAN0_MD2, val)
1878#define bfin_read_CAN0_TRS2() bfin_read16(CAN0_TRS2)
1879#define bfin_write_CAN0_TRS2(val) bfin_write16(CAN0_TRS2, val)
1880#define bfin_read_CAN0_TRR2() bfin_read16(CAN0_TRR2)
1881#define bfin_write_CAN0_TRR2(val) bfin_write16(CAN0_TRR2, val)
1882#define bfin_read_CAN0_TA2() bfin_read16(CAN0_TA2)
1883#define bfin_write_CAN0_TA2(val) bfin_write16(CAN0_TA2, val)
1884#define bfin_read_CAN0_AA2() bfin_read16(CAN0_AA2)
1885#define bfin_write_CAN0_AA2(val) bfin_write16(CAN0_AA2, val)
1886#define bfin_read_CAN0_RMP2() bfin_read16(CAN0_RMP2)
1887#define bfin_write_CAN0_RMP2(val) bfin_write16(CAN0_RMP2, val)
1888#define bfin_read_CAN0_RML2() bfin_read16(CAN0_RML2)
1889#define bfin_write_CAN0_RML2(val) bfin_write16(CAN0_RML2, val)
1890#define bfin_read_CAN0_MBTIF2() bfin_read16(CAN0_MBTIF2)
1891#define bfin_write_CAN0_MBTIF2(val) bfin_write16(CAN0_MBTIF2, val)
1892#define bfin_read_CAN0_MBRIF2() bfin_read16(CAN0_MBRIF2)
1893#define bfin_write_CAN0_MBRIF2(val) bfin_write16(CAN0_MBRIF2, val)
1894#define bfin_read_CAN0_MBIM2() bfin_read16(CAN0_MBIM2)
1895#define bfin_write_CAN0_MBIM2(val) bfin_write16(CAN0_MBIM2, val)
1896#define bfin_read_CAN0_RFH2() bfin_read16(CAN0_RFH2)
1897#define bfin_write_CAN0_RFH2(val) bfin_write16(CAN0_RFH2, val)
1898#define bfin_read_CAN0_OPSS2() bfin_read16(CAN0_OPSS2)
1899#define bfin_write_CAN0_OPSS2(val) bfin_write16(CAN0_OPSS2, val)
1900
1901/* CAN Controller 0 Clock/Interrubfin_read_()t/Counter Registers */
1902
1903#define bfin_read_CAN0_CLOCK() bfin_read16(CAN0_CLOCK)
1904#define bfin_write_CAN0_CLOCK(val) bfin_write16(CAN0_CLOCK, val)
1905#define bfin_read_CAN0_TIMING() bfin_read16(CAN0_TIMING)
1906#define bfin_write_CAN0_TIMING(val) bfin_write16(CAN0_TIMING, val)
1907#define bfin_read_CAN0_DEBUG() bfin_read16(CAN0_DEBUG)
1908#define bfin_write_CAN0_DEBUG(val) bfin_write16(CAN0_DEBUG, val)
1909#define bfin_read_CAN0_STATUS() bfin_read16(CAN0_STATUS)
1910#define bfin_write_CAN0_STATUS(val) bfin_write16(CAN0_STATUS, val)
1911#define bfin_read_CAN0_CEC() bfin_read16(CAN0_CEC)
1912#define bfin_write_CAN0_CEC(val) bfin_write16(CAN0_CEC, val)
1913#define bfin_read_CAN0_GIS() bfin_read16(CAN0_GIS)
1914#define bfin_write_CAN0_GIS(val) bfin_write16(CAN0_GIS, val)
1915#define bfin_read_CAN0_GIM() bfin_read16(CAN0_GIM)
1916#define bfin_write_CAN0_GIM(val) bfin_write16(CAN0_GIM, val)
1917#define bfin_read_CAN0_GIF() bfin_read16(CAN0_GIF)
1918#define bfin_write_CAN0_GIF(val) bfin_write16(CAN0_GIF, val)
1919#define bfin_read_CAN0_CONTROL() bfin_read16(CAN0_CONTROL)
1920#define bfin_write_CAN0_CONTROL(val) bfin_write16(CAN0_CONTROL, val)
1921#define bfin_read_CAN0_INTR() bfin_read16(CAN0_INTR)
1922#define bfin_write_CAN0_INTR(val) bfin_write16(CAN0_INTR, val)
1923#define bfin_read_CAN0_MBTD() bfin_read16(CAN0_MBTD)
1924#define bfin_write_CAN0_MBTD(val) bfin_write16(CAN0_MBTD, val)
1925#define bfin_read_CAN0_EWR() bfin_read16(CAN0_EWR)
1926#define bfin_write_CAN0_EWR(val) bfin_write16(CAN0_EWR, val)
1927#define bfin_read_CAN0_ESR() bfin_read16(CAN0_ESR)
1928#define bfin_write_CAN0_ESR(val) bfin_write16(CAN0_ESR, val)
1929#define bfin_read_CAN0_UCCNT() bfin_read16(CAN0_UCCNT)
1930#define bfin_write_CAN0_UCCNT(val) bfin_write16(CAN0_UCCNT, val)
1931#define bfin_read_CAN0_UCRC() bfin_read16(CAN0_UCRC)
1932#define bfin_write_CAN0_UCRC(val) bfin_write16(CAN0_UCRC, val)
1933#define bfin_read_CAN0_UCCNF() bfin_read16(CAN0_UCCNF)
1934#define bfin_write_CAN0_UCCNF(val) bfin_write16(CAN0_UCCNF, val)
1935
1936/* CAN Controller 0 Accebfin_read_()tance Registers */
1937
1938#define bfin_read_CAN0_AM00L() bfin_read16(CAN0_AM00L)
1939#define bfin_write_CAN0_AM00L(val) bfin_write16(CAN0_AM00L, val)
1940#define bfin_read_CAN0_AM00H() bfin_read16(CAN0_AM00H)
1941#define bfin_write_CAN0_AM00H(val) bfin_write16(CAN0_AM00H, val)
1942#define bfin_read_CAN0_AM01L() bfin_read16(CAN0_AM01L)
1943#define bfin_write_CAN0_AM01L(val) bfin_write16(CAN0_AM01L, val)
1944#define bfin_read_CAN0_AM01H() bfin_read16(CAN0_AM01H)
1945#define bfin_write_CAN0_AM01H(val) bfin_write16(CAN0_AM01H, val)
1946#define bfin_read_CAN0_AM02L() bfin_read16(CAN0_AM02L)
1947#define bfin_write_CAN0_AM02L(val) bfin_write16(CAN0_AM02L, val)
1948#define bfin_read_CAN0_AM02H() bfin_read16(CAN0_AM02H)
1949#define bfin_write_CAN0_AM02H(val) bfin_write16(CAN0_AM02H, val)
1950#define bfin_read_CAN0_AM03L() bfin_read16(CAN0_AM03L)
1951#define bfin_write_CAN0_AM03L(val) bfin_write16(CAN0_AM03L, val)
1952#define bfin_read_CAN0_AM03H() bfin_read16(CAN0_AM03H)
1953#define bfin_write_CAN0_AM03H(val) bfin_write16(CAN0_AM03H, val)
1954#define bfin_read_CAN0_AM04L() bfin_read16(CAN0_AM04L)
1955#define bfin_write_CAN0_AM04L(val) bfin_write16(CAN0_AM04L, val)
1956#define bfin_read_CAN0_AM04H() bfin_read16(CAN0_AM04H)
1957#define bfin_write_CAN0_AM04H(val) bfin_write16(CAN0_AM04H, val)
1958#define bfin_read_CAN0_AM05L() bfin_read16(CAN0_AM05L)
1959#define bfin_write_CAN0_AM05L(val) bfin_write16(CAN0_AM05L, val)
1960#define bfin_read_CAN0_AM05H() bfin_read16(CAN0_AM05H)
1961#define bfin_write_CAN0_AM05H(val) bfin_write16(CAN0_AM05H, val)
1962#define bfin_read_CAN0_AM06L() bfin_read16(CAN0_AM06L)
1963#define bfin_write_CAN0_AM06L(val) bfin_write16(CAN0_AM06L, val)
1964#define bfin_read_CAN0_AM06H() bfin_read16(CAN0_AM06H)
1965#define bfin_write_CAN0_AM06H(val) bfin_write16(CAN0_AM06H, val)
1966#define bfin_read_CAN0_AM07L() bfin_read16(CAN0_AM07L)
1967#define bfin_write_CAN0_AM07L(val) bfin_write16(CAN0_AM07L, val)
1968#define bfin_read_CAN0_AM07H() bfin_read16(CAN0_AM07H)
1969#define bfin_write_CAN0_AM07H(val) bfin_write16(CAN0_AM07H, val)
1970#define bfin_read_CAN0_AM08L() bfin_read16(CAN0_AM08L)
1971#define bfin_write_CAN0_AM08L(val) bfin_write16(CAN0_AM08L, val)
1972#define bfin_read_CAN0_AM08H() bfin_read16(CAN0_AM08H)
1973#define bfin_write_CAN0_AM08H(val) bfin_write16(CAN0_AM08H, val)
1974#define bfin_read_CAN0_AM09L() bfin_read16(CAN0_AM09L)
1975#define bfin_write_CAN0_AM09L(val) bfin_write16(CAN0_AM09L, val)
1976#define bfin_read_CAN0_AM09H() bfin_read16(CAN0_AM09H)
1977#define bfin_write_CAN0_AM09H(val) bfin_write16(CAN0_AM09H, val)
1978#define bfin_read_CAN0_AM10L() bfin_read16(CAN0_AM10L)
1979#define bfin_write_CAN0_AM10L(val) bfin_write16(CAN0_AM10L, val)
1980#define bfin_read_CAN0_AM10H() bfin_read16(CAN0_AM10H)
1981#define bfin_write_CAN0_AM10H(val) bfin_write16(CAN0_AM10H, val)
1982#define bfin_read_CAN0_AM11L() bfin_read16(CAN0_AM11L)
1983#define bfin_write_CAN0_AM11L(val) bfin_write16(CAN0_AM11L, val)
1984#define bfin_read_CAN0_AM11H() bfin_read16(CAN0_AM11H)
1985#define bfin_write_CAN0_AM11H(val) bfin_write16(CAN0_AM11H, val)
1986#define bfin_read_CAN0_AM12L() bfin_read16(CAN0_AM12L)
1987#define bfin_write_CAN0_AM12L(val) bfin_write16(CAN0_AM12L, val)
1988#define bfin_read_CAN0_AM12H() bfin_read16(CAN0_AM12H)
1989#define bfin_write_CAN0_AM12H(val) bfin_write16(CAN0_AM12H, val)
1990#define bfin_read_CAN0_AM13L() bfin_read16(CAN0_AM13L)
1991#define bfin_write_CAN0_AM13L(val) bfin_write16(CAN0_AM13L, val)
1992#define bfin_read_CAN0_AM13H() bfin_read16(CAN0_AM13H)
1993#define bfin_write_CAN0_AM13H(val) bfin_write16(CAN0_AM13H, val)
1994#define bfin_read_CAN0_AM14L() bfin_read16(CAN0_AM14L)
1995#define bfin_write_CAN0_AM14L(val) bfin_write16(CAN0_AM14L, val)
1996#define bfin_read_CAN0_AM14H() bfin_read16(CAN0_AM14H)
1997#define bfin_write_CAN0_AM14H(val) bfin_write16(CAN0_AM14H, val)
1998#define bfin_read_CAN0_AM15L() bfin_read16(CAN0_AM15L)
1999#define bfin_write_CAN0_AM15L(val) bfin_write16(CAN0_AM15L, val)
2000#define bfin_read_CAN0_AM15H() bfin_read16(CAN0_AM15H)
2001#define bfin_write_CAN0_AM15H(val) bfin_write16(CAN0_AM15H, val)
2002
2003/* CAN Controller 0 Accebfin_read_()tance Registers */
2004
2005#define bfin_read_CAN0_AM16L() bfin_read16(CAN0_AM16L)
2006#define bfin_write_CAN0_AM16L(val) bfin_write16(CAN0_AM16L, val)
2007#define bfin_read_CAN0_AM16H() bfin_read16(CAN0_AM16H)
2008#define bfin_write_CAN0_AM16H(val) bfin_write16(CAN0_AM16H, val)
2009#define bfin_read_CAN0_AM17L() bfin_read16(CAN0_AM17L)
2010#define bfin_write_CAN0_AM17L(val) bfin_write16(CAN0_AM17L, val)
2011#define bfin_read_CAN0_AM17H() bfin_read16(CAN0_AM17H)
2012#define bfin_write_CAN0_AM17H(val) bfin_write16(CAN0_AM17H, val)
2013#define bfin_read_CAN0_AM18L() bfin_read16(CAN0_AM18L)
2014#define bfin_write_CAN0_AM18L(val) bfin_write16(CAN0_AM18L, val)
2015#define bfin_read_CAN0_AM18H() bfin_read16(CAN0_AM18H)
2016#define bfin_write_CAN0_AM18H(val) bfin_write16(CAN0_AM18H, val)
2017#define bfin_read_CAN0_AM19L() bfin_read16(CAN0_AM19L)
2018#define bfin_write_CAN0_AM19L(val) bfin_write16(CAN0_AM19L, val)
2019#define bfin_read_CAN0_AM19H() bfin_read16(CAN0_AM19H)
2020#define bfin_write_CAN0_AM19H(val) bfin_write16(CAN0_AM19H, val)
2021#define bfin_read_CAN0_AM20L() bfin_read16(CAN0_AM20L)
2022#define bfin_write_CAN0_AM20L(val) bfin_write16(CAN0_AM20L, val)
2023#define bfin_read_CAN0_AM20H() bfin_read16(CAN0_AM20H)
2024#define bfin_write_CAN0_AM20H(val) bfin_write16(CAN0_AM20H, val)
2025#define bfin_read_CAN0_AM21L() bfin_read16(CAN0_AM21L)
2026#define bfin_write_CAN0_AM21L(val) bfin_write16(CAN0_AM21L, val)
2027#define bfin_read_CAN0_AM21H() bfin_read16(CAN0_AM21H)
2028#define bfin_write_CAN0_AM21H(val) bfin_write16(CAN0_AM21H, val)
2029#define bfin_read_CAN0_AM22L() bfin_read16(CAN0_AM22L)
2030#define bfin_write_CAN0_AM22L(val) bfin_write16(CAN0_AM22L, val)
2031#define bfin_read_CAN0_AM22H() bfin_read16(CAN0_AM22H)
2032#define bfin_write_CAN0_AM22H(val) bfin_write16(CAN0_AM22H, val)
2033#define bfin_read_CAN0_AM23L() bfin_read16(CAN0_AM23L)
2034#define bfin_write_CAN0_AM23L(val) bfin_write16(CAN0_AM23L, val)
2035#define bfin_read_CAN0_AM23H() bfin_read16(CAN0_AM23H)
2036#define bfin_write_CAN0_AM23H(val) bfin_write16(CAN0_AM23H, val)
2037#define bfin_read_CAN0_AM24L() bfin_read16(CAN0_AM24L)
2038#define bfin_write_CAN0_AM24L(val) bfin_write16(CAN0_AM24L, val)
2039#define bfin_read_CAN0_AM24H() bfin_read16(CAN0_AM24H)
2040#define bfin_write_CAN0_AM24H(val) bfin_write16(CAN0_AM24H, val)
2041#define bfin_read_CAN0_AM25L() bfin_read16(CAN0_AM25L)
2042#define bfin_write_CAN0_AM25L(val) bfin_write16(CAN0_AM25L, val)
2043#define bfin_read_CAN0_AM25H() bfin_read16(CAN0_AM25H)
2044#define bfin_write_CAN0_AM25H(val) bfin_write16(CAN0_AM25H, val)
2045#define bfin_read_CAN0_AM26L() bfin_read16(CAN0_AM26L)
2046#define bfin_write_CAN0_AM26L(val) bfin_write16(CAN0_AM26L, val)
2047#define bfin_read_CAN0_AM26H() bfin_read16(CAN0_AM26H)
2048#define bfin_write_CAN0_AM26H(val) bfin_write16(CAN0_AM26H, val)
2049#define bfin_read_CAN0_AM27L() bfin_read16(CAN0_AM27L)
2050#define bfin_write_CAN0_AM27L(val) bfin_write16(CAN0_AM27L, val)
2051#define bfin_read_CAN0_AM27H() bfin_read16(CAN0_AM27H)
2052#define bfin_write_CAN0_AM27H(val) bfin_write16(CAN0_AM27H, val)
2053#define bfin_read_CAN0_AM28L() bfin_read16(CAN0_AM28L)
2054#define bfin_write_CAN0_AM28L(val) bfin_write16(CAN0_AM28L, val)
2055#define bfin_read_CAN0_AM28H() bfin_read16(CAN0_AM28H)
2056#define bfin_write_CAN0_AM28H(val) bfin_write16(CAN0_AM28H, val)
2057#define bfin_read_CAN0_AM29L() bfin_read16(CAN0_AM29L)
2058#define bfin_write_CAN0_AM29L(val) bfin_write16(CAN0_AM29L, val)
2059#define bfin_read_CAN0_AM29H() bfin_read16(CAN0_AM29H)
2060#define bfin_write_CAN0_AM29H(val) bfin_write16(CAN0_AM29H, val)
2061#define bfin_read_CAN0_AM30L() bfin_read16(CAN0_AM30L)
2062#define bfin_write_CAN0_AM30L(val) bfin_write16(CAN0_AM30L, val)
2063#define bfin_read_CAN0_AM30H() bfin_read16(CAN0_AM30H)
2064#define bfin_write_CAN0_AM30H(val) bfin_write16(CAN0_AM30H, val)
2065#define bfin_read_CAN0_AM31L() bfin_read16(CAN0_AM31L)
2066#define bfin_write_CAN0_AM31L(val) bfin_write16(CAN0_AM31L, val)
2067#define bfin_read_CAN0_AM31H() bfin_read16(CAN0_AM31H)
2068#define bfin_write_CAN0_AM31H(val) bfin_write16(CAN0_AM31H, val)
2069
2070/* CAN Controller 0 Mailbox Data Registers */
2071
2072#define bfin_read_CAN0_MB00_DATA0() bfin_read16(CAN0_MB00_DATA0)
2073#define bfin_write_CAN0_MB00_DATA0(val) bfin_write16(CAN0_MB00_DATA0, val)
2074#define bfin_read_CAN0_MB00_DATA1() bfin_read16(CAN0_MB00_DATA1)
2075#define bfin_write_CAN0_MB00_DATA1(val) bfin_write16(CAN0_MB00_DATA1, val)
2076#define bfin_read_CAN0_MB00_DATA2() bfin_read16(CAN0_MB00_DATA2)
2077#define bfin_write_CAN0_MB00_DATA2(val) bfin_write16(CAN0_MB00_DATA2, val)
2078#define bfin_read_CAN0_MB00_DATA3() bfin_read16(CAN0_MB00_DATA3)
2079#define bfin_write_CAN0_MB00_DATA3(val) bfin_write16(CAN0_MB00_DATA3, val)
2080#define bfin_read_CAN0_MB00_LENGTH() bfin_read16(CAN0_MB00_LENGTH)
2081#define bfin_write_CAN0_MB00_LENGTH(val) bfin_write16(CAN0_MB00_LENGTH, val)
2082#define bfin_read_CAN0_MB00_TIMESTAMP() bfin_read16(CAN0_MB00_TIMESTAMP)
2083#define bfin_write_CAN0_MB00_TIMESTAMP(val) bfin_write16(CAN0_MB00_TIMESTAMP, val)
2084#define bfin_read_CAN0_MB00_ID0() bfin_read16(CAN0_MB00_ID0)
2085#define bfin_write_CAN0_MB00_ID0(val) bfin_write16(CAN0_MB00_ID0, val)
2086#define bfin_read_CAN0_MB00_ID1() bfin_read16(CAN0_MB00_ID1)
2087#define bfin_write_CAN0_MB00_ID1(val) bfin_write16(CAN0_MB00_ID1, val)
2088#define bfin_read_CAN0_MB01_DATA0() bfin_read16(CAN0_MB01_DATA0)
2089#define bfin_write_CAN0_MB01_DATA0(val) bfin_write16(CAN0_MB01_DATA0, val)
2090#define bfin_read_CAN0_MB01_DATA1() bfin_read16(CAN0_MB01_DATA1)
2091#define bfin_write_CAN0_MB01_DATA1(val) bfin_write16(CAN0_MB01_DATA1, val)
2092#define bfin_read_CAN0_MB01_DATA2() bfin_read16(CAN0_MB01_DATA2)
2093#define bfin_write_CAN0_MB01_DATA2(val) bfin_write16(CAN0_MB01_DATA2, val)
2094#define bfin_read_CAN0_MB01_DATA3() bfin_read16(CAN0_MB01_DATA3)
2095#define bfin_write_CAN0_MB01_DATA3(val) bfin_write16(CAN0_MB01_DATA3, val)
2096#define bfin_read_CAN0_MB01_LENGTH() bfin_read16(CAN0_MB01_LENGTH)
2097#define bfin_write_CAN0_MB01_LENGTH(val) bfin_write16(CAN0_MB01_LENGTH, val)
2098#define bfin_read_CAN0_MB01_TIMESTAMP() bfin_read16(CAN0_MB01_TIMESTAMP)
2099#define bfin_write_CAN0_MB01_TIMESTAMP(val) bfin_write16(CAN0_MB01_TIMESTAMP, val)
2100#define bfin_read_CAN0_MB01_ID0() bfin_read16(CAN0_MB01_ID0)
2101#define bfin_write_CAN0_MB01_ID0(val) bfin_write16(CAN0_MB01_ID0, val)
2102#define bfin_read_CAN0_MB01_ID1() bfin_read16(CAN0_MB01_ID1)
2103#define bfin_write_CAN0_MB01_ID1(val) bfin_write16(CAN0_MB01_ID1, val)
2104#define bfin_read_CAN0_MB02_DATA0() bfin_read16(CAN0_MB02_DATA0)
2105#define bfin_write_CAN0_MB02_DATA0(val) bfin_write16(CAN0_MB02_DATA0, val)
2106#define bfin_read_CAN0_MB02_DATA1() bfin_read16(CAN0_MB02_DATA1)
2107#define bfin_write_CAN0_MB02_DATA1(val) bfin_write16(CAN0_MB02_DATA1, val)
2108#define bfin_read_CAN0_MB02_DATA2() bfin_read16(CAN0_MB02_DATA2)
2109#define bfin_write_CAN0_MB02_DATA2(val) bfin_write16(CAN0_MB02_DATA2, val)
2110#define bfin_read_CAN0_MB02_DATA3() bfin_read16(CAN0_MB02_DATA3)
2111#define bfin_write_CAN0_MB02_DATA3(val) bfin_write16(CAN0_MB02_DATA3, val)
2112#define bfin_read_CAN0_MB02_LENGTH() bfin_read16(CAN0_MB02_LENGTH)
2113#define bfin_write_CAN0_MB02_LENGTH(val) bfin_write16(CAN0_MB02_LENGTH, val)
2114#define bfin_read_CAN0_MB02_TIMESTAMP() bfin_read16(CAN0_MB02_TIMESTAMP)
2115#define bfin_write_CAN0_MB02_TIMESTAMP(val) bfin_write16(CAN0_MB02_TIMESTAMP, val)
2116#define bfin_read_CAN0_MB02_ID0() bfin_read16(CAN0_MB02_ID0)
2117#define bfin_write_CAN0_MB02_ID0(val) bfin_write16(CAN0_MB02_ID0, val)
2118#define bfin_read_CAN0_MB02_ID1() bfin_read16(CAN0_MB02_ID1)
2119#define bfin_write_CAN0_MB02_ID1(val) bfin_write16(CAN0_MB02_ID1, val)
2120#define bfin_read_CAN0_MB03_DATA0() bfin_read16(CAN0_MB03_DATA0)
2121#define bfin_write_CAN0_MB03_DATA0(val) bfin_write16(CAN0_MB03_DATA0, val)
2122#define bfin_read_CAN0_MB03_DATA1() bfin_read16(CAN0_MB03_DATA1)
2123#define bfin_write_CAN0_MB03_DATA1(val) bfin_write16(CAN0_MB03_DATA1, val)
2124#define bfin_read_CAN0_MB03_DATA2() bfin_read16(CAN0_MB03_DATA2)
2125#define bfin_write_CAN0_MB03_DATA2(val) bfin_write16(CAN0_MB03_DATA2, val)
2126#define bfin_read_CAN0_MB03_DATA3() bfin_read16(CAN0_MB03_DATA3)
2127#define bfin_write_CAN0_MB03_DATA3(val) bfin_write16(CAN0_MB03_DATA3, val)
2128#define bfin_read_CAN0_MB03_LENGTH() bfin_read16(CAN0_MB03_LENGTH)
2129#define bfin_write_CAN0_MB03_LENGTH(val) bfin_write16(CAN0_MB03_LENGTH, val)
2130#define bfin_read_CAN0_MB03_TIMESTAMP() bfin_read16(CAN0_MB03_TIMESTAMP)
2131#define bfin_write_CAN0_MB03_TIMESTAMP(val) bfin_write16(CAN0_MB03_TIMESTAMP, val)
2132#define bfin_read_CAN0_MB03_ID0() bfin_read16(CAN0_MB03_ID0)
2133#define bfin_write_CAN0_MB03_ID0(val) bfin_write16(CAN0_MB03_ID0, val)
2134#define bfin_read_CAN0_MB03_ID1() bfin_read16(CAN0_MB03_ID1)
2135#define bfin_write_CAN0_MB03_ID1(val) bfin_write16(CAN0_MB03_ID1, val)
2136#define bfin_read_CAN0_MB04_DATA0() bfin_read16(CAN0_MB04_DATA0)
2137#define bfin_write_CAN0_MB04_DATA0(val) bfin_write16(CAN0_MB04_DATA0, val)
2138#define bfin_read_CAN0_MB04_DATA1() bfin_read16(CAN0_MB04_DATA1)
2139#define bfin_write_CAN0_MB04_DATA1(val) bfin_write16(CAN0_MB04_DATA1, val)
2140#define bfin_read_CAN0_MB04_DATA2() bfin_read16(CAN0_MB04_DATA2)
2141#define bfin_write_CAN0_MB04_DATA2(val) bfin_write16(CAN0_MB04_DATA2, val)
2142#define bfin_read_CAN0_MB04_DATA3() bfin_read16(CAN0_MB04_DATA3)
2143#define bfin_write_CAN0_MB04_DATA3(val) bfin_write16(CAN0_MB04_DATA3, val)
2144#define bfin_read_CAN0_MB04_LENGTH() bfin_read16(CAN0_MB04_LENGTH)
2145#define bfin_write_CAN0_MB04_LENGTH(val) bfin_write16(CAN0_MB04_LENGTH, val)
2146#define bfin_read_CAN0_MB04_TIMESTAMP() bfin_read16(CAN0_MB04_TIMESTAMP)
2147#define bfin_write_CAN0_MB04_TIMESTAMP(val) bfin_write16(CAN0_MB04_TIMESTAMP, val)
2148#define bfin_read_CAN0_MB04_ID0() bfin_read16(CAN0_MB04_ID0)
2149#define bfin_write_CAN0_MB04_ID0(val) bfin_write16(CAN0_MB04_ID0, val)
2150#define bfin_read_CAN0_MB04_ID1() bfin_read16(CAN0_MB04_ID1)
2151#define bfin_write_CAN0_MB04_ID1(val) bfin_write16(CAN0_MB04_ID1, val)
2152#define bfin_read_CAN0_MB05_DATA0() bfin_read16(CAN0_MB05_DATA0)
2153#define bfin_write_CAN0_MB05_DATA0(val) bfin_write16(CAN0_MB05_DATA0, val)
2154#define bfin_read_CAN0_MB05_DATA1() bfin_read16(CAN0_MB05_DATA1)
2155#define bfin_write_CAN0_MB05_DATA1(val) bfin_write16(CAN0_MB05_DATA1, val)
2156#define bfin_read_CAN0_MB05_DATA2() bfin_read16(CAN0_MB05_DATA2)
2157#define bfin_write_CAN0_MB05_DATA2(val) bfin_write16(CAN0_MB05_DATA2, val)
2158#define bfin_read_CAN0_MB05_DATA3() bfin_read16(CAN0_MB05_DATA3)
2159#define bfin_write_CAN0_MB05_DATA3(val) bfin_write16(CAN0_MB05_DATA3, val)
2160#define bfin_read_CAN0_MB05_LENGTH() bfin_read16(CAN0_MB05_LENGTH)
2161#define bfin_write_CAN0_MB05_LENGTH(val) bfin_write16(CAN0_MB05_LENGTH, val)
2162#define bfin_read_CAN0_MB05_TIMESTAMP() bfin_read16(CAN0_MB05_TIMESTAMP)
2163#define bfin_write_CAN0_MB05_TIMESTAMP(val) bfin_write16(CAN0_MB05_TIMESTAMP, val)
2164#define bfin_read_CAN0_MB05_ID0() bfin_read16(CAN0_MB05_ID0)
2165#define bfin_write_CAN0_MB05_ID0(val) bfin_write16(CAN0_MB05_ID0, val)
2166#define bfin_read_CAN0_MB05_ID1() bfin_read16(CAN0_MB05_ID1)
2167#define bfin_write_CAN0_MB05_ID1(val) bfin_write16(CAN0_MB05_ID1, val)
2168#define bfin_read_CAN0_MB06_DATA0() bfin_read16(CAN0_MB06_DATA0)
2169#define bfin_write_CAN0_MB06_DATA0(val) bfin_write16(CAN0_MB06_DATA0, val)
2170#define bfin_read_CAN0_MB06_DATA1() bfin_read16(CAN0_MB06_DATA1)
2171#define bfin_write_CAN0_MB06_DATA1(val) bfin_write16(CAN0_MB06_DATA1, val)
2172#define bfin_read_CAN0_MB06_DATA2() bfin_read16(CAN0_MB06_DATA2)
2173#define bfin_write_CAN0_MB06_DATA2(val) bfin_write16(CAN0_MB06_DATA2, val)
2174#define bfin_read_CAN0_MB06_DATA3() bfin_read16(CAN0_MB06_DATA3)
2175#define bfin_write_CAN0_MB06_DATA3(val) bfin_write16(CAN0_MB06_DATA3, val)
2176#define bfin_read_CAN0_MB06_LENGTH() bfin_read16(CAN0_MB06_LENGTH)
2177#define bfin_write_CAN0_MB06_LENGTH(val) bfin_write16(CAN0_MB06_LENGTH, val)
2178#define bfin_read_CAN0_MB06_TIMESTAMP() bfin_read16(CAN0_MB06_TIMESTAMP)
2179#define bfin_write_CAN0_MB06_TIMESTAMP(val) bfin_write16(CAN0_MB06_TIMESTAMP, val)
2180#define bfin_read_CAN0_MB06_ID0() bfin_read16(CAN0_MB06_ID0)
2181#define bfin_write_CAN0_MB06_ID0(val) bfin_write16(CAN0_MB06_ID0, val)
2182#define bfin_read_CAN0_MB06_ID1() bfin_read16(CAN0_MB06_ID1)
2183#define bfin_write_CAN0_MB06_ID1(val) bfin_write16(CAN0_MB06_ID1, val)
2184#define bfin_read_CAN0_MB07_DATA0() bfin_read16(CAN0_MB07_DATA0)
2185#define bfin_write_CAN0_MB07_DATA0(val) bfin_write16(CAN0_MB07_DATA0, val)
2186#define bfin_read_CAN0_MB07_DATA1() bfin_read16(CAN0_MB07_DATA1)
2187#define bfin_write_CAN0_MB07_DATA1(val) bfin_write16(CAN0_MB07_DATA1, val)
2188#define bfin_read_CAN0_MB07_DATA2() bfin_read16(CAN0_MB07_DATA2)
2189#define bfin_write_CAN0_MB07_DATA2(val) bfin_write16(CAN0_MB07_DATA2, val)
2190#define bfin_read_CAN0_MB07_DATA3() bfin_read16(CAN0_MB07_DATA3)
2191#define bfin_write_CAN0_MB07_DATA3(val) bfin_write16(CAN0_MB07_DATA3, val)
2192#define bfin_read_CAN0_MB07_LENGTH() bfin_read16(CAN0_MB07_LENGTH)
2193#define bfin_write_CAN0_MB07_LENGTH(val) bfin_write16(CAN0_MB07_LENGTH, val)
2194#define bfin_read_CAN0_MB07_TIMESTAMP() bfin_read16(CAN0_MB07_TIMESTAMP)
2195#define bfin_write_CAN0_MB07_TIMESTAMP(val) bfin_write16(CAN0_MB07_TIMESTAMP, val)
2196#define bfin_read_CAN0_MB07_ID0() bfin_read16(CAN0_MB07_ID0)
2197#define bfin_write_CAN0_MB07_ID0(val) bfin_write16(CAN0_MB07_ID0, val)
2198#define bfin_read_CAN0_MB07_ID1() bfin_read16(CAN0_MB07_ID1)
2199#define bfin_write_CAN0_MB07_ID1(val) bfin_write16(CAN0_MB07_ID1, val)
2200#define bfin_read_CAN0_MB08_DATA0() bfin_read16(CAN0_MB08_DATA0)
2201#define bfin_write_CAN0_MB08_DATA0(val) bfin_write16(CAN0_MB08_DATA0, val)
2202#define bfin_read_CAN0_MB08_DATA1() bfin_read16(CAN0_MB08_DATA1)
2203#define bfin_write_CAN0_MB08_DATA1(val) bfin_write16(CAN0_MB08_DATA1, val)
2204#define bfin_read_CAN0_MB08_DATA2() bfin_read16(CAN0_MB08_DATA2)
2205#define bfin_write_CAN0_MB08_DATA2(val) bfin_write16(CAN0_MB08_DATA2, val)
2206#define bfin_read_CAN0_MB08_DATA3() bfin_read16(CAN0_MB08_DATA3)
2207#define bfin_write_CAN0_MB08_DATA3(val) bfin_write16(CAN0_MB08_DATA3, val)
2208#define bfin_read_CAN0_MB08_LENGTH() bfin_read16(CAN0_MB08_LENGTH)
2209#define bfin_write_CAN0_MB08_LENGTH(val) bfin_write16(CAN0_MB08_LENGTH, val)
2210#define bfin_read_CAN0_MB08_TIMESTAMP() bfin_read16(CAN0_MB08_TIMESTAMP)
2211#define bfin_write_CAN0_MB08_TIMESTAMP(val) bfin_write16(CAN0_MB08_TIMESTAMP, val)
2212#define bfin_read_CAN0_MB08_ID0() bfin_read16(CAN0_MB08_ID0)
2213#define bfin_write_CAN0_MB08_ID0(val) bfin_write16(CAN0_MB08_ID0, val)
2214#define bfin_read_CAN0_MB08_ID1() bfin_read16(CAN0_MB08_ID1)
2215#define bfin_write_CAN0_MB08_ID1(val) bfin_write16(CAN0_MB08_ID1, val)
2216#define bfin_read_CAN0_MB09_DATA0() bfin_read16(CAN0_MB09_DATA0)
2217#define bfin_write_CAN0_MB09_DATA0(val) bfin_write16(CAN0_MB09_DATA0, val)
2218#define bfin_read_CAN0_MB09_DATA1() bfin_read16(CAN0_MB09_DATA1)
2219#define bfin_write_CAN0_MB09_DATA1(val) bfin_write16(CAN0_MB09_DATA1, val)
2220#define bfin_read_CAN0_MB09_DATA2() bfin_read16(CAN0_MB09_DATA2)
2221#define bfin_write_CAN0_MB09_DATA2(val) bfin_write16(CAN0_MB09_DATA2, val)
2222#define bfin_read_CAN0_MB09_DATA3() bfin_read16(CAN0_MB09_DATA3)
2223#define bfin_write_CAN0_MB09_DATA3(val) bfin_write16(CAN0_MB09_DATA3, val)
2224#define bfin_read_CAN0_MB09_LENGTH() bfin_read16(CAN0_MB09_LENGTH)
2225#define bfin_write_CAN0_MB09_LENGTH(val) bfin_write16(CAN0_MB09_LENGTH, val)
2226#define bfin_read_CAN0_MB09_TIMESTAMP() bfin_read16(CAN0_MB09_TIMESTAMP)
2227#define bfin_write_CAN0_MB09_TIMESTAMP(val) bfin_write16(CAN0_MB09_TIMESTAMP, val)
2228#define bfin_read_CAN0_MB09_ID0() bfin_read16(CAN0_MB09_ID0)
2229#define bfin_write_CAN0_MB09_ID0(val) bfin_write16(CAN0_MB09_ID0, val)
2230#define bfin_read_CAN0_MB09_ID1() bfin_read16(CAN0_MB09_ID1)
2231#define bfin_write_CAN0_MB09_ID1(val) bfin_write16(CAN0_MB09_ID1, val)
2232#define bfin_read_CAN0_MB10_DATA0() bfin_read16(CAN0_MB10_DATA0)
2233#define bfin_write_CAN0_MB10_DATA0(val) bfin_write16(CAN0_MB10_DATA0, val)
2234#define bfin_read_CAN0_MB10_DATA1() bfin_read16(CAN0_MB10_DATA1)
2235#define bfin_write_CAN0_MB10_DATA1(val) bfin_write16(CAN0_MB10_DATA1, val)
2236#define bfin_read_CAN0_MB10_DATA2() bfin_read16(CAN0_MB10_DATA2)
2237#define bfin_write_CAN0_MB10_DATA2(val) bfin_write16(CAN0_MB10_DATA2, val)
2238#define bfin_read_CAN0_MB10_DATA3() bfin_read16(CAN0_MB10_DATA3)
2239#define bfin_write_CAN0_MB10_DATA3(val) bfin_write16(CAN0_MB10_DATA3, val)
2240#define bfin_read_CAN0_MB10_LENGTH() bfin_read16(CAN0_MB10_LENGTH)
2241#define bfin_write_CAN0_MB10_LENGTH(val) bfin_write16(CAN0_MB10_LENGTH, val)
2242#define bfin_read_CAN0_MB10_TIMESTAMP() bfin_read16(CAN0_MB10_TIMESTAMP)
2243#define bfin_write_CAN0_MB10_TIMESTAMP(val) bfin_write16(CAN0_MB10_TIMESTAMP, val)
2244#define bfin_read_CAN0_MB10_ID0() bfin_read16(CAN0_MB10_ID0)
2245#define bfin_write_CAN0_MB10_ID0(val) bfin_write16(CAN0_MB10_ID0, val)
2246#define bfin_read_CAN0_MB10_ID1() bfin_read16(CAN0_MB10_ID1)
2247#define bfin_write_CAN0_MB10_ID1(val) bfin_write16(CAN0_MB10_ID1, val)
2248#define bfin_read_CAN0_MB11_DATA0() bfin_read16(CAN0_MB11_DATA0)
2249#define bfin_write_CAN0_MB11_DATA0(val) bfin_write16(CAN0_MB11_DATA0, val)
2250#define bfin_read_CAN0_MB11_DATA1() bfin_read16(CAN0_MB11_DATA1)
2251#define bfin_write_CAN0_MB11_DATA1(val) bfin_write16(CAN0_MB11_DATA1, val)
2252#define bfin_read_CAN0_MB11_DATA2() bfin_read16(CAN0_MB11_DATA2)
2253#define bfin_write_CAN0_MB11_DATA2(val) bfin_write16(CAN0_MB11_DATA2, val)
2254#define bfin_read_CAN0_MB11_DATA3() bfin_read16(CAN0_MB11_DATA3)
2255#define bfin_write_CAN0_MB11_DATA3(val) bfin_write16(CAN0_MB11_DATA3, val)
2256#define bfin_read_CAN0_MB11_LENGTH() bfin_read16(CAN0_MB11_LENGTH)
2257#define bfin_write_CAN0_MB11_LENGTH(val) bfin_write16(CAN0_MB11_LENGTH, val)
2258#define bfin_read_CAN0_MB11_TIMESTAMP() bfin_read16(CAN0_MB11_TIMESTAMP)
2259#define bfin_write_CAN0_MB11_TIMESTAMP(val) bfin_write16(CAN0_MB11_TIMESTAMP, val)
2260#define bfin_read_CAN0_MB11_ID0() bfin_read16(CAN0_MB11_ID0)
2261#define bfin_write_CAN0_MB11_ID0(val) bfin_write16(CAN0_MB11_ID0, val)
2262#define bfin_read_CAN0_MB11_ID1() bfin_read16(CAN0_MB11_ID1)
2263#define bfin_write_CAN0_MB11_ID1(val) bfin_write16(CAN0_MB11_ID1, val)
2264#define bfin_read_CAN0_MB12_DATA0() bfin_read16(CAN0_MB12_DATA0)
2265#define bfin_write_CAN0_MB12_DATA0(val) bfin_write16(CAN0_MB12_DATA0, val)
2266#define bfin_read_CAN0_MB12_DATA1() bfin_read16(CAN0_MB12_DATA1)
2267#define bfin_write_CAN0_MB12_DATA1(val) bfin_write16(CAN0_MB12_DATA1, val)
2268#define bfin_read_CAN0_MB12_DATA2() bfin_read16(CAN0_MB12_DATA2)
2269#define bfin_write_CAN0_MB12_DATA2(val) bfin_write16(CAN0_MB12_DATA2, val)
2270#define bfin_read_CAN0_MB12_DATA3() bfin_read16(CAN0_MB12_DATA3)
2271#define bfin_write_CAN0_MB12_DATA3(val) bfin_write16(CAN0_MB12_DATA3, val)
2272#define bfin_read_CAN0_MB12_LENGTH() bfin_read16(CAN0_MB12_LENGTH)
2273#define bfin_write_CAN0_MB12_LENGTH(val) bfin_write16(CAN0_MB12_LENGTH, val)
2274#define bfin_read_CAN0_MB12_TIMESTAMP() bfin_read16(CAN0_MB12_TIMESTAMP)
2275#define bfin_write_CAN0_MB12_TIMESTAMP(val) bfin_write16(CAN0_MB12_TIMESTAMP, val)
2276#define bfin_read_CAN0_MB12_ID0() bfin_read16(CAN0_MB12_ID0)
2277#define bfin_write_CAN0_MB12_ID0(val) bfin_write16(CAN0_MB12_ID0, val)
2278#define bfin_read_CAN0_MB12_ID1() bfin_read16(CAN0_MB12_ID1)
2279#define bfin_write_CAN0_MB12_ID1(val) bfin_write16(CAN0_MB12_ID1, val)
2280#define bfin_read_CAN0_MB13_DATA0() bfin_read16(CAN0_MB13_DATA0)
2281#define bfin_write_CAN0_MB13_DATA0(val) bfin_write16(CAN0_MB13_DATA0, val)
2282#define bfin_read_CAN0_MB13_DATA1() bfin_read16(CAN0_MB13_DATA1)
2283#define bfin_write_CAN0_MB13_DATA1(val) bfin_write16(CAN0_MB13_DATA1, val)
2284#define bfin_read_CAN0_MB13_DATA2() bfin_read16(CAN0_MB13_DATA2)
2285#define bfin_write_CAN0_MB13_DATA2(val) bfin_write16(CAN0_MB13_DATA2, val)
2286#define bfin_read_CAN0_MB13_DATA3() bfin_read16(CAN0_MB13_DATA3)
2287#define bfin_write_CAN0_MB13_DATA3(val) bfin_write16(CAN0_MB13_DATA3, val)
2288#define bfin_read_CAN0_MB13_LENGTH() bfin_read16(CAN0_MB13_LENGTH)
2289#define bfin_write_CAN0_MB13_LENGTH(val) bfin_write16(CAN0_MB13_LENGTH, val)
2290#define bfin_read_CAN0_MB13_TIMESTAMP() bfin_read16(CAN0_MB13_TIMESTAMP)
2291#define bfin_write_CAN0_MB13_TIMESTAMP(val) bfin_write16(CAN0_MB13_TIMESTAMP, val)
2292#define bfin_read_CAN0_MB13_ID0() bfin_read16(CAN0_MB13_ID0)
2293#define bfin_write_CAN0_MB13_ID0(val) bfin_write16(CAN0_MB13_ID0, val)
2294#define bfin_read_CAN0_MB13_ID1() bfin_read16(CAN0_MB13_ID1)
2295#define bfin_write_CAN0_MB13_ID1(val) bfin_write16(CAN0_MB13_ID1, val)
2296#define bfin_read_CAN0_MB14_DATA0() bfin_read16(CAN0_MB14_DATA0)
2297#define bfin_write_CAN0_MB14_DATA0(val) bfin_write16(CAN0_MB14_DATA0, val)
2298#define bfin_read_CAN0_MB14_DATA1() bfin_read16(CAN0_MB14_DATA1)
2299#define bfin_write_CAN0_MB14_DATA1(val) bfin_write16(CAN0_MB14_DATA1, val)
2300#define bfin_read_CAN0_MB14_DATA2() bfin_read16(CAN0_MB14_DATA2)
2301#define bfin_write_CAN0_MB14_DATA2(val) bfin_write16(CAN0_MB14_DATA2, val)
2302#define bfin_read_CAN0_MB14_DATA3() bfin_read16(CAN0_MB14_DATA3)
2303#define bfin_write_CAN0_MB14_DATA3(val) bfin_write16(CAN0_MB14_DATA3, val)
2304#define bfin_read_CAN0_MB14_LENGTH() bfin_read16(CAN0_MB14_LENGTH)
2305#define bfin_write_CAN0_MB14_LENGTH(val) bfin_write16(CAN0_MB14_LENGTH, val)
2306#define bfin_read_CAN0_MB14_TIMESTAMP() bfin_read16(CAN0_MB14_TIMESTAMP)
2307#define bfin_write_CAN0_MB14_TIMESTAMP(val) bfin_write16(CAN0_MB14_TIMESTAMP, val)
2308#define bfin_read_CAN0_MB14_ID0() bfin_read16(CAN0_MB14_ID0)
2309#define bfin_write_CAN0_MB14_ID0(val) bfin_write16(CAN0_MB14_ID0, val)
2310#define bfin_read_CAN0_MB14_ID1() bfin_read16(CAN0_MB14_ID1)
2311#define bfin_write_CAN0_MB14_ID1(val) bfin_write16(CAN0_MB14_ID1, val)
2312#define bfin_read_CAN0_MB15_DATA0() bfin_read16(CAN0_MB15_DATA0)
2313#define bfin_write_CAN0_MB15_DATA0(val) bfin_write16(CAN0_MB15_DATA0, val)
2314#define bfin_read_CAN0_MB15_DATA1() bfin_read16(CAN0_MB15_DATA1)
2315#define bfin_write_CAN0_MB15_DATA1(val) bfin_write16(CAN0_MB15_DATA1, val)
2316#define bfin_read_CAN0_MB15_DATA2() bfin_read16(CAN0_MB15_DATA2)
2317#define bfin_write_CAN0_MB15_DATA2(val) bfin_write16(CAN0_MB15_DATA2, val)
2318#define bfin_read_CAN0_MB15_DATA3() bfin_read16(CAN0_MB15_DATA3)
2319#define bfin_write_CAN0_MB15_DATA3(val) bfin_write16(CAN0_MB15_DATA3, val)
2320#define bfin_read_CAN0_MB15_LENGTH() bfin_read16(CAN0_MB15_LENGTH)
2321#define bfin_write_CAN0_MB15_LENGTH(val) bfin_write16(CAN0_MB15_LENGTH, val)
2322#define bfin_read_CAN0_MB15_TIMESTAMP() bfin_read16(CAN0_MB15_TIMESTAMP)
2323#define bfin_write_CAN0_MB15_TIMESTAMP(val) bfin_write16(CAN0_MB15_TIMESTAMP, val)
2324#define bfin_read_CAN0_MB15_ID0() bfin_read16(CAN0_MB15_ID0)
2325#define bfin_write_CAN0_MB15_ID0(val) bfin_write16(CAN0_MB15_ID0, val)
2326#define bfin_read_CAN0_MB15_ID1() bfin_read16(CAN0_MB15_ID1)
2327#define bfin_write_CAN0_MB15_ID1(val) bfin_write16(CAN0_MB15_ID1, val)
2328
2329/* CAN Controller 0 Mailbox Data Registers */
2330
2331#define bfin_read_CAN0_MB16_DATA0() bfin_read16(CAN0_MB16_DATA0)
2332#define bfin_write_CAN0_MB16_DATA0(val) bfin_write16(CAN0_MB16_DATA0, val)
2333#define bfin_read_CAN0_MB16_DATA1() bfin_read16(CAN0_MB16_DATA1)
2334#define bfin_write_CAN0_MB16_DATA1(val) bfin_write16(CAN0_MB16_DATA1, val)
2335#define bfin_read_CAN0_MB16_DATA2() bfin_read16(CAN0_MB16_DATA2)
2336#define bfin_write_CAN0_MB16_DATA2(val) bfin_write16(CAN0_MB16_DATA2, val)
2337#define bfin_read_CAN0_MB16_DATA3() bfin_read16(CAN0_MB16_DATA3)
2338#define bfin_write_CAN0_MB16_DATA3(val) bfin_write16(CAN0_MB16_DATA3, val)
2339#define bfin_read_CAN0_MB16_LENGTH() bfin_read16(CAN0_MB16_LENGTH)
2340#define bfin_write_CAN0_MB16_LENGTH(val) bfin_write16(CAN0_MB16_LENGTH, val)
2341#define bfin_read_CAN0_MB16_TIMESTAMP() bfin_read16(CAN0_MB16_TIMESTAMP)
2342#define bfin_write_CAN0_MB16_TIMESTAMP(val) bfin_write16(CAN0_MB16_TIMESTAMP, val)
2343#define bfin_read_CAN0_MB16_ID0() bfin_read16(CAN0_MB16_ID0)
2344#define bfin_write_CAN0_MB16_ID0(val) bfin_write16(CAN0_MB16_ID0, val)
2345#define bfin_read_CAN0_MB16_ID1() bfin_read16(CAN0_MB16_ID1)
2346#define bfin_write_CAN0_MB16_ID1(val) bfin_write16(CAN0_MB16_ID1, val)
2347#define bfin_read_CAN0_MB17_DATA0() bfin_read16(CAN0_MB17_DATA0)
2348#define bfin_write_CAN0_MB17_DATA0(val) bfin_write16(CAN0_MB17_DATA0, val)
2349#define bfin_read_CAN0_MB17_DATA1() bfin_read16(CAN0_MB17_DATA1)
2350#define bfin_write_CAN0_MB17_DATA1(val) bfin_write16(CAN0_MB17_DATA1, val)
2351#define bfin_read_CAN0_MB17_DATA2() bfin_read16(CAN0_MB17_DATA2)
2352#define bfin_write_CAN0_MB17_DATA2(val) bfin_write16(CAN0_MB17_DATA2, val)
2353#define bfin_read_CAN0_MB17_DATA3() bfin_read16(CAN0_MB17_DATA3)
2354#define bfin_write_CAN0_MB17_DATA3(val) bfin_write16(CAN0_MB17_DATA3, val)
2355#define bfin_read_CAN0_MB17_LENGTH() bfin_read16(CAN0_MB17_LENGTH)
2356#define bfin_write_CAN0_MB17_LENGTH(val) bfin_write16(CAN0_MB17_LENGTH, val)
2357#define bfin_read_CAN0_MB17_TIMESTAMP() bfin_read16(CAN0_MB17_TIMESTAMP)
2358#define bfin_write_CAN0_MB17_TIMESTAMP(val) bfin_write16(CAN0_MB17_TIMESTAMP, val)
2359#define bfin_read_CAN0_MB17_ID0() bfin_read16(CAN0_MB17_ID0)
2360#define bfin_write_CAN0_MB17_ID0(val) bfin_write16(CAN0_MB17_ID0, val)
2361#define bfin_read_CAN0_MB17_ID1() bfin_read16(CAN0_MB17_ID1)
2362#define bfin_write_CAN0_MB17_ID1(val) bfin_write16(CAN0_MB17_ID1, val)
2363#define bfin_read_CAN0_MB18_DATA0() bfin_read16(CAN0_MB18_DATA0)
2364#define bfin_write_CAN0_MB18_DATA0(val) bfin_write16(CAN0_MB18_DATA0, val)
2365#define bfin_read_CAN0_MB18_DATA1() bfin_read16(CAN0_MB18_DATA1)
2366#define bfin_write_CAN0_MB18_DATA1(val) bfin_write16(CAN0_MB18_DATA1, val)
2367#define bfin_read_CAN0_MB18_DATA2() bfin_read16(CAN0_MB18_DATA2)
2368#define bfin_write_CAN0_MB18_DATA2(val) bfin_write16(CAN0_MB18_DATA2, val)
2369#define bfin_read_CAN0_MB18_DATA3() bfin_read16(CAN0_MB18_DATA3)
2370#define bfin_write_CAN0_MB18_DATA3(val) bfin_write16(CAN0_MB18_DATA3, val)
2371#define bfin_read_CAN0_MB18_LENGTH() bfin_read16(CAN0_MB18_LENGTH)
2372#define bfin_write_CAN0_MB18_LENGTH(val) bfin_write16(CAN0_MB18_LENGTH, val)
2373#define bfin_read_CAN0_MB18_TIMESTAMP() bfin_read16(CAN0_MB18_TIMESTAMP)
2374#define bfin_write_CAN0_MB18_TIMESTAMP(val) bfin_write16(CAN0_MB18_TIMESTAMP, val)
2375#define bfin_read_CAN0_MB18_ID0() bfin_read16(CAN0_MB18_ID0)
2376#define bfin_write_CAN0_MB18_ID0(val) bfin_write16(CAN0_MB18_ID0, val)
2377#define bfin_read_CAN0_MB18_ID1() bfin_read16(CAN0_MB18_ID1)
2378#define bfin_write_CAN0_MB18_ID1(val) bfin_write16(CAN0_MB18_ID1, val)
2379#define bfin_read_CAN0_MB19_DATA0() bfin_read16(CAN0_MB19_DATA0)
2380#define bfin_write_CAN0_MB19_DATA0(val) bfin_write16(CAN0_MB19_DATA0, val)
2381#define bfin_read_CAN0_MB19_DATA1() bfin_read16(CAN0_MB19_DATA1)
2382#define bfin_write_CAN0_MB19_DATA1(val) bfin_write16(CAN0_MB19_DATA1, val)
2383#define bfin_read_CAN0_MB19_DATA2() bfin_read16(CAN0_MB19_DATA2)
2384#define bfin_write_CAN0_MB19_DATA2(val) bfin_write16(CAN0_MB19_DATA2, val)
2385#define bfin_read_CAN0_MB19_DATA3() bfin_read16(CAN0_MB19_DATA3)
2386#define bfin_write_CAN0_MB19_DATA3(val) bfin_write16(CAN0_MB19_DATA3, val)
2387#define bfin_read_CAN0_MB19_LENGTH() bfin_read16(CAN0_MB19_LENGTH)
2388#define bfin_write_CAN0_MB19_LENGTH(val) bfin_write16(CAN0_MB19_LENGTH, val)
2389#define bfin_read_CAN0_MB19_TIMESTAMP() bfin_read16(CAN0_MB19_TIMESTAMP)
2390#define bfin_write_CAN0_MB19_TIMESTAMP(val) bfin_write16(CAN0_MB19_TIMESTAMP, val)
2391#define bfin_read_CAN0_MB19_ID0() bfin_read16(CAN0_MB19_ID0)
2392#define bfin_write_CAN0_MB19_ID0(val) bfin_write16(CAN0_MB19_ID0, val)
2393#define bfin_read_CAN0_MB19_ID1() bfin_read16(CAN0_MB19_ID1)
2394#define bfin_write_CAN0_MB19_ID1(val) bfin_write16(CAN0_MB19_ID1, val)
2395#define bfin_read_CAN0_MB20_DATA0() bfin_read16(CAN0_MB20_DATA0)
2396#define bfin_write_CAN0_MB20_DATA0(val) bfin_write16(CAN0_MB20_DATA0, val)
2397#define bfin_read_CAN0_MB20_DATA1() bfin_read16(CAN0_MB20_DATA1)
2398#define bfin_write_CAN0_MB20_DATA1(val) bfin_write16(CAN0_MB20_DATA1, val)
2399#define bfin_read_CAN0_MB20_DATA2() bfin_read16(CAN0_MB20_DATA2)
2400#define bfin_write_CAN0_MB20_DATA2(val) bfin_write16(CAN0_MB20_DATA2, val)
2401#define bfin_read_CAN0_MB20_DATA3() bfin_read16(CAN0_MB20_DATA3)
2402#define bfin_write_CAN0_MB20_DATA3(val) bfin_write16(CAN0_MB20_DATA3, val)
2403#define bfin_read_CAN0_MB20_LENGTH() bfin_read16(CAN0_MB20_LENGTH)
2404#define bfin_write_CAN0_MB20_LENGTH(val) bfin_write16(CAN0_MB20_LENGTH, val)
2405#define bfin_read_CAN0_MB20_TIMESTAMP() bfin_read16(CAN0_MB20_TIMESTAMP)
2406#define bfin_write_CAN0_MB20_TIMESTAMP(val) bfin_write16(CAN0_MB20_TIMESTAMP, val)
2407#define bfin_read_CAN0_MB20_ID0() bfin_read16(CAN0_MB20_ID0)
2408#define bfin_write_CAN0_MB20_ID0(val) bfin_write16(CAN0_MB20_ID0, val)
2409#define bfin_read_CAN0_MB20_ID1() bfin_read16(CAN0_MB20_ID1)
2410#define bfin_write_CAN0_MB20_ID1(val) bfin_write16(CAN0_MB20_ID1, val)
2411#define bfin_read_CAN0_MB21_DATA0() bfin_read16(CAN0_MB21_DATA0)
2412#define bfin_write_CAN0_MB21_DATA0(val) bfin_write16(CAN0_MB21_DATA0, val)
2413#define bfin_read_CAN0_MB21_DATA1() bfin_read16(CAN0_MB21_DATA1)
2414#define bfin_write_CAN0_MB21_DATA1(val) bfin_write16(CAN0_MB21_DATA1, val)
2415#define bfin_read_CAN0_MB21_DATA2() bfin_read16(CAN0_MB21_DATA2)
2416#define bfin_write_CAN0_MB21_DATA2(val) bfin_write16(CAN0_MB21_DATA2, val)
2417#define bfin_read_CAN0_MB21_DATA3() bfin_read16(CAN0_MB21_DATA3)
2418#define bfin_write_CAN0_MB21_DATA3(val) bfin_write16(CAN0_MB21_DATA3, val)
2419#define bfin_read_CAN0_MB21_LENGTH() bfin_read16(CAN0_MB21_LENGTH)
2420#define bfin_write_CAN0_MB21_LENGTH(val) bfin_write16(CAN0_MB21_LENGTH, val)
2421#define bfin_read_CAN0_MB21_TIMESTAMP() bfin_read16(CAN0_MB21_TIMESTAMP)
2422#define bfin_write_CAN0_MB21_TIMESTAMP(val) bfin_write16(CAN0_MB21_TIMESTAMP, val)
2423#define bfin_read_CAN0_MB21_ID0() bfin_read16(CAN0_MB21_ID0)
2424#define bfin_write_CAN0_MB21_ID0(val) bfin_write16(CAN0_MB21_ID0, val)
2425#define bfin_read_CAN0_MB21_ID1() bfin_read16(CAN0_MB21_ID1)
2426#define bfin_write_CAN0_MB21_ID1(val) bfin_write16(CAN0_MB21_ID1, val)
2427#define bfin_read_CAN0_MB22_DATA0() bfin_read16(CAN0_MB22_DATA0)
2428#define bfin_write_CAN0_MB22_DATA0(val) bfin_write16(CAN0_MB22_DATA0, val)
2429#define bfin_read_CAN0_MB22_DATA1() bfin_read16(CAN0_MB22_DATA1)
2430#define bfin_write_CAN0_MB22_DATA1(val) bfin_write16(CAN0_MB22_DATA1, val)
2431#define bfin_read_CAN0_MB22_DATA2() bfin_read16(CAN0_MB22_DATA2)
2432#define bfin_write_CAN0_MB22_DATA2(val) bfin_write16(CAN0_MB22_DATA2, val)
2433#define bfin_read_CAN0_MB22_DATA3() bfin_read16(CAN0_MB22_DATA3)
2434#define bfin_write_CAN0_MB22_DATA3(val) bfin_write16(CAN0_MB22_DATA3, val)
2435#define bfin_read_CAN0_MB22_LENGTH() bfin_read16(CAN0_MB22_LENGTH)
2436#define bfin_write_CAN0_MB22_LENGTH(val) bfin_write16(CAN0_MB22_LENGTH, val)
2437#define bfin_read_CAN0_MB22_TIMESTAMP() bfin_read16(CAN0_MB22_TIMESTAMP)
2438#define bfin_write_CAN0_MB22_TIMESTAMP(val) bfin_write16(CAN0_MB22_TIMESTAMP, val)
2439#define bfin_read_CAN0_MB22_ID0() bfin_read16(CAN0_MB22_ID0)
2440#define bfin_write_CAN0_MB22_ID0(val) bfin_write16(CAN0_MB22_ID0, val)
2441#define bfin_read_CAN0_MB22_ID1() bfin_read16(CAN0_MB22_ID1)
2442#define bfin_write_CAN0_MB22_ID1(val) bfin_write16(CAN0_MB22_ID1, val)
2443#define bfin_read_CAN0_MB23_DATA0() bfin_read16(CAN0_MB23_DATA0)
2444#define bfin_write_CAN0_MB23_DATA0(val) bfin_write16(CAN0_MB23_DATA0, val)
2445#define bfin_read_CAN0_MB23_DATA1() bfin_read16(CAN0_MB23_DATA1)
2446#define bfin_write_CAN0_MB23_DATA1(val) bfin_write16(CAN0_MB23_DATA1, val)
2447#define bfin_read_CAN0_MB23_DATA2() bfin_read16(CAN0_MB23_DATA2)
2448#define bfin_write_CAN0_MB23_DATA2(val) bfin_write16(CAN0_MB23_DATA2, val)
2449#define bfin_read_CAN0_MB23_DATA3() bfin_read16(CAN0_MB23_DATA3)
2450#define bfin_write_CAN0_MB23_DATA3(val) bfin_write16(CAN0_MB23_DATA3, val)
2451#define bfin_read_CAN0_MB23_LENGTH() bfin_read16(CAN0_MB23_LENGTH)
2452#define bfin_write_CAN0_MB23_LENGTH(val) bfin_write16(CAN0_MB23_LENGTH, val)
2453#define bfin_read_CAN0_MB23_TIMESTAMP() bfin_read16(CAN0_MB23_TIMESTAMP)
2454#define bfin_write_CAN0_MB23_TIMESTAMP(val) bfin_write16(CAN0_MB23_TIMESTAMP, val)
2455#define bfin_read_CAN0_MB23_ID0() bfin_read16(CAN0_MB23_ID0)
2456#define bfin_write_CAN0_MB23_ID0(val) bfin_write16(CAN0_MB23_ID0, val)
2457#define bfin_read_CAN0_MB23_ID1() bfin_read16(CAN0_MB23_ID1)
2458#define bfin_write_CAN0_MB23_ID1(val) bfin_write16(CAN0_MB23_ID1, val)
2459#define bfin_read_CAN0_MB24_DATA0() bfin_read16(CAN0_MB24_DATA0)
2460#define bfin_write_CAN0_MB24_DATA0(val) bfin_write16(CAN0_MB24_DATA0, val)
2461#define bfin_read_CAN0_MB24_DATA1() bfin_read16(CAN0_MB24_DATA1)
2462#define bfin_write_CAN0_MB24_DATA1(val) bfin_write16(CAN0_MB24_DATA1, val)
2463#define bfin_read_CAN0_MB24_DATA2() bfin_read16(CAN0_MB24_DATA2)
2464#define bfin_write_CAN0_MB24_DATA2(val) bfin_write16(CAN0_MB24_DATA2, val)
2465#define bfin_read_CAN0_MB24_DATA3() bfin_read16(CAN0_MB24_DATA3)
2466#define bfin_write_CAN0_MB24_DATA3(val) bfin_write16(CAN0_MB24_DATA3, val)
2467#define bfin_read_CAN0_MB24_LENGTH() bfin_read16(CAN0_MB24_LENGTH)
2468#define bfin_write_CAN0_MB24_LENGTH(val) bfin_write16(CAN0_MB24_LENGTH, val)
2469#define bfin_read_CAN0_MB24_TIMESTAMP() bfin_read16(CAN0_MB24_TIMESTAMP)
2470#define bfin_write_CAN0_MB24_TIMESTAMP(val) bfin_write16(CAN0_MB24_TIMESTAMP, val)
2471#define bfin_read_CAN0_MB24_ID0() bfin_read16(CAN0_MB24_ID0)
2472#define bfin_write_CAN0_MB24_ID0(val) bfin_write16(CAN0_MB24_ID0, val)
2473#define bfin_read_CAN0_MB24_ID1() bfin_read16(CAN0_MB24_ID1)
2474#define bfin_write_CAN0_MB24_ID1(val) bfin_write16(CAN0_MB24_ID1, val)
2475#define bfin_read_CAN0_MB25_DATA0() bfin_read16(CAN0_MB25_DATA0)
2476#define bfin_write_CAN0_MB25_DATA0(val) bfin_write16(CAN0_MB25_DATA0, val)
2477#define bfin_read_CAN0_MB25_DATA1() bfin_read16(CAN0_MB25_DATA1)
2478#define bfin_write_CAN0_MB25_DATA1(val) bfin_write16(CAN0_MB25_DATA1, val)
2479#define bfin_read_CAN0_MB25_DATA2() bfin_read16(CAN0_MB25_DATA2)
2480#define bfin_write_CAN0_MB25_DATA2(val) bfin_write16(CAN0_MB25_DATA2, val)
2481#define bfin_read_CAN0_MB25_DATA3() bfin_read16(CAN0_MB25_DATA3)
2482#define bfin_write_CAN0_MB25_DATA3(val) bfin_write16(CAN0_MB25_DATA3, val)
2483#define bfin_read_CAN0_MB25_LENGTH() bfin_read16(CAN0_MB25_LENGTH)
2484#define bfin_write_CAN0_MB25_LENGTH(val) bfin_write16(CAN0_MB25_LENGTH, val)
2485#define bfin_read_CAN0_MB25_TIMESTAMP() bfin_read16(CAN0_MB25_TIMESTAMP)
2486#define bfin_write_CAN0_MB25_TIMESTAMP(val) bfin_write16(CAN0_MB25_TIMESTAMP, val)
2487#define bfin_read_CAN0_MB25_ID0() bfin_read16(CAN0_MB25_ID0)
2488#define bfin_write_CAN0_MB25_ID0(val) bfin_write16(CAN0_MB25_ID0, val)
2489#define bfin_read_CAN0_MB25_ID1() bfin_read16(CAN0_MB25_ID1)
2490#define bfin_write_CAN0_MB25_ID1(val) bfin_write16(CAN0_MB25_ID1, val)
2491#define bfin_read_CAN0_MB26_DATA0() bfin_read16(CAN0_MB26_DATA0)
2492#define bfin_write_CAN0_MB26_DATA0(val) bfin_write16(CAN0_MB26_DATA0, val)
2493#define bfin_read_CAN0_MB26_DATA1() bfin_read16(CAN0_MB26_DATA1)
2494#define bfin_write_CAN0_MB26_DATA1(val) bfin_write16(CAN0_MB26_DATA1, val)
2495#define bfin_read_CAN0_MB26_DATA2() bfin_read16(CAN0_MB26_DATA2)
2496#define bfin_write_CAN0_MB26_DATA2(val) bfin_write16(CAN0_MB26_DATA2, val)
2497#define bfin_read_CAN0_MB26_DATA3() bfin_read16(CAN0_MB26_DATA3)
2498#define bfin_write_CAN0_MB26_DATA3(val) bfin_write16(CAN0_MB26_DATA3, val)
2499#define bfin_read_CAN0_MB26_LENGTH() bfin_read16(CAN0_MB26_LENGTH)
2500#define bfin_write_CAN0_MB26_LENGTH(val) bfin_write16(CAN0_MB26_LENGTH, val)
2501#define bfin_read_CAN0_MB26_TIMESTAMP() bfin_read16(CAN0_MB26_TIMESTAMP)
2502#define bfin_write_CAN0_MB26_TIMESTAMP(val) bfin_write16(CAN0_MB26_TIMESTAMP, val)
2503#define bfin_read_CAN0_MB26_ID0() bfin_read16(CAN0_MB26_ID0)
2504#define bfin_write_CAN0_MB26_ID0(val) bfin_write16(CAN0_MB26_ID0, val)
2505#define bfin_read_CAN0_MB26_ID1() bfin_read16(CAN0_MB26_ID1)
2506#define bfin_write_CAN0_MB26_ID1(val) bfin_write16(CAN0_MB26_ID1, val)
2507#define bfin_read_CAN0_MB27_DATA0() bfin_read16(CAN0_MB27_DATA0)
2508#define bfin_write_CAN0_MB27_DATA0(val) bfin_write16(CAN0_MB27_DATA0, val)
2509#define bfin_read_CAN0_MB27_DATA1() bfin_read16(CAN0_MB27_DATA1)
2510#define bfin_write_CAN0_MB27_DATA1(val) bfin_write16(CAN0_MB27_DATA1, val)
2511#define bfin_read_CAN0_MB27_DATA2() bfin_read16(CAN0_MB27_DATA2)
2512#define bfin_write_CAN0_MB27_DATA2(val) bfin_write16(CAN0_MB27_DATA2, val)
2513#define bfin_read_CAN0_MB27_DATA3() bfin_read16(CAN0_MB27_DATA3)
2514#define bfin_write_CAN0_MB27_DATA3(val) bfin_write16(CAN0_MB27_DATA3, val)
2515#define bfin_read_CAN0_MB27_LENGTH() bfin_read16(CAN0_MB27_LENGTH)
2516#define bfin_write_CAN0_MB27_LENGTH(val) bfin_write16(CAN0_MB27_LENGTH, val)
2517#define bfin_read_CAN0_MB27_TIMESTAMP() bfin_read16(CAN0_MB27_TIMESTAMP)
2518#define bfin_write_CAN0_MB27_TIMESTAMP(val) bfin_write16(CAN0_MB27_TIMESTAMP, val)
2519#define bfin_read_CAN0_MB27_ID0() bfin_read16(CAN0_MB27_ID0)
2520#define bfin_write_CAN0_MB27_ID0(val) bfin_write16(CAN0_MB27_ID0, val)
2521#define bfin_read_CAN0_MB27_ID1() bfin_read16(CAN0_MB27_ID1)
2522#define bfin_write_CAN0_MB27_ID1(val) bfin_write16(CAN0_MB27_ID1, val)
2523#define bfin_read_CAN0_MB28_DATA0() bfin_read16(CAN0_MB28_DATA0)
2524#define bfin_write_CAN0_MB28_DATA0(val) bfin_write16(CAN0_MB28_DATA0, val)
2525#define bfin_read_CAN0_MB28_DATA1() bfin_read16(CAN0_MB28_DATA1)
2526#define bfin_write_CAN0_MB28_DATA1(val) bfin_write16(CAN0_MB28_DATA1, val)
2527#define bfin_read_CAN0_MB28_DATA2() bfin_read16(CAN0_MB28_DATA2)
2528#define bfin_write_CAN0_MB28_DATA2(val) bfin_write16(CAN0_MB28_DATA2, val)
2529#define bfin_read_CAN0_MB28_DATA3() bfin_read16(CAN0_MB28_DATA3)
2530#define bfin_write_CAN0_MB28_DATA3(val) bfin_write16(CAN0_MB28_DATA3, val)
2531#define bfin_read_CAN0_MB28_LENGTH() bfin_read16(CAN0_MB28_LENGTH)
2532#define bfin_write_CAN0_MB28_LENGTH(val) bfin_write16(CAN0_MB28_LENGTH, val)
2533#define bfin_read_CAN0_MB28_TIMESTAMP() bfin_read16(CAN0_MB28_TIMESTAMP)
2534#define bfin_write_CAN0_MB28_TIMESTAMP(val) bfin_write16(CAN0_MB28_TIMESTAMP, val)
2535#define bfin_read_CAN0_MB28_ID0() bfin_read16(CAN0_MB28_ID0)
2536#define bfin_write_CAN0_MB28_ID0(val) bfin_write16(CAN0_MB28_ID0, val)
2537#define bfin_read_CAN0_MB28_ID1() bfin_read16(CAN0_MB28_ID1)
2538#define bfin_write_CAN0_MB28_ID1(val) bfin_write16(CAN0_MB28_ID1, val)
2539#define bfin_read_CAN0_MB29_DATA0() bfin_read16(CAN0_MB29_DATA0)
2540#define bfin_write_CAN0_MB29_DATA0(val) bfin_write16(CAN0_MB29_DATA0, val)
2541#define bfin_read_CAN0_MB29_DATA1() bfin_read16(CAN0_MB29_DATA1)
2542#define bfin_write_CAN0_MB29_DATA1(val) bfin_write16(CAN0_MB29_DATA1, val)
2543#define bfin_read_CAN0_MB29_DATA2() bfin_read16(CAN0_MB29_DATA2)
2544#define bfin_write_CAN0_MB29_DATA2(val) bfin_write16(CAN0_MB29_DATA2, val)
2545#define bfin_read_CAN0_MB29_DATA3() bfin_read16(CAN0_MB29_DATA3)
2546#define bfin_write_CAN0_MB29_DATA3(val) bfin_write16(CAN0_MB29_DATA3, val)
2547#define bfin_read_CAN0_MB29_LENGTH() bfin_read16(CAN0_MB29_LENGTH)
2548#define bfin_write_CAN0_MB29_LENGTH(val) bfin_write16(CAN0_MB29_LENGTH, val)
2549#define bfin_read_CAN0_MB29_TIMESTAMP() bfin_read16(CAN0_MB29_TIMESTAMP)
2550#define bfin_write_CAN0_MB29_TIMESTAMP(val) bfin_write16(CAN0_MB29_TIMESTAMP, val)
2551#define bfin_read_CAN0_MB29_ID0() bfin_read16(CAN0_MB29_ID0)
2552#define bfin_write_CAN0_MB29_ID0(val) bfin_write16(CAN0_MB29_ID0, val)
2553#define bfin_read_CAN0_MB29_ID1() bfin_read16(CAN0_MB29_ID1)
2554#define bfin_write_CAN0_MB29_ID1(val) bfin_write16(CAN0_MB29_ID1, val)
2555#define bfin_read_CAN0_MB30_DATA0() bfin_read16(CAN0_MB30_DATA0)
2556#define bfin_write_CAN0_MB30_DATA0(val) bfin_write16(CAN0_MB30_DATA0, val)
2557#define bfin_read_CAN0_MB30_DATA1() bfin_read16(CAN0_MB30_DATA1)
2558#define bfin_write_CAN0_MB30_DATA1(val) bfin_write16(CAN0_MB30_DATA1, val)
2559#define bfin_read_CAN0_MB30_DATA2() bfin_read16(CAN0_MB30_DATA2)
2560#define bfin_write_CAN0_MB30_DATA2(val) bfin_write16(CAN0_MB30_DATA2, val)
2561#define bfin_read_CAN0_MB30_DATA3() bfin_read16(CAN0_MB30_DATA3)
2562#define bfin_write_CAN0_MB30_DATA3(val) bfin_write16(CAN0_MB30_DATA3, val)
2563#define bfin_read_CAN0_MB30_LENGTH() bfin_read16(CAN0_MB30_LENGTH)
2564#define bfin_write_CAN0_MB30_LENGTH(val) bfin_write16(CAN0_MB30_LENGTH, val)
2565#define bfin_read_CAN0_MB30_TIMESTAMP() bfin_read16(CAN0_MB30_TIMESTAMP)
2566#define bfin_write_CAN0_MB30_TIMESTAMP(val) bfin_write16(CAN0_MB30_TIMESTAMP, val)
2567#define bfin_read_CAN0_MB30_ID0() bfin_read16(CAN0_MB30_ID0)
2568#define bfin_write_CAN0_MB30_ID0(val) bfin_write16(CAN0_MB30_ID0, val)
2569#define bfin_read_CAN0_MB30_ID1() bfin_read16(CAN0_MB30_ID1)
2570#define bfin_write_CAN0_MB30_ID1(val) bfin_write16(CAN0_MB30_ID1, val)
2571#define bfin_read_CAN0_MB31_DATA0() bfin_read16(CAN0_MB31_DATA0)
2572#define bfin_write_CAN0_MB31_DATA0(val) bfin_write16(CAN0_MB31_DATA0, val)
2573#define bfin_read_CAN0_MB31_DATA1() bfin_read16(CAN0_MB31_DATA1)
2574#define bfin_write_CAN0_MB31_DATA1(val) bfin_write16(CAN0_MB31_DATA1, val)
2575#define bfin_read_CAN0_MB31_DATA2() bfin_read16(CAN0_MB31_DATA2)
2576#define bfin_write_CAN0_MB31_DATA2(val) bfin_write16(CAN0_MB31_DATA2, val)
2577#define bfin_read_CAN0_MB31_DATA3() bfin_read16(CAN0_MB31_DATA3)
2578#define bfin_write_CAN0_MB31_DATA3(val) bfin_write16(CAN0_MB31_DATA3, val)
2579#define bfin_read_CAN0_MB31_LENGTH() bfin_read16(CAN0_MB31_LENGTH)
2580#define bfin_write_CAN0_MB31_LENGTH(val) bfin_write16(CAN0_MB31_LENGTH, val)
2581#define bfin_read_CAN0_MB31_TIMESTAMP() bfin_read16(CAN0_MB31_TIMESTAMP)
2582#define bfin_write_CAN0_MB31_TIMESTAMP(val) bfin_write16(CAN0_MB31_TIMESTAMP, val)
2583#define bfin_read_CAN0_MB31_ID0() bfin_read16(CAN0_MB31_ID0)
2584#define bfin_write_CAN0_MB31_ID0(val) bfin_write16(CAN0_MB31_ID0, val)
2585#define bfin_read_CAN0_MB31_ID1() bfin_read16(CAN0_MB31_ID1)
2586#define bfin_write_CAN0_MB31_ID1(val) bfin_write16(CAN0_MB31_ID1, val)
2587
2588/* UART3 Registers */
2589
2590#define bfin_read_UART3_DLL() bfin_read16(UART3_DLL)
2591#define bfin_write_UART3_DLL(val) bfin_write16(UART3_DLL, val)
2592#define bfin_read_UART3_DLH() bfin_read16(UART3_DLH)
2593#define bfin_write_UART3_DLH(val) bfin_write16(UART3_DLH, val)
2594#define bfin_read_UART3_GCTL() bfin_read16(UART3_GCTL)
2595#define bfin_write_UART3_GCTL(val) bfin_write16(UART3_GCTL, val)
2596#define bfin_read_UART3_LCR() bfin_read16(UART3_LCR)
2597#define bfin_write_UART3_LCR(val) bfin_write16(UART3_LCR, val)
2598#define bfin_read_UART3_MCR() bfin_read16(UART3_MCR)
2599#define bfin_write_UART3_MCR(val) bfin_write16(UART3_MCR, val)
2600#define bfin_read_UART3_LSR() bfin_read16(UART3_LSR)
2601#define bfin_write_UART3_LSR(val) bfin_write16(UART3_LSR, val)
2602#define bfin_read_UART3_MSR() bfin_read16(UART3_MSR)
2603#define bfin_write_UART3_MSR(val) bfin_write16(UART3_MSR, val)
2604#define bfin_read_UART3_SCR() bfin_read16(UART3_SCR)
2605#define bfin_write_UART3_SCR(val) bfin_write16(UART3_SCR, val)
2606#define bfin_read_UART3_IER_SET() bfin_read16(UART3_IER_SET)
2607#define bfin_write_UART3_IER_SET(val) bfin_write16(UART3_IER_SET, val)
2608#define bfin_read_UART3_IER_CLEAR() bfin_read16(UART3_IER_CLEAR)
2609#define bfin_write_UART3_IER_CLEAR(val) bfin_write16(UART3_IER_CLEAR, val)
2610#define bfin_read_UART3_THR() bfin_read16(UART3_THR)
2611#define bfin_write_UART3_THR(val) bfin_write16(UART3_THR, val)
2612#define bfin_read_UART3_RBR() bfin_read16(UART3_RBR)
2613#define bfin_write_UART3_RBR(val) bfin_write16(UART3_RBR, val)
2614
2615/* NFC Registers */
2616
2617#define bfin_read_NFC_CTL() bfin_read16(NFC_CTL)
2618#define bfin_write_NFC_CTL(val) bfin_write16(NFC_CTL, val)
2619#define bfin_read_NFC_STAT() bfin_read16(NFC_STAT)
2620#define bfin_write_NFC_STAT(val) bfin_write16(NFC_STAT, val)
2621#define bfin_read_NFC_IRQSTAT() bfin_read16(NFC_IRQSTAT)
2622#define bfin_write_NFC_IRQSTAT(val) bfin_write16(NFC_IRQSTAT, val)
2623#define bfin_read_NFC_IRQMASK() bfin_read16(NFC_IRQMASK)
2624#define bfin_write_NFC_IRQMASK(val) bfin_write16(NFC_IRQMASK, val)
2625#define bfin_read_NFC_ECC0() bfin_read16(NFC_ECC0)
2626#define bfin_write_NFC_ECC0(val) bfin_write16(NFC_ECC0, val)
2627#define bfin_read_NFC_ECC1() bfin_read16(NFC_ECC1)
2628#define bfin_write_NFC_ECC1(val) bfin_write16(NFC_ECC1, val)
2629#define bfin_read_NFC_ECC2() bfin_read16(NFC_ECC2)
2630#define bfin_write_NFC_ECC2(val) bfin_write16(NFC_ECC2, val)
2631#define bfin_read_NFC_ECC3() bfin_read16(NFC_ECC3)
2632#define bfin_write_NFC_ECC3(val) bfin_write16(NFC_ECC3, val)
2633#define bfin_read_NFC_COUNT() bfin_read16(NFC_COUNT)
2634#define bfin_write_NFC_COUNT(val) bfin_write16(NFC_COUNT, val)
2635#define bfin_read_NFC_RST() bfin_read16(NFC_RST)
2636#define bfin_write_NFC_RST(val) bfin_write16(NFC_RST, val)
2637#define bfin_read_NFC_PGCTL() bfin_read16(NFC_PGCTL)
2638#define bfin_write_NFC_PGCTL(val) bfin_write16(NFC_PGCTL, val)
2639#define bfin_read_NFC_READ() bfin_read16(NFC_READ)
2640#define bfin_write_NFC_READ(val) bfin_write16(NFC_READ, val)
2641#define bfin_read_NFC_ADDR() bfin_read16(NFC_ADDR)
2642#define bfin_write_NFC_ADDR(val) bfin_write16(NFC_ADDR, val)
2643#define bfin_read_NFC_CMD() bfin_read16(NFC_CMD)
2644#define bfin_write_NFC_CMD(val) bfin_write16(NFC_CMD, val)
2645#define bfin_read_NFC_DATA_WR() bfin_read16(NFC_DATA_WR)
2646#define bfin_write_NFC_DATA_WR(val) bfin_write16(NFC_DATA_WR, val)
2647#define bfin_read_NFC_DATA_RD() bfin_read16(NFC_DATA_RD)
2648#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val)
2649
2650/* Counter Registers */
2651
2652#define bfin_read_CNT_CONFIG() bfin_read16(CNT_CONFIG)
2653#define bfin_write_CNT_CONFIG(val) bfin_write16(CNT_CONFIG, val)
2654#define bfin_read_CNT_IMASK() bfin_read16(CNT_IMASK)
2655#define bfin_write_CNT_IMASK(val) bfin_write16(CNT_IMASK, val)
2656#define bfin_read_CNT_STATUS() bfin_read16(CNT_STATUS)
2657#define bfin_write_CNT_STATUS(val) bfin_write16(CNT_STATUS, val)
2658#define bfin_read_CNT_COMMAND() bfin_read16(CNT_COMMAND)
2659#define bfin_write_CNT_COMMAND(val) bfin_write16(CNT_COMMAND, val)
2660#define bfin_read_CNT_DEBOUNCE() bfin_read16(CNT_DEBOUNCE)
2661#define bfin_write_CNT_DEBOUNCE(val) bfin_write16(CNT_DEBOUNCE, val)
2662#define bfin_read_CNT_COUNTER() bfin_read32(CNT_COUNTER)
2663#define bfin_write_CNT_COUNTER(val) bfin_write32(CNT_COUNTER, val)
2664#define bfin_read_CNT_MAX() bfin_read32(CNT_MAX)
2665#define bfin_write_CNT_MAX(val) bfin_write32(CNT_MAX, val)
2666#define bfin_read_CNT_MIN() bfin_read32(CNT_MIN)
2667#define bfin_write_CNT_MIN(val) bfin_write32(CNT_MIN, val)
2668
2669/* OTP/FUSE Registers */
2670
2671#define bfin_read_OTP_CONTROL() bfin_read16(OTP_CONTROL)
2672#define bfin_write_OTP_CONTROL(val) bfin_write16(OTP_CONTROL, val)
2673#define bfin_read_OTP_BEN() bfin_read16(OTP_BEN)
2674#define bfin_write_OTP_BEN(val) bfin_write16(OTP_BEN, val)
2675#define bfin_read_OTP_STATUS() bfin_read16(OTP_STATUS)
2676#define bfin_write_OTP_STATUS(val) bfin_write16(OTP_STATUS, val)
2677#define bfin_read_OTP_TIMING() bfin_read32(OTP_TIMING)
2678#define bfin_write_OTP_TIMING(val) bfin_write32(OTP_TIMING, val)
2679
2680/* Security Registers */
2681
2682#define bfin_read_SECURE_SYSSWT() bfin_read32(SECURE_SYSSWT)
2683#define bfin_write_SECURE_SYSSWT(val) bfin_write32(SECURE_SYSSWT, val)
2684#define bfin_read_SECURE_CONTROL() bfin_read16(SECURE_CONTROL)
2685#define bfin_write_SECURE_CONTROL(val) bfin_write16(SECURE_CONTROL, val)
2686#define bfin_read_SECURE_STATUS() bfin_read16(SECURE_STATUS)
2687#define bfin_write_SECURE_STATUS(val) bfin_write16(SECURE_STATUS, val)
2688
2689/* DMA Peribfin_read_()heral Mux Register */
2690
2691#define bfin_read_DMAC1_PERIMUX() bfin_read16(DMAC1_PERIMUX)
2692#define bfin_write_DMAC1_PERIMUX(val) bfin_write16(DMAC1_PERIMUX, val)
2693
2694/* OTP Read/Write Data Buffer Registers */
2695
2696#define bfin_read_OTP_DATA0() bfin_read32(OTP_DATA0)
2697#define bfin_write_OTP_DATA0(val) bfin_write32(OTP_DATA0, val)
2698#define bfin_read_OTP_DATA1() bfin_read32(OTP_DATA1)
2699#define bfin_write_OTP_DATA1(val) bfin_write32(OTP_DATA1, val)
2700#define bfin_read_OTP_DATA2() bfin_read32(OTP_DATA2)
2701#define bfin_write_OTP_DATA2(val) bfin_write32(OTP_DATA2, val)
2702#define bfin_read_OTP_DATA3() bfin_read32(OTP_DATA3)
2703#define bfin_write_OTP_DATA3(val) bfin_write32(OTP_DATA3, val)
2704
2705/* Handshake MDMA is not defined in the shared file because it is not available on the ADSP-BF542 bfin_read_()rocessor */
2706
2707/* legacy definitions */
2708#define bfin_read_EBIU_AMCBCTL0 bfin_read_EBIU_AMBCTL0
2709#define bfin_write_EBIU_AMCBCTL0 bfin_write_EBIU_AMBCTL0
2710#define bfin_read_EBIU_AMCBCTL1 bfin_read_EBIU_AMBCTL1
2711#define bfin_write_EBIU_AMCBCTL1 bfin_write_EBIU_AMBCTL1
2712#define bfin_read_PINT0_IRQ bfin_read_PINT0_REQUEST
2713#define bfin_write_PINT0_IRQ bfin_write_PINT0_REQUEST
2714#define bfin_read_PINT1_IRQ bfin_read_PINT1_REQUEST
2715#define bfin_write_PINT1_IRQ bfin_write_PINT1_REQUEST
2716#define bfin_read_PINT2_IRQ bfin_read_PINT2_REQUEST
2717#define bfin_write_PINT2_IRQ bfin_write_PINT2_REQUEST
2718#define bfin_read_PINT3_IRQ bfin_read_PINT3_REQUEST
2719#define bfin_write_PINT3_IRQ bfin_write_PINT3_REQUEST
2720
2721#endif /* _CDEF_BF54X_H */
2722
diff --git a/include/asm-blackfin/mach-bf548/defBF542.h b/include/asm-blackfin/mach-bf548/defBF542.h
new file mode 100644
index 000000000000..ac968fca5cc5
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/defBF542.h
@@ -0,0 +1,1206 @@
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 nKPAD_EN 0x0
366#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */
367#define KPAD_ROWEN 0x1c00 /* Row Enable Width */
368#define KPAD_COLEN 0xe000 /* Column Enable Width */
369
370/* Bit masks for KPAD_PRESCALE */
371
372#define KPAD_PRESCALE_VAL 0x3f /* Key Prescale Value */
373
374/* Bit masks for KPAD_MSEL */
375
376#define DBON_SCALE 0xff /* Debounce Scale Value */
377#define COLDRV_SCALE 0xff00 /* Column Driver Scale Value */
378
379/* Bit masks for KPAD_ROWCOL */
380
381#define KPAD_ROW 0xff /* Rows Pressed */
382#define KPAD_COL 0xff00 /* Columns Pressed */
383
384/* Bit masks for KPAD_STAT */
385
386#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */
387#define nKPAD_IRQ 0x0
388#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */
389#define KPAD_PRESSED 0x8 /* Key press current status */
390#define nKPAD_PRESSED 0x0
391
392/* Bit masks for KPAD_SOFTEVAL */
393
394#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */
395#define nKPAD_SOFTEVAL_E 0x0
396
397/* Bit masks for SDH_COMMAND */
398
399#define CMD_IDX 0x3f /* Command Index */
400#define CMD_RSP 0x40 /* Response */
401#define nCMD_RSP 0x0
402#define CMD_L_RSP 0x80 /* Long Response */
403#define nCMD_L_RSP 0x0
404#define CMD_INT_E 0x100 /* Command Interrupt */
405#define nCMD_INT_E 0x0
406#define CMD_PEND_E 0x200 /* Command Pending */
407#define nCMD_PEND_E 0x0
408#define CMD_E 0x400 /* Command Enable */
409#define nCMD_E 0x0
410
411/* Bit masks for SDH_PWR_CTL */
412
413#define PWR_ON 0x3 /* Power On */
414#if 0
415#define TBD 0x3c /* TBD */
416#endif
417#define SD_CMD_OD 0x40 /* Open Drain Output */
418#define nSD_CMD_OD 0x0
419#define ROD_CTL 0x80 /* Rod Control */
420#define nROD_CTL 0x0
421
422/* Bit masks for SDH_CLK_CTL */
423
424#define CLKDIV 0xff /* MC_CLK Divisor */
425#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
426#define nCLK_E 0x0
427#define PWR_SV_E 0x200 /* Power Save Enable */
428#define nPWR_SV_E 0x0
429#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
430#define nCLKDIV_BYPASS 0x0
431#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
432#define nWIDE_BUS 0x0
433
434/* Bit masks for SDH_RESP_CMD */
435
436#define RESP_CMD 0x3f /* Response Command */
437
438/* Bit masks for SDH_DATA_CTL */
439
440#define DTX_E 0x1 /* Data Transfer Enable */
441#define nDTX_E 0x0
442#define DTX_DIR 0x2 /* Data Transfer Direction */
443#define nDTX_DIR 0x0
444#define DTX_MODE 0x4 /* Data Transfer Mode */
445#define nDTX_MODE 0x0
446#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
447#define nDTX_DMA_E 0x0
448#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
449
450/* Bit masks for SDH_STATUS */
451
452#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
453#define nCMD_CRC_FAIL 0x0
454#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
455#define nDAT_CRC_FAIL 0x0
456#define CMD_TIMEOUT 0x4 /* CMD Time Out */
457#define nCMD_TIMEOUT 0x0
458#define DAT_TIMEOUT 0x8 /* Data Time Out */
459#define nDAT_TIMEOUT 0x0
460#define TX_UNDERRUN 0x10 /* Transmit Underrun */
461#define nTX_UNDERRUN 0x0
462#define RX_OVERRUN 0x20 /* Receive Overrun */
463#define nRX_OVERRUN 0x0
464#define CMD_RESP_END 0x40 /* CMD Response End */
465#define nCMD_RESP_END 0x0
466#define CMD_SENT 0x80 /* CMD Sent */
467#define nCMD_SENT 0x0
468#define DAT_END 0x100 /* Data End */
469#define nDAT_END 0x0
470#define START_BIT_ERR 0x200 /* Start Bit Error */
471#define nSTART_BIT_ERR 0x0
472#define DAT_BLK_END 0x400 /* Data Block End */
473#define nDAT_BLK_END 0x0
474#define CMD_ACT 0x800 /* CMD Active */
475#define nCMD_ACT 0x0
476#define TX_ACT 0x1000 /* Transmit Active */
477#define nTX_ACT 0x0
478#define RX_ACT 0x2000 /* Receive Active */
479#define nRX_ACT 0x0
480#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
481#define nTX_FIFO_STAT 0x0
482#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
483#define nRX_FIFO_STAT 0x0
484#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
485#define nTX_FIFO_FULL 0x0
486#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
487#define nRX_FIFO_FULL 0x0
488#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
489#define nTX_FIFO_ZERO 0x0
490#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
491#define nRX_DAT_ZERO 0x0
492#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
493#define nTX_DAT_RDY 0x0
494#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
495#define nRX_FIFO_RDY 0x0
496
497/* Bit masks for SDH_STATUS_CLR */
498
499#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
500#define nCMD_CRC_FAIL_STAT 0x0
501#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
502#define nDAT_CRC_FAIL_STAT 0x0
503#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
504#define nCMD_TIMEOUT_STAT 0x0
505#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
506#define nDAT_TIMEOUT_STAT 0x0
507#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
508#define nTX_UNDERRUN_STAT 0x0
509#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
510#define nRX_OVERRUN_STAT 0x0
511#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
512#define nCMD_RESP_END_STAT 0x0
513#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
514#define nCMD_SENT_STAT 0x0
515#define DAT_END_STAT 0x100 /* Data End Status */
516#define nDAT_END_STAT 0x0
517#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
518#define nSTART_BIT_ERR_STAT 0x0
519#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
520#define nDAT_BLK_END_STAT 0x0
521
522/* Bit masks for SDH_MASK0 */
523
524#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
525#define nCMD_CRC_FAIL_MASK 0x0
526#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
527#define nDAT_CRC_FAIL_MASK 0x0
528#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
529#define nCMD_TIMEOUT_MASK 0x0
530#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
531#define nDAT_TIMEOUT_MASK 0x0
532#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
533#define nTX_UNDERRUN_MASK 0x0
534#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
535#define nRX_OVERRUN_MASK 0x0
536#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
537#define nCMD_RESP_END_MASK 0x0
538#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
539#define nCMD_SENT_MASK 0x0
540#define DAT_END_MASK 0x100 /* Data End Mask */
541#define nDAT_END_MASK 0x0
542#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
543#define nSTART_BIT_ERR_MASK 0x0
544#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
545#define nDAT_BLK_END_MASK 0x0
546#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
547#define nCMD_ACT_MASK 0x0
548#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
549#define nTX_ACT_MASK 0x0
550#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
551#define nRX_ACT_MASK 0x0
552#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
553#define nTX_FIFO_STAT_MASK 0x0
554#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
555#define nRX_FIFO_STAT_MASK 0x0
556#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
557#define nTX_FIFO_FULL_MASK 0x0
558#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
559#define nRX_FIFO_FULL_MASK 0x0
560#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
561#define nTX_FIFO_ZERO_MASK 0x0
562#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
563#define nRX_DAT_ZERO_MASK 0x0
564#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
565#define nTX_DAT_RDY_MASK 0x0
566#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
567#define nRX_FIFO_RDY_MASK 0x0
568
569/* Bit masks for SDH_FIFO_CNT */
570
571#define FIFO_COUNT 0x7fff /* FIFO Count */
572
573/* Bit masks for SDH_E_STATUS */
574
575#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
576#define nSDIO_INT_DET 0x0
577#define SD_CARD_DET 0x10 /* SD Card Detect */
578#define nSD_CARD_DET 0x0
579
580/* Bit masks for SDH_E_MASK */
581
582#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
583#define nSDIO_MSK 0x0
584#define SCD_MSK 0x40 /* Mask Card Detect */
585#define nSCD_MSK 0x0
586
587/* Bit masks for SDH_CFG */
588
589#define CLKS_EN 0x1 /* Clocks Enable */
590#define nCLKS_EN 0x0
591#define SD4E 0x4 /* SDIO 4-Bit Enable */
592#define nSD4E 0x0
593#define MWE 0x8 /* Moving Window Enable */
594#define nMWE 0x0
595#define SD_RST 0x10 /* SDMMC Reset */
596#define nSD_RST 0x0
597#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
598#define nPUP_SDDAT 0x0
599#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
600#define nPUP_SDDAT3 0x0
601#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
602#define nPD_SDDAT3 0x0
603
604/* Bit masks for SDH_RD_WAIT_EN */
605
606#define RWR 0x1 /* Read Wait Request */
607#define nRWR 0x0
608
609/* Bit masks for ATAPI_CONTROL */
610
611#define PIO_START 0x1 /* Start PIO/Reg Op */
612#define nPIO_START 0x0
613#define MULTI_START 0x2 /* Start Multi-DMA Op */
614#define nMULTI_START 0x0
615#define ULTRA_START 0x4 /* Start Ultra-DMA Op */
616#define nULTRA_START 0x0
617#define XFER_DIR 0x8 /* Transfer Direction */
618#define nXFER_DIR 0x0
619#define IORDY_EN 0x10 /* IORDY Enable */
620#define nIORDY_EN 0x0
621#define FIFO_FLUSH 0x20 /* Flush FIFOs */
622#define nFIFO_FLUSH 0x0
623#define SOFT_RST 0x40 /* Soft Reset */
624#define nSOFT_RST 0x0
625#define DEV_RST 0x80 /* Device Reset */
626#define nDEV_RST 0x0
627#define TFRCNT_RST 0x100 /* Trans Count Reset */
628#define nTFRCNT_RST 0x0
629#define END_ON_TERM 0x200 /* End/Terminate Select */
630#define nEND_ON_TERM 0x0
631#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
632#define nPIO_USE_DMA 0x0
633#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
634
635/* Bit masks for ATAPI_STATUS */
636
637#define PIO_XFER_ON 0x1 /* PIO transfer in progress */
638#define nPIO_XFER_ON 0x0
639#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
640#define nMULTI_XFER_ON 0x0
641#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
642#define nULTRA_XFER_ON 0x0
643#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
644
645/* Bit masks for ATAPI_DEV_ADDR */
646
647#define DEV_ADDR 0x1f /* Device Address */
648
649/* Bit masks for ATAPI_INT_MASK */
650
651#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
652#define nATAPI_DEV_INT_MASK 0x0
653#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
654#define nPIO_DONE_MASK 0x0
655#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
656#define nMULTI_DONE_MASK 0x0
657#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
658#define nUDMAIN_DONE_MASK 0x0
659#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
660#define nUDMAOUT_DONE_MASK 0x0
661#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
662#define nHOST_TERM_XFER_MASK 0x0
663#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
664#define nMULTI_TERM_MASK 0x0
665#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
666#define nUDMAIN_TERM_MASK 0x0
667#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
668#define nUDMAOUT_TERM_MASK 0x0
669
670/* Bit masks for ATAPI_INT_STATUS */
671
672#define ATAPI_DEV_INT 0x1 /* Device interrupt status */
673#define nATAPI_DEV_INT 0x0
674#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
675#define nPIO_DONE_INT 0x0
676#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
677#define nMULTI_DONE_INT 0x0
678#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
679#define nUDMAIN_DONE_INT 0x0
680#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
681#define nUDMAOUT_DONE_INT 0x0
682#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
683#define nHOST_TERM_XFER_INT 0x0
684#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
685#define nMULTI_TERM_INT 0x0
686#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
687#define nUDMAIN_TERM_INT 0x0
688#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
689#define nUDMAOUT_TERM_INT 0x0
690
691/* Bit masks for ATAPI_LINE_STATUS */
692
693#define ATAPI_INTR 0x1 /* Device interrupt to host line status */
694#define nATAPI_INTR 0x0
695#define ATAPI_DASP 0x2 /* Device dasp to host line status */
696#define nATAPI_DASP 0x0
697#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
698#define nATAPI_CS0N 0x0
699#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
700#define nATAPI_CS1N 0x0
701#define ATAPI_ADDR 0x70 /* ATAPI address line status */
702#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
703#define nATAPI_DMAREQ 0x0
704#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
705#define nATAPI_DMAACKN 0x0
706#define ATAPI_DIOWN 0x200 /* ATAPI write line status */
707#define nATAPI_DIOWN 0x0
708#define ATAPI_DIORN 0x400 /* ATAPI read line status */
709#define nATAPI_DIORN 0x0
710#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
711#define nATAPI_IORDY 0x0
712
713/* Bit masks for ATAPI_SM_STATE */
714
715#define PIO_CSTATE 0xf /* PIO mode state machine current state */
716#define DMA_CSTATE 0xf0 /* DMA mode state machine current state */
717#define UDMAIN_CSTATE 0xf00 /* Ultra DMA-In mode state machine current state */
718#define UDMAOUT_CSTATE 0xf000 /* ATAPI IORDY line status */
719
720/* Bit masks for ATAPI_TERMINATE */
721
722#define ATAPI_HOST_TERM 0x1 /* Host terminationation */
723#define nATAPI_HOST_TERM 0x0
724
725/* Bit masks for ATAPI_REG_TIM_0 */
726
727#define T2_REG 0xff /* End of cycle time for register access transfers */
728#define TEOC_REG 0xff00 /* Selects DIOR/DIOW pulsewidth */
729
730/* Bit masks for ATAPI_PIO_TIM_0 */
731
732#define T1_REG 0xf /* Time from address valid to DIOR/DIOW */
733#define T2_REG_PIO 0xff0 /* DIOR/DIOW pulsewidth */
734#define T4_REG 0xf000 /* DIOW data hold */
735
736/* Bit masks for ATAPI_PIO_TIM_1 */
737
738#define TEOC_REG_PIO 0xff /* End of cycle time for PIO access transfers. */
739
740/* Bit masks for ATAPI_MULTI_TIM_0 */
741
742#define TD 0xff /* DIOR/DIOW asserted pulsewidth */
743#define TM 0xff00 /* Time from address valid to DIOR/DIOW */
744
745/* Bit masks for ATAPI_MULTI_TIM_1 */
746
747#define TKW 0xff /* Selects DIOW negated pulsewidth */
748#define TKR 0xff00 /* Selects DIOR negated pulsewidth */
749
750/* Bit masks for ATAPI_MULTI_TIM_2 */
751
752#define TH 0xff /* Selects DIOW data hold */
753#define TEOC 0xff00 /* Selects end of cycle for DMA */
754
755/* Bit masks for ATAPI_ULTRA_TIM_0 */
756
757#define TACK 0xff /* Selects setup and hold times for TACK */
758#define TENV 0xff00 /* Selects envelope time */
759
760/* Bit masks for ATAPI_ULTRA_TIM_1 */
761
762#define TDVS 0xff /* Selects data valid setup time */
763#define TCYC_TDVS 0xff00 /* Selects cycle time - TDVS time */
764
765/* Bit masks for ATAPI_ULTRA_TIM_2 */
766
767#define TSS 0xff /* Selects time from STROBE edge to negation of DMARQ or assertion of STOP */
768#define TMLI 0xff00 /* Selects interlock time */
769
770/* Bit masks for ATAPI_ULTRA_TIM_3 */
771
772#define TZAH 0xff /* Selects minimum delay required for output */
773#define READY_PAUSE 0xff00 /* Selects ready to pause */
774
775/* Bit masks for USB_FADDR */
776
777#define FUNCTION_ADDRESS 0x7f /* Function address */
778
779/* Bit masks for USB_POWER */
780
781#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
782#define nENABLE_SUSPENDM 0x0
783#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
784#define nSUSPEND_MODE 0x0
785#define RESUME_MODE 0x4 /* DMA Mode */
786#define nRESUME_MODE 0x0
787#define RESET 0x8 /* Reset indicator */
788#define nRESET 0x0
789#define HS_MODE 0x10 /* High Speed mode indicator */
790#define nHS_MODE 0x0
791#define HS_ENABLE 0x20 /* high Speed Enable */
792#define nHS_ENABLE 0x0
793#define SOFT_CONN 0x40 /* Soft connect */
794#define nSOFT_CONN 0x0
795#define ISO_UPDATE 0x80 /* Isochronous update */
796#define nISO_UPDATE 0x0
797
798/* Bit masks for USB_INTRTX */
799
800#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
801#define nEP0_TX 0x0
802#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
803#define nEP1_TX 0x0
804#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
805#define nEP2_TX 0x0
806#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
807#define nEP3_TX 0x0
808#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
809#define nEP4_TX 0x0
810#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
811#define nEP5_TX 0x0
812#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
813#define nEP6_TX 0x0
814#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
815#define nEP7_TX 0x0
816
817/* Bit masks for USB_INTRRX */
818
819#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
820#define nEP1_RX 0x0
821#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
822#define nEP2_RX 0x0
823#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
824#define nEP3_RX 0x0
825#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
826#define nEP4_RX 0x0
827#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
828#define nEP5_RX 0x0
829#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
830#define nEP6_RX 0x0
831#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
832#define nEP7_RX 0x0
833
834/* Bit masks for USB_INTRTXE */
835
836#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
837#define nEP0_TX_E 0x0
838#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
839#define nEP1_TX_E 0x0
840#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
841#define nEP2_TX_E 0x0
842#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
843#define nEP3_TX_E 0x0
844#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
845#define nEP4_TX_E 0x0
846#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
847#define nEP5_TX_E 0x0
848#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
849#define nEP6_TX_E 0x0
850#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
851#define nEP7_TX_E 0x0
852
853/* Bit masks for USB_INTRRXE */
854
855#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
856#define nEP1_RX_E 0x0
857#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
858#define nEP2_RX_E 0x0
859#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
860#define nEP3_RX_E 0x0
861#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
862#define nEP4_RX_E 0x0
863#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
864#define nEP5_RX_E 0x0
865#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
866#define nEP6_RX_E 0x0
867#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
868#define nEP7_RX_E 0x0
869
870/* Bit masks for USB_INTRUSB */
871
872#define SUSPEND_B 0x1 /* Suspend indicator */
873#define nSUSPEND_B 0x0
874#define RESUME_B 0x2 /* Resume indicator */
875#define nRESUME_B 0x0
876#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
877#define nRESET_OR_BABLE_B 0x0
878#define SOF_B 0x8 /* Start of frame */
879#define nSOF_B 0x0
880#define CONN_B 0x10 /* Connection indicator */
881#define nCONN_B 0x0
882#define DISCON_B 0x20 /* Disconnect indicator */
883#define nDISCON_B 0x0
884#define SESSION_REQ_B 0x40 /* Session Request */
885#define nSESSION_REQ_B 0x0
886#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
887#define nVBUS_ERROR_B 0x0
888
889/* Bit masks for USB_INTRUSBE */
890
891#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
892#define nSUSPEND_BE 0x0
893#define RESUME_BE 0x2 /* Resume indicator int enable */
894#define nRESUME_BE 0x0
895#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
896#define nRESET_OR_BABLE_BE 0x0
897#define SOF_BE 0x8 /* Start of frame int enable */
898#define nSOF_BE 0x0
899#define CONN_BE 0x10 /* Connection indicator int enable */
900#define nCONN_BE 0x0
901#define DISCON_BE 0x20 /* Disconnect indicator int enable */
902#define nDISCON_BE 0x0
903#define SESSION_REQ_BE 0x40 /* Session Request int enable */
904#define nSESSION_REQ_BE 0x0
905#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
906#define nVBUS_ERROR_BE 0x0
907
908/* Bit masks for USB_FRAME */
909
910#define FRAME_NUMBER 0x7ff /* Frame number */
911
912/* Bit masks for USB_INDEX */
913
914#define SELECTED_ENDPOINT 0xf /* selected endpoint */
915
916/* Bit masks for USB_GLOBAL_CTL */
917
918#define GLOBAL_ENA 0x1 /* enables USB module */
919#define nGLOBAL_ENA 0x0
920#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
921#define nEP1_TX_ENA 0x0
922#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
923#define nEP2_TX_ENA 0x0
924#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
925#define nEP3_TX_ENA 0x0
926#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
927#define nEP4_TX_ENA 0x0
928#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
929#define nEP5_TX_ENA 0x0
930#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
931#define nEP6_TX_ENA 0x0
932#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
933#define nEP7_TX_ENA 0x0
934#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
935#define nEP1_RX_ENA 0x0
936#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
937#define nEP2_RX_ENA 0x0
938#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
939#define nEP3_RX_ENA 0x0
940#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
941#define nEP4_RX_ENA 0x0
942#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
943#define nEP5_RX_ENA 0x0
944#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
945#define nEP6_RX_ENA 0x0
946#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
947#define nEP7_RX_ENA 0x0
948
949/* Bit masks for USB_OTG_DEV_CTL */
950
951#define SESSION 0x1 /* session indicator */
952#define nSESSION 0x0
953#define HOST_REQ 0x2 /* Host negotiation request */
954#define nHOST_REQ 0x0
955#define HOST_MODE 0x4 /* indicates USBDRC is a host */
956#define nHOST_MODE 0x0
957#define VBUS0 0x8 /* Vbus level indicator[0] */
958#define nVBUS0 0x0
959#define VBUS1 0x10 /* Vbus level indicator[1] */
960#define nVBUS1 0x0
961#define LSDEV 0x20 /* Low-speed indicator */
962#define nLSDEV 0x0
963#define FSDEV 0x40 /* Full or High-speed indicator */
964#define nFSDEV 0x0
965#define B_DEVICE 0x80 /* A' or 'B' device indicator */
966#define nB_DEVICE 0x0
967
968/* Bit masks for USB_OTG_VBUS_IRQ */
969
970#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
971#define nDRIVE_VBUS_ON 0x0
972#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
973#define nDRIVE_VBUS_OFF 0x0
974#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
975#define nCHRG_VBUS_START 0x0
976#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
977#define nCHRG_VBUS_END 0x0
978#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
979#define nDISCHRG_VBUS_START 0x0
980#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
981#define nDISCHRG_VBUS_END 0x0
982
983/* Bit masks for USB_OTG_VBUS_MASK */
984
985#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
986#define nDRIVE_VBUS_ON_ENA 0x0
987#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
988#define nDRIVE_VBUS_OFF_ENA 0x0
989#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
990#define nCHRG_VBUS_START_ENA 0x0
991#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
992#define nCHRG_VBUS_END_ENA 0x0
993#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
994#define nDISCHRG_VBUS_START_ENA 0x0
995#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
996#define nDISCHRG_VBUS_END_ENA 0x0
997
998/* Bit masks for USB_CSR0 */
999
1000#define RXPKTRDY 0x1 /* data packet receive indicator */
1001#define nRXPKTRDY 0x0
1002#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
1003#define nTXPKTRDY 0x0
1004#define STALL_SENT 0x4 /* STALL handshake sent */
1005#define nSTALL_SENT 0x0
1006#define DATAEND 0x8 /* Data end indicator */
1007#define nDATAEND 0x0
1008#define SETUPEND 0x10 /* Setup end */
1009#define nSETUPEND 0x0
1010#define SENDSTALL 0x20 /* Send STALL handshake */
1011#define nSENDSTALL 0x0
1012#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
1013#define nSERVICED_RXPKTRDY 0x0
1014#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
1015#define nSERVICED_SETUPEND 0x0
1016#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
1017#define nFLUSHFIFO 0x0
1018#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
1019#define nSTALL_RECEIVED_H 0x0
1020#define SETUPPKT_H 0x8 /* send Setup token host mode */
1021#define nSETUPPKT_H 0x0
1022#define ERROR_H 0x10 /* timeout error indicator host mode */
1023#define nERROR_H 0x0
1024#define REQPKT_H 0x20 /* Request an IN transaction host mode */
1025#define nREQPKT_H 0x0
1026#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
1027#define nSTATUSPKT_H 0x0
1028#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
1029#define nNAK_TIMEOUT_H 0x0
1030
1031/* Bit masks for USB_COUNT0 */
1032
1033#define EP0_RX_COUNT 0x7f /* number of received bytes in EP0 FIFO */
1034
1035/* Bit masks for USB_NAKLIMIT0 */
1036
1037#define EP0_NAK_LIMIT 0x1f /* number of frames/micro frames after which EP0 timeouts */
1038
1039/* Bit masks for USB_TX_MAX_PACKET */
1040
1041#define MAX_PACKET_SIZE_T 0x7ff /* maximum data pay load in a frame */
1042
1043/* Bit masks for USB_RX_MAX_PACKET */
1044
1045#define MAX_PACKET_SIZE_R 0x7ff /* maximum data pay load in a frame */
1046
1047/* Bit masks for USB_TXCSR */
1048
1049#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
1050#define nTXPKTRDY_T 0x0
1051#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
1052#define nFIFO_NOT_EMPTY_T 0x0
1053#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
1054#define nUNDERRUN_T 0x0
1055#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
1056#define nFLUSHFIFO_T 0x0
1057#define STALL_SEND_T 0x10 /* issue a Stall handshake */
1058#define nSTALL_SEND_T 0x0
1059#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
1060#define nSTALL_SENT_T 0x0
1061#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
1062#define nCLEAR_DATATOGGLE_T 0x0
1063#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
1064#define nINCOMPTX_T 0x0
1065#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
1066#define nDMAREQMODE_T 0x0
1067#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
1068#define nFORCE_DATATOGGLE_T 0x0
1069#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
1070#define nDMAREQ_ENA_T 0x0
1071#define ISO_T 0x4000 /* enable Isochronous transfers */
1072#define nISO_T 0x0
1073#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
1074#define nAUTOSET_T 0x0
1075#define ERROR_TH 0x4 /* error condition host mode */
1076#define nERROR_TH 0x0
1077#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
1078#define nSTALL_RECEIVED_TH 0x0
1079#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
1080#define nNAK_TIMEOUT_TH 0x0
1081
1082/* Bit masks for USB_TXCOUNT */
1083
1084#define TX_COUNT 0x1fff /* Number of bytes to be written to the selected endpoint Tx FIFO */
1085
1086/* Bit masks for USB_RXCSR */
1087
1088#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
1089#define nRXPKTRDY_R 0x0
1090#define FIFO_FULL_R 0x2 /* FIFO not empty */
1091#define nFIFO_FULL_R 0x0
1092#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
1093#define nOVERRUN_R 0x0
1094#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
1095#define nDATAERROR_R 0x0
1096#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
1097#define nFLUSHFIFO_R 0x0
1098#define STALL_SEND_R 0x20 /* issue a Stall handshake */
1099#define nSTALL_SEND_R 0x0
1100#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
1101#define nSTALL_SENT_R 0x0
1102#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
1103#define nCLEAR_DATATOGGLE_R 0x0
1104#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
1105#define nINCOMPRX_R 0x0
1106#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
1107#define nDMAREQMODE_R 0x0
1108#define DISNYET_R 0x1000 /* disable Nyet handshakes */
1109#define nDISNYET_R 0x0
1110#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
1111#define nDMAREQ_ENA_R 0x0
1112#define ISO_R 0x4000 /* enable Isochronous transfers */
1113#define nISO_R 0x0
1114#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
1115#define nAUTOCLEAR_R 0x0
1116#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
1117#define nERROR_RH 0x0
1118#define REQPKT_RH 0x20 /* request an IN transaction host mode */
1119#define nREQPKT_RH 0x0
1120#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
1121#define nSTALL_RECEIVED_RH 0x0
1122#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
1123#define nINCOMPRX_RH 0x0
1124#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
1125#define nDMAREQMODE_RH 0x0
1126#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
1127#define nAUTOREQ_RH 0x0
1128
1129/* Bit masks for USB_RXCOUNT */
1130
1131#define RX_COUNT 0x1fff /* Number of received bytes in the packet in the Rx FIFO */
1132
1133/* Bit masks for USB_TXTYPE */
1134
1135#define TARGET_EP_NO_T 0xf /* EP number */
1136#define PROTOCOL_T 0xc /* transfer type */
1137
1138/* Bit masks for USB_TXINTERVAL */
1139
1140#define TX_POLL_INTERVAL 0xff /* polling interval for selected Tx EP */
1141
1142/* Bit masks for USB_RXTYPE */
1143
1144#define TARGET_EP_NO_R 0xf /* EP number */
1145#define PROTOCOL_R 0xc /* transfer type */
1146
1147/* Bit masks for USB_RXINTERVAL */
1148
1149#define RX_POLL_INTERVAL 0xff /* polling interval for selected Rx EP */
1150
1151/* Bit masks for USB_DMA_INTERRUPT */
1152
1153#define DMA0_INT 0x1 /* DMA0 pending interrupt */
1154#define nDMA0_INT 0x0
1155#define DMA1_INT 0x2 /* DMA1 pending interrupt */
1156#define nDMA1_INT 0x0
1157#define DMA2_INT 0x4 /* DMA2 pending interrupt */
1158#define nDMA2_INT 0x0
1159#define DMA3_INT 0x8 /* DMA3 pending interrupt */
1160#define nDMA3_INT 0x0
1161#define DMA4_INT 0x10 /* DMA4 pending interrupt */
1162#define nDMA4_INT 0x0
1163#define DMA5_INT 0x20 /* DMA5 pending interrupt */
1164#define nDMA5_INT 0x0
1165#define DMA6_INT 0x40 /* DMA6 pending interrupt */
1166#define nDMA6_INT 0x0
1167#define DMA7_INT 0x80 /* DMA7 pending interrupt */
1168#define nDMA7_INT 0x0
1169
1170/* Bit masks for USB_DMAxCONTROL */
1171
1172#define DMA_ENA 0x1 /* DMA enable */
1173#define nDMA_ENA 0x0
1174#define DIRECTION 0x2 /* direction of DMA transfer */
1175#define nDIRECTION 0x0
1176#define MODE 0x4 /* DMA Bus error */
1177#define nMODE 0x0
1178#define INT_ENA 0x8 /* Interrupt enable */
1179#define nINT_ENA 0x0
1180#define EPNUM 0xf0 /* EP number */
1181#define BUSERROR 0x100 /* DMA Bus error */
1182#define nBUSERROR 0x0
1183
1184/* Bit masks for USB_DMAxADDRHIGH */
1185
1186#define DMA_ADDR_HIGH 0xffff /* Upper 16-bits of memory source/destination address for the DMA master channel */
1187
1188/* Bit masks for USB_DMAxADDRLOW */
1189
1190#define DMA_ADDR_LOW 0xffff /* Lower 16-bits of memory source/destination address for the DMA master channel */
1191
1192/* Bit masks for USB_DMAxCOUNTHIGH */
1193
1194#define DMA_COUNT_HIGH 0xffff /* Upper 16-bits of byte count of DMA transfer for DMA master channel */
1195
1196/* Bit masks for USB_DMAxCOUNTLOW */
1197
1198#define DMA_COUNT_LOW 0xffff /* Lower 16-bits of byte count of DMA transfer for DMA master channel */
1199
1200
1201/* ******************************************* */
1202/* MULTI BIT MACRO ENUMERATIONS */
1203/* ******************************************* */
1204
1205
1206#endif /* _DEF_BF542_H */
diff --git a/include/asm-blackfin/mach-bf548/defBF544.h b/include/asm-blackfin/mach-bf548/defBF544.h
new file mode 100644
index 000000000000..8fc77ea12aa9
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/defBF544.h
@@ -0,0 +1,766 @@
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_CLKDIV 0xffc02200 /* Clock Divider Register */
85#define TWI1_CONTROL 0xffc02204 /* TWI Control Register */
86#define TWI1_SLAVE_CTRL 0xffc02208 /* TWI Slave Mode Control Register */
87#define TWI1_SLAVE_STAT 0xffc0220c /* TWI Slave Mode Status Register */
88#define TWI1_SLAVE_ADDR 0xffc02210 /* TWI Slave Mode Address Register */
89#define TWI1_MASTER_CTRL 0xffc02214 /* TWI Master Mode Control Register */
90#define TWI1_MASTER_STAT 0xffc02218 /* TWI Master Mode Status Register */
91#define TWI1_MASTER_ADDR 0xffc0221c /* TWI Master Mode Address Register */
92#define TWI1_INT_STAT 0xffc02220 /* TWI Interrupt Status Register */
93#define TWI1_INT_MASK 0xffc02224 /* TWI Interrupt Mask Register */
94#define TWI1_FIFO_CTRL 0xffc02228 /* TWI FIFO Control Register */
95#define TWI1_FIFO_STAT 0xffc0222c /* TWI FIFO Status Register */
96#define TWI1_XMT_DATA8 0xffc02280 /* TWI FIFO Transmit Data Single Byte Register */
97#define TWI1_XMT_DATA16 0xffc02284 /* TWI FIFO Transmit Data Double Byte Register */
98#define TWI1_RCV_DATA8 0xffc02288 /* TWI FIFO Receive Data Single Byte Register */
99#define TWI1_RCV_DATA16 0xffc0228c /* TWI FIFO Receive Data Double Byte Register */
100
101/* CAN Controller 1 Config 1 Registers */
102
103#define CAN1_MC1 0xffc03200 /* CAN Controller 1 Mailbox Configuration Register 1 */
104#define CAN1_MD1 0xffc03204 /* CAN Controller 1 Mailbox Direction Register 1 */
105#define CAN1_TRS1 0xffc03208 /* CAN Controller 1 Transmit Request Set Register 1 */
106#define CAN1_TRR1 0xffc0320c /* CAN Controller 1 Transmit Request Reset Register 1 */
107#define CAN1_TA1 0xffc03210 /* CAN Controller 1 Transmit Acknowledge Register 1 */
108#define CAN1_AA1 0xffc03214 /* CAN Controller 1 Abort Acknowledge Register 1 */
109#define CAN1_RMP1 0xffc03218 /* CAN Controller 1 Receive Message Pending Register 1 */
110#define CAN1_RML1 0xffc0321c /* CAN Controller 1 Receive Message Lost Register 1 */
111#define CAN1_MBTIF1 0xffc03220 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 1 */
112#define CAN1_MBRIF1 0xffc03224 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 1 */
113#define CAN1_MBIM1 0xffc03228 /* CAN Controller 1 Mailbox Interrupt Mask Register 1 */
114#define CAN1_RFH1 0xffc0322c /* CAN Controller 1 Remote Frame Handling Enable Register 1 */
115#define CAN1_OPSS1 0xffc03230 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 1 */
116
117/* CAN Controller 1 Config 2 Registers */
118
119#define CAN1_MC2 0xffc03240 /* CAN Controller 1 Mailbox Configuration Register 2 */
120#define CAN1_MD2 0xffc03244 /* CAN Controller 1 Mailbox Direction Register 2 */
121#define CAN1_TRS2 0xffc03248 /* CAN Controller 1 Transmit Request Set Register 2 */
122#define CAN1_TRR2 0xffc0324c /* CAN Controller 1 Transmit Request Reset Register 2 */
123#define CAN1_TA2 0xffc03250 /* CAN Controller 1 Transmit Acknowledge Register 2 */
124#define CAN1_AA2 0xffc03254 /* CAN Controller 1 Abort Acknowledge Register 2 */
125#define CAN1_RMP2 0xffc03258 /* CAN Controller 1 Receive Message Pending Register 2 */
126#define CAN1_RML2 0xffc0325c /* CAN Controller 1 Receive Message Lost Register 2 */
127#define CAN1_MBTIF2 0xffc03260 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 2 */
128#define CAN1_MBRIF2 0xffc03264 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 2 */
129#define CAN1_MBIM2 0xffc03268 /* CAN Controller 1 Mailbox Interrupt Mask Register 2 */
130#define CAN1_RFH2 0xffc0326c /* CAN Controller 1 Remote Frame Handling Enable Register 2 */
131#define CAN1_OPSS2 0xffc03270 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 2 */
132
133/* CAN Controller 1 Clock/Interrupt/Counter Registers */
134
135#define CAN1_CLOCK 0xffc03280 /* CAN Controller 1 Clock Register */
136#define CAN1_TIMING 0xffc03284 /* CAN Controller 1 Timing Register */
137#define CAN1_DEBUG 0xffc03288 /* CAN Controller 1 Debug Register */
138#define CAN1_STATUS 0xffc0328c /* CAN Controller 1 Global Status Register */
139#define CAN1_CEC 0xffc03290 /* CAN Controller 1 Error Counter Register */
140#define CAN1_GIS 0xffc03294 /* CAN Controller 1 Global Interrupt Status Register */
141#define CAN1_GIM 0xffc03298 /* CAN Controller 1 Global Interrupt Mask Register */
142#define CAN1_GIF 0xffc0329c /* CAN Controller 1 Global Interrupt Flag Register */
143#define CAN1_CONTROL 0xffc032a0 /* CAN Controller 1 Master Control Register */
144#define CAN1_INTR 0xffc032a4 /* CAN Controller 1 Interrupt Pending Register */
145#define CAN1_MBTD 0xffc032ac /* CAN Controller 1 Mailbox Temporary Disable Register */
146#define CAN1_EWR 0xffc032b0 /* CAN Controller 1 Programmable Warning Level Register */
147#define CAN1_ESR 0xffc032b4 /* CAN Controller 1 Error Status Register */
148#define CAN1_UCCNT 0xffc032c4 /* CAN Controller 1 Universal Counter Register */
149#define CAN1_UCRC 0xffc032c8 /* CAN Controller 1 Universal Counter Force Reload Register */
150#define CAN1_UCCNF 0xffc032cc /* CAN Controller 1 Universal Counter Configuration Register */
151
152/* CAN Controller 1 Mailbox Acceptance Registers */
153
154#define CAN1_AM00L 0xffc03300 /* CAN Controller 1 Mailbox 0 Acceptance Mask High Register */
155#define CAN1_AM00H 0xffc03304 /* CAN Controller 1 Mailbox 0 Acceptance Mask Low Register */
156#define CAN1_AM01L 0xffc03308 /* CAN Controller 1 Mailbox 1 Acceptance Mask High Register */
157#define CAN1_AM01H 0xffc0330c /* CAN Controller 1 Mailbox 1 Acceptance Mask Low Register */
158#define CAN1_AM02L 0xffc03310 /* CAN Controller 1 Mailbox 2 Acceptance Mask High Register */
159#define CAN1_AM02H 0xffc03314 /* CAN Controller 1 Mailbox 2 Acceptance Mask Low Register */
160#define CAN1_AM03L 0xffc03318 /* CAN Controller 1 Mailbox 3 Acceptance Mask High Register */
161#define CAN1_AM03H 0xffc0331c /* CAN Controller 1 Mailbox 3 Acceptance Mask Low Register */
162#define CAN1_AM04L 0xffc03320 /* CAN Controller 1 Mailbox 4 Acceptance Mask High Register */
163#define CAN1_AM04H 0xffc03324 /* CAN Controller 1 Mailbox 4 Acceptance Mask Low Register */
164#define CAN1_AM05L 0xffc03328 /* CAN Controller 1 Mailbox 5 Acceptance Mask High Register */
165#define CAN1_AM05H 0xffc0332c /* CAN Controller 1 Mailbox 5 Acceptance Mask Low Register */
166#define CAN1_AM06L 0xffc03330 /* CAN Controller 1 Mailbox 6 Acceptance Mask High Register */
167#define CAN1_AM06H 0xffc03334 /* CAN Controller 1 Mailbox 6 Acceptance Mask Low Register */
168#define CAN1_AM07L 0xffc03338 /* CAN Controller 1 Mailbox 7 Acceptance Mask High Register */
169#define CAN1_AM07H 0xffc0333c /* CAN Controller 1 Mailbox 7 Acceptance Mask Low Register */
170#define CAN1_AM08L 0xffc03340 /* CAN Controller 1 Mailbox 8 Acceptance Mask High Register */
171#define CAN1_AM08H 0xffc03344 /* CAN Controller 1 Mailbox 8 Acceptance Mask Low Register */
172#define CAN1_AM09L 0xffc03348 /* CAN Controller 1 Mailbox 9 Acceptance Mask High Register */
173#define CAN1_AM09H 0xffc0334c /* CAN Controller 1 Mailbox 9 Acceptance Mask Low Register */
174#define CAN1_AM10L 0xffc03350 /* CAN Controller 1 Mailbox 10 Acceptance Mask High Register */
175#define CAN1_AM10H 0xffc03354 /* CAN Controller 1 Mailbox 10 Acceptance Mask Low Register */
176#define CAN1_AM11L 0xffc03358 /* CAN Controller 1 Mailbox 11 Acceptance Mask High Register */
177#define CAN1_AM11H 0xffc0335c /* CAN Controller 1 Mailbox 11 Acceptance Mask Low Register */
178#define CAN1_AM12L 0xffc03360 /* CAN Controller 1 Mailbox 12 Acceptance Mask High Register */
179#define CAN1_AM12H 0xffc03364 /* CAN Controller 1 Mailbox 12 Acceptance Mask Low Register */
180#define CAN1_AM13L 0xffc03368 /* CAN Controller 1 Mailbox 13 Acceptance Mask High Register */
181#define CAN1_AM13H 0xffc0336c /* CAN Controller 1 Mailbox 13 Acceptance Mask Low Register */
182#define CAN1_AM14L 0xffc03370 /* CAN Controller 1 Mailbox 14 Acceptance Mask High Register */
183#define CAN1_AM14H 0xffc03374 /* CAN Controller 1 Mailbox 14 Acceptance Mask Low Register */
184#define CAN1_AM15L 0xffc03378 /* CAN Controller 1 Mailbox 15 Acceptance Mask High Register */
185#define CAN1_AM15H 0xffc0337c /* CAN Controller 1 Mailbox 15 Acceptance Mask Low Register */
186
187/* CAN Controller 1 Mailbox Acceptance Registers */
188
189#define CAN1_AM16L 0xffc03380 /* CAN Controller 1 Mailbox 16 Acceptance Mask High Register */
190#define CAN1_AM16H 0xffc03384 /* CAN Controller 1 Mailbox 16 Acceptance Mask Low Register */
191#define CAN1_AM17L 0xffc03388 /* CAN Controller 1 Mailbox 17 Acceptance Mask High Register */
192#define CAN1_AM17H 0xffc0338c /* CAN Controller 1 Mailbox 17 Acceptance Mask Low Register */
193#define CAN1_AM18L 0xffc03390 /* CAN Controller 1 Mailbox 18 Acceptance Mask High Register */
194#define CAN1_AM18H 0xffc03394 /* CAN Controller 1 Mailbox 18 Acceptance Mask Low Register */
195#define CAN1_AM19L 0xffc03398 /* CAN Controller 1 Mailbox 19 Acceptance Mask High Register */
196#define CAN1_AM19H 0xffc0339c /* CAN Controller 1 Mailbox 19 Acceptance Mask Low Register */
197#define CAN1_AM20L 0xffc033a0 /* CAN Controller 1 Mailbox 20 Acceptance Mask High Register */
198#define CAN1_AM20H 0xffc033a4 /* CAN Controller 1 Mailbox 20 Acceptance Mask Low Register */
199#define CAN1_AM21L 0xffc033a8 /* CAN Controller 1 Mailbox 21 Acceptance Mask High Register */
200#define CAN1_AM21H 0xffc033ac /* CAN Controller 1 Mailbox 21 Acceptance Mask Low Register */
201#define CAN1_AM22L 0xffc033b0 /* CAN Controller 1 Mailbox 22 Acceptance Mask High Register */
202#define CAN1_AM22H 0xffc033b4 /* CAN Controller 1 Mailbox 22 Acceptance Mask Low Register */
203#define CAN1_AM23L 0xffc033b8 /* CAN Controller 1 Mailbox 23 Acceptance Mask High Register */
204#define CAN1_AM23H 0xffc033bc /* CAN Controller 1 Mailbox 23 Acceptance Mask Low Register */
205#define CAN1_AM24L 0xffc033c0 /* CAN Controller 1 Mailbox 24 Acceptance Mask High Register */
206#define CAN1_AM24H 0xffc033c4 /* CAN Controller 1 Mailbox 24 Acceptance Mask Low Register */
207#define CAN1_AM25L 0xffc033c8 /* CAN Controller 1 Mailbox 25 Acceptance Mask High Register */
208#define CAN1_AM25H 0xffc033cc /* CAN Controller 1 Mailbox 25 Acceptance Mask Low Register */
209#define CAN1_AM26L 0xffc033d0 /* CAN Controller 1 Mailbox 26 Acceptance Mask High Register */
210#define CAN1_AM26H 0xffc033d4 /* CAN Controller 1 Mailbox 26 Acceptance Mask Low Register */
211#define CAN1_AM27L 0xffc033d8 /* CAN Controller 1 Mailbox 27 Acceptance Mask High Register */
212#define CAN1_AM27H 0xffc033dc /* CAN Controller 1 Mailbox 27 Acceptance Mask Low Register */
213#define CAN1_AM28L 0xffc033e0 /* CAN Controller 1 Mailbox 28 Acceptance Mask High Register */
214#define CAN1_AM28H 0xffc033e4 /* CAN Controller 1 Mailbox 28 Acceptance Mask Low Register */
215#define CAN1_AM29L 0xffc033e8 /* CAN Controller 1 Mailbox 29 Acceptance Mask High Register */
216#define CAN1_AM29H 0xffc033ec /* CAN Controller 1 Mailbox 29 Acceptance Mask Low Register */
217#define CAN1_AM30L 0xffc033f0 /* CAN Controller 1 Mailbox 30 Acceptance Mask High Register */
218#define CAN1_AM30H 0xffc033f4 /* CAN Controller 1 Mailbox 30 Acceptance Mask Low Register */
219#define CAN1_AM31L 0xffc033f8 /* CAN Controller 1 Mailbox 31 Acceptance Mask High Register */
220#define CAN1_AM31H 0xffc033fc /* CAN Controller 1 Mailbox 31 Acceptance Mask Low Register */
221
222/* CAN Controller 1 Mailbox Data Registers */
223
224#define CAN1_MB00_DATA0 0xffc03400 /* CAN Controller 1 Mailbox 0 Data 0 Register */
225#define CAN1_MB00_DATA1 0xffc03404 /* CAN Controller 1 Mailbox 0 Data 1 Register */
226#define CAN1_MB00_DATA2 0xffc03408 /* CAN Controller 1 Mailbox 0 Data 2 Register */
227#define CAN1_MB00_DATA3 0xffc0340c /* CAN Controller 1 Mailbox 0 Data 3 Register */
228#define CAN1_MB00_LENGTH 0xffc03410 /* CAN Controller 1 Mailbox 0 Length Register */
229#define CAN1_MB00_TIMESTAMP 0xffc03414 /* CAN Controller 1 Mailbox 0 Timestamp Register */
230#define CAN1_MB00_ID0 0xffc03418 /* CAN Controller 1 Mailbox 0 ID0 Register */
231#define CAN1_MB00_ID1 0xffc0341c /* CAN Controller 1 Mailbox 0 ID1 Register */
232#define CAN1_MB01_DATA0 0xffc03420 /* CAN Controller 1 Mailbox 1 Data 0 Register */
233#define CAN1_MB01_DATA1 0xffc03424 /* CAN Controller 1 Mailbox 1 Data 1 Register */
234#define CAN1_MB01_DATA2 0xffc03428 /* CAN Controller 1 Mailbox 1 Data 2 Register */
235#define CAN1_MB01_DATA3 0xffc0342c /* CAN Controller 1 Mailbox 1 Data 3 Register */
236#define CAN1_MB01_LENGTH 0xffc03430 /* CAN Controller 1 Mailbox 1 Length Register */
237#define CAN1_MB01_TIMESTAMP 0xffc03434 /* CAN Controller 1 Mailbox 1 Timestamp Register */
238#define CAN1_MB01_ID0 0xffc03438 /* CAN Controller 1 Mailbox 1 ID0 Register */
239#define CAN1_MB01_ID1 0xffc0343c /* CAN Controller 1 Mailbox 1 ID1 Register */
240#define CAN1_MB02_DATA0 0xffc03440 /* CAN Controller 1 Mailbox 2 Data 0 Register */
241#define CAN1_MB02_DATA1 0xffc03444 /* CAN Controller 1 Mailbox 2 Data 1 Register */
242#define CAN1_MB02_DATA2 0xffc03448 /* CAN Controller 1 Mailbox 2 Data 2 Register */
243#define CAN1_MB02_DATA3 0xffc0344c /* CAN Controller 1 Mailbox 2 Data 3 Register */
244#define CAN1_MB02_LENGTH 0xffc03450 /* CAN Controller 1 Mailbox 2 Length Register */
245#define CAN1_MB02_TIMESTAMP 0xffc03454 /* CAN Controller 1 Mailbox 2 Timestamp Register */
246#define CAN1_MB02_ID0 0xffc03458 /* CAN Controller 1 Mailbox 2 ID0 Register */
247#define CAN1_MB02_ID1 0xffc0345c /* CAN Controller 1 Mailbox 2 ID1 Register */
248#define CAN1_MB03_DATA0 0xffc03460 /* CAN Controller 1 Mailbox 3 Data 0 Register */
249#define CAN1_MB03_DATA1 0xffc03464 /* CAN Controller 1 Mailbox 3 Data 1 Register */
250#define CAN1_MB03_DATA2 0xffc03468 /* CAN Controller 1 Mailbox 3 Data 2 Register */
251#define CAN1_MB03_DATA3 0xffc0346c /* CAN Controller 1 Mailbox 3 Data 3 Register */
252#define CAN1_MB03_LENGTH 0xffc03470 /* CAN Controller 1 Mailbox 3 Length Register */
253#define CAN1_MB03_TIMESTAMP 0xffc03474 /* CAN Controller 1 Mailbox 3 Timestamp Register */
254#define CAN1_MB03_ID0 0xffc03478 /* CAN Controller 1 Mailbox 3 ID0 Register */
255#define CAN1_MB03_ID1 0xffc0347c /* CAN Controller 1 Mailbox 3 ID1 Register */
256#define CAN1_MB04_DATA0 0xffc03480 /* CAN Controller 1 Mailbox 4 Data 0 Register */
257#define CAN1_MB04_DATA1 0xffc03484 /* CAN Controller 1 Mailbox 4 Data 1 Register */
258#define CAN1_MB04_DATA2 0xffc03488 /* CAN Controller 1 Mailbox 4 Data 2 Register */
259#define CAN1_MB04_DATA3 0xffc0348c /* CAN Controller 1 Mailbox 4 Data 3 Register */
260#define CAN1_MB04_LENGTH 0xffc03490 /* CAN Controller 1 Mailbox 4 Length Register */
261#define CAN1_MB04_TIMESTAMP 0xffc03494 /* CAN Controller 1 Mailbox 4 Timestamp Register */
262#define CAN1_MB04_ID0 0xffc03498 /* CAN Controller 1 Mailbox 4 ID0 Register */
263#define CAN1_MB04_ID1 0xffc0349c /* CAN Controller 1 Mailbox 4 ID1 Register */
264#define CAN1_MB05_DATA0 0xffc034a0 /* CAN Controller 1 Mailbox 5 Data 0 Register */
265#define CAN1_MB05_DATA1 0xffc034a4 /* CAN Controller 1 Mailbox 5 Data 1 Register */
266#define CAN1_MB05_DATA2 0xffc034a8 /* CAN Controller 1 Mailbox 5 Data 2 Register */
267#define CAN1_MB05_DATA3 0xffc034ac /* CAN Controller 1 Mailbox 5 Data 3 Register */
268#define CAN1_MB05_LENGTH 0xffc034b0 /* CAN Controller 1 Mailbox 5 Length Register */
269#define CAN1_MB05_TIMESTAMP 0xffc034b4 /* CAN Controller 1 Mailbox 5 Timestamp Register */
270#define CAN1_MB05_ID0 0xffc034b8 /* CAN Controller 1 Mailbox 5 ID0 Register */
271#define CAN1_MB05_ID1 0xffc034bc /* CAN Controller 1 Mailbox 5 ID1 Register */
272#define CAN1_MB06_DATA0 0xffc034c0 /* CAN Controller 1 Mailbox 6 Data 0 Register */
273#define CAN1_MB06_DATA1 0xffc034c4 /* CAN Controller 1 Mailbox 6 Data 1 Register */
274#define CAN1_MB06_DATA2 0xffc034c8 /* CAN Controller 1 Mailbox 6 Data 2 Register */
275#define CAN1_MB06_DATA3 0xffc034cc /* CAN Controller 1 Mailbox 6 Data 3 Register */
276#define CAN1_MB06_LENGTH 0xffc034d0 /* CAN Controller 1 Mailbox 6 Length Register */
277#define CAN1_MB06_TIMESTAMP 0xffc034d4 /* CAN Controller 1 Mailbox 6 Timestamp Register */
278#define CAN1_MB06_ID0 0xffc034d8 /* CAN Controller 1 Mailbox 6 ID0 Register */
279#define CAN1_MB06_ID1 0xffc034dc /* CAN Controller 1 Mailbox 6 ID1 Register */
280#define CAN1_MB07_DATA0 0xffc034e0 /* CAN Controller 1 Mailbox 7 Data 0 Register */
281#define CAN1_MB07_DATA1 0xffc034e4 /* CAN Controller 1 Mailbox 7 Data 1 Register */
282#define CAN1_MB07_DATA2 0xffc034e8 /* CAN Controller 1 Mailbox 7 Data 2 Register */
283#define CAN1_MB07_DATA3 0xffc034ec /* CAN Controller 1 Mailbox 7 Data 3 Register */
284#define CAN1_MB07_LENGTH 0xffc034f0 /* CAN Controller 1 Mailbox 7 Length Register */
285#define CAN1_MB07_TIMESTAMP 0xffc034f4 /* CAN Controller 1 Mailbox 7 Timestamp Register */
286#define CAN1_MB07_ID0 0xffc034f8 /* CAN Controller 1 Mailbox 7 ID0 Register */
287#define CAN1_MB07_ID1 0xffc034fc /* CAN Controller 1 Mailbox 7 ID1 Register */
288#define CAN1_MB08_DATA0 0xffc03500 /* CAN Controller 1 Mailbox 8 Data 0 Register */
289#define CAN1_MB08_DATA1 0xffc03504 /* CAN Controller 1 Mailbox 8 Data 1 Register */
290#define CAN1_MB08_DATA2 0xffc03508 /* CAN Controller 1 Mailbox 8 Data 2 Register */
291#define CAN1_MB08_DATA3 0xffc0350c /* CAN Controller 1 Mailbox 8 Data 3 Register */
292#define CAN1_MB08_LENGTH 0xffc03510 /* CAN Controller 1 Mailbox 8 Length Register */
293#define CAN1_MB08_TIMESTAMP 0xffc03514 /* CAN Controller 1 Mailbox 8 Timestamp Register */
294#define CAN1_MB08_ID0 0xffc03518 /* CAN Controller 1 Mailbox 8 ID0 Register */
295#define CAN1_MB08_ID1 0xffc0351c /* CAN Controller 1 Mailbox 8 ID1 Register */
296#define CAN1_MB09_DATA0 0xffc03520 /* CAN Controller 1 Mailbox 9 Data 0 Register */
297#define CAN1_MB09_DATA1 0xffc03524 /* CAN Controller 1 Mailbox 9 Data 1 Register */
298#define CAN1_MB09_DATA2 0xffc03528 /* CAN Controller 1 Mailbox 9 Data 2 Register */
299#define CAN1_MB09_DATA3 0xffc0352c /* CAN Controller 1 Mailbox 9 Data 3 Register */
300#define CAN1_MB09_LENGTH 0xffc03530 /* CAN Controller 1 Mailbox 9 Length Register */
301#define CAN1_MB09_TIMESTAMP 0xffc03534 /* CAN Controller 1 Mailbox 9 Timestamp Register */
302#define CAN1_MB09_ID0 0xffc03538 /* CAN Controller 1 Mailbox 9 ID0 Register */
303#define CAN1_MB09_ID1 0xffc0353c /* CAN Controller 1 Mailbox 9 ID1 Register */
304#define CAN1_MB10_DATA0 0xffc03540 /* CAN Controller 1 Mailbox 10 Data 0 Register */
305#define CAN1_MB10_DATA1 0xffc03544 /* CAN Controller 1 Mailbox 10 Data 1 Register */
306#define CAN1_MB10_DATA2 0xffc03548 /* CAN Controller 1 Mailbox 10 Data 2 Register */
307#define CAN1_MB10_DATA3 0xffc0354c /* CAN Controller 1 Mailbox 10 Data 3 Register */
308#define CAN1_MB10_LENGTH 0xffc03550 /* CAN Controller 1 Mailbox 10 Length Register */
309#define CAN1_MB10_TIMESTAMP 0xffc03554 /* CAN Controller 1 Mailbox 10 Timestamp Register */
310#define CAN1_MB10_ID0 0xffc03558 /* CAN Controller 1 Mailbox 10 ID0 Register */
311#define CAN1_MB10_ID1 0xffc0355c /* CAN Controller 1 Mailbox 10 ID1 Register */
312#define CAN1_MB11_DATA0 0xffc03560 /* CAN Controller 1 Mailbox 11 Data 0 Register */
313#define CAN1_MB11_DATA1 0xffc03564 /* CAN Controller 1 Mailbox 11 Data 1 Register */
314#define CAN1_MB11_DATA2 0xffc03568 /* CAN Controller 1 Mailbox 11 Data 2 Register */
315#define CAN1_MB11_DATA3 0xffc0356c /* CAN Controller 1 Mailbox 11 Data 3 Register */
316#define CAN1_MB11_LENGTH 0xffc03570 /* CAN Controller 1 Mailbox 11 Length Register */
317#define CAN1_MB11_TIMESTAMP 0xffc03574 /* CAN Controller 1 Mailbox 11 Timestamp Register */
318#define CAN1_MB11_ID0 0xffc03578 /* CAN Controller 1 Mailbox 11 ID0 Register */
319#define CAN1_MB11_ID1 0xffc0357c /* CAN Controller 1 Mailbox 11 ID1 Register */
320#define CAN1_MB12_DATA0 0xffc03580 /* CAN Controller 1 Mailbox 12 Data 0 Register */
321#define CAN1_MB12_DATA1 0xffc03584 /* CAN Controller 1 Mailbox 12 Data 1 Register */
322#define CAN1_MB12_DATA2 0xffc03588 /* CAN Controller 1 Mailbox 12 Data 2 Register */
323#define CAN1_MB12_DATA3 0xffc0358c /* CAN Controller 1 Mailbox 12 Data 3 Register */
324#define CAN1_MB12_LENGTH 0xffc03590 /* CAN Controller 1 Mailbox 12 Length Register */
325#define CAN1_MB12_TIMESTAMP 0xffc03594 /* CAN Controller 1 Mailbox 12 Timestamp Register */
326#define CAN1_MB12_ID0 0xffc03598 /* CAN Controller 1 Mailbox 12 ID0 Register */
327#define CAN1_MB12_ID1 0xffc0359c /* CAN Controller 1 Mailbox 12 ID1 Register */
328#define CAN1_MB13_DATA0 0xffc035a0 /* CAN Controller 1 Mailbox 13 Data 0 Register */
329#define CAN1_MB13_DATA1 0xffc035a4 /* CAN Controller 1 Mailbox 13 Data 1 Register */
330#define CAN1_MB13_DATA2 0xffc035a8 /* CAN Controller 1 Mailbox 13 Data 2 Register */
331#define CAN1_MB13_DATA3 0xffc035ac /* CAN Controller 1 Mailbox 13 Data 3 Register */
332#define CAN1_MB13_LENGTH 0xffc035b0 /* CAN Controller 1 Mailbox 13 Length Register */
333#define CAN1_MB13_TIMESTAMP 0xffc035b4 /* CAN Controller 1 Mailbox 13 Timestamp Register */
334#define CAN1_MB13_ID0 0xffc035b8 /* CAN Controller 1 Mailbox 13 ID0 Register */
335#define CAN1_MB13_ID1 0xffc035bc /* CAN Controller 1 Mailbox 13 ID1 Register */
336#define CAN1_MB14_DATA0 0xffc035c0 /* CAN Controller 1 Mailbox 14 Data 0 Register */
337#define CAN1_MB14_DATA1 0xffc035c4 /* CAN Controller 1 Mailbox 14 Data 1 Register */
338#define CAN1_MB14_DATA2 0xffc035c8 /* CAN Controller 1 Mailbox 14 Data 2 Register */
339#define CAN1_MB14_DATA3 0xffc035cc /* CAN Controller 1 Mailbox 14 Data 3 Register */
340#define CAN1_MB14_LENGTH 0xffc035d0 /* CAN Controller 1 Mailbox 14 Length Register */
341#define CAN1_MB14_TIMESTAMP 0xffc035d4 /* CAN Controller 1 Mailbox 14 Timestamp Register */
342#define CAN1_MB14_ID0 0xffc035d8 /* CAN Controller 1 Mailbox 14 ID0 Register */
343#define CAN1_MB14_ID1 0xffc035dc /* CAN Controller 1 Mailbox 14 ID1 Register */
344#define CAN1_MB15_DATA0 0xffc035e0 /* CAN Controller 1 Mailbox 15 Data 0 Register */
345#define CAN1_MB15_DATA1 0xffc035e4 /* CAN Controller 1 Mailbox 15 Data 1 Register */
346#define CAN1_MB15_DATA2 0xffc035e8 /* CAN Controller 1 Mailbox 15 Data 2 Register */
347#define CAN1_MB15_DATA3 0xffc035ec /* CAN Controller 1 Mailbox 15 Data 3 Register */
348#define CAN1_MB15_LENGTH 0xffc035f0 /* CAN Controller 1 Mailbox 15 Length Register */
349#define CAN1_MB15_TIMESTAMP 0xffc035f4 /* CAN Controller 1 Mailbox 15 Timestamp Register */
350#define CAN1_MB15_ID0 0xffc035f8 /* CAN Controller 1 Mailbox 15 ID0 Register */
351#define CAN1_MB15_ID1 0xffc035fc /* CAN Controller 1 Mailbox 15 ID1 Register */
352
353/* CAN Controller 1 Mailbox Data Registers */
354
355#define CAN1_MB16_DATA0 0xffc03600 /* CAN Controller 1 Mailbox 16 Data 0 Register */
356#define CAN1_MB16_DATA1 0xffc03604 /* CAN Controller 1 Mailbox 16 Data 1 Register */
357#define CAN1_MB16_DATA2 0xffc03608 /* CAN Controller 1 Mailbox 16 Data 2 Register */
358#define CAN1_MB16_DATA3 0xffc0360c /* CAN Controller 1 Mailbox 16 Data 3 Register */
359#define CAN1_MB16_LENGTH 0xffc03610 /* CAN Controller 1 Mailbox 16 Length Register */
360#define CAN1_MB16_TIMESTAMP 0xffc03614 /* CAN Controller 1 Mailbox 16 Timestamp Register */
361#define CAN1_MB16_ID0 0xffc03618 /* CAN Controller 1 Mailbox 16 ID0 Register */
362#define CAN1_MB16_ID1 0xffc0361c /* CAN Controller 1 Mailbox 16 ID1 Register */
363#define CAN1_MB17_DATA0 0xffc03620 /* CAN Controller 1 Mailbox 17 Data 0 Register */
364#define CAN1_MB17_DATA1 0xffc03624 /* CAN Controller 1 Mailbox 17 Data 1 Register */
365#define CAN1_MB17_DATA2 0xffc03628 /* CAN Controller 1 Mailbox 17 Data 2 Register */
366#define CAN1_MB17_DATA3 0xffc0362c /* CAN Controller 1 Mailbox 17 Data 3 Register */
367#define CAN1_MB17_LENGTH 0xffc03630 /* CAN Controller 1 Mailbox 17 Length Register */
368#define CAN1_MB17_TIMESTAMP 0xffc03634 /* CAN Controller 1 Mailbox 17 Timestamp Register */
369#define CAN1_MB17_ID0 0xffc03638 /* CAN Controller 1 Mailbox 17 ID0 Register */
370#define CAN1_MB17_ID1 0xffc0363c /* CAN Controller 1 Mailbox 17 ID1 Register */
371#define CAN1_MB18_DATA0 0xffc03640 /* CAN Controller 1 Mailbox 18 Data 0 Register */
372#define CAN1_MB18_DATA1 0xffc03644 /* CAN Controller 1 Mailbox 18 Data 1 Register */
373#define CAN1_MB18_DATA2 0xffc03648 /* CAN Controller 1 Mailbox 18 Data 2 Register */
374#define CAN1_MB18_DATA3 0xffc0364c /* CAN Controller 1 Mailbox 18 Data 3 Register */
375#define CAN1_MB18_LENGTH 0xffc03650 /* CAN Controller 1 Mailbox 18 Length Register */
376#define CAN1_MB18_TIMESTAMP 0xffc03654 /* CAN Controller 1 Mailbox 18 Timestamp Register */
377#define CAN1_MB18_ID0 0xffc03658 /* CAN Controller 1 Mailbox 18 ID0 Register */
378#define CAN1_MB18_ID1 0xffc0365c /* CAN Controller 1 Mailbox 18 ID1 Register */
379#define CAN1_MB19_DATA0 0xffc03660 /* CAN Controller 1 Mailbox 19 Data 0 Register */
380#define CAN1_MB19_DATA1 0xffc03664 /* CAN Controller 1 Mailbox 19 Data 1 Register */
381#define CAN1_MB19_DATA2 0xffc03668 /* CAN Controller 1 Mailbox 19 Data 2 Register */
382#define CAN1_MB19_DATA3 0xffc0366c /* CAN Controller 1 Mailbox 19 Data 3 Register */
383#define CAN1_MB19_LENGTH 0xffc03670 /* CAN Controller 1 Mailbox 19 Length Register */
384#define CAN1_MB19_TIMESTAMP 0xffc03674 /* CAN Controller 1 Mailbox 19 Timestamp Register */
385#define CAN1_MB19_ID0 0xffc03678 /* CAN Controller 1 Mailbox 19 ID0 Register */
386#define CAN1_MB19_ID1 0xffc0367c /* CAN Controller 1 Mailbox 19 ID1 Register */
387#define CAN1_MB20_DATA0 0xffc03680 /* CAN Controller 1 Mailbox 20 Data 0 Register */
388#define CAN1_MB20_DATA1 0xffc03684 /* CAN Controller 1 Mailbox 20 Data 1 Register */
389#define CAN1_MB20_DATA2 0xffc03688 /* CAN Controller 1 Mailbox 20 Data 2 Register */
390#define CAN1_MB20_DATA3 0xffc0368c /* CAN Controller 1 Mailbox 20 Data 3 Register */
391#define CAN1_MB20_LENGTH 0xffc03690 /* CAN Controller 1 Mailbox 20 Length Register */
392#define CAN1_MB20_TIMESTAMP 0xffc03694 /* CAN Controller 1 Mailbox 20 Timestamp Register */
393#define CAN1_MB20_ID0 0xffc03698 /* CAN Controller 1 Mailbox 20 ID0 Register */
394#define CAN1_MB20_ID1 0xffc0369c /* CAN Controller 1 Mailbox 20 ID1 Register */
395#define CAN1_MB21_DATA0 0xffc036a0 /* CAN Controller 1 Mailbox 21 Data 0 Register */
396#define CAN1_MB21_DATA1 0xffc036a4 /* CAN Controller 1 Mailbox 21 Data 1 Register */
397#define CAN1_MB21_DATA2 0xffc036a8 /* CAN Controller 1 Mailbox 21 Data 2 Register */
398#define CAN1_MB21_DATA3 0xffc036ac /* CAN Controller 1 Mailbox 21 Data 3 Register */
399#define CAN1_MB21_LENGTH 0xffc036b0 /* CAN Controller 1 Mailbox 21 Length Register */
400#define CAN1_MB21_TIMESTAMP 0xffc036b4 /* CAN Controller 1 Mailbox 21 Timestamp Register */
401#define CAN1_MB21_ID0 0xffc036b8 /* CAN Controller 1 Mailbox 21 ID0 Register */
402#define CAN1_MB21_ID1 0xffc036bc /* CAN Controller 1 Mailbox 21 ID1 Register */
403#define CAN1_MB22_DATA0 0xffc036c0 /* CAN Controller 1 Mailbox 22 Data 0 Register */
404#define CAN1_MB22_DATA1 0xffc036c4 /* CAN Controller 1 Mailbox 22 Data 1 Register */
405#define CAN1_MB22_DATA2 0xffc036c8 /* CAN Controller 1 Mailbox 22 Data 2 Register */
406#define CAN1_MB22_DATA3 0xffc036cc /* CAN Controller 1 Mailbox 22 Data 3 Register */
407#define CAN1_MB22_LENGTH 0xffc036d0 /* CAN Controller 1 Mailbox 22 Length Register */
408#define CAN1_MB22_TIMESTAMP 0xffc036d4 /* CAN Controller 1 Mailbox 22 Timestamp Register */
409#define CAN1_MB22_ID0 0xffc036d8 /* CAN Controller 1 Mailbox 22 ID0 Register */
410#define CAN1_MB22_ID1 0xffc036dc /* CAN Controller 1 Mailbox 22 ID1 Register */
411#define CAN1_MB23_DATA0 0xffc036e0 /* CAN Controller 1 Mailbox 23 Data 0 Register */
412#define CAN1_MB23_DATA1 0xffc036e4 /* CAN Controller 1 Mailbox 23 Data 1 Register */
413#define CAN1_MB23_DATA2 0xffc036e8 /* CAN Controller 1 Mailbox 23 Data 2 Register */
414#define CAN1_MB23_DATA3 0xffc036ec /* CAN Controller 1 Mailbox 23 Data 3 Register */
415#define CAN1_MB23_LENGTH 0xffc036f0 /* CAN Controller 1 Mailbox 23 Length Register */
416#define CAN1_MB23_TIMESTAMP 0xffc036f4 /* CAN Controller 1 Mailbox 23 Timestamp Register */
417#define CAN1_MB23_ID0 0xffc036f8 /* CAN Controller 1 Mailbox 23 ID0 Register */
418#define CAN1_MB23_ID1 0xffc036fc /* CAN Controller 1 Mailbox 23 ID1 Register */
419#define CAN1_MB24_DATA0 0xffc03700 /* CAN Controller 1 Mailbox 24 Data 0 Register */
420#define CAN1_MB24_DATA1 0xffc03704 /* CAN Controller 1 Mailbox 24 Data 1 Register */
421#define CAN1_MB24_DATA2 0xffc03708 /* CAN Controller 1 Mailbox 24 Data 2 Register */
422#define CAN1_MB24_DATA3 0xffc0370c /* CAN Controller 1 Mailbox 24 Data 3 Register */
423#define CAN1_MB24_LENGTH 0xffc03710 /* CAN Controller 1 Mailbox 24 Length Register */
424#define CAN1_MB24_TIMESTAMP 0xffc03714 /* CAN Controller 1 Mailbox 24 Timestamp Register */
425#define CAN1_MB24_ID0 0xffc03718 /* CAN Controller 1 Mailbox 24 ID0 Register */
426#define CAN1_MB24_ID1 0xffc0371c /* CAN Controller 1 Mailbox 24 ID1 Register */
427#define CAN1_MB25_DATA0 0xffc03720 /* CAN Controller 1 Mailbox 25 Data 0 Register */
428#define CAN1_MB25_DATA1 0xffc03724 /* CAN Controller 1 Mailbox 25 Data 1 Register */
429#define CAN1_MB25_DATA2 0xffc03728 /* CAN Controller 1 Mailbox 25 Data 2 Register */
430#define CAN1_MB25_DATA3 0xffc0372c /* CAN Controller 1 Mailbox 25 Data 3 Register */
431#define CAN1_MB25_LENGTH 0xffc03730 /* CAN Controller 1 Mailbox 25 Length Register */
432#define CAN1_MB25_TIMESTAMP 0xffc03734 /* CAN Controller 1 Mailbox 25 Timestamp Register */
433#define CAN1_MB25_ID0 0xffc03738 /* CAN Controller 1 Mailbox 25 ID0 Register */
434#define CAN1_MB25_ID1 0xffc0373c /* CAN Controller 1 Mailbox 25 ID1 Register */
435#define CAN1_MB26_DATA0 0xffc03740 /* CAN Controller 1 Mailbox 26 Data 0 Register */
436#define CAN1_MB26_DATA1 0xffc03744 /* CAN Controller 1 Mailbox 26 Data 1 Register */
437#define CAN1_MB26_DATA2 0xffc03748 /* CAN Controller 1 Mailbox 26 Data 2 Register */
438#define CAN1_MB26_DATA3 0xffc0374c /* CAN Controller 1 Mailbox 26 Data 3 Register */
439#define CAN1_MB26_LENGTH 0xffc03750 /* CAN Controller 1 Mailbox 26 Length Register */
440#define CAN1_MB26_TIMESTAMP 0xffc03754 /* CAN Controller 1 Mailbox 26 Timestamp Register */
441#define CAN1_MB26_ID0 0xffc03758 /* CAN Controller 1 Mailbox 26 ID0 Register */
442#define CAN1_MB26_ID1 0xffc0375c /* CAN Controller 1 Mailbox 26 ID1 Register */
443#define CAN1_MB27_DATA0 0xffc03760 /* CAN Controller 1 Mailbox 27 Data 0 Register */
444#define CAN1_MB27_DATA1 0xffc03764 /* CAN Controller 1 Mailbox 27 Data 1 Register */
445#define CAN1_MB27_DATA2 0xffc03768 /* CAN Controller 1 Mailbox 27 Data 2 Register */
446#define CAN1_MB27_DATA3 0xffc0376c /* CAN Controller 1 Mailbox 27 Data 3 Register */
447#define CAN1_MB27_LENGTH 0xffc03770 /* CAN Controller 1 Mailbox 27 Length Register */
448#define CAN1_MB27_TIMESTAMP 0xffc03774 /* CAN Controller 1 Mailbox 27 Timestamp Register */
449#define CAN1_MB27_ID0 0xffc03778 /* CAN Controller 1 Mailbox 27 ID0 Register */
450#define CAN1_MB27_ID1 0xffc0377c /* CAN Controller 1 Mailbox 27 ID1 Register */
451#define CAN1_MB28_DATA0 0xffc03780 /* CAN Controller 1 Mailbox 28 Data 0 Register */
452#define CAN1_MB28_DATA1 0xffc03784 /* CAN Controller 1 Mailbox 28 Data 1 Register */
453#define CAN1_MB28_DATA2 0xffc03788 /* CAN Controller 1 Mailbox 28 Data 2 Register */
454#define CAN1_MB28_DATA3 0xffc0378c /* CAN Controller 1 Mailbox 28 Data 3 Register */
455#define CAN1_MB28_LENGTH 0xffc03790 /* CAN Controller 1 Mailbox 28 Length Register */
456#define CAN1_MB28_TIMESTAMP 0xffc03794 /* CAN Controller 1 Mailbox 28 Timestamp Register */
457#define CAN1_MB28_ID0 0xffc03798 /* CAN Controller 1 Mailbox 28 ID0 Register */
458#define CAN1_MB28_ID1 0xffc0379c /* CAN Controller 1 Mailbox 28 ID1 Register */
459#define CAN1_MB29_DATA0 0xffc037a0 /* CAN Controller 1 Mailbox 29 Data 0 Register */
460#define CAN1_MB29_DATA1 0xffc037a4 /* CAN Controller 1 Mailbox 29 Data 1 Register */
461#define CAN1_MB29_DATA2 0xffc037a8 /* CAN Controller 1 Mailbox 29 Data 2 Register */
462#define CAN1_MB29_DATA3 0xffc037ac /* CAN Controller 1 Mailbox 29 Data 3 Register */
463#define CAN1_MB29_LENGTH 0xffc037b0 /* CAN Controller 1 Mailbox 29 Length Register */
464#define CAN1_MB29_TIMESTAMP 0xffc037b4 /* CAN Controller 1 Mailbox 29 Timestamp Register */
465#define CAN1_MB29_ID0 0xffc037b8 /* CAN Controller 1 Mailbox 29 ID0 Register */
466#define CAN1_MB29_ID1 0xffc037bc /* CAN Controller 1 Mailbox 29 ID1 Register */
467#define CAN1_MB30_DATA0 0xffc037c0 /* CAN Controller 1 Mailbox 30 Data 0 Register */
468#define CAN1_MB30_DATA1 0xffc037c4 /* CAN Controller 1 Mailbox 30 Data 1 Register */
469#define CAN1_MB30_DATA2 0xffc037c8 /* CAN Controller 1 Mailbox 30 Data 2 Register */
470#define CAN1_MB30_DATA3 0xffc037cc /* CAN Controller 1 Mailbox 30 Data 3 Register */
471#define CAN1_MB30_LENGTH 0xffc037d0 /* CAN Controller 1 Mailbox 30 Length Register */
472#define CAN1_MB30_TIMESTAMP 0xffc037d4 /* CAN Controller 1 Mailbox 30 Timestamp Register */
473#define CAN1_MB30_ID0 0xffc037d8 /* CAN Controller 1 Mailbox 30 ID0 Register */
474#define CAN1_MB30_ID1 0xffc037dc /* CAN Controller 1 Mailbox 30 ID1 Register */
475#define CAN1_MB31_DATA0 0xffc037e0 /* CAN Controller 1 Mailbox 31 Data 0 Register */
476#define CAN1_MB31_DATA1 0xffc037e4 /* CAN Controller 1 Mailbox 31 Data 1 Register */
477#define CAN1_MB31_DATA2 0xffc037e8 /* CAN Controller 1 Mailbox 31 Data 2 Register */
478#define CAN1_MB31_DATA3 0xffc037ec /* CAN Controller 1 Mailbox 31 Data 3 Register */
479#define CAN1_MB31_LENGTH 0xffc037f0 /* CAN Controller 1 Mailbox 31 Length Register */
480#define CAN1_MB31_TIMESTAMP 0xffc037f4 /* CAN Controller 1 Mailbox 31 Timestamp Register */
481#define CAN1_MB31_ID0 0xffc037f8 /* CAN Controller 1 Mailbox 31 ID0 Register */
482#define CAN1_MB31_ID1 0xffc037fc /* CAN Controller 1 Mailbox 31 ID1 Register */
483
484/* HOST Port Registers */
485
486#define HOST_CONTROL 0xffc03a00 /* HOST Control Register */
487#define HOST_STATUS 0xffc03a04 /* HOST Status Register */
488#define HOST_TIMEOUT 0xffc03a08 /* HOST Acknowledge Mode Timeout Register */
489
490/* Pixel Compositor (PIXC) Registers */
491
492#define PIXC_CTL 0xffc04400 /* Overlay enable, resampling mode, I/O data format, transparency enable, watermark level, FIFO status */
493#define PIXC_PPL 0xffc04404 /* Holds the number of pixels per line of the display */
494#define PIXC_LPF 0xffc04408 /* Holds the number of lines per frame of the display */
495#define PIXC_AHSTART 0xffc0440c /* Contains horizontal start pixel information of the overlay data (set A) */
496#define PIXC_AHEND 0xffc04410 /* Contains horizontal end pixel information of the overlay data (set A) */
497#define PIXC_AVSTART 0xffc04414 /* Contains vertical start pixel information of the overlay data (set A) */
498#define PIXC_AVEND 0xffc04418 /* Contains vertical end pixel information of the overlay data (set A) */
499#define PIXC_ATRANSP 0xffc0441c /* Contains the transparency ratio (set A) */
500#define PIXC_BHSTART 0xffc04420 /* Contains horizontal start pixel information of the overlay data (set B) */
501#define PIXC_BHEND 0xffc04424 /* Contains horizontal end pixel information of the overlay data (set B) */
502#define PIXC_BVSTART 0xffc04428 /* Contains vertical start pixel information of the overlay data (set B) */
503#define PIXC_BVEND 0xffc0442c /* Contains vertical end pixel information of the overlay data (set B) */
504#define PIXC_BTRANSP 0xffc04430 /* Contains the transparency ratio (set B) */
505#define PIXC_INTRSTAT 0xffc0443c /* Overlay interrupt configuration/status */
506#define PIXC_RYCON 0xffc04440 /* Color space conversion matrix register. Contains the R/Y conversion coefficients */
507#define PIXC_GUCON 0xffc04444 /* Color space conversion matrix register. Contains the G/U conversion coefficients */
508#define PIXC_BVCON 0xffc04448 /* Color space conversion matrix register. Contains the B/V conversion coefficients */
509#define PIXC_CCBIAS 0xffc0444c /* Bias values for the color space conversion matrix */
510#define PIXC_TC 0xffc04450 /* Holds the transparent color value */
511
512/* Handshake MDMA 0 Registers */
513
514#define HMDMA0_CONTROL 0xffc04500 /* Handshake MDMA0 Control Register */
515#define HMDMA0_ECINIT 0xffc04504 /* Handshake MDMA0 Initial Edge Count Register */
516#define HMDMA0_BCINIT 0xffc04508 /* Handshake MDMA0 Initial Block Count Register */
517#define HMDMA0_ECURGENT 0xffc0450c /* Handshake MDMA0 Urgent Edge Count Threshhold Register */
518#define HMDMA0_ECOVERFLOW 0xffc04510 /* Handshake MDMA0 Edge Count Overflow Interrupt Register */
519#define HMDMA0_ECOUNT 0xffc04514 /* Handshake MDMA0 Current Edge Count Register */
520#define HMDMA0_BCOUNT 0xffc04518 /* Handshake MDMA0 Current Block Count Register */
521
522/* Handshake MDMA 1 Registers */
523
524#define HMDMA1_CONTROL 0xffc04540 /* Handshake MDMA1 Control Register */
525#define HMDMA1_ECINIT 0xffc04544 /* Handshake MDMA1 Initial Edge Count Register */
526#define HMDMA1_BCINIT 0xffc04548 /* Handshake MDMA1 Initial Block Count Register */
527#define HMDMA1_ECURGENT 0xffc0454c /* Handshake MDMA1 Urgent Edge Count Threshhold Register */
528#define HMDMA1_ECOVERFLOW 0xffc04550 /* Handshake MDMA1 Edge Count Overflow Interrupt Register */
529#define HMDMA1_ECOUNT 0xffc04554 /* Handshake MDMA1 Current Edge Count Register */
530#define HMDMA1_BCOUNT 0xffc04558 /* Handshake MDMA1 Current Block Count Register */
531
532
533/* ********************************************************** */
534/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
535/* and MULTI BIT READ MACROS */
536/* ********************************************************** */
537
538/* Bit masks for PIXC_CTL */
539
540#define PIXC_EN 0x1 /* Pixel Compositor Enable */
541#define nPIXC_EN 0x0
542#define OVR_A_EN 0x2 /* Overlay A Enable */
543#define nOVR_A_EN 0x0
544#define OVR_B_EN 0x4 /* Overlay B Enable */
545#define nOVR_B_EN 0x0
546#define IMG_FORM 0x8 /* Image Data Format */
547#define nIMG_FORM 0x0
548#define OVR_FORM 0x10 /* Overlay Data Format */
549#define nOVR_FORM 0x0
550#define OUT_FORM 0x20 /* Output Data Format */
551#define nOUT_FORM 0x0
552#define UDS_MOD 0x40 /* Resampling Mode */
553#define nUDS_MOD 0x0
554#define TC_EN 0x80 /* Transparent Color Enable */
555#define nTC_EN 0x0
556#define IMG_STAT 0x300 /* Image FIFO Status */
557#define OVR_STAT 0xc00 /* Overlay FIFO Status */
558#define WM_LVL 0x3000 /* FIFO Watermark Level */
559
560/* Bit masks for PIXC_AHSTART */
561
562#define A_HSTART 0xfff /* Horizontal Start Coordinates */
563
564/* Bit masks for PIXC_AHEND */
565
566#define A_HEND 0xfff /* Horizontal End Coordinates */
567
568/* Bit masks for PIXC_AVSTART */
569
570#define A_VSTART 0x3ff /* Vertical Start Coordinates */
571
572/* Bit masks for PIXC_AVEND */
573
574#define A_VEND 0x3ff /* Vertical End Coordinates */
575
576/* Bit masks for PIXC_ATRANSP */
577
578#define A_TRANSP 0xf /* Transparency Value */
579
580/* Bit masks for PIXC_BHSTART */
581
582#define B_HSTART 0xfff /* Horizontal Start Coordinates */
583
584/* Bit masks for PIXC_BHEND */
585
586#define B_HEND 0xfff /* Horizontal End Coordinates */
587
588/* Bit masks for PIXC_BVSTART */
589
590#define B_VSTART 0x3ff /* Vertical Start Coordinates */
591
592/* Bit masks for PIXC_BVEND */
593
594#define B_VEND 0x3ff /* Vertical End Coordinates */
595
596/* Bit masks for PIXC_BTRANSP */
597
598#define B_TRANSP 0xf /* Transparency Value */
599
600/* Bit masks for PIXC_INTRSTAT */
601
602#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */
603#define nOVR_INT_EN 0x0
604#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */
605#define nFRM_INT_EN 0x0
606#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */
607#define nOVR_INT_STAT 0x0
608#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */
609#define nFRM_INT_STAT 0x0
610
611/* Bit masks for PIXC_RYCON */
612
613#define A11 0x3ff /* A11 in the Coefficient Matrix */
614#define A12 0xffc00 /* A12 in the Coefficient Matrix */
615#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */
616#define RY_MULT4 0x40000000 /* Multiply Row by 4 */
617#define nRY_MULT4 0x0
618
619/* Bit masks for PIXC_GUCON */
620
621#define A21 0x3ff /* A21 in the Coefficient Matrix */
622#define A22 0xffc00 /* A22 in the Coefficient Matrix */
623#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */
624#define GU_MULT4 0x40000000 /* Multiply Row by 4 */
625#define nGU_MULT4 0x0
626
627/* Bit masks for PIXC_BVCON */
628
629#define A31 0x3ff /* A31 in the Coefficient Matrix */
630#define A32 0xffc00 /* A32 in the Coefficient Matrix */
631#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */
632#define BV_MULT4 0x40000000 /* Multiply Row by 4 */
633#define nBV_MULT4 0x0
634
635/* Bit masks for PIXC_CCBIAS */
636
637#define A14 0x3ff /* A14 in the Bias Vector */
638#define A24 0xffc00 /* A24 in the Bias Vector */
639#define A34 0x3ff00000 /* A34 in the Bias Vector */
640
641/* Bit masks for PIXC_TC */
642
643#define RY_TRANS 0xff /* Transparent Color - R/Y Component */
644#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */
645#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */
646
647/* Bit masks for HOST_CONTROL */
648
649#define HOST_EN 0x1 /* Host Enable */
650#define nHOST_EN 0x0
651#define HOST_END 0x2 /* Host Endianess */
652#define nHOST_END 0x0
653#define DATA_SIZE 0x4 /* Data Size */
654#define nDATA_SIZE 0x0
655#define HOST_RST 0x8 /* Host Reset */
656#define nHOST_RST 0x0
657#define HRDY_OVR 0x20 /* Host Ready Override */
658#define nHRDY_OVR 0x0
659#define INT_MODE 0x40 /* Interrupt Mode */
660#define nINT_MODE 0x0
661#define BT_EN 0x80 /* Bus Timeout Enable */
662#define nBT_EN 0x0
663#define EHW 0x100 /* Enable Host Write */
664#define nEHW 0x0
665#define EHR 0x200 /* Enable Host Read */
666#define nEHR 0x0
667#define BDR 0x400 /* Burst DMA Requests */
668#define nBDR 0x0
669
670/* Bit masks for HOST_STATUS */
671
672#define READY 0x1 /* DMA Ready */
673#define nREADY 0x0
674#define FIFOFULL 0x2 /* FIFO Full */
675#define nFIFOFULL 0x0
676#define FIFOEMPTY 0x4 /* FIFO Empty */
677#define nFIFOEMPTY 0x0
678#define COMPLETE 0x8 /* DMA Complete */
679#define nCOMPLETE 0x0
680#define HSHK 0x10 /* Host Handshake */
681#define nHSHK 0x0
682#define TIMEOUT 0x20 /* Host Timeout */
683#define nTIMEOUT 0x0
684#define HIRQ 0x40 /* Host Interrupt Request */
685#define nHIRQ 0x0
686#define ALLOW_CNFG 0x80 /* Allow New Configuration */
687#define nALLOW_CNFG 0x0
688#define DMA_DIR 0x100 /* DMA Direction */
689#define nDMA_DIR 0x0
690#define BTE 0x200 /* Bus Timeout Enabled */
691#define nBTE 0x0
692
693/* Bit masks for HOST_TIMEOUT */
694
695#define COUNT_TIMEOUT 0x7ff /* Host Timeout count */
696
697/* Bit masks for TIMER_ENABLE1 */
698
699#define TIMEN8 0x1 /* Timer 8 Enable */
700#define nTIMEN8 0x0
701#define TIMEN9 0x2 /* Timer 9 Enable */
702#define nTIMEN9 0x0
703#define TIMEN10 0x4 /* Timer 10 Enable */
704#define nTIMEN10 0x0
705
706/* Bit masks for TIMER_DISABLE1 */
707
708#define TIMDIS8 0x1 /* Timer 8 Disable */
709#define nTIMDIS8 0x0
710#define TIMDIS9 0x2 /* Timer 9 Disable */
711#define nTIMDIS9 0x0
712#define TIMDIS10 0x4 /* Timer 10 Disable */
713#define nTIMDIS10 0x0
714
715/* Bit masks for TIMER_STATUS1 */
716
717#define TIMIL8 0x1 /* Timer 8 Interrupt */
718#define nTIMIL8 0x0
719#define TIMIL9 0x2 /* Timer 9 Interrupt */
720#define nTIMIL9 0x0
721#define TIMIL10 0x4 /* Timer 10 Interrupt */
722#define nTIMIL10 0x0
723#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */
724#define nTOVF_ERR8 0x0
725#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */
726#define nTOVF_ERR9 0x0
727#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */
728#define nTOVF_ERR10 0x0
729#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */
730#define nTRUN8 0x0
731#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */
732#define nTRUN9 0x0
733#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */
734#define nTRUN10 0x0
735
736/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */
737
738/* Bit masks for HMDMAx_CONTROL */
739
740#define HMDMAEN 0x1 /* Handshake MDMA Enable */
741#define nHMDMAEN 0x0
742#define REP 0x2 /* Handshake MDMA Request Polarity */
743#define nREP 0x0
744#define UTE 0x8 /* Urgency Threshold Enable */
745#define nUTE 0x0
746#define OIE 0x10 /* Overflow Interrupt Enable */
747#define nOIE 0x0
748#define BDIE 0x20 /* Block Done Interrupt Enable */
749#define nBDIE 0x0
750#define MBDI 0x40 /* Mask Block Done Interrupt */
751#define nMBDI 0x0
752#define DRQ 0x300 /* Handshake MDMA Request Type */
753#define RBC 0x1000 /* Force Reload of BCOUNT */
754#define nRBC 0x0
755#define PS 0x2000 /* Pin Status */
756#define nPS 0x0
757#define OI 0x4000 /* Overflow Interrupt Generated */
758#define nOI 0x0
759#define BDI 0x8000 /* Block Done Interrupt Generated */
760#define nBDI 0x0
761
762/* ******************************************* */
763/* MULTI BIT MACRO ENUMERATIONS */
764/* ******************************************* */
765
766#endif /* _DEF_BF544_H */
diff --git a/include/asm-blackfin/mach-bf548/defBF548.h b/include/asm-blackfin/mach-bf548/defBF548.h
new file mode 100644
index 000000000000..d9e3062a9117
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/defBF548.h
@@ -0,0 +1,1966 @@
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_CLKDIV 0xffc02200 /* Clock Divider Register */
124#define TWI1_CONTROL 0xffc02204 /* TWI Control Register */
125#define TWI1_SLAVE_CTRL 0xffc02208 /* TWI Slave Mode Control Register */
126#define TWI1_SLAVE_STAT 0xffc0220c /* TWI Slave Mode Status Register */
127#define TWI1_SLAVE_ADDR 0xffc02210 /* TWI Slave Mode Address Register */
128#define TWI1_MASTER_CTRL 0xffc02214 /* TWI Master Mode Control Register */
129#define TWI1_MASTER_STAT 0xffc02218 /* TWI Master Mode Status Register */
130#define TWI1_MASTER_ADDR 0xffc0221c /* TWI Master Mode Address Register */
131#define TWI1_INT_STAT 0xffc02220 /* TWI Interrupt Status Register */
132#define TWI1_INT_MASK 0xffc02224 /* TWI Interrupt Mask Register */
133#define TWI1_FIFO_CTRL 0xffc02228 /* TWI FIFO Control Register */
134#define TWI1_FIFO_STAT 0xffc0222c /* TWI FIFO Status Register */
135#define TWI1_XMT_DATA8 0xffc02280 /* TWI FIFO Transmit Data Single Byte Register */
136#define TWI1_XMT_DATA16 0xffc02284 /* TWI FIFO Transmit Data Double Byte Register */
137#define TWI1_RCV_DATA8 0xffc02288 /* TWI FIFO Receive Data Single Byte Register */
138#define TWI1_RCV_DATA16 0xffc0228c /* TWI FIFO Receive Data Double Byte Register */
139
140/* SPI2 Registers */
141
142#define SPI2_CTL 0xffc02400 /* SPI2 Control Register */
143#define SPI2_FLG 0xffc02404 /* SPI2 Flag Register */
144#define SPI2_STAT 0xffc02408 /* SPI2 Status Register */
145#define SPI2_TDBR 0xffc0240c /* SPI2 Transmit Data Buffer Register */
146#define SPI2_RDBR 0xffc02410 /* SPI2 Receive Data Buffer Register */
147#define SPI2_BAUD 0xffc02414 /* SPI2 Baud Rate Register */
148#define SPI2_SHADOW 0xffc02418 /* SPI2 Receive Data Buffer Shadow Register */
149
150/* CAN Controller 1 Config 1 Registers */
151
152#define CAN1_MC1 0xffc03200 /* CAN Controller 1 Mailbox Configuration Register 1 */
153#define CAN1_MD1 0xffc03204 /* CAN Controller 1 Mailbox Direction Register 1 */
154#define CAN1_TRS1 0xffc03208 /* CAN Controller 1 Transmit Request Set Register 1 */
155#define CAN1_TRR1 0xffc0320c /* CAN Controller 1 Transmit Request Reset Register 1 */
156#define CAN1_TA1 0xffc03210 /* CAN Controller 1 Transmit Acknowledge Register 1 */
157#define CAN1_AA1 0xffc03214 /* CAN Controller 1 Abort Acknowledge Register 1 */
158#define CAN1_RMP1 0xffc03218 /* CAN Controller 1 Receive Message Pending Register 1 */
159#define CAN1_RML1 0xffc0321c /* CAN Controller 1 Receive Message Lost Register 1 */
160#define CAN1_MBTIF1 0xffc03220 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 1 */
161#define CAN1_MBRIF1 0xffc03224 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 1 */
162#define CAN1_MBIM1 0xffc03228 /* CAN Controller 1 Mailbox Interrupt Mask Register 1 */
163#define CAN1_RFH1 0xffc0322c /* CAN Controller 1 Remote Frame Handling Enable Register 1 */
164#define CAN1_OPSS1 0xffc03230 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 1 */
165
166/* CAN Controller 1 Config 2 Registers */
167
168#define CAN1_MC2 0xffc03240 /* CAN Controller 1 Mailbox Configuration Register 2 */
169#define CAN1_MD2 0xffc03244 /* CAN Controller 1 Mailbox Direction Register 2 */
170#define CAN1_TRS2 0xffc03248 /* CAN Controller 1 Transmit Request Set Register 2 */
171#define CAN1_TRR2 0xffc0324c /* CAN Controller 1 Transmit Request Reset Register 2 */
172#define CAN1_TA2 0xffc03250 /* CAN Controller 1 Transmit Acknowledge Register 2 */
173#define CAN1_AA2 0xffc03254 /* CAN Controller 1 Abort Acknowledge Register 2 */
174#define CAN1_RMP2 0xffc03258 /* CAN Controller 1 Receive Message Pending Register 2 */
175#define CAN1_RML2 0xffc0325c /* CAN Controller 1 Receive Message Lost Register 2 */
176#define CAN1_MBTIF2 0xffc03260 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 2 */
177#define CAN1_MBRIF2 0xffc03264 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 2 */
178#define CAN1_MBIM2 0xffc03268 /* CAN Controller 1 Mailbox Interrupt Mask Register 2 */
179#define CAN1_RFH2 0xffc0326c /* CAN Controller 1 Remote Frame Handling Enable Register 2 */
180#define CAN1_OPSS2 0xffc03270 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 2 */
181
182/* CAN Controller 1 Clock/Interrupt/Counter Registers */
183
184#define CAN1_CLOCK 0xffc03280 /* CAN Controller 1 Clock Register */
185#define CAN1_TIMING 0xffc03284 /* CAN Controller 1 Timing Register */
186#define CAN1_DEBUG 0xffc03288 /* CAN Controller 1 Debug Register */
187#define CAN1_STATUS 0xffc0328c /* CAN Controller 1 Global Status Register */
188#define CAN1_CEC 0xffc03290 /* CAN Controller 1 Error Counter Register */
189#define CAN1_GIS 0xffc03294 /* CAN Controller 1 Global Interrupt Status Register */
190#define CAN1_GIM 0xffc03298 /* CAN Controller 1 Global Interrupt Mask Register */
191#define CAN1_GIF 0xffc0329c /* CAN Controller 1 Global Interrupt Flag Register */
192#define CAN1_CONTROL 0xffc032a0 /* CAN Controller 1 Master Control Register */
193#define CAN1_INTR 0xffc032a4 /* CAN Controller 1 Interrupt Pending Register */
194#define CAN1_MBTD 0xffc032ac /* CAN Controller 1 Mailbox Temporary Disable Register */
195#define CAN1_EWR 0xffc032b0 /* CAN Controller 1 Programmable Warning Level Register */
196#define CAN1_ESR 0xffc032b4 /* CAN Controller 1 Error Status Register */
197#define CAN1_UCCNT 0xffc032c4 /* CAN Controller 1 Universal Counter Register */
198#define CAN1_UCRC 0xffc032c8 /* CAN Controller 1 Universal Counter Force Reload Register */
199#define CAN1_UCCNF 0xffc032cc /* CAN Controller 1 Universal Counter Configuration Register */
200
201/* CAN Controller 1 Mailbox Acceptance Registers */
202
203#define CAN1_AM00L 0xffc03300 /* CAN Controller 1 Mailbox 0 Acceptance Mask High Register */
204#define CAN1_AM00H 0xffc03304 /* CAN Controller 1 Mailbox 0 Acceptance Mask Low Register */
205#define CAN1_AM01L 0xffc03308 /* CAN Controller 1 Mailbox 1 Acceptance Mask High Register */
206#define CAN1_AM01H 0xffc0330c /* CAN Controller 1 Mailbox 1 Acceptance Mask Low Register */
207#define CAN1_AM02L 0xffc03310 /* CAN Controller 1 Mailbox 2 Acceptance Mask High Register */
208#define CAN1_AM02H 0xffc03314 /* CAN Controller 1 Mailbox 2 Acceptance Mask Low Register */
209#define CAN1_AM03L 0xffc03318 /* CAN Controller 1 Mailbox 3 Acceptance Mask High Register */
210#define CAN1_AM03H 0xffc0331c /* CAN Controller 1 Mailbox 3 Acceptance Mask Low Register */
211#define CAN1_AM04L 0xffc03320 /* CAN Controller 1 Mailbox 4 Acceptance Mask High Register */
212#define CAN1_AM04H 0xffc03324 /* CAN Controller 1 Mailbox 4 Acceptance Mask Low Register */
213#define CAN1_AM05L 0xffc03328 /* CAN Controller 1 Mailbox 5 Acceptance Mask High Register */
214#define CAN1_AM05H 0xffc0332c /* CAN Controller 1 Mailbox 5 Acceptance Mask Low Register */
215#define CAN1_AM06L 0xffc03330 /* CAN Controller 1 Mailbox 6 Acceptance Mask High Register */
216#define CAN1_AM06H 0xffc03334 /* CAN Controller 1 Mailbox 6 Acceptance Mask Low Register */
217#define CAN1_AM07L 0xffc03338 /* CAN Controller 1 Mailbox 7 Acceptance Mask High Register */
218#define CAN1_AM07H 0xffc0333c /* CAN Controller 1 Mailbox 7 Acceptance Mask Low Register */
219#define CAN1_AM08L 0xffc03340 /* CAN Controller 1 Mailbox 8 Acceptance Mask High Register */
220#define CAN1_AM08H 0xffc03344 /* CAN Controller 1 Mailbox 8 Acceptance Mask Low Register */
221#define CAN1_AM09L 0xffc03348 /* CAN Controller 1 Mailbox 9 Acceptance Mask High Register */
222#define CAN1_AM09H 0xffc0334c /* CAN Controller 1 Mailbox 9 Acceptance Mask Low Register */
223#define CAN1_AM10L 0xffc03350 /* CAN Controller 1 Mailbox 10 Acceptance Mask High Register */
224#define CAN1_AM10H 0xffc03354 /* CAN Controller 1 Mailbox 10 Acceptance Mask Low Register */
225#define CAN1_AM11L 0xffc03358 /* CAN Controller 1 Mailbox 11 Acceptance Mask High Register */
226#define CAN1_AM11H 0xffc0335c /* CAN Controller 1 Mailbox 11 Acceptance Mask Low Register */
227#define CAN1_AM12L 0xffc03360 /* CAN Controller 1 Mailbox 12 Acceptance Mask High Register */
228#define CAN1_AM12H 0xffc03364 /* CAN Controller 1 Mailbox 12 Acceptance Mask Low Register */
229#define CAN1_AM13L 0xffc03368 /* CAN Controller 1 Mailbox 13 Acceptance Mask High Register */
230#define CAN1_AM13H 0xffc0336c /* CAN Controller 1 Mailbox 13 Acceptance Mask Low Register */
231#define CAN1_AM14L 0xffc03370 /* CAN Controller 1 Mailbox 14 Acceptance Mask High Register */
232#define CAN1_AM14H 0xffc03374 /* CAN Controller 1 Mailbox 14 Acceptance Mask Low Register */
233#define CAN1_AM15L 0xffc03378 /* CAN Controller 1 Mailbox 15 Acceptance Mask High Register */
234#define CAN1_AM15H 0xffc0337c /* CAN Controller 1 Mailbox 15 Acceptance Mask Low Register */
235
236/* CAN Controller 1 Mailbox Acceptance Registers */
237
238#define CAN1_AM16L 0xffc03380 /* CAN Controller 1 Mailbox 16 Acceptance Mask High Register */
239#define CAN1_AM16H 0xffc03384 /* CAN Controller 1 Mailbox 16 Acceptance Mask Low Register */
240#define CAN1_AM17L 0xffc03388 /* CAN Controller 1 Mailbox 17 Acceptance Mask High Register */
241#define CAN1_AM17H 0xffc0338c /* CAN Controller 1 Mailbox 17 Acceptance Mask Low Register */
242#define CAN1_AM18L 0xffc03390 /* CAN Controller 1 Mailbox 18 Acceptance Mask High Register */
243#define CAN1_AM18H 0xffc03394 /* CAN Controller 1 Mailbox 18 Acceptance Mask Low Register */
244#define CAN1_AM19L 0xffc03398 /* CAN Controller 1 Mailbox 19 Acceptance Mask High Register */
245#define CAN1_AM19H 0xffc0339c /* CAN Controller 1 Mailbox 19 Acceptance Mask Low Register */
246#define CAN1_AM20L 0xffc033a0 /* CAN Controller 1 Mailbox 20 Acceptance Mask High Register */
247#define CAN1_AM20H 0xffc033a4 /* CAN Controller 1 Mailbox 20 Acceptance Mask Low Register */
248#define CAN1_AM21L 0xffc033a8 /* CAN Controller 1 Mailbox 21 Acceptance Mask High Register */
249#define CAN1_AM21H 0xffc033ac /* CAN Controller 1 Mailbox 21 Acceptance Mask Low Register */
250#define CAN1_AM22L 0xffc033b0 /* CAN Controller 1 Mailbox 22 Acceptance Mask High Register */
251#define CAN1_AM22H 0xffc033b4 /* CAN Controller 1 Mailbox 22 Acceptance Mask Low Register */
252#define CAN1_AM23L 0xffc033b8 /* CAN Controller 1 Mailbox 23 Acceptance Mask High Register */
253#define CAN1_AM23H 0xffc033bc /* CAN Controller 1 Mailbox 23 Acceptance Mask Low Register */
254#define CAN1_AM24L 0xffc033c0 /* CAN Controller 1 Mailbox 24 Acceptance Mask High Register */
255#define CAN1_AM24H 0xffc033c4 /* CAN Controller 1 Mailbox 24 Acceptance Mask Low Register */
256#define CAN1_AM25L 0xffc033c8 /* CAN Controller 1 Mailbox 25 Acceptance Mask High Register */
257#define CAN1_AM25H 0xffc033cc /* CAN Controller 1 Mailbox 25 Acceptance Mask Low Register */
258#define CAN1_AM26L 0xffc033d0 /* CAN Controller 1 Mailbox 26 Acceptance Mask High Register */
259#define CAN1_AM26H 0xffc033d4 /* CAN Controller 1 Mailbox 26 Acceptance Mask Low Register */
260#define CAN1_AM27L 0xffc033d8 /* CAN Controller 1 Mailbox 27 Acceptance Mask High Register */
261#define CAN1_AM27H 0xffc033dc /* CAN Controller 1 Mailbox 27 Acceptance Mask Low Register */
262#define CAN1_AM28L 0xffc033e0 /* CAN Controller 1 Mailbox 28 Acceptance Mask High Register */
263#define CAN1_AM28H 0xffc033e4 /* CAN Controller 1 Mailbox 28 Acceptance Mask Low Register */
264#define CAN1_AM29L 0xffc033e8 /* CAN Controller 1 Mailbox 29 Acceptance Mask High Register */
265#define CAN1_AM29H 0xffc033ec /* CAN Controller 1 Mailbox 29 Acceptance Mask Low Register */
266#define CAN1_AM30L 0xffc033f0 /* CAN Controller 1 Mailbox 30 Acceptance Mask High Register */
267#define CAN1_AM30H 0xffc033f4 /* CAN Controller 1 Mailbox 30 Acceptance Mask Low Register */
268#define CAN1_AM31L 0xffc033f8 /* CAN Controller 1 Mailbox 31 Acceptance Mask High Register */
269#define CAN1_AM31H 0xffc033fc /* CAN Controller 1 Mailbox 31 Acceptance Mask Low Register */
270
271/* CAN Controller 1 Mailbox Data Registers */
272
273#define CAN1_MB00_DATA0 0xffc03400 /* CAN Controller 1 Mailbox 0 Data 0 Register */
274#define CAN1_MB00_DATA1 0xffc03404 /* CAN Controller 1 Mailbox 0 Data 1 Register */
275#define CAN1_MB00_DATA2 0xffc03408 /* CAN Controller 1 Mailbox 0 Data 2 Register */
276#define CAN1_MB00_DATA3 0xffc0340c /* CAN Controller 1 Mailbox 0 Data 3 Register */
277#define CAN1_MB00_LENGTH 0xffc03410 /* CAN Controller 1 Mailbox 0 Length Register */
278#define CAN1_MB00_TIMESTAMP 0xffc03414 /* CAN Controller 1 Mailbox 0 Timestamp Register */
279#define CAN1_MB00_ID0 0xffc03418 /* CAN Controller 1 Mailbox 0 ID0 Register */
280#define CAN1_MB00_ID1 0xffc0341c /* CAN Controller 1 Mailbox 0 ID1 Register */
281#define CAN1_MB01_DATA0 0xffc03420 /* CAN Controller 1 Mailbox 1 Data 0 Register */
282#define CAN1_MB01_DATA1 0xffc03424 /* CAN Controller 1 Mailbox 1 Data 1 Register */
283#define CAN1_MB01_DATA2 0xffc03428 /* CAN Controller 1 Mailbox 1 Data 2 Register */
284#define CAN1_MB01_DATA3 0xffc0342c /* CAN Controller 1 Mailbox 1 Data 3 Register */
285#define CAN1_MB01_LENGTH 0xffc03430 /* CAN Controller 1 Mailbox 1 Length Register */
286#define CAN1_MB01_TIMESTAMP 0xffc03434 /* CAN Controller 1 Mailbox 1 Timestamp Register */
287#define CAN1_MB01_ID0 0xffc03438 /* CAN Controller 1 Mailbox 1 ID0 Register */
288#define CAN1_MB01_ID1 0xffc0343c /* CAN Controller 1 Mailbox 1 ID1 Register */
289#define CAN1_MB02_DATA0 0xffc03440 /* CAN Controller 1 Mailbox 2 Data 0 Register */
290#define CAN1_MB02_DATA1 0xffc03444 /* CAN Controller 1 Mailbox 2 Data 1 Register */
291#define CAN1_MB02_DATA2 0xffc03448 /* CAN Controller 1 Mailbox 2 Data 2 Register */
292#define CAN1_MB02_DATA3 0xffc0344c /* CAN Controller 1 Mailbox 2 Data 3 Register */
293#define CAN1_MB02_LENGTH 0xffc03450 /* CAN Controller 1 Mailbox 2 Length Register */
294#define CAN1_MB02_TIMESTAMP 0xffc03454 /* CAN Controller 1 Mailbox 2 Timestamp Register */
295#define CAN1_MB02_ID0 0xffc03458 /* CAN Controller 1 Mailbox 2 ID0 Register */
296#define CAN1_MB02_ID1 0xffc0345c /* CAN Controller 1 Mailbox 2 ID1 Register */
297#define CAN1_MB03_DATA0 0xffc03460 /* CAN Controller 1 Mailbox 3 Data 0 Register */
298#define CAN1_MB03_DATA1 0xffc03464 /* CAN Controller 1 Mailbox 3 Data 1 Register */
299#define CAN1_MB03_DATA2 0xffc03468 /* CAN Controller 1 Mailbox 3 Data 2 Register */
300#define CAN1_MB03_DATA3 0xffc0346c /* CAN Controller 1 Mailbox 3 Data 3 Register */
301#define CAN1_MB03_LENGTH 0xffc03470 /* CAN Controller 1 Mailbox 3 Length Register */
302#define CAN1_MB03_TIMESTAMP 0xffc03474 /* CAN Controller 1 Mailbox 3 Timestamp Register */
303#define CAN1_MB03_ID0 0xffc03478 /* CAN Controller 1 Mailbox 3 ID0 Register */
304#define CAN1_MB03_ID1 0xffc0347c /* CAN Controller 1 Mailbox 3 ID1 Register */
305#define CAN1_MB04_DATA0 0xffc03480 /* CAN Controller 1 Mailbox 4 Data 0 Register */
306#define CAN1_MB04_DATA1 0xffc03484 /* CAN Controller 1 Mailbox 4 Data 1 Register */
307#define CAN1_MB04_DATA2 0xffc03488 /* CAN Controller 1 Mailbox 4 Data 2 Register */
308#define CAN1_MB04_DATA3 0xffc0348c /* CAN Controller 1 Mailbox 4 Data 3 Register */
309#define CAN1_MB04_LENGTH 0xffc03490 /* CAN Controller 1 Mailbox 4 Length Register */
310#define CAN1_MB04_TIMESTAMP 0xffc03494 /* CAN Controller 1 Mailbox 4 Timestamp Register */
311#define CAN1_MB04_ID0 0xffc03498 /* CAN Controller 1 Mailbox 4 ID0 Register */
312#define CAN1_MB04_ID1 0xffc0349c /* CAN Controller 1 Mailbox 4 ID1 Register */
313#define CAN1_MB05_DATA0 0xffc034a0 /* CAN Controller 1 Mailbox 5 Data 0 Register */
314#define CAN1_MB05_DATA1 0xffc034a4 /* CAN Controller 1 Mailbox 5 Data 1 Register */
315#define CAN1_MB05_DATA2 0xffc034a8 /* CAN Controller 1 Mailbox 5 Data 2 Register */
316#define CAN1_MB05_DATA3 0xffc034ac /* CAN Controller 1 Mailbox 5 Data 3 Register */
317#define CAN1_MB05_LENGTH 0xffc034b0 /* CAN Controller 1 Mailbox 5 Length Register */
318#define CAN1_MB05_TIMESTAMP 0xffc034b4 /* CAN Controller 1 Mailbox 5 Timestamp Register */
319#define CAN1_MB05_ID0 0xffc034b8 /* CAN Controller 1 Mailbox 5 ID0 Register */
320#define CAN1_MB05_ID1 0xffc034bc /* CAN Controller 1 Mailbox 5 ID1 Register */
321#define CAN1_MB06_DATA0 0xffc034c0 /* CAN Controller 1 Mailbox 6 Data 0 Register */
322#define CAN1_MB06_DATA1 0xffc034c4 /* CAN Controller 1 Mailbox 6 Data 1 Register */
323#define CAN1_MB06_DATA2 0xffc034c8 /* CAN Controller 1 Mailbox 6 Data 2 Register */
324#define CAN1_MB06_DATA3 0xffc034cc /* CAN Controller 1 Mailbox 6 Data 3 Register */
325#define CAN1_MB06_LENGTH 0xffc034d0 /* CAN Controller 1 Mailbox 6 Length Register */
326#define CAN1_MB06_TIMESTAMP 0xffc034d4 /* CAN Controller 1 Mailbox 6 Timestamp Register */
327#define CAN1_MB06_ID0 0xffc034d8 /* CAN Controller 1 Mailbox 6 ID0 Register */
328#define CAN1_MB06_ID1 0xffc034dc /* CAN Controller 1 Mailbox 6 ID1 Register */
329#define CAN1_MB07_DATA0 0xffc034e0 /* CAN Controller 1 Mailbox 7 Data 0 Register */
330#define CAN1_MB07_DATA1 0xffc034e4 /* CAN Controller 1 Mailbox 7 Data 1 Register */
331#define CAN1_MB07_DATA2 0xffc034e8 /* CAN Controller 1 Mailbox 7 Data 2 Register */
332#define CAN1_MB07_DATA3 0xffc034ec /* CAN Controller 1 Mailbox 7 Data 3 Register */
333#define CAN1_MB07_LENGTH 0xffc034f0 /* CAN Controller 1 Mailbox 7 Length Register */
334#define CAN1_MB07_TIMESTAMP 0xffc034f4 /* CAN Controller 1 Mailbox 7 Timestamp Register */
335#define CAN1_MB07_ID0 0xffc034f8 /* CAN Controller 1 Mailbox 7 ID0 Register */
336#define CAN1_MB07_ID1 0xffc034fc /* CAN Controller 1 Mailbox 7 ID1 Register */
337#define CAN1_MB08_DATA0 0xffc03500 /* CAN Controller 1 Mailbox 8 Data 0 Register */
338#define CAN1_MB08_DATA1 0xffc03504 /* CAN Controller 1 Mailbox 8 Data 1 Register */
339#define CAN1_MB08_DATA2 0xffc03508 /* CAN Controller 1 Mailbox 8 Data 2 Register */
340#define CAN1_MB08_DATA3 0xffc0350c /* CAN Controller 1 Mailbox 8 Data 3 Register */
341#define CAN1_MB08_LENGTH 0xffc03510 /* CAN Controller 1 Mailbox 8 Length Register */
342#define CAN1_MB08_TIMESTAMP 0xffc03514 /* CAN Controller 1 Mailbox 8 Timestamp Register */
343#define CAN1_MB08_ID0 0xffc03518 /* CAN Controller 1 Mailbox 8 ID0 Register */
344#define CAN1_MB08_ID1 0xffc0351c /* CAN Controller 1 Mailbox 8 ID1 Register */
345#define CAN1_MB09_DATA0 0xffc03520 /* CAN Controller 1 Mailbox 9 Data 0 Register */
346#define CAN1_MB09_DATA1 0xffc03524 /* CAN Controller 1 Mailbox 9 Data 1 Register */
347#define CAN1_MB09_DATA2 0xffc03528 /* CAN Controller 1 Mailbox 9 Data 2 Register */
348#define CAN1_MB09_DATA3 0xffc0352c /* CAN Controller 1 Mailbox 9 Data 3 Register */
349#define CAN1_MB09_LENGTH 0xffc03530 /* CAN Controller 1 Mailbox 9 Length Register */
350#define CAN1_MB09_TIMESTAMP 0xffc03534 /* CAN Controller 1 Mailbox 9 Timestamp Register */
351#define CAN1_MB09_ID0 0xffc03538 /* CAN Controller 1 Mailbox 9 ID0 Register */
352#define CAN1_MB09_ID1 0xffc0353c /* CAN Controller 1 Mailbox 9 ID1 Register */
353#define CAN1_MB10_DATA0 0xffc03540 /* CAN Controller 1 Mailbox 10 Data 0 Register */
354#define CAN1_MB10_DATA1 0xffc03544 /* CAN Controller 1 Mailbox 10 Data 1 Register */
355#define CAN1_MB10_DATA2 0xffc03548 /* CAN Controller 1 Mailbox 10 Data 2 Register */
356#define CAN1_MB10_DATA3 0xffc0354c /* CAN Controller 1 Mailbox 10 Data 3 Register */
357#define CAN1_MB10_LENGTH 0xffc03550 /* CAN Controller 1 Mailbox 10 Length Register */
358#define CAN1_MB10_TIMESTAMP 0xffc03554 /* CAN Controller 1 Mailbox 10 Timestamp Register */
359#define CAN1_MB10_ID0 0xffc03558 /* CAN Controller 1 Mailbox 10 ID0 Register */
360#define CAN1_MB10_ID1 0xffc0355c /* CAN Controller 1 Mailbox 10 ID1 Register */
361#define CAN1_MB11_DATA0 0xffc03560 /* CAN Controller 1 Mailbox 11 Data 0 Register */
362#define CAN1_MB11_DATA1 0xffc03564 /* CAN Controller 1 Mailbox 11 Data 1 Register */
363#define CAN1_MB11_DATA2 0xffc03568 /* CAN Controller 1 Mailbox 11 Data 2 Register */
364#define CAN1_MB11_DATA3 0xffc0356c /* CAN Controller 1 Mailbox 11 Data 3 Register */
365#define CAN1_MB11_LENGTH 0xffc03570 /* CAN Controller 1 Mailbox 11 Length Register */
366#define CAN1_MB11_TIMESTAMP 0xffc03574 /* CAN Controller 1 Mailbox 11 Timestamp Register */
367#define CAN1_MB11_ID0 0xffc03578 /* CAN Controller 1 Mailbox 11 ID0 Register */
368#define CAN1_MB11_ID1 0xffc0357c /* CAN Controller 1 Mailbox 11 ID1 Register */
369#define CAN1_MB12_DATA0 0xffc03580 /* CAN Controller 1 Mailbox 12 Data 0 Register */
370#define CAN1_MB12_DATA1 0xffc03584 /* CAN Controller 1 Mailbox 12 Data 1 Register */
371#define CAN1_MB12_DATA2 0xffc03588 /* CAN Controller 1 Mailbox 12 Data 2 Register */
372#define CAN1_MB12_DATA3 0xffc0358c /* CAN Controller 1 Mailbox 12 Data 3 Register */
373#define CAN1_MB12_LENGTH 0xffc03590 /* CAN Controller 1 Mailbox 12 Length Register */
374#define CAN1_MB12_TIMESTAMP 0xffc03594 /* CAN Controller 1 Mailbox 12 Timestamp Register */
375#define CAN1_MB12_ID0 0xffc03598 /* CAN Controller 1 Mailbox 12 ID0 Register */
376#define CAN1_MB12_ID1 0xffc0359c /* CAN Controller 1 Mailbox 12 ID1 Register */
377#define CAN1_MB13_DATA0 0xffc035a0 /* CAN Controller 1 Mailbox 13 Data 0 Register */
378#define CAN1_MB13_DATA1 0xffc035a4 /* CAN Controller 1 Mailbox 13 Data 1 Register */
379#define CAN1_MB13_DATA2 0xffc035a8 /* CAN Controller 1 Mailbox 13 Data 2 Register */
380#define CAN1_MB13_DATA3 0xffc035ac /* CAN Controller 1 Mailbox 13 Data 3 Register */
381#define CAN1_MB13_LENGTH 0xffc035b0 /* CAN Controller 1 Mailbox 13 Length Register */
382#define CAN1_MB13_TIMESTAMP 0xffc035b4 /* CAN Controller 1 Mailbox 13 Timestamp Register */
383#define CAN1_MB13_ID0 0xffc035b8 /* CAN Controller 1 Mailbox 13 ID0 Register */
384#define CAN1_MB13_ID1 0xffc035bc /* CAN Controller 1 Mailbox 13 ID1 Register */
385#define CAN1_MB14_DATA0 0xffc035c0 /* CAN Controller 1 Mailbox 14 Data 0 Register */
386#define CAN1_MB14_DATA1 0xffc035c4 /* CAN Controller 1 Mailbox 14 Data 1 Register */
387#define CAN1_MB14_DATA2 0xffc035c8 /* CAN Controller 1 Mailbox 14 Data 2 Register */
388#define CAN1_MB14_DATA3 0xffc035cc /* CAN Controller 1 Mailbox 14 Data 3 Register */
389#define CAN1_MB14_LENGTH 0xffc035d0 /* CAN Controller 1 Mailbox 14 Length Register */
390#define CAN1_MB14_TIMESTAMP 0xffc035d4 /* CAN Controller 1 Mailbox 14 Timestamp Register */
391#define CAN1_MB14_ID0 0xffc035d8 /* CAN Controller 1 Mailbox 14 ID0 Register */
392#define CAN1_MB14_ID1 0xffc035dc /* CAN Controller 1 Mailbox 14 ID1 Register */
393#define CAN1_MB15_DATA0 0xffc035e0 /* CAN Controller 1 Mailbox 15 Data 0 Register */
394#define CAN1_MB15_DATA1 0xffc035e4 /* CAN Controller 1 Mailbox 15 Data 1 Register */
395#define CAN1_MB15_DATA2 0xffc035e8 /* CAN Controller 1 Mailbox 15 Data 2 Register */
396#define CAN1_MB15_DATA3 0xffc035ec /* CAN Controller 1 Mailbox 15 Data 3 Register */
397#define CAN1_MB15_LENGTH 0xffc035f0 /* CAN Controller 1 Mailbox 15 Length Register */
398#define CAN1_MB15_TIMESTAMP 0xffc035f4 /* CAN Controller 1 Mailbox 15 Timestamp Register */
399#define CAN1_MB15_ID0 0xffc035f8 /* CAN Controller 1 Mailbox 15 ID0 Register */
400#define CAN1_MB15_ID1 0xffc035fc /* CAN Controller 1 Mailbox 15 ID1 Register */
401
402/* CAN Controller 1 Mailbox Data Registers */
403
404#define CAN1_MB16_DATA0 0xffc03600 /* CAN Controller 1 Mailbox 16 Data 0 Register */
405#define CAN1_MB16_DATA1 0xffc03604 /* CAN Controller 1 Mailbox 16 Data 1 Register */
406#define CAN1_MB16_DATA2 0xffc03608 /* CAN Controller 1 Mailbox 16 Data 2 Register */
407#define CAN1_MB16_DATA3 0xffc0360c /* CAN Controller 1 Mailbox 16 Data 3 Register */
408#define CAN1_MB16_LENGTH 0xffc03610 /* CAN Controller 1 Mailbox 16 Length Register */
409#define CAN1_MB16_TIMESTAMP 0xffc03614 /* CAN Controller 1 Mailbox 16 Timestamp Register */
410#define CAN1_MB16_ID0 0xffc03618 /* CAN Controller 1 Mailbox 16 ID0 Register */
411#define CAN1_MB16_ID1 0xffc0361c /* CAN Controller 1 Mailbox 16 ID1 Register */
412#define CAN1_MB17_DATA0 0xffc03620 /* CAN Controller 1 Mailbox 17 Data 0 Register */
413#define CAN1_MB17_DATA1 0xffc03624 /* CAN Controller 1 Mailbox 17 Data 1 Register */
414#define CAN1_MB17_DATA2 0xffc03628 /* CAN Controller 1 Mailbox 17 Data 2 Register */
415#define CAN1_MB17_DATA3 0xffc0362c /* CAN Controller 1 Mailbox 17 Data 3 Register */
416#define CAN1_MB17_LENGTH 0xffc03630 /* CAN Controller 1 Mailbox 17 Length Register */
417#define CAN1_MB17_TIMESTAMP 0xffc03634 /* CAN Controller 1 Mailbox 17 Timestamp Register */
418#define CAN1_MB17_ID0 0xffc03638 /* CAN Controller 1 Mailbox 17 ID0 Register */
419#define CAN1_MB17_ID1 0xffc0363c /* CAN Controller 1 Mailbox 17 ID1 Register */
420#define CAN1_MB18_DATA0 0xffc03640 /* CAN Controller 1 Mailbox 18 Data 0 Register */
421#define CAN1_MB18_DATA1 0xffc03644 /* CAN Controller 1 Mailbox 18 Data 1 Register */
422#define CAN1_MB18_DATA2 0xffc03648 /* CAN Controller 1 Mailbox 18 Data 2 Register */
423#define CAN1_MB18_DATA3 0xffc0364c /* CAN Controller 1 Mailbox 18 Data 3 Register */
424#define CAN1_MB18_LENGTH 0xffc03650 /* CAN Controller 1 Mailbox 18 Length Register */
425#define CAN1_MB18_TIMESTAMP 0xffc03654 /* CAN Controller 1 Mailbox 18 Timestamp Register */
426#define CAN1_MB18_ID0 0xffc03658 /* CAN Controller 1 Mailbox 18 ID0 Register */
427#define CAN1_MB18_ID1 0xffc0365c /* CAN Controller 1 Mailbox 18 ID1 Register */
428#define CAN1_MB19_DATA0 0xffc03660 /* CAN Controller 1 Mailbox 19 Data 0 Register */
429#define CAN1_MB19_DATA1 0xffc03664 /* CAN Controller 1 Mailbox 19 Data 1 Register */
430#define CAN1_MB19_DATA2 0xffc03668 /* CAN Controller 1 Mailbox 19 Data 2 Register */
431#define CAN1_MB19_DATA3 0xffc0366c /* CAN Controller 1 Mailbox 19 Data 3 Register */
432#define CAN1_MB19_LENGTH 0xffc03670 /* CAN Controller 1 Mailbox 19 Length Register */
433#define CAN1_MB19_TIMESTAMP 0xffc03674 /* CAN Controller 1 Mailbox 19 Timestamp Register */
434#define CAN1_MB19_ID0 0xffc03678 /* CAN Controller 1 Mailbox 19 ID0 Register */
435#define CAN1_MB19_ID1 0xffc0367c /* CAN Controller 1 Mailbox 19 ID1 Register */
436#define CAN1_MB20_DATA0 0xffc03680 /* CAN Controller 1 Mailbox 20 Data 0 Register */
437#define CAN1_MB20_DATA1 0xffc03684 /* CAN Controller 1 Mailbox 20 Data 1 Register */
438#define CAN1_MB20_DATA2 0xffc03688 /* CAN Controller 1 Mailbox 20 Data 2 Register */
439#define CAN1_MB20_DATA3 0xffc0368c /* CAN Controller 1 Mailbox 20 Data 3 Register */
440#define CAN1_MB20_LENGTH 0xffc03690 /* CAN Controller 1 Mailbox 20 Length Register */
441#define CAN1_MB20_TIMESTAMP 0xffc03694 /* CAN Controller 1 Mailbox 20 Timestamp Register */
442#define CAN1_MB20_ID0 0xffc03698 /* CAN Controller 1 Mailbox 20 ID0 Register */
443#define CAN1_MB20_ID1 0xffc0369c /* CAN Controller 1 Mailbox 20 ID1 Register */
444#define CAN1_MB21_DATA0 0xffc036a0 /* CAN Controller 1 Mailbox 21 Data 0 Register */
445#define CAN1_MB21_DATA1 0xffc036a4 /* CAN Controller 1 Mailbox 21 Data 1 Register */
446#define CAN1_MB21_DATA2 0xffc036a8 /* CAN Controller 1 Mailbox 21 Data 2 Register */
447#define CAN1_MB21_DATA3 0xffc036ac /* CAN Controller 1 Mailbox 21 Data 3 Register */
448#define CAN1_MB21_LENGTH 0xffc036b0 /* CAN Controller 1 Mailbox 21 Length Register */
449#define CAN1_MB21_TIMESTAMP 0xffc036b4 /* CAN Controller 1 Mailbox 21 Timestamp Register */
450#define CAN1_MB21_ID0 0xffc036b8 /* CAN Controller 1 Mailbox 21 ID0 Register */
451#define CAN1_MB21_ID1 0xffc036bc /* CAN Controller 1 Mailbox 21 ID1 Register */
452#define CAN1_MB22_DATA0 0xffc036c0 /* CAN Controller 1 Mailbox 22 Data 0 Register */
453#define CAN1_MB22_DATA1 0xffc036c4 /* CAN Controller 1 Mailbox 22 Data 1 Register */
454#define CAN1_MB22_DATA2 0xffc036c8 /* CAN Controller 1 Mailbox 22 Data 2 Register */
455#define CAN1_MB22_DATA3 0xffc036cc /* CAN Controller 1 Mailbox 22 Data 3 Register */
456#define CAN1_MB22_LENGTH 0xffc036d0 /* CAN Controller 1 Mailbox 22 Length Register */
457#define CAN1_MB22_TIMESTAMP 0xffc036d4 /* CAN Controller 1 Mailbox 22 Timestamp Register */
458#define CAN1_MB22_ID0 0xffc036d8 /* CAN Controller 1 Mailbox 22 ID0 Register */
459#define CAN1_MB22_ID1 0xffc036dc /* CAN Controller 1 Mailbox 22 ID1 Register */
460#define CAN1_MB23_DATA0 0xffc036e0 /* CAN Controller 1 Mailbox 23 Data 0 Register */
461#define CAN1_MB23_DATA1 0xffc036e4 /* CAN Controller 1 Mailbox 23 Data 1 Register */
462#define CAN1_MB23_DATA2 0xffc036e8 /* CAN Controller 1 Mailbox 23 Data 2 Register */
463#define CAN1_MB23_DATA3 0xffc036ec /* CAN Controller 1 Mailbox 23 Data 3 Register */
464#define CAN1_MB23_LENGTH 0xffc036f0 /* CAN Controller 1 Mailbox 23 Length Register */
465#define CAN1_MB23_TIMESTAMP 0xffc036f4 /* CAN Controller 1 Mailbox 23 Timestamp Register */
466#define CAN1_MB23_ID0 0xffc036f8 /* CAN Controller 1 Mailbox 23 ID0 Register */
467#define CAN1_MB23_ID1 0xffc036fc /* CAN Controller 1 Mailbox 23 ID1 Register */
468#define CAN1_MB24_DATA0 0xffc03700 /* CAN Controller 1 Mailbox 24 Data 0 Register */
469#define CAN1_MB24_DATA1 0xffc03704 /* CAN Controller 1 Mailbox 24 Data 1 Register */
470#define CAN1_MB24_DATA2 0xffc03708 /* CAN Controller 1 Mailbox 24 Data 2 Register */
471#define CAN1_MB24_DATA3 0xffc0370c /* CAN Controller 1 Mailbox 24 Data 3 Register */
472#define CAN1_MB24_LENGTH 0xffc03710 /* CAN Controller 1 Mailbox 24 Length Register */
473#define CAN1_MB24_TIMESTAMP 0xffc03714 /* CAN Controller 1 Mailbox 24 Timestamp Register */
474#define CAN1_MB24_ID0 0xffc03718 /* CAN Controller 1 Mailbox 24 ID0 Register */
475#define CAN1_MB24_ID1 0xffc0371c /* CAN Controller 1 Mailbox 24 ID1 Register */
476#define CAN1_MB25_DATA0 0xffc03720 /* CAN Controller 1 Mailbox 25 Data 0 Register */
477#define CAN1_MB25_DATA1 0xffc03724 /* CAN Controller 1 Mailbox 25 Data 1 Register */
478#define CAN1_MB25_DATA2 0xffc03728 /* CAN Controller 1 Mailbox 25 Data 2 Register */
479#define CAN1_MB25_DATA3 0xffc0372c /* CAN Controller 1 Mailbox 25 Data 3 Register */
480#define CAN1_MB25_LENGTH 0xffc03730 /* CAN Controller 1 Mailbox 25 Length Register */
481#define CAN1_MB25_TIMESTAMP 0xffc03734 /* CAN Controller 1 Mailbox 25 Timestamp Register */
482#define CAN1_MB25_ID0 0xffc03738 /* CAN Controller 1 Mailbox 25 ID0 Register */
483#define CAN1_MB25_ID1 0xffc0373c /* CAN Controller 1 Mailbox 25 ID1 Register */
484#define CAN1_MB26_DATA0 0xffc03740 /* CAN Controller 1 Mailbox 26 Data 0 Register */
485#define CAN1_MB26_DATA1 0xffc03744 /* CAN Controller 1 Mailbox 26 Data 1 Register */
486#define CAN1_MB26_DATA2 0xffc03748 /* CAN Controller 1 Mailbox 26 Data 2 Register */
487#define CAN1_MB26_DATA3 0xffc0374c /* CAN Controller 1 Mailbox 26 Data 3 Register */
488#define CAN1_MB26_LENGTH 0xffc03750 /* CAN Controller 1 Mailbox 26 Length Register */
489#define CAN1_MB26_TIMESTAMP 0xffc03754 /* CAN Controller 1 Mailbox 26 Timestamp Register */
490#define CAN1_MB26_ID0 0xffc03758 /* CAN Controller 1 Mailbox 26 ID0 Register */
491#define CAN1_MB26_ID1 0xffc0375c /* CAN Controller 1 Mailbox 26 ID1 Register */
492#define CAN1_MB27_DATA0 0xffc03760 /* CAN Controller 1 Mailbox 27 Data 0 Register */
493#define CAN1_MB27_DATA1 0xffc03764 /* CAN Controller 1 Mailbox 27 Data 1 Register */
494#define CAN1_MB27_DATA2 0xffc03768 /* CAN Controller 1 Mailbox 27 Data 2 Register */
495#define CAN1_MB27_DATA3 0xffc0376c /* CAN Controller 1 Mailbox 27 Data 3 Register */
496#define CAN1_MB27_LENGTH 0xffc03770 /* CAN Controller 1 Mailbox 27 Length Register */
497#define CAN1_MB27_TIMESTAMP 0xffc03774 /* CAN Controller 1 Mailbox 27 Timestamp Register */
498#define CAN1_MB27_ID0 0xffc03778 /* CAN Controller 1 Mailbox 27 ID0 Register */
499#define CAN1_MB27_ID1 0xffc0377c /* CAN Controller 1 Mailbox 27 ID1 Register */
500#define CAN1_MB28_DATA0 0xffc03780 /* CAN Controller 1 Mailbox 28 Data 0 Register */
501#define CAN1_MB28_DATA1 0xffc03784 /* CAN Controller 1 Mailbox 28 Data 1 Register */
502#define CAN1_MB28_DATA2 0xffc03788 /* CAN Controller 1 Mailbox 28 Data 2 Register */
503#define CAN1_MB28_DATA3 0xffc0378c /* CAN Controller 1 Mailbox 28 Data 3 Register */
504#define CAN1_MB28_LENGTH 0xffc03790 /* CAN Controller 1 Mailbox 28 Length Register */
505#define CAN1_MB28_TIMESTAMP 0xffc03794 /* CAN Controller 1 Mailbox 28 Timestamp Register */
506#define CAN1_MB28_ID0 0xffc03798 /* CAN Controller 1 Mailbox 28 ID0 Register */
507#define CAN1_MB28_ID1 0xffc0379c /* CAN Controller 1 Mailbox 28 ID1 Register */
508#define CAN1_MB29_DATA0 0xffc037a0 /* CAN Controller 1 Mailbox 29 Data 0 Register */
509#define CAN1_MB29_DATA1 0xffc037a4 /* CAN Controller 1 Mailbox 29 Data 1 Register */
510#define CAN1_MB29_DATA2 0xffc037a8 /* CAN Controller 1 Mailbox 29 Data 2 Register */
511#define CAN1_MB29_DATA3 0xffc037ac /* CAN Controller 1 Mailbox 29 Data 3 Register */
512#define CAN1_MB29_LENGTH 0xffc037b0 /* CAN Controller 1 Mailbox 29 Length Register */
513#define CAN1_MB29_TIMESTAMP 0xffc037b4 /* CAN Controller 1 Mailbox 29 Timestamp Register */
514#define CAN1_MB29_ID0 0xffc037b8 /* CAN Controller 1 Mailbox 29 ID0 Register */
515#define CAN1_MB29_ID1 0xffc037bc /* CAN Controller 1 Mailbox 29 ID1 Register */
516#define CAN1_MB30_DATA0 0xffc037c0 /* CAN Controller 1 Mailbox 30 Data 0 Register */
517#define CAN1_MB30_DATA1 0xffc037c4 /* CAN Controller 1 Mailbox 30 Data 1 Register */
518#define CAN1_MB30_DATA2 0xffc037c8 /* CAN Controller 1 Mailbox 30 Data 2 Register */
519#define CAN1_MB30_DATA3 0xffc037cc /* CAN Controller 1 Mailbox 30 Data 3 Register */
520#define CAN1_MB30_LENGTH 0xffc037d0 /* CAN Controller 1 Mailbox 30 Length Register */
521#define CAN1_MB30_TIMESTAMP 0xffc037d4 /* CAN Controller 1 Mailbox 30 Timestamp Register */
522#define CAN1_MB30_ID0 0xffc037d8 /* CAN Controller 1 Mailbox 30 ID0 Register */
523#define CAN1_MB30_ID1 0xffc037dc /* CAN Controller 1 Mailbox 30 ID1 Register */
524#define CAN1_MB31_DATA0 0xffc037e0 /* CAN Controller 1 Mailbox 31 Data 0 Register */
525#define CAN1_MB31_DATA1 0xffc037e4 /* CAN Controller 1 Mailbox 31 Data 1 Register */
526#define CAN1_MB31_DATA2 0xffc037e8 /* CAN Controller 1 Mailbox 31 Data 2 Register */
527#define CAN1_MB31_DATA3 0xffc037ec /* CAN Controller 1 Mailbox 31 Data 3 Register */
528#define CAN1_MB31_LENGTH 0xffc037f0 /* CAN Controller 1 Mailbox 31 Length Register */
529#define CAN1_MB31_TIMESTAMP 0xffc037f4 /* CAN Controller 1 Mailbox 31 Timestamp Register */
530#define CAN1_MB31_ID0 0xffc037f8 /* CAN Controller 1 Mailbox 31 ID0 Register */
531#define CAN1_MB31_ID1 0xffc037fc /* CAN Controller 1 Mailbox 31 ID1 Register */
532
533/* ATAPI Registers */
534
535#define ATAPI_CONTROL 0xffc03800 /* ATAPI Control Register */
536#define ATAPI_STATUS 0xffc03804 /* ATAPI Status Register */
537#define ATAPI_DEV_ADDR 0xffc03808 /* ATAPI Device Register Address */
538#define ATAPI_DEV_TXBUF 0xffc0380c /* ATAPI Device Register Write Data */
539#define ATAPI_DEV_RXBUF 0xffc03810 /* ATAPI Device Register Read Data */
540#define ATAPI_INT_MASK 0xffc03814 /* ATAPI Interrupt Mask Register */
541#define ATAPI_INT_STATUS 0xffc03818 /* ATAPI Interrupt Status Register */
542#define ATAPI_XFER_LEN 0xffc0381c /* ATAPI Length of Transfer */
543#define ATAPI_LINE_STATUS 0xffc03820 /* ATAPI Line Status */
544#define ATAPI_SM_STATE 0xffc03824 /* ATAPI State Machine Status */
545#define ATAPI_TERMINATE 0xffc03828 /* ATAPI Host Terminate */
546#define ATAPI_PIO_TFRCNT 0xffc0382c /* ATAPI PIO mode transfer count */
547#define ATAPI_DMA_TFRCNT 0xffc03830 /* ATAPI DMA mode transfer count */
548#define ATAPI_UMAIN_TFRCNT 0xffc03834 /* ATAPI UDMAIN transfer count */
549#define ATAPI_UDMAOUT_TFRCNT 0xffc03838 /* ATAPI UDMAOUT transfer count */
550#define ATAPI_REG_TIM_0 0xffc03840 /* ATAPI Register Transfer Timing 0 */
551#define ATAPI_PIO_TIM_0 0xffc03844 /* ATAPI PIO Timing 0 Register */
552#define ATAPI_PIO_TIM_1 0xffc03848 /* ATAPI PIO Timing 1 Register */
553#define ATAPI_MULTI_TIM_0 0xffc03850 /* ATAPI Multi-DMA Timing 0 Register */
554#define ATAPI_MULTI_TIM_1 0xffc03854 /* ATAPI Multi-DMA Timing 1 Register */
555#define ATAPI_MULTI_TIM_2 0xffc03858 /* ATAPI Multi-DMA Timing 2 Register */
556#define ATAPI_ULTRA_TIM_0 0xffc03860 /* ATAPI Ultra-DMA Timing 0 Register */
557#define ATAPI_ULTRA_TIM_1 0xffc03864 /* ATAPI Ultra-DMA Timing 1 Register */
558#define ATAPI_ULTRA_TIM_2 0xffc03868 /* ATAPI Ultra-DMA Timing 2 Register */
559#define ATAPI_ULTRA_TIM_3 0xffc0386c /* ATAPI Ultra-DMA Timing 3 Register */
560
561/* SDH Registers */
562
563#define SDH_PWR_CTL 0xffc03900 /* SDH Power Control */
564#define SDH_CLK_CTL 0xffc03904 /* SDH Clock Control */
565#define SDH_ARGUMENT 0xffc03908 /* SDH Argument */
566#define SDH_COMMAND 0xffc0390c /* SDH Command */
567#define SDH_RESP_CMD 0xffc03910 /* SDH Response Command */
568#define SDH_RESPONSE0 0xffc03914 /* SDH Response0 */
569#define SDH_RESPONSE1 0xffc03918 /* SDH Response1 */
570#define SDH_RESPONSE2 0xffc0391c /* SDH Response2 */
571#define SDH_RESPONSE3 0xffc03920 /* SDH Response3 */
572#define SDH_DATA_TIMER 0xffc03924 /* SDH Data Timer */
573#define SDH_DATA_LGTH 0xffc03928 /* SDH Data Length */
574#define SDH_DATA_CTL 0xffc0392c /* SDH Data Control */
575#define SDH_DATA_CNT 0xffc03930 /* SDH Data Counter */
576#define SDH_STATUS 0xffc03934 /* SDH Status */
577#define SDH_STATUS_CLR 0xffc03938 /* SDH Status Clear */
578#define SDH_MASK0 0xffc0393c /* SDH Interrupt0 Mask */
579#define SDH_MASK1 0xffc03940 /* SDH Interrupt1 Mask */
580#define SDH_FIFO_CNT 0xffc03948 /* SDH FIFO Counter */
581#define SDH_FIFO 0xffc03980 /* SDH Data FIFO */
582#define SDH_E_STATUS 0xffc039c0 /* SDH Exception Status */
583#define SDH_E_MASK 0xffc039c4 /* SDH Exception Mask */
584#define SDH_CFG 0xffc039c8 /* SDH Configuration */
585#define SDH_RD_WAIT_EN 0xffc039cc /* SDH Read Wait Enable */
586#define SDH_PID0 0xffc039d0 /* SDH Peripheral Identification0 */
587#define SDH_PID1 0xffc039d4 /* SDH Peripheral Identification1 */
588#define SDH_PID2 0xffc039d8 /* SDH Peripheral Identification2 */
589#define SDH_PID3 0xffc039dc /* SDH Peripheral Identification3 */
590#define SDH_PID4 0xffc039e0 /* SDH Peripheral Identification4 */
591#define SDH_PID5 0xffc039e4 /* SDH Peripheral Identification5 */
592#define SDH_PID6 0xffc039e8 /* SDH Peripheral Identification6 */
593#define SDH_PID7 0xffc039ec /* SDH Peripheral Identification7 */
594
595/* HOST Port Registers */
596
597#define HOST_CONTROL 0xffc03a00 /* HOST Control Register */
598#define HOST_STATUS 0xffc03a04 /* HOST Status Register */
599#define HOST_TIMEOUT 0xffc03a08 /* HOST Acknowledge Mode Timeout Register */
600
601/* USB Control Registers */
602
603#define USB_FADDR 0xffc03c00 /* Function address register */
604#define USB_POWER 0xffc03c04 /* Power management register */
605#define USB_INTRTX 0xffc03c08 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
606#define USB_INTRRX 0xffc03c0c /* Interrupt register for Rx endpoints 1 to 7 */
607#define USB_INTRTXE 0xffc03c10 /* Interrupt enable register for IntrTx */
608#define USB_INTRRXE 0xffc03c14 /* Interrupt enable register for IntrRx */
609#define USB_INTRUSB 0xffc03c18 /* Interrupt register for common USB interrupts */
610#define USB_INTRUSBE 0xffc03c1c /* Interrupt enable register for IntrUSB */
611#define USB_FRAME 0xffc03c20 /* USB frame number */
612#define USB_INDEX 0xffc03c24 /* Index register for selecting the indexed endpoint registers */
613#define USB_TESTMODE 0xffc03c28 /* Enabled USB 20 test modes */
614#define USB_GLOBINTR 0xffc03c2c /* Global Interrupt Mask register and Wakeup Exception Interrupt */
615#define USB_GLOBAL_CTL 0xffc03c30 /* Global Clock Control for the core */
616
617/* USB Packet Control Registers */
618
619#define USB_TX_MAX_PACKET 0xffc03c40 /* Maximum packet size for Host Tx endpoint */
620#define USB_CSR0 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
621#define USB_TXCSR 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
622#define USB_RX_MAX_PACKET 0xffc03c48 /* Maximum packet size for Host Rx endpoint */
623#define USB_RXCSR 0xffc03c4c /* Control Status register for Host Rx endpoint */
624#define USB_COUNT0 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
625#define USB_RXCOUNT 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
626#define USB_TXTYPE 0xffc03c54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint */
627#define USB_NAKLIMIT0 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
628#define USB_TXINTERVAL 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
629#define USB_RXTYPE 0xffc03c5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint */
630#define USB_RXINTERVAL 0xffc03c60 /* Sets the polling interval for Interrupt and Isochronous transfers or the NAK response timeout on Bulk transfers */
631#define USB_TXCOUNT 0xffc03c68 /* Number of bytes to be written to the selected endpoint Tx FIFO */
632
633/* USB Endpoint FIFO Registers */
634
635#define USB_EP0_FIFO 0xffc03c80 /* Endpoint 0 FIFO */
636#define USB_EP1_FIFO 0xffc03c88 /* Endpoint 1 FIFO */
637#define USB_EP2_FIFO 0xffc03c90 /* Endpoint 2 FIFO */
638#define USB_EP3_FIFO 0xffc03c98 /* Endpoint 3 FIFO */
639#define USB_EP4_FIFO 0xffc03ca0 /* Endpoint 4 FIFO */
640#define USB_EP5_FIFO 0xffc03ca8 /* Endpoint 5 FIFO */
641#define USB_EP6_FIFO 0xffc03cb0 /* Endpoint 6 FIFO */
642#define USB_EP7_FIFO 0xffc03cb8 /* Endpoint 7 FIFO */
643
644/* USB OTG Control Registers */
645
646#define USB_OTG_DEV_CTL 0xffc03d00 /* OTG Device Control Register */
647#define USB_OTG_VBUS_IRQ 0xffc03d04 /* OTG VBUS Control Interrupts */
648#define USB_OTG_VBUS_MASK 0xffc03d08 /* VBUS Control Interrupt Enable */
649
650/* USB Phy Control Registers */
651
652#define USB_LINKINFO 0xffc03d48 /* Enables programming of some PHY-side delays */
653#define USB_VPLEN 0xffc03d4c /* Determines duration of VBUS pulse for VBUS charging */
654#define USB_HS_EOF1 0xffc03d50 /* Time buffer for High-Speed transactions */
655#define USB_FS_EOF1 0xffc03d54 /* Time buffer for Full-Speed transactions */
656#define USB_LS_EOF1 0xffc03d58 /* Time buffer for Low-Speed transactions */
657
658/* (APHY_CNTRL is for ADI usage only) */
659
660#define USB_APHY_CNTRL 0xffc03de0 /* Register that increases visibility of Analog PHY */
661
662/* (APHY_CALIB is for ADI usage only) */
663
664#define USB_APHY_CALIB 0xffc03de4 /* Register used to set some calibration values */
665#define USB_APHY_CNTRL2 0xffc03de8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */
666
667/* (PHY_TEST is for ADI usage only) */
668
669#define USB_PHY_TEST 0xffc03dec /* Used for reducing simulation time and simplifies FIFO testability */
670#define USB_PLLOSC_CTRL 0xffc03df0 /* Used to program different parameters for USB PLL and Oscillator */
671#define USB_SRP_CLKDIV 0xffc03df4 /* Used to program clock divide value for the clock fed to the SRP detection logic */
672
673/* USB Endpoint 0 Control Registers */
674
675#define USB_EP_NI0_TXMAXP 0xffc03e00 /* Maximum packet size for Host Tx endpoint0 */
676#define USB_EP_NI0_TXCSR 0xffc03e04 /* Control Status register for endpoint 0 */
677#define USB_EP_NI0_RXMAXP 0xffc03e08 /* Maximum packet size for Host Rx endpoint0 */
678#define USB_EP_NI0_RXCSR 0xffc03e0c /* Control Status register for Host Rx endpoint0 */
679#define USB_EP_NI0_RXCOUNT 0xffc03e10 /* Number of bytes received in endpoint 0 FIFO */
680#define USB_EP_NI0_TXTYPE 0xffc03e14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint0 */
681#define USB_EP_NI0_TXINTERVAL 0xffc03e18 /* Sets the NAK response timeout on Endpoint 0 */
682#define USB_EP_NI0_RXTYPE 0xffc03e1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint0 */
683#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 */
684
685/* USB Endpoint 1 Control Registers */
686
687#define USB_EP_NI0_TXCOUNT 0xffc03e28 /* Number of bytes to be written to the endpoint0 Tx FIFO */
688#define USB_EP_NI1_TXMAXP 0xffc03e40 /* Maximum packet size for Host Tx endpoint1 */
689#define USB_EP_NI1_TXCSR 0xffc03e44 /* Control Status register for endpoint1 */
690#define USB_EP_NI1_RXMAXP 0xffc03e48 /* Maximum packet size for Host Rx endpoint1 */
691#define USB_EP_NI1_RXCSR 0xffc03e4c /* Control Status register for Host Rx endpoint1 */
692#define USB_EP_NI1_RXCOUNT 0xffc03e50 /* Number of bytes received in endpoint1 FIFO */
693#define USB_EP_NI1_TXTYPE 0xffc03e54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint1 */
694#define USB_EP_NI1_TXINTERVAL 0xffc03e58 /* Sets the NAK response timeout on Endpoint1 */
695#define USB_EP_NI1_RXTYPE 0xffc03e5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint1 */
696#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 */
697
698/* USB Endpoint 2 Control Registers */
699
700#define USB_EP_NI1_TXCOUNT 0xffc03e68 /* Number of bytes to be written to the+H102 endpoint1 Tx FIFO */
701#define USB_EP_NI2_TXMAXP 0xffc03e80 /* Maximum packet size for Host Tx endpoint2 */
702#define USB_EP_NI2_TXCSR 0xffc03e84 /* Control Status register for endpoint2 */
703#define USB_EP_NI2_RXMAXP 0xffc03e88 /* Maximum packet size for Host Rx endpoint2 */
704#define USB_EP_NI2_RXCSR 0xffc03e8c /* Control Status register for Host Rx endpoint2 */
705#define USB_EP_NI2_RXCOUNT 0xffc03e90 /* Number of bytes received in endpoint2 FIFO */
706#define USB_EP_NI2_TXTYPE 0xffc03e94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint2 */
707#define USB_EP_NI2_TXINTERVAL 0xffc03e98 /* Sets the NAK response timeout on Endpoint2 */
708#define USB_EP_NI2_RXTYPE 0xffc03e9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint2 */
709#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 */
710
711/* USB Endpoint 3 Control Registers */
712
713#define USB_EP_NI2_TXCOUNT 0xffc03ea8 /* Number of bytes to be written to the endpoint2 Tx FIFO */
714#define USB_EP_NI3_TXMAXP 0xffc03ec0 /* Maximum packet size for Host Tx endpoint3 */
715#define USB_EP_NI3_TXCSR 0xffc03ec4 /* Control Status register for endpoint3 */
716#define USB_EP_NI3_RXMAXP 0xffc03ec8 /* Maximum packet size for Host Rx endpoint3 */
717#define USB_EP_NI3_RXCSR 0xffc03ecc /* Control Status register for Host Rx endpoint3 */
718#define USB_EP_NI3_RXCOUNT 0xffc03ed0 /* Number of bytes received in endpoint3 FIFO */
719#define USB_EP_NI3_TXTYPE 0xffc03ed4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint3 */
720#define USB_EP_NI3_TXINTERVAL 0xffc03ed8 /* Sets the NAK response timeout on Endpoint3 */
721#define USB_EP_NI3_RXTYPE 0xffc03edc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint3 */
722#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 */
723
724/* USB Endpoint 4 Control Registers */
725
726#define USB_EP_NI3_TXCOUNT 0xffc03ee8 /* Number of bytes to be written to the H124endpoint3 Tx FIFO */
727#define USB_EP_NI4_TXMAXP 0xffc03f00 /* Maximum packet size for Host Tx endpoint4 */
728#define USB_EP_NI4_TXCSR 0xffc03f04 /* Control Status register for endpoint4 */
729#define USB_EP_NI4_RXMAXP 0xffc03f08 /* Maximum packet size for Host Rx endpoint4 */
730#define USB_EP_NI4_RXCSR 0xffc03f0c /* Control Status register for Host Rx endpoint4 */
731#define USB_EP_NI4_RXCOUNT 0xffc03f10 /* Number of bytes received in endpoint4 FIFO */
732#define USB_EP_NI4_TXTYPE 0xffc03f14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint4 */
733#define USB_EP_NI4_TXINTERVAL 0xffc03f18 /* Sets the NAK response timeout on Endpoint4 */
734#define USB_EP_NI4_RXTYPE 0xffc03f1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint4 */
735#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 */
736
737/* USB Endpoint 5 Control Registers */
738
739#define USB_EP_NI4_TXCOUNT 0xffc03f28 /* Number of bytes to be written to the endpoint4 Tx FIFO */
740#define USB_EP_NI5_TXMAXP 0xffc03f40 /* Maximum packet size for Host Tx endpoint5 */
741#define USB_EP_NI5_TXCSR 0xffc03f44 /* Control Status register for endpoint5 */
742#define USB_EP_NI5_RXMAXP 0xffc03f48 /* Maximum packet size for Host Rx endpoint5 */
743#define USB_EP_NI5_RXCSR 0xffc03f4c /* Control Status register for Host Rx endpoint5 */
744#define USB_EP_NI5_RXCOUNT 0xffc03f50 /* Number of bytes received in endpoint5 FIFO */
745#define USB_EP_NI5_TXTYPE 0xffc03f54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint5 */
746#define USB_EP_NI5_TXINTERVAL 0xffc03f58 /* Sets the NAK response timeout on Endpoint5 */
747#define USB_EP_NI5_RXTYPE 0xffc03f5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint5 */
748#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 */
749
750/* USB Endpoint 6 Control Registers */
751
752#define USB_EP_NI5_TXCOUNT 0xffc03f68 /* Number of bytes to be written to the H145endpoint5 Tx FIFO */
753#define USB_EP_NI6_TXMAXP 0xffc03f80 /* Maximum packet size for Host Tx endpoint6 */
754#define USB_EP_NI6_TXCSR 0xffc03f84 /* Control Status register for endpoint6 */
755#define USB_EP_NI6_RXMAXP 0xffc03f88 /* Maximum packet size for Host Rx endpoint6 */
756#define USB_EP_NI6_RXCSR 0xffc03f8c /* Control Status register for Host Rx endpoint6 */
757#define USB_EP_NI6_RXCOUNT 0xffc03f90 /* Number of bytes received in endpoint6 FIFO */
758#define USB_EP_NI6_TXTYPE 0xffc03f94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint6 */
759#define USB_EP_NI6_TXINTERVAL 0xffc03f98 /* Sets the NAK response timeout on Endpoint6 */
760#define USB_EP_NI6_RXTYPE 0xffc03f9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint6 */
761#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 */
762
763/* USB Endpoint 7 Control Registers */
764
765#define USB_EP_NI6_TXCOUNT 0xffc03fa8 /* Number of bytes to be written to the endpoint6 Tx FIFO */
766#define USB_EP_NI7_TXMAXP 0xffc03fc0 /* Maximum packet size for Host Tx endpoint7 */
767#define USB_EP_NI7_TXCSR 0xffc03fc4 /* Control Status register for endpoint7 */
768#define USB_EP_NI7_RXMAXP 0xffc03fc8 /* Maximum packet size for Host Rx endpoint7 */
769#define USB_EP_NI7_RXCSR 0xffc03fcc /* Control Status register for Host Rx endpoint7 */
770#define USB_EP_NI7_RXCOUNT 0xffc03fd0 /* Number of bytes received in endpoint7 FIFO */
771#define USB_EP_NI7_TXTYPE 0xffc03fd4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint7 */
772#define USB_EP_NI7_TXINTERVAL 0xffc03fd8 /* Sets the NAK response timeout on Endpoint7 */
773#define USB_EP_NI7_RXTYPE 0xffc03fdc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint7 */
774#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 */
775#define USB_EP_NI7_TXCOUNT 0xffc03ff8 /* Number of bytes to be written to the endpoint7 Tx FIFO */
776#define USB_DMA_INTERRUPT 0xffc04000 /* Indicates pending interrupts for the DMA channels */
777
778/* USB Channel 0 Config Registers */
779
780#define USB_DMA0CONTROL 0xffc04004 /* DMA master channel 0 configuration */
781#define USB_DMA0ADDRLOW 0xffc04008 /* Lower 16-bits of memory source/destination address for DMA master channel 0 */
782#define USB_DMA0ADDRHIGH 0xffc0400c /* Upper 16-bits of memory source/destination address for DMA master channel 0 */
783#define USB_DMA0COUNTLOW 0xffc04010 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 0 */
784#define USB_DMA0COUNTHIGH 0xffc04014 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 0 */
785
786/* USB Channel 1 Config Registers */
787
788#define USB_DMA1CONTROL 0xffc04024 /* DMA master channel 1 configuration */
789#define USB_DMA1ADDRLOW 0xffc04028 /* Lower 16-bits of memory source/destination address for DMA master channel 1 */
790#define USB_DMA1ADDRHIGH 0xffc0402c /* Upper 16-bits of memory source/destination address for DMA master channel 1 */
791#define USB_DMA1COUNTLOW 0xffc04030 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 1 */
792#define USB_DMA1COUNTHIGH 0xffc04034 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 1 */
793
794/* USB Channel 2 Config Registers */
795
796#define USB_DMA2CONTROL 0xffc04044 /* DMA master channel 2 configuration */
797#define USB_DMA2ADDRLOW 0xffc04048 /* Lower 16-bits of memory source/destination address for DMA master channel 2 */
798#define USB_DMA2ADDRHIGH 0xffc0404c /* Upper 16-bits of memory source/destination address for DMA master channel 2 */
799#define USB_DMA2COUNTLOW 0xffc04050 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 2 */
800#define USB_DMA2COUNTHIGH 0xffc04054 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 2 */
801
802/* USB Channel 3 Config Registers */
803
804#define USB_DMA3CONTROL 0xffc04064 /* DMA master channel 3 configuration */
805#define USB_DMA3ADDRLOW 0xffc04068 /* Lower 16-bits of memory source/destination address for DMA master channel 3 */
806#define USB_DMA3ADDRHIGH 0xffc0406c /* Upper 16-bits of memory source/destination address for DMA master channel 3 */
807#define USB_DMA3COUNTLOW 0xffc04070 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 3 */
808#define USB_DMA3COUNTHIGH 0xffc04074 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 3 */
809
810/* USB Channel 4 Config Registers */
811
812#define USB_DMA4CONTROL 0xffc04084 /* DMA master channel 4 configuration */
813#define USB_DMA4ADDRLOW 0xffc04088 /* Lower 16-bits of memory source/destination address for DMA master channel 4 */
814#define USB_DMA4ADDRHIGH 0xffc0408c /* Upper 16-bits of memory source/destination address for DMA master channel 4 */
815#define USB_DMA4COUNTLOW 0xffc04090 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 4 */
816#define USB_DMA4COUNTHIGH 0xffc04094 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 4 */
817
818/* USB Channel 5 Config Registers */
819
820#define USB_DMA5CONTROL 0xffc040a4 /* DMA master channel 5 configuration */
821#define USB_DMA5ADDRLOW 0xffc040a8 /* Lower 16-bits of memory source/destination address for DMA master channel 5 */
822#define USB_DMA5ADDRHIGH 0xffc040ac /* Upper 16-bits of memory source/destination address for DMA master channel 5 */
823#define USB_DMA5COUNTLOW 0xffc040b0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 5 */
824#define USB_DMA5COUNTHIGH 0xffc040b4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 5 */
825
826/* USB Channel 6 Config Registers */
827
828#define USB_DMA6CONTROL 0xffc040c4 /* DMA master channel 6 configuration */
829#define USB_DMA6ADDRLOW 0xffc040c8 /* Lower 16-bits of memory source/destination address for DMA master channel 6 */
830#define USB_DMA6ADDRHIGH 0xffc040cc /* Upper 16-bits of memory source/destination address for DMA master channel 6 */
831#define USB_DMA6COUNTLOW 0xffc040d0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 6 */
832#define USB_DMA6COUNTHIGH 0xffc040d4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 6 */
833
834/* USB Channel 7 Config Registers */
835
836#define USB_DMA7CONTROL 0xffc040e4 /* DMA master channel 7 configuration */
837#define USB_DMA7ADDRLOW 0xffc040e8 /* Lower 16-bits of memory source/destination address for DMA master channel 7 */
838#define USB_DMA7ADDRHIGH 0xffc040ec /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
839#define USB_DMA7COUNTLOW 0xffc040f0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
840#define USB_DMA7COUNTHIGH 0xffc040f4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
841
842/* Keypad Registers */
843
844#define KPAD_CTL 0xffc04100 /* Controls keypad module enable and disable */
845#define KPAD_PRESCALE 0xffc04104 /* Establish a time base for programing the KPAD_MSEL register */
846#define KPAD_MSEL 0xffc04108 /* Selects delay parameters for keypad interface sensitivity */
847#define KPAD_ROWCOL 0xffc0410c /* Captures the row and column output values of the keys pressed */
848#define KPAD_STAT 0xffc04110 /* Holds and clears the status of the keypad interface interrupt */
849#define KPAD_SOFTEVAL 0xffc04114 /* Lets software force keypad interface to check for keys being pressed */
850
851/* Pixel Compositor (PIXC) Registers */
852
853#define PIXC_CTL 0xffc04400 /* Overlay enable, resampling mode, I/O data format, transparency enable, watermark level, FIFO status */
854#define PIXC_PPL 0xffc04404 /* Holds the number of pixels per line of the display */
855#define PIXC_LPF 0xffc04408 /* Holds the number of lines per frame of the display */
856#define PIXC_AHSTART 0xffc0440c /* Contains horizontal start pixel information of the overlay data (set A) */
857#define PIXC_AHEND 0xffc04410 /* Contains horizontal end pixel information of the overlay data (set A) */
858#define PIXC_AVSTART 0xffc04414 /* Contains vertical start pixel information of the overlay data (set A) */
859#define PIXC_AVEND 0xffc04418 /* Contains vertical end pixel information of the overlay data (set A) */
860#define PIXC_ATRANSP 0xffc0441c /* Contains the transparency ratio (set A) */
861#define PIXC_BHSTART 0xffc04420 /* Contains horizontal start pixel information of the overlay data (set B) */
862#define PIXC_BHEND 0xffc04424 /* Contains horizontal end pixel information of the overlay data (set B) */
863#define PIXC_BVSTART 0xffc04428 /* Contains vertical start pixel information of the overlay data (set B) */
864#define PIXC_BVEND 0xffc0442c /* Contains vertical end pixel information of the overlay data (set B) */
865#define PIXC_BTRANSP 0xffc04430 /* Contains the transparency ratio (set B) */
866#define PIXC_INTRSTAT 0xffc0443c /* Overlay interrupt configuration/status */
867#define PIXC_RYCON 0xffc04440 /* Color space conversion matrix register. Contains the R/Y conversion coefficients */
868#define PIXC_GUCON 0xffc04444 /* Color space conversion matrix register. Contains the G/U conversion coefficients */
869#define PIXC_BVCON 0xffc04448 /* Color space conversion matrix register. Contains the B/V conversion coefficients */
870#define PIXC_CCBIAS 0xffc0444c /* Bias values for the color space conversion matrix */
871#define PIXC_TC 0xffc04450 /* Holds the transparent color value */
872
873/* Handshake MDMA 0 Registers */
874
875#define HMDMA0_CONTROL 0xffc04500 /* Handshake MDMA0 Control Register */
876#define HMDMA0_ECINIT 0xffc04504 /* Handshake MDMA0 Initial Edge Count Register */
877#define HMDMA0_BCINIT 0xffc04508 /* Handshake MDMA0 Initial Block Count Register */
878#define HMDMA0_ECURGENT 0xffc0450c /* Handshake MDMA0 Urgent Edge Count Threshhold Register */
879#define HMDMA0_ECOVERFLOW 0xffc04510 /* Handshake MDMA0 Edge Count Overflow Interrupt Register */
880#define HMDMA0_ECOUNT 0xffc04514 /* Handshake MDMA0 Current Edge Count Register */
881#define HMDMA0_BCOUNT 0xffc04518 /* Handshake MDMA0 Current Block Count Register */
882
883/* Handshake MDMA 1 Registers */
884
885#define HMDMA1_CONTROL 0xffc04540 /* Handshake MDMA1 Control Register */
886#define HMDMA1_ECINIT 0xffc04544 /* Handshake MDMA1 Initial Edge Count Register */
887#define HMDMA1_BCINIT 0xffc04548 /* Handshake MDMA1 Initial Block Count Register */
888#define HMDMA1_ECURGENT 0xffc0454c /* Handshake MDMA1 Urgent Edge Count Threshhold Register */
889#define HMDMA1_ECOVERFLOW 0xffc04550 /* Handshake MDMA1 Edge Count Overflow Interrupt Register */
890#define HMDMA1_ECOUNT 0xffc04554 /* Handshake MDMA1 Current Edge Count Register */
891#define HMDMA1_BCOUNT 0xffc04558 /* Handshake MDMA1 Current Block Count Register */
892
893
894/* ********************************************************** */
895/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
896/* and MULTI BIT READ MACROS */
897/* ********************************************************** */
898
899/* Bit masks for PIXC_CTL */
900
901#define PIXC_EN 0x1 /* Pixel Compositor Enable */
902#define nPIXC_EN 0x0
903#define OVR_A_EN 0x2 /* Overlay A Enable */
904#define nOVR_A_EN 0x0
905#define OVR_B_EN 0x4 /* Overlay B Enable */
906#define nOVR_B_EN 0x0
907#define IMG_FORM 0x8 /* Image Data Format */
908#define nIMG_FORM 0x0
909#define OVR_FORM 0x10 /* Overlay Data Format */
910#define nOVR_FORM 0x0
911#define OUT_FORM 0x20 /* Output Data Format */
912#define nOUT_FORM 0x0
913#define UDS_MOD 0x40 /* Resampling Mode */
914#define nUDS_MOD 0x0
915#define TC_EN 0x80 /* Transparent Color Enable */
916#define nTC_EN 0x0
917#define IMG_STAT 0x300 /* Image FIFO Status */
918#define OVR_STAT 0xc00 /* Overlay FIFO Status */
919#define WM_LVL 0x3000 /* FIFO Watermark Level */
920
921/* Bit masks for PIXC_AHSTART */
922
923#define A_HSTART 0xfff /* Horizontal Start Coordinates */
924
925/* Bit masks for PIXC_AHEND */
926
927#define A_HEND 0xfff /* Horizontal End Coordinates */
928
929/* Bit masks for PIXC_AVSTART */
930
931#define A_VSTART 0x3ff /* Vertical Start Coordinates */
932
933/* Bit masks for PIXC_AVEND */
934
935#define A_VEND 0x3ff /* Vertical End Coordinates */
936
937/* Bit masks for PIXC_ATRANSP */
938
939#define A_TRANSP 0xf /* Transparency Value */
940
941/* Bit masks for PIXC_BHSTART */
942
943#define B_HSTART 0xfff /* Horizontal Start Coordinates */
944
945/* Bit masks for PIXC_BHEND */
946
947#define B_HEND 0xfff /* Horizontal End Coordinates */
948
949/* Bit masks for PIXC_BVSTART */
950
951#define B_VSTART 0x3ff /* Vertical Start Coordinates */
952
953/* Bit masks for PIXC_BVEND */
954
955#define B_VEND 0x3ff /* Vertical End Coordinates */
956
957/* Bit masks for PIXC_BTRANSP */
958
959#define B_TRANSP 0xf /* Transparency Value */
960
961/* Bit masks for PIXC_INTRSTAT */
962
963#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */
964#define nOVR_INT_EN 0x0
965#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */
966#define nFRM_INT_EN 0x0
967#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */
968#define nOVR_INT_STAT 0x0
969#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */
970#define nFRM_INT_STAT 0x0
971
972/* Bit masks for PIXC_RYCON */
973
974#define A11 0x3ff /* A11 in the Coefficient Matrix */
975#define A12 0xffc00 /* A12 in the Coefficient Matrix */
976#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */
977#define RY_MULT4 0x40000000 /* Multiply Row by 4 */
978#define nRY_MULT4 0x0
979
980/* Bit masks for PIXC_GUCON */
981
982#define A21 0x3ff /* A21 in the Coefficient Matrix */
983#define A22 0xffc00 /* A22 in the Coefficient Matrix */
984#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */
985#define GU_MULT4 0x40000000 /* Multiply Row by 4 */
986#define nGU_MULT4 0x0
987
988/* Bit masks for PIXC_BVCON */
989
990#define A31 0x3ff /* A31 in the Coefficient Matrix */
991#define A32 0xffc00 /* A32 in the Coefficient Matrix */
992#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */
993#define BV_MULT4 0x40000000 /* Multiply Row by 4 */
994#define nBV_MULT4 0x0
995
996/* Bit masks for PIXC_CCBIAS */
997
998#define A14 0x3ff /* A14 in the Bias Vector */
999#define A24 0xffc00 /* A24 in the Bias Vector */
1000#define A34 0x3ff00000 /* A34 in the Bias Vector */
1001
1002/* Bit masks for PIXC_TC */
1003
1004#define RY_TRANS 0xff /* Transparent Color - R/Y Component */
1005#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */
1006#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */
1007
1008/* Bit masks for HOST_CONTROL */
1009
1010#define HOST_EN 0x1 /* Host Enable */
1011#define nHOST_EN 0x0
1012#define HOST_END 0x2 /* Host Endianess */
1013#define nHOST_END 0x0
1014#define DATA_SIZE 0x4 /* Data Size */
1015#define nDATA_SIZE 0x0
1016#define HOST_RST 0x8 /* Host Reset */
1017#define nHOST_RST 0x0
1018#define HRDY_OVR 0x20 /* Host Ready Override */
1019#define nHRDY_OVR 0x0
1020#define INT_MODE 0x40 /* Interrupt Mode */
1021#define nINT_MODE 0x0
1022#define BT_EN 0x80 /* Bus Timeout Enable */
1023#define nBT_EN 0x0
1024#define EHW 0x100 /* Enable Host Write */
1025#define nEHW 0x0
1026#define EHR 0x200 /* Enable Host Read */
1027#define nEHR 0x0
1028#define BDR 0x400 /* Burst DMA Requests */
1029#define nBDR 0x0
1030
1031/* Bit masks for HOST_STATUS */
1032
1033#define READY 0x1 /* DMA Ready */
1034#define nREADY 0x0
1035#define FIFOFULL 0x2 /* FIFO Full */
1036#define nFIFOFULL 0x0
1037#define FIFOEMPTY 0x4 /* FIFO Empty */
1038#define nFIFOEMPTY 0x0
1039#define COMPLETE 0x8 /* DMA Complete */
1040#define nCOMPLETE 0x0
1041#define HSHK 0x10 /* Host Handshake */
1042#define nHSHK 0x0
1043#define TIMEOUT 0x20 /* Host Timeout */
1044#define nTIMEOUT 0x0
1045#define HIRQ 0x40 /* Host Interrupt Request */
1046#define nHIRQ 0x0
1047#define ALLOW_CNFG 0x80 /* Allow New Configuration */
1048#define nALLOW_CNFG 0x0
1049#define DMA_DIR 0x100 /* DMA Direction */
1050#define nDMA_DIR 0x0
1051#define BTE 0x200 /* Bus Timeout Enabled */
1052#define nBTE 0x0
1053
1054/* Bit masks for HOST_TIMEOUT */
1055
1056#define COUNT_TIMEOUT 0x7ff /* Host Timeout count */
1057
1058/* Bit masks for KPAD_CTL */
1059
1060#define KPAD_EN 0x1 /* Keypad Enable */
1061#define nKPAD_EN 0x0
1062#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */
1063#define KPAD_ROWEN 0x1c00 /* Row Enable Width */
1064#define KPAD_COLEN 0xe000 /* Column Enable Width */
1065
1066/* Bit masks for KPAD_PRESCALE */
1067
1068#define KPAD_PRESCALE_VAL 0x3f /* Key Prescale Value */
1069
1070/* Bit masks for KPAD_MSEL */
1071
1072#define DBON_SCALE 0xff /* Debounce Scale Value */
1073#define COLDRV_SCALE 0xff00 /* Column Driver Scale Value */
1074
1075/* Bit masks for KPAD_ROWCOL */
1076
1077#define KPAD_ROW 0xff /* Rows Pressed */
1078#define KPAD_COL 0xff00 /* Columns Pressed */
1079
1080/* Bit masks for KPAD_STAT */
1081
1082#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */
1083#define nKPAD_IRQ 0x0
1084#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */
1085#define KPAD_PRESSED 0x8 /* Key press current status */
1086#define nKPAD_PRESSED 0x0
1087
1088/* Bit masks for KPAD_SOFTEVAL */
1089
1090#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */
1091#define nKPAD_SOFTEVAL_E 0x0
1092
1093/* Bit masks for SDH_COMMAND */
1094
1095#define CMD_IDX 0x3f /* Command Index */
1096#define CMD_RSP 0x40 /* Response */
1097#define nCMD_RSP 0x0
1098#define CMD_L_RSP 0x80 /* Long Response */
1099#define nCMD_L_RSP 0x0
1100#define CMD_INT_E 0x100 /* Command Interrupt */
1101#define nCMD_INT_E 0x0
1102#define CMD_PEND_E 0x200 /* Command Pending */
1103#define nCMD_PEND_E 0x0
1104#define CMD_E 0x400 /* Command Enable */
1105#define nCMD_E 0x0
1106
1107/* Bit masks for SDH_PWR_CTL */
1108
1109#define PWR_ON 0x3 /* Power On */
1110#if 0
1111#define TBD 0x3c /* TBD */
1112#endif
1113#define SD_CMD_OD 0x40 /* Open Drain Output */
1114#define nSD_CMD_OD 0x0
1115#define ROD_CTL 0x80 /* Rod Control */
1116#define nROD_CTL 0x0
1117
1118/* Bit masks for SDH_CLK_CTL */
1119
1120#define CLKDIV 0xff /* MC_CLK Divisor */
1121#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
1122#define nCLK_E 0x0
1123#define PWR_SV_E 0x200 /* Power Save Enable */
1124#define nPWR_SV_E 0x0
1125#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
1126#define nCLKDIV_BYPASS 0x0
1127#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
1128#define nWIDE_BUS 0x0
1129
1130/* Bit masks for SDH_RESP_CMD */
1131
1132#define RESP_CMD 0x3f /* Response Command */
1133
1134/* Bit masks for SDH_DATA_CTL */
1135
1136#define DTX_E 0x1 /* Data Transfer Enable */
1137#define nDTX_E 0x0
1138#define DTX_DIR 0x2 /* Data Transfer Direction */
1139#define nDTX_DIR 0x0
1140#define DTX_MODE 0x4 /* Data Transfer Mode */
1141#define nDTX_MODE 0x0
1142#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
1143#define nDTX_DMA_E 0x0
1144#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
1145
1146/* Bit masks for SDH_STATUS */
1147
1148#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
1149#define nCMD_CRC_FAIL 0x0
1150#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
1151#define nDAT_CRC_FAIL 0x0
1152#define CMD_TIMEOUT 0x4 /* CMD Time Out */
1153#define nCMD_TIMEOUT 0x0
1154#define DAT_TIMEOUT 0x8 /* Data Time Out */
1155#define nDAT_TIMEOUT 0x0
1156#define TX_UNDERRUN 0x10 /* Transmit Underrun */
1157#define nTX_UNDERRUN 0x0
1158#define RX_OVERRUN 0x20 /* Receive Overrun */
1159#define nRX_OVERRUN 0x0
1160#define CMD_RESP_END 0x40 /* CMD Response End */
1161#define nCMD_RESP_END 0x0
1162#define CMD_SENT 0x80 /* CMD Sent */
1163#define nCMD_SENT 0x0
1164#define DAT_END 0x100 /* Data End */
1165#define nDAT_END 0x0
1166#define START_BIT_ERR 0x200 /* Start Bit Error */
1167#define nSTART_BIT_ERR 0x0
1168#define DAT_BLK_END 0x400 /* Data Block End */
1169#define nDAT_BLK_END 0x0
1170#define CMD_ACT 0x800 /* CMD Active */
1171#define nCMD_ACT 0x0
1172#define TX_ACT 0x1000 /* Transmit Active */
1173#define nTX_ACT 0x0
1174#define RX_ACT 0x2000 /* Receive Active */
1175#define nRX_ACT 0x0
1176#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
1177#define nTX_FIFO_STAT 0x0
1178#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
1179#define nRX_FIFO_STAT 0x0
1180#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
1181#define nTX_FIFO_FULL 0x0
1182#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
1183#define nRX_FIFO_FULL 0x0
1184#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
1185#define nTX_FIFO_ZERO 0x0
1186#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
1187#define nRX_DAT_ZERO 0x0
1188#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
1189#define nTX_DAT_RDY 0x0
1190#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
1191#define nRX_FIFO_RDY 0x0
1192
1193/* Bit masks for SDH_STATUS_CLR */
1194
1195#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
1196#define nCMD_CRC_FAIL_STAT 0x0
1197#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
1198#define nDAT_CRC_FAIL_STAT 0x0
1199#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
1200#define nCMD_TIMEOUT_STAT 0x0
1201#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
1202#define nDAT_TIMEOUT_STAT 0x0
1203#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
1204#define nTX_UNDERRUN_STAT 0x0
1205#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
1206#define nRX_OVERRUN_STAT 0x0
1207#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
1208#define nCMD_RESP_END_STAT 0x0
1209#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
1210#define nCMD_SENT_STAT 0x0
1211#define DAT_END_STAT 0x100 /* Data End Status */
1212#define nDAT_END_STAT 0x0
1213#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
1214#define nSTART_BIT_ERR_STAT 0x0
1215#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
1216#define nDAT_BLK_END_STAT 0x0
1217
1218/* Bit masks for SDH_MASK0 */
1219
1220#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
1221#define nCMD_CRC_FAIL_MASK 0x0
1222#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
1223#define nDAT_CRC_FAIL_MASK 0x0
1224#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
1225#define nCMD_TIMEOUT_MASK 0x0
1226#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
1227#define nDAT_TIMEOUT_MASK 0x0
1228#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
1229#define nTX_UNDERRUN_MASK 0x0
1230#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
1231#define nRX_OVERRUN_MASK 0x0
1232#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
1233#define nCMD_RESP_END_MASK 0x0
1234#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
1235#define nCMD_SENT_MASK 0x0
1236#define DAT_END_MASK 0x100 /* Data End Mask */
1237#define nDAT_END_MASK 0x0
1238#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
1239#define nSTART_BIT_ERR_MASK 0x0
1240#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
1241#define nDAT_BLK_END_MASK 0x0
1242#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
1243#define nCMD_ACT_MASK 0x0
1244#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
1245#define nTX_ACT_MASK 0x0
1246#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
1247#define nRX_ACT_MASK 0x0
1248#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
1249#define nTX_FIFO_STAT_MASK 0x0
1250#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
1251#define nRX_FIFO_STAT_MASK 0x0
1252#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
1253#define nTX_FIFO_FULL_MASK 0x0
1254#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
1255#define nRX_FIFO_FULL_MASK 0x0
1256#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
1257#define nTX_FIFO_ZERO_MASK 0x0
1258#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
1259#define nRX_DAT_ZERO_MASK 0x0
1260#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
1261#define nTX_DAT_RDY_MASK 0x0
1262#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
1263#define nRX_FIFO_RDY_MASK 0x0
1264
1265/* Bit masks for SDH_FIFO_CNT */
1266
1267#define FIFO_COUNT 0x7fff /* FIFO Count */
1268
1269/* Bit masks for SDH_E_STATUS */
1270
1271#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
1272#define nSDIO_INT_DET 0x0
1273#define SD_CARD_DET 0x10 /* SD Card Detect */
1274#define nSD_CARD_DET 0x0
1275
1276/* Bit masks for SDH_E_MASK */
1277
1278#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
1279#define nSDIO_MSK 0x0
1280#define SCD_MSK 0x40 /* Mask Card Detect */
1281#define nSCD_MSK 0x0
1282
1283/* Bit masks for SDH_CFG */
1284
1285#define CLKS_EN 0x1 /* Clocks Enable */
1286#define nCLKS_EN 0x0
1287#define SD4E 0x4 /* SDIO 4-Bit Enable */
1288#define nSD4E 0x0
1289#define MWE 0x8 /* Moving Window Enable */
1290#define nMWE 0x0
1291#define SD_RST 0x10 /* SDMMC Reset */
1292#define nSD_RST 0x0
1293#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
1294#define nPUP_SDDAT 0x0
1295#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
1296#define nPUP_SDDAT3 0x0
1297#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
1298#define nPD_SDDAT3 0x0
1299
1300/* Bit masks for SDH_RD_WAIT_EN */
1301
1302#define RWR 0x1 /* Read Wait Request */
1303#define nRWR 0x0
1304
1305/* Bit masks for ATAPI_CONTROL */
1306
1307#define PIO_START 0x1 /* Start PIO/Reg Op */
1308#define nPIO_START 0x0
1309#define MULTI_START 0x2 /* Start Multi-DMA Op */
1310#define nMULTI_START 0x0
1311#define ULTRA_START 0x4 /* Start Ultra-DMA Op */
1312#define nULTRA_START 0x0
1313#define XFER_DIR 0x8 /* Transfer Direction */
1314#define nXFER_DIR 0x0
1315#define IORDY_EN 0x10 /* IORDY Enable */
1316#define nIORDY_EN 0x0
1317#define FIFO_FLUSH 0x20 /* Flush FIFOs */
1318#define nFIFO_FLUSH 0x0
1319#define SOFT_RST 0x40 /* Soft Reset */
1320#define nSOFT_RST 0x0
1321#define DEV_RST 0x80 /* Device Reset */
1322#define nDEV_RST 0x0
1323#define TFRCNT_RST 0x100 /* Trans Count Reset */
1324#define nTFRCNT_RST 0x0
1325#define END_ON_TERM 0x200 /* End/Terminate Select */
1326#define nEND_ON_TERM 0x0
1327#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
1328#define nPIO_USE_DMA 0x0
1329#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
1330
1331/* Bit masks for ATAPI_STATUS */
1332
1333#define PIO_XFER_ON 0x1 /* PIO transfer in progress */
1334#define nPIO_XFER_ON 0x0
1335#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
1336#define nMULTI_XFER_ON 0x0
1337#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
1338#define nULTRA_XFER_ON 0x0
1339#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
1340
1341/* Bit masks for ATAPI_DEV_ADDR */
1342
1343#define DEV_ADDR 0x1f /* Device Address */
1344
1345/* Bit masks for ATAPI_INT_MASK */
1346
1347#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
1348#define nATAPI_DEV_INT_MASK 0x0
1349#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
1350#define nPIO_DONE_MASK 0x0
1351#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
1352#define nMULTI_DONE_MASK 0x0
1353#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
1354#define nUDMAIN_DONE_MASK 0x0
1355#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
1356#define nUDMAOUT_DONE_MASK 0x0
1357#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
1358#define nHOST_TERM_XFER_MASK 0x0
1359#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
1360#define nMULTI_TERM_MASK 0x0
1361#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
1362#define nUDMAIN_TERM_MASK 0x0
1363#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
1364#define nUDMAOUT_TERM_MASK 0x0
1365
1366/* Bit masks for ATAPI_INT_STATUS */
1367
1368#define ATAPI_DEV_INT 0x1 /* Device interrupt status */
1369#define nATAPI_DEV_INT 0x0
1370#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
1371#define nPIO_DONE_INT 0x0
1372#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
1373#define nMULTI_DONE_INT 0x0
1374#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
1375#define nUDMAIN_DONE_INT 0x0
1376#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
1377#define nUDMAOUT_DONE_INT 0x0
1378#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
1379#define nHOST_TERM_XFER_INT 0x0
1380#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
1381#define nMULTI_TERM_INT 0x0
1382#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
1383#define nUDMAIN_TERM_INT 0x0
1384#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
1385#define nUDMAOUT_TERM_INT 0x0
1386
1387/* Bit masks for ATAPI_LINE_STATUS */
1388
1389#define ATAPI_INTR 0x1 /* Device interrupt to host line status */
1390#define nATAPI_INTR 0x0
1391#define ATAPI_DASP 0x2 /* Device dasp to host line status */
1392#define nATAPI_DASP 0x0
1393#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
1394#define nATAPI_CS0N 0x0
1395#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
1396#define nATAPI_CS1N 0x0
1397#define ATAPI_ADDR 0x70 /* ATAPI address line status */
1398#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
1399#define nATAPI_DMAREQ 0x0
1400#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
1401#define nATAPI_DMAACKN 0x0
1402#define ATAPI_DIOWN 0x200 /* ATAPI write line status */
1403#define nATAPI_DIOWN 0x0
1404#define ATAPI_DIORN 0x400 /* ATAPI read line status */
1405#define nATAPI_DIORN 0x0
1406#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
1407#define nATAPI_IORDY 0x0
1408
1409/* Bit masks for ATAPI_SM_STATE */
1410
1411#define PIO_CSTATE 0xf /* PIO mode state machine current state */
1412#define DMA_CSTATE 0xf0 /* DMA mode state machine current state */
1413#define UDMAIN_CSTATE 0xf00 /* Ultra DMA-In mode state machine current state */
1414#define UDMAOUT_CSTATE 0xf000 /* ATAPI IORDY line status */
1415
1416/* Bit masks for ATAPI_TERMINATE */
1417
1418#define ATAPI_HOST_TERM 0x1 /* Host terminationation */
1419#define nATAPI_HOST_TERM 0x0
1420
1421/* Bit masks for ATAPI_REG_TIM_0 */
1422
1423#define T2_REG 0xff /* End of cycle time for register access transfers */
1424#define TEOC_REG 0xff00 /* Selects DIOR/DIOW pulsewidth */
1425
1426/* Bit masks for ATAPI_PIO_TIM_0 */
1427
1428#define T1_REG 0xf /* Time from address valid to DIOR/DIOW */
1429#define T2_REG_PIO 0xff0 /* DIOR/DIOW pulsewidth */
1430#define T4_REG 0xf000 /* DIOW data hold */
1431
1432/* Bit masks for ATAPI_PIO_TIM_1 */
1433
1434#define TEOC_REG_PIO 0xff /* End of cycle time for PIO access transfers. */
1435
1436/* Bit masks for ATAPI_MULTI_TIM_0 */
1437
1438#define TD 0xff /* DIOR/DIOW asserted pulsewidth */
1439#define TM 0xff00 /* Time from address valid to DIOR/DIOW */
1440
1441/* Bit masks for ATAPI_MULTI_TIM_1 */
1442
1443#define TKW 0xff /* Selects DIOW negated pulsewidth */
1444#define TKR 0xff00 /* Selects DIOR negated pulsewidth */
1445
1446/* Bit masks for ATAPI_MULTI_TIM_2 */
1447
1448#define TH 0xff /* Selects DIOW data hold */
1449#define TEOC 0xff00 /* Selects end of cycle for DMA */
1450
1451/* Bit masks for ATAPI_ULTRA_TIM_0 */
1452
1453#define TACK 0xff /* Selects setup and hold times for TACK */
1454#define TENV 0xff00 /* Selects envelope time */
1455
1456/* Bit masks for ATAPI_ULTRA_TIM_1 */
1457
1458#define TDVS 0xff /* Selects data valid setup time */
1459#define TCYC_TDVS 0xff00 /* Selects cycle time - TDVS time */
1460
1461/* Bit masks for ATAPI_ULTRA_TIM_2 */
1462
1463#define TSS 0xff /* Selects time from STROBE edge to negation of DMARQ or assertion of STOP */
1464#define TMLI 0xff00 /* Selects interlock time */
1465
1466/* Bit masks for ATAPI_ULTRA_TIM_3 */
1467
1468#define TZAH 0xff /* Selects minimum delay required for output */
1469#define READY_PAUSE 0xff00 /* Selects ready to pause */
1470
1471/* Bit masks for TIMER_ENABLE1 */
1472
1473#define TIMEN8 0x1 /* Timer 8 Enable */
1474#define nTIMEN8 0x0
1475#define TIMEN9 0x2 /* Timer 9 Enable */
1476#define nTIMEN9 0x0
1477#define TIMEN10 0x4 /* Timer 10 Enable */
1478#define nTIMEN10 0x0
1479
1480/* Bit masks for TIMER_DISABLE1 */
1481
1482#define TIMDIS8 0x1 /* Timer 8 Disable */
1483#define nTIMDIS8 0x0
1484#define TIMDIS9 0x2 /* Timer 9 Disable */
1485#define nTIMDIS9 0x0
1486#define TIMDIS10 0x4 /* Timer 10 Disable */
1487#define nTIMDIS10 0x0
1488
1489/* Bit masks for TIMER_STATUS1 */
1490
1491#define TIMIL8 0x1 /* Timer 8 Interrupt */
1492#define nTIMIL8 0x0
1493#define TIMIL9 0x2 /* Timer 9 Interrupt */
1494#define nTIMIL9 0x0
1495#define TIMIL10 0x4 /* Timer 10 Interrupt */
1496#define nTIMIL10 0x0
1497#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */
1498#define nTOVF_ERR8 0x0
1499#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */
1500#define nTOVF_ERR9 0x0
1501#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */
1502#define nTOVF_ERR10 0x0
1503#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */
1504#define nTRUN8 0x0
1505#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */
1506#define nTRUN9 0x0
1507#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */
1508#define nTRUN10 0x0
1509
1510/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */
1511
1512/* Bit masks for USB_FADDR */
1513
1514#define FUNCTION_ADDRESS 0x7f /* Function address */
1515
1516/* Bit masks for USB_POWER */
1517
1518#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
1519#define nENABLE_SUSPENDM 0x0
1520#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
1521#define nSUSPEND_MODE 0x0
1522#define RESUME_MODE 0x4 /* DMA Mode */
1523#define nRESUME_MODE 0x0
1524#define RESET 0x8 /* Reset indicator */
1525#define nRESET 0x0
1526#define HS_MODE 0x10 /* High Speed mode indicator */
1527#define nHS_MODE 0x0
1528#define HS_ENABLE 0x20 /* high Speed Enable */
1529#define nHS_ENABLE 0x0
1530#define SOFT_CONN 0x40 /* Soft connect */
1531#define nSOFT_CONN 0x0
1532#define ISO_UPDATE 0x80 /* Isochronous update */
1533#define nISO_UPDATE 0x0
1534
1535/* Bit masks for USB_INTRTX */
1536
1537#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
1538#define nEP0_TX 0x0
1539#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
1540#define nEP1_TX 0x0
1541#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
1542#define nEP2_TX 0x0
1543#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
1544#define nEP3_TX 0x0
1545#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
1546#define nEP4_TX 0x0
1547#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
1548#define nEP5_TX 0x0
1549#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
1550#define nEP6_TX 0x0
1551#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
1552#define nEP7_TX 0x0
1553
1554/* Bit masks for USB_INTRRX */
1555
1556#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
1557#define nEP1_RX 0x0
1558#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
1559#define nEP2_RX 0x0
1560#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
1561#define nEP3_RX 0x0
1562#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
1563#define nEP4_RX 0x0
1564#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
1565#define nEP5_RX 0x0
1566#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
1567#define nEP6_RX 0x0
1568#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
1569#define nEP7_RX 0x0
1570
1571/* Bit masks for USB_INTRTXE */
1572
1573#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
1574#define nEP0_TX_E 0x0
1575#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
1576#define nEP1_TX_E 0x0
1577#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
1578#define nEP2_TX_E 0x0
1579#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
1580#define nEP3_TX_E 0x0
1581#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
1582#define nEP4_TX_E 0x0
1583#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
1584#define nEP5_TX_E 0x0
1585#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
1586#define nEP6_TX_E 0x0
1587#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
1588#define nEP7_TX_E 0x0
1589
1590/* Bit masks for USB_INTRRXE */
1591
1592#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
1593#define nEP1_RX_E 0x0
1594#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
1595#define nEP2_RX_E 0x0
1596#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
1597#define nEP3_RX_E 0x0
1598#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
1599#define nEP4_RX_E 0x0
1600#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
1601#define nEP5_RX_E 0x0
1602#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
1603#define nEP6_RX_E 0x0
1604#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
1605#define nEP7_RX_E 0x0
1606
1607/* Bit masks for USB_INTRUSB */
1608
1609#define SUSPEND_B 0x1 /* Suspend indicator */
1610#define nSUSPEND_B 0x0
1611#define RESUME_B 0x2 /* Resume indicator */
1612#define nRESUME_B 0x0
1613#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
1614#define nRESET_OR_BABLE_B 0x0
1615#define SOF_B 0x8 /* Start of frame */
1616#define nSOF_B 0x0
1617#define CONN_B 0x10 /* Connection indicator */
1618#define nCONN_B 0x0
1619#define DISCON_B 0x20 /* Disconnect indicator */
1620#define nDISCON_B 0x0
1621#define SESSION_REQ_B 0x40 /* Session Request */
1622#define nSESSION_REQ_B 0x0
1623#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
1624#define nVBUS_ERROR_B 0x0
1625
1626/* Bit masks for USB_INTRUSBE */
1627
1628#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
1629#define nSUSPEND_BE 0x0
1630#define RESUME_BE 0x2 /* Resume indicator int enable */
1631#define nRESUME_BE 0x0
1632#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
1633#define nRESET_OR_BABLE_BE 0x0
1634#define SOF_BE 0x8 /* Start of frame int enable */
1635#define nSOF_BE 0x0
1636#define CONN_BE 0x10 /* Connection indicator int enable */
1637#define nCONN_BE 0x0
1638#define DISCON_BE 0x20 /* Disconnect indicator int enable */
1639#define nDISCON_BE 0x0
1640#define SESSION_REQ_BE 0x40 /* Session Request int enable */
1641#define nSESSION_REQ_BE 0x0
1642#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
1643#define nVBUS_ERROR_BE 0x0
1644
1645/* Bit masks for USB_FRAME */
1646
1647#define FRAME_NUMBER 0x7ff /* Frame number */
1648
1649/* Bit masks for USB_INDEX */
1650
1651#define SELECTED_ENDPOINT 0xf /* selected endpoint */
1652
1653/* Bit masks for USB_GLOBAL_CTL */
1654
1655#define GLOBAL_ENA 0x1 /* enables USB module */
1656#define nGLOBAL_ENA 0x0
1657#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
1658#define nEP1_TX_ENA 0x0
1659#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
1660#define nEP2_TX_ENA 0x0
1661#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
1662#define nEP3_TX_ENA 0x0
1663#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
1664#define nEP4_TX_ENA 0x0
1665#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
1666#define nEP5_TX_ENA 0x0
1667#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
1668#define nEP6_TX_ENA 0x0
1669#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
1670#define nEP7_TX_ENA 0x0
1671#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
1672#define nEP1_RX_ENA 0x0
1673#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
1674#define nEP2_RX_ENA 0x0
1675#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
1676#define nEP3_RX_ENA 0x0
1677#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
1678#define nEP4_RX_ENA 0x0
1679#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
1680#define nEP5_RX_ENA 0x0
1681#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
1682#define nEP6_RX_ENA 0x0
1683#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
1684#define nEP7_RX_ENA 0x0
1685
1686/* Bit masks for USB_OTG_DEV_CTL */
1687
1688#define SESSION 0x1 /* session indicator */
1689#define nSESSION 0x0
1690#define HOST_REQ 0x2 /* Host negotiation request */
1691#define nHOST_REQ 0x0
1692#define HOST_MODE 0x4 /* indicates USBDRC is a host */
1693#define nHOST_MODE 0x0
1694#define VBUS0 0x8 /* Vbus level indicator[0] */
1695#define nVBUS0 0x0
1696#define VBUS1 0x10 /* Vbus level indicator[1] */
1697#define nVBUS1 0x0
1698#define LSDEV 0x20 /* Low-speed indicator */
1699#define nLSDEV 0x0
1700#define FSDEV 0x40 /* Full or High-speed indicator */
1701#define nFSDEV 0x0
1702#define B_DEVICE 0x80 /* A' or 'B' device indicator */
1703#define nB_DEVICE 0x0
1704
1705/* Bit masks for USB_OTG_VBUS_IRQ */
1706
1707#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
1708#define nDRIVE_VBUS_ON 0x0
1709#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
1710#define nDRIVE_VBUS_OFF 0x0
1711#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
1712#define nCHRG_VBUS_START 0x0
1713#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
1714#define nCHRG_VBUS_END 0x0
1715#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
1716#define nDISCHRG_VBUS_START 0x0
1717#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
1718#define nDISCHRG_VBUS_END 0x0
1719
1720/* Bit masks for USB_OTG_VBUS_MASK */
1721
1722#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
1723#define nDRIVE_VBUS_ON_ENA 0x0
1724#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
1725#define nDRIVE_VBUS_OFF_ENA 0x0
1726#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
1727#define nCHRG_VBUS_START_ENA 0x0
1728#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
1729#define nCHRG_VBUS_END_ENA 0x0
1730#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
1731#define nDISCHRG_VBUS_START_ENA 0x0
1732#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
1733#define nDISCHRG_VBUS_END_ENA 0x0
1734
1735/* Bit masks for USB_CSR0 */
1736
1737#define RXPKTRDY 0x1 /* data packet receive indicator */
1738#define nRXPKTRDY 0x0
1739#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
1740#define nTXPKTRDY 0x0
1741#define STALL_SENT 0x4 /* STALL handshake sent */
1742#define nSTALL_SENT 0x0
1743#define DATAEND 0x8 /* Data end indicator */
1744#define nDATAEND 0x0
1745#define SETUPEND 0x10 /* Setup end */
1746#define nSETUPEND 0x0
1747#define SENDSTALL 0x20 /* Send STALL handshake */
1748#define nSENDSTALL 0x0
1749#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
1750#define nSERVICED_RXPKTRDY 0x0
1751#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
1752#define nSERVICED_SETUPEND 0x0
1753#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
1754#define nFLUSHFIFO 0x0
1755#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
1756#define nSTALL_RECEIVED_H 0x0
1757#define SETUPPKT_H 0x8 /* send Setup token host mode */
1758#define nSETUPPKT_H 0x0
1759#define ERROR_H 0x10 /* timeout error indicator host mode */
1760#define nERROR_H 0x0
1761#define REQPKT_H 0x20 /* Request an IN transaction host mode */
1762#define nREQPKT_H 0x0
1763#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
1764#define nSTATUSPKT_H 0x0
1765#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
1766#define nNAK_TIMEOUT_H 0x0
1767
1768/* Bit masks for USB_COUNT0 */
1769
1770#define EP0_RX_COUNT 0x7f /* number of received bytes in EP0 FIFO */
1771
1772/* Bit masks for USB_NAKLIMIT0 */
1773
1774#define EP0_NAK_LIMIT 0x1f /* number of frames/micro frames after which EP0 timeouts */
1775
1776/* Bit masks for USB_TX_MAX_PACKET */
1777
1778#define MAX_PACKET_SIZE_T 0x7ff /* maximum data pay load in a frame */
1779
1780/* Bit masks for USB_RX_MAX_PACKET */
1781
1782#define MAX_PACKET_SIZE_R 0x7ff /* maximum data pay load in a frame */
1783
1784/* Bit masks for USB_TXCSR */
1785
1786#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
1787#define nTXPKTRDY_T 0x0
1788#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
1789#define nFIFO_NOT_EMPTY_T 0x0
1790#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
1791#define nUNDERRUN_T 0x0
1792#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
1793#define nFLUSHFIFO_T 0x0
1794#define STALL_SEND_T 0x10 /* issue a Stall handshake */
1795#define nSTALL_SEND_T 0x0
1796#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
1797#define nSTALL_SENT_T 0x0
1798#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
1799#define nCLEAR_DATATOGGLE_T 0x0
1800#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
1801#define nINCOMPTX_T 0x0
1802#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
1803#define nDMAREQMODE_T 0x0
1804#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
1805#define nFORCE_DATATOGGLE_T 0x0
1806#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
1807#define nDMAREQ_ENA_T 0x0
1808#define ISO_T 0x4000 /* enable Isochronous transfers */
1809#define nISO_T 0x0
1810#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
1811#define nAUTOSET_T 0x0
1812#define ERROR_TH 0x4 /* error condition host mode */
1813#define nERROR_TH 0x0
1814#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
1815#define nSTALL_RECEIVED_TH 0x0
1816#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
1817#define nNAK_TIMEOUT_TH 0x0
1818
1819/* Bit masks for USB_TXCOUNT */
1820
1821#define TX_COUNT 0x1fff /* Number of bytes to be written to the selected endpoint Tx FIFO */
1822
1823/* Bit masks for USB_RXCSR */
1824
1825#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
1826#define nRXPKTRDY_R 0x0
1827#define FIFO_FULL_R 0x2 /* FIFO not empty */
1828#define nFIFO_FULL_R 0x0
1829#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
1830#define nOVERRUN_R 0x0
1831#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
1832#define nDATAERROR_R 0x0
1833#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
1834#define nFLUSHFIFO_R 0x0
1835#define STALL_SEND_R 0x20 /* issue a Stall handshake */
1836#define nSTALL_SEND_R 0x0
1837#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
1838#define nSTALL_SENT_R 0x0
1839#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
1840#define nCLEAR_DATATOGGLE_R 0x0
1841#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
1842#define nINCOMPRX_R 0x0
1843#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
1844#define nDMAREQMODE_R 0x0
1845#define DISNYET_R 0x1000 /* disable Nyet handshakes */
1846#define nDISNYET_R 0x0
1847#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
1848#define nDMAREQ_ENA_R 0x0
1849#define ISO_R 0x4000 /* enable Isochronous transfers */
1850#define nISO_R 0x0
1851#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
1852#define nAUTOCLEAR_R 0x0
1853#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
1854#define nERROR_RH 0x0
1855#define REQPKT_RH 0x20 /* request an IN transaction host mode */
1856#define nREQPKT_RH 0x0
1857#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
1858#define nSTALL_RECEIVED_RH 0x0
1859#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
1860#define nINCOMPRX_RH 0x0
1861#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
1862#define nDMAREQMODE_RH 0x0
1863#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
1864#define nAUTOREQ_RH 0x0
1865
1866/* Bit masks for USB_RXCOUNT */
1867
1868#define RX_COUNT 0x1fff /* Number of received bytes in the packet in the Rx FIFO */
1869
1870/* Bit masks for USB_TXTYPE */
1871
1872#define TARGET_EP_NO_T 0xf /* EP number */
1873#define PROTOCOL_T 0xc /* transfer type */
1874
1875/* Bit masks for USB_TXINTERVAL */
1876
1877#define TX_POLL_INTERVAL 0xff /* polling interval for selected Tx EP */
1878
1879/* Bit masks for USB_RXTYPE */
1880
1881#define TARGET_EP_NO_R 0xf /* EP number */
1882#define PROTOCOL_R 0xc /* transfer type */
1883
1884/* Bit masks for USB_RXINTERVAL */
1885
1886#define RX_POLL_INTERVAL 0xff /* polling interval for selected Rx EP */
1887
1888/* Bit masks for USB_DMA_INTERRUPT */
1889
1890#define DMA0_INT 0x1 /* DMA0 pending interrupt */
1891#define nDMA0_INT 0x0
1892#define DMA1_INT 0x2 /* DMA1 pending interrupt */
1893#define nDMA1_INT 0x0
1894#define DMA2_INT 0x4 /* DMA2 pending interrupt */
1895#define nDMA2_INT 0x0
1896#define DMA3_INT 0x8 /* DMA3 pending interrupt */
1897#define nDMA3_INT 0x0
1898#define DMA4_INT 0x10 /* DMA4 pending interrupt */
1899#define nDMA4_INT 0x0
1900#define DMA5_INT 0x20 /* DMA5 pending interrupt */
1901#define nDMA5_INT 0x0
1902#define DMA6_INT 0x40 /* DMA6 pending interrupt */
1903#define nDMA6_INT 0x0
1904#define DMA7_INT 0x80 /* DMA7 pending interrupt */
1905#define nDMA7_INT 0x0
1906
1907/* Bit masks for USB_DMAxCONTROL */
1908
1909#define DMA_ENA 0x1 /* DMA enable */
1910#define nDMA_ENA 0x0
1911#define DIRECTION 0x2 /* direction of DMA transfer */
1912#define nDIRECTION 0x0
1913#define MODE 0x4 /* DMA Bus error */
1914#define nMODE 0x0
1915#define INT_ENA 0x8 /* Interrupt enable */
1916#define nINT_ENA 0x0
1917#define EPNUM 0xf0 /* EP number */
1918#define BUSERROR 0x100 /* DMA Bus error */
1919#define nBUSERROR 0x0
1920
1921/* Bit masks for USB_DMAxADDRHIGH */
1922
1923#define DMA_ADDR_HIGH 0xffff /* Upper 16-bits of memory source/destination address for the DMA master channel */
1924
1925/* Bit masks for USB_DMAxADDRLOW */
1926
1927#define DMA_ADDR_LOW 0xffff /* Lower 16-bits of memory source/destination address for the DMA master channel */
1928
1929/* Bit masks for USB_DMAxCOUNTHIGH */
1930
1931#define DMA_COUNT_HIGH 0xffff /* Upper 16-bits of byte count of DMA transfer for DMA master channel */
1932
1933/* Bit masks for USB_DMAxCOUNTLOW */
1934
1935#define DMA_COUNT_LOW 0xffff /* Lower 16-bits of byte count of DMA transfer for DMA master channel */
1936
1937/* Bit masks for HMDMAx_CONTROL */
1938
1939#define HMDMAEN 0x1 /* Handshake MDMA Enable */
1940#define nHMDMAEN 0x0
1941#define REP 0x2 /* Handshake MDMA Request Polarity */
1942#define nREP 0x0
1943#define UTE 0x8 /* Urgency Threshold Enable */
1944#define nUTE 0x0
1945#define OIE 0x10 /* Overflow Interrupt Enable */
1946#define nOIE 0x0
1947#define BDIE 0x20 /* Block Done Interrupt Enable */
1948#define nBDIE 0x0
1949#define MBDI 0x40 /* Mask Block Done Interrupt */
1950#define nMBDI 0x0
1951#define DRQ 0x300 /* Handshake MDMA Request Type */
1952#define RBC 0x1000 /* Force Reload of BCOUNT */
1953#define nRBC 0x0
1954#define PS 0x2000 /* Pin Status */
1955#define nPS 0x0
1956#define OI 0x4000 /* Overflow Interrupt Generated */
1957#define nOI 0x0
1958#define BDI 0x8000 /* Block Done Interrupt Generated */
1959#define nBDI 0x0
1960
1961/* ******************************************* */
1962/* MULTI BIT MACRO ENUMERATIONS */
1963/* ******************************************* */
1964
1965
1966#endif /* _DEF_BF548_H */
diff --git a/include/asm-blackfin/mach-bf548/defBF549.h b/include/asm-blackfin/mach-bf548/defBF549.h
new file mode 100644
index 000000000000..b1cc1c073b41
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/defBF549.h
@@ -0,0 +1,3472 @@
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_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_CTL 0xffc02400 /* SPI2 Control Register */
144#define SPI2_FLG 0xffc02404 /* SPI2 Flag Register */
145#define SPI2_STAT 0xffc02408 /* SPI2 Status Register */
146#define SPI2_TDBR 0xffc0240c /* SPI2 Transmit Data Buffer Register */
147#define SPI2_RDBR 0xffc02410 /* SPI2 Receive Data Buffer Register */
148#define SPI2_BAUD 0xffc02414 /* SPI2 Baud Rate Register */
149#define SPI2_SHADOW 0xffc02418 /* SPI2 Receive Data Buffer Shadow Register */
150
151/* MXVR Registers */
152
153#define MXVR_CONFIG 0xffc02700 /* MXVR Configuration Register */
154#define MXVR_STATE_0 0xffc02708 /* MXVR State Register 0 */
155#define MXVR_STATE_1 0xffc0270c /* MXVR State Register 1 */
156#define MXVR_INT_STAT_0 0xffc02710 /* MXVR Interrupt Status Register 0 */
157#define MXVR_INT_STAT_1 0xffc02714 /* MXVR Interrupt Status Register 1 */
158#define MXVR_INT_EN_0 0xffc02718 /* MXVR Interrupt Enable Register 0 */
159#define MXVR_INT_EN_1 0xffc0271c /* MXVR Interrupt Enable Register 1 */
160#define MXVR_POSITION 0xffc02720 /* MXVR Node Position Register */
161#define MXVR_MAX_POSITION 0xffc02724 /* MXVR Maximum Node Position Register */
162#define MXVR_DELAY 0xffc02728 /* MXVR Node Frame Delay Register */
163#define MXVR_MAX_DELAY 0xffc0272c /* MXVR Maximum Node Frame Delay Register */
164#define MXVR_LADDR 0xffc02730 /* MXVR Logical Address Register */
165#define MXVR_GADDR 0xffc02734 /* MXVR Group Address Register */
166#define MXVR_AADDR 0xffc02738 /* MXVR Alternate Address Register */
167
168/* MXVR Allocation Table Registers */
169
170#define MXVR_ALLOC_0 0xffc0273c /* MXVR Allocation Table Register 0 */
171#define MXVR_ALLOC_1 0xffc02740 /* MXVR Allocation Table Register 1 */
172#define MXVR_ALLOC_2 0xffc02744 /* MXVR Allocation Table Register 2 */
173#define MXVR_ALLOC_3 0xffc02748 /* MXVR Allocation Table Register 3 */
174#define MXVR_ALLOC_4 0xffc0274c /* MXVR Allocation Table Register 4 */
175#define MXVR_ALLOC_5 0xffc02750 /* MXVR Allocation Table Register 5 */
176#define MXVR_ALLOC_6 0xffc02754 /* MXVR Allocation Table Register 6 */
177#define MXVR_ALLOC_7 0xffc02758 /* MXVR Allocation Table Register 7 */
178#define MXVR_ALLOC_8 0xffc0275c /* MXVR Allocation Table Register 8 */
179#define MXVR_ALLOC_9 0xffc02760 /* MXVR Allocation Table Register 9 */
180#define MXVR_ALLOC_10 0xffc02764 /* MXVR Allocation Table Register 10 */
181#define MXVR_ALLOC_11 0xffc02768 /* MXVR Allocation Table Register 11 */
182#define MXVR_ALLOC_12 0xffc0276c /* MXVR Allocation Table Register 12 */
183#define MXVR_ALLOC_13 0xffc02770 /* MXVR Allocation Table Register 13 */
184#define MXVR_ALLOC_14 0xffc02774 /* MXVR Allocation Table Register 14 */
185
186/* MXVR Channel Assign Registers */
187
188#define MXVR_SYNC_LCHAN_0 0xffc02778 /* MXVR Sync Data Logical Channel Assign Register 0 */
189#define MXVR_SYNC_LCHAN_1 0xffc0277c /* MXVR Sync Data Logical Channel Assign Register 1 */
190#define MXVR_SYNC_LCHAN_2 0xffc02780 /* MXVR Sync Data Logical Channel Assign Register 2 */
191#define MXVR_SYNC_LCHAN_3 0xffc02784 /* MXVR Sync Data Logical Channel Assign Register 3 */
192#define MXVR_SYNC_LCHAN_4 0xffc02788 /* MXVR Sync Data Logical Channel Assign Register 4 */
193#define MXVR_SYNC_LCHAN_5 0xffc0278c /* MXVR Sync Data Logical Channel Assign Register 5 */
194#define MXVR_SYNC_LCHAN_6 0xffc02790 /* MXVR Sync Data Logical Channel Assign Register 6 */
195#define MXVR_SYNC_LCHAN_7 0xffc02794 /* MXVR Sync Data Logical Channel Assign Register 7 */
196
197/* MXVR DMA0 Registers */
198
199#define MXVR_DMA0_CONFIG 0xffc02798 /* MXVR Sync Data DMA0 Config Register */
200#define MXVR_DMA0_START_ADDR 0xffc0279c /* MXVR Sync Data DMA0 Start Address */
201#define MXVR_DMA0_COUNT 0xffc027a0 /* MXVR Sync Data DMA0 Loop Count Register */
202#define MXVR_DMA0_CURR_ADDR 0xffc027a4 /* MXVR Sync Data DMA0 Current Address */
203#define MXVR_DMA0_CURR_COUNT 0xffc027a8 /* MXVR Sync Data DMA0 Current Loop Count */
204
205/* MXVR DMA1 Registers */
206
207#define MXVR_DMA1_CONFIG 0xffc027ac /* MXVR Sync Data DMA1 Config Register */
208#define MXVR_DMA1_START_ADDR 0xffc027b0 /* MXVR Sync Data DMA1 Start Address */
209#define MXVR_DMA1_COUNT 0xffc027b4 /* MXVR Sync Data DMA1 Loop Count Register */
210#define MXVR_DMA1_CURR_ADDR 0xffc027b8 /* MXVR Sync Data DMA1 Current Address */
211#define MXVR_DMA1_CURR_COUNT 0xffc027bc /* MXVR Sync Data DMA1 Current Loop Count */
212
213/* MXVR DMA2 Registers */
214
215#define MXVR_DMA2_CONFIG 0xffc027c0 /* MXVR Sync Data DMA2 Config Register */
216#define MXVR_DMA2_START_ADDR 0xffc027c4 /* MXVR Sync Data DMA2 Start Address */
217#define MXVR_DMA2_COUNT 0xffc027c8 /* MXVR Sync Data DMA2 Loop Count Register */
218#define MXVR_DMA2_CURR_ADDR 0xffc027cc /* MXVR Sync Data DMA2 Current Address */
219#define MXVR_DMA2_CURR_COUNT 0xffc027d0 /* MXVR Sync Data DMA2 Current Loop Count */
220
221/* MXVR DMA3 Registers */
222
223#define MXVR_DMA3_CONFIG 0xffc027d4 /* MXVR Sync Data DMA3 Config Register */
224#define MXVR_DMA3_START_ADDR 0xffc027d8 /* MXVR Sync Data DMA3 Start Address */
225#define MXVR_DMA3_COUNT 0xffc027dc /* MXVR Sync Data DMA3 Loop Count Register */
226#define MXVR_DMA3_CURR_ADDR 0xffc027e0 /* MXVR Sync Data DMA3 Current Address */
227#define MXVR_DMA3_CURR_COUNT 0xffc027e4 /* MXVR Sync Data DMA3 Current Loop Count */
228
229/* MXVR DMA4 Registers */
230
231#define MXVR_DMA4_CONFIG 0xffc027e8 /* MXVR Sync Data DMA4 Config Register */
232#define MXVR_DMA4_START_ADDR 0xffc027ec /* MXVR Sync Data DMA4 Start Address */
233#define MXVR_DMA4_COUNT 0xffc027f0 /* MXVR Sync Data DMA4 Loop Count Register */
234#define MXVR_DMA4_CURR_ADDR 0xffc027f4 /* MXVR Sync Data DMA4 Current Address */
235#define MXVR_DMA4_CURR_COUNT 0xffc027f8 /* MXVR Sync Data DMA4 Current Loop Count */
236
237/* MXVR DMA5 Registers */
238
239#define MXVR_DMA5_CONFIG 0xffc027fc /* MXVR Sync Data DMA5 Config Register */
240#define MXVR_DMA5_START_ADDR 0xffc02800 /* MXVR Sync Data DMA5 Start Address */
241#define MXVR_DMA5_COUNT 0xffc02804 /* MXVR Sync Data DMA5 Loop Count Register */
242#define MXVR_DMA5_CURR_ADDR 0xffc02808 /* MXVR Sync Data DMA5 Current Address */
243#define MXVR_DMA5_CURR_COUNT 0xffc0280c /* MXVR Sync Data DMA5 Current Loop Count */
244
245/* MXVR DMA6 Registers */
246
247#define MXVR_DMA6_CONFIG 0xffc02810 /* MXVR Sync Data DMA6 Config Register */
248#define MXVR_DMA6_START_ADDR 0xffc02814 /* MXVR Sync Data DMA6 Start Address */
249#define MXVR_DMA6_COUNT 0xffc02818 /* MXVR Sync Data DMA6 Loop Count Register */
250#define MXVR_DMA6_CURR_ADDR 0xffc0281c /* MXVR Sync Data DMA6 Current Address */
251#define MXVR_DMA6_CURR_COUNT 0xffc02820 /* MXVR Sync Data DMA6 Current Loop Count */
252
253/* MXVR DMA7 Registers */
254
255#define MXVR_DMA7_CONFIG 0xffc02824 /* MXVR Sync Data DMA7 Config Register */
256#define MXVR_DMA7_START_ADDR 0xffc02828 /* MXVR Sync Data DMA7 Start Address */
257#define MXVR_DMA7_COUNT 0xffc0282c /* MXVR Sync Data DMA7 Loop Count Register */
258#define MXVR_DMA7_CURR_ADDR 0xffc02830 /* MXVR Sync Data DMA7 Current Address */
259#define MXVR_DMA7_CURR_COUNT 0xffc02834 /* MXVR Sync Data DMA7 Current Loop Count */
260
261/* MXVR Asynch Packet Registers */
262
263#define MXVR_AP_CTL 0xffc02838 /* MXVR Async Packet Control Register */
264#define MXVR_APRB_START_ADDR 0xffc0283c /* MXVR Async Packet RX Buffer Start Addr Register */
265#define MXVR_APRB_CURR_ADDR 0xffc02840 /* MXVR Async Packet RX Buffer Current Addr Register */
266#define MXVR_APTB_START_ADDR 0xffc02844 /* MXVR Async Packet TX Buffer Start Addr Register */
267#define MXVR_APTB_CURR_ADDR 0xffc02848 /* MXVR Async Packet TX Buffer Current Addr Register */
268
269/* MXVR Control Message Registers */
270
271#define MXVR_CM_CTL 0xffc0284c /* MXVR Control Message Control Register */
272#define MXVR_CMRB_START_ADDR 0xffc02850 /* MXVR Control Message RX Buffer Start Addr Register */
273#define MXVR_CMRB_CURR_ADDR 0xffc02854 /* MXVR Control Message RX Buffer Current Address */
274#define MXVR_CMTB_START_ADDR 0xffc02858 /* MXVR Control Message TX Buffer Start Addr Register */
275#define MXVR_CMTB_CURR_ADDR 0xffc0285c /* MXVR Control Message TX Buffer Current Address */
276
277/* MXVR Remote Read Registers */
278
279#define MXVR_RRDB_START_ADDR 0xffc02860 /* MXVR Remote Read Buffer Start Addr Register */
280#define MXVR_RRDB_CURR_ADDR 0xffc02864 /* MXVR Remote Read Buffer Current Addr Register */
281
282/* MXVR Pattern Data Registers */
283
284#define MXVR_PAT_DATA_0 0xffc02868 /* MXVR Pattern Data Register 0 */
285#define MXVR_PAT_EN_0 0xffc0286c /* MXVR Pattern Enable Register 0 */
286#define MXVR_PAT_DATA_1 0xffc02870 /* MXVR Pattern Data Register 1 */
287#define MXVR_PAT_EN_1 0xffc02874 /* MXVR Pattern Enable Register 1 */
288
289/* MXVR Frame Counter Registers */
290
291#define MXVR_FRAME_CNT_0 0xffc02878 /* MXVR Frame Counter 0 */
292#define MXVR_FRAME_CNT_1 0xffc0287c /* MXVR Frame Counter 1 */
293
294/* MXVR Routing Table Registers */
295
296#define MXVR_ROUTING_0 0xffc02880 /* MXVR Routing Table Register 0 */
297#define MXVR_ROUTING_1 0xffc02884 /* MXVR Routing Table Register 1 */
298#define MXVR_ROUTING_2 0xffc02888 /* MXVR Routing Table Register 2 */
299#define MXVR_ROUTING_3 0xffc0288c /* MXVR Routing Table Register 3 */
300#define MXVR_ROUTING_4 0xffc02890 /* MXVR Routing Table Register 4 */
301#define MXVR_ROUTING_5 0xffc02894 /* MXVR Routing Table Register 5 */
302#define MXVR_ROUTING_6 0xffc02898 /* MXVR Routing Table Register 6 */
303#define MXVR_ROUTING_7 0xffc0289c /* MXVR Routing Table Register 7 */
304#define MXVR_ROUTING_8 0xffc028a0 /* MXVR Routing Table Register 8 */
305#define MXVR_ROUTING_9 0xffc028a4 /* MXVR Routing Table Register 9 */
306#define MXVR_ROUTING_10 0xffc028a8 /* MXVR Routing Table Register 10 */
307#define MXVR_ROUTING_11 0xffc028ac /* MXVR Routing Table Register 11 */
308#define MXVR_ROUTING_12 0xffc028b0 /* MXVR Routing Table Register 12 */
309#define MXVR_ROUTING_13 0xffc028b4 /* MXVR Routing Table Register 13 */
310#define MXVR_ROUTING_14 0xffc028b8 /* MXVR Routing Table Register 14 */
311
312/* MXVR Counter-Clock-Control Registers */
313
314#define MXVR_BLOCK_CNT 0xffc028c0 /* MXVR Block Counter */
315#define MXVR_CLK_CTL 0xffc028d0 /* MXVR Clock Control Register */
316#define MXVR_CDRPLL_CTL 0xffc028d4 /* MXVR Clock/Data Recovery PLL Control Register */
317#define MXVR_FMPLL_CTL 0xffc028d8 /* MXVR Frequency Multiply PLL Control Register */
318#define MXVR_PIN_CTL 0xffc028dc /* MXVR Pin Control Register */
319#define MXVR_SCLK_CNT 0xffc028e0 /* MXVR System Clock Counter Register */
320
321/* CAN Controller 1 Config 1 Registers */
322
323#define CAN1_MC1 0xffc03200 /* CAN Controller 1 Mailbox Configuration Register 1 */
324#define CAN1_MD1 0xffc03204 /* CAN Controller 1 Mailbox Direction Register 1 */
325#define CAN1_TRS1 0xffc03208 /* CAN Controller 1 Transmit Request Set Register 1 */
326#define CAN1_TRR1 0xffc0320c /* CAN Controller 1 Transmit Request Reset Register 1 */
327#define CAN1_TA1 0xffc03210 /* CAN Controller 1 Transmit Acknowledge Register 1 */
328#define CAN1_AA1 0xffc03214 /* CAN Controller 1 Abort Acknowledge Register 1 */
329#define CAN1_RMP1 0xffc03218 /* CAN Controller 1 Receive Message Pending Register 1 */
330#define CAN1_RML1 0xffc0321c /* CAN Controller 1 Receive Message Lost Register 1 */
331#define CAN1_MBTIF1 0xffc03220 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 1 */
332#define CAN1_MBRIF1 0xffc03224 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 1 */
333#define CAN1_MBIM1 0xffc03228 /* CAN Controller 1 Mailbox Interrupt Mask Register 1 */
334#define CAN1_RFH1 0xffc0322c /* CAN Controller 1 Remote Frame Handling Enable Register 1 */
335#define CAN1_OPSS1 0xffc03230 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 1 */
336
337/* CAN Controller 1 Config 2 Registers */
338
339#define CAN1_MC2 0xffc03240 /* CAN Controller 1 Mailbox Configuration Register 2 */
340#define CAN1_MD2 0xffc03244 /* CAN Controller 1 Mailbox Direction Register 2 */
341#define CAN1_TRS2 0xffc03248 /* CAN Controller 1 Transmit Request Set Register 2 */
342#define CAN1_TRR2 0xffc0324c /* CAN Controller 1 Transmit Request Reset Register 2 */
343#define CAN1_TA2 0xffc03250 /* CAN Controller 1 Transmit Acknowledge Register 2 */
344#define CAN1_AA2 0xffc03254 /* CAN Controller 1 Abort Acknowledge Register 2 */
345#define CAN1_RMP2 0xffc03258 /* CAN Controller 1 Receive Message Pending Register 2 */
346#define CAN1_RML2 0xffc0325c /* CAN Controller 1 Receive Message Lost Register 2 */
347#define CAN1_MBTIF2 0xffc03260 /* CAN Controller 1 Mailbox Transmit Interrupt Flag Register 2 */
348#define CAN1_MBRIF2 0xffc03264 /* CAN Controller 1 Mailbox Receive Interrupt Flag Register 2 */
349#define CAN1_MBIM2 0xffc03268 /* CAN Controller 1 Mailbox Interrupt Mask Register 2 */
350#define CAN1_RFH2 0xffc0326c /* CAN Controller 1 Remote Frame Handling Enable Register 2 */
351#define CAN1_OPSS2 0xffc03270 /* CAN Controller 1 Overwrite Protection Single Shot Transmit Register 2 */
352
353/* CAN Controller 1 Clock/Interrupt/Counter Registers */
354
355#define CAN1_CLOCK 0xffc03280 /* CAN Controller 1 Clock Register */
356#define CAN1_TIMING 0xffc03284 /* CAN Controller 1 Timing Register */
357#define CAN1_DEBUG 0xffc03288 /* CAN Controller 1 Debug Register */
358#define CAN1_STATUS 0xffc0328c /* CAN Controller 1 Global Status Register */
359#define CAN1_CEC 0xffc03290 /* CAN Controller 1 Error Counter Register */
360#define CAN1_GIS 0xffc03294 /* CAN Controller 1 Global Interrupt Status Register */
361#define CAN1_GIM 0xffc03298 /* CAN Controller 1 Global Interrupt Mask Register */
362#define CAN1_GIF 0xffc0329c /* CAN Controller 1 Global Interrupt Flag Register */
363#define CAN1_CONTROL 0xffc032a0 /* CAN Controller 1 Master Control Register */
364#define CAN1_INTR 0xffc032a4 /* CAN Controller 1 Interrupt Pending Register */
365#define CAN1_MBTD 0xffc032ac /* CAN Controller 1 Mailbox Temporary Disable Register */
366#define CAN1_EWR 0xffc032b0 /* CAN Controller 1 Programmable Warning Level Register */
367#define CAN1_ESR 0xffc032b4 /* CAN Controller 1 Error Status Register */
368#define CAN1_UCCNT 0xffc032c4 /* CAN Controller 1 Universal Counter Register */
369#define CAN1_UCRC 0xffc032c8 /* CAN Controller 1 Universal Counter Force Reload Register */
370#define CAN1_UCCNF 0xffc032cc /* CAN Controller 1 Universal Counter Configuration Register */
371
372/* CAN Controller 1 Mailbox Acceptance Registers */
373
374#define CAN1_AM00L 0xffc03300 /* CAN Controller 1 Mailbox 0 Acceptance Mask High Register */
375#define CAN1_AM00H 0xffc03304 /* CAN Controller 1 Mailbox 0 Acceptance Mask Low Register */
376#define CAN1_AM01L 0xffc03308 /* CAN Controller 1 Mailbox 1 Acceptance Mask High Register */
377#define CAN1_AM01H 0xffc0330c /* CAN Controller 1 Mailbox 1 Acceptance Mask Low Register */
378#define CAN1_AM02L 0xffc03310 /* CAN Controller 1 Mailbox 2 Acceptance Mask High Register */
379#define CAN1_AM02H 0xffc03314 /* CAN Controller 1 Mailbox 2 Acceptance Mask Low Register */
380#define CAN1_AM03L 0xffc03318 /* CAN Controller 1 Mailbox 3 Acceptance Mask High Register */
381#define CAN1_AM03H 0xffc0331c /* CAN Controller 1 Mailbox 3 Acceptance Mask Low Register */
382#define CAN1_AM04L 0xffc03320 /* CAN Controller 1 Mailbox 4 Acceptance Mask High Register */
383#define CAN1_AM04H 0xffc03324 /* CAN Controller 1 Mailbox 4 Acceptance Mask Low Register */
384#define CAN1_AM05L 0xffc03328 /* CAN Controller 1 Mailbox 5 Acceptance Mask High Register */
385#define CAN1_AM05H 0xffc0332c /* CAN Controller 1 Mailbox 5 Acceptance Mask Low Register */
386#define CAN1_AM06L 0xffc03330 /* CAN Controller 1 Mailbox 6 Acceptance Mask High Register */
387#define CAN1_AM06H 0xffc03334 /* CAN Controller 1 Mailbox 6 Acceptance Mask Low Register */
388#define CAN1_AM07L 0xffc03338 /* CAN Controller 1 Mailbox 7 Acceptance Mask High Register */
389#define CAN1_AM07H 0xffc0333c /* CAN Controller 1 Mailbox 7 Acceptance Mask Low Register */
390#define CAN1_AM08L 0xffc03340 /* CAN Controller 1 Mailbox 8 Acceptance Mask High Register */
391#define CAN1_AM08H 0xffc03344 /* CAN Controller 1 Mailbox 8 Acceptance Mask Low Register */
392#define CAN1_AM09L 0xffc03348 /* CAN Controller 1 Mailbox 9 Acceptance Mask High Register */
393#define CAN1_AM09H 0xffc0334c /* CAN Controller 1 Mailbox 9 Acceptance Mask Low Register */
394#define CAN1_AM10L 0xffc03350 /* CAN Controller 1 Mailbox 10 Acceptance Mask High Register */
395#define CAN1_AM10H 0xffc03354 /* CAN Controller 1 Mailbox 10 Acceptance Mask Low Register */
396#define CAN1_AM11L 0xffc03358 /* CAN Controller 1 Mailbox 11 Acceptance Mask High Register */
397#define CAN1_AM11H 0xffc0335c /* CAN Controller 1 Mailbox 11 Acceptance Mask Low Register */
398#define CAN1_AM12L 0xffc03360 /* CAN Controller 1 Mailbox 12 Acceptance Mask High Register */
399#define CAN1_AM12H 0xffc03364 /* CAN Controller 1 Mailbox 12 Acceptance Mask Low Register */
400#define CAN1_AM13L 0xffc03368 /* CAN Controller 1 Mailbox 13 Acceptance Mask High Register */
401#define CAN1_AM13H 0xffc0336c /* CAN Controller 1 Mailbox 13 Acceptance Mask Low Register */
402#define CAN1_AM14L 0xffc03370 /* CAN Controller 1 Mailbox 14 Acceptance Mask High Register */
403#define CAN1_AM14H 0xffc03374 /* CAN Controller 1 Mailbox 14 Acceptance Mask Low Register */
404#define CAN1_AM15L 0xffc03378 /* CAN Controller 1 Mailbox 15 Acceptance Mask High Register */
405#define CAN1_AM15H 0xffc0337c /* CAN Controller 1 Mailbox 15 Acceptance Mask Low Register */
406
407/* CAN Controller 1 Mailbox Acceptance Registers */
408
409#define CAN1_AM16L 0xffc03380 /* CAN Controller 1 Mailbox 16 Acceptance Mask High Register */
410#define CAN1_AM16H 0xffc03384 /* CAN Controller 1 Mailbox 16 Acceptance Mask Low Register */
411#define CAN1_AM17L 0xffc03388 /* CAN Controller 1 Mailbox 17 Acceptance Mask High Register */
412#define CAN1_AM17H 0xffc0338c /* CAN Controller 1 Mailbox 17 Acceptance Mask Low Register */
413#define CAN1_AM18L 0xffc03390 /* CAN Controller 1 Mailbox 18 Acceptance Mask High Register */
414#define CAN1_AM18H 0xffc03394 /* CAN Controller 1 Mailbox 18 Acceptance Mask Low Register */
415#define CAN1_AM19L 0xffc03398 /* CAN Controller 1 Mailbox 19 Acceptance Mask High Register */
416#define CAN1_AM19H 0xffc0339c /* CAN Controller 1 Mailbox 19 Acceptance Mask Low Register */
417#define CAN1_AM20L 0xffc033a0 /* CAN Controller 1 Mailbox 20 Acceptance Mask High Register */
418#define CAN1_AM20H 0xffc033a4 /* CAN Controller 1 Mailbox 20 Acceptance Mask Low Register */
419#define CAN1_AM21L 0xffc033a8 /* CAN Controller 1 Mailbox 21 Acceptance Mask High Register */
420#define CAN1_AM21H 0xffc033ac /* CAN Controller 1 Mailbox 21 Acceptance Mask Low Register */
421#define CAN1_AM22L 0xffc033b0 /* CAN Controller 1 Mailbox 22 Acceptance Mask High Register */
422#define CAN1_AM22H 0xffc033b4 /* CAN Controller 1 Mailbox 22 Acceptance Mask Low Register */
423#define CAN1_AM23L 0xffc033b8 /* CAN Controller 1 Mailbox 23 Acceptance Mask High Register */
424#define CAN1_AM23H 0xffc033bc /* CAN Controller 1 Mailbox 23 Acceptance Mask Low Register */
425#define CAN1_AM24L 0xffc033c0 /* CAN Controller 1 Mailbox 24 Acceptance Mask High Register */
426#define CAN1_AM24H 0xffc033c4 /* CAN Controller 1 Mailbox 24 Acceptance Mask Low Register */
427#define CAN1_AM25L 0xffc033c8 /* CAN Controller 1 Mailbox 25 Acceptance Mask High Register */
428#define CAN1_AM25H 0xffc033cc /* CAN Controller 1 Mailbox 25 Acceptance Mask Low Register */
429#define CAN1_AM26L 0xffc033d0 /* CAN Controller 1 Mailbox 26 Acceptance Mask High Register */
430#define CAN1_AM26H 0xffc033d4 /* CAN Controller 1 Mailbox 26 Acceptance Mask Low Register */
431#define CAN1_AM27L 0xffc033d8 /* CAN Controller 1 Mailbox 27 Acceptance Mask High Register */
432#define CAN1_AM27H 0xffc033dc /* CAN Controller 1 Mailbox 27 Acceptance Mask Low Register */
433#define CAN1_AM28L 0xffc033e0 /* CAN Controller 1 Mailbox 28 Acceptance Mask High Register */
434#define CAN1_AM28H 0xffc033e4 /* CAN Controller 1 Mailbox 28 Acceptance Mask Low Register */
435#define CAN1_AM29L 0xffc033e8 /* CAN Controller 1 Mailbox 29 Acceptance Mask High Register */
436#define CAN1_AM29H 0xffc033ec /* CAN Controller 1 Mailbox 29 Acceptance Mask Low Register */
437#define CAN1_AM30L 0xffc033f0 /* CAN Controller 1 Mailbox 30 Acceptance Mask High Register */
438#define CAN1_AM30H 0xffc033f4 /* CAN Controller 1 Mailbox 30 Acceptance Mask Low Register */
439#define CAN1_AM31L 0xffc033f8 /* CAN Controller 1 Mailbox 31 Acceptance Mask High Register */
440#define CAN1_AM31H 0xffc033fc /* CAN Controller 1 Mailbox 31 Acceptance Mask Low Register */
441
442/* CAN Controller 1 Mailbox Data Registers */
443
444#define CAN1_MB00_DATA0 0xffc03400 /* CAN Controller 1 Mailbox 0 Data 0 Register */
445#define CAN1_MB00_DATA1 0xffc03404 /* CAN Controller 1 Mailbox 0 Data 1 Register */
446#define CAN1_MB00_DATA2 0xffc03408 /* CAN Controller 1 Mailbox 0 Data 2 Register */
447#define CAN1_MB00_DATA3 0xffc0340c /* CAN Controller 1 Mailbox 0 Data 3 Register */
448#define CAN1_MB00_LENGTH 0xffc03410 /* CAN Controller 1 Mailbox 0 Length Register */
449#define CAN1_MB00_TIMESTAMP 0xffc03414 /* CAN Controller 1 Mailbox 0 Timestamp Register */
450#define CAN1_MB00_ID0 0xffc03418 /* CAN Controller 1 Mailbox 0 ID0 Register */
451#define CAN1_MB00_ID1 0xffc0341c /* CAN Controller 1 Mailbox 0 ID1 Register */
452#define CAN1_MB01_DATA0 0xffc03420 /* CAN Controller 1 Mailbox 1 Data 0 Register */
453#define CAN1_MB01_DATA1 0xffc03424 /* CAN Controller 1 Mailbox 1 Data 1 Register */
454#define CAN1_MB01_DATA2 0xffc03428 /* CAN Controller 1 Mailbox 1 Data 2 Register */
455#define CAN1_MB01_DATA3 0xffc0342c /* CAN Controller 1 Mailbox 1 Data 3 Register */
456#define CAN1_MB01_LENGTH 0xffc03430 /* CAN Controller 1 Mailbox 1 Length Register */
457#define CAN1_MB01_TIMESTAMP 0xffc03434 /* CAN Controller 1 Mailbox 1 Timestamp Register */
458#define CAN1_MB01_ID0 0xffc03438 /* CAN Controller 1 Mailbox 1 ID0 Register */
459#define CAN1_MB01_ID1 0xffc0343c /* CAN Controller 1 Mailbox 1 ID1 Register */
460#define CAN1_MB02_DATA0 0xffc03440 /* CAN Controller 1 Mailbox 2 Data 0 Register */
461#define CAN1_MB02_DATA1 0xffc03444 /* CAN Controller 1 Mailbox 2 Data 1 Register */
462#define CAN1_MB02_DATA2 0xffc03448 /* CAN Controller 1 Mailbox 2 Data 2 Register */
463#define CAN1_MB02_DATA3 0xffc0344c /* CAN Controller 1 Mailbox 2 Data 3 Register */
464#define CAN1_MB02_LENGTH 0xffc03450 /* CAN Controller 1 Mailbox 2 Length Register */
465#define CAN1_MB02_TIMESTAMP 0xffc03454 /* CAN Controller 1 Mailbox 2 Timestamp Register */
466#define CAN1_MB02_ID0 0xffc03458 /* CAN Controller 1 Mailbox 2 ID0 Register */
467#define CAN1_MB02_ID1 0xffc0345c /* CAN Controller 1 Mailbox 2 ID1 Register */
468#define CAN1_MB03_DATA0 0xffc03460 /* CAN Controller 1 Mailbox 3 Data 0 Register */
469#define CAN1_MB03_DATA1 0xffc03464 /* CAN Controller 1 Mailbox 3 Data 1 Register */
470#define CAN1_MB03_DATA2 0xffc03468 /* CAN Controller 1 Mailbox 3 Data 2 Register */
471#define CAN1_MB03_DATA3 0xffc0346c /* CAN Controller 1 Mailbox 3 Data 3 Register */
472#define CAN1_MB03_LENGTH 0xffc03470 /* CAN Controller 1 Mailbox 3 Length Register */
473#define CAN1_MB03_TIMESTAMP 0xffc03474 /* CAN Controller 1 Mailbox 3 Timestamp Register */
474#define CAN1_MB03_ID0 0xffc03478 /* CAN Controller 1 Mailbox 3 ID0 Register */
475#define CAN1_MB03_ID1 0xffc0347c /* CAN Controller 1 Mailbox 3 ID1 Register */
476#define CAN1_MB04_DATA0 0xffc03480 /* CAN Controller 1 Mailbox 4 Data 0 Register */
477#define CAN1_MB04_DATA1 0xffc03484 /* CAN Controller 1 Mailbox 4 Data 1 Register */
478#define CAN1_MB04_DATA2 0xffc03488 /* CAN Controller 1 Mailbox 4 Data 2 Register */
479#define CAN1_MB04_DATA3 0xffc0348c /* CAN Controller 1 Mailbox 4 Data 3 Register */
480#define CAN1_MB04_LENGTH 0xffc03490 /* CAN Controller 1 Mailbox 4 Length Register */
481#define CAN1_MB04_TIMESTAMP 0xffc03494 /* CAN Controller 1 Mailbox 4 Timestamp Register */
482#define CAN1_MB04_ID0 0xffc03498 /* CAN Controller 1 Mailbox 4 ID0 Register */
483#define CAN1_MB04_ID1 0xffc0349c /* CAN Controller 1 Mailbox 4 ID1 Register */
484#define CAN1_MB05_DATA0 0xffc034a0 /* CAN Controller 1 Mailbox 5 Data 0 Register */
485#define CAN1_MB05_DATA1 0xffc034a4 /* CAN Controller 1 Mailbox 5 Data 1 Register */
486#define CAN1_MB05_DATA2 0xffc034a8 /* CAN Controller 1 Mailbox 5 Data 2 Register */
487#define CAN1_MB05_DATA3 0xffc034ac /* CAN Controller 1 Mailbox 5 Data 3 Register */
488#define CAN1_MB05_LENGTH 0xffc034b0 /* CAN Controller 1 Mailbox 5 Length Register */
489#define CAN1_MB05_TIMESTAMP 0xffc034b4 /* CAN Controller 1 Mailbox 5 Timestamp Register */
490#define CAN1_MB05_ID0 0xffc034b8 /* CAN Controller 1 Mailbox 5 ID0 Register */
491#define CAN1_MB05_ID1 0xffc034bc /* CAN Controller 1 Mailbox 5 ID1 Register */
492#define CAN1_MB06_DATA0 0xffc034c0 /* CAN Controller 1 Mailbox 6 Data 0 Register */
493#define CAN1_MB06_DATA1 0xffc034c4 /* CAN Controller 1 Mailbox 6 Data 1 Register */
494#define CAN1_MB06_DATA2 0xffc034c8 /* CAN Controller 1 Mailbox 6 Data 2 Register */
495#define CAN1_MB06_DATA3 0xffc034cc /* CAN Controller 1 Mailbox 6 Data 3 Register */
496#define CAN1_MB06_LENGTH 0xffc034d0 /* CAN Controller 1 Mailbox 6 Length Register */
497#define CAN1_MB06_TIMESTAMP 0xffc034d4 /* CAN Controller 1 Mailbox 6 Timestamp Register */
498#define CAN1_MB06_ID0 0xffc034d8 /* CAN Controller 1 Mailbox 6 ID0 Register */
499#define CAN1_MB06_ID1 0xffc034dc /* CAN Controller 1 Mailbox 6 ID1 Register */
500#define CAN1_MB07_DATA0 0xffc034e0 /* CAN Controller 1 Mailbox 7 Data 0 Register */
501#define CAN1_MB07_DATA1 0xffc034e4 /* CAN Controller 1 Mailbox 7 Data 1 Register */
502#define CAN1_MB07_DATA2 0xffc034e8 /* CAN Controller 1 Mailbox 7 Data 2 Register */
503#define CAN1_MB07_DATA3 0xffc034ec /* CAN Controller 1 Mailbox 7 Data 3 Register */
504#define CAN1_MB07_LENGTH 0xffc034f0 /* CAN Controller 1 Mailbox 7 Length Register */
505#define CAN1_MB07_TIMESTAMP 0xffc034f4 /* CAN Controller 1 Mailbox 7 Timestamp Register */
506#define CAN1_MB07_ID0 0xffc034f8 /* CAN Controller 1 Mailbox 7 ID0 Register */
507#define CAN1_MB07_ID1 0xffc034fc /* CAN Controller 1 Mailbox 7 ID1 Register */
508#define CAN1_MB08_DATA0 0xffc03500 /* CAN Controller 1 Mailbox 8 Data 0 Register */
509#define CAN1_MB08_DATA1 0xffc03504 /* CAN Controller 1 Mailbox 8 Data 1 Register */
510#define CAN1_MB08_DATA2 0xffc03508 /* CAN Controller 1 Mailbox 8 Data 2 Register */
511#define CAN1_MB08_DATA3 0xffc0350c /* CAN Controller 1 Mailbox 8 Data 3 Register */
512#define CAN1_MB08_LENGTH 0xffc03510 /* CAN Controller 1 Mailbox 8 Length Register */
513#define CAN1_MB08_TIMESTAMP 0xffc03514 /* CAN Controller 1 Mailbox 8 Timestamp Register */
514#define CAN1_MB08_ID0 0xffc03518 /* CAN Controller 1 Mailbox 8 ID0 Register */
515#define CAN1_MB08_ID1 0xffc0351c /* CAN Controller 1 Mailbox 8 ID1 Register */
516#define CAN1_MB09_DATA0 0xffc03520 /* CAN Controller 1 Mailbox 9 Data 0 Register */
517#define CAN1_MB09_DATA1 0xffc03524 /* CAN Controller 1 Mailbox 9 Data 1 Register */
518#define CAN1_MB09_DATA2 0xffc03528 /* CAN Controller 1 Mailbox 9 Data 2 Register */
519#define CAN1_MB09_DATA3 0xffc0352c /* CAN Controller 1 Mailbox 9 Data 3 Register */
520#define CAN1_MB09_LENGTH 0xffc03530 /* CAN Controller 1 Mailbox 9 Length Register */
521#define CAN1_MB09_TIMESTAMP 0xffc03534 /* CAN Controller 1 Mailbox 9 Timestamp Register */
522#define CAN1_MB09_ID0 0xffc03538 /* CAN Controller 1 Mailbox 9 ID0 Register */
523#define CAN1_MB09_ID1 0xffc0353c /* CAN Controller 1 Mailbox 9 ID1 Register */
524#define CAN1_MB10_DATA0 0xffc03540 /* CAN Controller 1 Mailbox 10 Data 0 Register */
525#define CAN1_MB10_DATA1 0xffc03544 /* CAN Controller 1 Mailbox 10 Data 1 Register */
526#define CAN1_MB10_DATA2 0xffc03548 /* CAN Controller 1 Mailbox 10 Data 2 Register */
527#define CAN1_MB10_DATA3 0xffc0354c /* CAN Controller 1 Mailbox 10 Data 3 Register */
528#define CAN1_MB10_LENGTH 0xffc03550 /* CAN Controller 1 Mailbox 10 Length Register */
529#define CAN1_MB10_TIMESTAMP 0xffc03554 /* CAN Controller 1 Mailbox 10 Timestamp Register */
530#define CAN1_MB10_ID0 0xffc03558 /* CAN Controller 1 Mailbox 10 ID0 Register */
531#define CAN1_MB10_ID1 0xffc0355c /* CAN Controller 1 Mailbox 10 ID1 Register */
532#define CAN1_MB11_DATA0 0xffc03560 /* CAN Controller 1 Mailbox 11 Data 0 Register */
533#define CAN1_MB11_DATA1 0xffc03564 /* CAN Controller 1 Mailbox 11 Data 1 Register */
534#define CAN1_MB11_DATA2 0xffc03568 /* CAN Controller 1 Mailbox 11 Data 2 Register */
535#define CAN1_MB11_DATA3 0xffc0356c /* CAN Controller 1 Mailbox 11 Data 3 Register */
536#define CAN1_MB11_LENGTH 0xffc03570 /* CAN Controller 1 Mailbox 11 Length Register */
537#define CAN1_MB11_TIMESTAMP 0xffc03574 /* CAN Controller 1 Mailbox 11 Timestamp Register */
538#define CAN1_MB11_ID0 0xffc03578 /* CAN Controller 1 Mailbox 11 ID0 Register */
539#define CAN1_MB11_ID1 0xffc0357c /* CAN Controller 1 Mailbox 11 ID1 Register */
540#define CAN1_MB12_DATA0 0xffc03580 /* CAN Controller 1 Mailbox 12 Data 0 Register */
541#define CAN1_MB12_DATA1 0xffc03584 /* CAN Controller 1 Mailbox 12 Data 1 Register */
542#define CAN1_MB12_DATA2 0xffc03588 /* CAN Controller 1 Mailbox 12 Data 2 Register */
543#define CAN1_MB12_DATA3 0xffc0358c /* CAN Controller 1 Mailbox 12 Data 3 Register */
544#define CAN1_MB12_LENGTH 0xffc03590 /* CAN Controller 1 Mailbox 12 Length Register */
545#define CAN1_MB12_TIMESTAMP 0xffc03594 /* CAN Controller 1 Mailbox 12 Timestamp Register */
546#define CAN1_MB12_ID0 0xffc03598 /* CAN Controller 1 Mailbox 12 ID0 Register */
547#define CAN1_MB12_ID1 0xffc0359c /* CAN Controller 1 Mailbox 12 ID1 Register */
548#define CAN1_MB13_DATA0 0xffc035a0 /* CAN Controller 1 Mailbox 13 Data 0 Register */
549#define CAN1_MB13_DATA1 0xffc035a4 /* CAN Controller 1 Mailbox 13 Data 1 Register */
550#define CAN1_MB13_DATA2 0xffc035a8 /* CAN Controller 1 Mailbox 13 Data 2 Register */
551#define CAN1_MB13_DATA3 0xffc035ac /* CAN Controller 1 Mailbox 13 Data 3 Register */
552#define CAN1_MB13_LENGTH 0xffc035b0 /* CAN Controller 1 Mailbox 13 Length Register */
553#define CAN1_MB13_TIMESTAMP 0xffc035b4 /* CAN Controller 1 Mailbox 13 Timestamp Register */
554#define CAN1_MB13_ID0 0xffc035b8 /* CAN Controller 1 Mailbox 13 ID0 Register */
555#define CAN1_MB13_ID1 0xffc035bc /* CAN Controller 1 Mailbox 13 ID1 Register */
556#define CAN1_MB14_DATA0 0xffc035c0 /* CAN Controller 1 Mailbox 14 Data 0 Register */
557#define CAN1_MB14_DATA1 0xffc035c4 /* CAN Controller 1 Mailbox 14 Data 1 Register */
558#define CAN1_MB14_DATA2 0xffc035c8 /* CAN Controller 1 Mailbox 14 Data 2 Register */
559#define CAN1_MB14_DATA3 0xffc035cc /* CAN Controller 1 Mailbox 14 Data 3 Register */
560#define CAN1_MB14_LENGTH 0xffc035d0 /* CAN Controller 1 Mailbox 14 Length Register */
561#define CAN1_MB14_TIMESTAMP 0xffc035d4 /* CAN Controller 1 Mailbox 14 Timestamp Register */
562#define CAN1_MB14_ID0 0xffc035d8 /* CAN Controller 1 Mailbox 14 ID0 Register */
563#define CAN1_MB14_ID1 0xffc035dc /* CAN Controller 1 Mailbox 14 ID1 Register */
564#define CAN1_MB15_DATA0 0xffc035e0 /* CAN Controller 1 Mailbox 15 Data 0 Register */
565#define CAN1_MB15_DATA1 0xffc035e4 /* CAN Controller 1 Mailbox 15 Data 1 Register */
566#define CAN1_MB15_DATA2 0xffc035e8 /* CAN Controller 1 Mailbox 15 Data 2 Register */
567#define CAN1_MB15_DATA3 0xffc035ec /* CAN Controller 1 Mailbox 15 Data 3 Register */
568#define CAN1_MB15_LENGTH 0xffc035f0 /* CAN Controller 1 Mailbox 15 Length Register */
569#define CAN1_MB15_TIMESTAMP 0xffc035f4 /* CAN Controller 1 Mailbox 15 Timestamp Register */
570#define CAN1_MB15_ID0 0xffc035f8 /* CAN Controller 1 Mailbox 15 ID0 Register */
571#define CAN1_MB15_ID1 0xffc035fc /* CAN Controller 1 Mailbox 15 ID1 Register */
572
573/* CAN Controller 1 Mailbox Data Registers */
574
575#define CAN1_MB16_DATA0 0xffc03600 /* CAN Controller 1 Mailbox 16 Data 0 Register */
576#define CAN1_MB16_DATA1 0xffc03604 /* CAN Controller 1 Mailbox 16 Data 1 Register */
577#define CAN1_MB16_DATA2 0xffc03608 /* CAN Controller 1 Mailbox 16 Data 2 Register */
578#define CAN1_MB16_DATA3 0xffc0360c /* CAN Controller 1 Mailbox 16 Data 3 Register */
579#define CAN1_MB16_LENGTH 0xffc03610 /* CAN Controller 1 Mailbox 16 Length Register */
580#define CAN1_MB16_TIMESTAMP 0xffc03614 /* CAN Controller 1 Mailbox 16 Timestamp Register */
581#define CAN1_MB16_ID0 0xffc03618 /* CAN Controller 1 Mailbox 16 ID0 Register */
582#define CAN1_MB16_ID1 0xffc0361c /* CAN Controller 1 Mailbox 16 ID1 Register */
583#define CAN1_MB17_DATA0 0xffc03620 /* CAN Controller 1 Mailbox 17 Data 0 Register */
584#define CAN1_MB17_DATA1 0xffc03624 /* CAN Controller 1 Mailbox 17 Data 1 Register */
585#define CAN1_MB17_DATA2 0xffc03628 /* CAN Controller 1 Mailbox 17 Data 2 Register */
586#define CAN1_MB17_DATA3 0xffc0362c /* CAN Controller 1 Mailbox 17 Data 3 Register */
587#define CAN1_MB17_LENGTH 0xffc03630 /* CAN Controller 1 Mailbox 17 Length Register */
588#define CAN1_MB17_TIMESTAMP 0xffc03634 /* CAN Controller 1 Mailbox 17 Timestamp Register */
589#define CAN1_MB17_ID0 0xffc03638 /* CAN Controller 1 Mailbox 17 ID0 Register */
590#define CAN1_MB17_ID1 0xffc0363c /* CAN Controller 1 Mailbox 17 ID1 Register */
591#define CAN1_MB18_DATA0 0xffc03640 /* CAN Controller 1 Mailbox 18 Data 0 Register */
592#define CAN1_MB18_DATA1 0xffc03644 /* CAN Controller 1 Mailbox 18 Data 1 Register */
593#define CAN1_MB18_DATA2 0xffc03648 /* CAN Controller 1 Mailbox 18 Data 2 Register */
594#define CAN1_MB18_DATA3 0xffc0364c /* CAN Controller 1 Mailbox 18 Data 3 Register */
595#define CAN1_MB18_LENGTH 0xffc03650 /* CAN Controller 1 Mailbox 18 Length Register */
596#define CAN1_MB18_TIMESTAMP 0xffc03654 /* CAN Controller 1 Mailbox 18 Timestamp Register */
597#define CAN1_MB18_ID0 0xffc03658 /* CAN Controller 1 Mailbox 18 ID0 Register */
598#define CAN1_MB18_ID1 0xffc0365c /* CAN Controller 1 Mailbox 18 ID1 Register */
599#define CAN1_MB19_DATA0 0xffc03660 /* CAN Controller 1 Mailbox 19 Data 0 Register */
600#define CAN1_MB19_DATA1 0xffc03664 /* CAN Controller 1 Mailbox 19 Data 1 Register */
601#define CAN1_MB19_DATA2 0xffc03668 /* CAN Controller 1 Mailbox 19 Data 2 Register */
602#define CAN1_MB19_DATA3 0xffc0366c /* CAN Controller 1 Mailbox 19 Data 3 Register */
603#define CAN1_MB19_LENGTH 0xffc03670 /* CAN Controller 1 Mailbox 19 Length Register */
604#define CAN1_MB19_TIMESTAMP 0xffc03674 /* CAN Controller 1 Mailbox 19 Timestamp Register */
605#define CAN1_MB19_ID0 0xffc03678 /* CAN Controller 1 Mailbox 19 ID0 Register */
606#define CAN1_MB19_ID1 0xffc0367c /* CAN Controller 1 Mailbox 19 ID1 Register */
607#define CAN1_MB20_DATA0 0xffc03680 /* CAN Controller 1 Mailbox 20 Data 0 Register */
608#define CAN1_MB20_DATA1 0xffc03684 /* CAN Controller 1 Mailbox 20 Data 1 Register */
609#define CAN1_MB20_DATA2 0xffc03688 /* CAN Controller 1 Mailbox 20 Data 2 Register */
610#define CAN1_MB20_DATA3 0xffc0368c /* CAN Controller 1 Mailbox 20 Data 3 Register */
611#define CAN1_MB20_LENGTH 0xffc03690 /* CAN Controller 1 Mailbox 20 Length Register */
612#define CAN1_MB20_TIMESTAMP 0xffc03694 /* CAN Controller 1 Mailbox 20 Timestamp Register */
613#define CAN1_MB20_ID0 0xffc03698 /* CAN Controller 1 Mailbox 20 ID0 Register */
614#define CAN1_MB20_ID1 0xffc0369c /* CAN Controller 1 Mailbox 20 ID1 Register */
615#define CAN1_MB21_DATA0 0xffc036a0 /* CAN Controller 1 Mailbox 21 Data 0 Register */
616#define CAN1_MB21_DATA1 0xffc036a4 /* CAN Controller 1 Mailbox 21 Data 1 Register */
617#define CAN1_MB21_DATA2 0xffc036a8 /* CAN Controller 1 Mailbox 21 Data 2 Register */
618#define CAN1_MB21_DATA3 0xffc036ac /* CAN Controller 1 Mailbox 21 Data 3 Register */
619#define CAN1_MB21_LENGTH 0xffc036b0 /* CAN Controller 1 Mailbox 21 Length Register */
620#define CAN1_MB21_TIMESTAMP 0xffc036b4 /* CAN Controller 1 Mailbox 21 Timestamp Register */
621#define CAN1_MB21_ID0 0xffc036b8 /* CAN Controller 1 Mailbox 21 ID0 Register */
622#define CAN1_MB21_ID1 0xffc036bc /* CAN Controller 1 Mailbox 21 ID1 Register */
623#define CAN1_MB22_DATA0 0xffc036c0 /* CAN Controller 1 Mailbox 22 Data 0 Register */
624#define CAN1_MB22_DATA1 0xffc036c4 /* CAN Controller 1 Mailbox 22 Data 1 Register */
625#define CAN1_MB22_DATA2 0xffc036c8 /* CAN Controller 1 Mailbox 22 Data 2 Register */
626#define CAN1_MB22_DATA3 0xffc036cc /* CAN Controller 1 Mailbox 22 Data 3 Register */
627#define CAN1_MB22_LENGTH 0xffc036d0 /* CAN Controller 1 Mailbox 22 Length Register */
628#define CAN1_MB22_TIMESTAMP 0xffc036d4 /* CAN Controller 1 Mailbox 22 Timestamp Register */
629#define CAN1_MB22_ID0 0xffc036d8 /* CAN Controller 1 Mailbox 22 ID0 Register */
630#define CAN1_MB22_ID1 0xffc036dc /* CAN Controller 1 Mailbox 22 ID1 Register */
631#define CAN1_MB23_DATA0 0xffc036e0 /* CAN Controller 1 Mailbox 23 Data 0 Register */
632#define CAN1_MB23_DATA1 0xffc036e4 /* CAN Controller 1 Mailbox 23 Data 1 Register */
633#define CAN1_MB23_DATA2 0xffc036e8 /* CAN Controller 1 Mailbox 23 Data 2 Register */
634#define CAN1_MB23_DATA3 0xffc036ec /* CAN Controller 1 Mailbox 23 Data 3 Register */
635#define CAN1_MB23_LENGTH 0xffc036f0 /* CAN Controller 1 Mailbox 23 Length Register */
636#define CAN1_MB23_TIMESTAMP 0xffc036f4 /* CAN Controller 1 Mailbox 23 Timestamp Register */
637#define CAN1_MB23_ID0 0xffc036f8 /* CAN Controller 1 Mailbox 23 ID0 Register */
638#define CAN1_MB23_ID1 0xffc036fc /* CAN Controller 1 Mailbox 23 ID1 Register */
639#define CAN1_MB24_DATA0 0xffc03700 /* CAN Controller 1 Mailbox 24 Data 0 Register */
640#define CAN1_MB24_DATA1 0xffc03704 /* CAN Controller 1 Mailbox 24 Data 1 Register */
641#define CAN1_MB24_DATA2 0xffc03708 /* CAN Controller 1 Mailbox 24 Data 2 Register */
642#define CAN1_MB24_DATA3 0xffc0370c /* CAN Controller 1 Mailbox 24 Data 3 Register */
643#define CAN1_MB24_LENGTH 0xffc03710 /* CAN Controller 1 Mailbox 24 Length Register */
644#define CAN1_MB24_TIMESTAMP 0xffc03714 /* CAN Controller 1 Mailbox 24 Timestamp Register */
645#define CAN1_MB24_ID0 0xffc03718 /* CAN Controller 1 Mailbox 24 ID0 Register */
646#define CAN1_MB24_ID1 0xffc0371c /* CAN Controller 1 Mailbox 24 ID1 Register */
647#define CAN1_MB25_DATA0 0xffc03720 /* CAN Controller 1 Mailbox 25 Data 0 Register */
648#define CAN1_MB25_DATA1 0xffc03724 /* CAN Controller 1 Mailbox 25 Data 1 Register */
649#define CAN1_MB25_DATA2 0xffc03728 /* CAN Controller 1 Mailbox 25 Data 2 Register */
650#define CAN1_MB25_DATA3 0xffc0372c /* CAN Controller 1 Mailbox 25 Data 3 Register */
651#define CAN1_MB25_LENGTH 0xffc03730 /* CAN Controller 1 Mailbox 25 Length Register */
652#define CAN1_MB25_TIMESTAMP 0xffc03734 /* CAN Controller 1 Mailbox 25 Timestamp Register */
653#define CAN1_MB25_ID0 0xffc03738 /* CAN Controller 1 Mailbox 25 ID0 Register */
654#define CAN1_MB25_ID1 0xffc0373c /* CAN Controller 1 Mailbox 25 ID1 Register */
655#define CAN1_MB26_DATA0 0xffc03740 /* CAN Controller 1 Mailbox 26 Data 0 Register */
656#define CAN1_MB26_DATA1 0xffc03744 /* CAN Controller 1 Mailbox 26 Data 1 Register */
657#define CAN1_MB26_DATA2 0xffc03748 /* CAN Controller 1 Mailbox 26 Data 2 Register */
658#define CAN1_MB26_DATA3 0xffc0374c /* CAN Controller 1 Mailbox 26 Data 3 Register */
659#define CAN1_MB26_LENGTH 0xffc03750 /* CAN Controller 1 Mailbox 26 Length Register */
660#define CAN1_MB26_TIMESTAMP 0xffc03754 /* CAN Controller 1 Mailbox 26 Timestamp Register */
661#define CAN1_MB26_ID0 0xffc03758 /* CAN Controller 1 Mailbox 26 ID0 Register */
662#define CAN1_MB26_ID1 0xffc0375c /* CAN Controller 1 Mailbox 26 ID1 Register */
663#define CAN1_MB27_DATA0 0xffc03760 /* CAN Controller 1 Mailbox 27 Data 0 Register */
664#define CAN1_MB27_DATA1 0xffc03764 /* CAN Controller 1 Mailbox 27 Data 1 Register */
665#define CAN1_MB27_DATA2 0xffc03768 /* CAN Controller 1 Mailbox 27 Data 2 Register */
666#define CAN1_MB27_DATA3 0xffc0376c /* CAN Controller 1 Mailbox 27 Data 3 Register */
667#define CAN1_MB27_LENGTH 0xffc03770 /* CAN Controller 1 Mailbox 27 Length Register */
668#define CAN1_MB27_TIMESTAMP 0xffc03774 /* CAN Controller 1 Mailbox 27 Timestamp Register */
669#define CAN1_MB27_ID0 0xffc03778 /* CAN Controller 1 Mailbox 27 ID0 Register */
670#define CAN1_MB27_ID1 0xffc0377c /* CAN Controller 1 Mailbox 27 ID1 Register */
671#define CAN1_MB28_DATA0 0xffc03780 /* CAN Controller 1 Mailbox 28 Data 0 Register */
672#define CAN1_MB28_DATA1 0xffc03784 /* CAN Controller 1 Mailbox 28 Data 1 Register */
673#define CAN1_MB28_DATA2 0xffc03788 /* CAN Controller 1 Mailbox 28 Data 2 Register */
674#define CAN1_MB28_DATA3 0xffc0378c /* CAN Controller 1 Mailbox 28 Data 3 Register */
675#define CAN1_MB28_LENGTH 0xffc03790 /* CAN Controller 1 Mailbox 28 Length Register */
676#define CAN1_MB28_TIMESTAMP 0xffc03794 /* CAN Controller 1 Mailbox 28 Timestamp Register */
677#define CAN1_MB28_ID0 0xffc03798 /* CAN Controller 1 Mailbox 28 ID0 Register */
678#define CAN1_MB28_ID1 0xffc0379c /* CAN Controller 1 Mailbox 28 ID1 Register */
679#define CAN1_MB29_DATA0 0xffc037a0 /* CAN Controller 1 Mailbox 29 Data 0 Register */
680#define CAN1_MB29_DATA1 0xffc037a4 /* CAN Controller 1 Mailbox 29 Data 1 Register */
681#define CAN1_MB29_DATA2 0xffc037a8 /* CAN Controller 1 Mailbox 29 Data 2 Register */
682#define CAN1_MB29_DATA3 0xffc037ac /* CAN Controller 1 Mailbox 29 Data 3 Register */
683#define CAN1_MB29_LENGTH 0xffc037b0 /* CAN Controller 1 Mailbox 29 Length Register */
684#define CAN1_MB29_TIMESTAMP 0xffc037b4 /* CAN Controller 1 Mailbox 29 Timestamp Register */
685#define CAN1_MB29_ID0 0xffc037b8 /* CAN Controller 1 Mailbox 29 ID0 Register */
686#define CAN1_MB29_ID1 0xffc037bc /* CAN Controller 1 Mailbox 29 ID1 Register */
687#define CAN1_MB30_DATA0 0xffc037c0 /* CAN Controller 1 Mailbox 30 Data 0 Register */
688#define CAN1_MB30_DATA1 0xffc037c4 /* CAN Controller 1 Mailbox 30 Data 1 Register */
689#define CAN1_MB30_DATA2 0xffc037c8 /* CAN Controller 1 Mailbox 30 Data 2 Register */
690#define CAN1_MB30_DATA3 0xffc037cc /* CAN Controller 1 Mailbox 30 Data 3 Register */
691#define CAN1_MB30_LENGTH 0xffc037d0 /* CAN Controller 1 Mailbox 30 Length Register */
692#define CAN1_MB30_TIMESTAMP 0xffc037d4 /* CAN Controller 1 Mailbox 30 Timestamp Register */
693#define CAN1_MB30_ID0 0xffc037d8 /* CAN Controller 1 Mailbox 30 ID0 Register */
694#define CAN1_MB30_ID1 0xffc037dc /* CAN Controller 1 Mailbox 30 ID1 Register */
695#define CAN1_MB31_DATA0 0xffc037e0 /* CAN Controller 1 Mailbox 31 Data 0 Register */
696#define CAN1_MB31_DATA1 0xffc037e4 /* CAN Controller 1 Mailbox 31 Data 1 Register */
697#define CAN1_MB31_DATA2 0xffc037e8 /* CAN Controller 1 Mailbox 31 Data 2 Register */
698#define CAN1_MB31_DATA3 0xffc037ec /* CAN Controller 1 Mailbox 31 Data 3 Register */
699#define CAN1_MB31_LENGTH 0xffc037f0 /* CAN Controller 1 Mailbox 31 Length Register */
700#define CAN1_MB31_TIMESTAMP 0xffc037f4 /* CAN Controller 1 Mailbox 31 Timestamp Register */
701#define CAN1_MB31_ID0 0xffc037f8 /* CAN Controller 1 Mailbox 31 ID0 Register */
702#define CAN1_MB31_ID1 0xffc037fc /* CAN Controller 1 Mailbox 31 ID1 Register */
703
704/* ATAPI Registers */
705
706#define ATAPI_CONTROL 0xffc03800 /* ATAPI Control Register */
707#define ATAPI_STATUS 0xffc03804 /* ATAPI Status Register */
708#define ATAPI_DEV_ADDR 0xffc03808 /* ATAPI Device Register Address */
709#define ATAPI_DEV_TXBUF 0xffc0380c /* ATAPI Device Register Write Data */
710#define ATAPI_DEV_RXBUF 0xffc03810 /* ATAPI Device Register Read Data */
711#define ATAPI_INT_MASK 0xffc03814 /* ATAPI Interrupt Mask Register */
712#define ATAPI_INT_STATUS 0xffc03818 /* ATAPI Interrupt Status Register */
713#define ATAPI_XFER_LEN 0xffc0381c /* ATAPI Length of Transfer */
714#define ATAPI_LINE_STATUS 0xffc03820 /* ATAPI Line Status */
715#define ATAPI_SM_STATE 0xffc03824 /* ATAPI State Machine Status */
716#define ATAPI_TERMINATE 0xffc03828 /* ATAPI Host Terminate */
717#define ATAPI_PIO_TFRCNT 0xffc0382c /* ATAPI PIO mode transfer count */
718#define ATAPI_DMA_TFRCNT 0xffc03830 /* ATAPI DMA mode transfer count */
719#define ATAPI_UMAIN_TFRCNT 0xffc03834 /* ATAPI UDMAIN transfer count */
720#define ATAPI_UDMAOUT_TFRCNT 0xffc03838 /* ATAPI UDMAOUT transfer count */
721#define ATAPI_REG_TIM_0 0xffc03840 /* ATAPI Register Transfer Timing 0 */
722#define ATAPI_PIO_TIM_0 0xffc03844 /* ATAPI PIO Timing 0 Register */
723#define ATAPI_PIO_TIM_1 0xffc03848 /* ATAPI PIO Timing 1 Register */
724#define ATAPI_MULTI_TIM_0 0xffc03850 /* ATAPI Multi-DMA Timing 0 Register */
725#define ATAPI_MULTI_TIM_1 0xffc03854 /* ATAPI Multi-DMA Timing 1 Register */
726#define ATAPI_MULTI_TIM_2 0xffc03858 /* ATAPI Multi-DMA Timing 2 Register */
727#define ATAPI_ULTRA_TIM_0 0xffc03860 /* ATAPI Ultra-DMA Timing 0 Register */
728#define ATAPI_ULTRA_TIM_1 0xffc03864 /* ATAPI Ultra-DMA Timing 1 Register */
729#define ATAPI_ULTRA_TIM_2 0xffc03868 /* ATAPI Ultra-DMA Timing 2 Register */
730#define ATAPI_ULTRA_TIM_3 0xffc0386c /* ATAPI Ultra-DMA Timing 3 Register */
731
732/* SDH Registers */
733
734#define SDH_PWR_CTL 0xffc03900 /* SDH Power Control */
735#define SDH_CLK_CTL 0xffc03904 /* SDH Clock Control */
736#define SDH_ARGUMENT 0xffc03908 /* SDH Argument */
737#define SDH_COMMAND 0xffc0390c /* SDH Command */
738#define SDH_RESP_CMD 0xffc03910 /* SDH Response Command */
739#define SDH_RESPONSE0 0xffc03914 /* SDH Response0 */
740#define SDH_RESPONSE1 0xffc03918 /* SDH Response1 */
741#define SDH_RESPONSE2 0xffc0391c /* SDH Response2 */
742#define SDH_RESPONSE3 0xffc03920 /* SDH Response3 */
743#define SDH_DATA_TIMER 0xffc03924 /* SDH Data Timer */
744#define SDH_DATA_LGTH 0xffc03928 /* SDH Data Length */
745#define SDH_DATA_CTL 0xffc0392c /* SDH Data Control */
746#define SDH_DATA_CNT 0xffc03930 /* SDH Data Counter */
747#define SDH_STATUS 0xffc03934 /* SDH Status */
748#define SDH_STATUS_CLR 0xffc03938 /* SDH Status Clear */
749#define SDH_MASK0 0xffc0393c /* SDH Interrupt0 Mask */
750#define SDH_MASK1 0xffc03940 /* SDH Interrupt1 Mask */
751#define SDH_FIFO_CNT 0xffc03948 /* SDH FIFO Counter */
752#define SDH_FIFO 0xffc03980 /* SDH Data FIFO */
753#define SDH_E_STATUS 0xffc039c0 /* SDH Exception Status */
754#define SDH_E_MASK 0xffc039c4 /* SDH Exception Mask */
755#define SDH_CFG 0xffc039c8 /* SDH Configuration */
756#define SDH_RD_WAIT_EN 0xffc039cc /* SDH Read Wait Enable */
757#define SDH_PID0 0xffc039d0 /* SDH Peripheral Identification0 */
758#define SDH_PID1 0xffc039d4 /* SDH Peripheral Identification1 */
759#define SDH_PID2 0xffc039d8 /* SDH Peripheral Identification2 */
760#define SDH_PID3 0xffc039dc /* SDH Peripheral Identification3 */
761#define SDH_PID4 0xffc039e0 /* SDH Peripheral Identification4 */
762#define SDH_PID5 0xffc039e4 /* SDH Peripheral Identification5 */
763#define SDH_PID6 0xffc039e8 /* SDH Peripheral Identification6 */
764#define SDH_PID7 0xffc039ec /* SDH Peripheral Identification7 */
765
766/* HOST Port Registers */
767
768#define HOST_CONTROL 0xffc03a00 /* HOST Control Register */
769#define HOST_STATUS 0xffc03a04 /* HOST Status Register */
770#define HOST_TIMEOUT 0xffc03a08 /* HOST Acknowledge Mode Timeout Register */
771
772/* USB Control Registers */
773
774#define USB_FADDR 0xffc03c00 /* Function address register */
775#define USB_POWER 0xffc03c04 /* Power management register */
776#define USB_INTRTX 0xffc03c08 /* Interrupt register for endpoint 0 and Tx endpoint 1 to 7 */
777#define USB_INTRRX 0xffc03c0c /* Interrupt register for Rx endpoints 1 to 7 */
778#define USB_INTRTXE 0xffc03c10 /* Interrupt enable register for IntrTx */
779#define USB_INTRRXE 0xffc03c14 /* Interrupt enable register for IntrRx */
780#define USB_INTRUSB 0xffc03c18 /* Interrupt register for common USB interrupts */
781#define USB_INTRUSBE 0xffc03c1c /* Interrupt enable register for IntrUSB */
782#define USB_FRAME 0xffc03c20 /* USB frame number */
783#define USB_INDEX 0xffc03c24 /* Index register for selecting the indexed endpoint registers */
784#define USB_TESTMODE 0xffc03c28 /* Enabled USB 20 test modes */
785#define USB_GLOBINTR 0xffc03c2c /* Global Interrupt Mask register and Wakeup Exception Interrupt */
786#define USB_GLOBAL_CTL 0xffc03c30 /* Global Clock Control for the core */
787
788/* USB Packet Control Registers */
789
790#define USB_TX_MAX_PACKET 0xffc03c40 /* Maximum packet size for Host Tx endpoint */
791#define USB_CSR0 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
792#define USB_TXCSR 0xffc03c44 /* Control Status register for endpoint 0 and Control Status register for Host Tx endpoint */
793#define USB_RX_MAX_PACKET 0xffc03c48 /* Maximum packet size for Host Rx endpoint */
794#define USB_RXCSR 0xffc03c4c /* Control Status register for Host Rx endpoint */
795#define USB_COUNT0 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
796#define USB_RXCOUNT 0xffc03c50 /* Number of bytes received in endpoint 0 FIFO and Number of bytes received in Host Tx endpoint */
797#define USB_TXTYPE 0xffc03c54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint */
798#define USB_NAKLIMIT0 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
799#define USB_TXINTERVAL 0xffc03c58 /* Sets the NAK response timeout on Endpoint 0 and on Bulk transfers for Host Tx endpoint */
800#define USB_RXTYPE 0xffc03c5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint */
801#define USB_RXINTERVAL 0xffc03c60 /* Sets the polling interval for Interrupt and Isochronous transfers or the NAK response timeout on Bulk transfers */
802#define USB_TXCOUNT 0xffc03c68 /* Number of bytes to be written to the selected endpoint Tx FIFO */
803
804/* USB Endpoint FIFO Registers */
805
806#define USB_EP0_FIFO 0xffc03c80 /* Endpoint 0 FIFO */
807#define USB_EP1_FIFO 0xffc03c88 /* Endpoint 1 FIFO */
808#define USB_EP2_FIFO 0xffc03c90 /* Endpoint 2 FIFO */
809#define USB_EP3_FIFO 0xffc03c98 /* Endpoint 3 FIFO */
810#define USB_EP4_FIFO 0xffc03ca0 /* Endpoint 4 FIFO */
811#define USB_EP5_FIFO 0xffc03ca8 /* Endpoint 5 FIFO */
812#define USB_EP6_FIFO 0xffc03cb0 /* Endpoint 6 FIFO */
813#define USB_EP7_FIFO 0xffc03cb8 /* Endpoint 7 FIFO */
814
815/* USB OTG Control Registers */
816
817#define USB_OTG_DEV_CTL 0xffc03d00 /* OTG Device Control Register */
818#define USB_OTG_VBUS_IRQ 0xffc03d04 /* OTG VBUS Control Interrupts */
819#define USB_OTG_VBUS_MASK 0xffc03d08 /* VBUS Control Interrupt Enable */
820
821/* USB Phy Control Registers */
822
823#define USB_LINKINFO 0xffc03d48 /* Enables programming of some PHY-side delays */
824#define USB_VPLEN 0xffc03d4c /* Determines duration of VBUS pulse for VBUS charging */
825#define USB_HS_EOF1 0xffc03d50 /* Time buffer for High-Speed transactions */
826#define USB_FS_EOF1 0xffc03d54 /* Time buffer for Full-Speed transactions */
827#define USB_LS_EOF1 0xffc03d58 /* Time buffer for Low-Speed transactions */
828
829/* (APHY_CNTRL is for ADI usage only) */
830
831#define USB_APHY_CNTRL 0xffc03de0 /* Register that increases visibility of Analog PHY */
832
833/* (APHY_CALIB is for ADI usage only) */
834
835#define USB_APHY_CALIB 0xffc03de4 /* Register used to set some calibration values */
836#define USB_APHY_CNTRL2 0xffc03de8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */
837
838/* (PHY_TEST is for ADI usage only) */
839
840#define USB_PHY_TEST 0xffc03dec /* Used for reducing simulation time and simplifies FIFO testability */
841#define USB_PLLOSC_CTRL 0xffc03df0 /* Used to program different parameters for USB PLL and Oscillator */
842#define USB_SRP_CLKDIV 0xffc03df4 /* Used to program clock divide value for the clock fed to the SRP detection logic */
843
844/* USB Endpoint 0 Control Registers */
845
846#define USB_EP_NI0_TXMAXP 0xffc03e00 /* Maximum packet size for Host Tx endpoint0 */
847#define USB_EP_NI0_TXCSR 0xffc03e04 /* Control Status register for endpoint 0 */
848#define USB_EP_NI0_RXMAXP 0xffc03e08 /* Maximum packet size for Host Rx endpoint0 */
849#define USB_EP_NI0_RXCSR 0xffc03e0c /* Control Status register for Host Rx endpoint0 */
850#define USB_EP_NI0_RXCOUNT 0xffc03e10 /* Number of bytes received in endpoint 0 FIFO */
851#define USB_EP_NI0_TXTYPE 0xffc03e14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint0 */
852#define USB_EP_NI0_TXINTERVAL 0xffc03e18 /* Sets the NAK response timeout on Endpoint 0 */
853#define USB_EP_NI0_RXTYPE 0xffc03e1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint0 */
854#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 */
855
856/* USB Endpoint 1 Control Registers */
857
858#define USB_EP_NI0_TXCOUNT 0xffc03e28 /* Number of bytes to be written to the endpoint0 Tx FIFO */
859#define USB_EP_NI1_TXMAXP 0xffc03e40 /* Maximum packet size for Host Tx endpoint1 */
860#define USB_EP_NI1_TXCSR 0xffc03e44 /* Control Status register for endpoint1 */
861#define USB_EP_NI1_RXMAXP 0xffc03e48 /* Maximum packet size for Host Rx endpoint1 */
862#define USB_EP_NI1_RXCSR 0xffc03e4c /* Control Status register for Host Rx endpoint1 */
863#define USB_EP_NI1_RXCOUNT 0xffc03e50 /* Number of bytes received in endpoint1 FIFO */
864#define USB_EP_NI1_TXTYPE 0xffc03e54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint1 */
865#define USB_EP_NI1_TXINTERVAL 0xffc03e58 /* Sets the NAK response timeout on Endpoint1 */
866#define USB_EP_NI1_RXTYPE 0xffc03e5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint1 */
867#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 */
868
869/* USB Endpoint 2 Control Registers */
870
871#define USB_EP_NI1_TXCOUNT 0xffc03e68 /* Number of bytes to be written to the+H102 endpoint1 Tx FIFO */
872#define USB_EP_NI2_TXMAXP 0xffc03e80 /* Maximum packet size for Host Tx endpoint2 */
873#define USB_EP_NI2_TXCSR 0xffc03e84 /* Control Status register for endpoint2 */
874#define USB_EP_NI2_RXMAXP 0xffc03e88 /* Maximum packet size for Host Rx endpoint2 */
875#define USB_EP_NI2_RXCSR 0xffc03e8c /* Control Status register for Host Rx endpoint2 */
876#define USB_EP_NI2_RXCOUNT 0xffc03e90 /* Number of bytes received in endpoint2 FIFO */
877#define USB_EP_NI2_TXTYPE 0xffc03e94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint2 */
878#define USB_EP_NI2_TXINTERVAL 0xffc03e98 /* Sets the NAK response timeout on Endpoint2 */
879#define USB_EP_NI2_RXTYPE 0xffc03e9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint2 */
880#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 */
881
882/* USB Endpoint 3 Control Registers */
883
884#define USB_EP_NI2_TXCOUNT 0xffc03ea8 /* Number of bytes to be written to the endpoint2 Tx FIFO */
885#define USB_EP_NI3_TXMAXP 0xffc03ec0 /* Maximum packet size for Host Tx endpoint3 */
886#define USB_EP_NI3_TXCSR 0xffc03ec4 /* Control Status register for endpoint3 */
887#define USB_EP_NI3_RXMAXP 0xffc03ec8 /* Maximum packet size for Host Rx endpoint3 */
888#define USB_EP_NI3_RXCSR 0xffc03ecc /* Control Status register for Host Rx endpoint3 */
889#define USB_EP_NI3_RXCOUNT 0xffc03ed0 /* Number of bytes received in endpoint3 FIFO */
890#define USB_EP_NI3_TXTYPE 0xffc03ed4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint3 */
891#define USB_EP_NI3_TXINTERVAL 0xffc03ed8 /* Sets the NAK response timeout on Endpoint3 */
892#define USB_EP_NI3_RXTYPE 0xffc03edc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint3 */
893#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 */
894
895/* USB Endpoint 4 Control Registers */
896
897#define USB_EP_NI3_TXCOUNT 0xffc03ee8 /* Number of bytes to be written to the H124endpoint3 Tx FIFO */
898#define USB_EP_NI4_TXMAXP 0xffc03f00 /* Maximum packet size for Host Tx endpoint4 */
899#define USB_EP_NI4_TXCSR 0xffc03f04 /* Control Status register for endpoint4 */
900#define USB_EP_NI4_RXMAXP 0xffc03f08 /* Maximum packet size for Host Rx endpoint4 */
901#define USB_EP_NI4_RXCSR 0xffc03f0c /* Control Status register for Host Rx endpoint4 */
902#define USB_EP_NI4_RXCOUNT 0xffc03f10 /* Number of bytes received in endpoint4 FIFO */
903#define USB_EP_NI4_TXTYPE 0xffc03f14 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint4 */
904#define USB_EP_NI4_TXINTERVAL 0xffc03f18 /* Sets the NAK response timeout on Endpoint4 */
905#define USB_EP_NI4_RXTYPE 0xffc03f1c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint4 */
906#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 */
907
908/* USB Endpoint 5 Control Registers */
909
910#define USB_EP_NI4_TXCOUNT 0xffc03f28 /* Number of bytes to be written to the endpoint4 Tx FIFO */
911#define USB_EP_NI5_TXMAXP 0xffc03f40 /* Maximum packet size for Host Tx endpoint5 */
912#define USB_EP_NI5_TXCSR 0xffc03f44 /* Control Status register for endpoint5 */
913#define USB_EP_NI5_RXMAXP 0xffc03f48 /* Maximum packet size for Host Rx endpoint5 */
914#define USB_EP_NI5_RXCSR 0xffc03f4c /* Control Status register for Host Rx endpoint5 */
915#define USB_EP_NI5_RXCOUNT 0xffc03f50 /* Number of bytes received in endpoint5 FIFO */
916#define USB_EP_NI5_TXTYPE 0xffc03f54 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint5 */
917#define USB_EP_NI5_TXINTERVAL 0xffc03f58 /* Sets the NAK response timeout on Endpoint5 */
918#define USB_EP_NI5_RXTYPE 0xffc03f5c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint5 */
919#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 */
920
921/* USB Endpoint 6 Control Registers */
922
923#define USB_EP_NI5_TXCOUNT 0xffc03f68 /* Number of bytes to be written to the H145endpoint5 Tx FIFO */
924#define USB_EP_NI6_TXMAXP 0xffc03f80 /* Maximum packet size for Host Tx endpoint6 */
925#define USB_EP_NI6_TXCSR 0xffc03f84 /* Control Status register for endpoint6 */
926#define USB_EP_NI6_RXMAXP 0xffc03f88 /* Maximum packet size for Host Rx endpoint6 */
927#define USB_EP_NI6_RXCSR 0xffc03f8c /* Control Status register for Host Rx endpoint6 */
928#define USB_EP_NI6_RXCOUNT 0xffc03f90 /* Number of bytes received in endpoint6 FIFO */
929#define USB_EP_NI6_TXTYPE 0xffc03f94 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint6 */
930#define USB_EP_NI6_TXINTERVAL 0xffc03f98 /* Sets the NAK response timeout on Endpoint6 */
931#define USB_EP_NI6_RXTYPE 0xffc03f9c /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint6 */
932#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 */
933
934/* USB Endpoint 7 Control Registers */
935
936#define USB_EP_NI6_TXCOUNT 0xffc03fa8 /* Number of bytes to be written to the endpoint6 Tx FIFO */
937#define USB_EP_NI7_TXMAXP 0xffc03fc0 /* Maximum packet size for Host Tx endpoint7 */
938#define USB_EP_NI7_TXCSR 0xffc03fc4 /* Control Status register for endpoint7 */
939#define USB_EP_NI7_RXMAXP 0xffc03fc8 /* Maximum packet size for Host Rx endpoint7 */
940#define USB_EP_NI7_RXCSR 0xffc03fcc /* Control Status register for Host Rx endpoint7 */
941#define USB_EP_NI7_RXCOUNT 0xffc03fd0 /* Number of bytes received in endpoint7 FIFO */
942#define USB_EP_NI7_TXTYPE 0xffc03fd4 /* Sets the transaction protocol and peripheral endpoint number for the Host Tx endpoint7 */
943#define USB_EP_NI7_TXINTERVAL 0xffc03fd8 /* Sets the NAK response timeout on Endpoint7 */
944#define USB_EP_NI7_RXTYPE 0xffc03fdc /* Sets the transaction protocol and peripheral endpoint number for the Host Rx endpoint7 */
945#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 */
946#define USB_EP_NI7_TXCOUNT 0xffc03ff8 /* Number of bytes to be written to the endpoint7 Tx FIFO */
947#define USB_DMA_INTERRUPT 0xffc04000 /* Indicates pending interrupts for the DMA channels */
948
949/* USB Channel 0 Config Registers */
950
951#define USB_DMA0CONTROL 0xffc04004 /* DMA master channel 0 configuration */
952#define USB_DMA0ADDRLOW 0xffc04008 /* Lower 16-bits of memory source/destination address for DMA master channel 0 */
953#define USB_DMA0ADDRHIGH 0xffc0400c /* Upper 16-bits of memory source/destination address for DMA master channel 0 */
954#define USB_DMA0COUNTLOW 0xffc04010 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 0 */
955#define USB_DMA0COUNTHIGH 0xffc04014 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 0 */
956
957/* USB Channel 1 Config Registers */
958
959#define USB_DMA1CONTROL 0xffc04024 /* DMA master channel 1 configuration */
960#define USB_DMA1ADDRLOW 0xffc04028 /* Lower 16-bits of memory source/destination address for DMA master channel 1 */
961#define USB_DMA1ADDRHIGH 0xffc0402c /* Upper 16-bits of memory source/destination address for DMA master channel 1 */
962#define USB_DMA1COUNTLOW 0xffc04030 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 1 */
963#define USB_DMA1COUNTHIGH 0xffc04034 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 1 */
964
965/* USB Channel 2 Config Registers */
966
967#define USB_DMA2CONTROL 0xffc04044 /* DMA master channel 2 configuration */
968#define USB_DMA2ADDRLOW 0xffc04048 /* Lower 16-bits of memory source/destination address for DMA master channel 2 */
969#define USB_DMA2ADDRHIGH 0xffc0404c /* Upper 16-bits of memory source/destination address for DMA master channel 2 */
970#define USB_DMA2COUNTLOW 0xffc04050 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 2 */
971#define USB_DMA2COUNTHIGH 0xffc04054 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 2 */
972
973/* USB Channel 3 Config Registers */
974
975#define USB_DMA3CONTROL 0xffc04064 /* DMA master channel 3 configuration */
976#define USB_DMA3ADDRLOW 0xffc04068 /* Lower 16-bits of memory source/destination address for DMA master channel 3 */
977#define USB_DMA3ADDRHIGH 0xffc0406c /* Upper 16-bits of memory source/destination address for DMA master channel 3 */
978#define USB_DMA3COUNTLOW 0xffc04070 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 3 */
979#define USB_DMA3COUNTHIGH 0xffc04074 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 3 */
980
981/* USB Channel 4 Config Registers */
982
983#define USB_DMA4CONTROL 0xffc04084 /* DMA master channel 4 configuration */
984#define USB_DMA4ADDRLOW 0xffc04088 /* Lower 16-bits of memory source/destination address for DMA master channel 4 */
985#define USB_DMA4ADDRHIGH 0xffc0408c /* Upper 16-bits of memory source/destination address for DMA master channel 4 */
986#define USB_DMA4COUNTLOW 0xffc04090 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 4 */
987#define USB_DMA4COUNTHIGH 0xffc04094 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 4 */
988
989/* USB Channel 5 Config Registers */
990
991#define USB_DMA5CONTROL 0xffc040a4 /* DMA master channel 5 configuration */
992#define USB_DMA5ADDRLOW 0xffc040a8 /* Lower 16-bits of memory source/destination address for DMA master channel 5 */
993#define USB_DMA5ADDRHIGH 0xffc040ac /* Upper 16-bits of memory source/destination address for DMA master channel 5 */
994#define USB_DMA5COUNTLOW 0xffc040b0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 5 */
995#define USB_DMA5COUNTHIGH 0xffc040b4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 5 */
996
997/* USB Channel 6 Config Registers */
998
999#define USB_DMA6CONTROL 0xffc040c4 /* DMA master channel 6 configuration */
1000#define USB_DMA6ADDRLOW 0xffc040c8 /* Lower 16-bits of memory source/destination address for DMA master channel 6 */
1001#define USB_DMA6ADDRHIGH 0xffc040cc /* Upper 16-bits of memory source/destination address for DMA master channel 6 */
1002#define USB_DMA6COUNTLOW 0xffc040d0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 6 */
1003#define USB_DMA6COUNTHIGH 0xffc040d4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 6 */
1004
1005/* USB Channel 7 Config Registers */
1006
1007#define USB_DMA7CONTROL 0xffc040e4 /* DMA master channel 7 configuration */
1008#define USB_DMA7ADDRLOW 0xffc040e8 /* Lower 16-bits of memory source/destination address for DMA master channel 7 */
1009#define USB_DMA7ADDRHIGH 0xffc040ec /* Upper 16-bits of memory source/destination address for DMA master channel 7 */
1010#define USB_DMA7COUNTLOW 0xffc040f0 /* Lower 16-bits of byte count of DMA transfer for DMA master channel 7 */
1011#define USB_DMA7COUNTHIGH 0xffc040f4 /* Upper 16-bits of byte count of DMA transfer for DMA master channel 7 */
1012
1013/* Keypad Registers */
1014
1015#define KPAD_CTL 0xffc04100 /* Controls keypad module enable and disable */
1016#define KPAD_PRESCALE 0xffc04104 /* Establish a time base for programing the KPAD_MSEL register */
1017#define KPAD_MSEL 0xffc04108 /* Selects delay parameters for keypad interface sensitivity */
1018#define KPAD_ROWCOL 0xffc0410c /* Captures the row and column output values of the keys pressed */
1019#define KPAD_STAT 0xffc04110 /* Holds and clears the status of the keypad interface interrupt */
1020#define KPAD_SOFTEVAL 0xffc04114 /* Lets software force keypad interface to check for keys being pressed */
1021
1022/* Pixel Compositor (PIXC) Registers */
1023
1024#define PIXC_CTL 0xffc04400 /* Overlay enable, resampling mode, I/O data format, transparency enable, watermark level, FIFO status */
1025#define PIXC_PPL 0xffc04404 /* Holds the number of pixels per line of the display */
1026#define PIXC_LPF 0xffc04408 /* Holds the number of lines per frame of the display */
1027#define PIXC_AHSTART 0xffc0440c /* Contains horizontal start pixel information of the overlay data (set A) */
1028#define PIXC_AHEND 0xffc04410 /* Contains horizontal end pixel information of the overlay data (set A) */
1029#define PIXC_AVSTART 0xffc04414 /* Contains vertical start pixel information of the overlay data (set A) */
1030#define PIXC_AVEND 0xffc04418 /* Contains vertical end pixel information of the overlay data (set A) */
1031#define PIXC_ATRANSP 0xffc0441c /* Contains the transparency ratio (set A) */
1032#define PIXC_BHSTART 0xffc04420 /* Contains horizontal start pixel information of the overlay data (set B) */
1033#define PIXC_BHEND 0xffc04424 /* Contains horizontal end pixel information of the overlay data (set B) */
1034#define PIXC_BVSTART 0xffc04428 /* Contains vertical start pixel information of the overlay data (set B) */
1035#define PIXC_BVEND 0xffc0442c /* Contains vertical end pixel information of the overlay data (set B) */
1036#define PIXC_BTRANSP 0xffc04430 /* Contains the transparency ratio (set B) */
1037#define PIXC_INTRSTAT 0xffc0443c /* Overlay interrupt configuration/status */
1038#define PIXC_RYCON 0xffc04440 /* Color space conversion matrix register. Contains the R/Y conversion coefficients */
1039#define PIXC_GUCON 0xffc04444 /* Color space conversion matrix register. Contains the G/U conversion coefficients */
1040#define PIXC_BVCON 0xffc04448 /* Color space conversion matrix register. Contains the B/V conversion coefficients */
1041#define PIXC_CCBIAS 0xffc0444c /* Bias values for the color space conversion matrix */
1042#define PIXC_TC 0xffc04450 /* Holds the transparent color value */
1043
1044/* Handshake MDMA 0 Registers */
1045
1046#define HMDMA0_CONTROL 0xffc04500 /* Handshake MDMA0 Control Register */
1047#define HMDMA0_ECINIT 0xffc04504 /* Handshake MDMA0 Initial Edge Count Register */
1048#define HMDMA0_BCINIT 0xffc04508 /* Handshake MDMA0 Initial Block Count Register */
1049#define HMDMA0_ECURGENT 0xffc0450c /* Handshake MDMA0 Urgent Edge Count Threshhold Register */
1050#define HMDMA0_ECOVERFLOW 0xffc04510 /* Handshake MDMA0 Edge Count Overflow Interrupt Register */
1051#define HMDMA0_ECOUNT 0xffc04514 /* Handshake MDMA0 Current Edge Count Register */
1052#define HMDMA0_BCOUNT 0xffc04518 /* Handshake MDMA0 Current Block Count Register */
1053
1054/* Handshake MDMA 1 Registers */
1055
1056#define HMDMA1_CONTROL 0xffc04540 /* Handshake MDMA1 Control Register */
1057#define HMDMA1_ECINIT 0xffc04544 /* Handshake MDMA1 Initial Edge Count Register */
1058#define HMDMA1_BCINIT 0xffc04548 /* Handshake MDMA1 Initial Block Count Register */
1059#define HMDMA1_ECURGENT 0xffc0454c /* Handshake MDMA1 Urgent Edge Count Threshhold Register */
1060#define HMDMA1_ECOVERFLOW 0xffc04550 /* Handshake MDMA1 Edge Count Overflow Interrupt Register */
1061#define HMDMA1_ECOUNT 0xffc04554 /* Handshake MDMA1 Current Edge Count Register */
1062#define HMDMA1_BCOUNT 0xffc04558 /* Handshake MDMA1 Current Block Count Register */
1063
1064
1065/* ********************************************************** */
1066/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
1067/* and MULTI BIT READ MACROS */
1068/* ********************************************************** */
1069
1070/* Bit masks for PIXC_CTL */
1071
1072#define PIXC_EN 0x1 /* Pixel Compositor Enable */
1073#define nPIXC_EN 0x0
1074#define OVR_A_EN 0x2 /* Overlay A Enable */
1075#define nOVR_A_EN 0x0
1076#define OVR_B_EN 0x4 /* Overlay B Enable */
1077#define nOVR_B_EN 0x0
1078#define IMG_FORM 0x8 /* Image Data Format */
1079#define nIMG_FORM 0x0
1080#define OVR_FORM 0x10 /* Overlay Data Format */
1081#define nOVR_FORM 0x0
1082#define OUT_FORM 0x20 /* Output Data Format */
1083#define nOUT_FORM 0x0
1084#define UDS_MOD 0x40 /* Resampling Mode */
1085#define nUDS_MOD 0x0
1086#define TC_EN 0x80 /* Transparent Color Enable */
1087#define nTC_EN 0x0
1088#define IMG_STAT 0x300 /* Image FIFO Status */
1089#define OVR_STAT 0xc00 /* Overlay FIFO Status */
1090#define WM_LVL 0x3000 /* FIFO Watermark Level */
1091
1092/* Bit masks for PIXC_AHSTART */
1093
1094#define A_HSTART 0xfff /* Horizontal Start Coordinates */
1095
1096/* Bit masks for PIXC_AHEND */
1097
1098#define A_HEND 0xfff /* Horizontal End Coordinates */
1099
1100/* Bit masks for PIXC_AVSTART */
1101
1102#define A_VSTART 0x3ff /* Vertical Start Coordinates */
1103
1104/* Bit masks for PIXC_AVEND */
1105
1106#define A_VEND 0x3ff /* Vertical End Coordinates */
1107
1108/* Bit masks for PIXC_ATRANSP */
1109
1110#define A_TRANSP 0xf /* Transparency Value */
1111
1112/* Bit masks for PIXC_BHSTART */
1113
1114#define B_HSTART 0xfff /* Horizontal Start Coordinates */
1115
1116/* Bit masks for PIXC_BHEND */
1117
1118#define B_HEND 0xfff /* Horizontal End Coordinates */
1119
1120/* Bit masks for PIXC_BVSTART */
1121
1122#define B_VSTART 0x3ff /* Vertical Start Coordinates */
1123
1124/* Bit masks for PIXC_BVEND */
1125
1126#define B_VEND 0x3ff /* Vertical End Coordinates */
1127
1128/* Bit masks for PIXC_BTRANSP */
1129
1130#define B_TRANSP 0xf /* Transparency Value */
1131
1132/* Bit masks for PIXC_INTRSTAT */
1133
1134#define OVR_INT_EN 0x1 /* Interrupt at End of Last Valid Overlay */
1135#define nOVR_INT_EN 0x0
1136#define FRM_INT_EN 0x2 /* Interrupt at End of Frame */
1137#define nFRM_INT_EN 0x0
1138#define OVR_INT_STAT 0x4 /* Overlay Interrupt Status */
1139#define nOVR_INT_STAT 0x0
1140#define FRM_INT_STAT 0x8 /* Frame Interrupt Status */
1141#define nFRM_INT_STAT 0x0
1142
1143/* Bit masks for PIXC_RYCON */
1144
1145#define A11 0x3ff /* A11 in the Coefficient Matrix */
1146#define A12 0xffc00 /* A12 in the Coefficient Matrix */
1147#define A13 0x3ff00000 /* A13 in the Coefficient Matrix */
1148#define RY_MULT4 0x40000000 /* Multiply Row by 4 */
1149#define nRY_MULT4 0x0
1150
1151/* Bit masks for PIXC_GUCON */
1152
1153#define A21 0x3ff /* A21 in the Coefficient Matrix */
1154#define A22 0xffc00 /* A22 in the Coefficient Matrix */
1155#define A23 0x3ff00000 /* A23 in the Coefficient Matrix */
1156#define GU_MULT4 0x40000000 /* Multiply Row by 4 */
1157#define nGU_MULT4 0x0
1158
1159/* Bit masks for PIXC_BVCON */
1160
1161#define A31 0x3ff /* A31 in the Coefficient Matrix */
1162#define A32 0xffc00 /* A32 in the Coefficient Matrix */
1163#define A33 0x3ff00000 /* A33 in the Coefficient Matrix */
1164#define BV_MULT4 0x40000000 /* Multiply Row by 4 */
1165#define nBV_MULT4 0x0
1166
1167/* Bit masks for PIXC_CCBIAS */
1168
1169#define A14 0x3ff /* A14 in the Bias Vector */
1170#define A24 0xffc00 /* A24 in the Bias Vector */
1171#define A34 0x3ff00000 /* A34 in the Bias Vector */
1172
1173/* Bit masks for PIXC_TC */
1174
1175#define RY_TRANS 0xff /* Transparent Color - R/Y Component */
1176#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */
1177#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */
1178
1179/* Bit masks for HOST_CONTROL */
1180
1181#define HOST_EN 0x1 /* Host Enable */
1182#define nHOST_EN 0x0
1183#define HOST_END 0x2 /* Host Endianess */
1184#define nHOST_END 0x0
1185#define DATA_SIZE 0x4 /* Data Size */
1186#define nDATA_SIZE 0x0
1187#define HOST_RST 0x8 /* Host Reset */
1188#define nHOST_RST 0x0
1189#define HRDY_OVR 0x20 /* Host Ready Override */
1190#define nHRDY_OVR 0x0
1191#define INT_MODE 0x40 /* Interrupt Mode */
1192#define nINT_MODE 0x0
1193#define BT_EN 0x80 /* Bus Timeout Enable */
1194#define nBT_EN 0x0
1195#define EHW 0x100 /* Enable Host Write */
1196#define nEHW 0x0
1197#define EHR 0x200 /* Enable Host Read */
1198#define nEHR 0x0
1199#define BDR 0x400 /* Burst DMA Requests */
1200#define nBDR 0x0
1201
1202/* Bit masks for HOST_STATUS */
1203
1204#define READY 0x1 /* DMA Ready */
1205#define nREADY 0x0
1206#define FIFOFULL 0x2 /* FIFO Full */
1207#define nFIFOFULL 0x0
1208#define FIFOEMPTY 0x4 /* FIFO Empty */
1209#define nFIFOEMPTY 0x0
1210#define COMPLETE 0x8 /* DMA Complete */
1211#define nCOMPLETE 0x0
1212#define HSHK 0x10 /* Host Handshake */
1213#define nHSHK 0x0
1214#define TIMEOUT 0x20 /* Host Timeout */
1215#define nTIMEOUT 0x0
1216#define HIRQ 0x40 /* Host Interrupt Request */
1217#define nHIRQ 0x0
1218#define ALLOW_CNFG 0x80 /* Allow New Configuration */
1219#define nALLOW_CNFG 0x0
1220#define DMA_DIR 0x100 /* DMA Direction */
1221#define nDMA_DIR 0x0
1222#define BTE 0x200 /* Bus Timeout Enabled */
1223#define nBTE 0x0
1224
1225/* Bit masks for HOST_TIMEOUT */
1226
1227#define COUNT_TIMEOUT 0x7ff /* Host Timeout count */
1228
1229/* Bit masks for MXVR_CONFIG */
1230
1231#define MXVREN 0x1 /* MXVR Enable */
1232#define nMXVREN 0x0
1233#define MMSM 0x2 /* MXVR Master/Slave Mode Select */
1234#define nMMSM 0x0
1235#define ACTIVE 0x4 /* Active Mode */
1236#define nACTIVE 0x0
1237#define SDELAY 0x8 /* Synchronous Data Delay */
1238#define nSDELAY 0x0
1239#define NCMRXEN 0x10 /* Normal Control Message Receive Enable */
1240#define nNCMRXEN 0x0
1241#define RWRRXEN 0x20 /* Remote Write Receive Enable */
1242#define nRWRRXEN 0x0
1243#define MTXEN 0x40 /* MXVR Transmit Data Enable */
1244#define nMTXEN 0x0
1245#define MTXONB 0x80 /* MXVR Phy Transmitter On */
1246#define nMTXONB 0x0
1247#define EPARITY 0x100 /* Even Parity Select */
1248#define nEPARITY 0x0
1249#define MSB 0x1e00 /* Master Synchronous Boundary */
1250#define APRXEN 0x2000 /* Asynchronous Packet Receive Enable */
1251#define nAPRXEN 0x0
1252#define WAKEUP 0x4000 /* Wake-Up */
1253#define nWAKEUP 0x0
1254#define LMECH 0x8000 /* Lock Mechanism Select */
1255#define nLMECH 0x0
1256
1257/* Bit masks for MXVR_STATE_0 */
1258
1259#define NACT 0x1 /* Network Activity */
1260#define nNACT 0x0
1261#define SBLOCK 0x2 /* Super Block Lock */
1262#define nSBLOCK 0x0
1263#define FMPLLST 0xc /* Frequency Multiply PLL SM State */
1264#define CDRPLLST 0xe0 /* Clock/Data Recovery PLL SM State */
1265#define APBSY 0x100 /* Asynchronous Packet Transmit Buffer Busy */
1266#define nAPBSY 0x0
1267#define APARB 0x200 /* Asynchronous Packet Arbitrating */
1268#define nAPARB 0x0
1269#define APTX 0x400 /* Asynchronous Packet Transmitting */
1270#define nAPTX 0x0
1271#define APRX 0x800 /* Receiving Asynchronous Packet */
1272#define nAPRX 0x0
1273#define CMBSY 0x1000 /* Control Message Transmit Buffer Busy */
1274#define nCMBSY 0x0
1275#define CMARB 0x2000 /* Control Message Arbitrating */
1276#define nCMARB 0x0
1277#define CMTX 0x4000 /* Control Message Transmitting */
1278#define nCMTX 0x0
1279#define CMRX 0x8000 /* Receiving Control Message */
1280#define nCMRX 0x0
1281#define MRXONB 0x10000 /* MRXONB Pin State */
1282#define nMRXONB 0x0
1283#define RGSIP 0x20000 /* Remote Get Source In Progress */
1284#define nRGSIP 0x0
1285#define DALIP 0x40000 /* Resource Deallocate In Progress */
1286#define nDALIP 0x0
1287#define ALIP 0x80000 /* Resource Allocate In Progress */
1288#define nALIP 0x0
1289#define RRDIP 0x100000 /* Remote Read In Progress */
1290#define nRRDIP 0x0
1291#define RWRIP 0x200000 /* Remote Write In Progress */
1292#define nRWRIP 0x0
1293#define FLOCK 0x400000 /* Frame Lock */
1294#define nFLOCK 0x0
1295#define BLOCK 0x800000 /* Block Lock */
1296#define nBLOCK 0x0
1297#define RSB 0xf000000 /* Received Synchronous Boundary */
1298#define DERRNUM 0xf0000000 /* DMA Error Channel Number */
1299
1300/* Bit masks for MXVR_STATE_1 */
1301
1302#define SRXNUMB 0xf /* Synchronous Receive FIFO Number of Bytes */
1303#define STXNUMB 0xf0 /* Synchronous Transmit FIFO Number of Bytes */
1304#define APCONT 0x100 /* Asynchronous Packet Continuation */
1305#define nAPCONT 0x0
1306#define OBERRNUM 0xe00 /* DMA Out of Bounds Error Channel Number */
1307#define DMAACTIVE0 0x10000 /* DMA0 Active */
1308#define nDMAACTIVE0 0x0
1309#define DMAACTIVE1 0x20000 /* DMA1 Active */
1310#define nDMAACTIVE1 0x0
1311#define DMAACTIVE2 0x40000 /* DMA2 Active */
1312#define nDMAACTIVE2 0x0
1313#define DMAACTIVE3 0x80000 /* DMA3 Active */
1314#define nDMAACTIVE3 0x0
1315#define DMAACTIVE4 0x100000 /* DMA4 Active */
1316#define nDMAACTIVE4 0x0
1317#define DMAACTIVE5 0x200000 /* DMA5 Active */
1318#define nDMAACTIVE5 0x0
1319#define DMAACTIVE6 0x400000 /* DMA6 Active */
1320#define nDMAACTIVE6 0x0
1321#define DMAACTIVE7 0x800000 /* DMA7 Active */
1322#define nDMAACTIVE7 0x0
1323#define DMAPMEN0 0x1000000 /* DMA0 Pattern Matching Enabled */
1324#define nDMAPMEN0 0x0
1325#define DMAPMEN1 0x2000000 /* DMA1 Pattern Matching Enabled */
1326#define nDMAPMEN1 0x0
1327#define DMAPMEN2 0x4000000 /* DMA2 Pattern Matching Enabled */
1328#define nDMAPMEN2 0x0
1329#define DMAPMEN3 0x8000000 /* DMA3 Pattern Matching Enabled */
1330#define nDMAPMEN3 0x0
1331#define DMAPMEN4 0x10000000 /* DMA4 Pattern Matching Enabled */
1332#define nDMAPMEN4 0x0
1333#define DMAPMEN5 0x20000000 /* DMA5 Pattern Matching Enabled */
1334#define nDMAPMEN5 0x0
1335#define DMAPMEN6 0x40000000 /* DMA6 Pattern Matching Enabled */
1336#define nDMAPMEN6 0x0
1337#define DMAPMEN7 0x80000000 /* DMA7 Pattern Matching Enabled */
1338#define nDMAPMEN7 0x0
1339
1340/* Bit masks for MXVR_INT_STAT_0 */
1341
1342#define NI2A 0x1 /* Network Inactive to Active */
1343#define nNI2A 0x0
1344#define NA2I 0x2 /* Network Active to Inactive */
1345#define nNA2I 0x0
1346#define SBU2L 0x4 /* Super Block Unlock to Lock */
1347#define nSBU2L 0x0
1348#define SBL2U 0x8 /* Super Block Lock to Unlock */
1349#define nSBL2U 0x0
1350#define PRU 0x10 /* Position Register Updated */
1351#define nPRU 0x0
1352#define MPRU 0x20 /* Maximum Position Register Updated */
1353#define nMPRU 0x0
1354#define DRU 0x40 /* Delay Register Updated */
1355#define nDRU 0x0
1356#define MDRU 0x80 /* Maximum Delay Register Updated */
1357#define nMDRU 0x0
1358#define SBU 0x100 /* Synchronous Boundary Updated */
1359#define nSBU 0x0
1360#define ATU 0x200 /* Allocation Table Updated */
1361#define nATU 0x0
1362#define FCZ0 0x400 /* Frame Counter 0 Zero */
1363#define nFCZ0 0x0
1364#define FCZ1 0x800 /* Frame Counter 1 Zero */
1365#define nFCZ1 0x0
1366#define PERR 0x1000 /* Parity Error */
1367#define nPERR 0x0
1368#define MH2L 0x2000 /* MRXONB High to Low */
1369#define nMH2L 0x0
1370#define ML2H 0x4000 /* MRXONB Low to High */
1371#define nML2H 0x0
1372#define WUP 0x8000 /* Wake-Up Preamble Received */
1373#define nWUP 0x0
1374#define FU2L 0x10000 /* Frame Unlock to Lock */
1375#define nFU2L 0x0
1376#define FL2U 0x20000 /* Frame Lock to Unlock */
1377#define nFL2U 0x0
1378#define BU2L 0x40000 /* Block Unlock to Lock */
1379#define nBU2L 0x0
1380#define BL2U 0x80000 /* Block Lock to Unlock */
1381#define nBL2U 0x0
1382#define OBERR 0x100000 /* DMA Out of Bounds Error */
1383#define nOBERR 0x0
1384#define PFL 0x200000 /* PLL Frequency Locked */
1385#define nPFL 0x0
1386#define SCZ 0x400000 /* System Clock Counter Zero */
1387#define nSCZ 0x0
1388#define FERR 0x800000 /* FIFO Error */
1389#define nFERR 0x0
1390#define CMR 0x1000000 /* Control Message Received */
1391#define nCMR 0x0
1392#define CMROF 0x2000000 /* Control Message Receive Buffer Overflow */
1393#define nCMROF 0x0
1394#define CMTS 0x4000000 /* Control Message Transmit Buffer Successfully Sent */
1395#define nCMTS 0x0
1396#define CMTC 0x8000000 /* Control Message Transmit Buffer Successfully Cancelled */
1397#define nCMTC 0x0
1398#define RWRC 0x10000000 /* Remote Write Control Message Completed */
1399#define nRWRC 0x0
1400#define BCZ 0x20000000 /* Block Counter Zero */
1401#define nBCZ 0x0
1402#define BMERR 0x40000000 /* Biphase Mark Coding Error */
1403#define nBMERR 0x0
1404#define DERR 0x80000000 /* DMA Error */
1405#define nDERR 0x0
1406
1407/* Bit masks for MXVR_INT_STAT_1 */
1408
1409#define HDONE0 0x1 /* DMA0 Half Done */
1410#define nHDONE0 0x0
1411#define DONE0 0x2 /* DMA0 Done */
1412#define nDONE0 0x0
1413#define APR 0x4 /* Asynchronous Packet Received */
1414#define nAPR 0x0
1415#define APROF 0x8 /* Asynchronous Packet Receive Buffer Overflow */
1416#define nAPROF 0x0
1417#define HDONE1 0x10 /* DMA1 Half Done */
1418#define nHDONE1 0x0
1419#define DONE1 0x20 /* DMA1 Done */
1420#define nDONE1 0x0
1421#define APTS 0x40 /* Asynchronous Packet Transmit Buffer Successfully Sent */
1422#define nAPTS 0x0
1423#define APTC 0x80 /* Asynchronous Packet Transmit Buffer Successfully Cancelled */
1424#define nAPTC 0x0
1425#define HDONE2 0x100 /* DMA2 Half Done */
1426#define nHDONE2 0x0
1427#define DONE2 0x200 /* DMA2 Done */
1428#define nDONE2 0x0
1429#define APRCE 0x400 /* Asynchronous Packet Receive CRC Error */
1430#define nAPRCE 0x0
1431#define APRPE 0x800 /* Asynchronous Packet Receive Packet Error */
1432#define nAPRPE 0x0
1433#define HDONE3 0x1000 /* DMA3 Half Done */
1434#define nHDONE3 0x0
1435#define DONE3 0x2000 /* DMA3 Done */
1436#define nDONE3 0x0
1437#define HDONE4 0x10000 /* DMA4 Half Done */
1438#define nHDONE4 0x0
1439#define DONE4 0x20000 /* DMA4 Done */
1440#define nDONE4 0x0
1441#define HDONE5 0x100000 /* DMA5 Half Done */
1442#define nHDONE5 0x0
1443#define DONE5 0x200000 /* DMA5 Done */
1444#define nDONE5 0x0
1445#define HDONE6 0x1000000 /* DMA6 Half Done */
1446#define nHDONE6 0x0
1447#define DONE6 0x2000000 /* DMA6 Done */
1448#define nDONE6 0x0
1449#define HDONE7 0x10000000 /* DMA7 Half Done */
1450#define nHDONE7 0x0
1451#define DONE7 0x20000000 /* DMA7 Done */
1452#define nDONE7 0x0
1453
1454/* Bit masks for MXVR_INT_EN_0 */
1455
1456#define NI2AEN 0x1 /* Network Inactive to Active Interrupt Enable */
1457#define nNI2AEN 0x0
1458#define NA2IEN 0x2 /* Network Active to Inactive Interrupt Enable */
1459#define nNA2IEN 0x0
1460#define SBU2LEN 0x4 /* Super Block Unlock to Lock Interrupt Enable */
1461#define nSBU2LEN 0x0
1462#define SBL2UEN 0x8 /* Super Block Lock to Unlock Interrupt Enable */
1463#define nSBL2UEN 0x0
1464#define PRUEN 0x10 /* Position Register Updated Interrupt Enable */
1465#define nPRUEN 0x0
1466#define MPRUEN 0x20 /* Maximum Position Register Updated Interrupt Enable */
1467#define nMPRUEN 0x0
1468#define DRUEN 0x40 /* Delay Register Updated Interrupt Enable */
1469#define nDRUEN 0x0
1470#define MDRUEN 0x80 /* Maximum Delay Register Updated Interrupt Enable */
1471#define nMDRUEN 0x0
1472#define SBUEN 0x100 /* Synchronous Boundary Updated Interrupt Enable */
1473#define nSBUEN 0x0
1474#define ATUEN 0x200 /* Allocation Table Updated Interrupt Enable */
1475#define nATUEN 0x0
1476#define FCZ0EN 0x400 /* Frame Counter 0 Zero Interrupt Enable */
1477#define nFCZ0EN 0x0
1478#define FCZ1EN 0x800 /* Frame Counter 1 Zero Interrupt Enable */
1479#define nFCZ1EN 0x0
1480#define PERREN 0x1000 /* Parity Error Interrupt Enable */
1481#define nPERREN 0x0
1482#define MH2LEN 0x2000 /* MRXONB High to Low Interrupt Enable */
1483#define nMH2LEN 0x0
1484#define ML2HEN 0x4000 /* MRXONB Low to High Interrupt Enable */
1485#define nML2HEN 0x0
1486#define WUPEN 0x8000 /* Wake-Up Preamble Received Interrupt Enable */
1487#define nWUPEN 0x0
1488#define FU2LEN 0x10000 /* Frame Unlock to Lock Interrupt Enable */
1489#define nFU2LEN 0x0
1490#define FL2UEN 0x20000 /* Frame Lock to Unlock Interrupt Enable */
1491#define nFL2UEN 0x0
1492#define BU2LEN 0x40000 /* Block Unlock to Lock Interrupt Enable */
1493#define nBU2LEN 0x0
1494#define BL2UEN 0x80000 /* Block Lock to Unlock Interrupt Enable */
1495#define nBL2UEN 0x0
1496#define OBERREN 0x100000 /* DMA Out of Bounds Error Interrupt Enable */
1497#define nOBERREN 0x0
1498#define PFLEN 0x200000 /* PLL Frequency Locked Interrupt Enable */
1499#define nPFLEN 0x0
1500#define SCZEN 0x400000 /* System Clock Counter Zero Interrupt Enable */
1501#define nSCZEN 0x0
1502#define FERREN 0x800000 /* FIFO Error Interrupt Enable */
1503#define nFERREN 0x0
1504#define CMREN 0x1000000 /* Control Message Received Interrupt Enable */
1505#define nCMREN 0x0
1506#define CMROFEN 0x2000000 /* Control Message Receive Buffer Overflow Interrupt Enable */
1507#define nCMROFEN 0x0
1508#define CMTSEN 0x4000000 /* Control Message Transmit Buffer Successfully Sent Interrupt Enable */
1509#define nCMTSEN 0x0
1510#define CMTCEN 0x8000000 /* Control Message Transmit Buffer Successfully Cancelled Interrupt Enable */
1511#define nCMTCEN 0x0
1512#define RWRCEN 0x10000000 /* Remote Write Control Message Completed Interrupt Enable */
1513#define nRWRCEN 0x0
1514#define BCZEN 0x20000000 /* Block Counter Zero Interrupt Enable */
1515#define nBCZEN 0x0
1516#define BMERREN 0x40000000 /* Biphase Mark Coding Error Interrupt Enable */
1517#define nBMERREN 0x0
1518#define DERREN 0x80000000 /* DMA Error Interrupt Enable */
1519#define nDERREN 0x0
1520
1521/* Bit masks for MXVR_INT_EN_1 */
1522
1523#define HDONEEN0 0x1 /* DMA0 Half Done Interrupt Enable */
1524#define nHDONEEN0 0x0
1525#define DONEEN0 0x2 /* DMA0 Done Interrupt Enable */
1526#define nDONEEN0 0x0
1527#define APREN 0x4 /* Asynchronous Packet Received Interrupt Enable */
1528#define nAPREN 0x0
1529#define APROFEN 0x8 /* Asynchronous Packet Receive Buffer Overflow Interrupt Enable */
1530#define nAPROFEN 0x0
1531#define HDONEEN1 0x10 /* DMA1 Half Done Interrupt Enable */
1532#define nHDONEEN1 0x0
1533#define DONEEN1 0x20 /* DMA1 Done Interrupt Enable */
1534#define nDONEEN1 0x0
1535#define APTSEN 0x40 /* Asynchronous Packet Transmit Buffer Successfully Sent Interrupt Enable */
1536#define nAPTSEN 0x0
1537#define APTCEN 0x80 /* Asynchronous Packet Transmit Buffer Successfully Cancelled Interrupt Enable */
1538#define nAPTCEN 0x0
1539#define HDONEEN2 0x100 /* DMA2 Half Done Interrupt Enable */
1540#define nHDONEEN2 0x0
1541#define DONEEN2 0x200 /* DMA2 Done Interrupt Enable */
1542#define nDONEEN2 0x0
1543#define APRCEEN 0x400 /* Asynchronous Packet Receive CRC Error Interrupt Enable */
1544#define nAPRCEEN 0x0
1545#define APRPEEN 0x800 /* Asynchronous Packet Receive Packet Error Interrupt Enable */
1546#define nAPRPEEN 0x0
1547#define HDONEEN3 0x1000 /* DMA3 Half Done Interrupt Enable */
1548#define nHDONEEN3 0x0
1549#define DONEEN3 0x2000 /* DMA3 Done Interrupt Enable */
1550#define nDONEEN3 0x0
1551#define HDONEEN4 0x10000 /* DMA4 Half Done Interrupt Enable */
1552#define nHDONEEN4 0x0
1553#define DONEEN4 0x20000 /* DMA4 Done Interrupt Enable */
1554#define nDONEEN4 0x0
1555#define HDONEEN5 0x100000 /* DMA5 Half Done Interrupt Enable */
1556#define nHDONEEN5 0x0
1557#define DONEEN5 0x200000 /* DMA5 Done Interrupt Enable */
1558#define nDONEEN5 0x0
1559#define HDONEEN6 0x1000000 /* DMA6 Half Done Interrupt Enable */
1560#define nHDONEEN6 0x0
1561#define DONEEN6 0x2000000 /* DMA6 Done Interrupt Enable */
1562#define nDONEEN6 0x0
1563#define HDONEEN7 0x10000000 /* DMA7 Half Done Interrupt Enable */
1564#define nHDONEEN7 0x0
1565#define DONEEN7 0x20000000 /* DMA7 Done Interrupt Enable */
1566#define nDONEEN7 0x0
1567
1568/* Bit masks for MXVR_POSITION */
1569
1570#define POSITION 0x3f /* Node Position */
1571#define PVALID 0x8000 /* Node Position Valid */
1572#define nPVALID 0x0
1573
1574/* Bit masks for MXVR_MAX_POSITION */
1575
1576#define MPOSITION 0x3f /* Maximum Node Position */
1577#define MPVALID 0x8000 /* Maximum Node Position Valid */
1578#define nMPVALID 0x0
1579
1580/* Bit masks for MXVR_DELAY */
1581
1582#define DELAY 0x3f /* Node Frame Delay */
1583#define DVALID 0x8000 /* Node Frame Delay Valid */
1584#define nDVALID 0x0
1585
1586/* Bit masks for MXVR_MAX_DELAY */
1587
1588#define MDELAY 0x3f /* Maximum Node Frame Delay */
1589#define MDVALID 0x8000 /* Maximum Node Frame Delay Valid */
1590#define nMDVALID 0x0
1591
1592/* Bit masks for MXVR_LADDR */
1593
1594#define LADDR 0xffff /* Logical Address */
1595#define LVALID 0x80000000 /* Logical Address Valid */
1596#define nLVALID 0x0
1597
1598/* Bit masks for MXVR_GADDR */
1599
1600#define GADDRL 0xff /* Group Address Lower Byte */
1601#define GVALID 0x8000 /* Group Address Valid */
1602#define nGVALID 0x0
1603
1604/* Bit masks for MXVR_AADDR */
1605
1606#define AADDR 0xffff /* Alternate Address */
1607#define AVALID 0x80000000 /* Alternate Address Valid */
1608#define nAVALID 0x0
1609
1610/* Bit masks for MXVR_ALLOC_0 */
1611
1612#define CL0 0x7f /* Channel 0 Connection Label */
1613#define CIU0 0x80 /* Channel 0 In Use */
1614#define nCIU0 0x0
1615#define CL1 0x7f00 /* Channel 0 Connection Label */
1616#define CIU1 0x8000 /* Channel 0 In Use */
1617#define nCIU1 0x0
1618#define CL2 0x7f0000 /* Channel 0 Connection Label */
1619#define CIU2 0x800000 /* Channel 0 In Use */
1620#define nCIU2 0x0
1621#define CL3 0x7f000000 /* Channel 0 Connection Label */
1622#define CIU3 0x80000000 /* Channel 0 In Use */
1623#define nCIU3 0x0
1624
1625/* Bit masks for MXVR_ALLOC_1 */
1626
1627#define CL4 0x7f /* Channel 4 Connection Label */
1628#define CIU4 0x80 /* Channel 4 In Use */
1629#define nCIU4 0x0
1630#define CL5 0x7f00 /* Channel 5 Connection Label */
1631#define CIU5 0x8000 /* Channel 5 In Use */
1632#define nCIU5 0x0
1633#define CL6 0x7f0000 /* Channel 6 Connection Label */
1634#define CIU6 0x800000 /* Channel 6 In Use */
1635#define nCIU6 0x0
1636#define CL7 0x7f000000 /* Channel 7 Connection Label */
1637#define CIU7 0x80000000 /* Channel 7 In Use */
1638#define nCIU7 0x0
1639
1640/* Bit masks for MXVR_ALLOC_2 */
1641
1642#define CL8 0x7f /* Channel 8 Connection Label */
1643#define CIU8 0x80 /* Channel 8 In Use */
1644#define nCIU8 0x0
1645#define CL9 0x7f00 /* Channel 9 Connection Label */
1646#define CIU9 0x8000 /* Channel 9 In Use */
1647#define nCIU9 0x0
1648#define CL10 0x7f0000 /* Channel 10 Connection Label */
1649#define CIU10 0x800000 /* Channel 10 In Use */
1650#define nCIU10 0x0
1651#define CL11 0x7f000000 /* Channel 11 Connection Label */
1652#define CIU11 0x80000000 /* Channel 11 In Use */
1653#define nCIU11 0x0
1654
1655/* Bit masks for MXVR_ALLOC_3 */
1656
1657#define CL12 0x7f /* Channel 12 Connection Label */
1658#define CIU12 0x80 /* Channel 12 In Use */
1659#define nCIU12 0x0
1660#define CL13 0x7f00 /* Channel 13 Connection Label */
1661#define CIU13 0x8000 /* Channel 13 In Use */
1662#define nCIU13 0x0
1663#define CL14 0x7f0000 /* Channel 14 Connection Label */
1664#define CIU14 0x800000 /* Channel 14 In Use */
1665#define nCIU14 0x0
1666#define CL15 0x7f000000 /* Channel 15 Connection Label */
1667#define CIU15 0x80000000 /* Channel 15 In Use */
1668#define nCIU15 0x0
1669
1670/* Bit masks for MXVR_ALLOC_4 */
1671
1672#define CL16 0x7f /* Channel 16 Connection Label */
1673#define CIU16 0x80 /* Channel 16 In Use */
1674#define nCIU16 0x0
1675#define CL17 0x7f00 /* Channel 17 Connection Label */
1676#define CIU17 0x8000 /* Channel 17 In Use */
1677#define nCIU17 0x0
1678#define CL18 0x7f0000 /* Channel 18 Connection Label */
1679#define CIU18 0x800000 /* Channel 18 In Use */
1680#define nCIU18 0x0
1681#define CL19 0x7f000000 /* Channel 19 Connection Label */
1682#define CIU19 0x80000000 /* Channel 19 In Use */
1683#define nCIU19 0x0
1684
1685/* Bit masks for MXVR_ALLOC_5 */
1686
1687#define CL20 0x7f /* Channel 20 Connection Label */
1688#define CIU20 0x80 /* Channel 20 In Use */
1689#define nCIU20 0x0
1690#define CL21 0x7f00 /* Channel 21 Connection Label */
1691#define CIU21 0x8000 /* Channel 21 In Use */
1692#define nCIU21 0x0
1693#define CL22 0x7f0000 /* Channel 22 Connection Label */
1694#define CIU22 0x800000 /* Channel 22 In Use */
1695#define nCIU22 0x0
1696#define CL23 0x7f000000 /* Channel 23 Connection Label */
1697#define CIU23 0x80000000 /* Channel 23 In Use */
1698#define nCIU23 0x0
1699
1700/* Bit masks for MXVR_ALLOC_6 */
1701
1702#define CL24 0x7f /* Channel 24 Connection Label */
1703#define CIU24 0x80 /* Channel 24 In Use */
1704#define nCIU24 0x0
1705#define CL25 0x7f00 /* Channel 25 Connection Label */
1706#define CIU25 0x8000 /* Channel 25 In Use */
1707#define nCIU25 0x0
1708#define CL26 0x7f0000 /* Channel 26 Connection Label */
1709#define CIU26 0x800000 /* Channel 26 In Use */
1710#define nCIU26 0x0
1711#define CL27 0x7f000000 /* Channel 27 Connection Label */
1712#define CIU27 0x80000000 /* Channel 27 In Use */
1713#define nCIU27 0x0
1714
1715/* Bit masks for MXVR_ALLOC_7 */
1716
1717#define CL28 0x7f /* Channel 28 Connection Label */
1718#define CIU28 0x80 /* Channel 28 In Use */
1719#define nCIU28 0x0
1720#define CL29 0x7f00 /* Channel 29 Connection Label */
1721#define CIU29 0x8000 /* Channel 29 In Use */
1722#define nCIU29 0x0
1723#define CL30 0x7f0000 /* Channel 30 Connection Label */
1724#define CIU30 0x800000 /* Channel 30 In Use */
1725#define nCIU30 0x0
1726#define CL31 0x7f000000 /* Channel 31 Connection Label */
1727#define CIU31 0x80000000 /* Channel 31 In Use */
1728#define nCIU31 0x0
1729
1730/* Bit masks for MXVR_ALLOC_8 */
1731
1732#define CL32 0x7f /* Channel 32 Connection Label */
1733#define CIU32 0x80 /* Channel 32 In Use */
1734#define nCIU32 0x0
1735#define CL33 0x7f00 /* Channel 33 Connection Label */
1736#define CIU33 0x8000 /* Channel 33 In Use */
1737#define nCIU33 0x0
1738#define CL34 0x7f0000 /* Channel 34 Connection Label */
1739#define CIU34 0x800000 /* Channel 34 In Use */
1740#define nCIU34 0x0
1741#define CL35 0x7f000000 /* Channel 35 Connection Label */
1742#define CIU35 0x80000000 /* Channel 35 In Use */
1743#define nCIU35 0x0
1744
1745/* Bit masks for MXVR_ALLOC_9 */
1746
1747#define CL36 0x7f /* Channel 36 Connection Label */
1748#define CIU36 0x80 /* Channel 36 In Use */
1749#define nCIU36 0x0
1750#define CL37 0x7f00 /* Channel 37 Connection Label */
1751#define CIU37 0x8000 /* Channel 37 In Use */
1752#define nCIU37 0x0
1753#define CL38 0x7f0000 /* Channel 38 Connection Label */
1754#define CIU38 0x800000 /* Channel 38 In Use */
1755#define nCIU38 0x0
1756#define CL39 0x7f000000 /* Channel 39 Connection Label */
1757#define CIU39 0x80000000 /* Channel 39 In Use */
1758#define nCIU39 0x0
1759
1760/* Bit masks for MXVR_ALLOC_10 */
1761
1762#define CL40 0x7f /* Channel 40 Connection Label */
1763#define CIU40 0x80 /* Channel 40 In Use */
1764#define nCIU40 0x0
1765#define CL41 0x7f00 /* Channel 41 Connection Label */
1766#define CIU41 0x8000 /* Channel 41 In Use */
1767#define nCIU41 0x0
1768#define CL42 0x7f0000 /* Channel 42 Connection Label */
1769#define CIU42 0x800000 /* Channel 42 In Use */
1770#define nCIU42 0x0
1771#define CL43 0x7f000000 /* Channel 43 Connection Label */
1772#define CIU43 0x80000000 /* Channel 43 In Use */
1773#define nCIU43 0x0
1774
1775/* Bit masks for MXVR_ALLOC_11 */
1776
1777#define CL44 0x7f /* Channel 44 Connection Label */
1778#define CIU44 0x80 /* Channel 44 In Use */
1779#define nCIU44 0x0
1780#define CL45 0x7f00 /* Channel 45 Connection Label */
1781#define CIU45 0x8000 /* Channel 45 In Use */
1782#define nCIU45 0x0
1783#define CL46 0x7f0000 /* Channel 46 Connection Label */
1784#define CIU46 0x800000 /* Channel 46 In Use */
1785#define nCIU46 0x0
1786#define CL47 0x7f000000 /* Channel 47 Connection Label */
1787#define CIU47 0x80000000 /* Channel 47 In Use */
1788#define nCIU47 0x0
1789
1790/* Bit masks for MXVR_ALLOC_12 */
1791
1792#define CL48 0x7f /* Channel 48 Connection Label */
1793#define CIU48 0x80 /* Channel 48 In Use */
1794#define nCIU48 0x0
1795#define CL49 0x7f00 /* Channel 49 Connection Label */
1796#define CIU49 0x8000 /* Channel 49 In Use */
1797#define nCIU49 0x0
1798#define CL50 0x7f0000 /* Channel 50 Connection Label */
1799#define CIU50 0x800000 /* Channel 50 In Use */
1800#define nCIU50 0x0
1801#define CL51 0x7f000000 /* Channel 51 Connection Label */
1802#define CIU51 0x80000000 /* Channel 51 In Use */
1803#define nCIU51 0x0
1804
1805/* Bit masks for MXVR_ALLOC_13 */
1806
1807#define CL52 0x7f /* Channel 52 Connection Label */
1808#define CIU52 0x80 /* Channel 52 In Use */
1809#define nCIU52 0x0
1810#define CL53 0x7f00 /* Channel 53 Connection Label */
1811#define CIU53 0x8000 /* Channel 53 In Use */
1812#define nCIU53 0x0
1813#define CL54 0x7f0000 /* Channel 54 Connection Label */
1814#define CIU54 0x800000 /* Channel 54 In Use */
1815#define nCIU54 0x0
1816#define CL55 0x7f000000 /* Channel 55 Connection Label */
1817#define CIU55 0x80000000 /* Channel 55 In Use */
1818#define nCIU55 0x0
1819
1820/* Bit masks for MXVR_ALLOC_14 */
1821
1822#define CL56 0x7f /* Channel 56 Connection Label */
1823#define CIU56 0x80 /* Channel 56 In Use */
1824#define nCIU56 0x0
1825#define CL57 0x7f00 /* Channel 57 Connection Label */
1826#define CIU57 0x8000 /* Channel 57 In Use */
1827#define nCIU57 0x0
1828#define CL58 0x7f0000 /* Channel 58 Connection Label */
1829#define CIU58 0x800000 /* Channel 58 In Use */
1830#define nCIU58 0x0
1831#define CL59 0x7f000000 /* Channel 59 Connection Label */
1832#define CIU59 0x80000000 /* Channel 59 In Use */
1833#define nCIU59 0x0
1834
1835/* MXVR_SYNC_LCHAN_0 Masks */
1836
1837#define LCHANPC0 0x0000000Flu
1838#define LCHANPC1 0x000000F0lu
1839#define LCHANPC2 0x00000F00lu
1840#define LCHANPC3 0x0000F000lu
1841#define LCHANPC4 0x000F0000lu
1842#define LCHANPC5 0x00F00000lu
1843#define LCHANPC6 0x0F000000lu
1844#define LCHANPC7 0xF0000000lu
1845
1846
1847/* MXVR_SYNC_LCHAN_1 Masks */
1848
1849#define LCHANPC8 0x0000000Flu
1850#define LCHANPC9 0x000000F0lu
1851#define LCHANPC10 0x00000F00lu
1852#define LCHANPC11 0x0000F000lu
1853#define LCHANPC12 0x000F0000lu
1854#define LCHANPC13 0x00F00000lu
1855#define LCHANPC14 0x0F000000lu
1856#define LCHANPC15 0xF0000000lu
1857
1858
1859/* MXVR_SYNC_LCHAN_2 Masks */
1860
1861#define LCHANPC16 0x0000000Flu
1862#define LCHANPC17 0x000000F0lu
1863#define LCHANPC18 0x00000F00lu
1864#define LCHANPC19 0x0000F000lu
1865#define LCHANPC20 0x000F0000lu
1866#define LCHANPC21 0x00F00000lu
1867#define LCHANPC22 0x0F000000lu
1868#define LCHANPC23 0xF0000000lu
1869
1870
1871/* MXVR_SYNC_LCHAN_3 Masks */
1872
1873#define LCHANPC24 0x0000000Flu
1874#define LCHANPC25 0x000000F0lu
1875#define LCHANPC26 0x00000F00lu
1876#define LCHANPC27 0x0000F000lu
1877#define LCHANPC28 0x000F0000lu
1878#define LCHANPC29 0x00F00000lu
1879#define LCHANPC30 0x0F000000lu
1880#define LCHANPC31 0xF0000000lu
1881
1882
1883/* MXVR_SYNC_LCHAN_4 Masks */
1884
1885#define LCHANPC32 0x0000000Flu
1886#define LCHANPC33 0x000000F0lu
1887#define LCHANPC34 0x00000F00lu
1888#define LCHANPC35 0x0000F000lu
1889#define LCHANPC36 0x000F0000lu
1890#define LCHANPC37 0x00F00000lu
1891#define LCHANPC38 0x0F000000lu
1892#define LCHANPC39 0xF0000000lu
1893
1894
1895/* MXVR_SYNC_LCHAN_5 Masks */
1896
1897#define LCHANPC40 0x0000000Flu
1898#define LCHANPC41 0x000000F0lu
1899#define LCHANPC42 0x00000F00lu
1900#define LCHANPC43 0x0000F000lu
1901#define LCHANPC44 0x000F0000lu
1902#define LCHANPC45 0x00F00000lu
1903#define LCHANPC46 0x0F000000lu
1904#define LCHANPC47 0xF0000000lu
1905
1906
1907/* MXVR_SYNC_LCHAN_6 Masks */
1908
1909#define LCHANPC48 0x0000000Flu
1910#define LCHANPC49 0x000000F0lu
1911#define LCHANPC50 0x00000F00lu
1912#define LCHANPC51 0x0000F000lu
1913#define LCHANPC52 0x000F0000lu
1914#define LCHANPC53 0x00F00000lu
1915#define LCHANPC54 0x0F000000lu
1916#define LCHANPC55 0xF0000000lu
1917
1918
1919/* MXVR_SYNC_LCHAN_7 Masks */
1920
1921#define LCHANPC56 0x0000000Flu
1922#define LCHANPC57 0x000000F0lu
1923#define LCHANPC58 0x00000F00lu
1924#define LCHANPC59 0x0000F000lu
1925
1926/* Bit masks for MXVR_DMAx_CONFIG */
1927
1928#define MDMAEN 0x1 /* DMA Channel Enable */
1929#define nMDMAEN 0x0
1930#define DD 0x2 /* DMA Channel Direction */
1931#define nDD 0x0
1932#define BY4SWAPEN 0x20 /* DMA Channel Four Byte Swap Enable */
1933#define nBY4SWAPEN 0x0
1934#define LCHAN 0x3c0 /* DMA Channel Logical Channel */
1935#define BITSWAPEN 0x400 /* DMA Channel Bit Swap Enable */
1936#define nBITSWAPEN 0x0
1937#define BY2SWAPEN 0x800 /* DMA Channel Two Byte Swap Enable */
1938#define nBY2SWAPEN 0x0
1939#define MFLOW 0x7000 /* DMA Channel Operation Flow */
1940#define FIXEDPM 0x80000 /* DMA Channel Fixed Pattern Matching Select */
1941#define nFIXEDPM 0x0
1942#define STARTPAT 0x300000 /* DMA Channel Start Pattern Select */
1943#define STOPPAT 0xc00000 /* DMA Channel Stop Pattern Select */
1944#define COUNTPOS 0x1c000000 /* DMA Channel Count Position */
1945
1946/* Bit masks for MXVR_AP_CTL */
1947
1948#define STARTAP 0x1 /* Start Asynchronous Packet Transmission */
1949#define nSTARTAP 0x0
1950#define CANCELAP 0x2 /* Cancel Asynchronous Packet Transmission */
1951#define nCANCELAP 0x0
1952#define RESETAP 0x4 /* Reset Asynchronous Packet Arbitration */
1953#define nRESETAP 0x0
1954#define APRBE0 0x4000 /* Asynchronous Packet Receive Buffer Entry 0 */
1955#define nAPRBE0 0x0
1956#define APRBE1 0x8000 /* Asynchronous Packet Receive Buffer Entry 1 */
1957#define nAPRBE1 0x0
1958
1959/* Bit masks for MXVR_APRB_START_ADDR */
1960
1961#define MXVR_APRB_START_ADDR 0x1fffffe /* Asynchronous Packet Receive Buffer Start Address */
1962
1963/* Bit masks for MXVR_APRB_CURR_ADDR */
1964
1965#define MXVR_APRB_CURR_ADDR 0xffffffff /* Asynchronous Packet Receive Buffer Current Address */
1966
1967/* Bit masks for MXVR_APTB_START_ADDR */
1968
1969#define MXVR_APTB_START_ADDR 0x1fffffe /* Asynchronous Packet Transmit Buffer Start Address */
1970
1971/* Bit masks for MXVR_APTB_CURR_ADDR */
1972
1973#define MXVR_APTB_CURR_ADDR 0xffffffff /* Asynchronous Packet Transmit Buffer Current Address */
1974
1975/* Bit masks for MXVR_CM_CTL */
1976
1977#define STARTCM 0x1 /* Start Control Message Transmission */
1978#define nSTARTCM 0x0
1979#define CANCELCM 0x2 /* Cancel Control Message Transmission */
1980#define nCANCELCM 0x0
1981#define CMRBE0 0x10000 /* Control Message Receive Buffer Entry 0 */
1982#define nCMRBE0 0x0
1983#define CMRBE1 0x20000 /* Control Message Receive Buffer Entry 1 */
1984#define nCMRBE1 0x0
1985#define CMRBE2 0x40000 /* Control Message Receive Buffer Entry 2 */
1986#define nCMRBE2 0x0
1987#define CMRBE3 0x80000 /* Control Message Receive Buffer Entry 3 */
1988#define nCMRBE3 0x0
1989#define CMRBE4 0x100000 /* Control Message Receive Buffer Entry 4 */
1990#define nCMRBE4 0x0
1991#define CMRBE5 0x200000 /* Control Message Receive Buffer Entry 5 */
1992#define nCMRBE5 0x0
1993#define CMRBE6 0x400000 /* Control Message Receive Buffer Entry 6 */
1994#define nCMRBE6 0x0
1995#define CMRBE7 0x800000 /* Control Message Receive Buffer Entry 7 */
1996#define nCMRBE7 0x0
1997#define CMRBE8 0x1000000 /* Control Message Receive Buffer Entry 8 */
1998#define nCMRBE8 0x0
1999#define CMRBE9 0x2000000 /* Control Message Receive Buffer Entry 9 */
2000#define nCMRBE9 0x0
2001#define CMRBE10 0x4000000 /* Control Message Receive Buffer Entry 10 */
2002#define nCMRBE10 0x0
2003#define CMRBE11 0x8000000 /* Control Message Receive Buffer Entry 11 */
2004#define nCMRBE11 0x0
2005#define CMRBE12 0x10000000 /* Control Message Receive Buffer Entry 12 */
2006#define nCMRBE12 0x0
2007#define CMRBE13 0x20000000 /* Control Message Receive Buffer Entry 13 */
2008#define nCMRBE13 0x0
2009#define CMRBE14 0x40000000 /* Control Message Receive Buffer Entry 14 */
2010#define nCMRBE14 0x0
2011#define CMRBE15 0x80000000 /* Control Message Receive Buffer Entry 15 */
2012#define nCMRBE15 0x0
2013
2014/* Bit masks for MXVR_CMRB_START_ADDR */
2015
2016#define MXVR_CMRB_START_ADDR 0x1fffffe /* Control Message Receive Buffer Start Address */
2017
2018/* Bit masks for MXVR_CMRB_CURR_ADDR */
2019
2020#define MXVR_CMRB_CURR_ADDR 0xffffffff /* Control Message Receive Buffer Current Address */
2021
2022/* Bit masks for MXVR_CMTB_START_ADDR */
2023
2024#define MXVR_CMTB_START_ADDR 0x1fffffe /* Control Message Transmit Buffer Start Address */
2025
2026/* Bit masks for MXVR_CMTB_CURR_ADDR */
2027
2028#define MXVR_CMTB_CURR_ADDR 0xffffffff /* Control Message Transmit Buffer Current Address */
2029
2030/* Bit masks for MXVR_RRDB_START_ADDR */
2031
2032#define MXVR_RRDB_START_ADDR 0x1fffffe /* Remote Read Buffer Start Address */
2033
2034/* Bit masks for MXVR_RRDB_CURR_ADDR */
2035
2036#define MXVR_RRDB_CURR_ADDR 0xffffffff /* Remote Read Buffer Current Address */
2037
2038/* Bit masks for MXVR_PAT_DATAx */
2039
2040#define MATCH_DATA_0 0xff /* Pattern Match Data Byte 0 */
2041#define MATCH_DATA_1 0xff00 /* Pattern Match Data Byte 1 */
2042#define MATCH_DATA_2 0xff0000 /* Pattern Match Data Byte 2 */
2043#define MATCH_DATA_3 0xff000000 /* Pattern Match Data Byte 3 */
2044
2045/* Bit masks for MXVR_PAT_EN_0 */
2046
2047#define MATCH_EN_0_0 0x1 /* Pattern Match Enable Byte 0 Bit 0 */
2048#define nMATCH_EN_0_0 0x0
2049#define MATCH_EN_0_1 0x2 /* Pattern Match Enable Byte 0 Bit 1 */
2050#define nMATCH_EN_0_1 0x0
2051#define MATCH_EN_0_2 0x4 /* Pattern Match Enable Byte 0 Bit 2 */
2052#define nMATCH_EN_0_2 0x0
2053#define MATCH_EN_0_3 0x8 /* Pattern Match Enable Byte 0 Bit 3 */
2054#define nMATCH_EN_0_3 0x0
2055#define MATCH_EN_0_4 0x10 /* Pattern Match Enable Byte 0 Bit 4 */
2056#define nMATCH_EN_0_4 0x0
2057#define MATCH_EN_0_5 0x20 /* Pattern Match Enable Byte 0 Bit 5 */
2058#define nMATCH_EN_0_5 0x0
2059#define MATCH_EN_0_6 0x40 /* Pattern Match Enable Byte 0 Bit 6 */
2060#define nMATCH_EN_0_6 0x0
2061#define MATCH_EN_0_7 0x80 /* Pattern Match Enable Byte 0 Bit 7 */
2062#define nMATCH_EN_0_7 0x0
2063#define MATCH_EN_1_0 0x100 /* Pattern Match Enable Byte 1 Bit 0 */
2064#define nMATCH_EN_1_0 0x0
2065#define MATCH_EN_1_1 0x200 /* Pattern Match Enable Byte 1 Bit 1 */
2066#define nMATCH_EN_1_1 0x0
2067#define MATCH_EN_1_2 0x400 /* Pattern Match Enable Byte 1 Bit 2 */
2068#define nMATCH_EN_1_2 0x0
2069#define MATCH_EN_1_3 0x800 /* Pattern Match Enable Byte 1 Bit 3 */
2070#define nMATCH_EN_1_3 0x0
2071#define MATCH_EN_1_4 0x1000 /* Pattern Match Enable Byte 1 Bit 4 */
2072#define nMATCH_EN_1_4 0x0
2073#define MATCH_EN_1_5 0x2000 /* Pattern Match Enable Byte 1 Bit 5 */
2074#define nMATCH_EN_1_5 0x0
2075#define MATCH_EN_1_6 0x4000 /* Pattern Match Enable Byte 1 Bit 6 */
2076#define nMATCH_EN_1_6 0x0
2077#define MATCH_EN_1_7 0x8000 /* Pattern Match Enable Byte 1 Bit 7 */
2078#define nMATCH_EN_1_7 0x0
2079#define MATCH_EN_2_0 0x10000 /* Pattern Match Enable Byte 2 Bit 0 */
2080#define nMATCH_EN_2_0 0x0
2081#define MATCH_EN_2_1 0x20000 /* Pattern Match Enable Byte 2 Bit 1 */
2082#define nMATCH_EN_2_1 0x0
2083#define MATCH_EN_2_2 0x40000 /* Pattern Match Enable Byte 2 Bit 2 */
2084#define nMATCH_EN_2_2 0x0
2085#define MATCH_EN_2_3 0x80000 /* Pattern Match Enable Byte 2 Bit 3 */
2086#define nMATCH_EN_2_3 0x0
2087#define MATCH_EN_2_4 0x100000 /* Pattern Match Enable Byte 2 Bit 4 */
2088#define nMATCH_EN_2_4 0x0
2089#define MATCH_EN_2_5 0x200000 /* Pattern Match Enable Byte 2 Bit 5 */
2090#define nMATCH_EN_2_5 0x0
2091#define MATCH_EN_2_6 0x400000 /* Pattern Match Enable Byte 2 Bit 6 */
2092#define nMATCH_EN_2_6 0x0
2093#define MATCH_EN_2_7 0x800000 /* Pattern Match Enable Byte 2 Bit 7 */
2094#define nMATCH_EN_2_7 0x0
2095#define MATCH_EN_3_0 0x1000000 /* Pattern Match Enable Byte 3 Bit 0 */
2096#define nMATCH_EN_3_0 0x0
2097#define MATCH_EN_3_1 0x2000000 /* Pattern Match Enable Byte 3 Bit 1 */
2098#define nMATCH_EN_3_1 0x0
2099#define MATCH_EN_3_2 0x4000000 /* Pattern Match Enable Byte 3 Bit 2 */
2100#define nMATCH_EN_3_2 0x0
2101#define MATCH_EN_3_3 0x8000000 /* Pattern Match Enable Byte 3 Bit 3 */
2102#define nMATCH_EN_3_3 0x0
2103#define MATCH_EN_3_4 0x10000000 /* Pattern Match Enable Byte 3 Bit 4 */
2104#define nMATCH_EN_3_4 0x0
2105#define MATCH_EN_3_5 0x20000000 /* Pattern Match Enable Byte 3 Bit 5 */
2106#define nMATCH_EN_3_5 0x0
2107#define MATCH_EN_3_6 0x40000000 /* Pattern Match Enable Byte 3 Bit 6 */
2108#define nMATCH_EN_3_6 0x0
2109#define MATCH_EN_3_7 0x80000000 /* Pattern Match Enable Byte 3 Bit 7 */
2110#define nMATCH_EN_3_7 0x0
2111
2112/* Bit masks for MXVR_PAT_EN_1 */
2113
2114#define MATCH_EN_0_0 0x1 /* Pattern Match Enable Byte 0 Bit 0 */
2115#define nMATCH_EN_0_0 0x0
2116#define MATCH_EN_0_1 0x2 /* Pattern Match Enable Byte 0 Bit 1 */
2117#define nMATCH_EN_0_1 0x0
2118#define MATCH_EN_0_2 0x4 /* Pattern Match Enable Byte 0 Bit 2 */
2119#define nMATCH_EN_0_2 0x0
2120#define MATCH_EN_0_3 0x8 /* Pattern Match Enable Byte 0 Bit 3 */
2121#define nMATCH_EN_0_3 0x0
2122#define MATCH_EN_0_4 0x10 /* Pattern Match Enable Byte 0 Bit 4 */
2123#define nMATCH_EN_0_4 0x0
2124#define MATCH_EN_0_5 0x20 /* Pattern Match Enable Byte 0 Bit 5 */
2125#define nMATCH_EN_0_5 0x0
2126#define MATCH_EN_0_6 0x40 /* Pattern Match Enable Byte 0 Bit 6 */
2127#define nMATCH_EN_0_6 0x0
2128#define MATCH_EN_0_7 0x80 /* Pattern Match Enable Byte 0 Bit 7 */
2129#define nMATCH_EN_0_7 0x0
2130#define MATCH_EN_1_0 0x100 /* Pattern Match Enable Byte 1 Bit 0 */
2131#define nMATCH_EN_1_0 0x0
2132#define MATCH_EN_1_1 0x200 /* Pattern Match Enable Byte 1 Bit 1 */
2133#define nMATCH_EN_1_1 0x0
2134#define MATCH_EN_1_2 0x400 /* Pattern Match Enable Byte 1 Bit 2 */
2135#define nMATCH_EN_1_2 0x0
2136#define MATCH_EN_1_3 0x800 /* Pattern Match Enable Byte 1 Bit 3 */
2137#define nMATCH_EN_1_3 0x0
2138#define MATCH_EN_1_4 0x1000 /* Pattern Match Enable Byte 1 Bit 4 */
2139#define nMATCH_EN_1_4 0x0
2140#define MATCH_EN_1_5 0x2000 /* Pattern Match Enable Byte 1 Bit 5 */
2141#define nMATCH_EN_1_5 0x0
2142#define MATCH_EN_1_6 0x4000 /* Pattern Match Enable Byte 1 Bit 6 */
2143#define nMATCH_EN_1_6 0x0
2144#define MATCH_EN_1_7 0x8000 /* Pattern Match Enable Byte 1 Bit 7 */
2145#define nMATCH_EN_1_7 0x0
2146#define MATCH_EN_2_0 0x10000 /* Pattern Match Enable Byte 2 Bit 0 */
2147#define nMATCH_EN_2_0 0x0
2148#define MATCH_EN_2_1 0x20000 /* Pattern Match Enable Byte 2 Bit 1 */
2149#define nMATCH_EN_2_1 0x0
2150#define MATCH_EN_2_2 0x40000 /* Pattern Match Enable Byte 2 Bit 2 */
2151#define nMATCH_EN_2_2 0x0
2152#define MATCH_EN_2_3 0x80000 /* Pattern Match Enable Byte 2 Bit 3 */
2153#define nMATCH_EN_2_3 0x0
2154#define MATCH_EN_2_4 0x100000 /* Pattern Match Enable Byte 2 Bit 4 */
2155#define nMATCH_EN_2_4 0x0
2156#define MATCH_EN_2_5 0x200000 /* Pattern Match Enable Byte 2 Bit 5 */
2157#define nMATCH_EN_2_5 0x0
2158#define MATCH_EN_2_6 0x400000 /* Pattern Match Enable Byte 2 Bit 6 */
2159#define nMATCH_EN_2_6 0x0
2160#define MATCH_EN_2_7 0x800000 /* Pattern Match Enable Byte 2 Bit 7 */
2161#define nMATCH_EN_2_7 0x0
2162#define MATCH_EN_3_0 0x1000000 /* Pattern Match Enable Byte 3 Bit 0 */
2163#define nMATCH_EN_3_0 0x0
2164#define MATCH_EN_3_1 0x2000000 /* Pattern Match Enable Byte 3 Bit 1 */
2165#define nMATCH_EN_3_1 0x0
2166#define MATCH_EN_3_2 0x4000000 /* Pattern Match Enable Byte 3 Bit 2 */
2167#define nMATCH_EN_3_2 0x0
2168#define MATCH_EN_3_3 0x8000000 /* Pattern Match Enable Byte 3 Bit 3 */
2169#define nMATCH_EN_3_3 0x0
2170#define MATCH_EN_3_4 0x10000000 /* Pattern Match Enable Byte 3 Bit 4 */
2171#define nMATCH_EN_3_4 0x0
2172#define MATCH_EN_3_5 0x20000000 /* Pattern Match Enable Byte 3 Bit 5 */
2173#define nMATCH_EN_3_5 0x0
2174#define MATCH_EN_3_6 0x40000000 /* Pattern Match Enable Byte 3 Bit 6 */
2175#define nMATCH_EN_3_6 0x0
2176#define MATCH_EN_3_7 0x80000000 /* Pattern Match Enable Byte 3 Bit 7 */
2177#define nMATCH_EN_3_7 0x0
2178
2179/* Bit masks for MXVR_FRAME_CNT_0 */
2180
2181#define FCNT 0xffff /* Frame Count */
2182
2183/* Bit masks for MXVR_FRAME_CNT_1 */
2184
2185#define FCNT 0xffff /* Frame Count */
2186
2187/* Bit masks for MXVR_ROUTING_0 */
2188
2189#define TX_CH0 0x3f /* Transmit Channel 0 */
2190#define MUTE_CH0 0x80 /* Mute Channel 0 */
2191#define nMUTE_CH0 0x0
2192#define TX_CH1 0x3f00 /* Transmit Channel 0 */
2193#define MUTE_CH1 0x8000 /* Mute Channel 0 */
2194#define nMUTE_CH1 0x0
2195#define TX_CH2 0x3f0000 /* Transmit Channel 0 */
2196#define MUTE_CH2 0x800000 /* Mute Channel 0 */
2197#define nMUTE_CH2 0x0
2198#define TX_CH3 0x3f000000 /* Transmit Channel 0 */
2199#define MUTE_CH3 0x80000000 /* Mute Channel 0 */
2200#define nMUTE_CH3 0x0
2201
2202/* Bit masks for MXVR_ROUTING_1 */
2203
2204#define TX_CH4 0x3f /* Transmit Channel 4 */
2205#define MUTE_CH4 0x80 /* Mute Channel 4 */
2206#define nMUTE_CH4 0x0
2207#define TX_CH5 0x3f00 /* Transmit Channel 5 */
2208#define MUTE_CH5 0x8000 /* Mute Channel 5 */
2209#define nMUTE_CH5 0x0
2210#define TX_CH6 0x3f0000 /* Transmit Channel 6 */
2211#define MUTE_CH6 0x800000 /* Mute Channel 6 */
2212#define nMUTE_CH6 0x0
2213#define TX_CH7 0x3f000000 /* Transmit Channel 7 */
2214#define MUTE_CH7 0x80000000 /* Mute Channel 7 */
2215#define nMUTE_CH7 0x0
2216
2217/* Bit masks for MXVR_ROUTING_2 */
2218
2219#define TX_CH8 0x3f /* Transmit Channel 8 */
2220#define MUTE_CH8 0x80 /* Mute Channel 8 */
2221#define nMUTE_CH8 0x0
2222#define TX_CH9 0x3f00 /* Transmit Channel 9 */
2223#define MUTE_CH9 0x8000 /* Mute Channel 9 */
2224#define nMUTE_CH9 0x0
2225#define TX_CH10 0x3f0000 /* Transmit Channel 10 */
2226#define MUTE_CH10 0x800000 /* Mute Channel 10 */
2227#define nMUTE_CH10 0x0
2228#define TX_CH11 0x3f000000 /* Transmit Channel 11 */
2229#define MUTE_CH11 0x80000000 /* Mute Channel 11 */
2230#define nMUTE_CH11 0x0
2231
2232/* Bit masks for MXVR_ROUTING_3 */
2233
2234#define TX_CH12 0x3f /* Transmit Channel 12 */
2235#define MUTE_CH12 0x80 /* Mute Channel 12 */
2236#define nMUTE_CH12 0x0
2237#define TX_CH13 0x3f00 /* Transmit Channel 13 */
2238#define MUTE_CH13 0x8000 /* Mute Channel 13 */
2239#define nMUTE_CH13 0x0
2240#define TX_CH14 0x3f0000 /* Transmit Channel 14 */
2241#define MUTE_CH14 0x800000 /* Mute Channel 14 */
2242#define nMUTE_CH14 0x0
2243#define TX_CH15 0x3f000000 /* Transmit Channel 15 */
2244#define MUTE_CH15 0x80000000 /* Mute Channel 15 */
2245#define nMUTE_CH15 0x0
2246
2247/* Bit masks for MXVR_ROUTING_4 */
2248
2249#define TX_CH16 0x3f /* Transmit Channel 16 */
2250#define MUTE_CH16 0x80 /* Mute Channel 16 */
2251#define nMUTE_CH16 0x0
2252#define TX_CH17 0x3f00 /* Transmit Channel 17 */
2253#define MUTE_CH17 0x8000 /* Mute Channel 17 */
2254#define nMUTE_CH17 0x0
2255#define TX_CH18 0x3f0000 /* Transmit Channel 18 */
2256#define MUTE_CH18 0x800000 /* Mute Channel 18 */
2257#define nMUTE_CH18 0x0
2258#define TX_CH19 0x3f000000 /* Transmit Channel 19 */
2259#define MUTE_CH19 0x80000000 /* Mute Channel 19 */
2260#define nMUTE_CH19 0x0
2261
2262/* Bit masks for MXVR_ROUTING_5 */
2263
2264#define TX_CH20 0x3f /* Transmit Channel 20 */
2265#define MUTE_CH20 0x80 /* Mute Channel 20 */
2266#define nMUTE_CH20 0x0
2267#define TX_CH21 0x3f00 /* Transmit Channel 21 */
2268#define MUTE_CH21 0x8000 /* Mute Channel 21 */
2269#define nMUTE_CH21 0x0
2270#define TX_CH22 0x3f0000 /* Transmit Channel 22 */
2271#define MUTE_CH22 0x800000 /* Mute Channel 22 */
2272#define nMUTE_CH22 0x0
2273#define TX_CH23 0x3f000000 /* Transmit Channel 23 */
2274#define MUTE_CH23 0x80000000 /* Mute Channel 23 */
2275#define nMUTE_CH23 0x0
2276
2277/* Bit masks for MXVR_ROUTING_6 */
2278
2279#define TX_CH24 0x3f /* Transmit Channel 24 */
2280#define MUTE_CH24 0x80 /* Mute Channel 24 */
2281#define nMUTE_CH24 0x0
2282#define TX_CH25 0x3f00 /* Transmit Channel 25 */
2283#define MUTE_CH25 0x8000 /* Mute Channel 25 */
2284#define nMUTE_CH25 0x0
2285#define TX_CH26 0x3f0000 /* Transmit Channel 26 */
2286#define MUTE_CH26 0x800000 /* Mute Channel 26 */
2287#define nMUTE_CH26 0x0
2288#define TX_CH27 0x3f000000 /* Transmit Channel 27 */
2289#define MUTE_CH27 0x80000000 /* Mute Channel 27 */
2290#define nMUTE_CH27 0x0
2291
2292/* Bit masks for MXVR_ROUTING_7 */
2293
2294#define TX_CH28 0x3f /* Transmit Channel 28 */
2295#define MUTE_CH28 0x80 /* Mute Channel 28 */
2296#define nMUTE_CH28 0x0
2297#define TX_CH29 0x3f00 /* Transmit Channel 29 */
2298#define MUTE_CH29 0x8000 /* Mute Channel 29 */
2299#define nMUTE_CH29 0x0
2300#define TX_CH30 0x3f0000 /* Transmit Channel 30 */
2301#define MUTE_CH30 0x800000 /* Mute Channel 30 */
2302#define nMUTE_CH30 0x0
2303#define TX_CH31 0x3f000000 /* Transmit Channel 31 */
2304#define MUTE_CH31 0x80000000 /* Mute Channel 31 */
2305#define nMUTE_CH31 0x0
2306
2307/* Bit masks for MXVR_ROUTING_8 */
2308
2309#define TX_CH32 0x3f /* Transmit Channel 32 */
2310#define MUTE_CH32 0x80 /* Mute Channel 32 */
2311#define nMUTE_CH32 0x0
2312#define TX_CH33 0x3f00 /* Transmit Channel 33 */
2313#define MUTE_CH33 0x8000 /* Mute Channel 33 */
2314#define nMUTE_CH33 0x0
2315#define TX_CH34 0x3f0000 /* Transmit Channel 34 */
2316#define MUTE_CH34 0x800000 /* Mute Channel 34 */
2317#define nMUTE_CH34 0x0
2318#define TX_CH35 0x3f000000 /* Transmit Channel 35 */
2319#define MUTE_CH35 0x80000000 /* Mute Channel 35 */
2320#define nMUTE_CH35 0x0
2321
2322/* Bit masks for MXVR_ROUTING_9 */
2323
2324#define TX_CH36 0x3f /* Transmit Channel 36 */
2325#define MUTE_CH36 0x80 /* Mute Channel 36 */
2326#define nMUTE_CH36 0x0
2327#define TX_CH37 0x3f00 /* Transmit Channel 37 */
2328#define MUTE_CH37 0x8000 /* Mute Channel 37 */
2329#define nMUTE_CH37 0x0
2330#define TX_CH38 0x3f0000 /* Transmit Channel 38 */
2331#define MUTE_CH38 0x800000 /* Mute Channel 38 */
2332#define nMUTE_CH38 0x0
2333#define TX_CH39 0x3f000000 /* Transmit Channel 39 */
2334#define MUTE_CH39 0x80000000 /* Mute Channel 39 */
2335#define nMUTE_CH39 0x0
2336
2337/* Bit masks for MXVR_ROUTING_10 */
2338
2339#define TX_CH40 0x3f /* Transmit Channel 40 */
2340#define MUTE_CH40 0x80 /* Mute Channel 40 */
2341#define nMUTE_CH40 0x0
2342#define TX_CH41 0x3f00 /* Transmit Channel 41 */
2343#define MUTE_CH41 0x8000 /* Mute Channel 41 */
2344#define nMUTE_CH41 0x0
2345#define TX_CH42 0x3f0000 /* Transmit Channel 42 */
2346#define MUTE_CH42 0x800000 /* Mute Channel 42 */
2347#define nMUTE_CH42 0x0
2348#define TX_CH43 0x3f000000 /* Transmit Channel 43 */
2349#define MUTE_CH43 0x80000000 /* Mute Channel 43 */
2350#define nMUTE_CH43 0x0
2351
2352/* Bit masks for MXVR_ROUTING_11 */
2353
2354#define TX_CH44 0x3f /* Transmit Channel 44 */
2355#define MUTE_CH44 0x80 /* Mute Channel 44 */
2356#define nMUTE_CH44 0x0
2357#define TX_CH45 0x3f00 /* Transmit Channel 45 */
2358#define MUTE_CH45 0x8000 /* Mute Channel 45 */
2359#define nMUTE_CH45 0x0
2360#define TX_CH46 0x3f0000 /* Transmit Channel 46 */
2361#define MUTE_CH46 0x800000 /* Mute Channel 46 */
2362#define nMUTE_CH46 0x0
2363#define TX_CH47 0x3f000000 /* Transmit Channel 47 */
2364#define MUTE_CH47 0x80000000 /* Mute Channel 47 */
2365#define nMUTE_CH47 0x0
2366
2367/* Bit masks for MXVR_ROUTING_12 */
2368
2369#define TX_CH48 0x3f /* Transmit Channel 48 */
2370#define MUTE_CH48 0x80 /* Mute Channel 48 */
2371#define nMUTE_CH48 0x0
2372#define TX_CH49 0x3f00 /* Transmit Channel 49 */
2373#define MUTE_CH49 0x8000 /* Mute Channel 49 */
2374#define nMUTE_CH49 0x0
2375#define TX_CH50 0x3f0000 /* Transmit Channel 50 */
2376#define MUTE_CH50 0x800000 /* Mute Channel 50 */
2377#define nMUTE_CH50 0x0
2378#define TX_CH51 0x3f000000 /* Transmit Channel 51 */
2379#define MUTE_CH51 0x80000000 /* Mute Channel 51 */
2380#define nMUTE_CH51 0x0
2381
2382/* Bit masks for MXVR_ROUTING_13 */
2383
2384#define TX_CH52 0x3f /* Transmit Channel 52 */
2385#define MUTE_CH52 0x80 /* Mute Channel 52 */
2386#define nMUTE_CH52 0x0
2387#define TX_CH53 0x3f00 /* Transmit Channel 53 */
2388#define MUTE_CH53 0x8000 /* Mute Channel 53 */
2389#define nMUTE_CH53 0x0
2390#define TX_CH54 0x3f0000 /* Transmit Channel 54 */
2391#define MUTE_CH54 0x800000 /* Mute Channel 54 */
2392#define nMUTE_CH54 0x0
2393#define TX_CH55 0x3f000000 /* Transmit Channel 55 */
2394#define MUTE_CH55 0x80000000 /* Mute Channel 55 */
2395#define nMUTE_CH55 0x0
2396
2397/* Bit masks for MXVR_ROUTING_14 */
2398
2399#define TX_CH56 0x3f /* Transmit Channel 56 */
2400#define MUTE_CH56 0x80 /* Mute Channel 56 */
2401#define nMUTE_CH56 0x0
2402#define TX_CH57 0x3f00 /* Transmit Channel 57 */
2403#define MUTE_CH57 0x8000 /* Mute Channel 57 */
2404#define nMUTE_CH57 0x0
2405#define TX_CH58 0x3f0000 /* Transmit Channel 58 */
2406#define MUTE_CH58 0x800000 /* Mute Channel 58 */
2407#define nMUTE_CH58 0x0
2408#define TX_CH59 0x3f000000 /* Transmit Channel 59 */
2409#define MUTE_CH59 0x80000000 /* Mute Channel 59 */
2410#define nMUTE_CH59 0x0
2411
2412/* Bit masks for MXVR_BLOCK_CNT */
2413
2414#define BCNT 0xffff /* Block Count */
2415
2416/* Bit masks for MXVR_CLK_CTL */
2417
2418#define MXTALCEN 0x1 /* MXVR Crystal Oscillator Clock Enable */
2419#define nMXTALCEN 0x0
2420#define MXTALFEN 0x2 /* MXVR Crystal Oscillator Feedback Enable */
2421#define nMXTALFEN 0x0
2422#define MXTALMUL 0x30 /* MXVR Crystal Multiplier */
2423#define CLKX3SEL 0x80 /* Clock Generation Source Select */
2424#define nCLKX3SEL 0x0
2425#define MMCLKEN 0x100 /* Master Clock Enable */
2426#define nMMCLKEN 0x0
2427#define MMCLKMUL 0x1e00 /* Master Clock Multiplication Factor */
2428#define PLLSMPS 0xe000 /* MXVR PLL State Machine Prescaler */
2429#define MBCLKEN 0x10000 /* Bit Clock Enable */
2430#define nMBCLKEN 0x0
2431#define MBCLKDIV 0x1e0000 /* Bit Clock Divide Factor */
2432#define INVRX 0x800000 /* Invert Receive Data */
2433#define nINVRX 0x0
2434#define MFSEN 0x1000000 /* Frame Sync Enable */
2435#define nMFSEN 0x0
2436#define MFSDIV 0x1e000000 /* Frame Sync Divide Factor */
2437#define MFSSEL 0x60000000 /* Frame Sync Select */
2438#define MFSSYNC 0x80000000 /* Frame Sync Synchronization Select */
2439#define nMFSSYNC 0x0
2440
2441/* Bit masks for MXVR_CDRPLL_CTL */
2442
2443#define CDRSMEN 0x1 /* MXVR CDRPLL State Machine Enable */
2444#define nCDRSMEN 0x0
2445#define CDRRSTB 0x2 /* MXVR CDRPLL Reset */
2446#define nCDRRSTB 0x0
2447#define CDRSVCO 0x4 /* MXVR CDRPLL Start VCO */
2448#define nCDRSVCO 0x0
2449#define CDRMODE 0x8 /* MXVR CDRPLL CDR Mode Select */
2450#define nCDRMODE 0x0
2451#define CDRSCNT 0x3f0 /* MXVR CDRPLL Start Counter */
2452#define CDRLCNT 0xfc00 /* MXVR CDRPLL Lock Counter */
2453#define CDRSHPSEL 0x3f0000 /* MXVR CDRPLL Shaper Select */
2454#define CDRSHPEN 0x800000 /* MXVR CDRPLL Shaper Enable */
2455#define nCDRSHPEN 0x0
2456#define CDRCPSEL 0xff000000 /* MXVR CDRPLL Charge Pump Current Select */
2457
2458/* Bit masks for MXVR_FMPLL_CTL */
2459
2460#define FMSMEN 0x1 /* MXVR FMPLL State Machine Enable */
2461#define nFMSMEN 0x0
2462#define FMRSTB 0x2 /* MXVR FMPLL Reset */
2463#define nFMRSTB 0x0
2464#define FMSVCO 0x4 /* MXVR FMPLL Start VCO */
2465#define nFMSVCO 0x0
2466#define FMSCNT 0x3f0 /* MXVR FMPLL Start Counter */
2467#define FMLCNT 0xfc00 /* MXVR FMPLL Lock Counter */
2468#define FMCPSEL 0xff000000 /* MXVR FMPLL Charge Pump Current Select */
2469
2470/* Bit masks for MXVR_PIN_CTL */
2471
2472#define MTXONBOD 0x1 /* MTXONB Open Drain Select */
2473#define nMTXONBOD 0x0
2474#define MTXONBG 0x2 /* MTXONB Gates MTX Select */
2475#define nMTXONBG 0x0
2476#define MFSOE 0x10 /* MFS Output Enable */
2477#define nMFSOE 0x0
2478#define MFSGPSEL 0x20 /* MFS General Purpose Output Select */
2479#define nMFSGPSEL 0x0
2480#define MFSGPDAT 0x40 /* MFS General Purpose Output Data */
2481#define nMFSGPDAT 0x0
2482
2483/* Bit masks for MXVR_SCLK_CNT */
2484
2485#define SCNT 0xffff /* System Clock Count */
2486
2487/* Bit masks for KPAD_CTL */
2488
2489#define KPAD_EN 0x1 /* Keypad Enable */
2490#define nKPAD_EN 0x0
2491#define KPAD_IRQMODE 0x6 /* Key Press Interrupt Enable */
2492#define KPAD_ROWEN 0x1c00 /* Row Enable Width */
2493#define KPAD_COLEN 0xe000 /* Column Enable Width */
2494
2495/* Bit masks for KPAD_PRESCALE */
2496
2497#define KPAD_PRESCALE_VAL 0x3f /* Key Prescale Value */
2498
2499/* Bit masks for KPAD_MSEL */
2500
2501#define DBON_SCALE 0xff /* Debounce Scale Value */
2502#define COLDRV_SCALE 0xff00 /* Column Driver Scale Value */
2503
2504/* Bit masks for KPAD_ROWCOL */
2505
2506#define KPAD_ROW 0xff /* Rows Pressed */
2507#define KPAD_COL 0xff00 /* Columns Pressed */
2508
2509/* Bit masks for KPAD_STAT */
2510
2511#define KPAD_IRQ 0x1 /* Keypad Interrupt Status */
2512#define nKPAD_IRQ 0x0
2513#define KPAD_MROWCOL 0x6 /* Multiple Row/Column Keypress Status */
2514#define KPAD_PRESSED 0x8 /* Key press current status */
2515#define nKPAD_PRESSED 0x0
2516
2517/* Bit masks for KPAD_SOFTEVAL */
2518
2519#define KPAD_SOFTEVAL_E 0x2 /* Software Programmable Force Evaluate */
2520#define nKPAD_SOFTEVAL_E 0x0
2521
2522/* Bit masks for SDH_COMMAND */
2523
2524#define CMD_IDX 0x3f /* Command Index */
2525#define CMD_RSP 0x40 /* Response */
2526#define nCMD_RSP 0x0
2527#define CMD_L_RSP 0x80 /* Long Response */
2528#define nCMD_L_RSP 0x0
2529#define CMD_INT_E 0x100 /* Command Interrupt */
2530#define nCMD_INT_E 0x0
2531#define CMD_PEND_E 0x200 /* Command Pending */
2532#define nCMD_PEND_E 0x0
2533#define CMD_E 0x400 /* Command Enable */
2534#define nCMD_E 0x0
2535
2536/* Bit masks for SDH_PWR_CTL */
2537
2538#define PWR_ON 0x3 /* Power On */
2539#if 0
2540#define TBD 0x3c /* TBD */
2541#endif
2542#define SD_CMD_OD 0x40 /* Open Drain Output */
2543#define nSD_CMD_OD 0x0
2544#define ROD_CTL 0x80 /* Rod Control */
2545#define nROD_CTL 0x0
2546
2547/* Bit masks for SDH_CLK_CTL */
2548
2549#define CLKDIV 0xff /* MC_CLK Divisor */
2550#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
2551#define nCLK_E 0x0
2552#define PWR_SV_E 0x200 /* Power Save Enable */
2553#define nPWR_SV_E 0x0
2554#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
2555#define nCLKDIV_BYPASS 0x0
2556#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
2557#define nWIDE_BUS 0x0
2558
2559/* Bit masks for SDH_RESP_CMD */
2560
2561#define RESP_CMD 0x3f /* Response Command */
2562
2563/* Bit masks for SDH_DATA_CTL */
2564
2565#define DTX_E 0x1 /* Data Transfer Enable */
2566#define nDTX_E 0x0
2567#define DTX_DIR 0x2 /* Data Transfer Direction */
2568#define nDTX_DIR 0x0
2569#define DTX_MODE 0x4 /* Data Transfer Mode */
2570#define nDTX_MODE 0x0
2571#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
2572#define nDTX_DMA_E 0x0
2573#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
2574
2575/* Bit masks for SDH_STATUS */
2576
2577#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
2578#define nCMD_CRC_FAIL 0x0
2579#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
2580#define nDAT_CRC_FAIL 0x0
2581#define CMD_TIMEOUT 0x4 /* CMD Time Out */
2582#define nCMD_TIMEOUT 0x0
2583#define DAT_TIMEOUT 0x8 /* Data Time Out */
2584#define nDAT_TIMEOUT 0x0
2585#define TX_UNDERRUN 0x10 /* Transmit Underrun */
2586#define nTX_UNDERRUN 0x0
2587#define RX_OVERRUN 0x20 /* Receive Overrun */
2588#define nRX_OVERRUN 0x0
2589#define CMD_RESP_END 0x40 /* CMD Response End */
2590#define nCMD_RESP_END 0x0
2591#define CMD_SENT 0x80 /* CMD Sent */
2592#define nCMD_SENT 0x0
2593#define DAT_END 0x100 /* Data End */
2594#define nDAT_END 0x0
2595#define START_BIT_ERR 0x200 /* Start Bit Error */
2596#define nSTART_BIT_ERR 0x0
2597#define DAT_BLK_END 0x400 /* Data Block End */
2598#define nDAT_BLK_END 0x0
2599#define CMD_ACT 0x800 /* CMD Active */
2600#define nCMD_ACT 0x0
2601#define TX_ACT 0x1000 /* Transmit Active */
2602#define nTX_ACT 0x0
2603#define RX_ACT 0x2000 /* Receive Active */
2604#define nRX_ACT 0x0
2605#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
2606#define nTX_FIFO_STAT 0x0
2607#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
2608#define nRX_FIFO_STAT 0x0
2609#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
2610#define nTX_FIFO_FULL 0x0
2611#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
2612#define nRX_FIFO_FULL 0x0
2613#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
2614#define nTX_FIFO_ZERO 0x0
2615#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
2616#define nRX_DAT_ZERO 0x0
2617#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
2618#define nTX_DAT_RDY 0x0
2619#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
2620#define nRX_FIFO_RDY 0x0
2621
2622/* Bit masks for SDH_STATUS_CLR */
2623
2624#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
2625#define nCMD_CRC_FAIL_STAT 0x0
2626#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
2627#define nDAT_CRC_FAIL_STAT 0x0
2628#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
2629#define nCMD_TIMEOUT_STAT 0x0
2630#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
2631#define nDAT_TIMEOUT_STAT 0x0
2632#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
2633#define nTX_UNDERRUN_STAT 0x0
2634#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
2635#define nRX_OVERRUN_STAT 0x0
2636#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
2637#define nCMD_RESP_END_STAT 0x0
2638#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
2639#define nCMD_SENT_STAT 0x0
2640#define DAT_END_STAT 0x100 /* Data End Status */
2641#define nDAT_END_STAT 0x0
2642#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
2643#define nSTART_BIT_ERR_STAT 0x0
2644#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
2645#define nDAT_BLK_END_STAT 0x0
2646
2647/* Bit masks for SDH_MASK0 */
2648
2649#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
2650#define nCMD_CRC_FAIL_MASK 0x0
2651#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
2652#define nDAT_CRC_FAIL_MASK 0x0
2653#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
2654#define nCMD_TIMEOUT_MASK 0x0
2655#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
2656#define nDAT_TIMEOUT_MASK 0x0
2657#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
2658#define nTX_UNDERRUN_MASK 0x0
2659#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
2660#define nRX_OVERRUN_MASK 0x0
2661#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
2662#define nCMD_RESP_END_MASK 0x0
2663#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
2664#define nCMD_SENT_MASK 0x0
2665#define DAT_END_MASK 0x100 /* Data End Mask */
2666#define nDAT_END_MASK 0x0
2667#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
2668#define nSTART_BIT_ERR_MASK 0x0
2669#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
2670#define nDAT_BLK_END_MASK 0x0
2671#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
2672#define nCMD_ACT_MASK 0x0
2673#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
2674#define nTX_ACT_MASK 0x0
2675#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
2676#define nRX_ACT_MASK 0x0
2677#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
2678#define nTX_FIFO_STAT_MASK 0x0
2679#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
2680#define nRX_FIFO_STAT_MASK 0x0
2681#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
2682#define nTX_FIFO_FULL_MASK 0x0
2683#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
2684#define nRX_FIFO_FULL_MASK 0x0
2685#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
2686#define nTX_FIFO_ZERO_MASK 0x0
2687#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
2688#define nRX_DAT_ZERO_MASK 0x0
2689#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
2690#define nTX_DAT_RDY_MASK 0x0
2691#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
2692#define nRX_FIFO_RDY_MASK 0x0
2693
2694/* Bit masks for SDH_FIFO_CNT */
2695
2696#define FIFO_COUNT 0x7fff /* FIFO Count */
2697
2698/* Bit masks for SDH_E_STATUS */
2699
2700#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
2701#define nSDIO_INT_DET 0x0
2702#define SD_CARD_DET 0x10 /* SD Card Detect */
2703#define nSD_CARD_DET 0x0
2704
2705/* Bit masks for SDH_E_MASK */
2706
2707#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
2708#define nSDIO_MSK 0x0
2709#define SCD_MSK 0x40 /* Mask Card Detect */
2710#define nSCD_MSK 0x0
2711
2712/* Bit masks for SDH_CFG */
2713
2714#define CLKS_EN 0x1 /* Clocks Enable */
2715#define nCLKS_EN 0x0
2716#define SD4E 0x4 /* SDIO 4-Bit Enable */
2717#define nSD4E 0x0
2718#define MWE 0x8 /* Moving Window Enable */
2719#define nMWE 0x0
2720#define SD_RST 0x10 /* SDMMC Reset */
2721#define nSD_RST 0x0
2722#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
2723#define nPUP_SDDAT 0x0
2724#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
2725#define nPUP_SDDAT3 0x0
2726#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
2727#define nPD_SDDAT3 0x0
2728
2729/* Bit masks for SDH_RD_WAIT_EN */
2730
2731#define RWR 0x1 /* Read Wait Request */
2732#define nRWR 0x0
2733
2734/* Bit masks for ATAPI_CONTROL */
2735
2736#define PIO_START 0x1 /* Start PIO/Reg Op */
2737#define nPIO_START 0x0
2738#define MULTI_START 0x2 /* Start Multi-DMA Op */
2739#define nMULTI_START 0x0
2740#define ULTRA_START 0x4 /* Start Ultra-DMA Op */
2741#define nULTRA_START 0x0
2742#define XFER_DIR 0x8 /* Transfer Direction */
2743#define nXFER_DIR 0x0
2744#define IORDY_EN 0x10 /* IORDY Enable */
2745#define nIORDY_EN 0x0
2746#define FIFO_FLUSH 0x20 /* Flush FIFOs */
2747#define nFIFO_FLUSH 0x0
2748#define SOFT_RST 0x40 /* Soft Reset */
2749#define nSOFT_RST 0x0
2750#define DEV_RST 0x80 /* Device Reset */
2751#define nDEV_RST 0x0
2752#define TFRCNT_RST 0x100 /* Trans Count Reset */
2753#define nTFRCNT_RST 0x0
2754#define END_ON_TERM 0x200 /* End/Terminate Select */
2755#define nEND_ON_TERM 0x0
2756#define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
2757#define nPIO_USE_DMA 0x0
2758#define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
2759
2760/* Bit masks for ATAPI_STATUS */
2761
2762#define PIO_XFER_ON 0x1 /* PIO transfer in progress */
2763#define nPIO_XFER_ON 0x0
2764#define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
2765#define nMULTI_XFER_ON 0x0
2766#define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
2767#define nULTRA_XFER_ON 0x0
2768#define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
2769
2770/* Bit masks for ATAPI_DEV_ADDR */
2771
2772#define DEV_ADDR 0x1f /* Device Address */
2773
2774/* Bit masks for ATAPI_INT_MASK */
2775
2776#define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
2777#define nATAPI_DEV_INT_MASK 0x0
2778#define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
2779#define nPIO_DONE_MASK 0x0
2780#define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
2781#define nMULTI_DONE_MASK 0x0
2782#define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
2783#define nUDMAIN_DONE_MASK 0x0
2784#define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
2785#define nUDMAOUT_DONE_MASK 0x0
2786#define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
2787#define nHOST_TERM_XFER_MASK 0x0
2788#define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
2789#define nMULTI_TERM_MASK 0x0
2790#define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
2791#define nUDMAIN_TERM_MASK 0x0
2792#define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
2793#define nUDMAOUT_TERM_MASK 0x0
2794
2795/* Bit masks for ATAPI_INT_STATUS */
2796
2797#define ATAPI_DEV_INT 0x1 /* Device interrupt status */
2798#define nATAPI_DEV_INT 0x0
2799#define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
2800#define nPIO_DONE_INT 0x0
2801#define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
2802#define nMULTI_DONE_INT 0x0
2803#define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
2804#define nUDMAIN_DONE_INT 0x0
2805#define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
2806#define nUDMAOUT_DONE_INT 0x0
2807#define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
2808#define nHOST_TERM_XFER_INT 0x0
2809#define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
2810#define nMULTI_TERM_INT 0x0
2811#define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
2812#define nUDMAIN_TERM_INT 0x0
2813#define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
2814#define nUDMAOUT_TERM_INT 0x0
2815
2816/* Bit masks for ATAPI_LINE_STATUS */
2817
2818#define ATAPI_INTR 0x1 /* Device interrupt to host line status */
2819#define nATAPI_INTR 0x0
2820#define ATAPI_DASP 0x2 /* Device dasp to host line status */
2821#define nATAPI_DASP 0x0
2822#define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
2823#define nATAPI_CS0N 0x0
2824#define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
2825#define nATAPI_CS1N 0x0
2826#define ATAPI_ADDR 0x70 /* ATAPI address line status */
2827#define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
2828#define nATAPI_DMAREQ 0x0
2829#define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
2830#define nATAPI_DMAACKN 0x0
2831#define ATAPI_DIOWN 0x200 /* ATAPI write line status */
2832#define nATAPI_DIOWN 0x0
2833#define ATAPI_DIORN 0x400 /* ATAPI read line status */
2834#define nATAPI_DIORN 0x0
2835#define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
2836#define nATAPI_IORDY 0x0
2837
2838/* Bit masks for ATAPI_SM_STATE */
2839
2840#define PIO_CSTATE 0xf /* PIO mode state machine current state */
2841#define DMA_CSTATE 0xf0 /* DMA mode state machine current state */
2842#define UDMAIN_CSTATE 0xf00 /* Ultra DMA-In mode state machine current state */
2843#define UDMAOUT_CSTATE 0xf000 /* ATAPI IORDY line status */
2844
2845/* Bit masks for ATAPI_TERMINATE */
2846
2847#define ATAPI_HOST_TERM 0x1 /* Host terminationation */
2848#define nATAPI_HOST_TERM 0x0
2849
2850/* Bit masks for ATAPI_REG_TIM_0 */
2851
2852#define T2_REG 0xff /* End of cycle time for register access transfers */
2853#define TEOC_REG 0xff00 /* Selects DIOR/DIOW pulsewidth */
2854
2855/* Bit masks for ATAPI_PIO_TIM_0 */
2856
2857#define T1_REG 0xf /* Time from address valid to DIOR/DIOW */
2858#define T2_REG_PIO 0xff0 /* DIOR/DIOW pulsewidth */
2859#define T4_REG 0xf000 /* DIOW data hold */
2860
2861/* Bit masks for ATAPI_PIO_TIM_1 */
2862
2863#define TEOC_REG_PIO 0xff /* End of cycle time for PIO access transfers. */
2864
2865/* Bit masks for ATAPI_MULTI_TIM_0 */
2866
2867#define TD 0xff /* DIOR/DIOW asserted pulsewidth */
2868#define TM 0xff00 /* Time from address valid to DIOR/DIOW */
2869
2870/* Bit masks for ATAPI_MULTI_TIM_1 */
2871
2872#define TKW 0xff /* Selects DIOW negated pulsewidth */
2873#define TKR 0xff00 /* Selects DIOR negated pulsewidth */
2874
2875/* Bit masks for ATAPI_MULTI_TIM_2 */
2876
2877#define TH 0xff /* Selects DIOW data hold */
2878#define TEOC 0xff00 /* Selects end of cycle for DMA */
2879
2880/* Bit masks for ATAPI_ULTRA_TIM_0 */
2881
2882#define TACK 0xff /* Selects setup and hold times for TACK */
2883#define TENV 0xff00 /* Selects envelope time */
2884
2885/* Bit masks for ATAPI_ULTRA_TIM_1 */
2886
2887#define TDVS 0xff /* Selects data valid setup time */
2888#define TCYC_TDVS 0xff00 /* Selects cycle time - TDVS time */
2889
2890/* Bit masks for ATAPI_ULTRA_TIM_2 */
2891
2892#define TSS 0xff /* Selects time from STROBE edge to negation of DMARQ or assertion of STOP */
2893#define TMLI 0xff00 /* Selects interlock time */
2894
2895/* Bit masks for ATAPI_ULTRA_TIM_3 */
2896
2897#define TZAH 0xff /* Selects minimum delay required for output */
2898#define READY_PAUSE 0xff00 /* Selects ready to pause */
2899
2900/* Bit masks for TIMER_ENABLE1 */
2901
2902#define TIMEN8 0x1 /* Timer 8 Enable */
2903#define nTIMEN8 0x0
2904#define TIMEN9 0x2 /* Timer 9 Enable */
2905#define nTIMEN9 0x0
2906#define TIMEN10 0x4 /* Timer 10 Enable */
2907#define nTIMEN10 0x0
2908
2909/* Bit masks for TIMER_DISABLE1 */
2910
2911#define TIMDIS8 0x1 /* Timer 8 Disable */
2912#define nTIMDIS8 0x0
2913#define TIMDIS9 0x2 /* Timer 9 Disable */
2914#define nTIMDIS9 0x0
2915#define TIMDIS10 0x4 /* Timer 10 Disable */
2916#define nTIMDIS10 0x0
2917
2918/* Bit masks for TIMER_STATUS1 */
2919
2920#define TIMIL8 0x1 /* Timer 8 Interrupt */
2921#define nTIMIL8 0x0
2922#define TIMIL9 0x2 /* Timer 9 Interrupt */
2923#define nTIMIL9 0x0
2924#define TIMIL10 0x4 /* Timer 10 Interrupt */
2925#define nTIMIL10 0x0
2926#define TOVF_ERR8 0x10 /* Timer 8 Counter Overflow */
2927#define nTOVF_ERR8 0x0
2928#define TOVF_ERR9 0x20 /* Timer 9 Counter Overflow */
2929#define nTOVF_ERR9 0x0
2930#define TOVF_ERR10 0x40 /* Timer 10 Counter Overflow */
2931#define nTOVF_ERR10 0x0
2932#define TRUN8 0x1000 /* Timer 8 Slave Enable Status */
2933#define nTRUN8 0x0
2934#define TRUN9 0x2000 /* Timer 9 Slave Enable Status */
2935#define nTRUN9 0x0
2936#define TRUN10 0x4000 /* Timer 10 Slave Enable Status */
2937#define nTRUN10 0x0
2938
2939/* Bit masks for EPPI0 are obtained from common base header for EPPIx (EPPI1 and EPPI2) */
2940
2941/* Bit masks for USB_FADDR */
2942
2943#define FUNCTION_ADDRESS 0x7f /* Function address */
2944
2945/* Bit masks for USB_POWER */
2946
2947#define ENABLE_SUSPENDM 0x1 /* enable SuspendM output */
2948#define nENABLE_SUSPENDM 0x0
2949#define SUSPEND_MODE 0x2 /* Suspend Mode indicator */
2950#define nSUSPEND_MODE 0x0
2951#define RESUME_MODE 0x4 /* DMA Mode */
2952#define nRESUME_MODE 0x0
2953#define RESET 0x8 /* Reset indicator */
2954#define nRESET 0x0
2955#define HS_MODE 0x10 /* High Speed mode indicator */
2956#define nHS_MODE 0x0
2957#define HS_ENABLE 0x20 /* high Speed Enable */
2958#define nHS_ENABLE 0x0
2959#define SOFT_CONN 0x40 /* Soft connect */
2960#define nSOFT_CONN 0x0
2961#define ISO_UPDATE 0x80 /* Isochronous update */
2962#define nISO_UPDATE 0x0
2963
2964/* Bit masks for USB_INTRTX */
2965
2966#define EP0_TX 0x1 /* Tx Endpoint 0 interrupt */
2967#define nEP0_TX 0x0
2968#define EP1_TX 0x2 /* Tx Endpoint 1 interrupt */
2969#define nEP1_TX 0x0
2970#define EP2_TX 0x4 /* Tx Endpoint 2 interrupt */
2971#define nEP2_TX 0x0
2972#define EP3_TX 0x8 /* Tx Endpoint 3 interrupt */
2973#define nEP3_TX 0x0
2974#define EP4_TX 0x10 /* Tx Endpoint 4 interrupt */
2975#define nEP4_TX 0x0
2976#define EP5_TX 0x20 /* Tx Endpoint 5 interrupt */
2977#define nEP5_TX 0x0
2978#define EP6_TX 0x40 /* Tx Endpoint 6 interrupt */
2979#define nEP6_TX 0x0
2980#define EP7_TX 0x80 /* Tx Endpoint 7 interrupt */
2981#define nEP7_TX 0x0
2982
2983/* Bit masks for USB_INTRRX */
2984
2985#define EP1_RX 0x2 /* Rx Endpoint 1 interrupt */
2986#define nEP1_RX 0x0
2987#define EP2_RX 0x4 /* Rx Endpoint 2 interrupt */
2988#define nEP2_RX 0x0
2989#define EP3_RX 0x8 /* Rx Endpoint 3 interrupt */
2990#define nEP3_RX 0x0
2991#define EP4_RX 0x10 /* Rx Endpoint 4 interrupt */
2992#define nEP4_RX 0x0
2993#define EP5_RX 0x20 /* Rx Endpoint 5 interrupt */
2994#define nEP5_RX 0x0
2995#define EP6_RX 0x40 /* Rx Endpoint 6 interrupt */
2996#define nEP6_RX 0x0
2997#define EP7_RX 0x80 /* Rx Endpoint 7 interrupt */
2998#define nEP7_RX 0x0
2999
3000/* Bit masks for USB_INTRTXE */
3001
3002#define EP0_TX_E 0x1 /* Endpoint 0 interrupt Enable */
3003#define nEP0_TX_E 0x0
3004#define EP1_TX_E 0x2 /* Tx Endpoint 1 interrupt Enable */
3005#define nEP1_TX_E 0x0
3006#define EP2_TX_E 0x4 /* Tx Endpoint 2 interrupt Enable */
3007#define nEP2_TX_E 0x0
3008#define EP3_TX_E 0x8 /* Tx Endpoint 3 interrupt Enable */
3009#define nEP3_TX_E 0x0
3010#define EP4_TX_E 0x10 /* Tx Endpoint 4 interrupt Enable */
3011#define nEP4_TX_E 0x0
3012#define EP5_TX_E 0x20 /* Tx Endpoint 5 interrupt Enable */
3013#define nEP5_TX_E 0x0
3014#define EP6_TX_E 0x40 /* Tx Endpoint 6 interrupt Enable */
3015#define nEP6_TX_E 0x0
3016#define EP7_TX_E 0x80 /* Tx Endpoint 7 interrupt Enable */
3017#define nEP7_TX_E 0x0
3018
3019/* Bit masks for USB_INTRRXE */
3020
3021#define EP1_RX_E 0x2 /* Rx Endpoint 1 interrupt Enable */
3022#define nEP1_RX_E 0x0
3023#define EP2_RX_E 0x4 /* Rx Endpoint 2 interrupt Enable */
3024#define nEP2_RX_E 0x0
3025#define EP3_RX_E 0x8 /* Rx Endpoint 3 interrupt Enable */
3026#define nEP3_RX_E 0x0
3027#define EP4_RX_E 0x10 /* Rx Endpoint 4 interrupt Enable */
3028#define nEP4_RX_E 0x0
3029#define EP5_RX_E 0x20 /* Rx Endpoint 5 interrupt Enable */
3030#define nEP5_RX_E 0x0
3031#define EP6_RX_E 0x40 /* Rx Endpoint 6 interrupt Enable */
3032#define nEP6_RX_E 0x0
3033#define EP7_RX_E 0x80 /* Rx Endpoint 7 interrupt Enable */
3034#define nEP7_RX_E 0x0
3035
3036/* Bit masks for USB_INTRUSB */
3037
3038#define SUSPEND_B 0x1 /* Suspend indicator */
3039#define nSUSPEND_B 0x0
3040#define RESUME_B 0x2 /* Resume indicator */
3041#define nRESUME_B 0x0
3042#define RESET_OR_BABLE_B 0x4 /* Reset/babble indicator */
3043#define nRESET_OR_BABLE_B 0x0
3044#define SOF_B 0x8 /* Start of frame */
3045#define nSOF_B 0x0
3046#define CONN_B 0x10 /* Connection indicator */
3047#define nCONN_B 0x0
3048#define DISCON_B 0x20 /* Disconnect indicator */
3049#define nDISCON_B 0x0
3050#define SESSION_REQ_B 0x40 /* Session Request */
3051#define nSESSION_REQ_B 0x0
3052#define VBUS_ERROR_B 0x80 /* Vbus threshold indicator */
3053#define nVBUS_ERROR_B 0x0
3054
3055/* Bit masks for USB_INTRUSBE */
3056
3057#define SUSPEND_BE 0x1 /* Suspend indicator int enable */
3058#define nSUSPEND_BE 0x0
3059#define RESUME_BE 0x2 /* Resume indicator int enable */
3060#define nRESUME_BE 0x0
3061#define RESET_OR_BABLE_BE 0x4 /* Reset/babble indicator int enable */
3062#define nRESET_OR_BABLE_BE 0x0
3063#define SOF_BE 0x8 /* Start of frame int enable */
3064#define nSOF_BE 0x0
3065#define CONN_BE 0x10 /* Connection indicator int enable */
3066#define nCONN_BE 0x0
3067#define DISCON_BE 0x20 /* Disconnect indicator int enable */
3068#define nDISCON_BE 0x0
3069#define SESSION_REQ_BE 0x40 /* Session Request int enable */
3070#define nSESSION_REQ_BE 0x0
3071#define VBUS_ERROR_BE 0x80 /* Vbus threshold indicator int enable */
3072#define nVBUS_ERROR_BE 0x0
3073
3074/* Bit masks for USB_FRAME */
3075
3076#define FRAME_NUMBER 0x7ff /* Frame number */
3077
3078/* Bit masks for USB_INDEX */
3079
3080#define SELECTED_ENDPOINT 0xf /* selected endpoint */
3081
3082/* Bit masks for USB_GLOBAL_CTL */
3083
3084#define GLOBAL_ENA 0x1 /* enables USB module */
3085#define nGLOBAL_ENA 0x0
3086#define EP1_TX_ENA 0x2 /* Transmit endpoint 1 enable */
3087#define nEP1_TX_ENA 0x0
3088#define EP2_TX_ENA 0x4 /* Transmit endpoint 2 enable */
3089#define nEP2_TX_ENA 0x0
3090#define EP3_TX_ENA 0x8 /* Transmit endpoint 3 enable */
3091#define nEP3_TX_ENA 0x0
3092#define EP4_TX_ENA 0x10 /* Transmit endpoint 4 enable */
3093#define nEP4_TX_ENA 0x0
3094#define EP5_TX_ENA 0x20 /* Transmit endpoint 5 enable */
3095#define nEP5_TX_ENA 0x0
3096#define EP6_TX_ENA 0x40 /* Transmit endpoint 6 enable */
3097#define nEP6_TX_ENA 0x0
3098#define EP7_TX_ENA 0x80 /* Transmit endpoint 7 enable */
3099#define nEP7_TX_ENA 0x0
3100#define EP1_RX_ENA 0x100 /* Receive endpoint 1 enable */
3101#define nEP1_RX_ENA 0x0
3102#define EP2_RX_ENA 0x200 /* Receive endpoint 2 enable */
3103#define nEP2_RX_ENA 0x0
3104#define EP3_RX_ENA 0x400 /* Receive endpoint 3 enable */
3105#define nEP3_RX_ENA 0x0
3106#define EP4_RX_ENA 0x800 /* Receive endpoint 4 enable */
3107#define nEP4_RX_ENA 0x0
3108#define EP5_RX_ENA 0x1000 /* Receive endpoint 5 enable */
3109#define nEP5_RX_ENA 0x0
3110#define EP6_RX_ENA 0x2000 /* Receive endpoint 6 enable */
3111#define nEP6_RX_ENA 0x0
3112#define EP7_RX_ENA 0x4000 /* Receive endpoint 7 enable */
3113#define nEP7_RX_ENA 0x0
3114
3115/* Bit masks for USB_OTG_DEV_CTL */
3116
3117#define SESSION 0x1 /* session indicator */
3118#define nSESSION 0x0
3119#define HOST_REQ 0x2 /* Host negotiation request */
3120#define nHOST_REQ 0x0
3121#define HOST_MODE 0x4 /* indicates USBDRC is a host */
3122#define nHOST_MODE 0x0
3123#define VBUS0 0x8 /* Vbus level indicator[0] */
3124#define nVBUS0 0x0
3125#define VBUS1 0x10 /* Vbus level indicator[1] */
3126#define nVBUS1 0x0
3127#define LSDEV 0x20 /* Low-speed indicator */
3128#define nLSDEV 0x0
3129#define FSDEV 0x40 /* Full or High-speed indicator */
3130#define nFSDEV 0x0
3131#define B_DEVICE 0x80 /* A' or 'B' device indicator */
3132#define nB_DEVICE 0x0
3133
3134/* Bit masks for USB_OTG_VBUS_IRQ */
3135
3136#define DRIVE_VBUS_ON 0x1 /* indicator to drive VBUS control circuit */
3137#define nDRIVE_VBUS_ON 0x0
3138#define DRIVE_VBUS_OFF 0x2 /* indicator to shut off charge pump */
3139#define nDRIVE_VBUS_OFF 0x0
3140#define CHRG_VBUS_START 0x4 /* indicator for external circuit to start charging VBUS */
3141#define nCHRG_VBUS_START 0x0
3142#define CHRG_VBUS_END 0x8 /* indicator for external circuit to end charging VBUS */
3143#define nCHRG_VBUS_END 0x0
3144#define DISCHRG_VBUS_START 0x10 /* indicator to start discharging VBUS */
3145#define nDISCHRG_VBUS_START 0x0
3146#define DISCHRG_VBUS_END 0x20 /* indicator to stop discharging VBUS */
3147#define nDISCHRG_VBUS_END 0x0
3148
3149/* Bit masks for USB_OTG_VBUS_MASK */
3150
3151#define DRIVE_VBUS_ON_ENA 0x1 /* enable DRIVE_VBUS_ON interrupt */
3152#define nDRIVE_VBUS_ON_ENA 0x0
3153#define DRIVE_VBUS_OFF_ENA 0x2 /* enable DRIVE_VBUS_OFF interrupt */
3154#define nDRIVE_VBUS_OFF_ENA 0x0
3155#define CHRG_VBUS_START_ENA 0x4 /* enable CHRG_VBUS_START interrupt */
3156#define nCHRG_VBUS_START_ENA 0x0
3157#define CHRG_VBUS_END_ENA 0x8 /* enable CHRG_VBUS_END interrupt */
3158#define nCHRG_VBUS_END_ENA 0x0
3159#define DISCHRG_VBUS_START_ENA 0x10 /* enable DISCHRG_VBUS_START interrupt */
3160#define nDISCHRG_VBUS_START_ENA 0x0
3161#define DISCHRG_VBUS_END_ENA 0x20 /* enable DISCHRG_VBUS_END interrupt */
3162#define nDISCHRG_VBUS_END_ENA 0x0
3163
3164/* Bit masks for USB_CSR0 */
3165
3166#define RXPKTRDY 0x1 /* data packet receive indicator */
3167#define nRXPKTRDY 0x0
3168#define TXPKTRDY 0x2 /* data packet in FIFO indicator */
3169#define nTXPKTRDY 0x0
3170#define STALL_SENT 0x4 /* STALL handshake sent */
3171#define nSTALL_SENT 0x0
3172#define DATAEND 0x8 /* Data end indicator */
3173#define nDATAEND 0x0
3174#define SETUPEND 0x10 /* Setup end */
3175#define nSETUPEND 0x0
3176#define SENDSTALL 0x20 /* Send STALL handshake */
3177#define nSENDSTALL 0x0
3178#define SERVICED_RXPKTRDY 0x40 /* used to clear the RxPktRdy bit */
3179#define nSERVICED_RXPKTRDY 0x0
3180#define SERVICED_SETUPEND 0x80 /* used to clear the SetupEnd bit */
3181#define nSERVICED_SETUPEND 0x0
3182#define FLUSHFIFO 0x100 /* flush endpoint FIFO */
3183#define nFLUSHFIFO 0x0
3184#define STALL_RECEIVED_H 0x4 /* STALL handshake received host mode */
3185#define nSTALL_RECEIVED_H 0x0
3186#define SETUPPKT_H 0x8 /* send Setup token host mode */
3187#define nSETUPPKT_H 0x0
3188#define ERROR_H 0x10 /* timeout error indicator host mode */
3189#define nERROR_H 0x0
3190#define REQPKT_H 0x20 /* Request an IN transaction host mode */
3191#define nREQPKT_H 0x0
3192#define STATUSPKT_H 0x40 /* Status stage transaction host mode */
3193#define nSTATUSPKT_H 0x0
3194#define NAK_TIMEOUT_H 0x80 /* EP0 halted after a NAK host mode */
3195#define nNAK_TIMEOUT_H 0x0
3196
3197/* Bit masks for USB_COUNT0 */
3198
3199#define EP0_RX_COUNT 0x7f /* number of received bytes in EP0 FIFO */
3200
3201/* Bit masks for USB_NAKLIMIT0 */
3202
3203#define EP0_NAK_LIMIT 0x1f /* number of frames/micro frames after which EP0 timeouts */
3204
3205/* Bit masks for USB_TX_MAX_PACKET */
3206
3207#define MAX_PACKET_SIZE_T 0x7ff /* maximum data pay load in a frame */
3208
3209/* Bit masks for USB_RX_MAX_PACKET */
3210
3211#define MAX_PACKET_SIZE_R 0x7ff /* maximum data pay load in a frame */
3212
3213/* Bit masks for USB_TXCSR */
3214
3215#define TXPKTRDY_T 0x1 /* data packet in FIFO indicator */
3216#define nTXPKTRDY_T 0x0
3217#define FIFO_NOT_EMPTY_T 0x2 /* FIFO not empty */
3218#define nFIFO_NOT_EMPTY_T 0x0
3219#define UNDERRUN_T 0x4 /* TxPktRdy not set for an IN token */
3220#define nUNDERRUN_T 0x0
3221#define FLUSHFIFO_T 0x8 /* flush endpoint FIFO */
3222#define nFLUSHFIFO_T 0x0
3223#define STALL_SEND_T 0x10 /* issue a Stall handshake */
3224#define nSTALL_SEND_T 0x0
3225#define STALL_SENT_T 0x20 /* Stall handshake transmitted */
3226#define nSTALL_SENT_T 0x0
3227#define CLEAR_DATATOGGLE_T 0x40 /* clear endpoint data toggle */
3228#define nCLEAR_DATATOGGLE_T 0x0
3229#define INCOMPTX_T 0x80 /* indicates that a large packet is split */
3230#define nINCOMPTX_T 0x0
3231#define DMAREQMODE_T 0x400 /* DMA mode (0 or 1) selection */
3232#define nDMAREQMODE_T 0x0
3233#define FORCE_DATATOGGLE_T 0x800 /* Force data toggle */
3234#define nFORCE_DATATOGGLE_T 0x0
3235#define DMAREQ_ENA_T 0x1000 /* Enable DMA request for Tx EP */
3236#define nDMAREQ_ENA_T 0x0
3237#define ISO_T 0x4000 /* enable Isochronous transfers */
3238#define nISO_T 0x0
3239#define AUTOSET_T 0x8000 /* allows TxPktRdy to be set automatically */
3240#define nAUTOSET_T 0x0
3241#define ERROR_TH 0x4 /* error condition host mode */
3242#define nERROR_TH 0x0
3243#define STALL_RECEIVED_TH 0x20 /* Stall handshake received host mode */
3244#define nSTALL_RECEIVED_TH 0x0
3245#define NAK_TIMEOUT_TH 0x80 /* NAK timeout host mode */
3246#define nNAK_TIMEOUT_TH 0x0
3247
3248/* Bit masks for USB_TXCOUNT */
3249
3250#define TX_COUNT 0x1fff /* Number of bytes to be written to the selected endpoint Tx FIFO */
3251
3252/* Bit masks for USB_RXCSR */
3253
3254#define RXPKTRDY_R 0x1 /* data packet in FIFO indicator */
3255#define nRXPKTRDY_R 0x0
3256#define FIFO_FULL_R 0x2 /* FIFO not empty */
3257#define nFIFO_FULL_R 0x0
3258#define OVERRUN_R 0x4 /* TxPktRdy not set for an IN token */
3259#define nOVERRUN_R 0x0
3260#define DATAERROR_R 0x8 /* Out packet cannot be loaded into Rx FIFO */
3261#define nDATAERROR_R 0x0
3262#define FLUSHFIFO_R 0x10 /* flush endpoint FIFO */
3263#define nFLUSHFIFO_R 0x0
3264#define STALL_SEND_R 0x20 /* issue a Stall handshake */
3265#define nSTALL_SEND_R 0x0
3266#define STALL_SENT_R 0x40 /* Stall handshake transmitted */
3267#define nSTALL_SENT_R 0x0
3268#define CLEAR_DATATOGGLE_R 0x80 /* clear endpoint data toggle */
3269#define nCLEAR_DATATOGGLE_R 0x0
3270#define INCOMPRX_R 0x100 /* indicates that a large packet is split */
3271#define nINCOMPRX_R 0x0
3272#define DMAREQMODE_R 0x800 /* DMA mode (0 or 1) selection */
3273#define nDMAREQMODE_R 0x0
3274#define DISNYET_R 0x1000 /* disable Nyet handshakes */
3275#define nDISNYET_R 0x0
3276#define DMAREQ_ENA_R 0x2000 /* Enable DMA request for Tx EP */
3277#define nDMAREQ_ENA_R 0x0
3278#define ISO_R 0x4000 /* enable Isochronous transfers */
3279#define nISO_R 0x0
3280#define AUTOCLEAR_R 0x8000 /* allows TxPktRdy to be set automatically */
3281#define nAUTOCLEAR_R 0x0
3282#define ERROR_RH 0x4 /* TxPktRdy not set for an IN token host mode */
3283#define nERROR_RH 0x0
3284#define REQPKT_RH 0x20 /* request an IN transaction host mode */
3285#define nREQPKT_RH 0x0
3286#define STALL_RECEIVED_RH 0x40 /* Stall handshake received host mode */
3287#define nSTALL_RECEIVED_RH 0x0
3288#define INCOMPRX_RH 0x100 /* indicates that a large packet is split host mode */
3289#define nINCOMPRX_RH 0x0
3290#define DMAREQMODE_RH 0x800 /* DMA mode (0 or 1) selection host mode */
3291#define nDMAREQMODE_RH 0x0
3292#define AUTOREQ_RH 0x4000 /* sets ReqPkt automatically host mode */
3293#define nAUTOREQ_RH 0x0
3294
3295/* Bit masks for USB_RXCOUNT */
3296
3297#define RX_COUNT 0x1fff /* Number of received bytes in the packet in the Rx FIFO */
3298
3299/* Bit masks for USB_TXTYPE */
3300
3301#define TARGET_EP_NO_T 0xf /* EP number */
3302#define PROTOCOL_T 0xc /* transfer type */
3303
3304/* Bit masks for USB_TXINTERVAL */
3305
3306#define TX_POLL_INTERVAL 0xff /* polling interval for selected Tx EP */
3307
3308/* Bit masks for USB_RXTYPE */
3309
3310#define TARGET_EP_NO_R 0xf /* EP number */
3311#define PROTOCOL_R 0xc /* transfer type */
3312
3313/* Bit masks for USB_RXINTERVAL */
3314
3315#define RX_POLL_INTERVAL 0xff /* polling interval for selected Rx EP */
3316
3317/* Bit masks for USB_DMA_INTERRUPT */
3318
3319#define DMA0_INT 0x1 /* DMA0 pending interrupt */
3320#define nDMA0_INT 0x0
3321#define DMA1_INT 0x2 /* DMA1 pending interrupt */
3322#define nDMA1_INT 0x0
3323#define DMA2_INT 0x4 /* DMA2 pending interrupt */
3324#define nDMA2_INT 0x0
3325#define DMA3_INT 0x8 /* DMA3 pending interrupt */
3326#define nDMA3_INT 0x0
3327#define DMA4_INT 0x10 /* DMA4 pending interrupt */
3328#define nDMA4_INT 0x0
3329#define DMA5_INT 0x20 /* DMA5 pending interrupt */
3330#define nDMA5_INT 0x0
3331#define DMA6_INT 0x40 /* DMA6 pending interrupt */
3332#define nDMA6_INT 0x0
3333#define DMA7_INT 0x80 /* DMA7 pending interrupt */
3334#define nDMA7_INT 0x0
3335
3336/* Bit masks for USB_DMAxCONTROL */
3337
3338#define DMA_ENA 0x1 /* DMA enable */
3339#define nDMA_ENA 0x0
3340#define DIRECTION 0x2 /* direction of DMA transfer */
3341#define nDIRECTION 0x0
3342#define MODE 0x4 /* DMA Bus error */
3343#define nMODE 0x0
3344#define INT_ENA 0x8 /* Interrupt enable */
3345#define nINT_ENA 0x0
3346#define EPNUM 0xf0 /* EP number */
3347#define BUSERROR 0x100 /* DMA Bus error */
3348#define nBUSERROR 0x0
3349
3350/* Bit masks for USB_DMAxADDRHIGH */
3351
3352#define DMA_ADDR_HIGH 0xffff /* Upper 16-bits of memory source/destination address for the DMA master channel */
3353
3354/* Bit masks for USB_DMAxADDRLOW */
3355
3356#define DMA_ADDR_LOW 0xffff /* Lower 16-bits of memory source/destination address for the DMA master channel */
3357
3358/* Bit masks for USB_DMAxCOUNTHIGH */
3359
3360#define DMA_COUNT_HIGH 0xffff /* Upper 16-bits of byte count of DMA transfer for DMA master channel */
3361
3362/* Bit masks for USB_DMAxCOUNTLOW */
3363
3364#define DMA_COUNT_LOW 0xffff /* Lower 16-bits of byte count of DMA transfer for DMA master channel */
3365
3366/* Bit masks for HMDMAx_CONTROL */
3367
3368#define HMDMAEN 0x1 /* Handshake MDMA Enable */
3369#define nHMDMAEN 0x0
3370#define REP 0x2 /* Handshake MDMA Request Polarity */
3371#define nREP 0x0
3372#define UTE 0x8 /* Urgency Threshold Enable */
3373#define nUTE 0x0
3374#define OIE 0x10 /* Overflow Interrupt Enable */
3375#define nOIE 0x0
3376#define BDIE 0x20 /* Block Done Interrupt Enable */
3377#define nBDIE 0x0
3378#define MBDI 0x40 /* Mask Block Done Interrupt */
3379#define nMBDI 0x0
3380#define DRQ 0x300 /* Handshake MDMA Request Type */
3381#define RBC 0x1000 /* Force Reload of BCOUNT */
3382#define nRBC 0x0
3383#define PS 0x2000 /* Pin Status */
3384#define nPS 0x0
3385#define OI 0x4000 /* Overflow Interrupt Generated */
3386#define nOI 0x0
3387#define BDI 0x8000 /* Block Done Interrupt Generated */
3388#define nBDI 0x0
3389
3390/* ******************************************* */
3391/* MULTI BIT MACRO ENUMERATIONS */
3392/* ******************************************* */
3393
3394/* ************************ */
3395/* MXVR Address Offsets */
3396/* ************************ */
3397
3398/* Control Message Receive Buffer (CMRB) Address Offsets */
3399
3400#define CMRB_STRIDE 0x00000016lu
3401
3402#define CMRB_DST_OFFSET 0x00000000lu
3403#define CMRB_SRC_OFFSET 0x00000002lu
3404#define CMRB_DATA_OFFSET 0x00000005lu
3405
3406/* Control Message Transmit Buffer (CMTB) Address Offsets */
3407
3408#define CMTB_PRIO_OFFSET 0x00000000lu
3409#define CMTB_DST_OFFSET 0x00000002lu
3410#define CMTB_SRC_OFFSET 0x00000004lu
3411#define CMTB_TYPE_OFFSET 0x00000006lu
3412#define CMTB_DATA_OFFSET 0x00000007lu
3413
3414#define CMTB_ANSWER_OFFSET 0x0000000Alu
3415
3416#define CMTB_STAT_N_OFFSET 0x00000018lu
3417#define CMTB_STAT_A_OFFSET 0x00000016lu
3418#define CMTB_STAT_D_OFFSET 0x0000000Elu
3419#define CMTB_STAT_R_OFFSET 0x00000014lu
3420#define CMTB_STAT_W_OFFSET 0x00000014lu
3421#define CMTB_STAT_G_OFFSET 0x00000014lu
3422
3423/* Asynchronous Packet Receive Buffer (APRB) Address Offsets */
3424
3425#define APRB_STRIDE 0x00000400lu
3426
3427#define APRB_DST_OFFSET 0x00000000lu
3428#define APRB_LEN_OFFSET 0x00000002lu
3429#define APRB_SRC_OFFSET 0x00000004lu
3430#define APRB_DATA_OFFSET 0x00000006lu
3431
3432/* Asynchronous Packet Transmit Buffer (APTB) Address Offsets */
3433
3434#define APTB_PRIO_OFFSET 0x00000000lu
3435#define APTB_DST_OFFSET 0x00000002lu
3436#define APTB_LEN_OFFSET 0x00000004lu
3437#define APTB_SRC_OFFSET 0x00000006lu
3438#define APTB_DATA_OFFSET 0x00000008lu
3439
3440/* Remote Read Buffer (RRDB) Address Offsets */
3441
3442#define RRDB_WADDR_OFFSET 0x00000100lu
3443#define RRDB_WLEN_OFFSET 0x00000101lu
3444
3445/* **************** */
3446/* MXVR Macros */
3447/* **************** */
3448
3449/* MXVR_CONFIG Macros */
3450
3451#define SET_MSB(x) ( ( (x) & 0xF ) << 9)
3452
3453/* MXVR_INT_STAT_1 Macros */
3454
3455#define DONEX(x) (0x00000002 << (4 * (x)))
3456#define HDONEX(x) (0x00000001 << (4 * (x)))
3457
3458/* MXVR_INT_EN_1 Macros */
3459
3460#define DONEENX(x) (0x00000002 << (4 * (x)))
3461#define HDONEENX(x) (0x00000001 << (4 * (x)))
3462
3463/* MXVR_CDRPLL_CTL Macros */
3464
3465#define SET_CDRSHPSEL(x) ( ( (x) & 0x3F ) << 16)
3466
3467/* MXVR_FMPLL_CTL Macros */
3468
3469#define SET_CDRCPSEL(x) ( ( (x) & 0xFF ) << 24)
3470#define SET_FMCPSEL(x) ( ( (x) & 0xFF ) << 24)
3471
3472#endif /* _DEF_BF549_H */
diff --git a/include/asm-blackfin/mach-bf548/defBF54x_base.h b/include/asm-blackfin/mach-bf548/defBF54x_base.h
new file mode 100644
index 000000000000..a1b200fe6a1f
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/defBF54x_base.h
@@ -0,0 +1,4902 @@
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
51/* System Reset and Interrupt Controller (0xFFC00100 - 0xFFC00104) */
52
53#define SWRST 0xffc00100 /* Software Reset Register */
54#define SYSCR 0xffc00104 /* System Configuration register */
55
56/* SIC Registers */
57
58#define SIC_IMASK0 0xffc0010c /* System Interrupt Mask Register 0 */
59#define SIC_IMASK1 0xffc00110 /* System Interrupt Mask Register 1 */
60#define SIC_IMASK2 0xffc00114 /* System Interrupt Mask Register 2 */
61#define SIC_ISR0 0xffc00118 /* System Interrupt Status Register 0 */
62#define SIC_ISR1 0xffc0011c /* System Interrupt Status Register 1 */
63#define SIC_ISR2 0xffc00120 /* System Interrupt Status Register 2 */
64#define SIC_IWR0 0xffc00124 /* System Interrupt Wakeup Register 0 */
65#define SIC_IWR1 0xffc00128 /* System Interrupt Wakeup Register 1 */
66#define SIC_IWR2 0xffc0012c /* System Interrupt Wakeup Register 2 */
67#define SIC_IAR0 0xffc00130 /* System Interrupt Assignment Register 0 */
68#define SIC_IAR1 0xffc00134 /* System Interrupt Assignment Register 1 */
69#define SIC_IAR2 0xffc00138 /* System Interrupt Assignment Register 2 */
70#define SIC_IAR3 0xffc0013c /* System Interrupt Assignment Register 3 */
71#define SIC_IAR4 0xffc00140 /* System Interrupt Assignment Register 4 */
72#define SIC_IAR5 0xffc00144 /* System Interrupt Assignment Register 5 */
73#define SIC_IAR6 0xffc00148 /* System Interrupt Assignment Register 6 */
74#define SIC_IAR7 0xffc0014c /* System Interrupt Assignment Register 7 */
75#define SIC_IAR8 0xffc00150 /* System Interrupt Assignment Register 8 */
76#define SIC_IAR9 0xffc00154 /* System Interrupt Assignment Register 9 */
77#define SIC_IAR10 0xffc00158 /* System Interrupt Assignment Register 10 */
78#define SIC_IAR11 0xffc0015c /* System Interrupt Assignment Register 11 */
79
80/* Watchdog Timer Registers */
81
82#define WDOG_CTL 0xffc00200 /* Watchdog Control Register */
83#define WDOG_CNT 0xffc00204 /* Watchdog Count Register */
84#define WDOG_STAT 0xffc00208 /* Watchdog Status Register */
85
86/* RTC Registers */
87
88#define RTC_STAT 0xffc00300 /* RTC Status Register */
89#define RTC_ICTL 0xffc00304 /* RTC Interrupt Control Register */
90#define RTC_ISTAT 0xffc00308 /* RTC Interrupt Status Register */
91#define RTC_SWCNT 0xffc0030c /* RTC Stopwatch Count Register */
92#define RTC_ALARM 0xffc00310 /* RTC Alarm Register */
93#define RTC_PREN 0xffc00314 /* RTC Prescaler Enable Register */
94
95/* UART0 Registers */
96
97#define UART0_DLL 0xffc00400 /* Divisor Latch Low Byte */
98#define UART0_DLH 0xffc00404 /* Divisor Latch High Byte */
99#define UART0_GCTL 0xffc00408 /* Global Control Register */
100#define UART0_LCR 0xffc0040c /* Line Control Register */
101#define UART0_MCR 0xffc00410 /* Modem Control Register */
102#define UART0_LSR 0xffc00414 /* Line Status Register */
103#define UART0_MSR 0xffc00418 /* Modem Status Register */
104#define UART0_SCR 0xffc0041c /* Scratch Register */
105#define UART0_IER_SET 0xffc00420 /* Interrupt Enable Register Set */
106#define UART0_IER_CLEAR 0xffc00424 /* Interrupt Enable Register Clear */
107#define UART0_THR 0xffc00428 /* Transmit Hold Register */
108#define UART0_RBR 0xffc0042c /* Receive Buffer Register */
109
110/* SPI0 Registers */
111
112#define SPI0_CTL 0xffc00500 /* SPI0 Control Register */
113#define SPI0_FLG 0xffc00504 /* SPI0 Flag Register */
114#define SPI0_STAT 0xffc00508 /* SPI0 Status Register */
115#define SPI0_TDBR 0xffc0050c /* SPI0 Transmit Data Buffer Register */
116#define SPI0_RDBR 0xffc00510 /* SPI0 Receive Data Buffer Register */
117#define SPI0_BAUD 0xffc00514 /* SPI0 Baud Rate Register */
118#define SPI0_SHADOW 0xffc00518 /* SPI0 Receive Data Buffer Shadow Register */
119
120/* Timer Group of 3 registers are not defined in the shared file because they are not available on the ADSP-BF542 processor */
121
122/* Two Wire Interface Registers (TWI0) */
123
124#define TWI0_CLKDIV 0xffc00700 /* Clock Divider Register */
125#define TWI0_CONTROL 0xffc00704 /* TWI Control Register */
126#define TWI0_SLAVE_CTRL 0xffc00708 /* TWI Slave Mode Control Register */
127#define TWI0_SLAVE_STAT 0xffc0070c /* TWI Slave Mode Status Register */
128#define TWI0_SLAVE_ADDR 0xffc00710 /* TWI Slave Mode Address Register */
129#define TWI0_MASTER_CTRL 0xffc00714 /* TWI Master Mode Control Register */
130#define TWI0_MASTER_STAT 0xffc00718 /* TWI Master Mode Status Register */
131#define TWI0_MASTER_ADDR 0xffc0071c /* TWI Master Mode Address Register */
132#define TWI0_INT_STAT 0xffc00720 /* TWI Interrupt Status Register */
133#define TWI0_INT_MASK 0xffc00724 /* TWI Interrupt Mask Register */
134#define TWI0_FIFO_CTRL 0xffc00728 /* TWI FIFO Control Register */
135#define TWI0_FIFO_STAT 0xffc0072c /* TWI FIFO Status Register */
136#define TWI0_XMT_DATA8 0xffc00780 /* TWI FIFO Transmit Data Single Byte Register */
137#define TWI0_XMT_DATA16 0xffc00784 /* TWI FIFO Transmit Data Double Byte Register */
138#define TWI0_RCV_DATA8 0xffc00788 /* TWI FIFO Receive Data Single Byte Register */
139#define TWI0_RCV_DATA16 0xffc0078c /* TWI FIFO Receive Data Double Byte Register */
140
141/* SPORT0 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 processors */
142
143/* SPORT1 Registers */
144
145#define SPORT1_TCR1 0xffc00900 /* SPORT1 Transmit Configuration 1 Register */
146#define SPORT1_TCR2 0xffc00904 /* SPORT1 Transmit Configuration 2 Register */
147#define SPORT1_TCLKDIV 0xffc00908 /* SPORT1 Transmit Serial Clock Divider Register */
148#define SPORT1_TFSDIV 0xffc0090c /* SPORT1 Transmit Frame Sync Divider Register */
149#define SPORT1_TX 0xffc00910 /* SPORT1 Transmit Data Register */
150#define SPORT1_RX 0xffc00918 /* SPORT1 Receive Data Register */
151#define SPORT1_RCR1 0xffc00920 /* SPORT1 Receive Configuration 1 Register */
152#define SPORT1_RCR2 0xffc00924 /* SPORT1 Receive Configuration 2 Register */
153#define SPORT1_RCLKDIV 0xffc00928 /* SPORT1 Receive Serial Clock Divider Register */
154#define SPORT1_RFSDIV 0xffc0092c /* SPORT1 Receive Frame Sync Divider Register */
155#define SPORT1_STAT 0xffc00930 /* SPORT1 Status Register */
156#define SPORT1_CHNL 0xffc00934 /* SPORT1 Current Channel Register */
157#define SPORT1_MCMC1 0xffc00938 /* SPORT1 Multi channel Configuration Register 1 */
158#define SPORT1_MCMC2 0xffc0093c /* SPORT1 Multi channel Configuration Register 2 */
159#define SPORT1_MTCS0 0xffc00940 /* SPORT1 Multi channel Transmit Select Register 0 */
160#define SPORT1_MTCS1 0xffc00944 /* SPORT1 Multi channel Transmit Select Register 1 */
161#define SPORT1_MTCS2 0xffc00948 /* SPORT1 Multi channel Transmit Select Register 2 */
162#define SPORT1_MTCS3 0xffc0094c /* SPORT1 Multi channel Transmit Select Register 3 */
163#define SPORT1_MRCS0 0xffc00950 /* SPORT1 Multi channel Receive Select Register 0 */
164#define SPORT1_MRCS1 0xffc00954 /* SPORT1 Multi channel Receive Select Register 1 */
165#define SPORT1_MRCS2 0xffc00958 /* SPORT1 Multi channel Receive Select Register 2 */
166#define SPORT1_MRCS3 0xffc0095c /* SPORT1 Multi channel Receive Select Register 3 */
167
168/* Asynchronous Memory Control Registers */
169
170#define EBIU_AMGCTL 0xffc00a00 /* Asynchronous Memory Global Control Register */
171#define EBIU_AMBCTL0 0xffc00a04 /* Asynchronous Memory Bank Control Register */
172#define EBIU_AMBCTL1 0xffc00a08 /* Asynchronous Memory Bank Control Register */
173#define EBIU_MBSCTL 0xffc00a0c /* Asynchronous Memory Bank Select Control Register */
174#define EBIU_ARBSTAT 0xffc00a10 /* Asynchronous Memory Arbiter Status Register */
175#define EBIU_MODE 0xffc00a14 /* Asynchronous Mode Control Register */
176#define EBIU_FCTL 0xffc00a18 /* Asynchronous Memory Flash Control Register */
177
178/* DDR Memory Control Registers */
179
180#define EBIU_DDRCTL0 0xffc00a20 /* DDR Memory Control 0 Register */
181#define EBIU_DDRCTL1 0xffc00a24 /* DDR Memory Control 1 Register */
182#define EBIU_DDRCTL2 0xffc00a28 /* DDR Memory Control 2 Register */
183#define EBIU_DDRCTL3 0xffc00a2c /* DDR Memory Control 3 Register */
184#define EBIU_DDRQUE 0xffc00a30 /* DDR Queue Configuration Register */
185#define EBIU_ERRADD 0xffc00a34 /* DDR Error Address Register */
186#define EBIU_ERRMST 0xffc00a38 /* DDR Error Master Register */
187#define EBIU_RSTCTL 0xffc00a3c /* DDR Reset Control Register */
188
189/* DDR BankRead and Write Count Registers */
190
191#define EBIU_DDRBRC0 0xffc00a60 /* DDR Bank0 Read Count Register */
192#define EBIU_DDRBRC1 0xffc00a64 /* DDR Bank1 Read Count Register */
193#define EBIU_DDRBRC2 0xffc00a68 /* DDR Bank2 Read Count Register */
194#define EBIU_DDRBRC3 0xffc00a6c /* DDR Bank3 Read Count Register */
195#define EBIU_DDRBRC4 0xffc00a70 /* DDR Bank4 Read Count Register */
196#define EBIU_DDRBRC5 0xffc00a74 /* DDR Bank5 Read Count Register */
197#define EBIU_DDRBRC6 0xffc00a78 /* DDR Bank6 Read Count Register */
198#define EBIU_DDRBRC7 0xffc00a7c /* DDR Bank7 Read Count Register */
199#define EBIU_DDRBWC0 0xffc00a80 /* DDR Bank0 Write Count Register */
200#define EBIU_DDRBWC1 0xffc00a84 /* DDR Bank1 Write Count Register */
201#define EBIU_DDRBWC2 0xffc00a88 /* DDR Bank2 Write Count Register */
202#define EBIU_DDRBWC3 0xffc00a8c /* DDR Bank3 Write Count Register */
203#define EBIU_DDRBWC4 0xffc00a90 /* DDR Bank4 Write Count Register */
204#define EBIU_DDRBWC5 0xffc00a94 /* DDR Bank5 Write Count Register */
205#define EBIU_DDRBWC6 0xffc00a98 /* DDR Bank6 Write Count Register */
206#define EBIU_DDRBWC7 0xffc00a9c /* DDR Bank7 Write Count Register */
207#define EBIU_DDRACCT 0xffc00aa0 /* DDR Activation Count Register */
208#define EBIU_DDRTACT 0xffc00aa8 /* DDR Turn Around Count Register */
209#define EBIU_DDRARCT 0xffc00aac /* DDR Auto-refresh Count Register */
210#define EBIU_DDRGC0 0xffc00ab0 /* DDR Grant Count 0 Register */
211#define EBIU_DDRGC1 0xffc00ab4 /* DDR Grant Count 1 Register */
212#define EBIU_DDRGC2 0xffc00ab8 /* DDR Grant Count 2 Register */
213#define EBIU_DDRGC3 0xffc00abc /* DDR Grant Count 3 Register */
214#define EBIU_DDRMCEN 0xffc00ac0 /* DDR Metrics Counter Enable Register */
215#define EBIU_DDRMCCL 0xffc00ac4 /* DDR Metrics Counter Clear Register */
216
217/* DMAC0 Registers */
218
219#define DMAC0_TCPER 0xffc00b0c /* DMA Controller 0 Traffic Control Periods Register */
220#define DMAC0_TCCNT 0xffc00b10 /* DMA Controller 0 Current Counts Register */
221
222/* DMA Channel 0 Registers */
223
224#define DMA0_NEXT_DESC_PTR 0xffc00c00 /* DMA Channel 0 Next Descriptor Pointer Register */
225#define DMA0_START_ADDR 0xffc00c04 /* DMA Channel 0 Start Address Register */
226#define DMA0_CONFIG 0xffc00c08 /* DMA Channel 0 Configuration Register */
227#define DMA0_X_COUNT 0xffc00c10 /* DMA Channel 0 X Count Register */
228#define DMA0_X_MODIFY 0xffc00c14 /* DMA Channel 0 X Modify Register */
229#define DMA0_Y_COUNT 0xffc00c18 /* DMA Channel 0 Y Count Register */
230#define DMA0_Y_MODIFY 0xffc00c1c /* DMA Channel 0 Y Modify Register */
231#define DMA0_CURR_DESC_PTR 0xffc00c20 /* DMA Channel 0 Current Descriptor Pointer Register */
232#define DMA0_CURR_ADDR 0xffc00c24 /* DMA Channel 0 Current Address Register */
233#define DMA0_IRQ_STATUS 0xffc00c28 /* DMA Channel 0 Interrupt/Status Register */
234#define DMA0_PERIPHERAL_MAP 0xffc00c2c /* DMA Channel 0 Peripheral Map Register */
235#define DMA0_CURR_X_COUNT 0xffc00c30 /* DMA Channel 0 Current X Count Register */
236#define DMA0_CURR_Y_COUNT 0xffc00c38 /* DMA Channel 0 Current Y Count Register */
237
238/* DMA Channel 1 Registers */
239
240#define DMA1_NEXT_DESC_PTR 0xffc00c40 /* DMA Channel 1 Next Descriptor Pointer Register */
241#define DMA1_START_ADDR 0xffc00c44 /* DMA Channel 1 Start Address Register */
242#define DMA1_CONFIG 0xffc00c48 /* DMA Channel 1 Configuration Register */
243#define DMA1_X_COUNT 0xffc00c50 /* DMA Channel 1 X Count Register */
244#define DMA1_X_MODIFY 0xffc00c54 /* DMA Channel 1 X Modify Register */
245#define DMA1_Y_COUNT 0xffc00c58 /* DMA Channel 1 Y Count Register */
246#define DMA1_Y_MODIFY 0xffc00c5c /* DMA Channel 1 Y Modify Register */
247#define DMA1_CURR_DESC_PTR 0xffc00c60 /* DMA Channel 1 Current Descriptor Pointer Register */
248#define DMA1_CURR_ADDR 0xffc00c64 /* DMA Channel 1 Current Address Register */
249#define DMA1_IRQ_STATUS 0xffc00c68 /* DMA Channel 1 Interrupt/Status Register */
250#define DMA1_PERIPHERAL_MAP 0xffc00c6c /* DMA Channel 1 Peripheral Map Register */
251#define DMA1_CURR_X_COUNT 0xffc00c70 /* DMA Channel 1 Current X Count Register */
252#define DMA1_CURR_Y_COUNT 0xffc00c78 /* DMA Channel 1 Current Y Count Register */
253
254/* DMA Channel 2 Registers */
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/* DMA Channel 3 Registers */
271
272#define DMA3_NEXT_DESC_PTR 0xffc00cc0 /* DMA Channel 3 Next Descriptor Pointer Register */
273#define DMA3_START_ADDR 0xffc00cc4 /* DMA Channel 3 Start Address Register */
274#define DMA3_CONFIG 0xffc00cc8 /* DMA Channel 3 Configuration Register */
275#define DMA3_X_COUNT 0xffc00cd0 /* DMA Channel 3 X Count Register */
276#define DMA3_X_MODIFY 0xffc00cd4 /* DMA Channel 3 X Modify Register */
277#define DMA3_Y_COUNT 0xffc00cd8 /* DMA Channel 3 Y Count Register */
278#define DMA3_Y_MODIFY 0xffc00cdc /* DMA Channel 3 Y Modify Register */
279#define DMA3_CURR_DESC_PTR 0xffc00ce0 /* DMA Channel 3 Current Descriptor Pointer Register */
280#define DMA3_CURR_ADDR 0xffc00ce4 /* DMA Channel 3 Current Address Register */
281#define DMA3_IRQ_STATUS 0xffc00ce8 /* DMA Channel 3 Interrupt/Status Register */
282#define DMA3_PERIPHERAL_MAP 0xffc00cec /* DMA Channel 3 Peripheral Map Register */
283#define DMA3_CURR_X_COUNT 0xffc00cf0 /* DMA Channel 3 Current X Count Register */
284#define DMA3_CURR_Y_COUNT 0xffc00cf8 /* DMA Channel 3 Current Y Count Register */
285
286/* DMA Channel 4 Registers */
287
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_CONFIG 0xffc00d08 /* DMA Channel 4 Configuration Register */
291#define DMA4_X_COUNT 0xffc00d10 /* DMA Channel 4 X Count Register */
292#define DMA4_X_MODIFY 0xffc00d14 /* DMA Channel 4 X Modify Register */
293#define DMA4_Y_COUNT 0xffc00d18 /* DMA Channel 4 Y Count Register */
294#define DMA4_Y_MODIFY 0xffc00d1c /* DMA Channel 4 Y Modify Register */
295#define DMA4_CURR_DESC_PTR 0xffc00d20 /* DMA Channel 4 Current Descriptor Pointer Register */
296#define DMA4_CURR_ADDR 0xffc00d24 /* DMA Channel 4 Current Address Register */
297#define DMA4_IRQ_STATUS 0xffc00d28 /* DMA Channel 4 Interrupt/Status Register */
298#define DMA4_PERIPHERAL_MAP 0xffc00d2c /* DMA Channel 4 Peripheral Map Register */
299#define DMA4_CURR_X_COUNT 0xffc00d30 /* DMA Channel 4 Current X Count Register */
300#define DMA4_CURR_Y_COUNT 0xffc00d38 /* DMA Channel 4 Current Y Count Register */
301
302/* DMA Channel 5 Registers */
303
304#define DMA5_NEXT_DESC_PTR 0xffc00d40 /* DMA Channel 5 Next Descriptor Pointer Register */
305#define DMA5_START_ADDR 0xffc00d44 /* DMA Channel 5 Start Address Register */
306#define DMA5_CONFIG 0xffc00d48 /* DMA Channel 5 Configuration Register */
307#define DMA5_X_COUNT 0xffc00d50 /* DMA Channel 5 X Count Register */
308#define DMA5_X_MODIFY 0xffc00d54 /* DMA Channel 5 X Modify Register */
309#define DMA5_Y_COUNT 0xffc00d58 /* DMA Channel 5 Y Count Register */
310#define DMA5_Y_MODIFY 0xffc00d5c /* DMA Channel 5 Y Modify Register */
311#define DMA5_CURR_DESC_PTR 0xffc00d60 /* DMA Channel 5 Current Descriptor Pointer Register */
312#define DMA5_CURR_ADDR 0xffc00d64 /* DMA Channel 5 Current Address Register */
313#define DMA5_IRQ_STATUS 0xffc00d68 /* DMA Channel 5 Interrupt/Status Register */
314#define DMA5_PERIPHERAL_MAP 0xffc00d6c /* DMA Channel 5 Peripheral Map Register */
315#define DMA5_CURR_X_COUNT 0xffc00d70 /* DMA Channel 5 Current X Count Register */
316#define DMA5_CURR_Y_COUNT 0xffc00d78 /* DMA Channel 5 Current Y Count Register */
317
318/* DMA Channel 6 Registers */
319
320#define DMA6_NEXT_DESC_PTR 0xffc00d80 /* DMA Channel 6 Next Descriptor Pointer Register */
321#define DMA6_START_ADDR 0xffc00d84 /* DMA Channel 6 Start Address Register */
322#define DMA6_CONFIG 0xffc00d88 /* DMA Channel 6 Configuration Register */
323#define DMA6_X_COUNT 0xffc00d90 /* DMA Channel 6 X Count Register */
324#define DMA6_X_MODIFY 0xffc00d94 /* DMA Channel 6 X Modify Register */
325#define DMA6_Y_COUNT 0xffc00d98 /* DMA Channel 6 Y Count Register */
326#define DMA6_Y_MODIFY 0xffc00d9c /* DMA Channel 6 Y Modify Register */
327#define DMA6_CURR_DESC_PTR 0xffc00da0 /* DMA Channel 6 Current Descriptor Pointer Register */
328#define DMA6_CURR_ADDR 0xffc00da4 /* DMA Channel 6 Current Address Register */
329#define DMA6_IRQ_STATUS 0xffc00da8 /* DMA Channel 6 Interrupt/Status Register */
330#define DMA6_PERIPHERAL_MAP 0xffc00dac /* DMA Channel 6 Peripheral Map Register */
331#define DMA6_CURR_X_COUNT 0xffc00db0 /* DMA Channel 6 Current X Count Register */
332#define DMA6_CURR_Y_COUNT 0xffc00db8 /* DMA Channel 6 Current Y Count Register */
333
334/* DMA Channel 7 Registers */
335
336#define DMA7_NEXT_DESC_PTR 0xffc00dc0 /* DMA Channel 7 Next Descriptor Pointer Register */
337#define DMA7_START_ADDR 0xffc00dc4 /* DMA Channel 7 Start Address Register */
338#define DMA7_CONFIG 0xffc00dc8 /* DMA Channel 7 Configuration Register */
339#define DMA7_X_COUNT 0xffc00dd0 /* DMA Channel 7 X Count Register */
340#define DMA7_X_MODIFY 0xffc00dd4 /* DMA Channel 7 X Modify Register */
341#define DMA7_Y_COUNT 0xffc00dd8 /* DMA Channel 7 Y Count Register */
342#define DMA7_Y_MODIFY 0xffc00ddc /* DMA Channel 7 Y Modify Register */
343#define DMA7_CURR_DESC_PTR 0xffc00de0 /* DMA Channel 7 Current Descriptor Pointer Register */
344#define DMA7_CURR_ADDR 0xffc00de4 /* DMA Channel 7 Current Address Register */
345#define DMA7_IRQ_STATUS 0xffc00de8 /* DMA Channel 7 Interrupt/Status Register */
346#define DMA7_PERIPHERAL_MAP 0xffc00dec /* DMA Channel 7 Peripheral Map Register */
347#define DMA7_CURR_X_COUNT 0xffc00df0 /* DMA Channel 7 Current X Count Register */
348#define DMA7_CURR_Y_COUNT 0xffc00df8 /* DMA Channel 7 Current Y Count Register */
349
350/* DMA Channel 8 Registers */
351
352#define DMA8_NEXT_DESC_PTR 0xffc00e00 /* DMA Channel 8 Next Descriptor Pointer Register */
353#define DMA8_START_ADDR 0xffc00e04 /* DMA Channel 8 Start Address Register */
354#define DMA8_CONFIG 0xffc00e08 /* DMA Channel 8 Configuration Register */
355#define DMA8_X_COUNT 0xffc00e10 /* DMA Channel 8 X Count Register */
356#define DMA8_X_MODIFY 0xffc00e14 /* DMA Channel 8 X Modify Register */
357#define DMA8_Y_COUNT 0xffc00e18 /* DMA Channel 8 Y Count Register */
358#define DMA8_Y_MODIFY 0xffc00e1c /* DMA Channel 8 Y Modify Register */
359#define DMA8_CURR_DESC_PTR 0xffc00e20 /* DMA Channel 8 Current Descriptor Pointer Register */
360#define DMA8_CURR_ADDR 0xffc00e24 /* DMA Channel 8 Current Address Register */
361#define DMA8_IRQ_STATUS 0xffc00e28 /* DMA Channel 8 Interrupt/Status Register */
362#define DMA8_PERIPHERAL_MAP 0xffc00e2c /* DMA Channel 8 Peripheral Map Register */
363#define DMA8_CURR_X_COUNT 0xffc00e30 /* DMA Channel 8 Current X Count Register */
364#define DMA8_CURR_Y_COUNT 0xffc00e38 /* DMA Channel 8 Current Y Count Register */
365
366/* DMA Channel 9 Registers */
367
368#define DMA9_NEXT_DESC_PTR 0xffc00e40 /* DMA Channel 9 Next Descriptor Pointer Register */
369#define DMA9_START_ADDR 0xffc00e44 /* DMA Channel 9 Start Address Register */
370#define DMA9_CONFIG 0xffc00e48 /* DMA Channel 9 Configuration Register */
371#define DMA9_X_COUNT 0xffc00e50 /* DMA Channel 9 X Count Register */
372#define DMA9_X_MODIFY 0xffc00e54 /* DMA Channel 9 X Modify Register */
373#define DMA9_Y_COUNT 0xffc00e58 /* DMA Channel 9 Y Count Register */
374#define DMA9_Y_MODIFY 0xffc00e5c /* DMA Channel 9 Y Modify Register */
375#define DMA9_CURR_DESC_PTR 0xffc00e60 /* DMA Channel 9 Current Descriptor Pointer Register */
376#define DMA9_CURR_ADDR 0xffc00e64 /* DMA Channel 9 Current Address Register */
377#define DMA9_IRQ_STATUS 0xffc00e68 /* DMA Channel 9 Interrupt/Status Register */
378#define DMA9_PERIPHERAL_MAP 0xffc00e6c /* DMA Channel 9 Peripheral Map Register */
379#define DMA9_CURR_X_COUNT 0xffc00e70 /* DMA Channel 9 Current X Count Register */
380#define DMA9_CURR_Y_COUNT 0xffc00e78 /* DMA Channel 9 Current Y Count Register */
381
382/* DMA Channel 10 Registers */
383
384#define DMA10_NEXT_DESC_PTR 0xffc00e80 /* DMA Channel 10 Next Descriptor Pointer Register */
385#define DMA10_START_ADDR 0xffc00e84 /* DMA Channel 10 Start Address Register */
386#define DMA10_CONFIG 0xffc00e88 /* DMA Channel 10 Configuration Register */
387#define DMA10_X_COUNT 0xffc00e90 /* DMA Channel 10 X Count Register */
388#define DMA10_X_MODIFY 0xffc00e94 /* DMA Channel 10 X Modify Register */
389#define DMA10_Y_COUNT 0xffc00e98 /* DMA Channel 10 Y Count Register */
390#define DMA10_Y_MODIFY 0xffc00e9c /* DMA Channel 10 Y Modify Register */
391#define DMA10_CURR_DESC_PTR 0xffc00ea0 /* DMA Channel 10 Current Descriptor Pointer Register */
392#define DMA10_CURR_ADDR 0xffc00ea4 /* DMA Channel 10 Current Address Register */
393#define DMA10_IRQ_STATUS 0xffc00ea8 /* DMA Channel 10 Interrupt/Status Register */
394#define DMA10_PERIPHERAL_MAP 0xffc00eac /* DMA Channel 10 Peripheral Map Register */
395#define DMA10_CURR_X_COUNT 0xffc00eb0 /* DMA Channel 10 Current X Count Register */
396#define DMA10_CURR_Y_COUNT 0xffc00eb8 /* DMA Channel 10 Current Y Count Register */
397
398/* DMA Channel 11 Registers */
399
400#define DMA11_NEXT_DESC_PTR 0xffc00ec0 /* DMA Channel 11 Next Descriptor Pointer Register */
401#define DMA11_START_ADDR 0xffc00ec4 /* DMA Channel 11 Start Address Register */
402#define DMA11_CONFIG 0xffc00ec8 /* DMA Channel 11 Configuration Register */
403#define DMA11_X_COUNT 0xffc00ed0 /* DMA Channel 11 X Count Register */
404#define DMA11_X_MODIFY 0xffc00ed4 /* DMA Channel 11 X Modify Register */
405#define DMA11_Y_COUNT 0xffc00ed8 /* DMA Channel 11 Y Count Register */
406#define DMA11_Y_MODIFY 0xffc00edc /* DMA Channel 11 Y Modify Register */
407#define DMA11_CURR_DESC_PTR 0xffc00ee0 /* DMA Channel 11 Current Descriptor Pointer Register */
408#define DMA11_CURR_ADDR 0xffc00ee4 /* DMA Channel 11 Current Address Register */
409#define DMA11_IRQ_STATUS 0xffc00ee8 /* DMA Channel 11 Interrupt/Status Register */
410#define DMA11_PERIPHERAL_MAP 0xffc00eec /* DMA Channel 11 Peripheral Map Register */
411#define DMA11_CURR_X_COUNT 0xffc00ef0 /* DMA Channel 11 Current X Count Register */
412#define DMA11_CURR_Y_COUNT 0xffc00ef8 /* DMA Channel 11 Current Y Count Register */
413
414/* MDMA Stream 0 Registers */
415
416#define MDMA_D0_NEXT_DESC_PTR 0xffc00f00 /* Memory DMA Stream 0 Destination Next Descriptor Pointer Register */
417#define MDMA_D0_START_ADDR 0xffc00f04 /* Memory DMA Stream 0 Destination Start Address Register */
418#define MDMA_D0_CONFIG 0xffc00f08 /* Memory DMA Stream 0 Destination Configuration Register */
419#define MDMA_D0_X_COUNT 0xffc00f10 /* Memory DMA Stream 0 Destination X Count Register */
420#define MDMA_D0_X_MODIFY 0xffc00f14 /* Memory DMA Stream 0 Destination X Modify Register */
421#define MDMA_D0_Y_COUNT 0xffc00f18 /* Memory DMA Stream 0 Destination Y Count Register */
422#define MDMA_D0_Y_MODIFY 0xffc00f1c /* Memory DMA Stream 0 Destination Y Modify Register */
423#define MDMA_D0_CURR_DESC_PTR 0xffc00f20 /* Memory DMA Stream 0 Destination Current Descriptor Pointer Register */
424#define MDMA_D0_CURR_ADDR 0xffc00f24 /* Memory DMA Stream 0 Destination Current Address Register */
425#define MDMA_D0_IRQ_STATUS 0xffc00f28 /* Memory DMA Stream 0 Destination Interrupt/Status Register */
426#define MDMA_D0_PERIPHERAL_MAP 0xffc00f2c /* Memory DMA Stream 0 Destination Peripheral Map Register */
427#define MDMA_D0_CURR_X_COUNT 0xffc00f30 /* Memory DMA Stream 0 Destination Current X Count Register */
428#define MDMA_D0_CURR_Y_COUNT 0xffc00f38 /* Memory DMA Stream 0 Destination Current Y Count Register */
429#define MDMA_S0_NEXT_DESC_PTR 0xffc00f40 /* Memory DMA Stream 0 Source Next Descriptor Pointer Register */
430#define MDMA_S0_START_ADDR 0xffc00f44 /* Memory DMA Stream 0 Source Start Address Register */
431#define MDMA_S0_CONFIG 0xffc00f48 /* Memory DMA Stream 0 Source Configuration Register */
432#define MDMA_S0_X_COUNT 0xffc00f50 /* Memory DMA Stream 0 Source X Count Register */
433#define MDMA_S0_X_MODIFY 0xffc00f54 /* Memory DMA Stream 0 Source X Modify Register */
434#define MDMA_S0_Y_COUNT 0xffc00f58 /* Memory DMA Stream 0 Source Y Count Register */
435#define MDMA_S0_Y_MODIFY 0xffc00f5c /* Memory DMA Stream 0 Source Y Modify Register */
436#define MDMA_S0_CURR_DESC_PTR 0xffc00f60 /* Memory DMA Stream 0 Source Current Descriptor Pointer Register */
437#define MDMA_S0_CURR_ADDR 0xffc00f64 /* Memory DMA Stream 0 Source Current Address Register */
438#define MDMA_S0_IRQ_STATUS 0xffc00f68 /* Memory DMA Stream 0 Source Interrupt/Status Register */
439#define MDMA_S0_PERIPHERAL_MAP 0xffc00f6c /* Memory DMA Stream 0 Source Peripheral Map Register */
440#define MDMA_S0_CURR_X_COUNT 0xffc00f70 /* Memory DMA Stream 0 Source Current X Count Register */
441#define MDMA_S0_CURR_Y_COUNT 0xffc00f78 /* Memory DMA Stream 0 Source Current Y Count Register */
442
443/* MDMA Stream 1 Registers */
444
445#define MDMA_D1_NEXT_DESC_PTR 0xffc00f80 /* Memory DMA Stream 1 Destination Next Descriptor Pointer Register */
446#define MDMA_D1_START_ADDR 0xffc00f84 /* Memory DMA Stream 1 Destination Start Address Register */
447#define MDMA_D1_CONFIG 0xffc00f88 /* Memory DMA Stream 1 Destination Configuration Register */
448#define MDMA_D1_X_COUNT 0xffc00f90 /* Memory DMA Stream 1 Destination X Count Register */
449#define MDMA_D1_X_MODIFY 0xffc00f94 /* Memory DMA Stream 1 Destination X Modify Register */
450#define MDMA_D1_Y_COUNT 0xffc00f98 /* Memory DMA Stream 1 Destination Y Count Register */
451#define MDMA_D1_Y_MODIFY 0xffc00f9c /* Memory DMA Stream 1 Destination Y Modify Register */
452#define MDMA_D1_CURR_DESC_PTR 0xffc00fa0 /* Memory DMA Stream 1 Destination Current Descriptor Pointer Register */
453#define MDMA_D1_CURR_ADDR 0xffc00fa4 /* Memory DMA Stream 1 Destination Current Address Register */
454#define MDMA_D1_IRQ_STATUS 0xffc00fa8 /* Memory DMA Stream 1 Destination Interrupt/Status Register */
455#define MDMA_D1_PERIPHERAL_MAP 0xffc00fac /* Memory DMA Stream 1 Destination Peripheral Map Register */
456#define MDMA_D1_CURR_X_COUNT 0xffc00fb0 /* Memory DMA Stream 1 Destination Current X Count Register */
457#define MDMA_D1_CURR_Y_COUNT 0xffc00fb8 /* Memory DMA Stream 1 Destination Current Y Count Register */
458#define MDMA_S1_NEXT_DESC_PTR 0xffc00fc0 /* Memory DMA Stream 1 Source Next Descriptor Pointer Register */
459#define MDMA_S1_START_ADDR 0xffc00fc4 /* Memory DMA Stream 1 Source Start Address Register */
460#define MDMA_S1_CONFIG 0xffc00fc8 /* Memory DMA Stream 1 Source Configuration Register */
461#define MDMA_S1_X_COUNT 0xffc00fd0 /* Memory DMA Stream 1 Source X Count Register */
462#define MDMA_S1_X_MODIFY 0xffc00fd4 /* Memory DMA Stream 1 Source X Modify Register */
463#define MDMA_S1_Y_COUNT 0xffc00fd8 /* Memory DMA Stream 1 Source Y Count Register */
464#define MDMA_S1_Y_MODIFY 0xffc00fdc /* Memory DMA Stream 1 Source Y Modify Register */
465#define MDMA_S1_CURR_DESC_PTR 0xffc00fe0 /* Memory DMA Stream 1 Source Current Descriptor Pointer Register */
466#define MDMA_S1_CURR_ADDR 0xffc00fe4 /* Memory DMA Stream 1 Source Current Address Register */
467#define MDMA_S1_IRQ_STATUS 0xffc00fe8 /* Memory DMA Stream 1 Source Interrupt/Status Register */
468#define MDMA_S1_PERIPHERAL_MAP 0xffc00fec /* Memory DMA Stream 1 Source Peripheral Map Register */
469#define MDMA_S1_CURR_X_COUNT 0xffc00ff0 /* Memory DMA Stream 1 Source Current X Count Register */
470#define MDMA_S1_CURR_Y_COUNT 0xffc00ff8 /* Memory DMA Stream 1 Source Current Y Count Register */
471
472/* UART3 Registers */
473
474#define UART3_DLL 0xffc03100 /* Divisor Latch Low Byte */
475#define UART3_DLH 0xffc03104 /* Divisor Latch High Byte */
476#define UART3_GCTL 0xffc03108 /* Global Control Register */
477#define UART3_LCR 0xffc0310c /* Line Control Register */
478#define UART3_MCR 0xffc03110 /* Modem Control Register */
479#define UART3_LSR 0xffc03114 /* Line Status Register */
480#define UART3_MSR 0xffc03118 /* Modem Status Register */
481#define UART3_SCR 0xffc0311c /* Scratch Register */
482#define UART3_IER_SET 0xffc03120 /* Interrupt Enable Register Set */
483#define UART3_IER_CLEAR 0xffc03124 /* Interrupt Enable Register Clear */
484#define UART3_THR 0xffc03128 /* Transmit Hold Register */
485#define UART3_RBR 0xffc0312c /* Receive Buffer Register */
486
487/* EPPI1 Registers */
488
489#define EPPI1_STATUS 0xffc01300 /* EPPI1 Status Register */
490#define EPPI1_HCOUNT 0xffc01304 /* EPPI1 Horizontal Transfer Count Register */
491#define EPPI1_HDELAY 0xffc01308 /* EPPI1 Horizontal Delay Count Register */
492#define EPPI1_VCOUNT 0xffc0130c /* EPPI1 Vertical Transfer Count Register */
493#define EPPI1_VDELAY 0xffc01310 /* EPPI1 Vertical Delay Count Register */
494#define EPPI1_FRAME 0xffc01314 /* EPPI1 Lines per Frame Register */
495#define EPPI1_LINE 0xffc01318 /* EPPI1 Samples per Line Register */
496#define EPPI1_CLKDIV 0xffc0131c /* EPPI1 Clock Divide Register */
497#define EPPI1_CONTROL 0xffc01320 /* EPPI1 Control Register */
498#define EPPI1_FS1W_HBL 0xffc01324 /* EPPI1 FS1 Width Register / EPPI1 Horizontal Blanking Samples Per Line Register */
499#define EPPI1_FS1P_AVPL 0xffc01328 /* EPPI1 FS1 Period Register / EPPI1 Active Video Samples Per Line Register */
500#define EPPI1_FS2W_LVB 0xffc0132c /* EPPI1 FS2 Width Register / EPPI1 Lines of Vertical Blanking Register */
501#define EPPI1_FS2P_LAVF 0xffc01330 /* EPPI1 FS2 Period Register/ EPPI1 Lines of Active Video Per Field Register */
502#define EPPI1_CLIP 0xffc01334 /* EPPI1 Clipping Register */
503
504/* Port Interrupt 0 Registers (32-bit) */
505
506#define PINT0_MASK_SET 0xffc01400 /* Pin Interrupt 0 Mask Set Register */
507#define PINT0_MASK_CLEAR 0xffc01404 /* Pin Interrupt 0 Mask Clear Register */
508#define PINT0_REQUEST 0xffc01408 /* Pin Interrupt 0 Interrupt Request Register */
509#define PINT0_ASSIGN 0xffc0140c /* Pin Interrupt 0 Port Assign Register */
510#define PINT0_EDGE_SET 0xffc01410 /* Pin Interrupt 0 Edge-sensitivity Set Register */
511#define PINT0_EDGE_CLEAR 0xffc01414 /* Pin Interrupt 0 Edge-sensitivity Clear Register */
512#define PINT0_INVERT_SET 0xffc01418 /* Pin Interrupt 0 Inversion Set Register */
513#define PINT0_INVERT_CLEAR 0xffc0141c /* Pin Interrupt 0 Inversion Clear Register */
514#define PINT0_PINSTATE 0xffc01420 /* Pin Interrupt 0 Pin Status Register */
515#define PINT0_LATCH 0xffc01424 /* Pin Interrupt 0 Latch Register */
516
517/* Port Interrupt 1 Registers (32-bit) */
518
519#define PINT1_MASK_SET 0xffc01430 /* Pin Interrupt 1 Mask Set Register */
520#define PINT1_MASK_CLEAR 0xffc01434 /* Pin Interrupt 1 Mask Clear Register */
521#define PINT1_REQUEST 0xffc01438 /* Pin Interrupt 1 Interrupt Request Register */
522#define PINT1_ASSIGN 0xffc0143c /* Pin Interrupt 1 Port Assign Register */
523#define PINT1_EDGE_SET 0xffc01440 /* Pin Interrupt 1 Edge-sensitivity Set Register */
524#define PINT1_EDGE_CLEAR 0xffc01444 /* Pin Interrupt 1 Edge-sensitivity Clear Register */
525#define PINT1_INVERT_SET 0xffc01448 /* Pin Interrupt 1 Inversion Set Register */
526#define PINT1_INVERT_CLEAR 0xffc0144c /* Pin Interrupt 1 Inversion Clear Register */
527#define PINT1_PINSTATE 0xffc01450 /* Pin Interrupt 1 Pin Status Register */
528#define PINT1_LATCH 0xffc01454 /* Pin Interrupt 1 Latch Register */
529
530/* Port Interrupt 2 Registers (32-bit) */
531
532#define PINT2_MASK_SET 0xffc01460 /* Pin Interrupt 2 Mask Set Register */
533#define PINT2_MASK_CLEAR 0xffc01464 /* Pin Interrupt 2 Mask Clear Register */
534#define PINT2_REQUEST 0xffc01468 /* Pin Interrupt 2 Interrupt Request Register */
535#define PINT2_ASSIGN 0xffc0146c /* Pin Interrupt 2 Port Assign Register */
536#define PINT2_EDGE_SET 0xffc01470 /* Pin Interrupt 2 Edge-sensitivity Set Register */
537#define PINT2_EDGE_CLEAR 0xffc01474 /* Pin Interrupt 2 Edge-sensitivity Clear Register */
538#define PINT2_INVERT_SET 0xffc01478 /* Pin Interrupt 2 Inversion Set Register */
539#define PINT2_INVERT_CLEAR 0xffc0147c /* Pin Interrupt 2 Inversion Clear Register */
540#define PINT2_PINSTATE 0xffc01480 /* Pin Interrupt 2 Pin Status Register */
541#define PINT2_LATCH 0xffc01484 /* Pin Interrupt 2 Latch Register */
542
543/* Port Interrupt 3 Registers (32-bit) */
544
545#define PINT3_MASK_SET 0xffc01490 /* Pin Interrupt 3 Mask Set Register */
546#define PINT3_MASK_CLEAR 0xffc01494 /* Pin Interrupt 3 Mask Clear Register */
547#define PINT3_REQUEST 0xffc01498 /* Pin Interrupt 3 Interrupt Request Register */
548#define PINT3_ASSIGN 0xffc0149c /* Pin Interrupt 3 Port Assign Register */
549#define PINT3_EDGE_SET 0xffc014a0 /* Pin Interrupt 3 Edge-sensitivity Set Register */
550#define PINT3_EDGE_CLEAR 0xffc014a4 /* Pin Interrupt 3 Edge-sensitivity Clear Register */
551#define PINT3_INVERT_SET 0xffc014a8 /* Pin Interrupt 3 Inversion Set Register */
552#define PINT3_INVERT_CLEAR 0xffc014ac /* Pin Interrupt 3 Inversion Clear Register */
553#define PINT3_PINSTATE 0xffc014b0 /* Pin Interrupt 3 Pin Status Register */
554#define PINT3_LATCH 0xffc014b4 /* Pin Interrupt 3 Latch Register */
555
556/* Port A Registers */
557
558#define PORTA_FER 0xffc014c0 /* Function Enable Register */
559#define PORTA 0xffc014c4 /* GPIO Data Register */
560#define PORTA_SET 0xffc014c8 /* GPIO Data Set Register */
561#define PORTA_CLEAR 0xffc014cc /* GPIO Data Clear Register */
562#define PORTA_DIR_SET 0xffc014d0 /* GPIO Direction Set Register */
563#define PORTA_DIR_CLEAR 0xffc014d4 /* GPIO Direction Clear Register */
564#define PORTA_INEN 0xffc014d8 /* GPIO Input Enable Register */
565#define PORTA_MUX 0xffc014dc /* Multiplexer Control Register */
566
567/* Port B Registers */
568
569#define PORTB_FER 0xffc014e0 /* Function Enable Register */
570#define PORTB 0xffc014e4 /* GPIO Data Register */
571#define PORTB_SET 0xffc014e8 /* GPIO Data Set Register */
572#define PORTB_CLEAR 0xffc014ec /* GPIO Data Clear Register */
573#define PORTB_DIR_SET 0xffc014f0 /* GPIO Direction Set Register */
574#define PORTB_DIR_CLEAR 0xffc014f4 /* GPIO Direction Clear Register */
575#define PORTB_INEN 0xffc014f8 /* GPIO Input Enable Register */
576#define PORTB_MUX 0xffc014fc /* Multiplexer Control Register */
577
578/* Port C Registers */
579
580#define PORTC_FER 0xffc01500 /* Function Enable Register */
581#define PORTC 0xffc01504 /* GPIO Data Register */
582#define PORTC_SET 0xffc01508 /* GPIO Data Set Register */
583#define PORTC_CLEAR 0xffc0150c /* GPIO Data Clear Register */
584#define PORTC_DIR_SET 0xffc01510 /* GPIO Direction Set Register */
585#define PORTC_DIR_CLEAR 0xffc01514 /* GPIO Direction Clear Register */
586#define PORTC_INEN 0xffc01518 /* GPIO Input Enable Register */
587#define PORTC_MUX 0xffc0151c /* Multiplexer Control Register */
588
589/* Port D Registers */
590
591#define PORTD_FER 0xffc01520 /* Function Enable Register */
592#define PORTD 0xffc01524 /* GPIO Data Register */
593#define PORTD_SET 0xffc01528 /* GPIO Data Set Register */
594#define PORTD_CLEAR 0xffc0152c /* GPIO Data Clear Register */
595#define PORTD_DIR_SET 0xffc01530 /* GPIO Direction Set Register */
596#define PORTD_DIR_CLEAR 0xffc01534 /* GPIO Direction Clear Register */
597#define PORTD_INEN 0xffc01538 /* GPIO Input Enable Register */
598#define PORTD_MUX 0xffc0153c /* Multiplexer Control Register */
599
600/* Port E Registers */
601
602#define PORTE_FER 0xffc01540 /* Function Enable Register */
603#define PORTE 0xffc01544 /* GPIO Data Register */
604#define PORTE_SET 0xffc01548 /* GPIO Data Set Register */
605#define PORTE_CLEAR 0xffc0154c /* GPIO Data Clear Register */
606#define PORTE_DIR_SET 0xffc01550 /* GPIO Direction Set Register */
607#define PORTE_DIR_CLEAR 0xffc01554 /* GPIO Direction Clear Register */
608#define PORTE_INEN 0xffc01558 /* GPIO Input Enable Register */
609#define PORTE_MUX 0xffc0155c /* Multiplexer Control Register */
610
611/* Port F Registers */
612
613#define PORTF_FER 0xffc01560 /* Function Enable Register */
614#define PORTF 0xffc01564 /* GPIO Data Register */
615#define PORTF_SET 0xffc01568 /* GPIO Data Set Register */
616#define PORTF_CLEAR 0xffc0156c /* GPIO Data Clear Register */
617#define PORTF_DIR_SET 0xffc01570 /* GPIO Direction Set Register */
618#define PORTF_DIR_CLEAR 0xffc01574 /* GPIO Direction Clear Register */
619#define PORTF_INEN 0xffc01578 /* GPIO Input Enable Register */
620#define PORTF_MUX 0xffc0157c /* Multiplexer Control Register */
621
622/* Port G Registers */
623
624#define PORTG_FER 0xffc01580 /* Function Enable Register */
625#define PORTG 0xffc01584 /* GPIO Data Register */
626#define PORTG_SET 0xffc01588 /* GPIO Data Set Register */
627#define PORTG_CLEAR 0xffc0158c /* GPIO Data Clear Register */
628#define PORTG_DIR_SET 0xffc01590 /* GPIO Direction Set Register */
629#define PORTG_DIR_CLEAR 0xffc01594 /* GPIO Direction Clear Register */
630#define PORTG_INEN 0xffc01598 /* GPIO Input Enable Register */
631#define PORTG_MUX 0xffc0159c /* Multiplexer Control Register */
632
633/* Port H Registers */
634
635#define PORTH_FER 0xffc015a0 /* Function Enable Register */
636#define PORTH 0xffc015a4 /* GPIO Data Register */
637#define PORTH_SET 0xffc015a8 /* GPIO Data Set Register */
638#define PORTH_CLEAR 0xffc015ac /* GPIO Data Clear Register */
639#define PORTH_DIR_SET 0xffc015b0 /* GPIO Direction Set Register */
640#define PORTH_DIR_CLEAR 0xffc015b4 /* GPIO Direction Clear Register */
641#define PORTH_INEN 0xffc015b8 /* GPIO Input Enable Register */
642#define PORTH_MUX 0xffc015bc /* Multiplexer Control Register */
643
644/* Port I Registers */
645
646#define PORTI_FER 0xffc015c0 /* Function Enable Register */
647#define PORTI 0xffc015c4 /* GPIO Data Register */
648#define PORTI_SET 0xffc015c8 /* GPIO Data Set Register */
649#define PORTI_CLEAR 0xffc015cc /* GPIO Data Clear Register */
650#define PORTI_DIR_SET 0xffc015d0 /* GPIO Direction Set Register */
651#define PORTI_DIR_CLEAR 0xffc015d4 /* GPIO Direction Clear Register */
652#define PORTI_INEN 0xffc015d8 /* GPIO Input Enable Register */
653#define PORTI_MUX 0xffc015dc /* Multiplexer Control Register */
654
655/* Port J Registers */
656
657#define PORTJ_FER 0xffc015e0 /* Function Enable Register */
658#define PORTJ 0xffc015e4 /* GPIO Data Register */
659#define PORTJ_SET 0xffc015e8 /* GPIO Data Set Register */
660#define PORTJ_CLEAR 0xffc015ec /* GPIO Data Clear Register */
661#define PORTJ_DIR_SET 0xffc015f0 /* GPIO Direction Set Register */
662#define PORTJ_DIR_CLEAR 0xffc015f4 /* GPIO Direction Clear Register */
663#define PORTJ_INEN 0xffc015f8 /* GPIO Input Enable Register */
664#define PORTJ_MUX 0xffc015fc /* Multiplexer Control Register */
665
666/* PWM Timer Registers */
667
668#define TIMER0_CONFIG 0xffc01600 /* Timer 0 Configuration Register */
669#define TIMER0_COUNTER 0xffc01604 /* Timer 0 Counter Register */
670#define TIMER0_PERIOD 0xffc01608 /* Timer 0 Period Register */
671#define TIMER0_WIDTH 0xffc0160c /* Timer 0 Width Register */
672#define TIMER1_CONFIG 0xffc01610 /* Timer 1 Configuration Register */
673#define TIMER1_COUNTER 0xffc01614 /* Timer 1 Counter Register */
674#define TIMER1_PERIOD 0xffc01618 /* Timer 1 Period Register */
675#define TIMER1_WIDTH 0xffc0161c /* Timer 1 Width Register */
676#define TIMER2_CONFIG 0xffc01620 /* Timer 2 Configuration Register */
677#define TIMER2_COUNTER 0xffc01624 /* Timer 2 Counter Register */
678#define TIMER2_PERIOD 0xffc01628 /* Timer 2 Period Register */
679#define TIMER2_WIDTH 0xffc0162c /* Timer 2 Width Register */
680#define TIMER3_CONFIG 0xffc01630 /* Timer 3 Configuration Register */
681#define TIMER3_COUNTER 0xffc01634 /* Timer 3 Counter Register */
682#define TIMER3_PERIOD 0xffc01638 /* Timer 3 Period Register */
683#define TIMER3_WIDTH 0xffc0163c /* Timer 3 Width Register */
684#define TIMER4_CONFIG 0xffc01640 /* Timer 4 Configuration Register */
685#define TIMER4_COUNTER 0xffc01644 /* Timer 4 Counter Register */
686#define TIMER4_PERIOD 0xffc01648 /* Timer 4 Period Register */
687#define TIMER4_WIDTH 0xffc0164c /* Timer 4 Width Register */
688#define TIMER5_CONFIG 0xffc01650 /* Timer 5 Configuration Register */
689#define TIMER5_COUNTER 0xffc01654 /* Timer 5 Counter Register */
690#define TIMER5_PERIOD 0xffc01658 /* Timer 5 Period Register */
691#define TIMER5_WIDTH 0xffc0165c /* Timer 5 Width Register */
692#define TIMER6_CONFIG 0xffc01660 /* Timer 6 Configuration Register */
693#define TIMER6_COUNTER 0xffc01664 /* Timer 6 Counter Register */
694#define TIMER6_PERIOD 0xffc01668 /* Timer 6 Period Register */
695#define TIMER6_WIDTH 0xffc0166c /* Timer 6 Width Register */
696#define TIMER7_CONFIG 0xffc01670 /* Timer 7 Configuration Register */
697#define TIMER7_COUNTER 0xffc01674 /* Timer 7 Counter Register */
698#define TIMER7_PERIOD 0xffc01678 /* Timer 7 Period Register */
699#define TIMER7_WIDTH 0xffc0167c /* Timer 7 Width Register */
700
701/* Timer Group of 8 */
702
703#define TIMER_ENABLE0 0xffc01680 /* Timer Group of 8 Enable Register */
704#define TIMER_DISABLE0 0xffc01684 /* Timer Group of 8 Disable Register */
705#define TIMER_STATUS0 0xffc01688 /* Timer Group of 8 Status Register */
706
707/* DMAC1 Registers */
708
709#define DMAC1_TCPER 0xffc01b0c /* DMA Controller 1 Traffic Control Periods Register */
710#define DMAC1_TCCNT 0xffc01b10 /* DMA Controller 1 Current Counts Register */
711
712/* DMA Channel 12 Registers */
713
714#define DMA12_NEXT_DESC_PTR 0xffc01c00 /* DMA Channel 12 Next Descriptor Pointer Register */
715#define DMA12_START_ADDR 0xffc01c04 /* DMA Channel 12 Start Address Register */
716#define DMA12_CONFIG 0xffc01c08 /* DMA Channel 12 Configuration Register */
717#define DMA12_X_COUNT 0xffc01c10 /* DMA Channel 12 X Count Register */
718#define DMA12_X_MODIFY 0xffc01c14 /* DMA Channel 12 X Modify Register */
719#define DMA12_Y_COUNT 0xffc01c18 /* DMA Channel 12 Y Count Register */
720#define DMA12_Y_MODIFY 0xffc01c1c /* DMA Channel 12 Y Modify Register */
721#define DMA12_CURR_DESC_PTR 0xffc01c20 /* DMA Channel 12 Current Descriptor Pointer Register */
722#define DMA12_CURR_ADDR 0xffc01c24 /* DMA Channel 12 Current Address Register */
723#define DMA12_IRQ_STATUS 0xffc01c28 /* DMA Channel 12 Interrupt/Status Register */
724#define DMA12_PERIPHERAL_MAP 0xffc01c2c /* DMA Channel 12 Peripheral Map Register */
725#define DMA12_CURR_X_COUNT 0xffc01c30 /* DMA Channel 12 Current X Count Register */
726#define DMA12_CURR_Y_COUNT 0xffc01c38 /* DMA Channel 12 Current Y Count Register */
727
728/* DMA Channel 13 Registers */
729
730#define DMA13_NEXT_DESC_PTR 0xffc01c40 /* DMA Channel 13 Next Descriptor Pointer Register */
731#define DMA13_START_ADDR 0xffc01c44 /* DMA Channel 13 Start Address Register */
732#define DMA13_CONFIG 0xffc01c48 /* DMA Channel 13 Configuration Register */
733#define DMA13_X_COUNT 0xffc01c50 /* DMA Channel 13 X Count Register */
734#define DMA13_X_MODIFY 0xffc01c54 /* DMA Channel 13 X Modify Register */
735#define DMA13_Y_COUNT 0xffc01c58 /* DMA Channel 13 Y Count Register */
736#define DMA13_Y_MODIFY 0xffc01c5c /* DMA Channel 13 Y Modify Register */
737#define DMA13_CURR_DESC_PTR 0xffc01c60 /* DMA Channel 13 Current Descriptor Pointer Register */
738#define DMA13_CURR_ADDR 0xffc01c64 /* DMA Channel 13 Current Address Register */
739#define DMA13_IRQ_STATUS 0xffc01c68 /* DMA Channel 13 Interrupt/Status Register */
740#define DMA13_PERIPHERAL_MAP 0xffc01c6c /* DMA Channel 13 Peripheral Map Register */
741#define DMA13_CURR_X_COUNT 0xffc01c70 /* DMA Channel 13 Current X Count Register */
742#define DMA13_CURR_Y_COUNT 0xffc01c78 /* DMA Channel 13 Current Y Count Register */
743
744/* DMA Channel 14 Registers */
745
746#define DMA14_NEXT_DESC_PTR 0xffc01c80 /* DMA Channel 14 Next Descriptor Pointer Register */
747#define DMA14_START_ADDR 0xffc01c84 /* DMA Channel 14 Start Address Register */
748#define DMA14_CONFIG 0xffc01c88 /* DMA Channel 14 Configuration Register */
749#define DMA14_X_COUNT 0xffc01c90 /* DMA Channel 14 X Count Register */
750#define DMA14_X_MODIFY 0xffc01c94 /* DMA Channel 14 X Modify Register */
751#define DMA14_Y_COUNT 0xffc01c98 /* DMA Channel 14 Y Count Register */
752#define DMA14_Y_MODIFY 0xffc01c9c /* DMA Channel 14 Y Modify Register */
753#define DMA14_CURR_DESC_PTR 0xffc01ca0 /* DMA Channel 14 Current Descriptor Pointer Register */
754#define DMA14_CURR_ADDR 0xffc01ca4 /* DMA Channel 14 Current Address Register */
755#define DMA14_IRQ_STATUS 0xffc01ca8 /* DMA Channel 14 Interrupt/Status Register */
756#define DMA14_PERIPHERAL_MAP 0xffc01cac /* DMA Channel 14 Peripheral Map Register */
757#define DMA14_CURR_X_COUNT 0xffc01cb0 /* DMA Channel 14 Current X Count Register */
758#define DMA14_CURR_Y_COUNT 0xffc01cb8 /* DMA Channel 14 Current Y Count Register */
759
760/* DMA Channel 15 Registers */
761
762#define DMA15_NEXT_DESC_PTR 0xffc01cc0 /* DMA Channel 15 Next Descriptor Pointer Register */
763#define DMA15_START_ADDR 0xffc01cc4 /* DMA Channel 15 Start Address Register */
764#define DMA15_CONFIG 0xffc01cc8 /* DMA Channel 15 Configuration Register */
765#define DMA15_X_COUNT 0xffc01cd0 /* DMA Channel 15 X Count Register */
766#define DMA15_X_MODIFY 0xffc01cd4 /* DMA Channel 15 X Modify Register */
767#define DMA15_Y_COUNT 0xffc01cd8 /* DMA Channel 15 Y Count Register */
768#define DMA15_Y_MODIFY 0xffc01cdc /* DMA Channel 15 Y Modify Register */
769#define DMA15_CURR_DESC_PTR 0xffc01ce0 /* DMA Channel 15 Current Descriptor Pointer Register */
770#define DMA15_CURR_ADDR 0xffc01ce4 /* DMA Channel 15 Current Address Register */
771#define DMA15_IRQ_STATUS 0xffc01ce8 /* DMA Channel 15 Interrupt/Status Register */
772#define DMA15_PERIPHERAL_MAP 0xffc01cec /* DMA Channel 15 Peripheral Map Register */
773#define DMA15_CURR_X_COUNT 0xffc01cf0 /* DMA Channel 15 Current X Count Register */
774#define DMA15_CURR_Y_COUNT 0xffc01cf8 /* DMA Channel 15 Current Y Count Register */
775
776/* DMA Channel 16 Registers */
777
778#define DMA16_NEXT_DESC_PTR 0xffc01d00 /* DMA Channel 16 Next Descriptor Pointer Register */
779#define DMA16_START_ADDR 0xffc01d04 /* DMA Channel 16 Start Address Register */
780#define DMA16_CONFIG 0xffc01d08 /* DMA Channel 16 Configuration Register */
781#define DMA16_X_COUNT 0xffc01d10 /* DMA Channel 16 X Count Register */
782#define DMA16_X_MODIFY 0xffc01d14 /* DMA Channel 16 X Modify Register */
783#define DMA16_Y_COUNT 0xffc01d18 /* DMA Channel 16 Y Count Register */
784#define DMA16_Y_MODIFY 0xffc01d1c /* DMA Channel 16 Y Modify Register */
785#define DMA16_CURR_DESC_PTR 0xffc01d20 /* DMA Channel 16 Current Descriptor Pointer Register */
786#define DMA16_CURR_ADDR 0xffc01d24 /* DMA Channel 16 Current Address Register */
787#define DMA16_IRQ_STATUS 0xffc01d28 /* DMA Channel 16 Interrupt/Status Register */
788#define DMA16_PERIPHERAL_MAP 0xffc01d2c /* DMA Channel 16 Peripheral Map Register */
789#define DMA16_CURR_X_COUNT 0xffc01d30 /* DMA Channel 16 Current X Count Register */
790#define DMA16_CURR_Y_COUNT 0xffc01d38 /* DMA Channel 16 Current Y Count Register */
791
792/* DMA Channel 17 Registers */
793
794#define DMA17_NEXT_DESC_PTR 0xffc01d40 /* DMA Channel 17 Next Descriptor Pointer Register */
795#define DMA17_START_ADDR 0xffc01d44 /* DMA Channel 17 Start Address Register */
796#define DMA17_CONFIG 0xffc01d48 /* DMA Channel 17 Configuration Register */
797#define DMA17_X_COUNT 0xffc01d50 /* DMA Channel 17 X Count Register */
798#define DMA17_X_MODIFY 0xffc01d54 /* DMA Channel 17 X Modify Register */
799#define DMA17_Y_COUNT 0xffc01d58 /* DMA Channel 17 Y Count Register */
800#define DMA17_Y_MODIFY 0xffc01d5c /* DMA Channel 17 Y Modify Register */
801#define DMA17_CURR_DESC_PTR 0xffc01d60 /* DMA Channel 17 Current Descriptor Pointer Register */
802#define DMA17_CURR_ADDR 0xffc01d64 /* DMA Channel 17 Current Address Register */
803#define DMA17_IRQ_STATUS 0xffc01d68 /* DMA Channel 17 Interrupt/Status Register */
804#define DMA17_PERIPHERAL_MAP 0xffc01d6c /* DMA Channel 17 Peripheral Map Register */
805#define DMA17_CURR_X_COUNT 0xffc01d70 /* DMA Channel 17 Current X Count Register */
806#define DMA17_CURR_Y_COUNT 0xffc01d78 /* DMA Channel 17 Current Y Count Register */
807
808/* DMA Channel 18 Registers */
809
810#define DMA18_NEXT_DESC_PTR 0xffc01d80 /* DMA Channel 18 Next Descriptor Pointer Register */
811#define DMA18_START_ADDR 0xffc01d84 /* DMA Channel 18 Start Address Register */
812#define DMA18_CONFIG 0xffc01d88 /* DMA Channel 18 Configuration Register */
813#define DMA18_X_COUNT 0xffc01d90 /* DMA Channel 18 X Count Register */
814#define DMA18_X_MODIFY 0xffc01d94 /* DMA Channel 18 X Modify Register */
815#define DMA18_Y_COUNT 0xffc01d98 /* DMA Channel 18 Y Count Register */
816#define DMA18_Y_MODIFY 0xffc01d9c /* DMA Channel 18 Y Modify Register */
817#define DMA18_CURR_DESC_PTR 0xffc01da0 /* DMA Channel 18 Current Descriptor Pointer Register */
818#define DMA18_CURR_ADDR 0xffc01da4 /* DMA Channel 18 Current Address Register */
819#define DMA18_IRQ_STATUS 0xffc01da8 /* DMA Channel 18 Interrupt/Status Register */
820#define DMA18_PERIPHERAL_MAP 0xffc01dac /* DMA Channel 18 Peripheral Map Register */
821#define DMA18_CURR_X_COUNT 0xffc01db0 /* DMA Channel 18 Current X Count Register */
822#define DMA18_CURR_Y_COUNT 0xffc01db8 /* DMA Channel 18 Current Y Count Register */
823
824/* DMA Channel 19 Registers */
825
826#define DMA19_NEXT_DESC_PTR 0xffc01dc0 /* DMA Channel 19 Next Descriptor Pointer Register */
827#define DMA19_START_ADDR 0xffc01dc4 /* DMA Channel 19 Start Address Register */
828#define DMA19_CONFIG 0xffc01dc8 /* DMA Channel 19 Configuration Register */
829#define DMA19_X_COUNT 0xffc01dd0 /* DMA Channel 19 X Count Register */
830#define DMA19_X_MODIFY 0xffc01dd4 /* DMA Channel 19 X Modify Register */
831#define DMA19_Y_COUNT 0xffc01dd8 /* DMA Channel 19 Y Count Register */
832#define DMA19_Y_MODIFY 0xffc01ddc /* DMA Channel 19 Y Modify Register */
833#define DMA19_CURR_DESC_PTR 0xffc01de0 /* DMA Channel 19 Current Descriptor Pointer Register */
834#define DMA19_CURR_ADDR 0xffc01de4 /* DMA Channel 19 Current Address Register */
835#define DMA19_IRQ_STATUS 0xffc01de8 /* DMA Channel 19 Interrupt/Status Register */
836#define DMA19_PERIPHERAL_MAP 0xffc01dec /* DMA Channel 19 Peripheral Map Register */
837#define DMA19_CURR_X_COUNT 0xffc01df0 /* DMA Channel 19 Current X Count Register */
838#define DMA19_CURR_Y_COUNT 0xffc01df8 /* DMA Channel 19 Current Y Count Register */
839
840/* DMA Channel 20 Registers */
841
842#define DMA20_NEXT_DESC_PTR 0xffc01e00 /* DMA Channel 20 Next Descriptor Pointer Register */
843#define DMA20_START_ADDR 0xffc01e04 /* DMA Channel 20 Start Address Register */
844#define DMA20_CONFIG 0xffc01e08 /* DMA Channel 20 Configuration Register */
845#define DMA20_X_COUNT 0xffc01e10 /* DMA Channel 20 X Count Register */
846#define DMA20_X_MODIFY 0xffc01e14 /* DMA Channel 20 X Modify Register */
847#define DMA20_Y_COUNT 0xffc01e18 /* DMA Channel 20 Y Count Register */
848#define DMA20_Y_MODIFY 0xffc01e1c /* DMA Channel 20 Y Modify Register */
849#define DMA20_CURR_DESC_PTR 0xffc01e20 /* DMA Channel 20 Current Descriptor Pointer Register */
850#define DMA20_CURR_ADDR 0xffc01e24 /* DMA Channel 20 Current Address Register */
851#define DMA20_IRQ_STATUS 0xffc01e28 /* DMA Channel 20 Interrupt/Status Register */
852#define DMA20_PERIPHERAL_MAP 0xffc01e2c /* DMA Channel 20 Peripheral Map Register */
853#define DMA20_CURR_X_COUNT 0xffc01e30 /* DMA Channel 20 Current X Count Register */
854#define DMA20_CURR_Y_COUNT 0xffc01e38 /* DMA Channel 20 Current Y Count Register */
855
856/* DMA Channel 21 Registers */
857
858#define DMA21_NEXT_DESC_PTR 0xffc01e40 /* DMA Channel 21 Next Descriptor Pointer Register */
859#define DMA21_START_ADDR 0xffc01e44 /* DMA Channel 21 Start Address Register */
860#define DMA21_CONFIG 0xffc01e48 /* DMA Channel 21 Configuration Register */
861#define DMA21_X_COUNT 0xffc01e50 /* DMA Channel 21 X Count Register */
862#define DMA21_X_MODIFY 0xffc01e54 /* DMA Channel 21 X Modify Register */
863#define DMA21_Y_COUNT 0xffc01e58 /* DMA Channel 21 Y Count Register */
864#define DMA21_Y_MODIFY 0xffc01e5c /* DMA Channel 21 Y Modify Register */
865#define DMA21_CURR_DESC_PTR 0xffc01e60 /* DMA Channel 21 Current Descriptor Pointer Register */
866#define DMA21_CURR_ADDR 0xffc01e64 /* DMA Channel 21 Current Address Register */
867#define DMA21_IRQ_STATUS 0xffc01e68 /* DMA Channel 21 Interrupt/Status Register */
868#define DMA21_PERIPHERAL_MAP 0xffc01e6c /* DMA Channel 21 Peripheral Map Register */
869#define DMA21_CURR_X_COUNT 0xffc01e70 /* DMA Channel 21 Current X Count Register */
870#define DMA21_CURR_Y_COUNT 0xffc01e78 /* DMA Channel 21 Current Y Count Register */
871
872/* DMA Channel 22 Registers */
873
874#define DMA22_NEXT_DESC_PTR 0xffc01e80 /* DMA Channel 22 Next Descriptor Pointer Register */
875#define DMA22_START_ADDR 0xffc01e84 /* DMA Channel 22 Start Address Register */
876#define DMA22_CONFIG 0xffc01e88 /* DMA Channel 22 Configuration Register */
877#define DMA22_X_COUNT 0xffc01e90 /* DMA Channel 22 X Count Register */
878#define DMA22_X_MODIFY 0xffc01e94 /* DMA Channel 22 X Modify Register */
879#define DMA22_Y_COUNT 0xffc01e98 /* DMA Channel 22 Y Count Register */
880#define DMA22_Y_MODIFY 0xffc01e9c /* DMA Channel 22 Y Modify Register */
881#define DMA22_CURR_DESC_PTR 0xffc01ea0 /* DMA Channel 22 Current Descriptor Pointer Register */
882#define DMA22_CURR_ADDR 0xffc01ea4 /* DMA Channel 22 Current Address Register */
883#define DMA22_IRQ_STATUS 0xffc01ea8 /* DMA Channel 22 Interrupt/Status Register */
884#define DMA22_PERIPHERAL_MAP 0xffc01eac /* DMA Channel 22 Peripheral Map Register */
885#define DMA22_CURR_X_COUNT 0xffc01eb0 /* DMA Channel 22 Current X Count Register */
886#define DMA22_CURR_Y_COUNT 0xffc01eb8 /* DMA Channel 22 Current Y Count Register */
887
888/* DMA Channel 23 Registers */
889
890#define DMA23_NEXT_DESC_PTR 0xffc01ec0 /* DMA Channel 23 Next Descriptor Pointer Register */
891#define DMA23_START_ADDR 0xffc01ec4 /* DMA Channel 23 Start Address Register */
892#define DMA23_CONFIG 0xffc01ec8 /* DMA Channel 23 Configuration Register */
893#define DMA23_X_COUNT 0xffc01ed0 /* DMA Channel 23 X Count Register */
894#define DMA23_X_MODIFY 0xffc01ed4 /* DMA Channel 23 X Modify Register */
895#define DMA23_Y_COUNT 0xffc01ed8 /* DMA Channel 23 Y Count Register */
896#define DMA23_Y_MODIFY 0xffc01edc /* DMA Channel 23 Y Modify Register */
897#define DMA23_CURR_DESC_PTR 0xffc01ee0 /* DMA Channel 23 Current Descriptor Pointer Register */
898#define DMA23_CURR_ADDR 0xffc01ee4 /* DMA Channel 23 Current Address Register */
899#define DMA23_IRQ_STATUS 0xffc01ee8 /* DMA Channel 23 Interrupt/Status Register */
900#define DMA23_PERIPHERAL_MAP 0xffc01eec /* DMA Channel 23 Peripheral Map Register */
901#define DMA23_CURR_X_COUNT 0xffc01ef0 /* DMA Channel 23 Current X Count Register */
902#define DMA23_CURR_Y_COUNT 0xffc01ef8 /* DMA Channel 23 Current Y Count Register */
903
904/* MDMA Stream 2 Registers */
905
906#define MDMA_D2_NEXT_DESC_PTR 0xffc01f00 /* Memory DMA Stream 2 Destination Next Descriptor Pointer Register */
907#define MDMA_D2_START_ADDR 0xffc01f04 /* Memory DMA Stream 2 Destination Start Address Register */
908#define MDMA_D2_CONFIG 0xffc01f08 /* Memory DMA Stream 2 Destination Configuration Register */
909#define MDMA_D2_X_COUNT 0xffc01f10 /* Memory DMA Stream 2 Destination X Count Register */
910#define MDMA_D2_X_MODIFY 0xffc01f14 /* Memory DMA Stream 2 Destination X Modify Register */
911#define MDMA_D2_Y_COUNT 0xffc01f18 /* Memory DMA Stream 2 Destination Y Count Register */
912#define MDMA_D2_Y_MODIFY 0xffc01f1c /* Memory DMA Stream 2 Destination Y Modify Register */
913#define MDMA_D2_CURR_DESC_PTR 0xffc01f20 /* Memory DMA Stream 2 Destination Current Descriptor Pointer Register */
914#define MDMA_D2_CURR_ADDR 0xffc01f24 /* Memory DMA Stream 2 Destination Current Address Register */
915#define MDMA_D2_IRQ_STATUS 0xffc01f28 /* Memory DMA Stream 2 Destination Interrupt/Status Register */
916#define MDMA_D2_PERIPHERAL_MAP 0xffc01f2c /* Memory DMA Stream 2 Destination Peripheral Map Register */
917#define MDMA_D2_CURR_X_COUNT 0xffc01f30 /* Memory DMA Stream 2 Destination Current X Count Register */
918#define MDMA_D2_CURR_Y_COUNT 0xffc01f38 /* Memory DMA Stream 2 Destination Current Y Count Register */
919#define MDMA_S2_NEXT_DESC_PTR 0xffc01f40 /* Memory DMA Stream 2 Source Next Descriptor Pointer Register */
920#define MDMA_S2_START_ADDR 0xffc01f44 /* Memory DMA Stream 2 Source Start Address Register */
921#define MDMA_S2_CONFIG 0xffc01f48 /* Memory DMA Stream 2 Source Configuration Register */
922#define MDMA_S2_X_COUNT 0xffc01f50 /* Memory DMA Stream 2 Source X Count Register */
923#define MDMA_S2_X_MODIFY 0xffc01f54 /* Memory DMA Stream 2 Source X Modify Register */
924#define MDMA_S2_Y_COUNT 0xffc01f58 /* Memory DMA Stream 2 Source Y Count Register */
925#define MDMA_S2_Y_MODIFY 0xffc01f5c /* Memory DMA Stream 2 Source Y Modify Register */
926#define MDMA_S2_CURR_DESC_PTR 0xffc01f60 /* Memory DMA Stream 2 Source Current Descriptor Pointer Register */
927#define MDMA_S2_CURR_ADDR 0xffc01f64 /* Memory DMA Stream 2 Source Current Address Register */
928#define MDMA_S2_IRQ_STATUS 0xffc01f68 /* Memory DMA Stream 2 Source Interrupt/Status Register */
929#define MDMA_S2_PERIPHERAL_MAP 0xffc01f6c /* Memory DMA Stream 2 Source Peripheral Map Register */
930#define MDMA_S2_CURR_X_COUNT 0xffc01f70 /* Memory DMA Stream 2 Source Current X Count Register */
931#define MDMA_S2_CURR_Y_COUNT 0xffc01f78 /* Memory DMA Stream 2 Source Current Y Count Register */
932
933/* MDMA Stream 3 Registers */
934
935#define MDMA_D3_NEXT_DESC_PTR 0xffc01f80 /* Memory DMA Stream 3 Destination Next Descriptor Pointer Register */
936#define MDMA_D3_START_ADDR 0xffc01f84 /* Memory DMA Stream 3 Destination Start Address Register */
937#define MDMA_D3_CONFIG 0xffc01f88 /* Memory DMA Stream 3 Destination Configuration Register */
938#define MDMA_D3_X_COUNT 0xffc01f90 /* Memory DMA Stream 3 Destination X Count Register */
939#define MDMA_D3_X_MODIFY 0xffc01f94 /* Memory DMA Stream 3 Destination X Modify Register */
940#define MDMA_D3_Y_COUNT 0xffc01f98 /* Memory DMA Stream 3 Destination Y Count Register */
941#define MDMA_D3_Y_MODIFY 0xffc01f9c /* Memory DMA Stream 3 Destination Y Modify Register */
942#define MDMA_D3_CURR_DESC_PTR 0xffc01fa0 /* Memory DMA Stream 3 Destination Current Descriptor Pointer Register */
943#define MDMA_D3_CURR_ADDR 0xffc01fa4 /* Memory DMA Stream 3 Destination Current Address Register */
944#define MDMA_D3_IRQ_STATUS 0xffc01fa8 /* Memory DMA Stream 3 Destination Interrupt/Status Register */
945#define MDMA_D3_PERIPHERAL_MAP 0xffc01fac /* Memory DMA Stream 3 Destination Peripheral Map Register */
946#define MDMA_D3_CURR_X_COUNT 0xffc01fb0 /* Memory DMA Stream 3 Destination Current X Count Register */
947#define MDMA_D3_CURR_Y_COUNT 0xffc01fb8 /* Memory DMA Stream 3 Destination Current Y Count Register */
948#define MDMA_S3_NEXT_DESC_PTR 0xffc01fc0 /* Memory DMA Stream 3 Source Next Descriptor Pointer Register */
949#define MDMA_S3_START_ADDR 0xffc01fc4 /* Memory DMA Stream 3 Source Start Address Register */
950#define MDMA_S3_CONFIG 0xffc01fc8 /* Memory DMA Stream 3 Source Configuration Register */
951#define MDMA_S3_X_COUNT 0xffc01fd0 /* Memory DMA Stream 3 Source X Count Register */
952#define MDMA_S3_X_MODIFY 0xffc01fd4 /* Memory DMA Stream 3 Source X Modify Register */
953#define MDMA_S3_Y_COUNT 0xffc01fd8 /* Memory DMA Stream 3 Source Y Count Register */
954#define MDMA_S3_Y_MODIFY 0xffc01fdc /* Memory DMA Stream 3 Source Y Modify Register */
955#define MDMA_S3_CURR_DESC_PTR 0xffc01fe0 /* Memory DMA Stream 3 Source Current Descriptor Pointer Register */
956#define MDMA_S3_CURR_ADDR 0xffc01fe4 /* Memory DMA Stream 3 Source Current Address Register */
957#define MDMA_S3_IRQ_STATUS 0xffc01fe8 /* Memory DMA Stream 3 Source Interrupt/Status Register */
958#define MDMA_S3_PERIPHERAL_MAP 0xffc01fec /* Memory DMA Stream 3 Source Peripheral Map Register */
959#define MDMA_S3_CURR_X_COUNT 0xffc01ff0 /* Memory DMA Stream 3 Source Current X Count Register */
960#define MDMA_S3_CURR_Y_COUNT 0xffc01ff8 /* Memory DMA Stream 3 Source Current Y Count Register */
961
962/* UART1 Registers */
963
964#define UART1_DLL 0xffc02000 /* Divisor Latch Low Byte */
965#define UART1_DLH 0xffc02004 /* Divisor Latch High Byte */
966#define UART1_GCTL 0xffc02008 /* Global Control Register */
967#define UART1_LCR 0xffc0200c /* Line Control Register */
968#define UART1_MCR 0xffc02010 /* Modem Control Register */
969#define UART1_LSR 0xffc02014 /* Line Status Register */
970#define UART1_MSR 0xffc02018 /* Modem Status Register */
971#define UART1_SCR 0xffc0201c /* Scratch Register */
972#define UART1_IER_SET 0xffc02020 /* Interrupt Enable Register Set */
973#define UART1_IER_CLEAR 0xffc02024 /* Interrupt Enable Register Clear */
974#define UART1_THR 0xffc02028 /* Transmit Hold Register */
975#define UART1_RBR 0xffc0202c /* Receive Buffer Register */
976
977/* UART2 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 processors */
978
979/* SPI1 Registers */
980
981#define SPI1_CTL 0xffc02300 /* SPI1 Control Register */
982#define SPI1_FLG 0xffc02304 /* SPI1 Flag Register */
983#define SPI1_STAT 0xffc02308 /* SPI1 Status Register */
984#define SPI1_TDBR 0xffc0230c /* SPI1 Transmit Data Buffer Register */
985#define SPI1_RDBR 0xffc02310 /* SPI1 Receive Data Buffer Register */
986#define SPI1_BAUD 0xffc02314 /* SPI1 Baud Rate Register */
987#define SPI1_SHADOW 0xffc02318 /* SPI1 Receive Data Buffer Shadow Register */
988
989/* SPORT2 Registers */
990
991#define SPORT2_TCR1 0xffc02500 /* SPORT2 Transmit Configuration 1 Register */
992#define SPORT2_TCR2 0xffc02504 /* SPORT2 Transmit Configuration 2 Register */
993#define SPORT2_TCLKDIV 0xffc02508 /* SPORT2 Transmit Serial Clock Divider Register */
994#define SPORT2_TFSDIV 0xffc0250c /* SPORT2 Transmit Frame Sync Divider Register */
995#define SPORT2_TX 0xffc02510 /* SPORT2 Transmit Data Register */
996#define SPORT2_RX 0xffc02518 /* SPORT2 Receive Data Register */
997#define SPORT2_RCR1 0xffc02520 /* SPORT2 Receive Configuration 1 Register */
998#define SPORT2_RCR2 0xffc02524 /* SPORT2 Receive Configuration 2 Register */
999#define SPORT2_RCLKDIV 0xffc02528 /* SPORT2 Receive Serial Clock Divider Register */
1000#define SPORT2_RFSDIV 0xffc0252c /* SPORT2 Receive Frame Sync Divider Register */
1001#define SPORT2_STAT 0xffc02530 /* SPORT2 Status Register */
1002#define SPORT2_CHNL 0xffc02534 /* SPORT2 Current Channel Register */
1003#define SPORT2_MCMC1 0xffc02538 /* SPORT2 Multi channel Configuration Register 1 */
1004#define SPORT2_MCMC2 0xffc0253c /* SPORT2 Multi channel Configuration Register 2 */
1005#define SPORT2_MTCS0 0xffc02540 /* SPORT2 Multi channel Transmit Select Register 0 */
1006#define SPORT2_MTCS1 0xffc02544 /* SPORT2 Multi channel Transmit Select Register 1 */
1007#define SPORT2_MTCS2 0xffc02548 /* SPORT2 Multi channel Transmit Select Register 2 */
1008#define SPORT2_MTCS3 0xffc0254c /* SPORT2 Multi channel Transmit Select Register 3 */
1009#define SPORT2_MRCS0 0xffc02550 /* SPORT2 Multi channel Receive Select Register 0 */
1010#define SPORT2_MRCS1 0xffc02554 /* SPORT2 Multi channel Receive Select Register 1 */
1011#define SPORT2_MRCS2 0xffc02558 /* SPORT2 Multi channel Receive Select Register 2 */
1012#define SPORT2_MRCS3 0xffc0255c /* SPORT2 Multi channel Receive Select Register 3 */
1013
1014/* SPORT3 Registers */
1015
1016#define SPORT3_TCR1 0xffc02600 /* SPORT3 Transmit Configuration 1 Register */
1017#define SPORT3_TCR2 0xffc02604 /* SPORT3 Transmit Configuration 2 Register */
1018#define SPORT3_TCLKDIV 0xffc02608 /* SPORT3 Transmit Serial Clock Divider Register */
1019#define SPORT3_TFSDIV 0xffc0260c /* SPORT3 Transmit Frame Sync Divider Register */
1020#define SPORT3_TX 0xffc02610 /* SPORT3 Transmit Data Register */
1021#define SPORT3_RX 0xffc02618 /* SPORT3 Receive Data Register */
1022#define SPORT3_RCR1 0xffc02620 /* SPORT3 Receive Configuration 1 Register */
1023#define SPORT3_RCR2 0xffc02624 /* SPORT3 Receive Configuration 2 Register */
1024#define SPORT3_RCLKDIV 0xffc02628 /* SPORT3 Receive Serial Clock Divider Register */
1025#define SPORT3_RFSDIV 0xffc0262c /* SPORT3 Receive Frame Sync Divider Register */
1026#define SPORT3_STAT 0xffc02630 /* SPORT3 Status Register */
1027#define SPORT3_CHNL 0xffc02634 /* SPORT3 Current Channel Register */
1028#define SPORT3_MCMC1 0xffc02638 /* SPORT3 Multi channel Configuration Register 1 */
1029#define SPORT3_MCMC2 0xffc0263c /* SPORT3 Multi channel Configuration Register 2 */
1030#define SPORT3_MTCS0 0xffc02640 /* SPORT3 Multi channel Transmit Select Register 0 */
1031#define SPORT3_MTCS1 0xffc02644 /* SPORT3 Multi channel Transmit Select Register 1 */
1032#define SPORT3_MTCS2 0xffc02648 /* SPORT3 Multi channel Transmit Select Register 2 */
1033#define SPORT3_MTCS3 0xffc0264c /* SPORT3 Multi channel Transmit Select Register 3 */
1034#define SPORT3_MRCS0 0xffc02650 /* SPORT3 Multi channel Receive Select Register 0 */
1035#define SPORT3_MRCS1 0xffc02654 /* SPORT3 Multi channel Receive Select Register 1 */
1036#define SPORT3_MRCS2 0xffc02658 /* SPORT3 Multi channel Receive Select Register 2 */
1037#define SPORT3_MRCS3 0xffc0265c /* SPORT3 Multi channel Receive Select Register 3 */
1038
1039/* EPPI2 Registers */
1040
1041#define EPPI2_STATUS 0xffc02900 /* EPPI2 Status Register */
1042#define EPPI2_HCOUNT 0xffc02904 /* EPPI2 Horizontal Transfer Count Register */
1043#define EPPI2_HDELAY 0xffc02908 /* EPPI2 Horizontal Delay Count Register */
1044#define EPPI2_VCOUNT 0xffc0290c /* EPPI2 Vertical Transfer Count Register */
1045#define EPPI2_VDELAY 0xffc02910 /* EPPI2 Vertical Delay Count Register */
1046#define EPPI2_FRAME 0xffc02914 /* EPPI2 Lines per Frame Register */
1047#define EPPI2_LINE 0xffc02918 /* EPPI2 Samples per Line Register */
1048#define EPPI2_CLKDIV 0xffc0291c /* EPPI2 Clock Divide Register */
1049#define EPPI2_CONTROL 0xffc02920 /* EPPI2 Control Register */
1050#define EPPI2_FS1W_HBL 0xffc02924 /* EPPI2 FS1 Width Register / EPPI2 Horizontal Blanking Samples Per Line Register */
1051#define EPPI2_FS1P_AVPL 0xffc02928 /* EPPI2 FS1 Period Register / EPPI2 Active Video Samples Per Line Register */
1052#define EPPI2_FS2W_LVB 0xffc0292c /* EPPI2 FS2 Width Register / EPPI2 Lines of Vertical Blanking Register */
1053#define EPPI2_FS2P_LAVF 0xffc02930 /* EPPI2 FS2 Period Register/ EPPI2 Lines of Active Video Per Field Register */
1054#define EPPI2_CLIP 0xffc02934 /* EPPI2 Clipping Register */
1055
1056/* CAN Controller 0 Config 1 Registers */
1057
1058#define CAN0_MC1 0xffc02a00 /* CAN Controller 0 Mailbox Configuration Register 1 */
1059#define CAN0_MD1 0xffc02a04 /* CAN Controller 0 Mailbox Direction Register 1 */
1060#define CAN0_TRS1 0xffc02a08 /* CAN Controller 0 Transmit Request Set Register 1 */
1061#define CAN0_TRR1 0xffc02a0c /* CAN Controller 0 Transmit Request Reset Register 1 */
1062#define CAN0_TA1 0xffc02a10 /* CAN Controller 0 Transmit Acknowledge Register 1 */
1063#define CAN0_AA1 0xffc02a14 /* CAN Controller 0 Abort Acknowledge Register 1 */
1064#define CAN0_RMP1 0xffc02a18 /* CAN Controller 0 Receive Message Pending Register 1 */
1065#define CAN0_RML1 0xffc02a1c /* CAN Controller 0 Receive Message Lost Register 1 */
1066#define CAN0_MBTIF1 0xffc02a20 /* CAN Controller 0 Mailbox Transmit Interrupt Flag Register 1 */
1067#define CAN0_MBRIF1 0xffc02a24 /* CAN Controller 0 Mailbox Receive Interrupt Flag Register 1 */
1068#define CAN0_MBIM1 0xffc02a28 /* CAN Controller 0 Mailbox Interrupt Mask Register 1 */
1069#define CAN0_RFH1 0xffc02a2c /* CAN Controller 0 Remote Frame Handling Enable Register 1 */
1070#define CAN0_OPSS1 0xffc02a30 /* CAN Controller 0 Overwrite Protection Single Shot Transmit Register 1 */
1071
1072/* CAN Controller 0 Config 2 Registers */
1073
1074#define CAN0_MC2 0xffc02a40 /* CAN Controller 0 Mailbox Configuration Register 2 */
1075#define CAN0_MD2 0xffc02a44 /* CAN Controller 0 Mailbox Direction Register 2 */
1076#define CAN0_TRS2 0xffc02a48 /* CAN Controller 0 Transmit Request Set Register 2 */
1077#define CAN0_TRR2 0xffc02a4c /* CAN Controller 0 Transmit Request Reset Register 2 */
1078#define CAN0_TA2 0xffc02a50 /* CAN Controller 0 Transmit Acknowledge Register 2 */
1079#define CAN0_AA2 0xffc02a54 /* CAN Controller 0 Abort Acknowledge Register 2 */
1080#define CAN0_RMP2 0xffc02a58 /* CAN Controller 0 Receive Message Pending Register 2 */
1081#define CAN0_RML2 0xffc02a5c /* CAN Controller 0 Receive Message Lost Register 2 */
1082#define CAN0_MBTIF2 0xffc02a60 /* CAN Controller 0 Mailbox Transmit Interrupt Flag Register 2 */
1083#define CAN0_MBRIF2 0xffc02a64 /* CAN Controller 0 Mailbox Receive Interrupt Flag Register 2 */
1084#define CAN0_MBIM2 0xffc02a68 /* CAN Controller 0 Mailbox Interrupt Mask Register 2 */
1085#define CAN0_RFH2 0xffc02a6c /* CAN Controller 0 Remote Frame Handling Enable Register 2 */
1086#define CAN0_OPSS2 0xffc02a70 /* CAN Controller 0 Overwrite Protection Single Shot Transmit Register 2 */
1087
1088/* CAN Controller 0 Clock/Interrupt/Counter Registers */
1089
1090#define CAN0_CLOCK 0xffc02a80 /* CAN Controller 0 Clock Register */
1091#define CAN0_TIMING 0xffc02a84 /* CAN Controller 0 Timing Register */
1092#define CAN0_DEBUG 0xffc02a88 /* CAN Controller 0 Debug Register */
1093#define CAN0_STATUS 0xffc02a8c /* CAN Controller 0 Global Status Register */
1094#define CAN0_CEC 0xffc02a90 /* CAN Controller 0 Error Counter Register */
1095#define CAN0_GIS 0xffc02a94 /* CAN Controller 0 Global Interrupt Status Register */
1096#define CAN0_GIM 0xffc02a98 /* CAN Controller 0 Global Interrupt Mask Register */
1097#define CAN0_GIF 0xffc02a9c /* CAN Controller 0 Global Interrupt Flag Register */
1098#define CAN0_CONTROL 0xffc02aa0 /* CAN Controller 0 Master Control Register */
1099#define CAN0_INTR 0xffc02aa4 /* CAN Controller 0 Interrupt Pending Register */
1100#define CAN0_MBTD 0xffc02aac /* CAN Controller 0 Mailbox Temporary Disable Register */
1101#define CAN0_EWR 0xffc02ab0 /* CAN Controller 0 Programmable Warning Level Register */
1102#define CAN0_ESR 0xffc02ab4 /* CAN Controller 0 Error Status Register */
1103#define CAN0_UCCNT 0xffc02ac4 /* CAN Controller 0 Universal Counter Register */
1104#define CAN0_UCRC 0xffc02ac8 /* CAN Controller 0 Universal Counter Force Reload Register */
1105#define CAN0_UCCNF 0xffc02acc /* CAN Controller 0 Universal Counter Configuration Register */
1106
1107/* CAN Controller 0 Acceptance Registers */
1108
1109#define CAN0_AM00L 0xffc02b00 /* CAN Controller 0 Mailbox 0 Acceptance Mask High Register */
1110#define CAN0_AM00H 0xffc02b04 /* CAN Controller 0 Mailbox 0 Acceptance Mask Low Register */
1111#define CAN0_AM01L 0xffc02b08 /* CAN Controller 0 Mailbox 1 Acceptance Mask High Register */
1112#define CAN0_AM01H 0xffc02b0c /* CAN Controller 0 Mailbox 1 Acceptance Mask Low Register */
1113#define CAN0_AM02L 0xffc02b10 /* CAN Controller 0 Mailbox 2 Acceptance Mask High Register */
1114#define CAN0_AM02H 0xffc02b14 /* CAN Controller 0 Mailbox 2 Acceptance Mask Low Register */
1115#define CAN0_AM03L 0xffc02b18 /* CAN Controller 0 Mailbox 3 Acceptance Mask High Register */
1116#define CAN0_AM03H 0xffc02b1c /* CAN Controller 0 Mailbox 3 Acceptance Mask Low Register */
1117#define CAN0_AM04L 0xffc02b20 /* CAN Controller 0 Mailbox 4 Acceptance Mask High Register */
1118#define CAN0_AM04H 0xffc02b24 /* CAN Controller 0 Mailbox 4 Acceptance Mask Low Register */
1119#define CAN0_AM05L 0xffc02b28 /* CAN Controller 0 Mailbox 5 Acceptance Mask High Register */
1120#define CAN0_AM05H 0xffc02b2c /* CAN Controller 0 Mailbox 5 Acceptance Mask Low Register */
1121#define CAN0_AM06L 0xffc02b30 /* CAN Controller 0 Mailbox 6 Acceptance Mask High Register */
1122#define CAN0_AM06H 0xffc02b34 /* CAN Controller 0 Mailbox 6 Acceptance Mask Low Register */
1123#define CAN0_AM07L 0xffc02b38 /* CAN Controller 0 Mailbox 7 Acceptance Mask High Register */
1124#define CAN0_AM07H 0xffc02b3c /* CAN Controller 0 Mailbox 7 Acceptance Mask Low Register */
1125#define CAN0_AM08L 0xffc02b40 /* CAN Controller 0 Mailbox 8 Acceptance Mask High Register */
1126#define CAN0_AM08H 0xffc02b44 /* CAN Controller 0 Mailbox 8 Acceptance Mask Low Register */
1127#define CAN0_AM09L 0xffc02b48 /* CAN Controller 0 Mailbox 9 Acceptance Mask High Register */
1128#define CAN0_AM09H 0xffc02b4c /* CAN Controller 0 Mailbox 9 Acceptance Mask Low Register */
1129#define CAN0_AM10L 0xffc02b50 /* CAN Controller 0 Mailbox 10 Acceptance Mask High Register */
1130#define CAN0_AM10H 0xffc02b54 /* CAN Controller 0 Mailbox 10 Acceptance Mask Low Register */
1131#define CAN0_AM11L 0xffc02b58 /* CAN Controller 0 Mailbox 11 Acceptance Mask High Register */
1132#define CAN0_AM11H 0xffc02b5c /* CAN Controller 0 Mailbox 11 Acceptance Mask Low Register */
1133#define CAN0_AM12L 0xffc02b60 /* CAN Controller 0 Mailbox 12 Acceptance Mask High Register */
1134#define CAN0_AM12H 0xffc02b64 /* CAN Controller 0 Mailbox 12 Acceptance Mask Low Register */
1135#define CAN0_AM13L 0xffc02b68 /* CAN Controller 0 Mailbox 13 Acceptance Mask High Register */
1136#define CAN0_AM13H 0xffc02b6c /* CAN Controller 0 Mailbox 13 Acceptance Mask Low Register */
1137#define CAN0_AM14L 0xffc02b70 /* CAN Controller 0 Mailbox 14 Acceptance Mask High Register */
1138#define CAN0_AM14H 0xffc02b74 /* CAN Controller 0 Mailbox 14 Acceptance Mask Low Register */
1139#define CAN0_AM15L 0xffc02b78 /* CAN Controller 0 Mailbox 15 Acceptance Mask High Register */
1140#define CAN0_AM15H 0xffc02b7c /* CAN Controller 0 Mailbox 15 Acceptance Mask Low Register */
1141
1142/* CAN Controller 0 Acceptance Registers */
1143
1144#define CAN0_AM16L 0xffc02b80 /* CAN Controller 0 Mailbox 16 Acceptance Mask High Register */
1145#define CAN0_AM16H 0xffc02b84 /* CAN Controller 0 Mailbox 16 Acceptance Mask Low Register */
1146#define CAN0_AM17L 0xffc02b88 /* CAN Controller 0 Mailbox 17 Acceptance Mask High Register */
1147#define CAN0_AM17H 0xffc02b8c /* CAN Controller 0 Mailbox 17 Acceptance Mask Low Register */
1148#define CAN0_AM18L 0xffc02b90 /* CAN Controller 0 Mailbox 18 Acceptance Mask High Register */
1149#define CAN0_AM18H 0xffc02b94 /* CAN Controller 0 Mailbox 18 Acceptance Mask Low Register */
1150#define CAN0_AM19L 0xffc02b98 /* CAN Controller 0 Mailbox 19 Acceptance Mask High Register */
1151#define CAN0_AM19H 0xffc02b9c /* CAN Controller 0 Mailbox 19 Acceptance Mask Low Register */
1152#define CAN0_AM20L 0xffc02ba0 /* CAN Controller 0 Mailbox 20 Acceptance Mask High Register */
1153#define CAN0_AM20H 0xffc02ba4 /* CAN Controller 0 Mailbox 20 Acceptance Mask Low Register */
1154#define CAN0_AM21L 0xffc02ba8 /* CAN Controller 0 Mailbox 21 Acceptance Mask High Register */
1155#define CAN0_AM21H 0xffc02bac /* CAN Controller 0 Mailbox 21 Acceptance Mask Low Register */
1156#define CAN0_AM22L 0xffc02bb0 /* CAN Controller 0 Mailbox 22 Acceptance Mask High Register */
1157#define CAN0_AM22H 0xffc02bb4 /* CAN Controller 0 Mailbox 22 Acceptance Mask Low Register */
1158#define CAN0_AM23L 0xffc02bb8 /* CAN Controller 0 Mailbox 23 Acceptance Mask High Register */
1159#define CAN0_AM23H 0xffc02bbc /* CAN Controller 0 Mailbox 23 Acceptance Mask Low Register */
1160#define CAN0_AM24L 0xffc02bc0 /* CAN Controller 0 Mailbox 24 Acceptance Mask High Register */
1161#define CAN0_AM24H 0xffc02bc4 /* CAN Controller 0 Mailbox 24 Acceptance Mask Low Register */
1162#define CAN0_AM25L 0xffc02bc8 /* CAN Controller 0 Mailbox 25 Acceptance Mask High Register */
1163#define CAN0_AM25H 0xffc02bcc /* CAN Controller 0 Mailbox 25 Acceptance Mask Low Register */
1164#define CAN0_AM26L 0xffc02bd0 /* CAN Controller 0 Mailbox 26 Acceptance Mask High Register */
1165#define CAN0_AM26H 0xffc02bd4 /* CAN Controller 0 Mailbox 26 Acceptance Mask Low Register */
1166#define CAN0_AM27L 0xffc02bd8 /* CAN Controller 0 Mailbox 27 Acceptance Mask High Register */
1167#define CAN0_AM27H 0xffc02bdc /* CAN Controller 0 Mailbox 27 Acceptance Mask Low Register */
1168#define CAN0_AM28L 0xffc02be0 /* CAN Controller 0 Mailbox 28 Acceptance Mask High Register */
1169#define CAN0_AM28H 0xffc02be4 /* CAN Controller 0 Mailbox 28 Acceptance Mask Low Register */
1170#define CAN0_AM29L 0xffc02be8 /* CAN Controller 0 Mailbox 29 Acceptance Mask High Register */
1171#define CAN0_AM29H 0xffc02bec /* CAN Controller 0 Mailbox 29 Acceptance Mask Low Register */
1172#define CAN0_AM30L 0xffc02bf0 /* CAN Controller 0 Mailbox 30 Acceptance Mask High Register */
1173#define CAN0_AM30H 0xffc02bf4 /* CAN Controller 0 Mailbox 30 Acceptance Mask Low Register */
1174#define CAN0_AM31L 0xffc02bf8 /* CAN Controller 0 Mailbox 31 Acceptance Mask High Register */
1175#define CAN0_AM31H 0xffc02bfc /* CAN Controller 0 Mailbox 31 Acceptance Mask Low Register */
1176
1177/* CAN Controller 0 Mailbox Data Registers */
1178
1179#define CAN0_MB00_DATA0 0xffc02c00 /* CAN Controller 0 Mailbox 0 Data 0 Register */
1180#define CAN0_MB00_DATA1 0xffc02c04 /* CAN Controller 0 Mailbox 0 Data 1 Register */
1181#define CAN0_MB00_DATA2 0xffc02c08 /* CAN Controller 0 Mailbox 0 Data 2 Register */
1182#define CAN0_MB00_DATA3 0xffc02c0c /* CAN Controller 0 Mailbox 0 Data 3 Register */
1183#define CAN0_MB00_LENGTH 0xffc02c10 /* CAN Controller 0 Mailbox 0 Length Register */
1184#define CAN0_MB00_TIMESTAMP 0xffc02c14 /* CAN Controller 0 Mailbox 0 Timestamp Register */
1185#define CAN0_MB00_ID0 0xffc02c18 /* CAN Controller 0 Mailbox 0 ID0 Register */
1186#define CAN0_MB00_ID1 0xffc02c1c /* CAN Controller 0 Mailbox 0 ID1 Register */
1187#define CAN0_MB01_DATA0 0xffc02c20 /* CAN Controller 0 Mailbox 1 Data 0 Register */
1188#define CAN0_MB01_DATA1 0xffc02c24 /* CAN Controller 0 Mailbox 1 Data 1 Register */
1189#define CAN0_MB01_DATA2 0xffc02c28 /* CAN Controller 0 Mailbox 1 Data 2 Register */
1190#define CAN0_MB01_DATA3 0xffc02c2c /* CAN Controller 0 Mailbox 1 Data 3 Register */
1191#define CAN0_MB01_LENGTH 0xffc02c30 /* CAN Controller 0 Mailbox 1 Length Register */
1192#define CAN0_MB01_TIMESTAMP 0xffc02c34 /* CAN Controller 0 Mailbox 1 Timestamp Register */
1193#define CAN0_MB01_ID0 0xffc02c38 /* CAN Controller 0 Mailbox 1 ID0 Register */
1194#define CAN0_MB01_ID1 0xffc02c3c /* CAN Controller 0 Mailbox 1 ID1 Register */
1195#define CAN0_MB02_DATA0 0xffc02c40 /* CAN Controller 0 Mailbox 2 Data 0 Register */
1196#define CAN0_MB02_DATA1 0xffc02c44 /* CAN Controller 0 Mailbox 2 Data 1 Register */
1197#define CAN0_MB02_DATA2 0xffc02c48 /* CAN Controller 0 Mailbox 2 Data 2 Register */
1198#define CAN0_MB02_DATA3 0xffc02c4c /* CAN Controller 0 Mailbox 2 Data 3 Register */
1199#define CAN0_MB02_LENGTH 0xffc02c50 /* CAN Controller 0 Mailbox 2 Length Register */
1200#define CAN0_MB02_TIMESTAMP 0xffc02c54 /* CAN Controller 0 Mailbox 2 Timestamp Register */
1201#define CAN0_MB02_ID0 0xffc02c58 /* CAN Controller 0 Mailbox 2 ID0 Register */
1202#define CAN0_MB02_ID1 0xffc02c5c /* CAN Controller 0 Mailbox 2 ID1 Register */
1203#define CAN0_MB03_DATA0 0xffc02c60 /* CAN Controller 0 Mailbox 3 Data 0 Register */
1204#define CAN0_MB03_DATA1 0xffc02c64 /* CAN Controller 0 Mailbox 3 Data 1 Register */
1205#define CAN0_MB03_DATA2 0xffc02c68 /* CAN Controller 0 Mailbox 3 Data 2 Register */
1206#define CAN0_MB03_DATA3 0xffc02c6c /* CAN Controller 0 Mailbox 3 Data 3 Register */
1207#define CAN0_MB03_LENGTH 0xffc02c70 /* CAN Controller 0 Mailbox 3 Length Register */
1208#define CAN0_MB03_TIMESTAMP 0xffc02c74 /* CAN Controller 0 Mailbox 3 Timestamp Register */
1209#define CAN0_MB03_ID0 0xffc02c78 /* CAN Controller 0 Mailbox 3 ID0 Register */
1210#define CAN0_MB03_ID1 0xffc02c7c /* CAN Controller 0 Mailbox 3 ID1 Register */
1211#define CAN0_MB04_DATA0 0xffc02c80 /* CAN Controller 0 Mailbox 4 Data 0 Register */
1212#define CAN0_MB04_DATA1 0xffc02c84 /* CAN Controller 0 Mailbox 4 Data 1 Register */
1213#define CAN0_MB04_DATA2 0xffc02c88 /* CAN Controller 0 Mailbox 4 Data 2 Register */
1214#define CAN0_MB04_DATA3 0xffc02c8c /* CAN Controller 0 Mailbox 4 Data 3 Register */
1215#define CAN0_MB04_LENGTH 0xffc02c90 /* CAN Controller 0 Mailbox 4 Length Register */
1216#define CAN0_MB04_TIMESTAMP 0xffc02c94 /* CAN Controller 0 Mailbox 4 Timestamp Register */
1217#define CAN0_MB04_ID0 0xffc02c98 /* CAN Controller 0 Mailbox 4 ID0 Register */
1218#define CAN0_MB04_ID1 0xffc02c9c /* CAN Controller 0 Mailbox 4 ID1 Register */
1219#define CAN0_MB05_DATA0 0xffc02ca0 /* CAN Controller 0 Mailbox 5 Data 0 Register */
1220#define CAN0_MB05_DATA1 0xffc02ca4 /* CAN Controller 0 Mailbox 5 Data 1 Register */
1221#define CAN0_MB05_DATA2 0xffc02ca8 /* CAN Controller 0 Mailbox 5 Data 2 Register */
1222#define CAN0_MB05_DATA3 0xffc02cac /* CAN Controller 0 Mailbox 5 Data 3 Register */
1223#define CAN0_MB05_LENGTH 0xffc02cb0 /* CAN Controller 0 Mailbox 5 Length Register */
1224#define CAN0_MB05_TIMESTAMP 0xffc02cb4 /* CAN Controller 0 Mailbox 5 Timestamp Register */
1225#define CAN0_MB05_ID0 0xffc02cb8 /* CAN Controller 0 Mailbox 5 ID0 Register */
1226#define CAN0_MB05_ID1 0xffc02cbc /* CAN Controller 0 Mailbox 5 ID1 Register */
1227#define CAN0_MB06_DATA0 0xffc02cc0 /* CAN Controller 0 Mailbox 6 Data 0 Register */
1228#define CAN0_MB06_DATA1 0xffc02cc4 /* CAN Controller 0 Mailbox 6 Data 1 Register */
1229#define CAN0_MB06_DATA2 0xffc02cc8 /* CAN Controller 0 Mailbox 6 Data 2 Register */
1230#define CAN0_MB06_DATA3 0xffc02ccc /* CAN Controller 0 Mailbox 6 Data 3 Register */
1231#define CAN0_MB06_LENGTH 0xffc02cd0 /* CAN Controller 0 Mailbox 6 Length Register */
1232#define CAN0_MB06_TIMESTAMP 0xffc02cd4 /* CAN Controller 0 Mailbox 6 Timestamp Register */
1233#define CAN0_MB06_ID0 0xffc02cd8 /* CAN Controller 0 Mailbox 6 ID0 Register */
1234#define CAN0_MB06_ID1 0xffc02cdc /* CAN Controller 0 Mailbox 6 ID1 Register */
1235#define CAN0_MB07_DATA0 0xffc02ce0 /* CAN Controller 0 Mailbox 7 Data 0 Register */
1236#define CAN0_MB07_DATA1 0xffc02ce4 /* CAN Controller 0 Mailbox 7 Data 1 Register */
1237#define CAN0_MB07_DATA2 0xffc02ce8 /* CAN Controller 0 Mailbox 7 Data 2 Register */
1238#define CAN0_MB07_DATA3 0xffc02cec /* CAN Controller 0 Mailbox 7 Data 3 Register */
1239#define CAN0_MB07_LENGTH 0xffc02cf0 /* CAN Controller 0 Mailbox 7 Length Register */
1240#define CAN0_MB07_TIMESTAMP 0xffc02cf4 /* CAN Controller 0 Mailbox 7 Timestamp Register */
1241#define CAN0_MB07_ID0 0xffc02cf8 /* CAN Controller 0 Mailbox 7 ID0 Register */
1242#define CAN0_MB07_ID1 0xffc02cfc /* CAN Controller 0 Mailbox 7 ID1 Register */
1243#define CAN0_MB08_DATA0 0xffc02d00 /* CAN Controller 0 Mailbox 8 Data 0 Register */
1244#define CAN0_MB08_DATA1 0xffc02d04 /* CAN Controller 0 Mailbox 8 Data 1 Register */
1245#define CAN0_MB08_DATA2 0xffc02d08 /* CAN Controller 0 Mailbox 8 Data 2 Register */
1246#define CAN0_MB08_DATA3 0xffc02d0c /* CAN Controller 0 Mailbox 8 Data 3 Register */
1247#define CAN0_MB08_LENGTH 0xffc02d10 /* CAN Controller 0 Mailbox 8 Length Register */
1248#define CAN0_MB08_TIMESTAMP 0xffc02d14 /* CAN Controller 0 Mailbox 8 Timestamp Register */
1249#define CAN0_MB08_ID0 0xffc02d18 /* CAN Controller 0 Mailbox 8 ID0 Register */
1250#define CAN0_MB08_ID1 0xffc02d1c /* CAN Controller 0 Mailbox 8 ID1 Register */
1251#define CAN0_MB09_DATA0 0xffc02d20 /* CAN Controller 0 Mailbox 9 Data 0 Register */
1252#define CAN0_MB09_DATA1 0xffc02d24 /* CAN Controller 0 Mailbox 9 Data 1 Register */
1253#define CAN0_MB09_DATA2 0xffc02d28 /* CAN Controller 0 Mailbox 9 Data 2 Register */
1254#define CAN0_MB09_DATA3 0xffc02d2c /* CAN Controller 0 Mailbox 9 Data 3 Register */
1255#define CAN0_MB09_LENGTH 0xffc02d30 /* CAN Controller 0 Mailbox 9 Length Register */
1256#define CAN0_MB09_TIMESTAMP 0xffc02d34 /* CAN Controller 0 Mailbox 9 Timestamp Register */
1257#define CAN0_MB09_ID0 0xffc02d38 /* CAN Controller 0 Mailbox 9 ID0 Register */
1258#define CAN0_MB09_ID1 0xffc02d3c /* CAN Controller 0 Mailbox 9 ID1 Register */
1259#define CAN0_MB10_DATA0 0xffc02d40 /* CAN Controller 0 Mailbox 10 Data 0 Register */
1260#define CAN0_MB10_DATA1 0xffc02d44 /* CAN Controller 0 Mailbox 10 Data 1 Register */
1261#define CAN0_MB10_DATA2 0xffc02d48 /* CAN Controller 0 Mailbox 10 Data 2 Register */
1262#define CAN0_MB10_DATA3 0xffc02d4c /* CAN Controller 0 Mailbox 10 Data 3 Register */
1263#define CAN0_MB10_LENGTH 0xffc02d50 /* CAN Controller 0 Mailbox 10 Length Register */
1264#define CAN0_MB10_TIMESTAMP 0xffc02d54 /* CAN Controller 0 Mailbox 10 Timestamp Register */
1265#define CAN0_MB10_ID0 0xffc02d58 /* CAN Controller 0 Mailbox 10 ID0 Register */
1266#define CAN0_MB10_ID1 0xffc02d5c /* CAN Controller 0 Mailbox 10 ID1 Register */
1267#define CAN0_MB11_DATA0 0xffc02d60 /* CAN Controller 0 Mailbox 11 Data 0 Register */
1268#define CAN0_MB11_DATA1 0xffc02d64 /* CAN Controller 0 Mailbox 11 Data 1 Register */
1269#define CAN0_MB11_DATA2 0xffc02d68 /* CAN Controller 0 Mailbox 11 Data 2 Register */
1270#define CAN0_MB11_DATA3 0xffc02d6c /* CAN Controller 0 Mailbox 11 Data 3 Register */
1271#define CAN0_MB11_LENGTH 0xffc02d70 /* CAN Controller 0 Mailbox 11 Length Register */
1272#define CAN0_MB11_TIMESTAMP 0xffc02d74 /* CAN Controller 0 Mailbox 11 Timestamp Register */
1273#define CAN0_MB11_ID0 0xffc02d78 /* CAN Controller 0 Mailbox 11 ID0 Register */
1274#define CAN0_MB11_ID1 0xffc02d7c /* CAN Controller 0 Mailbox 11 ID1 Register */
1275#define CAN0_MB12_DATA0 0xffc02d80 /* CAN Controller 0 Mailbox 12 Data 0 Register */
1276#define CAN0_MB12_DATA1 0xffc02d84 /* CAN Controller 0 Mailbox 12 Data 1 Register */
1277#define CAN0_MB12_DATA2 0xffc02d88 /* CAN Controller 0 Mailbox 12 Data 2 Register */
1278#define CAN0_MB12_DATA3 0xffc02d8c /* CAN Controller 0 Mailbox 12 Data 3 Register */
1279#define CAN0_MB12_LENGTH 0xffc02d90 /* CAN Controller 0 Mailbox 12 Length Register */
1280#define CAN0_MB12_TIMESTAMP 0xffc02d94 /* CAN Controller 0 Mailbox 12 Timestamp Register */
1281#define CAN0_MB12_ID0 0xffc02d98 /* CAN Controller 0 Mailbox 12 ID0 Register */
1282#define CAN0_MB12_ID1 0xffc02d9c /* CAN Controller 0 Mailbox 12 ID1 Register */
1283#define CAN0_MB13_DATA0 0xffc02da0 /* CAN Controller 0 Mailbox 13 Data 0 Register */
1284#define CAN0_MB13_DATA1 0xffc02da4 /* CAN Controller 0 Mailbox 13 Data 1 Register */
1285#define CAN0_MB13_DATA2 0xffc02da8 /* CAN Controller 0 Mailbox 13 Data 2 Register */
1286#define CAN0_MB13_DATA3 0xffc02dac /* CAN Controller 0 Mailbox 13 Data 3 Register */
1287#define CAN0_MB13_LENGTH 0xffc02db0 /* CAN Controller 0 Mailbox 13 Length Register */
1288#define CAN0_MB13_TIMESTAMP 0xffc02db4 /* CAN Controller 0 Mailbox 13 Timestamp Register */
1289#define CAN0_MB13_ID0 0xffc02db8 /* CAN Controller 0 Mailbox 13 ID0 Register */
1290#define CAN0_MB13_ID1 0xffc02dbc /* CAN Controller 0 Mailbox 13 ID1 Register */
1291#define CAN0_MB14_DATA0 0xffc02dc0 /* CAN Controller 0 Mailbox 14 Data 0 Register */
1292#define CAN0_MB14_DATA1 0xffc02dc4 /* CAN Controller 0 Mailbox 14 Data 1 Register */
1293#define CAN0_MB14_DATA2 0xffc02dc8 /* CAN Controller 0 Mailbox 14 Data 2 Register */
1294#define CAN0_MB14_DATA3 0xffc02dcc /* CAN Controller 0 Mailbox 14 Data 3 Register */
1295#define CAN0_MB14_LENGTH 0xffc02dd0 /* CAN Controller 0 Mailbox 14 Length Register */
1296#define CAN0_MB14_TIMESTAMP 0xffc02dd4 /* CAN Controller 0 Mailbox 14 Timestamp Register */
1297#define CAN0_MB14_ID0 0xffc02dd8 /* CAN Controller 0 Mailbox 14 ID0 Register */
1298#define CAN0_MB14_ID1 0xffc02ddc /* CAN Controller 0 Mailbox 14 ID1 Register */
1299#define CAN0_MB15_DATA0 0xffc02de0 /* CAN Controller 0 Mailbox 15 Data 0 Register */
1300#define CAN0_MB15_DATA1 0xffc02de4 /* CAN Controller 0 Mailbox 15 Data 1 Register */
1301#define CAN0_MB15_DATA2 0xffc02de8 /* CAN Controller 0 Mailbox 15 Data 2 Register */
1302#define CAN0_MB15_DATA3 0xffc02dec /* CAN Controller 0 Mailbox 15 Data 3 Register */
1303#define CAN0_MB15_LENGTH 0xffc02df0 /* CAN Controller 0 Mailbox 15 Length Register */
1304#define CAN0_MB15_TIMESTAMP 0xffc02df4 /* CAN Controller 0 Mailbox 15 Timestamp Register */
1305#define CAN0_MB15_ID0 0xffc02df8 /* CAN Controller 0 Mailbox 15 ID0 Register */
1306#define CAN0_MB15_ID1 0xffc02dfc /* CAN Controller 0 Mailbox 15 ID1 Register */
1307
1308/* CAN Controller 0 Mailbox Data Registers */
1309
1310#define CAN0_MB16_DATA0 0xffc02e00 /* CAN Controller 0 Mailbox 16 Data 0 Register */
1311#define CAN0_MB16_DATA1 0xffc02e04 /* CAN Controller 0 Mailbox 16 Data 1 Register */
1312#define CAN0_MB16_DATA2 0xffc02e08 /* CAN Controller 0 Mailbox 16 Data 2 Register */
1313#define CAN0_MB16_DATA3 0xffc02e0c /* CAN Controller 0 Mailbox 16 Data 3 Register */
1314#define CAN0_MB16_LENGTH 0xffc02e10 /* CAN Controller 0 Mailbox 16 Length Register */
1315#define CAN0_MB16_TIMESTAMP 0xffc02e14 /* CAN Controller 0 Mailbox 16 Timestamp Register */
1316#define CAN0_MB16_ID0 0xffc02e18 /* CAN Controller 0 Mailbox 16 ID0 Register */
1317#define CAN0_MB16_ID1 0xffc02e1c /* CAN Controller 0 Mailbox 16 ID1 Register */
1318#define CAN0_MB17_DATA0 0xffc02e20 /* CAN Controller 0 Mailbox 17 Data 0 Register */
1319#define CAN0_MB17_DATA1 0xffc02e24 /* CAN Controller 0 Mailbox 17 Data 1 Register */
1320#define CAN0_MB17_DATA2 0xffc02e28 /* CAN Controller 0 Mailbox 17 Data 2 Register */
1321#define CAN0_MB17_DATA3 0xffc02e2c /* CAN Controller 0 Mailbox 17 Data 3 Register */
1322#define CAN0_MB17_LENGTH 0xffc02e30 /* CAN Controller 0 Mailbox 17 Length Register */
1323#define CAN0_MB17_TIMESTAMP 0xffc02e34 /* CAN Controller 0 Mailbox 17 Timestamp Register */
1324#define CAN0_MB17_ID0 0xffc02e38 /* CAN Controller 0 Mailbox 17 ID0 Register */
1325#define CAN0_MB17_ID1 0xffc02e3c /* CAN Controller 0 Mailbox 17 ID1 Register */
1326#define CAN0_MB18_DATA0 0xffc02e40 /* CAN Controller 0 Mailbox 18 Data 0 Register */
1327#define CAN0_MB18_DATA1 0xffc02e44 /* CAN Controller 0 Mailbox 18 Data 1 Register */
1328#define CAN0_MB18_DATA2 0xffc02e48 /* CAN Controller 0 Mailbox 18 Data 2 Register */
1329#define CAN0_MB18_DATA3 0xffc02e4c /* CAN Controller 0 Mailbox 18 Data 3 Register */
1330#define CAN0_MB18_LENGTH 0xffc02e50 /* CAN Controller 0 Mailbox 18 Length Register */
1331#define CAN0_MB18_TIMESTAMP 0xffc02e54 /* CAN Controller 0 Mailbox 18 Timestamp Register */
1332#define CAN0_MB18_ID0 0xffc02e58 /* CAN Controller 0 Mailbox 18 ID0 Register */
1333#define CAN0_MB18_ID1 0xffc02e5c /* CAN Controller 0 Mailbox 18 ID1 Register */
1334#define CAN0_MB19_DATA0 0xffc02e60 /* CAN Controller 0 Mailbox 19 Data 0 Register */
1335#define CAN0_MB19_DATA1 0xffc02e64 /* CAN Controller 0 Mailbox 19 Data 1 Register */
1336#define CAN0_MB19_DATA2 0xffc02e68 /* CAN Controller 0 Mailbox 19 Data 2 Register */
1337#define CAN0_MB19_DATA3 0xffc02e6c /* CAN Controller 0 Mailbox 19 Data 3 Register */
1338#define CAN0_MB19_LENGTH 0xffc02e70 /* CAN Controller 0 Mailbox 19 Length Register */
1339#define CAN0_MB19_TIMESTAMP 0xffc02e74 /* CAN Controller 0 Mailbox 19 Timestamp Register */
1340#define CAN0_MB19_ID0 0xffc02e78 /* CAN Controller 0 Mailbox 19 ID0 Register */
1341#define CAN0_MB19_ID1 0xffc02e7c /* CAN Controller 0 Mailbox 19 ID1 Register */
1342#define CAN0_MB20_DATA0 0xffc02e80 /* CAN Controller 0 Mailbox 20 Data 0 Register */
1343#define CAN0_MB20_DATA1 0xffc02e84 /* CAN Controller 0 Mailbox 20 Data 1 Register */
1344#define CAN0_MB20_DATA2 0xffc02e88 /* CAN Controller 0 Mailbox 20 Data 2 Register */
1345#define CAN0_MB20_DATA3 0xffc02e8c /* CAN Controller 0 Mailbox 20 Data 3 Register */
1346#define CAN0_MB20_LENGTH 0xffc02e90 /* CAN Controller 0 Mailbox 20 Length Register */
1347#define CAN0_MB20_TIMESTAMP 0xffc02e94 /* CAN Controller 0 Mailbox 20 Timestamp Register */
1348#define CAN0_MB20_ID0 0xffc02e98 /* CAN Controller 0 Mailbox 20 ID0 Register */
1349#define CAN0_MB20_ID1 0xffc02e9c /* CAN Controller 0 Mailbox 20 ID1 Register */
1350#define CAN0_MB21_DATA0 0xffc02ea0 /* CAN Controller 0 Mailbox 21 Data 0 Register */
1351#define CAN0_MB21_DATA1 0xffc02ea4 /* CAN Controller 0 Mailbox 21 Data 1 Register */
1352#define CAN0_MB21_DATA2 0xffc02ea8 /* CAN Controller 0 Mailbox 21 Data 2 Register */
1353#define CAN0_MB21_DATA3 0xffc02eac /* CAN Controller 0 Mailbox 21 Data 3 Register */
1354#define CAN0_MB21_LENGTH 0xffc02eb0 /* CAN Controller 0 Mailbox 21 Length Register */
1355#define CAN0_MB21_TIMESTAMP 0xffc02eb4 /* CAN Controller 0 Mailbox 21 Timestamp Register */
1356#define CAN0_MB21_ID0 0xffc02eb8 /* CAN Controller 0 Mailbox 21 ID0 Register */
1357#define CAN0_MB21_ID1 0xffc02ebc /* CAN Controller 0 Mailbox 21 ID1 Register */
1358#define CAN0_MB22_DATA0 0xffc02ec0 /* CAN Controller 0 Mailbox 22 Data 0 Register */
1359#define CAN0_MB22_DATA1 0xffc02ec4 /* CAN Controller 0 Mailbox 22 Data 1 Register */
1360#define CAN0_MB22_DATA2 0xffc02ec8 /* CAN Controller 0 Mailbox 22 Data 2 Register */
1361#define CAN0_MB22_DATA3 0xffc02ecc /* CAN Controller 0 Mailbox 22 Data 3 Register */
1362#define CAN0_MB22_LENGTH 0xffc02ed0 /* CAN Controller 0 Mailbox 22 Length Register */
1363#define CAN0_MB22_TIMESTAMP 0xffc02ed4 /* CAN Controller 0 Mailbox 22 Timestamp Register */
1364#define CAN0_MB22_ID0 0xffc02ed8 /* CAN Controller 0 Mailbox 22 ID0 Register */
1365#define CAN0_MB22_ID1 0xffc02edc /* CAN Controller 0 Mailbox 22 ID1 Register */
1366#define CAN0_MB23_DATA0 0xffc02ee0 /* CAN Controller 0 Mailbox 23 Data 0 Register */
1367#define CAN0_MB23_DATA1 0xffc02ee4 /* CAN Controller 0 Mailbox 23 Data 1 Register */
1368#define CAN0_MB23_DATA2 0xffc02ee8 /* CAN Controller 0 Mailbox 23 Data 2 Register */
1369#define CAN0_MB23_DATA3 0xffc02eec /* CAN Controller 0 Mailbox 23 Data 3 Register */
1370#define CAN0_MB23_LENGTH 0xffc02ef0 /* CAN Controller 0 Mailbox 23 Length Register */
1371#define CAN0_MB23_TIMESTAMP 0xffc02ef4 /* CAN Controller 0 Mailbox 23 Timestamp Register */
1372#define CAN0_MB23_ID0 0xffc02ef8 /* CAN Controller 0 Mailbox 23 ID0 Register */
1373#define CAN0_MB23_ID1 0xffc02efc /* CAN Controller 0 Mailbox 23 ID1 Register */
1374#define CAN0_MB24_DATA0 0xffc02f00 /* CAN Controller 0 Mailbox 24 Data 0 Register */
1375#define CAN0_MB24_DATA1 0xffc02f04 /* CAN Controller 0 Mailbox 24 Data 1 Register */
1376#define CAN0_MB24_DATA2 0xffc02f08 /* CAN Controller 0 Mailbox 24 Data 2 Register */
1377#define CAN0_MB24_DATA3 0xffc02f0c /* CAN Controller 0 Mailbox 24 Data 3 Register */
1378#define CAN0_MB24_LENGTH 0xffc02f10 /* CAN Controller 0 Mailbox 24 Length Register */
1379#define CAN0_MB24_TIMESTAMP 0xffc02f14 /* CAN Controller 0 Mailbox 24 Timestamp Register */
1380#define CAN0_MB24_ID0 0xffc02f18 /* CAN Controller 0 Mailbox 24 ID0 Register */
1381#define CAN0_MB24_ID1 0xffc02f1c /* CAN Controller 0 Mailbox 24 ID1 Register */
1382#define CAN0_MB25_DATA0 0xffc02f20 /* CAN Controller 0 Mailbox 25 Data 0 Register */
1383#define CAN0_MB25_DATA1 0xffc02f24 /* CAN Controller 0 Mailbox 25 Data 1 Register */
1384#define CAN0_MB25_DATA2 0xffc02f28 /* CAN Controller 0 Mailbox 25 Data 2 Register */
1385#define CAN0_MB25_DATA3 0xffc02f2c /* CAN Controller 0 Mailbox 25 Data 3 Register */
1386#define CAN0_MB25_LENGTH 0xffc02f30 /* CAN Controller 0 Mailbox 25 Length Register */
1387#define CAN0_MB25_TIMESTAMP 0xffc02f34 /* CAN Controller 0 Mailbox 25 Timestamp Register */
1388#define CAN0_MB25_ID0 0xffc02f38 /* CAN Controller 0 Mailbox 25 ID0 Register */
1389#define CAN0_MB25_ID1 0xffc02f3c /* CAN Controller 0 Mailbox 25 ID1 Register */
1390#define CAN0_MB26_DATA0 0xffc02f40 /* CAN Controller 0 Mailbox 26 Data 0 Register */
1391#define CAN0_MB26_DATA1 0xffc02f44 /* CAN Controller 0 Mailbox 26 Data 1 Register */
1392#define CAN0_MB26_DATA2 0xffc02f48 /* CAN Controller 0 Mailbox 26 Data 2 Register */
1393#define CAN0_MB26_DATA3 0xffc02f4c /* CAN Controller 0 Mailbox 26 Data 3 Register */
1394#define CAN0_MB26_LENGTH 0xffc02f50 /* CAN Controller 0 Mailbox 26 Length Register */
1395#define CAN0_MB26_TIMESTAMP 0xffc02f54 /* CAN Controller 0 Mailbox 26 Timestamp Register */
1396#define CAN0_MB26_ID0 0xffc02f58 /* CAN Controller 0 Mailbox 26 ID0 Register */
1397#define CAN0_MB26_ID1 0xffc02f5c /* CAN Controller 0 Mailbox 26 ID1 Register */
1398#define CAN0_MB27_DATA0 0xffc02f60 /* CAN Controller 0 Mailbox 27 Data 0 Register */
1399#define CAN0_MB27_DATA1 0xffc02f64 /* CAN Controller 0 Mailbox 27 Data 1 Register */
1400#define CAN0_MB27_DATA2 0xffc02f68 /* CAN Controller 0 Mailbox 27 Data 2 Register */
1401#define CAN0_MB27_DATA3 0xffc02f6c /* CAN Controller 0 Mailbox 27 Data 3 Register */
1402#define CAN0_MB27_LENGTH 0xffc02f70 /* CAN Controller 0 Mailbox 27 Length Register */
1403#define CAN0_MB27_TIMESTAMP 0xffc02f74 /* CAN Controller 0 Mailbox 27 Timestamp Register */
1404#define CAN0_MB27_ID0 0xffc02f78 /* CAN Controller 0 Mailbox 27 ID0 Register */
1405#define CAN0_MB27_ID1 0xffc02f7c /* CAN Controller 0 Mailbox 27 ID1 Register */
1406#define CAN0_MB28_DATA0 0xffc02f80 /* CAN Controller 0 Mailbox 28 Data 0 Register */
1407#define CAN0_MB28_DATA1 0xffc02f84 /* CAN Controller 0 Mailbox 28 Data 1 Register */
1408#define CAN0_MB28_DATA2 0xffc02f88 /* CAN Controller 0 Mailbox 28 Data 2 Register */
1409#define CAN0_MB28_DATA3 0xffc02f8c /* CAN Controller 0 Mailbox 28 Data 3 Register */
1410#define CAN0_MB28_LENGTH 0xffc02f90 /* CAN Controller 0 Mailbox 28 Length Register */
1411#define CAN0_MB28_TIMESTAMP 0xffc02f94 /* CAN Controller 0 Mailbox 28 Timestamp Register */
1412#define CAN0_MB28_ID0 0xffc02f98 /* CAN Controller 0 Mailbox 28 ID0 Register */
1413#define CAN0_MB28_ID1 0xffc02f9c /* CAN Controller 0 Mailbox 28 ID1 Register */
1414#define CAN0_MB29_DATA0 0xffc02fa0 /* CAN Controller 0 Mailbox 29 Data 0 Register */
1415#define CAN0_MB29_DATA1 0xffc02fa4 /* CAN Controller 0 Mailbox 29 Data 1 Register */
1416#define CAN0_MB29_DATA2 0xffc02fa8 /* CAN Controller 0 Mailbox 29 Data 2 Register */
1417#define CAN0_MB29_DATA3 0xffc02fac /* CAN Controller 0 Mailbox 29 Data 3 Register */
1418#define CAN0_MB29_LENGTH 0xffc02fb0 /* CAN Controller 0 Mailbox 29 Length Register */
1419#define CAN0_MB29_TIMESTAMP 0xffc02fb4 /* CAN Controller 0 Mailbox 29 Timestamp Register */
1420#define CAN0_MB29_ID0 0xffc02fb8 /* CAN Controller 0 Mailbox 29 ID0 Register */
1421#define CAN0_MB29_ID1 0xffc02fbc /* CAN Controller 0 Mailbox 29 ID1 Register */
1422#define CAN0_MB30_DATA0 0xffc02fc0 /* CAN Controller 0 Mailbox 30 Data 0 Register */
1423#define CAN0_MB30_DATA1 0xffc02fc4 /* CAN Controller 0 Mailbox 30 Data 1 Register */
1424#define CAN0_MB30_DATA2 0xffc02fc8 /* CAN Controller 0 Mailbox 30 Data 2 Register */
1425#define CAN0_MB30_DATA3 0xffc02fcc /* CAN Controller 0 Mailbox 30 Data 3 Register */
1426#define CAN0_MB30_LENGTH 0xffc02fd0 /* CAN Controller 0 Mailbox 30 Length Register */
1427#define CAN0_MB30_TIMESTAMP 0xffc02fd4 /* CAN Controller 0 Mailbox 30 Timestamp Register */
1428#define CAN0_MB30_ID0 0xffc02fd8 /* CAN Controller 0 Mailbox 30 ID0 Register */
1429#define CAN0_MB30_ID1 0xffc02fdc /* CAN Controller 0 Mailbox 30 ID1 Register */
1430#define CAN0_MB31_DATA0 0xffc02fe0 /* CAN Controller 0 Mailbox 31 Data 0 Register */
1431#define CAN0_MB31_DATA1 0xffc02fe4 /* CAN Controller 0 Mailbox 31 Data 1 Register */
1432#define CAN0_MB31_DATA2 0xffc02fe8 /* CAN Controller 0 Mailbox 31 Data 2 Register */
1433#define CAN0_MB31_DATA3 0xffc02fec /* CAN Controller 0 Mailbox 31 Data 3 Register */
1434#define CAN0_MB31_LENGTH 0xffc02ff0 /* CAN Controller 0 Mailbox 31 Length Register */
1435#define CAN0_MB31_TIMESTAMP 0xffc02ff4 /* CAN Controller 0 Mailbox 31 Timestamp Register */
1436#define CAN0_MB31_ID0 0xffc02ff8 /* CAN Controller 0 Mailbox 31 ID0 Register */
1437#define CAN0_MB31_ID1 0xffc02ffc /* CAN Controller 0 Mailbox 31 ID1 Register */
1438
1439/* UART3 Registers */
1440
1441#define UART3_DLL 0xffc03100 /* Divisor Latch Low Byte */
1442#define UART3_DLH 0xffc03104 /* Divisor Latch High Byte */
1443#define UART3_GCTL 0xffc03108 /* Global Control Register */
1444#define UART3_LCR 0xffc0310c /* Line Control Register */
1445#define UART3_MCR 0xffc03110 /* Modem Control Register */
1446#define UART3_LSR 0xffc03114 /* Line Status Register */
1447#define UART3_MSR 0xffc03118 /* Modem Status Register */
1448#define UART3_SCR 0xffc0311c /* Scratch Register */
1449#define UART3_IER_SET 0xffc03120 /* Interrupt Enable Register Set */
1450#define UART3_IER_CLEAR 0xffc03124 /* Interrupt Enable Register Clear */
1451#define UART3_THR 0xffc03128 /* Transmit Hold Register */
1452#define UART3_RBR 0xffc0312c /* Receive Buffer Register */
1453
1454/* NFC Registers */
1455
1456#define NFC_CTL 0xffc03b00 /* NAND Control Register */
1457#define NFC_STAT 0xffc03b04 /* NAND Status Register */
1458#define NFC_IRQSTAT 0xffc03b08 /* NAND Interrupt Status Register */
1459#define NFC_IRQMASK 0xffc03b0c /* NAND Interrupt Mask Register */
1460#define NFC_ECC0 0xffc03b10 /* NAND ECC Register 0 */
1461#define NFC_ECC1 0xffc03b14 /* NAND ECC Register 1 */
1462#define NFC_ECC2 0xffc03b18 /* NAND ECC Register 2 */
1463#define NFC_ECC3 0xffc03b1c /* NAND ECC Register 3 */
1464#define NFC_COUNT 0xffc03b20 /* NAND ECC Count Register */
1465#define NFC_RST 0xffc03b24 /* NAND ECC Reset Register */
1466#define NFC_PGCTL 0xffc03b28 /* NAND Page Control Register */
1467#define NFC_READ 0xffc03b2c /* NAND Read Data Register */
1468#define NFC_ADDR 0xffc03b40 /* NAND Address Register */
1469#define NFC_CMD 0xffc03b44 /* NAND Command Register */
1470#define NFC_DATA_WR 0xffc03b48 /* NAND Data Write Register */
1471#define NFC_DATA_RD 0xffc03b4c /* NAND Data Read Register */
1472
1473/* Counter Registers */
1474
1475#define CNT_CONFIG 0xffc04200 /* Configuration Register */
1476#define CNT_IMASK 0xffc04204 /* Interrupt Mask Register */
1477#define CNT_STATUS 0xffc04208 /* Status Register */
1478#define CNT_COMMAND 0xffc0420c /* Command Register */
1479#define CNT_DEBOUNCE 0xffc04210 /* Debounce Register */
1480#define CNT_COUNTER 0xffc04214 /* Counter Register */
1481#define CNT_MAX 0xffc04218 /* Maximal Count Register */
1482#define CNT_MIN 0xffc0421c /* Minimal Count Register */
1483
1484/* OTP/FUSE Registers */
1485
1486#define OTP_CONTROL 0xffc04300 /* OTP/Fuse Control Register */
1487#define OTP_BEN 0xffc04304 /* OTP/Fuse Byte Enable */
1488#define OTP_STATUS 0xffc04308 /* OTP/Fuse Status */
1489#define OTP_TIMING 0xffc0430c /* OTP/Fuse Access Timing */
1490
1491/* Security Registers */
1492
1493#define SECURE_SYSSWT 0xffc04320 /* Secure System Switches */
1494#define SECURE_CONTROL 0xffc04324 /* Secure Control */
1495#define SECURE_STATUS 0xffc04328 /* Secure Status */
1496
1497/* DMA Peripheral Mux Register */
1498
1499#define DMAC1_PERIMUX 0xffc04340 /* DMA Controller 1 Peripheral Multiplexer Register */
1500
1501/* OTP Read/Write Data Buffer Registers */
1502
1503#define OTP_DATA0 0xffc04380 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1504#define OTP_DATA1 0xffc04384 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1505#define OTP_DATA2 0xffc04388 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1506#define OTP_DATA3 0xffc0438c /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1507
1508/* Handshake MDMA is not defined in the shared file because it is not available on the ADSP-BF542 processor */
1509
1510/* ********************************************************** */
1511/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
1512/* and MULTI BIT READ MACROS */
1513/* ********************************************************** */
1514
1515/* Bit masks for SIC_IAR0 */
1516
1517#define IRQ_PLL_WAKEUP 0x1 /* PLL Wakeup */
1518#define nIRQ_PLL_WAKEUP 0x0
1519
1520/* Bit masks for SIC_IWR0, SIC_IMASK0, SIC_ISR0 */
1521
1522#define IRQ_DMA0_ERR 0x2 /* DMA Controller 0 Error */
1523#define nIRQ_DMA0_ERR 0x0
1524#define IRQ_EPPI0_ERR 0x4 /* EPPI0 Error */
1525#define nIRQ_EPPI0_ERR 0x0
1526#define IRQ_SPORT0_ERR 0x8 /* SPORT0 Error */
1527#define nIRQ_SPORT0_ERR 0x0
1528#define IRQ_SPORT1_ERR 0x10 /* SPORT1 Error */
1529#define nIRQ_SPORT1_ERR 0x0
1530#define IRQ_SPI0_ERR 0x20 /* SPI0 Error */
1531#define nIRQ_SPI0_ERR 0x0
1532#define IRQ_UART0_ERR 0x40 /* UART0 Error */
1533#define nIRQ_UART0_ERR 0x0
1534#define IRQ_RTC 0x80 /* Real-Time Clock */
1535#define nIRQ_RTC 0x0
1536#define IRQ_DMA12 0x100 /* DMA Channel 12 */
1537#define nIRQ_DMA12 0x0
1538#define IRQ_DMA0 0x200 /* DMA Channel 0 */
1539#define nIRQ_DMA0 0x0
1540#define IRQ_DMA1 0x400 /* DMA Channel 1 */
1541#define nIRQ_DMA1 0x0
1542#define IRQ_DMA2 0x800 /* DMA Channel 2 */
1543#define nIRQ_DMA2 0x0
1544#define IRQ_DMA3 0x1000 /* DMA Channel 3 */
1545#define nIRQ_DMA3 0x0
1546#define IRQ_DMA4 0x2000 /* DMA Channel 4 */
1547#define nIRQ_DMA4 0x0
1548#define IRQ_DMA6 0x4000 /* DMA Channel 6 */
1549#define nIRQ_DMA6 0x0
1550#define IRQ_DMA7 0x8000 /* DMA Channel 7 */
1551#define nIRQ_DMA7 0x0
1552#define IRQ_PINT0 0x80000 /* Pin Interrupt 0 */
1553#define nIRQ_PINT0 0x0
1554#define IRQ_PINT1 0x100000 /* Pin Interrupt 1 */
1555#define nIRQ_PINT1 0x0
1556#define IRQ_MDMA0 0x200000 /* Memory DMA Stream 0 */
1557#define nIRQ_MDMA0 0x0
1558#define IRQ_MDMA1 0x400000 /* Memory DMA Stream 1 */
1559#define nIRQ_MDMA1 0x0
1560#define IRQ_WDOG 0x800000 /* Watchdog Timer */
1561#define nIRQ_WDOG 0x0
1562#define IRQ_DMA1_ERR 0x1000000 /* DMA Controller 1 Error */
1563#define nIRQ_DMA1_ERR 0x0
1564#define IRQ_SPORT2_ERR 0x2000000 /* SPORT2 Error */
1565#define nIRQ_SPORT2_ERR 0x0
1566#define IRQ_SPORT3_ERR 0x4000000 /* SPORT3 Error */
1567#define nIRQ_SPORT3_ERR 0x0
1568#define IRQ_MXVR_SD 0x8000000 /* MXVR Synchronous Data */
1569#define nIRQ_MXVR_SD 0x0
1570#define IRQ_SPI1_ERR 0x10000000 /* SPI1 Error */
1571#define nIRQ_SPI1_ERR 0x0
1572#define IRQ_SPI2_ERR 0x20000000 /* SPI2 Error */
1573#define nIRQ_SPI2_ERR 0x0
1574#define IRQ_UART1_ERR 0x40000000 /* UART1 Error */
1575#define nIRQ_UART1_ERR 0x0
1576#define IRQ_UART2_ERR 0x80000000 /* UART2 Error */
1577#define nIRQ_UART2_ERR 0x0
1578
1579/* Bit masks for SIC_IWR1, SIC_IMASK1, SIC_ISR1 */
1580
1581#define IRQ_CAN0_ERR 0x1 /* CAN0 Error */
1582#define nIRQ_CAN0_ERR 0x0
1583#define IRQ_DMA18 0x2 /* DMA Channel 18 */
1584#define nIRQ_DMA18 0x0
1585#define IRQ_DMA19 0x4 /* DMA Channel 19 */
1586#define nIRQ_DMA19 0x0
1587#define IRQ_DMA20 0x8 /* DMA Channel 20 */
1588#define nIRQ_DMA20 0x0
1589#define IRQ_DMA21 0x10 /* DMA Channel 21 */
1590#define nIRQ_DMA21 0x0
1591#define IRQ_DMA13 0x20 /* DMA Channel 13 */
1592#define nIRQ_DMA13 0x0
1593#define IRQ_DMA14 0x40 /* DMA Channel 14 */
1594#define nIRQ_DMA14 0x0
1595#define IRQ_DMA5 0x80 /* DMA Channel 5 */
1596#define nIRQ_DMA5 0x0
1597#define IRQ_DMA23 0x100 /* DMA Channel 23 */
1598#define nIRQ_DMA23 0x0
1599#define IRQ_DMA8 0x200 /* DMA Channel 8 */
1600#define nIRQ_DMA8 0x0
1601#define IRQ_DMA9 0x400 /* DMA Channel 9 */
1602#define nIRQ_DMA9 0x0
1603#define IRQ_DMA10 0x800 /* DMA Channel 10 */
1604#define nIRQ_DMA10 0x0
1605#define IRQ_DMA11 0x1000 /* DMA Channel 11 */
1606#define nIRQ_DMA11 0x0
1607#define IRQ_TWI0 0x2000 /* TWI0 */
1608#define nIRQ_TWI0 0x0
1609#define IRQ_TWI1 0x4000 /* TWI1 */
1610#define nIRQ_TWI1 0x0
1611#define IRQ_CAN0_RX 0x8000 /* CAN0 Receive */
1612#define nIRQ_CAN0_RX 0x0
1613#define IRQ_CAN0_TX 0x10000 /* CAN0 Transmit */
1614#define nIRQ_CAN0_TX 0x0
1615#define IRQ_MDMA2 0x20000 /* Memory DMA Stream 0 */
1616#define nIRQ_MDMA2 0x0
1617#define IRQ_MDMA3 0x40000 /* Memory DMA Stream 1 */
1618#define nIRQ_MDMA3 0x0
1619#define IRQ_MXVR_STAT 0x80000 /* MXVR Status */
1620#define nIRQ_MXVR_STAT 0x0
1621#define IRQ_MXVR_CM 0x100000 /* MXVR Control Message */
1622#define nIRQ_MXVR_CM 0x0
1623#define IRQ_MXVR_AP 0x200000 /* MXVR Asynchronous Packet */
1624#define nIRQ_MXVR_AP 0x0
1625#define IRQ_EPPI1_ERR 0x400000 /* EPPI1 Error */
1626#define nIRQ_EPPI1_ERR 0x0
1627#define IRQ_EPPI2_ERR 0x800000 /* EPPI2 Error */
1628#define nIRQ_EPPI2_ERR 0x0
1629#define IRQ_UART3_ERR 0x1000000 /* UART3 Error */
1630#define nIRQ_UART3_ERR 0x0
1631#define IRQ_HOST_ERR 0x2000000 /* Host DMA Port Error */
1632#define nIRQ_HOST_ERR 0x0
1633#define IRQ_USB_ERR 0x4000000 /* USB Error */
1634#define nIRQ_USB_ERR 0x0
1635#define IRQ_PIXC_ERR 0x8000000 /* Pixel Compositor Error */
1636#define nIRQ_PIXC_ERR 0x0
1637#define IRQ_NFC_ERR 0x10000000 /* Nand Flash Controller Error */
1638#define nIRQ_NFC_ERR 0x0
1639#define IRQ_ATAPI_ERR 0x20000000 /* ATAPI Error */
1640#define nIRQ_ATAPI_ERR 0x0
1641#define IRQ_CAN1_ERR 0x40000000 /* CAN1 Error */
1642#define nIRQ_CAN1_ERR 0x0
1643#define IRQ_DMAR0_ERR 0x80000000 /* DMAR0 Overflow Error */
1644#define nIRQ_DMAR0_ERR 0x0
1645#define IRQ_DMAR1_ERR 0x80000000 /* DMAR1 Overflow Error */
1646#define nIRQ_DMAR1_ERR 0x0
1647#define IRQ_DMAR0 0x80000000 /* DMAR0 Block */
1648#define nIRQ_DMAR0 0x0
1649#define IRQ_DMAR1 0x80000000 /* DMAR1 Block */
1650#define nIRQ_DMAR1 0x0
1651
1652/* Bit masks for SIC_IWR2, SIC_IMASK2, SIC_ISR2 */
1653
1654#define IRQ_DMA15 0x1 /* DMA Channel 15 */
1655#define nIRQ_DMA15 0x0
1656#define IRQ_DMA16 0x2 /* DMA Channel 16 */
1657#define nIRQ_DMA16 0x0
1658#define IRQ_DMA17 0x4 /* DMA Channel 17 */
1659#define nIRQ_DMA17 0x0
1660#define IRQ_DMA22 0x8 /* DMA Channel 22 */
1661#define nIRQ_DMA22 0x0
1662#define IRQ_CNT 0x10 /* Counter */
1663#define nIRQ_CNT 0x0
1664#define IRQ_KEY 0x20 /* Keypad */
1665#define nIRQ_KEY 0x0
1666#define IRQ_CAN1_RX 0x40 /* CAN1 Receive */
1667#define nIRQ_CAN1_RX 0x0
1668#define IRQ_CAN1_TX 0x80 /* CAN1 Transmit */
1669#define nIRQ_CAN1_TX 0x0
1670#define IRQ_SDH_MASK0 0x100 /* SDH Mask 0 */
1671#define nIRQ_SDH_MASK0 0x0
1672#define IRQ_SDH_MASK1 0x200 /* SDH Mask 1 */
1673#define nIRQ_SDH_MASK1 0x0
1674#define IRQ_USB_EINT 0x400 /* USB Exception */
1675#define nIRQ_USB_EINT 0x0
1676#define IRQ_USB_INT0 0x800 /* USB Interrupt 0 */
1677#define nIRQ_USB_INT0 0x0
1678#define IRQ_USB_INT1 0x1000 /* USB Interrupt 1 */
1679#define nIRQ_USB_INT1 0x0
1680#define IRQ_USB_INT2 0x2000 /* USB Interrupt 2 */
1681#define nIRQ_USB_INT2 0x0
1682#define IRQ_USB_DMAINT 0x4000 /* USB DMA */
1683#define nIRQ_USB_DMAINT 0x0
1684#define IRQ_OTPSEC 0x8000 /* OTP Access Complete */
1685#define nIRQ_OTPSEC 0x0
1686#define IRQ_TIMER0 0x400000 /* Timer 0 */
1687#define nIRQ_TIMER0 0x0
1688#define IRQ_TIMER1 0x800000 /* Timer 1 */
1689#define nIRQ_TIMER1 0x0
1690#define IRQ_TIMER2 0x1000000 /* Timer 2 */
1691#define nIRQ_TIMER2 0x0
1692#define IRQ_TIMER3 0x2000000 /* Timer 3 */
1693#define nIRQ_TIMER3 0x0
1694#define IRQ_TIMER4 0x4000000 /* Timer 4 */
1695#define nIRQ_TIMER4 0x0
1696#define IRQ_TIMER5 0x8000000 /* Timer 5 */
1697#define nIRQ_TIMER5 0x0
1698#define IRQ_TIMER6 0x10000000 /* Timer 6 */
1699#define nIRQ_TIMER6 0x0
1700#define IRQ_TIMER7 0x20000000 /* Timer 7 */
1701#define nIRQ_TIMER7 0x0
1702#define IRQ_PINT2 0x40000000 /* Pin Interrupt 2 */
1703#define nIRQ_PINT2 0x0
1704#define IRQ_PINT3 0x80000000 /* Pin Interrupt 3 */
1705#define nIRQ_PINT3 0x0
1706
1707/* Bit masks for DMAx_CONFIG, MDMA_Sx_CONFIG, MDMA_Dx_CONFIG */
1708
1709#define DMAEN 0x1 /* DMA Channel Enable */
1710#define nDMAEN 0x0
1711#define WNR 0x2 /* DMA Direction */
1712#define nWNR 0x0
1713#define WDSIZE 0xc /* Transfer Word Size */
1714#define DMA2D 0x10 /* DMA Mode */
1715#define nDMA2D 0x0
1716#define RESTART 0x20 /* Work Unit Transitions */
1717#define nRESTART 0x0
1718#define DI_SEL 0x40 /* Data Interrupt Timing Select */
1719#define nDI_SEL 0x0
1720#define DI_EN 0x80 /* Data Interrupt Enable */
1721#define nDI_EN 0x0
1722#define NDSIZE 0xf00 /* Flex Descriptor Size */
1723#define DMAFLOW 0xf000 /* Next Operation */
1724
1725/* Bit masks for DMAx_IRQ_STATUS, MDMA_Sx_IRQ_STATUS, MDMA_Dx_IRQ_STATUS */
1726
1727#define DMA_DONE 0x1 /* DMA Completion Interrupt Status */
1728#define nDMA_DONE 0x0
1729#define DMA_ERR 0x2 /* DMA Error Interrupt Status */
1730#define nDMA_ERR 0x0
1731#define DFETCH 0x4 /* DMA Descriptor Fetch */
1732#define nDFETCH 0x0
1733#define DMA_RUN 0x8 /* DMA Channel Running */
1734#define nDMA_RUN 0x0
1735
1736/* Bit masks for DMAx_PERIPHERAL_MAP, MDMA_Sx_IRQ_STATUS, MDMA_Dx_IRQ_STATUS */
1737
1738#define CTYPE 0x40 /* DMA Channel Type */
1739#define nCTYPE 0x0
1740#define PMAP 0xf000 /* Peripheral Mapped To This Channel */
1741
1742/* Bit masks for DMACx_TCPER */
1743
1744#define DCB_TRAFFIC_PERIOD 0xf /* DCB Traffic Control Period */
1745#define DEB_TRAFFIC_PERIOD 0xf0 /* DEB Traffic Control Period */
1746#define DAB_TRAFFIC_PERIOD 0x700 /* DAB Traffic Control Period */
1747#define MDMA_ROUND_ROBIN_PERIOD 0xf800 /* MDMA Round Robin Period */
1748
1749/* Bit masks for DMACx_TCCNT */
1750
1751#define DCB_TRAFFIC_COUNT 0xf /* DCB Traffic Control Count */
1752#define DEB_TRAFFIC_COUNT 0xf0 /* DEB Traffic Control Count */
1753#define DAB_TRAFFIC_COUNT 0x700 /* DAB Traffic Control Count */
1754#define MDMA_ROUND_ROBIN_COUNT 0xf800 /* MDMA Round Robin Count */
1755
1756/* Bit masks for DMAC1_PERIMUX */
1757
1758#define PMUXSDH 0x1 /* Peripheral Select for DMA22 channel */
1759#define nPMUXSDH 0x0
1760
1761/* Bit masks for EBIU_AMGCTL */
1762
1763#define AMCKEN 0x1 /* Async Memory Enable */
1764#define nAMCKEN 0x0
1765#define AMBEN 0xe /* Async bank enable */
1766
1767/* Bit masks for EBIU_AMBCTL0 */
1768
1769#define B0RDYEN 0x1 /* Bank 0 ARDY Enable */
1770#define nB0RDYEN 0x0
1771#define B0RDYPOL 0x2 /* Bank 0 ARDY Polarity */
1772#define nB0RDYPOL 0x0
1773#define B0TT 0xc /* Bank 0 transition time */
1774#define B0ST 0x30 /* Bank 0 Setup time */
1775#define B0HT 0xc0 /* Bank 0 Hold time */
1776#define B0RAT 0xf00 /* Bank 0 Read access time */
1777#define B0WAT 0xf000 /* Bank 0 write access time */
1778#define B1RDYEN 0x10000 /* Bank 1 ARDY Enable */
1779#define nB1RDYEN 0x0
1780#define B1RDYPOL 0x20000 /* Bank 1 ARDY Polarity */
1781#define nB1RDYPOL 0x0
1782#define B1TT 0xc0000 /* Bank 1 transition time */
1783#define B1ST 0x300000 /* Bank 1 Setup time */
1784#define B1HT 0xc00000 /* Bank 1 Hold time */
1785#define B1RAT 0xf000000 /* Bank 1 Read access time */
1786#define B1WAT 0xf0000000 /* Bank 1 write access time */
1787
1788/* Bit masks for EBIU_AMBCTL1 */
1789
1790#define B2RDYEN 0x1 /* Bank 2 ARDY Enable */
1791#define nB2RDYEN 0x0
1792#define B2RDYPOL 0x2 /* Bank 2 ARDY Polarity */
1793#define nB2RDYPOL 0x0
1794#define B2TT 0xc /* Bank 2 transition time */
1795#define B2ST 0x30 /* Bank 2 Setup time */
1796#define B2HT 0xc0 /* Bank 2 Hold time */
1797#define B2RAT 0xf00 /* Bank 2 Read access time */
1798#define B2WAT 0xf000 /* Bank 2 write access time */
1799#define B3RDYEN 0x10000 /* Bank 3 ARDY Enable */
1800#define nB3RDYEN 0x0
1801#define B3RDYPOL 0x20000 /* Bank 3 ARDY Polarity */
1802#define nB3RDYPOL 0x0
1803#define B3TT 0xc0000 /* Bank 3 transition time */
1804#define B3ST 0x300000 /* Bank 3 Setup time */
1805#define B3HT 0xc00000 /* Bank 3 Hold time */
1806#define B3RAT 0xf000000 /* Bank 3 Read access time */
1807#define B3WAT 0xf0000000 /* Bank 3 write access time */
1808
1809/* Bit masks for EBIU_MBSCTL */
1810
1811#define AMSB0CTL 0x3 /* Async Memory Bank 0 select */
1812#define AMSB1CTL 0xc /* Async Memory Bank 1 select */
1813#define AMSB2CTL 0x30 /* Async Memory Bank 2 select */
1814#define AMSB3CTL 0xc0 /* Async Memory Bank 3 select */
1815
1816/* Bit masks for EBIU_MODE */
1817
1818#define B0MODE 0x3 /* Async Memory Bank 0 Access Mode */
1819#define B1MODE 0xc /* Async Memory Bank 1 Access Mode */
1820#define B2MODE 0x30 /* Async Memory Bank 2 Access Mode */
1821#define B3MODE 0xc0 /* Async Memory Bank 3 Access Mode */
1822
1823/* Bit masks for EBIU_FCTL */
1824
1825#define TESTSETLOCK 0x1 /* Test set lock */
1826#define nTESTSETLOCK 0x0
1827#define BCLK 0x6 /* Burst clock frequency */
1828#define PGWS 0x38 /* Page wait states */
1829#define PGSZ 0x40 /* Page size */
1830#define nPGSZ 0x0
1831#define RDDL 0x380 /* Read data delay */
1832
1833/* Bit masks for EBIU_ARBSTAT */
1834
1835#define ARBSTAT 0x1 /* Arbitration status */
1836#define nARBSTAT 0x0
1837#define BGSTAT 0x2 /* Bus grant status */
1838#define nBGSTAT 0x0
1839
1840/* Bit masks for EBIU_DDRCTL0 */
1841
1842#define TREFI 0x3fff /* Refresh Interval */
1843#define TRFC 0x3c000 /* Auto-refresh command period */
1844#define TRP 0x3c0000 /* Pre charge-to-active command period */
1845#define TRAS 0x3c00000 /* Min Active-to-pre charge time */
1846#define TRC 0x3c000000 /* Active-to-active time */
1847
1848/* Bit masks for EBIU_DDRCTL1 */
1849
1850#define TRCD 0xf /* Active-to-Read/write delay */
1851#define MRD 0xf0 /* Mode register set to active */
1852#define TWR 0x300 /* Write Recovery time */
1853#define DDRDATWIDTH 0x3000 /* DDR data width */
1854#define EXTBANKS 0xc000 /* External banks */
1855#define DDRDEVWIDTH 0x30000 /* DDR device width */
1856#define DDRDEVSIZE 0xc0000 /* DDR device size */
1857#define TWWTR 0xf0000000 /* Write-to-read delay */
1858
1859/* Bit masks for EBIU_DDRCTL2 */
1860
1861#define BURSTLENGTH 0x7 /* Burst length */
1862#define CASLATENCY 0x70 /* CAS latency */
1863#define DLLRESET 0x100 /* DLL Reset */
1864#define nDLLRESET 0x0
1865#define REGE 0x1000 /* Register mode enable */
1866#define nREGE 0x0
1867
1868/* Bit masks for EBIU_DDRCTL3 */
1869
1870#define PASR 0x7 /* Partial array self-refresh */
1871
1872/* Bit masks for EBIU_DDRQUE */
1873
1874#define DEB1_PFLEN 0x3 /* Pre fetch length for DEB1 accesses */
1875#define DEB2_PFLEN 0xc /* Pre fetch length for DEB2 accesses */
1876#define DEB3_PFLEN 0x30 /* Pre fetch length for DEB3 accesses */
1877#define DEB_ARB_PRIORITY 0x700 /* Arbitration between DEB busses */
1878#define DEB1_URGENT 0x1000 /* DEB1 Urgent */
1879#define nDEB1_URGENT 0x0
1880#define DEB2_URGENT 0x2000 /* DEB2 Urgent */
1881#define nDEB2_URGENT 0x0
1882#define DEB3_URGENT 0x4000 /* DEB3 Urgent */
1883#define nDEB3_URGENT 0x0
1884
1885/* Bit masks for EBIU_ERRMST */
1886
1887#define DEB1_ERROR 0x1 /* DEB1 Error */
1888#define nDEB1_ERROR 0x0
1889#define DEB2_ERROR 0x2 /* DEB2 Error */
1890#define nDEB2_ERROR 0x0
1891#define DEB3_ERROR 0x4 /* DEB3 Error */
1892#define nDEB3_ERROR 0x0
1893#define CORE_ERROR 0x8 /* Core error */
1894#define nCORE_ERROR 0x0
1895#define DEB_MERROR 0x10 /* DEB1 Error (2nd) */
1896#define nDEB_MERROR 0x0
1897#define DEB2_MERROR 0x20 /* DEB2 Error (2nd) */
1898#define nDEB2_MERROR 0x0
1899#define DEB3_MERROR 0x40 /* DEB3 Error (2nd) */
1900#define nDEB3_MERROR 0x0
1901#define CORE_MERROR 0x80 /* Core Error (2nd) */
1902#define nCORE_MERROR 0x0
1903
1904/* Bit masks for EBIU_ERRADD */
1905
1906#define ERROR_ADDRESS 0xffffffff /* Error Address */
1907
1908/* Bit masks for EBIU_RSTCTL */
1909
1910#define DDRSRESET 0x1 /* DDR soft reset */
1911#define nDDRSRESET 0x0
1912#define PFTCHSRESET 0x4 /* DDR prefetch reset */
1913#define nPFTCHSRESET 0x0
1914#define SRREQ 0x8 /* Self-refresh request */
1915#define nSRREQ 0x0
1916#define SRACK 0x10 /* Self-refresh acknowledge */
1917#define nSRACK 0x0
1918#define MDDRENABLE 0x20 /* Mobile DDR enable */
1919#define nMDDRENABLE 0x0
1920
1921/* Bit masks for EBIU_DDRBRC0 */
1922
1923#define BRC0 0xffffffff /* Count */
1924
1925/* Bit masks for EBIU_DDRBRC1 */
1926
1927#define BRC1 0xffffffff /* Count */
1928
1929/* Bit masks for EBIU_DDRBRC2 */
1930
1931#define BRC2 0xffffffff /* Count */
1932
1933/* Bit masks for EBIU_DDRBRC3 */
1934
1935#define BRC3 0xffffffff /* Count */
1936
1937/* Bit masks for EBIU_DDRBRC4 */
1938
1939#define BRC4 0xffffffff /* Count */
1940
1941/* Bit masks for EBIU_DDRBRC5 */
1942
1943#define BRC5 0xffffffff /* Count */
1944
1945/* Bit masks for EBIU_DDRBRC6 */
1946
1947#define BRC6 0xffffffff /* Count */
1948
1949/* Bit masks for EBIU_DDRBRC7 */
1950
1951#define BRC7 0xffffffff /* Count */
1952
1953/* Bit masks for EBIU_DDRBWC0 */
1954
1955#define BWC0 0xffffffff /* Count */
1956
1957/* Bit masks for EBIU_DDRBWC1 */
1958
1959#define BWC1 0xffffffff /* Count */
1960
1961/* Bit masks for EBIU_DDRBWC2 */
1962
1963#define BWC2 0xffffffff /* Count */
1964
1965/* Bit masks for EBIU_DDRBWC3 */
1966
1967#define BWC3 0xffffffff /* Count */
1968
1969/* Bit masks for EBIU_DDRBWC4 */
1970
1971#define BWC4 0xffffffff /* Count */
1972
1973/* Bit masks for EBIU_DDRBWC5 */
1974
1975#define BWC5 0xffffffff /* Count */
1976
1977/* Bit masks for EBIU_DDRBWC6 */
1978
1979#define BWC6 0xffffffff /* Count */
1980
1981/* Bit masks for EBIU_DDRBWC7 */
1982
1983#define BWC7 0xffffffff /* Count */
1984
1985/* Bit masks for EBIU_DDRACCT */
1986
1987#define ACCT 0xffffffff /* Count */
1988
1989/* Bit masks for EBIU_DDRTACT */
1990
1991#define TECT 0xffffffff /* Count */
1992
1993/* Bit masks for EBIU_DDRARCT */
1994
1995#define ARCT 0xffffffff /* Count */
1996
1997/* Bit masks for EBIU_DDRGC0 */
1998
1999#define GC0 0xffffffff /* Count */
2000
2001/* Bit masks for EBIU_DDRGC1 */
2002
2003#define GC1 0xffffffff /* Count */
2004
2005/* Bit masks for EBIU_DDRGC2 */
2006
2007#define GC2 0xffffffff /* Count */
2008
2009/* Bit masks for EBIU_DDRGC3 */
2010
2011#define GC3 0xffffffff /* Count */
2012
2013/* Bit masks for EBIU_DDRMCEN */
2014
2015#define B0WCENABLE 0x1 /* Bank 0 write count enable */
2016#define nB0WCENABLE 0x0
2017#define B1WCENABLE 0x2 /* Bank 1 write count enable */
2018#define nB1WCENABLE 0x0
2019#define B2WCENABLE 0x4 /* Bank 2 write count enable */
2020#define nB2WCENABLE 0x0
2021#define B3WCENABLE 0x8 /* Bank 3 write count enable */
2022#define nB3WCENABLE 0x0
2023#define B4WCENABLE 0x10 /* Bank 4 write count enable */
2024#define nB4WCENABLE 0x0
2025#define B5WCENABLE 0x20 /* Bank 5 write count enable */
2026#define nB5WCENABLE 0x0
2027#define B6WCENABLE 0x40 /* Bank 6 write count enable */
2028#define nB6WCENABLE 0x0
2029#define B7WCENABLE 0x80 /* Bank 7 write count enable */
2030#define nB7WCENABLE 0x0
2031#define B0RCENABLE 0x100 /* Bank 0 read count enable */
2032#define nB0RCENABLE 0x0
2033#define B1RCENABLE 0x200 /* Bank 1 read count enable */
2034#define nB1RCENABLE 0x0
2035#define B2RCENABLE 0x400 /* Bank 2 read count enable */
2036#define nB2RCENABLE 0x0
2037#define B3RCENABLE 0x800 /* Bank 3 read count enable */
2038#define nB3RCENABLE 0x0
2039#define B4RCENABLE 0x1000 /* Bank 4 read count enable */
2040#define nB4RCENABLE 0x0
2041#define B5RCENABLE 0x2000 /* Bank 5 read count enable */
2042#define nB5RCENABLE 0x0
2043#define B6RCENABLE 0x4000 /* Bank 6 read count enable */
2044#define nB6RCENABLE 0x0
2045#define B7RCENABLE 0x8000 /* Bank 7 read count enable */
2046#define nB7RCENABLE 0x0
2047#define ROWACTCENABLE 0x10000 /* DDR Row activate count enable */
2048#define nROWACTCENABLE 0x0
2049#define RWTCENABLE 0x20000 /* DDR R/W Turn around count enable */
2050#define nRWTCENABLE 0x0
2051#define ARCENABLE 0x40000 /* DDR Auto-refresh count enable */
2052#define nARCENABLE 0x0
2053#define GC0ENABLE 0x100000 /* DDR Grant count 0 enable */
2054#define nGC0ENABLE 0x0
2055#define GC1ENABLE 0x200000 /* DDR Grant count 1 enable */
2056#define nGC1ENABLE 0x0
2057#define GC2ENABLE 0x400000 /* DDR Grant count 2 enable */
2058#define nGC2ENABLE 0x0
2059#define GC3ENABLE 0x800000 /* DDR Grant count 3 enable */
2060#define nGC3ENABLE 0x0
2061#define GCCONTROL 0x3000000 /* DDR Grant Count Control */
2062
2063/* Bit masks for EBIU_DDRMCCL */
2064
2065#define CB0WCOUNT 0x1 /* Clear write count 0 */
2066#define nCB0WCOUNT 0x0
2067#define CB1WCOUNT 0x2 /* Clear write count 1 */
2068#define nCB1WCOUNT 0x0
2069#define CB2WCOUNT 0x4 /* Clear write count 2 */
2070#define nCB2WCOUNT 0x0
2071#define CB3WCOUNT 0x8 /* Clear write count 3 */
2072#define nCB3WCOUNT 0x0
2073#define CB4WCOUNT 0x10 /* Clear write count 4 */
2074#define nCB4WCOUNT 0x0
2075#define CB5WCOUNT 0x20 /* Clear write count 5 */
2076#define nCB5WCOUNT 0x0
2077#define CB6WCOUNT 0x40 /* Clear write count 6 */
2078#define nCB6WCOUNT 0x0
2079#define CB7WCOUNT 0x80 /* Clear write count 7 */
2080#define nCB7WCOUNT 0x0
2081#define CBRCOUNT 0x100 /* Clear read count 0 */
2082#define nCBRCOUNT 0x0
2083#define CB1RCOUNT 0x200 /* Clear read count 1 */
2084#define nCB1RCOUNT 0x0
2085#define CB2RCOUNT 0x400 /* Clear read count 2 */
2086#define nCB2RCOUNT 0x0
2087#define CB3RCOUNT 0x800 /* Clear read count 3 */
2088#define nCB3RCOUNT 0x0
2089#define CB4RCOUNT 0x1000 /* Clear read count 4 */
2090#define nCB4RCOUNT 0x0
2091#define CB5RCOUNT 0x2000 /* Clear read count 5 */
2092#define nCB5RCOUNT 0x0
2093#define CB6RCOUNT 0x4000 /* Clear read count 6 */
2094#define nCB6RCOUNT 0x0
2095#define CB7RCOUNT 0x8000 /* Clear read count 7 */
2096#define nCB7RCOUNT 0x0
2097#define CRACOUNT 0x10000 /* Clear row activation count */
2098#define nCRACOUNT 0x0
2099#define CRWTACOUNT 0x20000 /* Clear R/W turn-around count */
2100#define nCRWTACOUNT 0x0
2101#define CARCOUNT 0x40000 /* Clear auto-refresh count */
2102#define nCARCOUNT 0x0
2103#define CG0COUNT 0x100000 /* Clear grant count 0 */
2104#define nCG0COUNT 0x0
2105#define CG1COUNT 0x200000 /* Clear grant count 1 */
2106#define nCG1COUNT 0x0
2107#define CG2COUNT 0x400000 /* Clear grant count 2 */
2108#define nCG2COUNT 0x0
2109#define CG3COUNT 0x800000 /* Clear grant count 3 */
2110#define nCG3COUNT 0x0
2111
2112/* Bit masks for (PORTx is PORTA - PORTJ) includes PORTx_FER, PORTx_SET, PORTx_CLEAR, PORTx_DIR_SET, PORTx_DIR_CLEAR, PORTx_INEN */
2113
2114#define Px0 0x1 /* GPIO 0 */
2115#define nPx0 0x0
2116#define Px1 0x2 /* GPIO 1 */
2117#define nPx1 0x0
2118#define Px2 0x4 /* GPIO 2 */
2119#define nPx2 0x0
2120#define Px3 0x8 /* GPIO 3 */
2121#define nPx3 0x0
2122#define Px4 0x10 /* GPIO 4 */
2123#define nPx4 0x0
2124#define Px5 0x20 /* GPIO 5 */
2125#define nPx5 0x0
2126#define Px6 0x40 /* GPIO 6 */
2127#define nPx6 0x0
2128#define Px7 0x80 /* GPIO 7 */
2129#define nPx7 0x0
2130#define Px8 0x100 /* GPIO 8 */
2131#define nPx8 0x0
2132#define Px9 0x200 /* GPIO 9 */
2133#define nPx9 0x0
2134#define Px10 0x400 /* GPIO 10 */
2135#define nPx10 0x0
2136#define Px11 0x800 /* GPIO 11 */
2137#define nPx11 0x0
2138#define Px12 0x1000 /* GPIO 12 */
2139#define nPx12 0x0
2140#define Px13 0x2000 /* GPIO 13 */
2141#define nPx13 0x0
2142#define Px14 0x4000 /* GPIO 14 */
2143#define nPx14 0x0
2144#define Px15 0x8000 /* GPIO 15 */
2145#define nPx15 0x0
2146
2147/* Bit masks for PORTA_MUX - PORTJ_MUX */
2148
2149#define PxM0 0x3 /* GPIO Mux 0 */
2150#define PxM1 0xc /* GPIO Mux 1 */
2151#define PxM2 0x30 /* GPIO Mux 2 */
2152#define PxM3 0xc0 /* GPIO Mux 3 */
2153#define PxM4 0x300 /* GPIO Mux 4 */
2154#define PxM5 0xc00 /* GPIO Mux 5 */
2155#define PxM6 0x3000 /* GPIO Mux 6 */
2156#define PxM7 0xc000 /* GPIO Mux 7 */
2157#define PxM8 0x30000 /* GPIO Mux 8 */
2158#define PxM9 0xc0000 /* GPIO Mux 9 */
2159#define PxM10 0x300000 /* GPIO Mux 10 */
2160#define PxM11 0xc00000 /* GPIO Mux 11 */
2161#define PxM12 0x3000000 /* GPIO Mux 12 */
2162#define PxM13 0xc000000 /* GPIO Mux 13 */
2163#define PxM14 0x30000000 /* GPIO Mux 14 */
2164#define PxM15 0xc0000000 /* GPIO Mux 15 */
2165
2166
2167/* Bit masks for PINTx_MASK_SET/CLEAR, PINTx_REQUEST, PINTx_LATCH, PINTx_EDGE_SET/CLEAR, PINTx_INVERT_SET/CLEAR, PINTx_PINTSTATE */
2168
2169#define IB0 0x1 /* Interrupt Bit 0 */
2170#define nIB0 0x0
2171#define IB1 0x2 /* Interrupt Bit 1 */
2172#define nIB1 0x0
2173#define IB2 0x4 /* Interrupt Bit 2 */
2174#define nIB2 0x0
2175#define IB3 0x8 /* Interrupt Bit 3 */
2176#define nIB3 0x0
2177#define IB4 0x10 /* Interrupt Bit 4 */
2178#define nIB4 0x0
2179#define IB5 0x20 /* Interrupt Bit 5 */
2180#define nIB5 0x0
2181#define IB6 0x40 /* Interrupt Bit 6 */
2182#define nIB6 0x0
2183#define IB7 0x80 /* Interrupt Bit 7 */
2184#define nIB7 0x0
2185#define IB8 0x100 /* Interrupt Bit 8 */
2186#define nIB8 0x0
2187#define IB9 0x200 /* Interrupt Bit 9 */
2188#define nIB9 0x0
2189#define IB10 0x400 /* Interrupt Bit 10 */
2190#define nIB10 0x0
2191#define IB11 0x800 /* Interrupt Bit 11 */
2192#define nIB11 0x0
2193#define IB12 0x1000 /* Interrupt Bit 12 */
2194#define nIB12 0x0
2195#define IB13 0x2000 /* Interrupt Bit 13 */
2196#define nIB13 0x0
2197#define IB14 0x4000 /* Interrupt Bit 14 */
2198#define nIB14 0x0
2199#define IB15 0x8000 /* Interrupt Bit 15 */
2200#define nIB15 0x0
2201
2202/* Bit masks for TIMERx_CONFIG */
2203
2204#define TMODE 0x3 /* Timer Mode */
2205#define PULSE_HI 0x4 /* Pulse Polarity */
2206#define nPULSE_HI 0x0
2207#define PERIOD_CNT 0x8 /* Period Count */
2208#define nPERIOD_CNT 0x0
2209#define IRQ_ENA 0x10 /* Interrupt Request Enable */
2210#define nIRQ_ENA 0x0
2211#define TIN_SEL 0x20 /* Timer Input Select */
2212#define nTIN_SEL 0x0
2213#define OUT_DIS 0x40 /* Output Pad Disable */
2214#define nOUT_DIS 0x0
2215#define CLK_SEL 0x80 /* Timer Clock Select */
2216#define nCLK_SEL 0x0
2217#define TOGGLE_HI 0x100 /* Toggle Mode */
2218#define nTOGGLE_HI 0x0
2219#define EMU_RUN 0x200 /* Emulation Behavior Select */
2220#define nEMU_RUN 0x0
2221#define ERR_TYP 0xc000 /* Error Type */
2222
2223/* Bit masks for TIMER_ENABLE0 */
2224
2225#define TIMEN0 0x1 /* Timer 0 Enable */
2226#define nTIMEN0 0x0
2227#define TIMEN1 0x2 /* Timer 1 Enable */
2228#define nTIMEN1 0x0
2229#define TIMEN2 0x4 /* Timer 2 Enable */
2230#define nTIMEN2 0x0
2231#define TIMEN3 0x8 /* Timer 3 Enable */
2232#define nTIMEN3 0x0
2233#define TIMEN4 0x10 /* Timer 4 Enable */
2234#define nTIMEN4 0x0
2235#define TIMEN5 0x20 /* Timer 5 Enable */
2236#define nTIMEN5 0x0
2237#define TIMEN6 0x40 /* Timer 6 Enable */
2238#define nTIMEN6 0x0
2239#define TIMEN7 0x80 /* Timer 7 Enable */
2240#define nTIMEN7 0x0
2241
2242/* Bit masks for TIMER_DISABLE0 */
2243
2244#define TIMDIS0 0x1 /* Timer 0 Disable */
2245#define nTIMDIS0 0x0
2246#define TIMDIS1 0x2 /* Timer 1 Disable */
2247#define nTIMDIS1 0x0
2248#define TIMDIS2 0x4 /* Timer 2 Disable */
2249#define nTIMDIS2 0x0
2250#define TIMDIS3 0x8 /* Timer 3 Disable */
2251#define nTIMDIS3 0x0
2252#define TIMDIS4 0x10 /* Timer 4 Disable */
2253#define nTIMDIS4 0x0
2254#define TIMDIS5 0x20 /* Timer 5 Disable */
2255#define nTIMDIS5 0x0
2256#define TIMDIS6 0x40 /* Timer 6 Disable */
2257#define nTIMDIS6 0x0
2258#define TIMDIS7 0x80 /* Timer 7 Disable */
2259#define nTIMDIS7 0x0
2260
2261/* Bit masks for TIMER_STATUS0 */
2262
2263#define TIMIL0 0x1 /* Timer 0 Interrupt */
2264#define nTIMIL0 0x0
2265#define TIMIL1 0x2 /* Timer 1 Interrupt */
2266#define nTIMIL1 0x0
2267#define TIMIL2 0x4 /* Timer 2 Interrupt */
2268#define nTIMIL2 0x0
2269#define TIMIL3 0x8 /* Timer 3 Interrupt */
2270#define nTIMIL3 0x0
2271#define TOVF_ERR0 0x10 /* Timer 0 Counter Overflow */
2272#define nTOVF_ERR0 0x0
2273#define TOVF_ERR1 0x20 /* Timer 1 Counter Overflow */
2274#define nTOVF_ERR1 0x0
2275#define TOVF_ERR2 0x40 /* Timer 2 Counter Overflow */
2276#define nTOVF_ERR2 0x0
2277#define TOVF_ERR3 0x80 /* Timer 3 Counter Overflow */
2278#define nTOVF_ERR3 0x0
2279#define TRUN0 0x1000 /* Timer 0 Slave Enable Status */
2280#define nTRUN0 0x0
2281#define TRUN1 0x2000 /* Timer 1 Slave Enable Status */
2282#define nTRUN1 0x0
2283#define TRUN2 0x4000 /* Timer 2 Slave Enable Status */
2284#define nTRUN2 0x0
2285#define TRUN3 0x8000 /* Timer 3 Slave Enable Status */
2286#define nTRUN3 0x0
2287#define TIMIL4 0x10000 /* Timer 4 Interrupt */
2288#define nTIMIL4 0x0
2289#define TIMIL5 0x20000 /* Timer 5 Interrupt */
2290#define nTIMIL5 0x0
2291#define TIMIL6 0x40000 /* Timer 6 Interrupt */
2292#define nTIMIL6 0x0
2293#define TIMIL7 0x80000 /* Timer 7 Interrupt */
2294#define nTIMIL7 0x0
2295#define TOVF_ERR4 0x100000 /* Timer 4 Counter Overflow */
2296#define nTOVF_ERR4 0x0
2297#define TOVF_ERR5 0x200000 /* Timer 5 Counter Overflow */
2298#define nTOVF_ERR5 0x0
2299#define TOVF_ERR6 0x400000 /* Timer 6 Counter Overflow */
2300#define nTOVF_ERR6 0x0
2301#define TOVF_ERR7 0x800000 /* Timer 7 Counter Overflow */
2302#define nTOVF_ERR7 0x0
2303#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */
2304#define nTRUN4 0x0
2305#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */
2306#define nTRUN5 0x0
2307#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */
2308#define nTRUN6 0x0
2309#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */
2310#define nTRUN7 0x0
2311
2312/* Bit masks for WDOG_CTL */
2313
2314#define WDEV 0x6 /* Watchdog Event */
2315#define WDEN 0xff0 /* Watchdog Enable */
2316#define WDRO 0x8000 /* Watchdog Rolled Over */
2317#define nWDRO 0x0
2318
2319/* Bit masks for CNT_CONFIG */
2320
2321#define CNTE 0x1 /* Counter Enable */
2322#define nCNTE 0x0
2323#define DEBE 0x2 /* Debounce Enable */
2324#define nDEBE 0x0
2325#define CDGINV 0x10 /* CDG Pin Polarity Invert */
2326#define nCDGINV 0x0
2327#define CUDINV 0x20 /* CUD Pin Polarity Invert */
2328#define nCUDINV 0x0
2329#define CZMINV 0x40 /* CZM Pin Polarity Invert */
2330#define nCZMINV 0x0
2331#define CNTMODE 0x700 /* Counter Operating Mode */
2332#define ZMZC 0x800 /* CZM Zeroes Counter Enable */
2333#define nZMZC 0x0
2334#define BNDMODE 0x3000 /* Boundary register Mode */
2335#define INPDIS 0x8000 /* CUG and CDG Input Disable */
2336#define nINPDIS 0x0
2337
2338/* Bit masks for CNT_IMASK */
2339
2340#define ICIE 0x1 /* Illegal Gray/Binary Code Interrupt Enable */
2341#define nICIE 0x0
2342#define UCIE 0x2 /* Up count Interrupt Enable */
2343#define nUCIE 0x0
2344#define DCIE 0x4 /* Down count Interrupt Enable */
2345#define nDCIE 0x0
2346#define MINCIE 0x8 /* Min Count Interrupt Enable */
2347#define nMINCIE 0x0
2348#define MAXCIE 0x10 /* Max Count Interrupt Enable */
2349#define nMAXCIE 0x0
2350#define COV31IE 0x20 /* Bit 31 Overflow Interrupt Enable */
2351#define nCOV31IE 0x0
2352#define COV15IE 0x40 /* Bit 15 Overflow Interrupt Enable */
2353#define nCOV15IE 0x0
2354#define CZEROIE 0x80 /* Count to Zero Interrupt Enable */
2355#define nCZEROIE 0x0
2356#define CZMIE 0x100 /* CZM Pin Interrupt Enable */
2357#define nCZMIE 0x0
2358#define CZMEIE 0x200 /* CZM Error Interrupt Enable */
2359#define nCZMEIE 0x0
2360#define CZMZIE 0x400 /* CZM Zeroes Counter Interrupt Enable */
2361#define nCZMZIE 0x0
2362
2363/* Bit masks for CNT_STATUS */
2364
2365#define ICII 0x1 /* Illegal Gray/Binary Code Interrupt Identifier */
2366#define nICII 0x0
2367#define UCII 0x2 /* Up count Interrupt Identifier */
2368#define nUCII 0x0
2369#define DCII 0x4 /* Down count Interrupt Identifier */
2370#define nDCII 0x0
2371#define MINCII 0x8 /* Min Count Interrupt Identifier */
2372#define nMINCII 0x0
2373#define MAXCII 0x10 /* Max Count Interrupt Identifier */
2374#define nMAXCII 0x0
2375#define COV31II 0x20 /* Bit 31 Overflow Interrupt Identifier */
2376#define nCOV31II 0x0
2377#define COV15II 0x40 /* Bit 15 Overflow Interrupt Identifier */
2378#define nCOV15II 0x0
2379#define CZEROII 0x80 /* Count to Zero Interrupt Identifier */
2380#define nCZEROII 0x0
2381#define CZMII 0x100 /* CZM Pin Interrupt Identifier */
2382#define nCZMII 0x0
2383#define CZMEII 0x200 /* CZM Error Interrupt Identifier */
2384#define nCZMEII 0x0
2385#define CZMZII 0x400 /* CZM Zeroes Counter Interrupt Identifier */
2386#define nCZMZII 0x0
2387
2388/* Bit masks for CNT_COMMAND */
2389
2390#define W1LCNT 0xf /* Load Counter Register */
2391#define W1LMIN 0xf0 /* Load Min Register */
2392#define W1LMAX 0xf00 /* Load Max Register */
2393#define W1ZMONCE 0x1000 /* Enable CZM Clear Counter Once */
2394#define nW1ZMONCE 0x0
2395
2396/* Bit masks for CNT_DEBOUNCE */
2397
2398#define DPRESCALE 0xf /* Load Counter Register */
2399
2400/* Bit masks for RTC_STAT */
2401
2402#define SECONDS 0x3f /* Seconds */
2403#define MINUTES 0xfc0 /* Minutes */
2404#define HOURS 0x1f000 /* Hours */
2405#define DAY_COUNTER 0xfffe0000 /* Day Counter */
2406
2407/* Bit masks for RTC_ICTL */
2408
2409#define STOPWATCH_INTERRUPT_ENABLE 0x1 /* Stopwatch Interrupt Enable */
2410#define nSTOPWATCH_INTERRUPT_ENABLE 0x0
2411#define ALARM_INTERRUPT_ENABLE 0x2 /* Alarm Interrupt Enable */
2412#define nALARM_INTERRUPT_ENABLE 0x0
2413#define SECONDS_INTERRUPT_ENABLE 0x4 /* Seconds Interrupt Enable */
2414#define nSECONDS_INTERRUPT_ENABLE 0x0
2415#define MINUTES_INTERRUPT_ENABLE 0x8 /* Minutes Interrupt Enable */
2416#define nMINUTES_INTERRUPT_ENABLE 0x0
2417#define HOURS_INTERRUPT_ENABLE 0x10 /* Hours Interrupt Enable */
2418#define nHOURS_INTERRUPT_ENABLE 0x0
2419#define TWENTY_FOUR_HOURS_INTERRUPT_ENABLE 0x20 /* 24 Hours Interrupt Enable */
2420#define nTWENTY_FOUR_HOURS_INTERRUPT_ENABLE 0x0
2421#define DAY_ALARM_INTERRUPT_ENABLE 0x40 /* Day Alarm Interrupt Enable */
2422#define nDAY_ALARM_INTERRUPT_ENABLE 0x0
2423#define WRITE_COMPLETE_INTERRUPT_ENABLE 0x8000 /* Write Complete Interrupt Enable */
2424#define nWRITE_COMPLETE_INTERRUPT_ENABLE 0x0
2425
2426/* Bit masks for RTC_ISTAT */
2427
2428#define STOPWATCH_EVENT_FLAG 0x1 /* Stopwatch Event Flag */
2429#define nSTOPWATCH_EVENT_FLAG 0x0
2430#define ALARM_EVENT_FLAG 0x2 /* Alarm Event Flag */
2431#define nALARM_EVENT_FLAG 0x0
2432#define SECONDS_EVENT_FLAG 0x4 /* Seconds Event Flag */
2433#define nSECONDS_EVENT_FLAG 0x0
2434#define MINUTES_EVENT_FLAG 0x8 /* Minutes Event Flag */
2435#define nMINUTES_EVENT_FLAG 0x0
2436#define HOURS_EVENT_FLAG 0x10 /* Hours Event Flag */
2437#define nHOURS_EVENT_FLAG 0x0
2438#define TWENTY_FOUR_HOURS_EVENT_FLAG 0x20 /* 24 Hours Event Flag */
2439#define nTWENTY_FOUR_HOURS_EVENT_FLAG 0x0
2440#define DAY_ALARM_EVENT_FLAG 0x40 /* Day Alarm Event Flag */
2441#define nDAY_ALARM_EVENT_FLAG 0x0
2442#define WRITE_PENDING__STATUS 0x4000 /* Write Pending Status */
2443#define nWRITE_PENDING__STATUS 0x0
2444#define WRITE_COMPLETE 0x8000 /* Write Complete */
2445#define nWRITE_COMPLETE 0x0
2446
2447/* Bit masks for RTC_SWCNT */
2448
2449#define STOPWATCH_COUNT 0xffff /* Stopwatch Count */
2450
2451/* Bit masks for RTC_ALARM */
2452
2453#define SECONDS 0x3f /* Seconds */
2454#define MINUTES 0xfc0 /* Minutes */
2455#define HOURS 0x1f000 /* Hours */
2456#define DAY 0xfffe0000 /* Day */
2457
2458/* Bit masks for RTC_PREN */
2459
2460#define PREN 0x1 /* Prescaler Enable */
2461#define nPREN 0x0
2462
2463/* Bit masks for OTP_CONTROL */
2464
2465#define FUSE_FADDR 0x1ff /* OTP/Fuse Address */
2466#define FIEN 0x800 /* OTP/Fuse Interrupt Enable */
2467#define nFIEN 0x0
2468#define FTESTDEC 0x1000 /* OTP/Fuse Test Decoder */
2469#define nFTESTDEC 0x0
2470#define FWRTEST 0x2000 /* OTP/Fuse Write Test */
2471#define nFWRTEST 0x0
2472#define FRDEN 0x4000 /* OTP/Fuse Read Enable */
2473#define nFRDEN 0x0
2474#define FWREN 0x8000 /* OTP/Fuse Write Enable */
2475#define nFWREN 0x0
2476
2477/* Bit masks for OTP_BEN */
2478
2479#define FBEN 0xffff /* OTP/Fuse Byte Enable */
2480
2481/* Bit masks for OTP_STATUS */
2482
2483#define FCOMP 0x1 /* OTP/Fuse Access Complete */
2484#define nFCOMP 0x0
2485#define FERROR 0x2 /* OTP/Fuse Access Error */
2486#define nFERROR 0x0
2487#define MMRGLOAD 0x10 /* Memory Mapped Register Gasket Load */
2488#define nMMRGLOAD 0x0
2489#define MMRGLOCK 0x20 /* Memory Mapped Register Gasket Lock */
2490#define nMMRGLOCK 0x0
2491#define FPGMEN 0x40 /* OTP/Fuse Program Enable */
2492#define nFPGMEN 0x0
2493
2494/* Bit masks for OTP_TIMING */
2495
2496#define USECDIV 0xff /* Micro Second Divider */
2497#define READACC 0x7f00 /* Read Access Time */
2498#define CPUMPRL 0x38000 /* Charge Pump Release Time */
2499#define CPUMPSU 0xc0000 /* Charge Pump Setup Time */
2500#define CPUMPHD 0xf00000 /* Charge Pump Hold Time */
2501#define PGMTIME 0xff000000 /* Program Time */
2502
2503/* Bit masks for SECURE_SYSSWT */
2504
2505#define EMUDABL 0x1 /* Emulation Disable. */
2506#define nEMUDABL 0x0
2507#define RSTDABL 0x2 /* Reset Disable */
2508#define nRSTDABL 0x0
2509#define L1IDABL 0x1c /* L1 Instruction Memory Disable. */
2510#define L1DADABL 0xe0 /* L1 Data Bank A Memory Disable. */
2511#define L1DBDABL 0x700 /* L1 Data Bank B Memory Disable. */
2512#define DMA0OVR 0x800 /* DMA0 Memory Access Override */
2513#define nDMA0OVR 0x0
2514#define DMA1OVR 0x1000 /* DMA1 Memory Access Override */
2515#define nDMA1OVR 0x0
2516#define EMUOVR 0x4000 /* Emulation Override */
2517#define nEMUOVR 0x0
2518#define OTPSEN 0x8000 /* OTP Secrets Enable. */
2519#define nOTPSEN 0x0
2520#define L2DABL 0x70000 /* L2 Memory Disable. */
2521
2522/* Bit masks for SECURE_CONTROL */
2523
2524#define SECURE0 0x1 /* SECURE 0 */
2525#define nSECURE0 0x0
2526#define SECURE1 0x2 /* SECURE 1 */
2527#define nSECURE1 0x0
2528#define SECURE2 0x4 /* SECURE 2 */
2529#define nSECURE2 0x0
2530#define SECURE3 0x8 /* SECURE 3 */
2531#define nSECURE3 0x0
2532
2533/* Bit masks for SECURE_STATUS */
2534
2535#define SECMODE 0x3 /* Secured Mode Control State */
2536#define NMI 0x4 /* Non Maskable Interrupt */
2537#define nNMI 0x0
2538#define AFVALID 0x8 /* Authentication Firmware Valid */
2539#define nAFVALID 0x0
2540#define AFEXIT 0x10 /* Authentication Firmware Exit */
2541#define nAFEXIT 0x0
2542#define SECSTAT 0xe0 /* Secure Status */
2543
2544/* Bit masks for PLL_DIV */
2545
2546#define CSEL 0x30 /* Core Select */
2547#define SSEL 0xf /* System Select */
2548
2549/* Bit masks for PLL_CTL */
2550
2551#define MSEL 0x7e00 /* Multiplier Select */
2552#define BYPASS 0x100 /* PLL Bypass Enable */
2553#define nBYPASS 0x0
2554#define OUTPUT_DELAY 0x80 /* External Memory Output Delay Enable */
2555#define nOUTPUT_DELAY 0x0
2556#define INPUT_DELAY 0x40 /* External Memory Input Delay Enable */
2557#define nINPUT_DELAY 0x0
2558#define PDWN 0x20 /* Power Down */
2559#define nPDWN 0x0
2560#define STOPCK 0x8 /* Stop Clock */
2561#define nSTOPCK 0x0
2562#define PLL_OFF 0x2 /* Disable PLL */
2563#define nPLL_OFF 0x0
2564#define DF 0x1 /* Divide Frequency */
2565#define nDF 0x0
2566
2567/* Bit masks for PLL_STAT */
2568
2569#define PLL_LOCKED 0x20 /* PLL Locked Status */
2570#define nPLL_LOCKED 0x0
2571#define ACTIVE_PLLDISABLED 0x4 /* Active Mode With PLL Disabled */
2572#define nACTIVE_PLLDISABLED 0x0
2573#define FULL_ON 0x2 /* Full-On Mode */
2574#define nFULL_ON 0x0
2575#define ACTIVE_PLLENABLED 0x1 /* Active Mode With PLL Enabled */
2576#define nACTIVE_PLLENABLED 0x0
2577#define RTCWS 0x400 /* RTC/Reset Wake-Up Status */
2578#define nRTCWS 0x0
2579#define CANWS 0x800 /* CAN Wake-Up Status */
2580#define nCANWS 0x0
2581#define USBWS 0x2000 /* USB Wake-Up Status */
2582#define nUSBWS 0x0
2583#define KPADWS 0x4000 /* Keypad Wake-Up Status */
2584#define nKPADWS 0x0
2585#define ROTWS 0x8000 /* Rotary Wake-Up Status */
2586#define nROTWS 0x0
2587#define GPWS 0x1000 /* General-Purpose Wake-Up Status */
2588#define nGPWS 0x0
2589
2590/* Bit masks for VR_CTL */
2591
2592#define FREQ 0x3 /* Regulator Switching Frequency */
2593#define GAIN 0xc /* Voltage Output Level Gain */
2594#define VLEV 0xf0 /* Internal Voltage Level */
2595#define SCKELOW 0x8000 /* Drive SCKE Low During Reset Enable */
2596#define nSCKELOW 0x0
2597#define WAKE 0x100 /* RTC/Reset Wake-Up Enable */
2598#define nWAKE 0x0
2599#define CANWE 0x200 /* CAN0/1 Wake-Up Enable */
2600#define nCANWE 0x0
2601#define GPWE 0x400 /* General-Purpose Wake-Up Enable */
2602#define nGPWE 0x0
2603#define USBWE 0x800 /* USB Wake-Up Enable */
2604#define nUSBWE 0x0
2605#define KPADWE 0x1000 /* Keypad Wake-Up Enable */
2606#define nKPADWE 0x0
2607#define ROTWE 0x2000 /* Rotary Wake-Up Enable */
2608#define nROTWE 0x0
2609
2610/* Bit masks for NFC_CTL */
2611
2612#define WR_DLY 0xf /* Write Strobe Delay */
2613#define RD_DLY 0xf0 /* Read Strobe Delay */
2614#define NWIDTH 0x100 /* NAND Data Width */
2615#define nNWIDTH 0x0
2616#define PG_SIZE 0x200 /* Page Size */
2617#define nPG_SIZE 0x0
2618
2619/* Bit masks for NFC_STAT */
2620
2621#define NBUSY 0x1 /* Not Busy */
2622#define nNBUSY 0x0
2623#define WB_FULL 0x2 /* Write Buffer Full */
2624#define nWB_FULL 0x0
2625#define PG_WR_STAT 0x4 /* Page Write Pending */
2626#define nPG_WR_STAT 0x0
2627#define PG_RD_STAT 0x8 /* Page Read Pending */
2628#define nPG_RD_STAT 0x0
2629#define WB_EMPTY 0x10 /* Write Buffer Empty */
2630#define nWB_EMPTY 0x0
2631
2632/* Bit masks for NFC_IRQSTAT */
2633
2634#define NBUSYIRQ 0x1 /* Not Busy IRQ */
2635#define nNBUSYIRQ 0x0
2636#define WB_OVF 0x2 /* Write Buffer Overflow */
2637#define nWB_OVF 0x0
2638#define WB_EDGE 0x4 /* Write Buffer Edge Detect */
2639#define nWB_EDGE 0x0
2640#define RD_RDY 0x8 /* Read Data Ready */
2641#define nRD_RDY 0x0
2642#define WR_DONE 0x10 /* Page Write Done */
2643#define nWR_DONE 0x0
2644
2645/* Bit masks for NFC_IRQMASK */
2646
2647#define MASK_BUSYIRQ 0x1 /* Mask Not Busy IRQ */
2648#define nMASK_BUSYIRQ 0x0
2649#define MASK_WBOVF 0x2 /* Mask Write Buffer Overflow */
2650#define nMASK_WBOVF 0x0
2651#define MASK_WBEMPTY 0x4 /* Mask Write Buffer Empty */
2652#define nMASK_WBEMPTY 0x0
2653#define MASK_RDRDY 0x8 /* Mask Read Data Ready */
2654#define nMASK_RDRDY 0x0
2655#define MASK_WRDONE 0x10 /* Mask Write Done */
2656#define nMASK_WRDONE 0x0
2657
2658/* Bit masks for NFC_RST */
2659
2660#define ECC_RST 0x1 /* ECC (and NFC counters) Reset */
2661#define nECC_RST 0x0
2662
2663/* Bit masks for NFC_PGCTL */
2664
2665#define PG_RD_START 0x1 /* Page Read Start */
2666#define nPG_RD_START 0x0
2667#define PG_WR_START 0x2 /* Page Write Start */
2668#define nPG_WR_START 0x0
2669
2670/* Bit masks for NFC_ECC0 */
2671
2672#define ECC0 0x7ff /* Parity Calculation Result0 */
2673
2674/* Bit masks for NFC_ECC1 */
2675
2676#define ECC1 0x7ff /* Parity Calculation Result1 */
2677
2678/* Bit masks for NFC_ECC2 */
2679
2680#define ECC2 0x7ff /* Parity Calculation Result2 */
2681
2682/* Bit masks for NFC_ECC3 */
2683
2684#define ECC3 0x7ff /* Parity Calculation Result3 */
2685
2686/* Bit masks for NFC_COUNT */
2687
2688#define ECCCNT 0x3ff /* Transfer Count */
2689
2690/* Bit masks for CAN0_CONTROL */
2691
2692#define SRS 0x1 /* Software Reset */
2693#define nSRS 0x0
2694#define DNM 0x2 /* DeviceNet Mode */
2695#define nDNM 0x0
2696#define ABO 0x4 /* Auto Bus On */
2697#define nABO 0x0
2698#define WBA 0x10 /* Wakeup On CAN Bus Activity */
2699#define nWBA 0x0
2700#define SMR 0x20 /* Sleep Mode Request */
2701#define nSMR 0x0
2702#define CSR 0x40 /* CAN Suspend Mode Request */
2703#define nCSR 0x0
2704#define CCR 0x80 /* CAN Configuration Mode Request */
2705#define nCCR 0x0
2706
2707/* Bit masks for CAN0_STATUS */
2708
2709#define WT 0x1 /* CAN Transmit Warning Flag */
2710#define nWT 0x0
2711#define WR 0x2 /* CAN Receive Warning Flag */
2712#define nWR 0x0
2713#define EP 0x4 /* CAN Error Passive Mode */
2714#define nEP 0x0
2715#define EBO 0x8 /* CAN Error Bus Off Mode */
2716#define nEBO 0x0
2717#define CSA 0x40 /* CAN Suspend Mode Acknowledge */
2718#define nCSA 0x0
2719#define CCA 0x80 /* CAN Configuration Mode Acknowledge */
2720#define nCCA 0x0
2721#define MBPTR 0x1f00 /* Mailbox Pointer */
2722#define TRM 0x4000 /* Transmit Mode Status */
2723#define nTRM 0x0
2724#define REC 0x8000 /* Receive Mode Status */
2725#define nREC 0x0
2726
2727/* Bit masks for CAN0_DEBUG */
2728
2729#define DEC 0x1 /* Disable Transmit/Receive Error Counters */
2730#define nDEC 0x0
2731#define DRI 0x2 /* Disable CANRX Input Pin */
2732#define nDRI 0x0
2733#define DTO 0x4 /* Disable CANTX Output Pin */
2734#define nDTO 0x0
2735#define DIL 0x8 /* Disable Internal Loop */
2736#define nDIL 0x0
2737#define MAA 0x10 /* Mode Auto-Acknowledge */
2738#define nMAA 0x0
2739#define MRB 0x20 /* Mode Read Back */
2740#define nMRB 0x0
2741#define CDE 0x8000 /* CAN Debug Mode Enable */
2742#define nCDE 0x0
2743
2744/* Bit masks for CAN0_CLOCK */
2745
2746#define BRP 0x3ff /* CAN Bit Rate Prescaler */
2747
2748/* Bit masks for CAN0_TIMING */
2749
2750#define SJW 0x300 /* Synchronization Jump Width */
2751#define SAM 0x80 /* Sampling */
2752#define nSAM 0x0
2753#define TSEG2 0x70 /* Time Segment 2 */
2754#define TSEG1 0xf /* Time Segment 1 */
2755
2756/* Bit masks for CAN0_INTR */
2757
2758#define CANRX 0x80 /* Serial Input From Transceiver */
2759#define nCANRX 0x0
2760#define CANTX 0x40 /* Serial Output To Transceiver */
2761#define nCANTX 0x0
2762#define SMACK 0x8 /* Sleep Mode Acknowledge */
2763#define nSMACK 0x0
2764#define GIRQ 0x4 /* Global Interrupt Request Status */
2765#define nGIRQ 0x0
2766#define MBTIRQ 0x2 /* Mailbox Transmit Interrupt Request */
2767#define nMBTIRQ 0x0
2768#define MBRIRQ 0x1 /* Mailbox Receive Interrupt Request */
2769#define nMBRIRQ 0x0
2770
2771/* Bit masks for CAN0_GIM */
2772
2773#define EWTIM 0x1 /* Error Warning Transmit Interrupt Mask */
2774#define nEWTIM 0x0
2775#define EWRIM 0x2 /* Error Warning Receive Interrupt Mask */
2776#define nEWRIM 0x0
2777#define EPIM 0x4 /* Error Passive Interrupt Mask */
2778#define nEPIM 0x0
2779#define BOIM 0x8 /* Bus Off Interrupt Mask */
2780#define nBOIM 0x0
2781#define WUIM 0x10 /* Wakeup Interrupt Mask */
2782#define nWUIM 0x0
2783#define UIAIM 0x20 /* Unimplemented Address Interrupt Mask */
2784#define nUIAIM 0x0
2785#define AAIM 0x40 /* Abort Acknowledge Interrupt Mask */
2786#define nAAIM 0x0
2787#define RMLIM 0x80 /* Receive Message Lost Interrupt Mask */
2788#define nRMLIM 0x0
2789#define UCEIM 0x100 /* Universal Counter Exceeded Interrupt Mask */
2790#define nUCEIM 0x0
2791#define ADIM 0x400 /* Access Denied Interrupt Mask */
2792#define nADIM 0x0
2793
2794/* Bit masks for CAN0_GIS */
2795
2796#define EWTIS 0x1 /* Error Warning Transmit Interrupt Status */
2797#define nEWTIS 0x0
2798#define EWRIS 0x2 /* Error Warning Receive Interrupt Status */
2799#define nEWRIS 0x0
2800#define EPIS 0x4 /* Error Passive Interrupt Status */
2801#define nEPIS 0x0
2802#define BOIS 0x8 /* Bus Off Interrupt Status */
2803#define nBOIS 0x0
2804#define WUIS 0x10 /* Wakeup Interrupt Status */
2805#define nWUIS 0x0
2806#define UIAIS 0x20 /* Unimplemented Address Interrupt Status */
2807#define nUIAIS 0x0
2808#define AAIS 0x40 /* Abort Acknowledge Interrupt Status */
2809#define nAAIS 0x0
2810#define RMLIS 0x80 /* Receive Message Lost Interrupt Status */
2811#define nRMLIS 0x0
2812#define UCEIS 0x100 /* Universal Counter Exceeded Interrupt Status */
2813#define nUCEIS 0x0
2814#define ADIS 0x400 /* Access Denied Interrupt Status */
2815#define nADIS 0x0
2816
2817/* Bit masks for CAN0_GIF */
2818
2819#define EWTIF 0x1 /* Error Warning Transmit Interrupt Flag */
2820#define nEWTIF 0x0
2821#define EWRIF 0x2 /* Error Warning Receive Interrupt Flag */
2822#define nEWRIF 0x0
2823#define EPIF 0x4 /* Error Passive Interrupt Flag */
2824#define nEPIF 0x0
2825#define BOIF 0x8 /* Bus Off Interrupt Flag */
2826#define nBOIF 0x0
2827#define WUIF 0x10 /* Wakeup Interrupt Flag */
2828#define nWUIF 0x0
2829#define UIAIF 0x20 /* Unimplemented Address Interrupt Flag */
2830#define nUIAIF 0x0
2831#define AAIF 0x40 /* Abort Acknowledge Interrupt Flag */
2832#define nAAIF 0x0
2833#define RMLIF 0x80 /* Receive Message Lost Interrupt Flag */
2834#define nRMLIF 0x0
2835#define UCEIF 0x100 /* Universal Counter Exceeded Interrupt Flag */
2836#define nUCEIF 0x0
2837#define ADIF 0x400 /* Access Denied Interrupt Flag */
2838#define nADIF 0x0
2839
2840/* Bit masks for CAN0_MBTD */
2841
2842#define TDR 0x80 /* Temporary Disable Request */
2843#define nTDR 0x0
2844#define TDA 0x40 /* Temporary Disable Acknowledge */
2845#define nTDA 0x0
2846#define TDPTR 0x1f /* Temporary Disable Pointer */
2847
2848/* Bit masks for CAN0_UCCNF */
2849
2850#define UCCNF 0xf /* Universal Counter Configuration */
2851#define UCRC 0x20 /* Universal Counter Reload/Clear */
2852#define nUCRC 0x0
2853#define UCCT 0x40 /* Universal Counter CAN Trigger */
2854#define nUCCT 0x0
2855#define UCE 0x80 /* Universal Counter Enable */
2856#define nUCE 0x0
2857
2858/* Bit masks for CAN0_UCCNT */
2859
2860#define UCCNT 0xffff /* Universal Counter Count Value */
2861
2862/* Bit masks for CAN0_UCRC */
2863
2864#define UCVAL 0xffff /* Universal Counter Reload/Capture Value */
2865
2866/* Bit masks for CAN0_CEC */
2867
2868#define RXECNT 0xff /* Receive Error Counter */
2869#define TXECNT 0xff00 /* Transmit Error Counter */
2870
2871/* Bit masks for CAN0_ESR */
2872
2873#define FER 0x80 /* Form Error */
2874#define nFER 0x0
2875#define BEF 0x40 /* Bit Error Flag */
2876#define nBEF 0x0
2877#define SA0 0x20 /* Stuck At Dominant */
2878#define nSA0 0x0
2879#define CRCE 0x10 /* CRC Error */
2880#define nCRCE 0x0
2881#define SER 0x8 /* Stuff Bit Error */
2882#define nSER 0x0
2883#define ACKE 0x4 /* Acknowledge Error */
2884#define nACKE 0x0
2885
2886/* Bit masks for CAN0_EWR */
2887
2888#define EWLTEC 0xff00 /* Transmit Error Warning Limit */
2889#define EWLREC 0xff /* Receive Error Warning Limit */
2890
2891/* Bit masks for CAN0_AMxx_H */
2892
2893#define FDF 0x8000 /* Filter On Data Field */
2894#define nFDF 0x0
2895#define FMD 0x4000 /* Full Mask Data */
2896#define nFMD 0x0
2897#define AMIDE 0x2000 /* Acceptance Mask Identifier Extension */
2898#define nAMIDE 0x0
2899#define BASEID 0x1ffc /* Base Identifier */
2900#define EXTID_HI 0x3 /* Extended Identifier High Bits */
2901
2902/* Bit masks for CAN0_AMxx_L */
2903
2904#define EXTID_LO 0xffff /* Extended Identifier Low Bits */
2905#define DFM 0xffff /* Data Field Mask */
2906
2907/* Bit masks for CAN0_MBxx_ID1 */
2908
2909#define AME 0x8000 /* Acceptance Mask Enable */
2910#define nAME 0x0
2911#define RTR 0x4000 /* Remote Transmission Request */
2912#define nRTR 0x0
2913#define IDE 0x2000 /* Identifier Extension */
2914#define nIDE 0x0
2915#define BASEID 0x1ffc /* Base Identifier */
2916#define EXTID_HI 0x3 /* Extended Identifier High Bits */
2917
2918/* Bit masks for CAN0_MBxx_ID0 */
2919
2920#define EXTID_LO 0xffff /* Extended Identifier Low Bits */
2921#define DFM 0xffff /* Data Field Mask */
2922
2923/* Bit masks for CAN0_MBxx_TIMESTAMP */
2924
2925#define TSV 0xffff /* Time Stamp Value */
2926
2927/* Bit masks for CAN0_MBxx_LENGTH */
2928
2929#define DLC 0xf /* Data Length Code */
2930
2931/* Bit masks for CAN0_MBxx_DATA3 */
2932
2933#define CAN_BYTE0 0xff00 /* Data Field Byte 0 */
2934#define CAN_BYTE1 0xff /* Data Field Byte 1 */
2935
2936/* Bit masks for CAN0_MBxx_DATA2 */
2937
2938#define CAN_BYTE2 0xff00 /* Data Field Byte 2 */
2939#define CAN_BYTE3 0xff /* Data Field Byte 3 */
2940
2941/* Bit masks for CAN0_MBxx_DATA1 */
2942
2943#define CAN_BYTE4 0xff00 /* Data Field Byte 4 */
2944#define CAN_BYTE5 0xff /* Data Field Byte 5 */
2945
2946/* Bit masks for CAN0_MBxx_DATA0 */
2947
2948#define CAN_BYTE6 0xff00 /* Data Field Byte 6 */
2949#define CAN_BYTE7 0xff /* Data Field Byte 7 */
2950
2951/* Bit masks for CAN0_MC1 */
2952
2953#define MC0 0x1 /* Mailbox 0 Enable */
2954#define nMC0 0x0
2955#define MC1 0x2 /* Mailbox 1 Enable */
2956#define nMC1 0x0
2957#define MC2 0x4 /* Mailbox 2 Enable */
2958#define nMC2 0x0
2959#define MC3 0x8 /* Mailbox 3 Enable */
2960#define nMC3 0x0
2961#define MC4 0x10 /* Mailbox 4 Enable */
2962#define nMC4 0x0
2963#define MC5 0x20 /* Mailbox 5 Enable */
2964#define nMC5 0x0
2965#define MC6 0x40 /* Mailbox 6 Enable */
2966#define nMC6 0x0
2967#define MC7 0x80 /* Mailbox 7 Enable */
2968#define nMC7 0x0
2969#define MC8 0x100 /* Mailbox 8 Enable */
2970#define nMC8 0x0
2971#define MC9 0x200 /* Mailbox 9 Enable */
2972#define nMC9 0x0
2973#define MC10 0x400 /* Mailbox 10 Enable */
2974#define nMC10 0x0
2975#define MC11 0x800 /* Mailbox 11 Enable */
2976#define nMC11 0x0
2977#define MC12 0x1000 /* Mailbox 12 Enable */
2978#define nMC12 0x0
2979#define MC13 0x2000 /* Mailbox 13 Enable */
2980#define nMC13 0x0
2981#define MC14 0x4000 /* Mailbox 14 Enable */
2982#define nMC14 0x0
2983#define MC15 0x8000 /* Mailbox 15 Enable */
2984#define nMC15 0x0
2985
2986/* Bit masks for CAN0_MC2 */
2987
2988#define MC16 0x1 /* Mailbox 16 Enable */
2989#define nMC16 0x0
2990#define MC17 0x2 /* Mailbox 17 Enable */
2991#define nMC17 0x0
2992#define MC18 0x4 /* Mailbox 18 Enable */
2993#define nMC18 0x0
2994#define MC19 0x8 /* Mailbox 19 Enable */
2995#define nMC19 0x0
2996#define MC20 0x10 /* Mailbox 20 Enable */
2997#define nMC20 0x0
2998#define MC21 0x20 /* Mailbox 21 Enable */
2999#define nMC21 0x0
3000#define MC22 0x40 /* Mailbox 22 Enable */
3001#define nMC22 0x0
3002#define MC23 0x80 /* Mailbox 23 Enable */
3003#define nMC23 0x0
3004#define MC24 0x100 /* Mailbox 24 Enable */
3005#define nMC24 0x0
3006#define MC25 0x200 /* Mailbox 25 Enable */
3007#define nMC25 0x0
3008#define MC26 0x400 /* Mailbox 26 Enable */
3009#define nMC26 0x0
3010#define MC27 0x800 /* Mailbox 27 Enable */
3011#define nMC27 0x0
3012#define MC28 0x1000 /* Mailbox 28 Enable */
3013#define nMC28 0x0
3014#define MC29 0x2000 /* Mailbox 29 Enable */
3015#define nMC29 0x0
3016#define MC30 0x4000 /* Mailbox 30 Enable */
3017#define nMC30 0x0
3018#define MC31 0x8000 /* Mailbox 31 Enable */
3019#define nMC31 0x0
3020
3021/* Bit masks for CAN0_MD1 */
3022
3023#define MD0 0x1 /* Mailbox 0 Receive Enable */
3024#define nMD0 0x0
3025#define MD1 0x2 /* Mailbox 1 Receive Enable */
3026#define nMD1 0x0
3027#define MD2 0x4 /* Mailbox 2 Receive Enable */
3028#define nMD2 0x0
3029#define MD3 0x8 /* Mailbox 3 Receive Enable */
3030#define nMD3 0x0
3031#define MD4 0x10 /* Mailbox 4 Receive Enable */
3032#define nMD4 0x0
3033#define MD5 0x20 /* Mailbox 5 Receive Enable */
3034#define nMD5 0x0
3035#define MD6 0x40 /* Mailbox 6 Receive Enable */
3036#define nMD6 0x0
3037#define MD7 0x80 /* Mailbox 7 Receive Enable */
3038#define nMD7 0x0
3039#define MD8 0x100 /* Mailbox 8 Receive Enable */
3040#define nMD8 0x0
3041#define MD9 0x200 /* Mailbox 9 Receive Enable */
3042#define nMD9 0x0
3043#define MD10 0x400 /* Mailbox 10 Receive Enable */
3044#define nMD10 0x0
3045#define MD11 0x800 /* Mailbox 11 Receive Enable */
3046#define nMD11 0x0
3047#define MD12 0x1000 /* Mailbox 12 Receive Enable */
3048#define nMD12 0x0
3049#define MD13 0x2000 /* Mailbox 13 Receive Enable */
3050#define nMD13 0x0
3051#define MD14 0x4000 /* Mailbox 14 Receive Enable */
3052#define nMD14 0x0
3053#define MD15 0x8000 /* Mailbox 15 Receive Enable */
3054#define nMD15 0x0
3055
3056/* Bit masks for CAN0_MD2 */
3057
3058#define MD16 0x1 /* Mailbox 16 Receive Enable */
3059#define nMD16 0x0
3060#define MD17 0x2 /* Mailbox 17 Receive Enable */
3061#define nMD17 0x0
3062#define MD18 0x4 /* Mailbox 18 Receive Enable */
3063#define nMD18 0x0
3064#define MD19 0x8 /* Mailbox 19 Receive Enable */
3065#define nMD19 0x0
3066#define MD20 0x10 /* Mailbox 20 Receive Enable */
3067#define nMD20 0x0
3068#define MD21 0x20 /* Mailbox 21 Receive Enable */
3069#define nMD21 0x0
3070#define MD22 0x40 /* Mailbox 22 Receive Enable */
3071#define nMD22 0x0
3072#define MD23 0x80 /* Mailbox 23 Receive Enable */
3073#define nMD23 0x0
3074#define MD24 0x100 /* Mailbox 24 Receive Enable */
3075#define nMD24 0x0
3076#define MD25 0x200 /* Mailbox 25 Receive Enable */
3077#define nMD25 0x0
3078#define MD26 0x400 /* Mailbox 26 Receive Enable */
3079#define nMD26 0x0
3080#define MD27 0x800 /* Mailbox 27 Receive Enable */
3081#define nMD27 0x0
3082#define MD28 0x1000 /* Mailbox 28 Receive Enable */
3083#define nMD28 0x0
3084#define MD29 0x2000 /* Mailbox 29 Receive Enable */
3085#define nMD29 0x0
3086#define MD30 0x4000 /* Mailbox 30 Receive Enable */
3087#define nMD30 0x0
3088#define MD31 0x8000 /* Mailbox 31 Receive Enable */
3089#define nMD31 0x0
3090
3091/* Bit masks for CAN0_RMP1 */
3092
3093#define RMP0 0x1 /* Mailbox 0 Receive Message Pending */
3094#define nRMP0 0x0
3095#define RMP1 0x2 /* Mailbox 1 Receive Message Pending */
3096#define nRMP1 0x0
3097#define RMP2 0x4 /* Mailbox 2 Receive Message Pending */
3098#define nRMP2 0x0
3099#define RMP3 0x8 /* Mailbox 3 Receive Message Pending */
3100#define nRMP3 0x0
3101#define RMP4 0x10 /* Mailbox 4 Receive Message Pending */
3102#define nRMP4 0x0
3103#define RMP5 0x20 /* Mailbox 5 Receive Message Pending */
3104#define nRMP5 0x0
3105#define RMP6 0x40 /* Mailbox 6 Receive Message Pending */
3106#define nRMP6 0x0
3107#define RMP7 0x80 /* Mailbox 7 Receive Message Pending */
3108#define nRMP7 0x0
3109#define RMP8 0x100 /* Mailbox 8 Receive Message Pending */
3110#define nRMP8 0x0
3111#define RMP9 0x200 /* Mailbox 9 Receive Message Pending */
3112#define nRMP9 0x0
3113#define RMP10 0x400 /* Mailbox 10 Receive Message Pending */
3114#define nRMP10 0x0
3115#define RMP11 0x800 /* Mailbox 11 Receive Message Pending */
3116#define nRMP11 0x0
3117#define RMP12 0x1000 /* Mailbox 12 Receive Message Pending */
3118#define nRMP12 0x0
3119#define RMP13 0x2000 /* Mailbox 13 Receive Message Pending */
3120#define nRMP13 0x0
3121#define RMP14 0x4000 /* Mailbox 14 Receive Message Pending */
3122#define nRMP14 0x0
3123#define RMP15 0x8000 /* Mailbox 15 Receive Message Pending */
3124#define nRMP15 0x0
3125
3126/* Bit masks for CAN0_RMP2 */
3127
3128#define RMP16 0x1 /* Mailbox 16 Receive Message Pending */
3129#define nRMP16 0x0
3130#define RMP17 0x2 /* Mailbox 17 Receive Message Pending */
3131#define nRMP17 0x0
3132#define RMP18 0x4 /* Mailbox 18 Receive Message Pending */
3133#define nRMP18 0x0
3134#define RMP19 0x8 /* Mailbox 19 Receive Message Pending */
3135#define nRMP19 0x0
3136#define RMP20 0x10 /* Mailbox 20 Receive Message Pending */
3137#define nRMP20 0x0
3138#define RMP21 0x20 /* Mailbox 21 Receive Message Pending */
3139#define nRMP21 0x0
3140#define RMP22 0x40 /* Mailbox 22 Receive Message Pending */
3141#define nRMP22 0x0
3142#define RMP23 0x80 /* Mailbox 23 Receive Message Pending */
3143#define nRMP23 0x0
3144#define RMP24 0x100 /* Mailbox 24 Receive Message Pending */
3145#define nRMP24 0x0
3146#define RMP25 0x200 /* Mailbox 25 Receive Message Pending */
3147#define nRMP25 0x0
3148#define RMP26 0x400 /* Mailbox 26 Receive Message Pending */
3149#define nRMP26 0x0
3150#define RMP27 0x800 /* Mailbox 27 Receive Message Pending */
3151#define nRMP27 0x0
3152#define RMP28 0x1000 /* Mailbox 28 Receive Message Pending */
3153#define nRMP28 0x0
3154#define RMP29 0x2000 /* Mailbox 29 Receive Message Pending */
3155#define nRMP29 0x0
3156#define RMP30 0x4000 /* Mailbox 30 Receive Message Pending */
3157#define nRMP30 0x0
3158#define RMP31 0x8000 /* Mailbox 31 Receive Message Pending */
3159#define nRMP31 0x0
3160
3161/* Bit masks for CAN0_RML1 */
3162
3163#define RML0 0x1 /* Mailbox 0 Receive Message Lost */
3164#define nRML0 0x0
3165#define RML1 0x2 /* Mailbox 1 Receive Message Lost */
3166#define nRML1 0x0
3167#define RML2 0x4 /* Mailbox 2 Receive Message Lost */
3168#define nRML2 0x0
3169#define RML3 0x8 /* Mailbox 3 Receive Message Lost */
3170#define nRML3 0x0
3171#define RML4 0x10 /* Mailbox 4 Receive Message Lost */
3172#define nRML4 0x0
3173#define RML5 0x20 /* Mailbox 5 Receive Message Lost */
3174#define nRML5 0x0
3175#define RML6 0x40 /* Mailbox 6 Receive Message Lost */
3176#define nRML6 0x0
3177#define RML7 0x80 /* Mailbox 7 Receive Message Lost */
3178#define nRML7 0x0
3179#define RML8 0x100 /* Mailbox 8 Receive Message Lost */
3180#define nRML8 0x0
3181#define RML9 0x200 /* Mailbox 9 Receive Message Lost */
3182#define nRML9 0x0
3183#define RML10 0x400 /* Mailbox 10 Receive Message Lost */
3184#define nRML10 0x0
3185#define RML11 0x800 /* Mailbox 11 Receive Message Lost */
3186#define nRML11 0x0
3187#define RML12 0x1000 /* Mailbox 12 Receive Message Lost */
3188#define nRML12 0x0
3189#define RML13 0x2000 /* Mailbox 13 Receive Message Lost */
3190#define nRML13 0x0
3191#define RML14 0x4000 /* Mailbox 14 Receive Message Lost */
3192#define nRML14 0x0
3193#define RML15 0x8000 /* Mailbox 15 Receive Message Lost */
3194#define nRML15 0x0
3195
3196/* Bit masks for CAN0_RML2 */
3197
3198#define RML16 0x1 /* Mailbox 16 Receive Message Lost */
3199#define nRML16 0x0
3200#define RML17 0x2 /* Mailbox 17 Receive Message Lost */
3201#define nRML17 0x0
3202#define RML18 0x4 /* Mailbox 18 Receive Message Lost */
3203#define nRML18 0x0
3204#define RML19 0x8 /* Mailbox 19 Receive Message Lost */
3205#define nRML19 0x0
3206#define RML20 0x10 /* Mailbox 20 Receive Message Lost */
3207#define nRML20 0x0
3208#define RML21 0x20 /* Mailbox 21 Receive Message Lost */
3209#define nRML21 0x0
3210#define RML22 0x40 /* Mailbox 22 Receive Message Lost */
3211#define nRML22 0x0
3212#define RML23 0x80 /* Mailbox 23 Receive Message Lost */
3213#define nRML23 0x0
3214#define RML24 0x100 /* Mailbox 24 Receive Message Lost */
3215#define nRML24 0x0
3216#define RML25 0x200 /* Mailbox 25 Receive Message Lost */
3217#define nRML25 0x0
3218#define RML26 0x400 /* Mailbox 26 Receive Message Lost */
3219#define nRML26 0x0
3220#define RML27 0x800 /* Mailbox 27 Receive Message Lost */
3221#define nRML27 0x0
3222#define RML28 0x1000 /* Mailbox 28 Receive Message Lost */
3223#define nRML28 0x0
3224#define RML29 0x2000 /* Mailbox 29 Receive Message Lost */
3225#define nRML29 0x0
3226#define RML30 0x4000 /* Mailbox 30 Receive Message Lost */
3227#define nRML30 0x0
3228#define RML31 0x8000 /* Mailbox 31 Receive Message Lost */
3229#define nRML31 0x0
3230
3231/* Bit masks for CAN0_OPSS1 */
3232
3233#define OPSS0 0x1 /* Mailbox 0 Overwrite Protection/Single-Shot Transmission Enable */
3234#define nOPSS0 0x0
3235#define OPSS1 0x2 /* Mailbox 1 Overwrite Protection/Single-Shot Transmission Enable */
3236#define nOPSS1 0x0
3237#define OPSS2 0x4 /* Mailbox 2 Overwrite Protection/Single-Shot Transmission Enable */
3238#define nOPSS2 0x0
3239#define OPSS3 0x8 /* Mailbox 3 Overwrite Protection/Single-Shot Transmission Enable */
3240#define nOPSS3 0x0
3241#define OPSS4 0x10 /* Mailbox 4 Overwrite Protection/Single-Shot Transmission Enable */
3242#define nOPSS4 0x0
3243#define OPSS5 0x20 /* Mailbox 5 Overwrite Protection/Single-Shot Transmission Enable */
3244#define nOPSS5 0x0
3245#define OPSS6 0x40 /* Mailbox 6 Overwrite Protection/Single-Shot Transmission Enable */
3246#define nOPSS6 0x0
3247#define OPSS7 0x80 /* Mailbox 7 Overwrite Protection/Single-Shot Transmission Enable */
3248#define nOPSS7 0x0
3249#define OPSS8 0x100 /* Mailbox 8 Overwrite Protection/Single-Shot Transmission Enable */
3250#define nOPSS8 0x0
3251#define OPSS9 0x200 /* Mailbox 9 Overwrite Protection/Single-Shot Transmission Enable */
3252#define nOPSS9 0x0
3253#define OPSS10 0x400 /* Mailbox 10 Overwrite Protection/Single-Shot Transmission Enable */
3254#define nOPSS10 0x0
3255#define OPSS11 0x800 /* Mailbox 11 Overwrite Protection/Single-Shot Transmission Enable */
3256#define nOPSS11 0x0
3257#define OPSS12 0x1000 /* Mailbox 12 Overwrite Protection/Single-Shot Transmission Enable */
3258#define nOPSS12 0x0
3259#define OPSS13 0x2000 /* Mailbox 13 Overwrite Protection/Single-Shot Transmission Enable */
3260#define nOPSS13 0x0
3261#define OPSS14 0x4000 /* Mailbox 14 Overwrite Protection/Single-Shot Transmission Enable */
3262#define nOPSS14 0x0
3263#define OPSS15 0x8000 /* Mailbox 15 Overwrite Protection/Single-Shot Transmission Enable */
3264#define nOPSS15 0x0
3265
3266/* Bit masks for CAN0_OPSS2 */
3267
3268#define OPSS16 0x1 /* Mailbox 16 Overwrite Protection/Single-Shot Transmission Enable */
3269#define nOPSS16 0x0
3270#define OPSS17 0x2 /* Mailbox 17 Overwrite Protection/Single-Shot Transmission Enable */
3271#define nOPSS17 0x0
3272#define OPSS18 0x4 /* Mailbox 18 Overwrite Protection/Single-Shot Transmission Enable */
3273#define nOPSS18 0x0
3274#define OPSS19 0x8 /* Mailbox 19 Overwrite Protection/Single-Shot Transmission Enable */
3275#define nOPSS19 0x0
3276#define OPSS20 0x10 /* Mailbox 20 Overwrite Protection/Single-Shot Transmission Enable */
3277#define nOPSS20 0x0
3278#define OPSS21 0x20 /* Mailbox 21 Overwrite Protection/Single-Shot Transmission Enable */
3279#define nOPSS21 0x0
3280#define OPSS22 0x40 /* Mailbox 22 Overwrite Protection/Single-Shot Transmission Enable */
3281#define nOPSS22 0x0
3282#define OPSS23 0x80 /* Mailbox 23 Overwrite Protection/Single-Shot Transmission Enable */
3283#define nOPSS23 0x0
3284#define OPSS24 0x100 /* Mailbox 24 Overwrite Protection/Single-Shot Transmission Enable */
3285#define nOPSS24 0x0
3286#define OPSS25 0x200 /* Mailbox 25 Overwrite Protection/Single-Shot Transmission Enable */
3287#define nOPSS25 0x0
3288#define OPSS26 0x400 /* Mailbox 26 Overwrite Protection/Single-Shot Transmission Enable */
3289#define nOPSS26 0x0
3290#define OPSS27 0x800 /* Mailbox 27 Overwrite Protection/Single-Shot Transmission Enable */
3291#define nOPSS27 0x0
3292#define OPSS28 0x1000 /* Mailbox 28 Overwrite Protection/Single-Shot Transmission Enable */
3293#define nOPSS28 0x0
3294#define OPSS29 0x2000 /* Mailbox 29 Overwrite Protection/Single-Shot Transmission Enable */
3295#define nOPSS29 0x0
3296#define OPSS30 0x4000 /* Mailbox 30 Overwrite Protection/Single-Shot Transmission Enable */
3297#define nOPSS30 0x0
3298#define OPSS31 0x8000 /* Mailbox 31 Overwrite Protection/Single-Shot Transmission Enable */
3299#define nOPSS31 0x0
3300
3301/* Bit masks for CAN0_TRS1 */
3302
3303#define TRS0 0x1 /* Mailbox 0 Transmit Request Set */
3304#define nTRS0 0x0
3305#define TRS1 0x2 /* Mailbox 1 Transmit Request Set */
3306#define nTRS1 0x0
3307#define TRS2 0x4 /* Mailbox 2 Transmit Request Set */
3308#define nTRS2 0x0
3309#define TRS3 0x8 /* Mailbox 3 Transmit Request Set */
3310#define nTRS3 0x0
3311#define TRS4 0x10 /* Mailbox 4 Transmit Request Set */
3312#define nTRS4 0x0
3313#define TRS5 0x20 /* Mailbox 5 Transmit Request Set */
3314#define nTRS5 0x0
3315#define TRS6 0x40 /* Mailbox 6 Transmit Request Set */
3316#define nTRS6 0x0
3317#define TRS7 0x80 /* Mailbox 7 Transmit Request Set */
3318#define nTRS7 0x0
3319#define TRS8 0x100 /* Mailbox 8 Transmit Request Set */
3320#define nTRS8 0x0
3321#define TRS9 0x200 /* Mailbox 9 Transmit Request Set */
3322#define nTRS9 0x0
3323#define TRS10 0x400 /* Mailbox 10 Transmit Request Set */
3324#define nTRS10 0x0
3325#define TRS11 0x800 /* Mailbox 11 Transmit Request Set */
3326#define nTRS11 0x0
3327#define TRS12 0x1000 /* Mailbox 12 Transmit Request Set */
3328#define nTRS12 0x0
3329#define TRS13 0x2000 /* Mailbox 13 Transmit Request Set */
3330#define nTRS13 0x0
3331#define TRS14 0x4000 /* Mailbox 14 Transmit Request Set */
3332#define nTRS14 0x0
3333#define TRS15 0x8000 /* Mailbox 15 Transmit Request Set */
3334#define nTRS15 0x0
3335
3336/* Bit masks for CAN0_TRS2 */
3337
3338#define TRS16 0x1 /* Mailbox 16 Transmit Request Set */
3339#define nTRS16 0x0
3340#define TRS17 0x2 /* Mailbox 17 Transmit Request Set */
3341#define nTRS17 0x0
3342#define TRS18 0x4 /* Mailbox 18 Transmit Request Set */
3343#define nTRS18 0x0
3344#define TRS19 0x8 /* Mailbox 19 Transmit Request Set */
3345#define nTRS19 0x0
3346#define TRS20 0x10 /* Mailbox 20 Transmit Request Set */
3347#define nTRS20 0x0
3348#define TRS21 0x20 /* Mailbox 21 Transmit Request Set */
3349#define nTRS21 0x0
3350#define TRS22 0x40 /* Mailbox 22 Transmit Request Set */
3351#define nTRS22 0x0
3352#define TRS23 0x80 /* Mailbox 23 Transmit Request Set */
3353#define nTRS23 0x0
3354#define TRS24 0x100 /* Mailbox 24 Transmit Request Set */
3355#define nTRS24 0x0
3356#define TRS25 0x200 /* Mailbox 25 Transmit Request Set */
3357#define nTRS25 0x0
3358#define TRS26 0x400 /* Mailbox 26 Transmit Request Set */
3359#define nTRS26 0x0
3360#define TRS27 0x800 /* Mailbox 27 Transmit Request Set */
3361#define nTRS27 0x0
3362#define TRS28 0x1000 /* Mailbox 28 Transmit Request Set */
3363#define nTRS28 0x0
3364#define TRS29 0x2000 /* Mailbox 29 Transmit Request Set */
3365#define nTRS29 0x0
3366#define TRS30 0x4000 /* Mailbox 30 Transmit Request Set */
3367#define nTRS30 0x0
3368#define TRS31 0x8000 /* Mailbox 31 Transmit Request Set */
3369#define nTRS31 0x0
3370
3371/* Bit masks for CAN0_TRR1 */
3372
3373#define TRR0 0x1 /* Mailbox 0 Transmit Request Reset */
3374#define nTRR0 0x0
3375#define TRR1 0x2 /* Mailbox 1 Transmit Request Reset */
3376#define nTRR1 0x0
3377#define TRR2 0x4 /* Mailbox 2 Transmit Request Reset */
3378#define nTRR2 0x0
3379#define TRR3 0x8 /* Mailbox 3 Transmit Request Reset */
3380#define nTRR3 0x0
3381#define TRR4 0x10 /* Mailbox 4 Transmit Request Reset */
3382#define nTRR4 0x0
3383#define TRR5 0x20 /* Mailbox 5 Transmit Request Reset */
3384#define nTRR5 0x0
3385#define TRR6 0x40 /* Mailbox 6 Transmit Request Reset */
3386#define nTRR6 0x0
3387#define TRR7 0x80 /* Mailbox 7 Transmit Request Reset */
3388#define nTRR7 0x0
3389#define TRR8 0x100 /* Mailbox 8 Transmit Request Reset */
3390#define nTRR8 0x0
3391#define TRR9 0x200 /* Mailbox 9 Transmit Request Reset */
3392#define nTRR9 0x0
3393#define TRR10 0x400 /* Mailbox 10 Transmit Request Reset */
3394#define nTRR10 0x0
3395#define TRR11 0x800 /* Mailbox 11 Transmit Request Reset */
3396#define nTRR11 0x0
3397#define TRR12 0x1000 /* Mailbox 12 Transmit Request Reset */
3398#define nTRR12 0x0
3399#define TRR13 0x2000 /* Mailbox 13 Transmit Request Reset */
3400#define nTRR13 0x0
3401#define TRR14 0x4000 /* Mailbox 14 Transmit Request Reset */
3402#define nTRR14 0x0
3403#define TRR15 0x8000 /* Mailbox 15 Transmit Request Reset */
3404#define nTRR15 0x0
3405
3406/* Bit masks for CAN0_TRR2 */
3407
3408#define TRR16 0x1 /* Mailbox 16 Transmit Request Reset */
3409#define nTRR16 0x0
3410#define TRR17 0x2 /* Mailbox 17 Transmit Request Reset */
3411#define nTRR17 0x0
3412#define TRR18 0x4 /* Mailbox 18 Transmit Request Reset */
3413#define nTRR18 0x0
3414#define TRR19 0x8 /* Mailbox 19 Transmit Request Reset */
3415#define nTRR19 0x0
3416#define TRR20 0x10 /* Mailbox 20 Transmit Request Reset */
3417#define nTRR20 0x0
3418#define TRR21 0x20 /* Mailbox 21 Transmit Request Reset */
3419#define nTRR21 0x0
3420#define TRR22 0x40 /* Mailbox 22 Transmit Request Reset */
3421#define nTRR22 0x0
3422#define TRR23 0x80 /* Mailbox 23 Transmit Request Reset */
3423#define nTRR23 0x0
3424#define TRR24 0x100 /* Mailbox 24 Transmit Request Reset */
3425#define nTRR24 0x0
3426#define TRR25 0x200 /* Mailbox 25 Transmit Request Reset */
3427#define nTRR25 0x0
3428#define TRR26 0x400 /* Mailbox 26 Transmit Request Reset */
3429#define nTRR26 0x0
3430#define TRR27 0x800 /* Mailbox 27 Transmit Request Reset */
3431#define nTRR27 0x0
3432#define TRR28 0x1000 /* Mailbox 28 Transmit Request Reset */
3433#define nTRR28 0x0
3434#define TRR29 0x2000 /* Mailbox 29 Transmit Request Reset */
3435#define nTRR29 0x0
3436#define TRR30 0x4000 /* Mailbox 30 Transmit Request Reset */
3437#define nTRR30 0x0
3438#define TRR31 0x8000 /* Mailbox 31 Transmit Request Reset */
3439#define nTRR31 0x0
3440
3441/* Bit masks for CAN0_AA1 */
3442
3443#define AA0 0x1 /* Mailbox 0 Abort Acknowledge */
3444#define nAA0 0x0
3445#define AA1 0x2 /* Mailbox 1 Abort Acknowledge */
3446#define nAA1 0x0
3447#define AA2 0x4 /* Mailbox 2 Abort Acknowledge */
3448#define nAA2 0x0
3449#define AA3 0x8 /* Mailbox 3 Abort Acknowledge */
3450#define nAA3 0x0
3451#define AA4 0x10 /* Mailbox 4 Abort Acknowledge */
3452#define nAA4 0x0
3453#define AA5 0x20 /* Mailbox 5 Abort Acknowledge */
3454#define nAA5 0x0
3455#define AA6 0x40 /* Mailbox 6 Abort Acknowledge */
3456#define nAA6 0x0
3457#define AA7 0x80 /* Mailbox 7 Abort Acknowledge */
3458#define nAA7 0x0
3459#define AA8 0x100 /* Mailbox 8 Abort Acknowledge */
3460#define nAA8 0x0
3461#define AA9 0x200 /* Mailbox 9 Abort Acknowledge */
3462#define nAA9 0x0
3463#define AA10 0x400 /* Mailbox 10 Abort Acknowledge */
3464#define nAA10 0x0
3465#define AA11 0x800 /* Mailbox 11 Abort Acknowledge */
3466#define nAA11 0x0
3467#define AA12 0x1000 /* Mailbox 12 Abort Acknowledge */
3468#define nAA12 0x0
3469#define AA13 0x2000 /* Mailbox 13 Abort Acknowledge */
3470#define nAA13 0x0
3471#define AA14 0x4000 /* Mailbox 14 Abort Acknowledge */
3472#define nAA14 0x0
3473#define AA15 0x8000 /* Mailbox 15 Abort Acknowledge */
3474#define nAA15 0x0
3475
3476/* Bit masks for CAN0_AA2 */
3477
3478#define AA16 0x1 /* Mailbox 16 Abort Acknowledge */
3479#define nAA16 0x0
3480#define AA17 0x2 /* Mailbox 17 Abort Acknowledge */
3481#define nAA17 0x0
3482#define AA18 0x4 /* Mailbox 18 Abort Acknowledge */
3483#define nAA18 0x0
3484#define AA19 0x8 /* Mailbox 19 Abort Acknowledge */
3485#define nAA19 0x0
3486#define AA20 0x10 /* Mailbox 20 Abort Acknowledge */
3487#define nAA20 0x0
3488#define AA21 0x20 /* Mailbox 21 Abort Acknowledge */
3489#define nAA21 0x0
3490#define AA22 0x40 /* Mailbox 22 Abort Acknowledge */
3491#define nAA22 0x0
3492#define AA23 0x80 /* Mailbox 23 Abort Acknowledge */
3493#define nAA23 0x0
3494#define AA24 0x100 /* Mailbox 24 Abort Acknowledge */
3495#define nAA24 0x0
3496#define AA25 0x200 /* Mailbox 25 Abort Acknowledge */
3497#define nAA25 0x0
3498#define AA26 0x400 /* Mailbox 26 Abort Acknowledge */
3499#define nAA26 0x0
3500#define AA27 0x800 /* Mailbox 27 Abort Acknowledge */
3501#define nAA27 0x0
3502#define AA28 0x1000 /* Mailbox 28 Abort Acknowledge */
3503#define nAA28 0x0
3504#define AA29 0x2000 /* Mailbox 29 Abort Acknowledge */
3505#define nAA29 0x0
3506#define AA30 0x4000 /* Mailbox 30 Abort Acknowledge */
3507#define nAA30 0x0
3508#define AA31 0x8000 /* Mailbox 31 Abort Acknowledge */
3509#define nAA31 0x0
3510
3511/* Bit masks for CAN0_TA1 */
3512
3513#define TA0 0x1 /* Mailbox 0 Transmit Acknowledge */
3514#define nTA0 0x0
3515#define TA1 0x2 /* Mailbox 1 Transmit Acknowledge */
3516#define nTA1 0x0
3517#define TA2 0x4 /* Mailbox 2 Transmit Acknowledge */
3518#define nTA2 0x0
3519#define TA3 0x8 /* Mailbox 3 Transmit Acknowledge */
3520#define nTA3 0x0
3521#define TA4 0x10 /* Mailbox 4 Transmit Acknowledge */
3522#define nTA4 0x0
3523#define TA5 0x20 /* Mailbox 5 Transmit Acknowledge */
3524#define nTA5 0x0
3525#define TA6 0x40 /* Mailbox 6 Transmit Acknowledge */
3526#define nTA6 0x0
3527#define TA7 0x80 /* Mailbox 7 Transmit Acknowledge */
3528#define nTA7 0x0
3529#define TA8 0x100 /* Mailbox 8 Transmit Acknowledge */
3530#define nTA8 0x0
3531#define TA9 0x200 /* Mailbox 9 Transmit Acknowledge */
3532#define nTA9 0x0
3533#define TA10 0x400 /* Mailbox 10 Transmit Acknowledge */
3534#define nTA10 0x0
3535#define TA11 0x800 /* Mailbox 11 Transmit Acknowledge */
3536#define nTA11 0x0
3537#define TA12 0x1000 /* Mailbox 12 Transmit Acknowledge */
3538#define nTA12 0x0
3539#define TA13 0x2000 /* Mailbox 13 Transmit Acknowledge */
3540#define nTA13 0x0
3541#define TA14 0x4000 /* Mailbox 14 Transmit Acknowledge */
3542#define nTA14 0x0
3543#define TA15 0x8000 /* Mailbox 15 Transmit Acknowledge */
3544#define nTA15 0x0
3545
3546/* Bit masks for CAN0_TA2 */
3547
3548#define TA16 0x1 /* Mailbox 16 Transmit Acknowledge */
3549#define nTA16 0x0
3550#define TA17 0x2 /* Mailbox 17 Transmit Acknowledge */
3551#define nTA17 0x0
3552#define TA18 0x4 /* Mailbox 18 Transmit Acknowledge */
3553#define nTA18 0x0
3554#define TA19 0x8 /* Mailbox 19 Transmit Acknowledge */
3555#define nTA19 0x0
3556#define TA20 0x10 /* Mailbox 20 Transmit Acknowledge */
3557#define nTA20 0x0
3558#define TA21 0x20 /* Mailbox 21 Transmit Acknowledge */
3559#define nTA21 0x0
3560#define TA22 0x40 /* Mailbox 22 Transmit Acknowledge */
3561#define nTA22 0x0
3562#define TA23 0x80 /* Mailbox 23 Transmit Acknowledge */
3563#define nTA23 0x0
3564#define TA24 0x100 /* Mailbox 24 Transmit Acknowledge */
3565#define nTA24 0x0
3566#define TA25 0x200 /* Mailbox 25 Transmit Acknowledge */
3567#define nTA25 0x0
3568#define TA26 0x400 /* Mailbox 26 Transmit Acknowledge */
3569#define nTA26 0x0
3570#define TA27 0x800 /* Mailbox 27 Transmit Acknowledge */
3571#define nTA27 0x0
3572#define TA28 0x1000 /* Mailbox 28 Transmit Acknowledge */
3573#define nTA28 0x0
3574#define TA29 0x2000 /* Mailbox 29 Transmit Acknowledge */
3575#define nTA29 0x0
3576#define TA30 0x4000 /* Mailbox 30 Transmit Acknowledge */
3577#define nTA30 0x0
3578#define TA31 0x8000 /* Mailbox 31 Transmit Acknowledge */
3579#define nTA31 0x0
3580
3581/* Bit masks for CAN0_RFH1 */
3582
3583#define RFH0 0x1 /* Mailbox 0 Remote Frame Handling Enable */
3584#define nRFH0 0x0
3585#define RFH1 0x2 /* Mailbox 1 Remote Frame Handling Enable */
3586#define nRFH1 0x0
3587#define RFH2 0x4 /* Mailbox 2 Remote Frame Handling Enable */
3588#define nRFH2 0x0
3589#define RFH3 0x8 /* Mailbox 3 Remote Frame Handling Enable */
3590#define nRFH3 0x0
3591#define RFH4 0x10 /* Mailbox 4 Remote Frame Handling Enable */
3592#define nRFH4 0x0
3593#define RFH5 0x20 /* Mailbox 5 Remote Frame Handling Enable */
3594#define nRFH5 0x0
3595#define RFH6 0x40 /* Mailbox 6 Remote Frame Handling Enable */
3596#define nRFH6 0x0
3597#define RFH7 0x80 /* Mailbox 7 Remote Frame Handling Enable */
3598#define nRFH7 0x0
3599#define RFH8 0x100 /* Mailbox 8 Remote Frame Handling Enable */
3600#define nRFH8 0x0
3601#define RFH9 0x200 /* Mailbox 9 Remote Frame Handling Enable */
3602#define nRFH9 0x0
3603#define RFH10 0x400 /* Mailbox 10 Remote Frame Handling Enable */
3604#define nRFH10 0x0
3605#define RFH11 0x800 /* Mailbox 11 Remote Frame Handling Enable */
3606#define nRFH11 0x0
3607#define RFH12 0x1000 /* Mailbox 12 Remote Frame Handling Enable */
3608#define nRFH12 0x0
3609#define RFH13 0x2000 /* Mailbox 13 Remote Frame Handling Enable */
3610#define nRFH13 0x0
3611#define RFH14 0x4000 /* Mailbox 14 Remote Frame Handling Enable */
3612#define nRFH14 0x0
3613#define RFH15 0x8000 /* Mailbox 15 Remote Frame Handling Enable */
3614#define nRFH15 0x0
3615
3616/* Bit masks for CAN0_RFH2 */
3617
3618#define RFH16 0x1 /* Mailbox 16 Remote Frame Handling Enable */
3619#define nRFH16 0x0
3620#define RFH17 0x2 /* Mailbox 17 Remote Frame Handling Enable */
3621#define nRFH17 0x0
3622#define RFH18 0x4 /* Mailbox 18 Remote Frame Handling Enable */
3623#define nRFH18 0x0
3624#define RFH19 0x8 /* Mailbox 19 Remote Frame Handling Enable */
3625#define nRFH19 0x0
3626#define RFH20 0x10 /* Mailbox 20 Remote Frame Handling Enable */
3627#define nRFH20 0x0
3628#define RFH21 0x20 /* Mailbox 21 Remote Frame Handling Enable */
3629#define nRFH21 0x0
3630#define RFH22 0x40 /* Mailbox 22 Remote Frame Handling Enable */
3631#define nRFH22 0x0
3632#define RFH23 0x80 /* Mailbox 23 Remote Frame Handling Enable */
3633#define nRFH23 0x0
3634#define RFH24 0x100 /* Mailbox 24 Remote Frame Handling Enable */
3635#define nRFH24 0x0
3636#define RFH25 0x200 /* Mailbox 25 Remote Frame Handling Enable */
3637#define nRFH25 0x0
3638#define RFH26 0x400 /* Mailbox 26 Remote Frame Handling Enable */
3639#define nRFH26 0x0
3640#define RFH27 0x800 /* Mailbox 27 Remote Frame Handling Enable */
3641#define nRFH27 0x0
3642#define RFH28 0x1000 /* Mailbox 28 Remote Frame Handling Enable */
3643#define nRFH28 0x0
3644#define RFH29 0x2000 /* Mailbox 29 Remote Frame Handling Enable */
3645#define nRFH29 0x0
3646#define RFH30 0x4000 /* Mailbox 30 Remote Frame Handling Enable */
3647#define nRFH30 0x0
3648#define RFH31 0x8000 /* Mailbox 31 Remote Frame Handling Enable */
3649#define nRFH31 0x0
3650
3651/* Bit masks for CAN0_MBIM1 */
3652
3653#define MBIM0 0x1 /* Mailbox 0 Mailbox Interrupt Mask */
3654#define nMBIM0 0x0
3655#define MBIM1 0x2 /* Mailbox 1 Mailbox Interrupt Mask */
3656#define nMBIM1 0x0
3657#define MBIM2 0x4 /* Mailbox 2 Mailbox Interrupt Mask */
3658#define nMBIM2 0x0
3659#define MBIM3 0x8 /* Mailbox 3 Mailbox Interrupt Mask */
3660#define nMBIM3 0x0
3661#define MBIM4 0x10 /* Mailbox 4 Mailbox Interrupt Mask */
3662#define nMBIM4 0x0
3663#define MBIM5 0x20 /* Mailbox 5 Mailbox Interrupt Mask */
3664#define nMBIM5 0x0
3665#define MBIM6 0x40 /* Mailbox 6 Mailbox Interrupt Mask */
3666#define nMBIM6 0x0
3667#define MBIM7 0x80 /* Mailbox 7 Mailbox Interrupt Mask */
3668#define nMBIM7 0x0
3669#define MBIM8 0x100 /* Mailbox 8 Mailbox Interrupt Mask */
3670#define nMBIM8 0x0
3671#define MBIM9 0x200 /* Mailbox 9 Mailbox Interrupt Mask */
3672#define nMBIM9 0x0
3673#define MBIM10 0x400 /* Mailbox 10 Mailbox Interrupt Mask */
3674#define nMBIM10 0x0
3675#define MBIM11 0x800 /* Mailbox 11 Mailbox Interrupt Mask */
3676#define nMBIM11 0x0
3677#define MBIM12 0x1000 /* Mailbox 12 Mailbox Interrupt Mask */
3678#define nMBIM12 0x0
3679#define MBIM13 0x2000 /* Mailbox 13 Mailbox Interrupt Mask */
3680#define nMBIM13 0x0
3681#define MBIM14 0x4000 /* Mailbox 14 Mailbox Interrupt Mask */
3682#define nMBIM14 0x0
3683#define MBIM15 0x8000 /* Mailbox 15 Mailbox Interrupt Mask */
3684#define nMBIM15 0x0
3685
3686/* Bit masks for CAN0_MBIM2 */
3687
3688#define MBIM16 0x1 /* Mailbox 16 Mailbox Interrupt Mask */
3689#define nMBIM16 0x0
3690#define MBIM17 0x2 /* Mailbox 17 Mailbox Interrupt Mask */
3691#define nMBIM17 0x0
3692#define MBIM18 0x4 /* Mailbox 18 Mailbox Interrupt Mask */
3693#define nMBIM18 0x0
3694#define MBIM19 0x8 /* Mailbox 19 Mailbox Interrupt Mask */
3695#define nMBIM19 0x0
3696#define MBIM20 0x10 /* Mailbox 20 Mailbox Interrupt Mask */
3697#define nMBIM20 0x0
3698#define MBIM21 0x20 /* Mailbox 21 Mailbox Interrupt Mask */
3699#define nMBIM21 0x0
3700#define MBIM22 0x40 /* Mailbox 22 Mailbox Interrupt Mask */
3701#define nMBIM22 0x0
3702#define MBIM23 0x80 /* Mailbox 23 Mailbox Interrupt Mask */
3703#define nMBIM23 0x0
3704#define MBIM24 0x100 /* Mailbox 24 Mailbox Interrupt Mask */
3705#define nMBIM24 0x0
3706#define MBIM25 0x200 /* Mailbox 25 Mailbox Interrupt Mask */
3707#define nMBIM25 0x0
3708#define MBIM26 0x400 /* Mailbox 26 Mailbox Interrupt Mask */
3709#define nMBIM26 0x0
3710#define MBIM27 0x800 /* Mailbox 27 Mailbox Interrupt Mask */
3711#define nMBIM27 0x0
3712#define MBIM28 0x1000 /* Mailbox 28 Mailbox Interrupt Mask */
3713#define nMBIM28 0x0
3714#define MBIM29 0x2000 /* Mailbox 29 Mailbox Interrupt Mask */
3715#define nMBIM29 0x0
3716#define MBIM30 0x4000 /* Mailbox 30 Mailbox Interrupt Mask */
3717#define nMBIM30 0x0
3718#define MBIM31 0x8000 /* Mailbox 31 Mailbox Interrupt Mask */
3719#define nMBIM31 0x0
3720
3721/* Bit masks for CAN0_MBTIF1 */
3722
3723#define MBTIF0 0x1 /* Mailbox 0 Mailbox Transmit Interrupt Flag */
3724#define nMBTIF0 0x0
3725#define MBTIF1 0x2 /* Mailbox 1 Mailbox Transmit Interrupt Flag */
3726#define nMBTIF1 0x0
3727#define MBTIF2 0x4 /* Mailbox 2 Mailbox Transmit Interrupt Flag */
3728#define nMBTIF2 0x0
3729#define MBTIF3 0x8 /* Mailbox 3 Mailbox Transmit Interrupt Flag */
3730#define nMBTIF3 0x0
3731#define MBTIF4 0x10 /* Mailbox 4 Mailbox Transmit Interrupt Flag */
3732#define nMBTIF4 0x0
3733#define MBTIF5 0x20 /* Mailbox 5 Mailbox Transmit Interrupt Flag */
3734#define nMBTIF5 0x0
3735#define MBTIF6 0x40 /* Mailbox 6 Mailbox Transmit Interrupt Flag */
3736#define nMBTIF6 0x0
3737#define MBTIF7 0x80 /* Mailbox 7 Mailbox Transmit Interrupt Flag */
3738#define nMBTIF7 0x0
3739#define MBTIF8 0x100 /* Mailbox 8 Mailbox Transmit Interrupt Flag */
3740#define nMBTIF8 0x0
3741#define MBTIF9 0x200 /* Mailbox 9 Mailbox Transmit Interrupt Flag */
3742#define nMBTIF9 0x0
3743#define MBTIF10 0x400 /* Mailbox 10 Mailbox Transmit Interrupt Flag */
3744#define nMBTIF10 0x0
3745#define MBTIF11 0x800 /* Mailbox 11 Mailbox Transmit Interrupt Flag */
3746#define nMBTIF11 0x0
3747#define MBTIF12 0x1000 /* Mailbox 12 Mailbox Transmit Interrupt Flag */
3748#define nMBTIF12 0x0
3749#define MBTIF13 0x2000 /* Mailbox 13 Mailbox Transmit Interrupt Flag */
3750#define nMBTIF13 0x0
3751#define MBTIF14 0x4000 /* Mailbox 14 Mailbox Transmit Interrupt Flag */
3752#define nMBTIF14 0x0
3753#define MBTIF15 0x8000 /* Mailbox 15 Mailbox Transmit Interrupt Flag */
3754#define nMBTIF15 0x0
3755
3756/* Bit masks for CAN0_MBTIF2 */
3757
3758#define MBTIF16 0x1 /* Mailbox 16 Mailbox Transmit Interrupt Flag */
3759#define nMBTIF16 0x0
3760#define MBTIF17 0x2 /* Mailbox 17 Mailbox Transmit Interrupt Flag */
3761#define nMBTIF17 0x0
3762#define MBTIF18 0x4 /* Mailbox 18 Mailbox Transmit Interrupt Flag */
3763#define nMBTIF18 0x0
3764#define MBTIF19 0x8 /* Mailbox 19 Mailbox Transmit Interrupt Flag */
3765#define nMBTIF19 0x0
3766#define MBTIF20 0x10 /* Mailbox 20 Mailbox Transmit Interrupt Flag */
3767#define nMBTIF20 0x0
3768#define MBTIF21 0x20 /* Mailbox 21 Mailbox Transmit Interrupt Flag */
3769#define nMBTIF21 0x0
3770#define MBTIF22 0x40 /* Mailbox 22 Mailbox Transmit Interrupt Flag */
3771#define nMBTIF22 0x0
3772#define MBTIF23 0x80 /* Mailbox 23 Mailbox Transmit Interrupt Flag */
3773#define nMBTIF23 0x0
3774#define MBTIF24 0x100 /* Mailbox 24 Mailbox Transmit Interrupt Flag */
3775#define nMBTIF24 0x0
3776#define MBTIF25 0x200 /* Mailbox 25 Mailbox Transmit Interrupt Flag */
3777#define nMBTIF25 0x0
3778#define MBTIF26 0x400 /* Mailbox 26 Mailbox Transmit Interrupt Flag */
3779#define nMBTIF26 0x0
3780#define MBTIF27 0x800 /* Mailbox 27 Mailbox Transmit Interrupt Flag */
3781#define nMBTIF27 0x0
3782#define MBTIF28 0x1000 /* Mailbox 28 Mailbox Transmit Interrupt Flag */
3783#define nMBTIF28 0x0
3784#define MBTIF29 0x2000 /* Mailbox 29 Mailbox Transmit Interrupt Flag */
3785#define nMBTIF29 0x0
3786#define MBTIF30 0x4000 /* Mailbox 30 Mailbox Transmit Interrupt Flag */
3787#define nMBTIF30 0x0
3788#define MBTIF31 0x8000 /* Mailbox 31 Mailbox Transmit Interrupt Flag */
3789#define nMBTIF31 0x0
3790
3791/* Bit masks for CAN0_MBRIF1 */
3792
3793#define MBRIF0 0x1 /* Mailbox 0 Mailbox Receive Interrupt Flag */
3794#define nMBRIF0 0x0
3795#define MBRIF1 0x2 /* Mailbox 1 Mailbox Receive Interrupt Flag */
3796#define nMBRIF1 0x0
3797#define MBRIF2 0x4 /* Mailbox 2 Mailbox Receive Interrupt Flag */
3798#define nMBRIF2 0x0
3799#define MBRIF3 0x8 /* Mailbox 3 Mailbox Receive Interrupt Flag */
3800#define nMBRIF3 0x0
3801#define MBRIF4 0x10 /* Mailbox 4 Mailbox Receive Interrupt Flag */
3802#define nMBRIF4 0x0
3803#define MBRIF5 0x20 /* Mailbox 5 Mailbox Receive Interrupt Flag */
3804#define nMBRIF5 0x0
3805#define MBRIF6 0x40 /* Mailbox 6 Mailbox Receive Interrupt Flag */
3806#define nMBRIF6 0x0
3807#define MBRIF7 0x80 /* Mailbox 7 Mailbox Receive Interrupt Flag */
3808#define nMBRIF7 0x0
3809#define MBRIF8 0x100 /* Mailbox 8 Mailbox Receive Interrupt Flag */
3810#define nMBRIF8 0x0
3811#define MBRIF9 0x200 /* Mailbox 9 Mailbox Receive Interrupt Flag */
3812#define nMBRIF9 0x0
3813#define MBRIF10 0x400 /* Mailbox 10 Mailbox Receive Interrupt Flag */
3814#define nMBRIF10 0x0
3815#define MBRIF11 0x800 /* Mailbox 11 Mailbox Receive Interrupt Flag */
3816#define nMBRIF11 0x0
3817#define MBRIF12 0x1000 /* Mailbox 12 Mailbox Receive Interrupt Flag */
3818#define nMBRIF12 0x0
3819#define MBRIF13 0x2000 /* Mailbox 13 Mailbox Receive Interrupt Flag */
3820#define nMBRIF13 0x0
3821#define MBRIF14 0x4000 /* Mailbox 14 Mailbox Receive Interrupt Flag */
3822#define nMBRIF14 0x0
3823#define MBRIF15 0x8000 /* Mailbox 15 Mailbox Receive Interrupt Flag */
3824#define nMBRIF15 0x0
3825
3826/* Bit masks for CAN0_MBRIF2 */
3827
3828#define MBRIF16 0x1 /* Mailbox 16 Mailbox Receive Interrupt Flag */
3829#define nMBRIF16 0x0
3830#define MBRIF17 0x2 /* Mailbox 17 Mailbox Receive Interrupt Flag */
3831#define nMBRIF17 0x0
3832#define MBRIF18 0x4 /* Mailbox 18 Mailbox Receive Interrupt Flag */
3833#define nMBRIF18 0x0
3834#define MBRIF19 0x8 /* Mailbox 19 Mailbox Receive Interrupt Flag */
3835#define nMBRIF19 0x0
3836#define MBRIF20 0x10 /* Mailbox 20 Mailbox Receive Interrupt Flag */
3837#define nMBRIF20 0x0
3838#define MBRIF21 0x20 /* Mailbox 21 Mailbox Receive Interrupt Flag */
3839#define nMBRIF21 0x0
3840#define MBRIF22 0x40 /* Mailbox 22 Mailbox Receive Interrupt Flag */
3841#define nMBRIF22 0x0
3842#define MBRIF23 0x80 /* Mailbox 23 Mailbox Receive Interrupt Flag */
3843#define nMBRIF23 0x0
3844#define MBRIF24 0x100 /* Mailbox 24 Mailbox Receive Interrupt Flag */
3845#define nMBRIF24 0x0
3846#define MBRIF25 0x200 /* Mailbox 25 Mailbox Receive Interrupt Flag */
3847#define nMBRIF25 0x0
3848#define MBRIF26 0x400 /* Mailbox 26 Mailbox Receive Interrupt Flag */
3849#define nMBRIF26 0x0
3850#define MBRIF27 0x800 /* Mailbox 27 Mailbox Receive Interrupt Flag */
3851#define nMBRIF27 0x0
3852#define MBRIF28 0x1000 /* Mailbox 28 Mailbox Receive Interrupt Flag */
3853#define nMBRIF28 0x0
3854#define MBRIF29 0x2000 /* Mailbox 29 Mailbox Receive Interrupt Flag */
3855#define nMBRIF29 0x0
3856#define MBRIF30 0x4000 /* Mailbox 30 Mailbox Receive Interrupt Flag */
3857#define nMBRIF30 0x0
3858#define MBRIF31 0x8000 /* Mailbox 31 Mailbox Receive Interrupt Flag */
3859#define nMBRIF31 0x0
3860
3861/* Bit masks for EPPIx_STATUS */
3862
3863#define CFIFO_ERR 0x1 /* Chroma FIFO Error */
3864#define nCFIFO_ERR 0x0
3865#define YFIFO_ERR 0x2 /* Luma FIFO Error */
3866#define nYFIFO_ERR 0x0
3867#define LTERR_OVR 0x4 /* Line Track Overflow */
3868#define nLTERR_OVR 0x0
3869#define LTERR_UNDR 0x8 /* Line Track Underflow */
3870#define nLTERR_UNDR 0x0
3871#define FTERR_OVR 0x10 /* Frame Track Overflow */
3872#define nFTERR_OVR 0x0
3873#define FTERR_UNDR 0x20 /* Frame Track Underflow */
3874#define nFTERR_UNDR 0x0
3875#define ERR_NCOR 0x40 /* Preamble Error Not Corrected */
3876#define nERR_NCOR 0x0
3877#define DMA1URQ 0x80 /* DMA1 Urgent Request */
3878#define nDMA1URQ 0x0
3879#define DMA0URQ 0x100 /* DMA0 Urgent Request */
3880#define nDMA0URQ 0x0
3881#define ERR_DET 0x4000 /* Preamble Error Detected */
3882#define nERR_DET 0x0
3883#define FLD 0x8000 /* Field */
3884#define nFLD 0x0
3885
3886/* Bit masks for EPPIx_CONTROL */
3887
3888#define EPPI_EN 0x1 /* Enable */
3889#define nEPPI_EN 0x0
3890#define EPPI_DIR 0x2 /* Direction */
3891#define nEPPI_DIR 0x0
3892#define XFR_TYPE 0xc /* Operating Mode */
3893#define FS_CFG 0x30 /* Frame Sync Configuration */
3894#define FLD_SEL 0x40 /* Field Select/Trigger */
3895#define nFLD_SEL 0x0
3896#define ITU_TYPE 0x80 /* ITU Interlaced or Progressive */
3897#define nITU_TYPE 0x0
3898#define BLANKGEN 0x100 /* ITU Output Mode with Internal Blanking Generation */
3899#define nBLANKGEN 0x0
3900#define ICLKGEN 0x200 /* Internal Clock Generation */
3901#define nICLKGEN 0x0
3902#define IFSGEN 0x400 /* Internal Frame Sync Generation */
3903#define nIFSGEN 0x0
3904#define POLC 0x1800 /* Frame Sync and Data Driving/Sampling Edges */
3905#define POLS 0x6000 /* Frame Sync Polarity */
3906#define DLENGTH 0x38000 /* Data Length */
3907#define SKIP_EN 0x40000 /* Skip Enable */
3908#define nSKIP_EN 0x0
3909#define SKIP_EO 0x80000 /* Skip Even or Odd */
3910#define nSKIP_EO 0x0
3911#define PACKEN 0x100000 /* Packing/Unpacking Enable */
3912#define nPACKEN 0x0
3913#define SWAPEN 0x200000 /* Swap Enable */
3914#define nSWAPEN 0x0
3915#define SIGN_EXT 0x400000 /* Sign Extension or Zero-filled / Data Split Format */
3916#define nSIGN_EXT 0x0
3917#define SPLT_EVEN_ODD 0x800000 /* Split Even and Odd Data Samples */
3918#define nSPLT_EVEN_ODD 0x0
3919#define SUBSPLT_ODD 0x1000000 /* Sub-split Odd Samples */
3920#define nSUBSPLT_ODD 0x0
3921#define DMACFG 0x2000000 /* One or Two DMA Channels Mode */
3922#define nDMACFG 0x0
3923#define RGB_FMT_EN 0x4000000 /* RGB Formatting Enable */
3924#define nRGB_FMT_EN 0x0
3925#define FIFO_RWM 0x18000000 /* FIFO Regular Watermarks */
3926#define FIFO_UWM 0x60000000 /* FIFO Urgent Watermarks */
3927
3928/* Bit masks for EPPIx_FS2W_LVB */
3929
3930#define F1VB_BD 0xff /* Vertical Blanking before Field 1 Active Data */
3931#define F1VB_AD 0xff00 /* Vertical Blanking after Field 1 Active Data */
3932#define F2VB_BD 0xff0000 /* Vertical Blanking before Field 2 Active Data */
3933#define F2VB_AD 0xff000000 /* Vertical Blanking after Field 2 Active Data */
3934
3935/* Bit masks for EPPIx_FS2W_LAVF */
3936
3937#define F1_ACT 0xffff /* Number of Lines of Active Data in Field 1 */
3938#define F2_ACT 0xffff0000 /* Number of Lines of Active Data in Field 2 */
3939
3940/* Bit masks for EPPIx_CLIP */
3941
3942#define LOW_ODD 0xff /* Lower Limit for Odd Bytes (Chroma) */
3943#define HIGH_ODD 0xff00 /* Upper Limit for Odd Bytes (Chroma) */
3944#define LOW_EVEN 0xff0000 /* Lower Limit for Even Bytes (Luma) */
3945#define HIGH_EVEN 0xff000000 /* Upper Limit for Even Bytes (Luma) */
3946
3947/* Bit masks for SPIx_BAUD */
3948
3949#define SPI_BAUD 0xffff /* Baud Rate */
3950
3951/* Bit masks for SPIx_CTL */
3952
3953#define SPE 0x4000 /* SPI Enable */
3954#define nSPE 0x0
3955#define WOM 0x2000 /* Write Open Drain Master */
3956#define nWOM 0x0
3957#define MSTR 0x1000 /* Master Mode */
3958#define nMSTR 0x0
3959#define CPOL 0x800 /* Clock Polarity */
3960#define nCPOL 0x0
3961#define CPHA 0x400 /* Clock Phase */
3962#define nCPHA 0x0
3963#define LSBF 0x200 /* LSB First */
3964#define nLSBF 0x0
3965#define SIZE 0x100 /* Size of Words */
3966#define nSIZE 0x0
3967#define EMISO 0x20 /* Enable MISO Output */
3968#define nEMISO 0x0
3969#define PSSE 0x10 /* Slave-Select Enable */
3970#define nPSSE 0x0
3971#define GM 0x8 /* Get More Data */
3972#define nGM 0x0
3973#define SZ 0x4 /* Send Zero */
3974#define nSZ 0x0
3975#define TIMOD 0x3 /* Transfer Initiation Mode */
3976
3977/* Bit masks for SPIx_FLG */
3978
3979#define FLS1 0x2 /* Slave Select Enable 1 */
3980#define nFLS1 0x0
3981#define FLS2 0x4 /* Slave Select Enable 2 */
3982#define nFLS2 0x0
3983#define FLS3 0x8 /* Slave Select Enable 3 */
3984#define nFLS3 0x0
3985#define FLG1 0x200 /* Slave Select Value 1 */
3986#define nFLG1 0x0
3987#define FLG2 0x400 /* Slave Select Value 2 */
3988#define nFLG2 0x0
3989#define FLG3 0x800 /* Slave Select Value 3 */
3990#define nFLG3 0x0
3991
3992/* Bit masks for SPIx_STAT */
3993
3994#define TXCOL 0x40 /* Transmit Collision Error */
3995#define nTXCOL 0x0
3996#define RXS 0x20 /* RDBR Data Buffer Status */
3997#define nRXS 0x0
3998#define RBSY 0x10 /* Receive Error */
3999#define nRBSY 0x0
4000#define TXS 0x8 /* TDBR Data Buffer Status */
4001#define nTXS 0x0
4002#define TXE 0x4 /* Transmission Error */
4003#define nTXE 0x0
4004#define MODF 0x2 /* Mode Fault Error */
4005#define nMODF 0x0
4006#define SPIF 0x1 /* SPI Finished */
4007#define nSPIF 0x0
4008
4009/* Bit masks for SPIx_TDBR */
4010
4011#define TDBR 0xffff /* Transmit Data Buffer */
4012
4013/* Bit masks for SPIx_RDBR */
4014
4015#define RDBR 0xffff /* Receive Data Buffer */
4016
4017/* Bit masks for SPIx_SHADOW */
4018
4019#define SHADOW 0xffff /* RDBR Shadow */
4020
4021/* ************************************************ */
4022/* The TWI bit masks fields are from the ADSP-BF538 */
4023/* and they have not been verified as the final */
4024/* ones for the Moab processors ... bz 1/19/2007 */
4025/* ************************************************ */
4026
4027/* Bit masks for TWIx_CONTROL */
4028
4029#define PRESCALE 0x7f /* Prescale Value */
4030#define TWI_ENA 0x80 /* TWI Enable */
4031#define nTWI_ENA 0x0
4032#define SCCB 0x200 /* Serial Camera Control Bus */
4033#define nSCCB 0x0
4034
4035/* Bit maskes for TWIx_CLKDIV */
4036
4037#define CLKLOW 0xff /* Clock Low */
4038#define CLKHI 0xff00 /* Clock High */
4039
4040/* Bit maskes for TWIx_SLAVE_CTL */
4041
4042#define SEN 0x1 /* Slave Enable */
4043#define nSEN 0x0
4044#define STDVAL 0x4 /* Slave Transmit Data Valid */
4045#define nSTDVAL 0x0
4046#define NAK 0x8 /* Not Acknowledge */
4047#define nNAK 0x0
4048#define GEN 0x10 /* General Call Enable */
4049#define nGEN 0x0
4050
4051/* Bit maskes for TWIx_SLAVE_ADDR */
4052
4053#define SADDR 0x7f /* Slave Mode Address */
4054
4055/* Bit maskes for TWIx_SLAVE_STAT */
4056
4057#define SDIR 0x1 /* Slave Transfer Direction */
4058#define nSDIR 0x0
4059#define GCALL 0x2 /* General Call */
4060#define nGCALL 0x0
4061
4062/* Bit maskes for TWIx_MASTER_CTL */
4063
4064#define MEN 0x1 /* Master Mode Enable */
4065#define nMEN 0x0
4066#define MDIR 0x4 /* Master Transfer Direction */
4067#define nMDIR 0x0
4068#define FAST 0x8 /* Fast Mode */
4069#define nFAST 0x0
4070#define STOP 0x10 /* Issue Stop Condition */
4071#define nSTOP 0x0
4072#define RSTART 0x20 /* Repeat Start */
4073#define nRSTART 0x0
4074#define DCNT 0x3fc0 /* Data Transfer Count */
4075#define SDAOVR 0x4000 /* Serial Data Override */
4076#define nSDAOVR 0x0
4077#define SCLOVR 0x8000 /* Serial Clock Override */
4078#define nSCLOVR 0x0
4079
4080/* Bit maskes for TWIx_MASTER_ADDR */
4081
4082#define MADDR 0x7f /* Master Mode Address */
4083
4084/* Bit maskes for TWIx_MASTER_STAT */
4085
4086#define MPROG 0x1 /* Master Transfer in Progress */
4087#define nMPROG 0x0
4088#define LOSTARB 0x2 /* Lost Arbitration */
4089#define nLOSTARB 0x0
4090#define ANAK 0x4 /* Address Not Acknowledged */
4091#define nANAK 0x0
4092#define DNAK 0x8 /* Data Not Acknowledged */
4093#define nDNAK 0x0
4094#define BUFRDERR 0x10 /* Buffer Read Error */
4095#define nBUFRDERR 0x0
4096#define BUFWRERR 0x20 /* Buffer Write Error */
4097#define nBUFWRERR 0x0
4098#define SDASEN 0x40 /* Serial Data Sense */
4099#define nSDASEN 0x0
4100#define SCLSEN 0x80 /* Serial Clock Sense */
4101#define nSCLSEN 0x0
4102#define BUSBUSY 0x100 /* Bus Busy */
4103#define nBUSBUSY 0x0
4104
4105/* Bit maskes for TWIx_FIFO_CTL */
4106
4107#define XMTFLUSH 0x1 /* Transmit Buffer Flush */
4108#define nXMTFLUSH 0x0
4109#define RCVFLUSH 0x2 /* Receive Buffer Flush */
4110#define nRCVFLUSH 0x0
4111#define XMTINTLEN 0x4 /* Transmit Buffer Interrupt Length */
4112#define nXMTINTLEN 0x0
4113#define RCVINTLEN 0x8 /* Receive Buffer Interrupt Length */
4114#define nRCVINTLEN 0x0
4115
4116/* Bit maskes for TWIx_FIFO_STAT */
4117
4118#define XMTSTAT 0x3 /* Transmit FIFO Status */
4119#define RCVSTAT 0xc /* Receive FIFO Status */
4120
4121/* Bit maskes for TWIx_INT_MASK */
4122
4123#define SINITM 0x1 /* Slave Transfer Initiated Interrupt Mask */
4124#define nSINITM 0x0
4125#define SCOMPM 0x2 /* Slave Transfer Complete Interrupt Mask */
4126#define nSCOMPM 0x0
4127#define SERRM 0x4 /* Slave Transfer Error Interrupt Mask */
4128#define nSERRM 0x0
4129#define SOVFM 0x8 /* Slave Overflow Interrupt Mask */
4130#define nSOVFM 0x0
4131#define MCOMPM 0x10 /* Master Transfer Complete Interrupt Mask */
4132#define nMCOMPM 0x0
4133#define MERRM 0x20 /* Master Transfer Error Interrupt Mask */
4134#define nMERRM 0x0
4135#define XMTSERVM 0x40 /* Transmit FIFO Service Interrupt Mask */
4136#define nXMTSERVM 0x0
4137#define RCVSERVM 0x80 /* Receive FIFO Service Interrupt Mask */
4138#define nRCVSERVM 0x0
4139
4140/* Bit maskes for TWIx_INT_STAT */
4141
4142#define SINIT 0x1 /* Slave Transfer Initiated */
4143#define nSINIT 0x0
4144#define SCOMP 0x2 /* Slave Transfer Complete */
4145#define nSCOMP 0x0
4146#define SERR 0x4 /* Slave Transfer Error */
4147#define nSERR 0x0
4148#define SOVF 0x8 /* Slave Overflow */
4149#define nSOVF 0x0
4150#define MCOMP 0x10 /* Master Transfer Complete */
4151#define nMCOMP 0x0
4152#define MERR 0x20 /* Master Transfer Error */
4153#define nMERR 0x0
4154#define XMTSERV 0x40 /* Transmit FIFO Service */
4155#define nXMTSERV 0x0
4156#define RCVSERV 0x80 /* Receive FIFO Service */
4157#define nRCVSERV 0x0
4158
4159/* Bit maskes for TWIx_XMT_DATA8 */
4160
4161#define XMTDATA8 0xff /* Transmit FIFO 8-Bit Data */
4162
4163/* Bit maskes for TWIx_XMT_DATA16 */
4164
4165#define XMTDATA16 0xffff /* Transmit FIFO 16-Bit Data */
4166
4167/* Bit maskes for TWIx_RCV_DATA8 */
4168
4169#define RCVDATA8 0xff /* Receive FIFO 8-Bit Data */
4170
4171/* Bit maskes for TWIx_RCV_DATA16 */
4172
4173#define RCVDATA16 0xffff /* Receive FIFO 16-Bit Data */
4174
4175/* Bit masks for SPORTx_TCR1 */
4176
4177#define TCKFE 0x4000 /* Clock Falling Edge Select */
4178#define nTCKFE 0x0
4179#define LATFS 0x2000 /* Late Transmit Frame Sync */
4180#define nLATFS 0x0
4181#define LTFS 0x1000 /* Low Transmit Frame Sync Select */
4182#define nLTFS 0x0
4183#define DITFS 0x800 /* Data-Independent Transmit Frame Sync Select */
4184#define nDITFS 0x0
4185#define TFSR 0x400 /* Transmit Frame Sync Required Select */
4186#define nTFSR 0x0
4187#define ITFS 0x200 /* Internal Transmit Frame Sync Select */
4188#define nITFS 0x0
4189#define TLSBIT 0x10 /* Transmit Bit Order */
4190#define nTLSBIT 0x0
4191#define TDTYPE 0xc /* Data Formatting Type Select */
4192#define ITCLK 0x2 /* Internal Transmit Clock Select */
4193#define nITCLK 0x0
4194#define TSPEN 0x1 /* Transmit Enable */
4195#define nTSPEN 0x0
4196
4197/* Bit masks for SPORTx_TCR2 */
4198
4199#define TRFST 0x400 /* Left/Right Order */
4200#define nTRFST 0x0
4201#define TSFSE 0x200 /* Transmit Stereo Frame Sync Enable */
4202#define nTSFSE 0x0
4203#define TXSE 0x100 /* TxSEC Enable */
4204#define nTXSE 0x0
4205#define SLEN_T 0x1f /* SPORT Word Length */
4206
4207/* Bit masks for SPORTx_RCR1 */
4208
4209#define RCKFE 0x4000 /* Clock Falling Edge Select */
4210#define nRCKFE 0x0
4211#define LARFS 0x2000 /* Late Receive Frame Sync */
4212#define nLARFS 0x0
4213#define LRFS 0x1000 /* Low Receive Frame Sync Select */
4214#define nLRFS 0x0
4215#define RFSR 0x400 /* Receive Frame Sync Required Select */
4216#define nRFSR 0x0
4217#define IRFS 0x200 /* Internal Receive Frame Sync Select */
4218#define nIRFS 0x0
4219#define RLSBIT 0x10 /* Receive Bit Order */
4220#define nRLSBIT 0x0
4221#define RDTYPE 0xc /* Data Formatting Type Select */
4222#define IRCLK 0x2 /* Internal Receive Clock Select */
4223#define nIRCLK 0x0
4224#define RSPEN 0x1 /* Receive Enable */
4225#define nRSPEN 0x0
4226
4227/* Bit masks for SPORTx_RCR2 */
4228
4229#define RRFST 0x400 /* Left/Right Order */
4230#define nRRFST 0x0
4231#define RSFSE 0x200 /* Receive Stereo Frame Sync Enable */
4232#define nRSFSE 0x0
4233#define RXSE 0x100 /* RxSEC Enable */
4234#define nRXSE 0x0
4235#define SLEN_R 0x1f /* SPORT Word Length */
4236
4237/* Bit masks for SPORTx_STAT */
4238
4239#define TXHRE 0x40 /* Transmit Hold Register Empty */
4240#define nTXHRE 0x0
4241#define TOVF 0x20 /* Sticky Transmit Overflow Status */
4242#define nTOVF 0x0
4243#define TUVF 0x10 /* Sticky Transmit Underflow Status */
4244#define nTUVF 0x0
4245#define TXF 0x8 /* Transmit FIFO Full Status */
4246#define nTXF 0x0
4247#define ROVF 0x4 /* Sticky Receive Overflow Status */
4248#define nROVF 0x0
4249#define RUVF 0x2 /* Sticky Receive Underflow Status */
4250#define nRUVF 0x0
4251#define RXNE 0x1 /* Receive FIFO Not Empty Status */
4252#define nRXNE 0x0
4253
4254/* Bit masks for SPORTx_MCMC1 */
4255
4256#define SP_WSIZE 0xf000 /* Window Size */
4257#define SP_WOFF 0x3ff /* Windows Offset */
4258
4259/* Bit masks for SPORTx_MCMC2 */
4260
4261#define MFD 0xf000 /* Multi channel Frame Delay */
4262#define FSDR 0x80 /* Frame Sync to Data Relationship */
4263#define nFSDR 0x0
4264#define MCMEM 0x10 /* Multi channel Frame Mode Enable */
4265#define nMCMEM 0x0
4266#define MCDRXPE 0x8 /* Multi channel DMA Receive Packing */
4267#define nMCDRXPE 0x0
4268#define MCDTXPE 0x4 /* Multi channel DMA Transmit Packing */
4269#define nMCDTXPE 0x0
4270#define MCCRM 0x3 /* 2X Clock Recovery Mode */
4271
4272/* Bit masks for SPORTx_CHNL */
4273
4274#define CUR_CHNL 0x3ff /* Current Channel Indicator */
4275
4276/* Bit masks for UARTx_LCR */
4277
4278#if 0
4279/* conflicts with legacy one in last section */
4280#define WLS 0x3 /* Word Length Select */
4281#endif
4282#define STB 0x4 /* Stop Bits */
4283#define nSTB 0x0
4284#define PEN 0x8 /* Parity Enable */
4285#define nPEN 0x0
4286#define EPS 0x10 /* Even Parity Select */
4287#define nEPS 0x0
4288#define STP 0x20 /* Sticky Parity */
4289#define nSTP 0x0
4290#define SB 0x40 /* Set Break */
4291#define nSB 0x0
4292
4293/* Bit masks for UARTx_MCR */
4294
4295#define XOFF 0x1 /* Transmitter Off */
4296#define nXOFF 0x0
4297#define MRTS 0x2 /* Manual Request To Send */
4298#define nMRTS 0x0
4299#define RFIT 0x4 /* Receive FIFO IRQ Threshold */
4300#define nRFIT 0x0
4301#define RFRT 0x8 /* Receive FIFO RTS Threshold */
4302#define nRFRT 0x0
4303#define LOOP_ENA 0x10 /* Loopback Mode Enable */
4304#define nLOOP_ENA 0x0
4305#define FCPOL 0x20 /* Flow Control Pin Polarity */
4306#define nFCPOL 0x0
4307#define ARTS 0x40 /* Automatic Request To Send */
4308#define nARTS 0x0
4309#define ACTS 0x80 /* Automatic Clear To Send */
4310#define nACTS 0x0
4311
4312/* Bit masks for UARTx_LSR */
4313
4314#define DR 0x1 /* Data Ready */
4315#define nDR 0x0
4316#define OE 0x2 /* Overrun Error */
4317#define nOE 0x0
4318#define PE 0x4 /* Parity Error */
4319#define nPE 0x0
4320#define FE 0x8 /* Framing Error */
4321#define nFE 0x0
4322#define BI 0x10 /* Break Interrupt */
4323#define nBI 0x0
4324#define THRE 0x20 /* THR Empty */
4325#define nTHRE 0x0
4326#define TEMT 0x40 /* Transmitter Empty */
4327#define nTEMT 0x0
4328#define TFI 0x80 /* Transmission Finished Indicator */
4329#define nTFI 0x0
4330
4331/* Bit masks for UARTx_MSR */
4332
4333#define SCTS 0x1 /* Sticky CTS */
4334#define nSCTS 0x0
4335#define CTS 0x10 /* Clear To Send */
4336#define nCTS 0x0
4337#define RFCS 0x20 /* Receive FIFO Count Status */
4338#define nRFCS 0x0
4339
4340/* Bit masks for UARTx_IER_SET */
4341
4342#define ERBFI_S 0x1 /* Enable Receive Buffer Full Interrupt */
4343#define nERBFI_S 0x0
4344#define ETBEI_S 0x2 /* Enable Transmit Buffer Empty Interrupt */
4345#define nETBEI_S 0x0
4346#define ELSI_S 0x4 /* Enable Receive Status Interrupt */
4347#define nELSI_S 0x0
4348#define EDSSI_S 0x8 /* Enable Modem Status Interrupt */
4349#define nEDSSI_S 0x0
4350#define EDTPTI_S 0x10 /* Enable DMA Transmit PIRQ Interrupt */
4351#define nEDTPTI_S 0x0
4352#define ETFI_S 0x20 /* Enable Transmission Finished Interrupt */
4353#define nETFI_S 0x0
4354#define ERFCI_S 0x40 /* Enable Receive FIFO Count Interrupt */
4355#define nERFCI_S 0x0
4356
4357/* Bit masks for UARTx_IER_CLEAR */
4358
4359#define ERBFI_C 0x1 /* Enable Receive Buffer Full Interrupt */
4360#define nERBFI_C 0x0
4361#define ETBEI_C 0x2 /* Enable Transmit Buffer Empty Interrupt */
4362#define nETBEI_C 0x0
4363#define ELSI_C 0x4 /* Enable Receive Status Interrupt */
4364#define nELSI_C 0x0
4365#define EDSSI_C 0x8 /* Enable Modem Status Interrupt */
4366#define nEDSSI_C 0x0
4367#define EDTPTI_C 0x10 /* Enable DMA Transmit PIRQ Interrupt */
4368#define nEDTPTI_C 0x0
4369#define ETFI_C 0x20 /* Enable Transmission Finished Interrupt */
4370#define nETFI_C 0x0
4371#define ERFCI_C 0x40 /* Enable Receive FIFO Count Interrupt */
4372#define nERFCI_C 0x0
4373
4374/* Bit masks for UARTx_GCTL */
4375
4376#define UCEN 0x1 /* UART Enable */
4377#define nUCEN 0x0
4378#define IREN 0x2 /* IrDA Mode Enable */
4379#define nIREN 0x0
4380#define TPOLC 0x4 /* IrDA TX Polarity Change */
4381#define nTPOLC 0x0
4382#define RPOLC 0x8 /* IrDA RX Polarity Change */
4383#define nRPOLC 0x0
4384#define FPE 0x10 /* Force Parity Error */
4385#define nFPE 0x0
4386#define FFE 0x20 /* Force Framing Error */
4387#define nFFE 0x0
4388#define EDBO 0x40 /* Enable Divide-by-One */
4389#define nEDBO 0x0
4390#define EGLSI 0x80 /* Enable Global LS Interrupt */
4391#define nEGLSI 0x0
4392
4393
4394/* ******************************************* */
4395/* MULTI BIT MACRO ENUMERATIONS */
4396/* ******************************************* */
4397
4398/* BCODE bit field options (SYSCFG register) */
4399
4400#define BCODE_WAKEUP 0x0000 /* boot according to wake-up condition */
4401#define BCODE_FULLBOOT 0x0010 /* always perform full boot */
4402#define BCODE_QUICKBOOT 0x0020 /* always perform quick boot */
4403#define BCODE_NOBOOT 0x0030 /* always perform full boot */
4404
4405/* CNT_COMMAND bit field options */
4406
4407#define W1LCNT_ZERO 0x0001 /* write 1 to load CNT_COUNTER with zero */
4408#define W1LCNT_MIN 0x0004 /* write 1 to load CNT_COUNTER from CNT_MIN */
4409#define W1LCNT_MAX 0x0008 /* write 1 to load CNT_COUNTER from CNT_MAX */
4410
4411#define W1LMIN_ZERO 0x0010 /* write 1 to load CNT_MIN with zero */
4412#define W1LMIN_CNT 0x0020 /* write 1 to load CNT_MIN from CNT_COUNTER */
4413#define W1LMIN_MAX 0x0080 /* write 1 to load CNT_MIN from CNT_MAX */
4414
4415#define W1LMAX_ZERO 0x0100 /* write 1 to load CNT_MAX with zero */
4416#define W1LMAX_CNT 0x0200 /* write 1 to load CNT_MAX from CNT_COUNTER */
4417#define W1LMAX_MIN 0x0400 /* write 1 to load CNT_MAX from CNT_MIN */
4418
4419/* CNT_CONFIG bit field options */
4420
4421#define CNTMODE_QUADENC 0x0000 /* quadrature encoder mode */
4422#define CNTMODE_BINENC 0x0100 /* binary encoder mode */
4423#define CNTMODE_UDCNT 0x0200 /* up/down counter mode */
4424#define CNTMODE_DIRCNT 0x0400 /* direction counter mode */
4425#define CNTMODE_DIRTMR 0x0500 /* direction timer mode */
4426
4427#define BNDMODE_COMP 0x0000 /* boundary compare mode */
4428#define BNDMODE_ZERO 0x1000 /* boundary compare and zero mode */
4429#define BNDMODE_CAPT 0x2000 /* boundary capture mode */
4430#define BNDMODE_AEXT 0x3000 /* boundary auto-extend mode */
4431
4432/* TMODE in TIMERx_CONFIG bit field options */
4433
4434#define PWM_OUT 0x0001
4435#define WDTH_CAP 0x0002
4436#define EXT_CLK 0x0003
4437
4438/* UARTx_LCR bit field options */
4439
4440#define WLS_5 0x0000 /* 5 data bits */
4441#define WLS_6 0x0001 /* 6 data bits */
4442#define WLS_7 0x0002 /* 7 data bits */
4443#define WLS_8 0x0003 /* 8 data bits */
4444
4445/* PINTx Register Bit Definitions */
4446
4447#define PIQ0 0x00000001
4448#define PIQ1 0x00000002
4449#define PIQ2 0x00000004
4450#define PIQ3 0x00000008
4451
4452#define PIQ4 0x00000010
4453#define PIQ5 0x00000020
4454#define PIQ6 0x00000040
4455#define PIQ7 0x00000080
4456
4457#define PIQ8 0x00000100
4458#define PIQ9 0x00000200
4459#define PIQ10 0x00000400
4460#define PIQ11 0x00000800
4461
4462#define PIQ12 0x00001000
4463#define PIQ13 0x00002000
4464#define PIQ14 0x00004000
4465#define PIQ15 0x00008000
4466
4467#define PIQ16 0x00010000
4468#define PIQ17 0x00020000
4469#define PIQ18 0x00040000
4470#define PIQ19 0x00080000
4471
4472#define PIQ20 0x00100000
4473#define PIQ21 0x00200000
4474#define PIQ22 0x00400000
4475#define PIQ23 0x00800000
4476
4477#define PIQ24 0x01000000
4478#define PIQ25 0x02000000
4479#define PIQ26 0x04000000
4480#define PIQ27 0x08000000
4481
4482#define PIQ28 0x10000000
4483#define PIQ29 0x20000000
4484#define PIQ30 0x40000000
4485#define PIQ31 0x80000000
4486
4487/* PORT A Bit Definitions for the registers
4488PORTA, PORTA_SET, PORTA_CLEAR,
4489PORTA_DIR_SET, PORTA_DIR_CLEAR, PORTA_INEN,
4490PORTA_FER registers
4491*/
4492
4493#define PA0 0x0001
4494#define PA1 0x0002
4495#define PA2 0x0004
4496#define PA3 0x0008
4497#define PA4 0x0010
4498#define PA5 0x0020
4499#define PA6 0x0040
4500#define PA7 0x0080
4501#define PA8 0x0100
4502#define PA9 0x0200
4503#define PA10 0x0400
4504#define PA11 0x0800
4505#define PA12 0x1000
4506#define PA13 0x2000
4507#define PA14 0x4000
4508#define PA15 0x8000
4509
4510/* PORT B Bit Definitions for the registers
4511PORTB, PORTB_SET, PORTB_CLEAR,
4512PORTB_DIR_SET, PORTB_DIR_CLEAR, PORTB_INEN,
4513PORTB_FER registers
4514*/
4515
4516#define PB0 0x0001
4517#define PB1 0x0002
4518#define PB2 0x0004
4519#define PB3 0x0008
4520#define PB4 0x0010
4521#define PB5 0x0020
4522#define PB6 0x0040
4523#define PB7 0x0080
4524#define PB8 0x0100
4525#define PB9 0x0200
4526#define PB10 0x0400
4527#define PB11 0x0800
4528#define PB12 0x1000
4529#define PB13 0x2000
4530#define PB14 0x4000
4531
4532
4533/* PORT C Bit Definitions for the registers
4534PORTC, PORTC_SET, PORTC_CLEAR,
4535PORTC_DIR_SET, PORTC_DIR_CLEAR, PORTC_INEN,
4536PORTC_FER registers
4537*/
4538
4539
4540#define PC0 0x0001
4541#define PC1 0x0002
4542#define PC2 0x0004
4543#define PC3 0x0008
4544#define PC4 0x0010
4545#define PC5 0x0020
4546#define PC6 0x0040
4547#define PC7 0x0080
4548#define PC8 0x0100
4549#define PC9 0x0200
4550#define PC10 0x0400
4551#define PC11 0x0800
4552#define PC12 0x1000
4553#define PC13 0x2000
4554
4555
4556/* PORT D Bit Definitions for the registers
4557PORTD, PORTD_SET, PORTD_CLEAR,
4558PORTD_DIR_SET, PORTD_DIR_CLEAR, PORTD_INEN,
4559PORTD_FER registers
4560*/
4561
4562#define PD0 0x0001
4563#define PD1 0x0002
4564#define PD2 0x0004
4565#define PD3 0x0008
4566#define PD4 0x0010
4567#define PD5 0x0020
4568#define PD6 0x0040
4569#define PD7 0x0080
4570#define PD8 0x0100
4571#define PD9 0x0200
4572#define PD10 0x0400
4573#define PD11 0x0800
4574#define PD12 0x1000
4575#define PD13 0x2000
4576#define PD14 0x4000
4577#define PD15 0x8000
4578
4579/* PORT E Bit Definitions for the registers
4580PORTE, PORTE_SET, PORTE_CLEAR,
4581PORTE_DIR_SET, PORTE_DIR_CLEAR, PORTE_INEN,
4582PORTE_FER registers
4583*/
4584
4585
4586#define PE0 0x0001
4587#define PE1 0x0002
4588#define PE2 0x0004
4589#define PE3 0x0008
4590#define PE4 0x0010
4591#define PE5 0x0020
4592#define PE6 0x0040
4593#define PE7 0x0080
4594#define PE8 0x0100
4595#define PE9 0x0200
4596#define PE10 0x0400
4597#define PE11 0x0800
4598#define PE12 0x1000
4599#define PE13 0x2000
4600#define PE14 0x4000
4601#define PE15 0x8000
4602
4603/* PORT F Bit Definitions for the registers
4604PORTF, PORTF_SET, PORTF_CLEAR,
4605PORTF_DIR_SET, PORTF_DIR_CLEAR, PORTF_INEN,
4606PORTF_FER registers
4607*/
4608
4609
4610#define PF0 0x0001
4611#define PF1 0x0002
4612#define PF2 0x0004
4613#define PF3 0x0008
4614#define PF4 0x0010
4615#define PF5 0x0020
4616#define PF6 0x0040
4617#define PF7 0x0080
4618#define PF8 0x0100
4619#define PF9 0x0200
4620#define PF10 0x0400
4621#define PF11 0x0800
4622#define PF12 0x1000
4623#define PF13 0x2000
4624#define PF14 0x4000
4625#define PF15 0x8000
4626
4627/* PORT G Bit Definitions for the registers
4628PORTG, PORTG_SET, PORTG_CLEAR,
4629PORTG_DIR_SET, PORTG_DIR_CLEAR, PORTG_INEN,
4630PORTG_FER registers
4631*/
4632
4633
4634#define PG0 0x0001
4635#define PG1 0x0002
4636#define PG2 0x0004
4637#define PG3 0x0008
4638#define PG4 0x0010
4639#define PG5 0x0020
4640#define PG6 0x0040
4641#define PG7 0x0080
4642#define PG8 0x0100
4643#define PG9 0x0200
4644#define PG10 0x0400
4645#define PG11 0x0800
4646#define PG12 0x1000
4647#define PG13 0x2000
4648#define PG14 0x4000
4649#define PG15 0x8000
4650
4651/* PORT H Bit Definitions for the registers
4652PORTH, PORTH_SET, PORTH_CLEAR,
4653PORTH_DIR_SET, PORTH_DIR_CLEAR, PORTH_INEN,
4654PORTH_FER registers
4655*/
4656
4657
4658#define PH0 0x0001
4659#define PH1 0x0002
4660#define PH2 0x0004
4661#define PH3 0x0008
4662#define PH4 0x0010
4663#define PH5 0x0020
4664#define PH6 0x0040
4665#define PH7 0x0080
4666#define PH8 0x0100
4667#define PH9 0x0200
4668#define PH10 0x0400
4669#define PH11 0x0800
4670#define PH12 0x1000
4671#define PH13 0x2000
4672
4673
4674/* PORT I Bit Definitions for the registers
4675PORTI, PORTI_SET, PORTI_CLEAR,
4676PORTI_DIR_SET, PORTI_DIR_CLEAR, PORTI_INEN,
4677PORTI_FER registers
4678*/
4679
4680
4681#define PI0 0x0001
4682#define PI1 0x0002
4683#define PI2 0x0004
4684#define PI3 0x0008
4685#define PI4 0x0010
4686#define PI5 0x0020
4687#define PI6 0x0040
4688#define PI7 0x0080
4689#define PI8 0x0100
4690#define PI9 0x0200
4691#define PI10 0x0400
4692#define PI11 0x0800
4693#define PI12 0x1000
4694#define PI13 0x2000
4695#define PI14 0x4000
4696#define PI15 0x8000
4697
4698/* PORT J Bit Definitions for the registers
4699PORTJ, PORTJ_SET, PORTJ_CLEAR,
4700PORTJ_DIR_SET, PORTJ_DIR_CLEAR, PORTJ_INEN,
4701PORTJ_FER registers
4702*/
4703
4704
4705#define PJ0 0x0001
4706#define PJ1 0x0002
4707#define PJ2 0x0004
4708#define PJ3 0x0008
4709#define PJ4 0x0010
4710#define PJ5 0x0020
4711#define PJ6 0x0040
4712#define PJ7 0x0080
4713#define PJ8 0x0100
4714#define PJ9 0x0200
4715#define PJ10 0x0400
4716#define PJ11 0x0800
4717#define PJ12 0x1000
4718#define PJ13 0x2000
4719
4720
4721/* Port Muxing Bit Fields for PORTx_MUX Registers */
4722
4723#define MUX0 0x00000003
4724#define MUX0_0 0x00000000
4725#define MUX0_1 0x00000001
4726#define MUX0_2 0x00000002
4727#define MUX0_3 0x00000003
4728
4729#define MUX1 0x0000000C
4730#define MUX1_0 0x00000000
4731#define MUX1_1 0x00000004
4732#define MUX1_2 0x00000008
4733#define MUX1_3 0x0000000C
4734
4735#define MUX2 0x00000030
4736#define MUX2_0 0x00000000
4737#define MUX2_1 0x00000010
4738#define MUX2_2 0x00000020
4739#define MUX2_3 0x00000030
4740
4741#define MUX3 0x000000C0
4742#define MUX3_0 0x00000000
4743#define MUX3_1 0x00000040
4744#define MUX3_2 0x00000080
4745#define MUX3_3 0x000000C0
4746
4747#define MUX4 0x00000300
4748#define MUX4_0 0x00000000
4749#define MUX4_1 0x00000100
4750#define MUX4_2 0x00000200
4751#define MUX4_3 0x00000300
4752
4753#define MUX5 0x00000C00
4754#define MUX5_0 0x00000000
4755#define MUX5_1 0x00000400
4756#define MUX5_2 0x00000800
4757#define MUX5_3 0x00000C00
4758
4759#define MUX6 0x00003000
4760#define MUX6_0 0x00000000
4761#define MUX6_1 0x00001000
4762#define MUX6_2 0x00002000
4763#define MUX6_3 0x00003000
4764
4765#define MUX7 0x0000C000
4766#define MUX7_0 0x00000000
4767#define MUX7_1 0x00004000
4768#define MUX7_2 0x00008000
4769#define MUX7_3 0x0000C000
4770
4771#define MUX8 0x00030000
4772#define MUX8_0 0x00000000
4773#define MUX8_1 0x00010000
4774#define MUX8_2 0x00020000
4775#define MUX8_3 0x00030000
4776
4777#define MUX9 0x000C0000
4778#define MUX9_0 0x00000000
4779#define MUX9_1 0x00040000
4780#define MUX9_2 0x00080000
4781#define MUX9_3 0x000C0000
4782
4783#define MUX10 0x00300000
4784#define MUX10_0 0x00000000
4785#define MUX10_1 0x00100000
4786#define MUX10_2 0x00200000
4787#define MUX10_3 0x00300000
4788
4789#define MUX11 0x00C00000
4790#define MUX11_0 0x00000000
4791#define MUX11_1 0x00400000
4792#define MUX11_2 0x00800000
4793#define MUX11_3 0x00C00000
4794
4795#define MUX12 0x03000000
4796#define MUX12_0 0x00000000
4797#define MUX12_1 0x01000000
4798#define MUX12_2 0x02000000
4799#define MUX12_3 0x03000000
4800
4801#define MUX13 0x0C000000
4802#define MUX13_0 0x00000000
4803#define MUX13_1 0x04000000
4804#define MUX13_2 0x08000000
4805#define MUX13_3 0x0C000000
4806
4807#define MUX14 0x30000000
4808#define MUX14_0 0x00000000
4809#define MUX14_1 0x10000000
4810#define MUX14_2 0x20000000
4811#define MUX14_3 0x30000000
4812
4813#define MUX15 0xC0000000
4814#define MUX15_0 0x00000000
4815#define MUX15_1 0x40000000
4816#define MUX15_2 0x80000000
4817#define MUX15_3 0xC0000000
4818
4819#define MUX(b15,b14,b13,b12,b11,b10,b9,b8,b7,b6,b5,b4,b3,b2,b1,b0) \
4820 ((((b15)&3) << 30) | \
4821 (((b14)&3) << 28) | \
4822 (((b13)&3) << 26) | \
4823 (((b12)&3) << 24) | \
4824 (((b11)&3) << 22) | \
4825 (((b10)&3) << 20) | \
4826 (((b9) &3) << 18) | \
4827 (((b8) &3) << 16) | \
4828 (((b7) &3) << 14) | \
4829 (((b6) &3) << 12) | \
4830 (((b5) &3) << 10) | \
4831 (((b4) &3) << 8) | \
4832 (((b3) &3) << 6) | \
4833 (((b2) &3) << 4) | \
4834 (((b1) &3) << 2) | \
4835 (((b0) &3)))
4836
4837/* Bit fields for PINT0_ASSIGN and PINT1_ASSIGN registers */
4838
4839#define B0MAP 0x000000FF /* Byte 0 Lower Half Port Mapping */
4840#define B0MAP_PAL 0x00000000 /* Map Port A Low to Byte 0 */
4841#define B0MAP_PBL 0x00000001 /* Map Port B Low to Byte 0 */
4842#define B1MAP 0x0000FF00 /* Byte 1 Upper Half Port Mapping */
4843#define B1MAP_PAH 0x00000000 /* Map Port A High to Byte 1 */
4844#define B1MAP_PBH 0x00000100 /* Map Port B High to Byte 1 */
4845#define B2MAP 0x00FF0000 /* Byte 2 Lower Half Port Mapping */
4846#define B2MAP_PAL 0x00000000 /* Map Port A Low to Byte 2 */
4847#define B2MAP_PBL 0x00010000 /* Map Port B Low to Byte 2 */
4848#define B3MAP 0xFF000000 /* Byte 3 Upper Half Port Mapping */
4849#define B3MAP_PAH 0x00000000 /* Map Port A High to Byte 3 */
4850#define B3MAP_PBH 0x01000000 /* Map Port B High to Byte 3 */
4851
4852/* Bit fields for PINT2_ASSIGN and PINT3_ASSIGN registers */
4853
4854#define B0MAP_PCL 0x00000000 /* Map Port C Low to Byte 0 */
4855#define B0MAP_PDL 0x00000001 /* Map Port D Low to Byte 0 */
4856#define B0MAP_PEL 0x00000002 /* Map Port E Low to Byte 0 */
4857#define B0MAP_PFL 0x00000003 /* Map Port F Low to Byte 0 */
4858#define B0MAP_PGL 0x00000004 /* Map Port G Low to Byte 0 */
4859#define B0MAP_PHL 0x00000005 /* Map Port H Low to Byte 0 */
4860#define B0MAP_PIL 0x00000006 /* Map Port I Low to Byte 0 */
4861#define B0MAP_PJL 0x00000007 /* Map Port J Low to Byte 0 */
4862
4863#define B1MAP_PCH 0x00000000 /* Map Port C High to Byte 1 */
4864#define B1MAP_PDH 0x00000100 /* Map Port D High to Byte 1 */
4865#define B1MAP_PEH 0x00000200 /* Map Port E High to Byte 1 */
4866#define B1MAP_PFH 0x00000300 /* Map Port F High to Byte 1 */
4867#define B1MAP_PGH 0x00000400 /* Map Port G High to Byte 1 */
4868#define B1MAP_PHH 0x00000500 /* Map Port H High to Byte 1 */
4869#define B1MAP_PIH 0x00000600 /* Map Port I High to Byte 1 */
4870#define B1MAP_PJH 0x00000700 /* Map Port J High to Byte 1 */
4871
4872#define B2MAP_PCL 0x00000000 /* Map Port C Low to Byte 2 */
4873#define B2MAP_PDL 0x00010000 /* Map Port D Low to Byte 2 */
4874#define B2MAP_PEL 0x00020000 /* Map Port E Low to Byte 2 */
4875#define B2MAP_PFL 0x00030000 /* Map Port F Low to Byte 2 */
4876#define B2MAP_PGL 0x00040000 /* Map Port G Low to Byte 2 */
4877#define B2MAP_PHL 0x00050000 /* Map Port H Low to Byte 2 */
4878#define B2MAP_PIL 0x00060000 /* Map Port I Low to Byte 2 */
4879#define B2MAP_PJL 0x00070000 /* Map Port J Low to Byte 2 */
4880
4881#define B3MAP_PCH 0x00000000 /* Map Port C High to Byte 3 */
4882#define B3MAP_PDH 0x01000000 /* Map Port D High to Byte 3 */
4883#define B3MAP_PEH 0x02000000 /* Map Port E High to Byte 3 */
4884#define B3MAP_PFH 0x03000000 /* Map Port F High to Byte 3 */
4885#define B3MAP_PGH 0x04000000 /* Map Port G High to Byte 3 */
4886#define B3MAP_PHH 0x05000000 /* Map Port H High to Byte 3 */
4887#define B3MAP_PIH 0x06000000 /* Map Port I High to Byte 3 */
4888#define B3MAP_PJH 0x07000000 /* Map Port J High to Byte 3 */
4889
4890
4891/* for legacy compatibility */
4892
4893#define WLS(x) (((x)-5) & 0x03) /* Word Length Select */
4894#define W1LMAX_MAX W1LMAX_MIN
4895#define EBIU_AMCBCTL0 EBIU_AMBCTL0
4896#define EBIU_AMCBCTL1 EBIU_AMBCTL1
4897#define PINT0_IRQ PINT0_REQUEST
4898#define PINT1_IRQ PINT1_REQUEST
4899#define PINT2_IRQ PINT2_REQUEST
4900#define PINT3_IRQ PINT3_REQUEST
4901
4902#endif /* _DEF_BF54X_H */
diff --git a/include/asm-blackfin/mach-bf561/cdefBF561.h b/include/asm-blackfin/mach-bf561/cdefBF561.h
index 5dc0ed835447..b14f872e5703 100644
--- a/include/asm-blackfin/mach-bf561/cdefBF561.h
+++ b/include/asm-blackfin/mach-bf561/cdefBF561.h
@@ -59,12 +59,14 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
59{ 59{
60 unsigned long flags, iwr; 60 unsigned long flags, iwr;
61 61
62 bfin_write16(VR_CTL, val);
63 __builtin_bfin_ssync();
64 /* Enable the PLL Wakeup bit in SIC IWR */ 62 /* Enable the PLL Wakeup bit in SIC IWR */
65 iwr = bfin_read32(SICA_IWR0); 63 iwr = bfin_read32(SICA_IWR0);
66 /* Only allow PPL Wakeup) */ 64 /* Only allow PPL Wakeup) */
67 bfin_write32(SICA_IWR0, IWR_ENABLE(0)); 65 bfin_write32(SICA_IWR0, IWR_ENABLE(0));
66
67 bfin_write16(VR_CTL, val);
68 __builtin_bfin_ssync();
69
68 local_irq_save(flags); 70 local_irq_save(flags);
69 asm("IDLE;"); 71 asm("IDLE;");
70 local_irq_restore(flags); 72 local_irq_restore(flags);
diff --git a/include/asm-blackfin/mach-bf561/defBF561.h b/include/asm-blackfin/mach-bf561/defBF561.h
index a6de4c69ba55..89150ecb909d 100644
--- a/include/asm-blackfin/mach-bf561/defBF561.h
+++ b/include/asm-blackfin/mach-bf561/defBF561.h
@@ -904,23 +904,6 @@
904#define IWR_ENABLE(x) (1 << (x)) /* Wakeup Enable Peripheral #x */ 904#define IWR_ENABLE(x) (1 << (x)) /* Wakeup Enable Peripheral #x */
905#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << (x))) /* Wakeup Disable Peripheral #x */ 905#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << (x))) /* Wakeup Disable Peripheral #x */
906 906
907/* ********* WATCHDOG TIMER MASKS ********************8 */
908
909/* Watchdog Timer WDOG_CTL Register */
910#define ICTL(x) ((x<<1) & 0x0006)
911#define ENABLE_RESET 0x00000000 /* Set Watchdog Timer to generate reset */
912#define ENABLE_NMI 0x00000002 /* Set Watchdog Timer to generate non-maskable interrupt */
913#define ENABLE_GPI 0x00000004 /* Set Watchdog Timer to generate general-purpose interrupt */
914#define DISABLE_EVT 0x00000006 /* Disable Watchdog Timer interrupts */
915
916#define TMR_EN 0x0000
917#define TMR_DIS 0x0AD0
918#define TRO 0x8000
919
920#define ICTL_P0 0x01
921#define ICTL_P1 0x02
922#define TRO_P 0x0F
923
924/* ***************************** UART CONTROLLER MASKS ********************** */ 907/* ***************************** UART CONTROLLER MASKS ********************** */
925 908
926/* UART_LCR Register */ 909/* UART_LCR Register */
@@ -1214,18 +1197,18 @@
1214#define TIMIL9 0x0002 1197#define TIMIL9 0x0002
1215#define TIMIL10 0x0004 1198#define TIMIL10 0x0004
1216#define TIMIL11 0x0008 1199#define TIMIL11 0x0008
1217#define TOVL_ERR0 0x00000010 1200#define TOVF_ERR0 0x00000010
1218#define TOVL_ERR1 0x00000020 1201#define TOVF_ERR1 0x00000020
1219#define TOVL_ERR2 0x00000040 1202#define TOVF_ERR2 0x00000040
1220#define TOVL_ERR3 0x00000080 1203#define TOVF_ERR3 0x00000080
1221#define TOVL_ERR4 0x00100000 1204#define TOVF_ERR4 0x00100000
1222#define TOVL_ERR5 0x00200000 1205#define TOVF_ERR5 0x00200000
1223#define TOVL_ERR6 0x00400000 1206#define TOVF_ERR6 0x00400000
1224#define TOVL_ERR7 0x00800000 1207#define TOVF_ERR7 0x00800000
1225#define TOVL_ERR8 0x0010 1208#define TOVF_ERR8 0x0010
1226#define TOVL_ERR9 0x0020 1209#define TOVF_ERR9 0x0020
1227#define TOVL_ERR10 0x0040 1210#define TOVF_ERR10 0x0040
1228#define TOVL_ERR11 0x0080 1211#define TOVF_ERR11 0x0080
1229#define TRUN0 0x00001000 1212#define TRUN0 0x00001000
1230#define TRUN1 0x00002000 1213#define TRUN1 0x00002000
1231#define TRUN2 0x00004000 1214#define TRUN2 0x00004000
@@ -1251,18 +1234,18 @@
1251#define TIMIL9_P 0x01 1234#define TIMIL9_P 0x01
1252#define TIMIL10_P 0x02 1235#define TIMIL10_P 0x02
1253#define TIMIL11_P 0x03 1236#define TIMIL11_P 0x03
1254#define TOVL_ERR0_P 0x04 1237#define TOVF_ERR0_P 0x04
1255#define TOVL_ERR1_P 0x05 1238#define TOVF_ERR1_P 0x05
1256#define TOVL_ERR2_P 0x06 1239#define TOVF_ERR2_P 0x06
1257#define TOVL_ERR3_P 0x07 1240#define TOVF_ERR3_P 0x07
1258#define TOVL_ERR4_P 0x14 1241#define TOVF_ERR4_P 0x14
1259#define TOVL_ERR5_P 0x15 1242#define TOVF_ERR5_P 0x15
1260#define TOVL_ERR6_P 0x16 1243#define TOVF_ERR6_P 0x16
1261#define TOVL_ERR7_P 0x17 1244#define TOVF_ERR7_P 0x17
1262#define TOVL_ERR8_P 0x04 1245#define TOVF_ERR8_P 0x04
1263#define TOVL_ERR9_P 0x05 1246#define TOVF_ERR9_P 0x05
1264#define TOVL_ERR10_P 0x06 1247#define TOVF_ERR10_P 0x06
1265#define TOVL_ERR11_P 0x07 1248#define TOVF_ERR11_P 0x07
1266#define TRUN0_P 0x0C 1249#define TRUN0_P 0x0C
1267#define TRUN1_P 0x0D 1250#define TRUN1_P 0x0D
1268#define TRUN2_P 0x0E 1251#define TRUN2_P 0x0E
@@ -1276,6 +1259,32 @@
1276#define TRUN10_P 0x0E 1259#define TRUN10_P 0x0E
1277#define TRUN11_P 0x0F 1260#define TRUN11_P 0x0F
1278 1261
1262/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
1263#define TOVL_ERR0 TOVF_ERR0
1264#define TOVL_ERR1 TOVF_ERR1
1265#define TOVL_ERR2 TOVF_ERR2
1266#define TOVL_ERR3 TOVF_ERR3
1267#define TOVL_ERR4 TOVF_ERR4
1268#define TOVL_ERR5 TOVF_ERR5
1269#define TOVL_ERR6 TOVF_ERR6
1270#define TOVL_ERR7 TOVF_ERR7
1271#define TOVL_ERR8 TOVF_ERR8
1272#define TOVL_ERR9 TOVF_ERR9
1273#define TOVL_ERR10 TOVF_ERR10
1274#define TOVL_ERR11 TOVF_ERR11
1275#define TOVL_ERR0_P TOVF_ERR0_P
1276#define TOVL_ERR1_P TOVF_ERR1_P
1277#define TOVL_ERR2_P TOVF_ERR2_P
1278#define TOVL_ERR3_P TOVF_ERR3_P
1279#define TOVL_ERR4_P TOVF_ERR4_P
1280#define TOVL_ERR5_P TOVF_ERR5_P
1281#define TOVL_ERR6_P TOVF_ERR6_P
1282#define TOVL_ERR7_P TOVF_ERR7_P
1283#define TOVL_ERR8_P TOVF_ERR8_P
1284#define TOVL_ERR9_P TOVF_ERR9_P
1285#define TOVL_ERR10_P TOVF_ERR10_P
1286#define TOVL_ERR11_P TOVF_ERR11_P
1287
1279/* TIMERx_CONFIG Registers */ 1288/* TIMERx_CONFIG Registers */
1280#define PWM_OUT 0x0001 1289#define PWM_OUT 0x0001
1281#define WDTH_CAP 0x0002 1290#define WDTH_CAP 0x0002
@@ -1700,18 +1709,4 @@
1700#define SDEASE 0x00000010 /* SDRAM EAB sticky error status - W1C */ 1709#define SDEASE 0x00000010 /* SDRAM EAB sticky error status - W1C */
1701#define BGSTAT 0x00000020 /* Bus granted */ 1710#define BGSTAT 0x00000020 /* Bus granted */
1702 1711
1703/*VR_CTL Masks*/
1704#define WAKE 0x100
1705#define VLEV_6 0x60
1706#define VLEV_7 0x70
1707#define VLEV_8 0x80
1708#define VLEV_9 0x90
1709#define VLEV_10 0xA0
1710#define VLEV_11 0xB0
1711#define VLEV_12 0xC0
1712#define VLEV_13 0xD0
1713#define VLEV_14 0xE0
1714#define VLEV_15 0xF0
1715#define FREQ_3 0x03
1716
1717#endif /* _DEF_BF561_H */ 1712#endif /* _DEF_BF561_H */
diff --git a/include/asm-blackfin/mach-common/cdef_LPBlackfin.h b/include/asm-blackfin/mach-common/cdef_LPBlackfin.h
index 22aa5e637993..d39c396f850d 100644
--- a/include/asm-blackfin/mach-common/cdef_LPBlackfin.h
+++ b/include/asm-blackfin/mach-common/cdef_LPBlackfin.h
@@ -36,417 +36,288 @@
36#include <asm/mach-common/def_LPBlackfin.h> 36#include <asm/mach-common/def_LPBlackfin.h>
37 37
38/*Cache & SRAM Memory*/ 38/*Cache & SRAM Memory*/
39#define pSRAM_BASE_ADDRESS ((volatile void **)SRAM_BASE_ADDRESS)
40#define bfin_read_SRAM_BASE_ADDRESS() bfin_read32(SRAM_BASE_ADDRESS) 39#define bfin_read_SRAM_BASE_ADDRESS() bfin_read32(SRAM_BASE_ADDRESS)
41#define bfin_write_SRAM_BASE_ADDRESS(val) bfin_write32(SRAM_BASE_ADDRESS,val) 40#define bfin_write_SRAM_BASE_ADDRESS(val) bfin_write32(SRAM_BASE_ADDRESS,val)
42#define pDMEM_CONTROL ((volatile unsigned long *)DMEM_CONTROL)
43#define bfin_read_DMEM_CONTROL() bfin_read32(DMEM_CONTROL) 41#define bfin_read_DMEM_CONTROL() bfin_read32(DMEM_CONTROL)
44#define bfin_write_DMEM_CONTROL(val) bfin_write32(DMEM_CONTROL,val) 42#define bfin_write_DMEM_CONTROL(val) bfin_write32(DMEM_CONTROL,val)
45#define pDCPLB_STATUS ((volatile unsigned long *)DCPLB_STATUS)
46#define bfin_read_DCPLB_STATUS() bfin_read32(DCPLB_STATUS) 43#define bfin_read_DCPLB_STATUS() bfin_read32(DCPLB_STATUS)
47#define bfin_write_DCPLB_STATUS(val) bfin_write32(DCPLB_STATUS,val) 44#define bfin_write_DCPLB_STATUS(val) bfin_write32(DCPLB_STATUS,val)
48#define pDCPLB_FAULT_ADDR ((volatile void **)DCPLB_FAULT_ADDR)
49#define bfin_read_DCPLB_FAULT_ADDR() bfin_read32(DCPLB_FAULT_ADDR) 45#define bfin_read_DCPLB_FAULT_ADDR() bfin_read32(DCPLB_FAULT_ADDR)
50#define bfin_write_DCPLB_FAULT_ADDR(val) bfin_write32(DCPLB_FAULT_ADDR,val) 46#define bfin_write_DCPLB_FAULT_ADDR(val) bfin_write32(DCPLB_FAULT_ADDR,val)
51/* 47/*
52#define MMR_TIMEOUT 0xFFE00010 48#define MMR_TIMEOUT 0xFFE00010
53*/ 49*/
54#define pDCPLB_ADDR0 ((volatile void **)DCPLB_ADDR0)
55#define bfin_read_DCPLB_ADDR0() bfin_read32(DCPLB_ADDR0) 50#define bfin_read_DCPLB_ADDR0() bfin_read32(DCPLB_ADDR0)
56#define bfin_write_DCPLB_ADDR0(val) bfin_write32(DCPLB_ADDR0,val) 51#define bfin_write_DCPLB_ADDR0(val) bfin_write32(DCPLB_ADDR0,val)
57#define pDCPLB_ADDR1 ((volatile void **)DCPLB_ADDR1)
58#define bfin_read_DCPLB_ADDR1() bfin_read32(DCPLB_ADDR1) 52#define bfin_read_DCPLB_ADDR1() bfin_read32(DCPLB_ADDR1)
59#define bfin_write_DCPLB_ADDR1(val) bfin_write32(DCPLB_ADDR1,val) 53#define bfin_write_DCPLB_ADDR1(val) bfin_write32(DCPLB_ADDR1,val)
60#define pDCPLB_ADDR2 ((volatile void **)DCPLB_ADDR2)
61#define bfin_read_DCPLB_ADDR2() bfin_read32(DCPLB_ADDR2) 54#define bfin_read_DCPLB_ADDR2() bfin_read32(DCPLB_ADDR2)
62#define bfin_write_DCPLB_ADDR2(val) bfin_write32(DCPLB_ADDR2,val) 55#define bfin_write_DCPLB_ADDR2(val) bfin_write32(DCPLB_ADDR2,val)
63#define pDCPLB_ADDR3 ((volatile void **)DCPLB_ADDR3)
64#define bfin_read_DCPLB_ADDR3() bfin_read32(DCPLB_ADDR3) 56#define bfin_read_DCPLB_ADDR3() bfin_read32(DCPLB_ADDR3)
65#define bfin_write_DCPLB_ADDR3(val) bfin_write32(DCPLB_ADDR3,val) 57#define bfin_write_DCPLB_ADDR3(val) bfin_write32(DCPLB_ADDR3,val)
66#define pDCPLB_ADDR4 ((volatile void **)DCPLB_ADDR4)
67#define bfin_read_DCPLB_ADDR4() bfin_read32(DCPLB_ADDR4) 58#define bfin_read_DCPLB_ADDR4() bfin_read32(DCPLB_ADDR4)
68#define bfin_write_DCPLB_ADDR4(val) bfin_write32(DCPLB_ADDR4,val) 59#define bfin_write_DCPLB_ADDR4(val) bfin_write32(DCPLB_ADDR4,val)
69#define pDCPLB_ADDR5 ((volatile void **)DCPLB_ADDR5)
70#define bfin_read_DCPLB_ADDR5() bfin_read32(DCPLB_ADDR5) 60#define bfin_read_DCPLB_ADDR5() bfin_read32(DCPLB_ADDR5)
71#define bfin_write_DCPLB_ADDR5(val) bfin_write32(DCPLB_ADDR5,val) 61#define bfin_write_DCPLB_ADDR5(val) bfin_write32(DCPLB_ADDR5,val)
72#define pDCPLB_ADDR6 ((volatile void **)DCPLB_ADDR6)
73#define bfin_read_DCPLB_ADDR6() bfin_read32(DCPLB_ADDR6) 62#define bfin_read_DCPLB_ADDR6() bfin_read32(DCPLB_ADDR6)
74#define bfin_write_DCPLB_ADDR6(val) bfin_write32(DCPLB_ADDR6,val) 63#define bfin_write_DCPLB_ADDR6(val) bfin_write32(DCPLB_ADDR6,val)
75#define pDCPLB_ADDR7 ((volatile void **)DCPLB_ADDR7)
76#define bfin_read_DCPLB_ADDR7() bfin_read32(DCPLB_ADDR7) 64#define bfin_read_DCPLB_ADDR7() bfin_read32(DCPLB_ADDR7)
77#define bfin_write_DCPLB_ADDR7(val) bfin_write32(DCPLB_ADDR7,val) 65#define bfin_write_DCPLB_ADDR7(val) bfin_write32(DCPLB_ADDR7,val)
78#define pDCPLB_ADDR8 ((volatile void **)DCPLB_ADDR8)
79#define bfin_read_DCPLB_ADDR8() bfin_read32(DCPLB_ADDR8) 66#define bfin_read_DCPLB_ADDR8() bfin_read32(DCPLB_ADDR8)
80#define bfin_write_DCPLB_ADDR8(val) bfin_write32(DCPLB_ADDR8,val) 67#define bfin_write_DCPLB_ADDR8(val) bfin_write32(DCPLB_ADDR8,val)
81#define pDCPLB_ADDR9 ((volatile void **)DCPLB_ADDR9)
82#define bfin_read_DCPLB_ADDR9() bfin_read32(DCPLB_ADDR9) 68#define bfin_read_DCPLB_ADDR9() bfin_read32(DCPLB_ADDR9)
83#define bfin_write_DCPLB_ADDR9(val) bfin_write32(DCPLB_ADDR9,val) 69#define bfin_write_DCPLB_ADDR9(val) bfin_write32(DCPLB_ADDR9,val)
84#define pDCPLB_ADDR10 ((volatile void **)DCPLB_ADDR10)
85#define bfin_read_DCPLB_ADDR10() bfin_read32(DCPLB_ADDR10) 70#define bfin_read_DCPLB_ADDR10() bfin_read32(DCPLB_ADDR10)
86#define bfin_write_DCPLB_ADDR10(val) bfin_write32(DCPLB_ADDR10,val) 71#define bfin_write_DCPLB_ADDR10(val) bfin_write32(DCPLB_ADDR10,val)
87#define pDCPLB_ADDR11 ((volatile void **)DCPLB_ADDR11)
88#define bfin_read_DCPLB_ADDR11() bfin_read32(DCPLB_ADDR11) 72#define bfin_read_DCPLB_ADDR11() bfin_read32(DCPLB_ADDR11)
89#define bfin_write_DCPLB_ADDR11(val) bfin_write32(DCPLB_ADDR11,val) 73#define bfin_write_DCPLB_ADDR11(val) bfin_write32(DCPLB_ADDR11,val)
90#define pDCPLB_ADDR12 ((volatile void **)DCPLB_ADDR12)
91#define bfin_read_DCPLB_ADDR12() bfin_read32(DCPLB_ADDR12) 74#define bfin_read_DCPLB_ADDR12() bfin_read32(DCPLB_ADDR12)
92#define bfin_write_DCPLB_ADDR12(val) bfin_write32(DCPLB_ADDR12,val) 75#define bfin_write_DCPLB_ADDR12(val) bfin_write32(DCPLB_ADDR12,val)
93#define pDCPLB_ADDR13 ((volatile void **)DCPLB_ADDR13)
94#define bfin_read_DCPLB_ADDR13() bfin_read32(DCPLB_ADDR13) 76#define bfin_read_DCPLB_ADDR13() bfin_read32(DCPLB_ADDR13)
95#define bfin_write_DCPLB_ADDR13(val) bfin_write32(DCPLB_ADDR13,val) 77#define bfin_write_DCPLB_ADDR13(val) bfin_write32(DCPLB_ADDR13,val)
96#define pDCPLB_ADDR14 ((volatile void **)DCPLB_ADDR14)
97#define bfin_read_DCPLB_ADDR14() bfin_read32(DCPLB_ADDR14) 78#define bfin_read_DCPLB_ADDR14() bfin_read32(DCPLB_ADDR14)
98#define bfin_write_DCPLB_ADDR14(val) bfin_write32(DCPLB_ADDR14,val) 79#define bfin_write_DCPLB_ADDR14(val) bfin_write32(DCPLB_ADDR14,val)
99#define pDCPLB_ADDR15 ((volatile void **)DCPLB_ADDR15)
100#define bfin_read_DCPLB_ADDR15() bfin_read32(DCPLB_ADDR15) 80#define bfin_read_DCPLB_ADDR15() bfin_read32(DCPLB_ADDR15)
101#define bfin_write_DCPLB_ADDR15(val) bfin_write32(DCPLB_ADDR15,val) 81#define bfin_write_DCPLB_ADDR15(val) bfin_write32(DCPLB_ADDR15,val)
102#define pDCPLB_DATA0 ((volatile unsigned long *)DCPLB_DATA0)
103#define bfin_read_DCPLB_DATA0() bfin_read32(DCPLB_DATA0) 82#define bfin_read_DCPLB_DATA0() bfin_read32(DCPLB_DATA0)
104#define bfin_write_DCPLB_DATA0(val) bfin_write32(DCPLB_DATA0,val) 83#define bfin_write_DCPLB_DATA0(val) bfin_write32(DCPLB_DATA0,val)
105#define pDCPLB_DATA1 ((volatile unsigned long *)DCPLB_DATA1)
106#define bfin_read_DCPLB_DATA1() bfin_read32(DCPLB_DATA1) 84#define bfin_read_DCPLB_DATA1() bfin_read32(DCPLB_DATA1)
107#define bfin_write_DCPLB_DATA1(val) bfin_write32(DCPLB_DATA1,val) 85#define bfin_write_DCPLB_DATA1(val) bfin_write32(DCPLB_DATA1,val)
108#define pDCPLB_DATA2 ((volatile unsigned long *)DCPLB_DATA2)
109#define bfin_read_DCPLB_DATA2() bfin_read32(DCPLB_DATA2) 86#define bfin_read_DCPLB_DATA2() bfin_read32(DCPLB_DATA2)
110#define bfin_write_DCPLB_DATA2(val) bfin_write32(DCPLB_DATA2,val) 87#define bfin_write_DCPLB_DATA2(val) bfin_write32(DCPLB_DATA2,val)
111#define pDCPLB_DATA3 ((volatile unsigned long *)DCPLB_DATA3)
112#define bfin_read_DCPLB_DATA3() bfin_read32(DCPLB_DATA3) 88#define bfin_read_DCPLB_DATA3() bfin_read32(DCPLB_DATA3)
113#define bfin_write_DCPLB_DATA3(val) bfin_write32(DCPLB_DATA3,val) 89#define bfin_write_DCPLB_DATA3(val) bfin_write32(DCPLB_DATA3,val)
114#define pDCPLB_DATA4 ((volatile unsigned long *)DCPLB_DATA4)
115#define bfin_read_DCPLB_DATA4() bfin_read32(DCPLB_DATA4) 90#define bfin_read_DCPLB_DATA4() bfin_read32(DCPLB_DATA4)
116#define bfin_write_DCPLB_DATA4(val) bfin_write32(DCPLB_DATA4,val) 91#define bfin_write_DCPLB_DATA4(val) bfin_write32(DCPLB_DATA4,val)
117#define pDCPLB_DATA5 ((volatile unsigned long *)DCPLB_DATA5)
118#define bfin_read_DCPLB_DATA5() bfin_read32(DCPLB_DATA5) 92#define bfin_read_DCPLB_DATA5() bfin_read32(DCPLB_DATA5)
119#define bfin_write_DCPLB_DATA5(val) bfin_write32(DCPLB_DATA5,val) 93#define bfin_write_DCPLB_DATA5(val) bfin_write32(DCPLB_DATA5,val)
120#define pDCPLB_DATA6 ((volatile unsigned long *)DCPLB_DATA6)
121#define bfin_read_DCPLB_DATA6() bfin_read32(DCPLB_DATA6) 94#define bfin_read_DCPLB_DATA6() bfin_read32(DCPLB_DATA6)
122#define bfin_write_DCPLB_DATA6(val) bfin_write32(DCPLB_DATA6,val) 95#define bfin_write_DCPLB_DATA6(val) bfin_write32(DCPLB_DATA6,val)
123#define pDCPLB_DATA7 ((volatile unsigned long *)DCPLB_DATA7)
124#define bfin_read_DCPLB_DATA7() bfin_read32(DCPLB_DATA7) 96#define bfin_read_DCPLB_DATA7() bfin_read32(DCPLB_DATA7)
125#define bfin_write_DCPLB_DATA7(val) bfin_write32(DCPLB_DATA7,val) 97#define bfin_write_DCPLB_DATA7(val) bfin_write32(DCPLB_DATA7,val)
126#define pDCPLB_DATA8 ((volatile unsigned long *)DCPLB_DATA8)
127#define bfin_read_DCPLB_DATA8() bfin_read32(DCPLB_DATA8) 98#define bfin_read_DCPLB_DATA8() bfin_read32(DCPLB_DATA8)
128#define bfin_write_DCPLB_DATA8(val) bfin_write32(DCPLB_DATA8,val) 99#define bfin_write_DCPLB_DATA8(val) bfin_write32(DCPLB_DATA8,val)
129#define pDCPLB_DATA9 ((volatile unsigned long *)DCPLB_DATA9)
130#define bfin_read_DCPLB_DATA9() bfin_read32(DCPLB_DATA9) 100#define bfin_read_DCPLB_DATA9() bfin_read32(DCPLB_DATA9)
131#define bfin_write_DCPLB_DATA9(val) bfin_write32(DCPLB_DATA9,val) 101#define bfin_write_DCPLB_DATA9(val) bfin_write32(DCPLB_DATA9,val)
132#define pDCPLB_DATA10 ((volatile unsigned long *)DCPLB_DATA10)
133#define bfin_read_DCPLB_DATA10() bfin_read32(DCPLB_DATA10) 102#define bfin_read_DCPLB_DATA10() bfin_read32(DCPLB_DATA10)
134#define bfin_write_DCPLB_DATA10(val) bfin_write32(DCPLB_DATA10,val) 103#define bfin_write_DCPLB_DATA10(val) bfin_write32(DCPLB_DATA10,val)
135#define pDCPLB_DATA11 ((volatile unsigned long *)DCPLB_DATA11)
136#define bfin_read_DCPLB_DATA11() bfin_read32(DCPLB_DATA11) 104#define bfin_read_DCPLB_DATA11() bfin_read32(DCPLB_DATA11)
137#define bfin_write_DCPLB_DATA11(val) bfin_write32(DCPLB_DATA11,val) 105#define bfin_write_DCPLB_DATA11(val) bfin_write32(DCPLB_DATA11,val)
138#define pDCPLB_DATA12 ((volatile unsigned long *)DCPLB_DATA12)
139#define bfin_read_DCPLB_DATA12() bfin_read32(DCPLB_DATA12) 106#define bfin_read_DCPLB_DATA12() bfin_read32(DCPLB_DATA12)
140#define bfin_write_DCPLB_DATA12(val) bfin_write32(DCPLB_DATA12,val) 107#define bfin_write_DCPLB_DATA12(val) bfin_write32(DCPLB_DATA12,val)
141#define pDCPLB_DATA13 ((volatile unsigned long *)DCPLB_DATA13)
142#define bfin_read_DCPLB_DATA13() bfin_read32(DCPLB_DATA13) 108#define bfin_read_DCPLB_DATA13() bfin_read32(DCPLB_DATA13)
143#define bfin_write_DCPLB_DATA13(val) bfin_write32(DCPLB_DATA13,val) 109#define bfin_write_DCPLB_DATA13(val) bfin_write32(DCPLB_DATA13,val)
144#define pDCPLB_DATA14 ((volatile unsigned long *)DCPLB_DATA14)
145#define bfin_read_DCPLB_DATA14() bfin_read32(DCPLB_DATA14) 110#define bfin_read_DCPLB_DATA14() bfin_read32(DCPLB_DATA14)
146#define bfin_write_DCPLB_DATA14(val) bfin_write32(DCPLB_DATA14,val) 111#define bfin_write_DCPLB_DATA14(val) bfin_write32(DCPLB_DATA14,val)
147#define pDCPLB_DATA15 ((volatile unsigned long *)DCPLB_DATA15)
148#define bfin_read_DCPLB_DATA15() bfin_read32(DCPLB_DATA15) 112#define bfin_read_DCPLB_DATA15() bfin_read32(DCPLB_DATA15)
149#define bfin_write_DCPLB_DATA15(val) bfin_write32(DCPLB_DATA15,val) 113#define bfin_write_DCPLB_DATA15(val) bfin_write32(DCPLB_DATA15,val)
150#define pDTEST_COMMAND ((volatile unsigned long *)DTEST_COMMAND)
151#define bfin_read_DTEST_COMMAND() bfin_read32(DTEST_COMMAND) 114#define bfin_read_DTEST_COMMAND() bfin_read32(DTEST_COMMAND)
152#define bfin_write_DTEST_COMMAND(val) bfin_write32(DTEST_COMMAND,val) 115#define bfin_write_DTEST_COMMAND(val) bfin_write32(DTEST_COMMAND,val)
153/* 116/*
154#define DTEST_INDEX 0xFFE00304 117#define DTEST_INDEX 0xFFE00304
155*/ 118*/
156#define pDTEST_DATA0 ((volatile unsigned long *)DTEST_DATA0)
157#define bfin_read_DTEST_DATA0() bfin_read32(DTEST_DATA0) 119#define bfin_read_DTEST_DATA0() bfin_read32(DTEST_DATA0)
158#define bfin_write_DTEST_DATA0(val) bfin_write32(DTEST_DATA0,val) 120#define bfin_write_DTEST_DATA0(val) bfin_write32(DTEST_DATA0,val)
159#define pDTEST_DATA1 ((volatile unsigned long *)DTEST_DATA1)
160#define bfin_read_DTEST_DATA1() bfin_read32(DTEST_DATA1) 121#define bfin_read_DTEST_DATA1() bfin_read32(DTEST_DATA1)
161#define bfin_write_DTEST_DATA1(val) bfin_write32(DTEST_DATA1,val) 122#define bfin_write_DTEST_DATA1(val) bfin_write32(DTEST_DATA1,val)
162/* 123/*
163#define DTEST_DATA2 0xFFE00408 124#define DTEST_DATA2 0xFFE00408
164#define DTEST_DATA3 0xFFE0040C 125#define DTEST_DATA3 0xFFE0040C
165*/ 126*/
166#define pIMEM_CONTROL ((volatile unsigned long *)IMEM_CONTROL)
167#define bfin_read_IMEM_CONTROL() bfin_read32(IMEM_CONTROL) 127#define bfin_read_IMEM_CONTROL() bfin_read32(IMEM_CONTROL)
168#define bfin_write_IMEM_CONTROL(val) bfin_write32(IMEM_CONTROL,val) 128#define bfin_write_IMEM_CONTROL(val) bfin_write32(IMEM_CONTROL,val)
169#define pICPLB_STATUS ((volatile unsigned long *)ICPLB_STATUS)
170#define bfin_read_ICPLB_STATUS() bfin_read32(ICPLB_STATUS) 129#define bfin_read_ICPLB_STATUS() bfin_read32(ICPLB_STATUS)
171#define bfin_write_ICPLB_STATUS(val) bfin_write32(ICPLB_STATUS,val) 130#define bfin_write_ICPLB_STATUS(val) bfin_write32(ICPLB_STATUS,val)
172#define pICPLB_FAULT_ADDR ((volatile void **)ICPLB_FAULT_ADDR)
173#define bfin_read_ICPLB_FAULT_ADDR() bfin_read32(ICPLB_FAULT_ADDR) 131#define bfin_read_ICPLB_FAULT_ADDR() bfin_read32(ICPLB_FAULT_ADDR)
174#define bfin_write_ICPLB_FAULT_ADDR(val) bfin_write32(ICPLB_FAULT_ADDR,val) 132#define bfin_write_ICPLB_FAULT_ADDR(val) bfin_write32(ICPLB_FAULT_ADDR,val)
175#define pICPLB_ADDR0 ((volatile void **)ICPLB_ADDR0)
176#define bfin_read_ICPLB_ADDR0() bfin_read32(ICPLB_ADDR0) 133#define bfin_read_ICPLB_ADDR0() bfin_read32(ICPLB_ADDR0)
177#define bfin_write_ICPLB_ADDR0(val) bfin_write32(ICPLB_ADDR0,val) 134#define bfin_write_ICPLB_ADDR0(val) bfin_write32(ICPLB_ADDR0,val)
178#define pICPLB_ADDR1 ((volatile void **)ICPLB_ADDR1)
179#define bfin_read_ICPLB_ADDR1() bfin_read32(ICPLB_ADDR1) 135#define bfin_read_ICPLB_ADDR1() bfin_read32(ICPLB_ADDR1)
180#define bfin_write_ICPLB_ADDR1(val) bfin_write32(ICPLB_ADDR1,val) 136#define bfin_write_ICPLB_ADDR1(val) bfin_write32(ICPLB_ADDR1,val)
181#define pICPLB_ADDR2 ((volatile void **)ICPLB_ADDR2)
182#define bfin_read_ICPLB_ADDR2() bfin_read32(ICPLB_ADDR2) 137#define bfin_read_ICPLB_ADDR2() bfin_read32(ICPLB_ADDR2)
183#define bfin_write_ICPLB_ADDR2(val) bfin_write32(ICPLB_ADDR2,val) 138#define bfin_write_ICPLB_ADDR2(val) bfin_write32(ICPLB_ADDR2,val)
184#define pICPLB_ADDR3 ((volatile void **)ICPLB_ADDR3)
185#define bfin_read_ICPLB_ADDR3() bfin_read32(ICPLB_ADDR3) 139#define bfin_read_ICPLB_ADDR3() bfin_read32(ICPLB_ADDR3)
186#define bfin_write_ICPLB_ADDR3(val) bfin_write32(ICPLB_ADDR3,val) 140#define bfin_write_ICPLB_ADDR3(val) bfin_write32(ICPLB_ADDR3,val)
187#define pICPLB_ADDR4 ((volatile void **)ICPLB_ADDR4)
188#define bfin_read_ICPLB_ADDR4() bfin_read32(ICPLB_ADDR4) 141#define bfin_read_ICPLB_ADDR4() bfin_read32(ICPLB_ADDR4)
189#define bfin_write_ICPLB_ADDR4(val) bfin_write32(ICPLB_ADDR4,val) 142#define bfin_write_ICPLB_ADDR4(val) bfin_write32(ICPLB_ADDR4,val)
190#define pICPLB_ADDR5 ((volatile void **)ICPLB_ADDR5)
191#define bfin_read_ICPLB_ADDR5() bfin_read32(ICPLB_ADDR5) 143#define bfin_read_ICPLB_ADDR5() bfin_read32(ICPLB_ADDR5)
192#define bfin_write_ICPLB_ADDR5(val) bfin_write32(ICPLB_ADDR5,val) 144#define bfin_write_ICPLB_ADDR5(val) bfin_write32(ICPLB_ADDR5,val)
193#define pICPLB_ADDR6 ((volatile void **)ICPLB_ADDR6)
194#define bfin_read_ICPLB_ADDR6() bfin_read32(ICPLB_ADDR6) 145#define bfin_read_ICPLB_ADDR6() bfin_read32(ICPLB_ADDR6)
195#define bfin_write_ICPLB_ADDR6(val) bfin_write32(ICPLB_ADDR6,val) 146#define bfin_write_ICPLB_ADDR6(val) bfin_write32(ICPLB_ADDR6,val)
196#define pICPLB_ADDR7 ((volatile void **)ICPLB_ADDR7)
197#define bfin_read_ICPLB_ADDR7() bfin_read32(ICPLB_ADDR7) 147#define bfin_read_ICPLB_ADDR7() bfin_read32(ICPLB_ADDR7)
198#define bfin_write_ICPLB_ADDR7(val) bfin_write32(ICPLB_ADDR7,val) 148#define bfin_write_ICPLB_ADDR7(val) bfin_write32(ICPLB_ADDR7,val)
199#define pICPLB_ADDR8 ((volatile void **)ICPLB_ADDR8)
200#define bfin_read_ICPLB_ADDR8() bfin_read32(ICPLB_ADDR8) 149#define bfin_read_ICPLB_ADDR8() bfin_read32(ICPLB_ADDR8)
201#define bfin_write_ICPLB_ADDR8(val) bfin_write32(ICPLB_ADDR8,val) 150#define bfin_write_ICPLB_ADDR8(val) bfin_write32(ICPLB_ADDR8,val)
202#define pICPLB_ADDR9 ((volatile void **)ICPLB_ADDR9)
203#define bfin_read_ICPLB_ADDR9() bfin_read32(ICPLB_ADDR9) 151#define bfin_read_ICPLB_ADDR9() bfin_read32(ICPLB_ADDR9)
204#define bfin_write_ICPLB_ADDR9(val) bfin_write32(ICPLB_ADDR9,val) 152#define bfin_write_ICPLB_ADDR9(val) bfin_write32(ICPLB_ADDR9,val)
205#define pICPLB_ADDR10 ((volatile void **)ICPLB_ADDR10)
206#define bfin_read_ICPLB_ADDR10() bfin_read32(ICPLB_ADDR10) 153#define bfin_read_ICPLB_ADDR10() bfin_read32(ICPLB_ADDR10)
207#define bfin_write_ICPLB_ADDR10(val) bfin_write32(ICPLB_ADDR10,val) 154#define bfin_write_ICPLB_ADDR10(val) bfin_write32(ICPLB_ADDR10,val)
208#define pICPLB_ADDR11 ((volatile void **)ICPLB_ADDR11)
209#define bfin_read_ICPLB_ADDR11() bfin_read32(ICPLB_ADDR11) 155#define bfin_read_ICPLB_ADDR11() bfin_read32(ICPLB_ADDR11)
210#define bfin_write_ICPLB_ADDR11(val) bfin_write32(ICPLB_ADDR11,val) 156#define bfin_write_ICPLB_ADDR11(val) bfin_write32(ICPLB_ADDR11,val)
211#define pICPLB_ADDR12 ((volatile void **)ICPLB_ADDR12)
212#define bfin_read_ICPLB_ADDR12() bfin_read32(ICPLB_ADDR12) 157#define bfin_read_ICPLB_ADDR12() bfin_read32(ICPLB_ADDR12)
213#define bfin_write_ICPLB_ADDR12(val) bfin_write32(ICPLB_ADDR12,val) 158#define bfin_write_ICPLB_ADDR12(val) bfin_write32(ICPLB_ADDR12,val)
214#define pICPLB_ADDR13 ((volatile void **)ICPLB_ADDR13)
215#define bfin_read_ICPLB_ADDR13() bfin_read32(ICPLB_ADDR13) 159#define bfin_read_ICPLB_ADDR13() bfin_read32(ICPLB_ADDR13)
216#define bfin_write_ICPLB_ADDR13(val) bfin_write32(ICPLB_ADDR13,val) 160#define bfin_write_ICPLB_ADDR13(val) bfin_write32(ICPLB_ADDR13,val)
217#define pICPLB_ADDR14 ((volatile void **)ICPLB_ADDR14)
218#define bfin_read_ICPLB_ADDR14() bfin_read32(ICPLB_ADDR14) 161#define bfin_read_ICPLB_ADDR14() bfin_read32(ICPLB_ADDR14)
219#define bfin_write_ICPLB_ADDR14(val) bfin_write32(ICPLB_ADDR14,val) 162#define bfin_write_ICPLB_ADDR14(val) bfin_write32(ICPLB_ADDR14,val)
220#define pICPLB_ADDR15 ((volatile void **)ICPLB_ADDR15)
221#define bfin_read_ICPLB_ADDR15() bfin_read32(ICPLB_ADDR15) 163#define bfin_read_ICPLB_ADDR15() bfin_read32(ICPLB_ADDR15)
222#define bfin_write_ICPLB_ADDR15(val) bfin_write32(ICPLB_ADDR15,val) 164#define bfin_write_ICPLB_ADDR15(val) bfin_write32(ICPLB_ADDR15,val)
223#define pICPLB_DATA0 ((volatile unsigned long *)ICPLB_DATA0)
224#define bfin_read_ICPLB_DATA0() bfin_read32(ICPLB_DATA0) 165#define bfin_read_ICPLB_DATA0() bfin_read32(ICPLB_DATA0)
225#define bfin_write_ICPLB_DATA0(val) bfin_write32(ICPLB_DATA0,val) 166#define bfin_write_ICPLB_DATA0(val) bfin_write32(ICPLB_DATA0,val)
226#define pICPLB_DATA1 ((volatile unsigned long *)ICPLB_DATA1)
227#define bfin_read_ICPLB_DATA1() bfin_read32(ICPLB_DATA1) 167#define bfin_read_ICPLB_DATA1() bfin_read32(ICPLB_DATA1)
228#define bfin_write_ICPLB_DATA1(val) bfin_write32(ICPLB_DATA1,val) 168#define bfin_write_ICPLB_DATA1(val) bfin_write32(ICPLB_DATA1,val)
229#define pICPLB_DATA2 ((volatile unsigned long *)ICPLB_DATA2)
230#define bfin_read_ICPLB_DATA2() bfin_read32(ICPLB_DATA2) 169#define bfin_read_ICPLB_DATA2() bfin_read32(ICPLB_DATA2)
231#define bfin_write_ICPLB_DATA2(val) bfin_write32(ICPLB_DATA2,val) 170#define bfin_write_ICPLB_DATA2(val) bfin_write32(ICPLB_DATA2,val)
232#define pICPLB_DATA3 ((volatile unsigned long *)ICPLB_DATA3)
233#define bfin_read_ICPLB_DATA3() bfin_read32(ICPLB_DATA3) 171#define bfin_read_ICPLB_DATA3() bfin_read32(ICPLB_DATA3)
234#define bfin_write_ICPLB_DATA3(val) bfin_write32(ICPLB_DATA3,val) 172#define bfin_write_ICPLB_DATA3(val) bfin_write32(ICPLB_DATA3,val)
235#define pICPLB_DATA4 ((volatile unsigned long *)ICPLB_DATA4)
236#define bfin_read_ICPLB_DATA4() bfin_read32(ICPLB_DATA4) 173#define bfin_read_ICPLB_DATA4() bfin_read32(ICPLB_DATA4)
237#define bfin_write_ICPLB_DATA4(val) bfin_write32(ICPLB_DATA4,val) 174#define bfin_write_ICPLB_DATA4(val) bfin_write32(ICPLB_DATA4,val)
238#define pICPLB_DATA5 ((volatile unsigned long *)ICPLB_DATA5)
239#define bfin_read_ICPLB_DATA5() bfin_read32(ICPLB_DATA5) 175#define bfin_read_ICPLB_DATA5() bfin_read32(ICPLB_DATA5)
240#define bfin_write_ICPLB_DATA5(val) bfin_write32(ICPLB_DATA5,val) 176#define bfin_write_ICPLB_DATA5(val) bfin_write32(ICPLB_DATA5,val)
241#define pICPLB_DATA6 ((volatile unsigned long *)ICPLB_DATA6)
242#define bfin_read_ICPLB_DATA6() bfin_read32(ICPLB_DATA6) 177#define bfin_read_ICPLB_DATA6() bfin_read32(ICPLB_DATA6)
243#define bfin_write_ICPLB_DATA6(val) bfin_write32(ICPLB_DATA6,val) 178#define bfin_write_ICPLB_DATA6(val) bfin_write32(ICPLB_DATA6,val)
244#define pICPLB_DATA7 ((volatile unsigned long *)ICPLB_DATA7)
245#define bfin_read_ICPLB_DATA7() bfin_read32(ICPLB_DATA7) 179#define bfin_read_ICPLB_DATA7() bfin_read32(ICPLB_DATA7)
246#define bfin_write_ICPLB_DATA7(val) bfin_write32(ICPLB_DATA7,val) 180#define bfin_write_ICPLB_DATA7(val) bfin_write32(ICPLB_DATA7,val)
247#define pICPLB_DATA8 ((volatile unsigned long *)ICPLB_DATA8)
248#define bfin_read_ICPLB_DATA8() bfin_read32(ICPLB_DATA8) 181#define bfin_read_ICPLB_DATA8() bfin_read32(ICPLB_DATA8)
249#define bfin_write_ICPLB_DATA8(val) bfin_write32(ICPLB_DATA8,val) 182#define bfin_write_ICPLB_DATA8(val) bfin_write32(ICPLB_DATA8,val)
250#define pICPLB_DATA9 ((volatile unsigned long *)ICPLB_DATA9)
251#define bfin_read_ICPLB_DATA9() bfin_read32(ICPLB_DATA9) 183#define bfin_read_ICPLB_DATA9() bfin_read32(ICPLB_DATA9)
252#define bfin_write_ICPLB_DATA9(val) bfin_write32(ICPLB_DATA9,val) 184#define bfin_write_ICPLB_DATA9(val) bfin_write32(ICPLB_DATA9,val)
253#define pICPLB_DATA10 ((volatile unsigned long *)ICPLB_DATA10)
254#define bfin_read_ICPLB_DATA10() bfin_read32(ICPLB_DATA10) 185#define bfin_read_ICPLB_DATA10() bfin_read32(ICPLB_DATA10)
255#define bfin_write_ICPLB_DATA10(val) bfin_write32(ICPLB_DATA10,val) 186#define bfin_write_ICPLB_DATA10(val) bfin_write32(ICPLB_DATA10,val)
256#define pICPLB_DATA11 ((volatile unsigned long *)ICPLB_DATA11)
257#define bfin_read_ICPLB_DATA11() bfin_read32(ICPLB_DATA11) 187#define bfin_read_ICPLB_DATA11() bfin_read32(ICPLB_DATA11)
258#define bfin_write_ICPLB_DATA11(val) bfin_write32(ICPLB_DATA11,val) 188#define bfin_write_ICPLB_DATA11(val) bfin_write32(ICPLB_DATA11,val)
259#define pICPLB_DATA12 ((volatile unsigned long *)ICPLB_DATA12)
260#define bfin_read_ICPLB_DATA12() bfin_read32(ICPLB_DATA12) 189#define bfin_read_ICPLB_DATA12() bfin_read32(ICPLB_DATA12)
261#define bfin_write_ICPLB_DATA12(val) bfin_write32(ICPLB_DATA12,val) 190#define bfin_write_ICPLB_DATA12(val) bfin_write32(ICPLB_DATA12,val)
262#define pICPLB_DATA13 ((volatile unsigned long *)ICPLB_DATA13)
263#define bfin_read_ICPLB_DATA13() bfin_read32(ICPLB_DATA13) 191#define bfin_read_ICPLB_DATA13() bfin_read32(ICPLB_DATA13)
264#define bfin_write_ICPLB_DATA13(val) bfin_write32(ICPLB_DATA13,val) 192#define bfin_write_ICPLB_DATA13(val) bfin_write32(ICPLB_DATA13,val)
265#define pICPLB_DATA14 ((volatile unsigned long *)ICPLB_DATA14)
266#define bfin_read_ICPLB_DATA14() bfin_read32(ICPLB_DATA14) 193#define bfin_read_ICPLB_DATA14() bfin_read32(ICPLB_DATA14)
267#define bfin_write_ICPLB_DATA14(val) bfin_write32(ICPLB_DATA14,val) 194#define bfin_write_ICPLB_DATA14(val) bfin_write32(ICPLB_DATA14,val)
268#define pICPLB_DATA15 ((volatile unsigned long *)ICPLB_DATA15)
269#define bfin_read_ICPLB_DATA15() bfin_read32(ICPLB_DATA15) 195#define bfin_read_ICPLB_DATA15() bfin_read32(ICPLB_DATA15)
270#define bfin_write_ICPLB_DATA15(val) bfin_write32(ICPLB_DATA15,val) 196#define bfin_write_ICPLB_DATA15(val) bfin_write32(ICPLB_DATA15,val)
271#define pITEST_COMMAND ((volatile unsigned long *)ITEST_COMMAND)
272#define bfin_read_ITEST_COMMAND() bfin_read32(ITEST_COMMAND) 197#define bfin_read_ITEST_COMMAND() bfin_read32(ITEST_COMMAND)
273#define bfin_write_ITEST_COMMAND(val) bfin_write32(ITEST_COMMAND,val) 198#define bfin_write_ITEST_COMMAND(val) bfin_write32(ITEST_COMMAND,val)
274#if 0 199#if 0
275#define ITEST_INDEX 0xFFE01304 /* Instruction Test Index Register */ 200#define ITEST_INDEX 0xFFE01304 /* Instruction Test Index Register */
276#endif 201#endif
277#define pITEST_DATA0 ((volatile unsigned long *)ITEST_DATA0)
278#define bfin_read_ITEST_DATA0() bfin_read32(ITEST_DATA0) 202#define bfin_read_ITEST_DATA0() bfin_read32(ITEST_DATA0)
279#define bfin_write_ITEST_DATA0(val) bfin_write32(ITEST_DATA0,val) 203#define bfin_write_ITEST_DATA0(val) bfin_write32(ITEST_DATA0,val)
280#define pITEST_DATA1 ((volatile unsigned long *)ITEST_DATA1)
281#define bfin_read_ITEST_DATA1() bfin_read32(ITEST_DATA1) 204#define bfin_read_ITEST_DATA1() bfin_read32(ITEST_DATA1)
282#define bfin_write_ITEST_DATA1(val) bfin_write32(ITEST_DATA1,val) 205#define bfin_write_ITEST_DATA1(val) bfin_write32(ITEST_DATA1,val)
283 206
284/* Event/Interrupt Registers*/ 207/* Event/Interrupt Registers*/
285 208
286#define pEVT0 ((volatile void **)EVT0)
287#define bfin_read_EVT0() bfin_read32(EVT0) 209#define bfin_read_EVT0() bfin_read32(EVT0)
288#define bfin_write_EVT0(val) bfin_write32(EVT0,val) 210#define bfin_write_EVT0(val) bfin_write32(EVT0,val)
289#define pEVT1 ((volatile void **)EVT1)
290#define bfin_read_EVT1() bfin_read32(EVT1) 211#define bfin_read_EVT1() bfin_read32(EVT1)
291#define bfin_write_EVT1(val) bfin_write32(EVT1,val) 212#define bfin_write_EVT1(val) bfin_write32(EVT1,val)
292#define pEVT2 ((volatile void **)EVT2)
293#define bfin_read_EVT2() bfin_read32(EVT2) 213#define bfin_read_EVT2() bfin_read32(EVT2)
294#define bfin_write_EVT2(val) bfin_write32(EVT2,val) 214#define bfin_write_EVT2(val) bfin_write32(EVT2,val)
295#define pEVT3 ((volatile void **)EVT3)
296#define bfin_read_EVT3() bfin_read32(EVT3) 215#define bfin_read_EVT3() bfin_read32(EVT3)
297#define bfin_write_EVT3(val) bfin_write32(EVT3,val) 216#define bfin_write_EVT3(val) bfin_write32(EVT3,val)
298#define pEVT4 ((volatile void **)EVT4)
299#define bfin_read_EVT4() bfin_read32(EVT4) 217#define bfin_read_EVT4() bfin_read32(EVT4)
300#define bfin_write_EVT4(val) bfin_write32(EVT4,val) 218#define bfin_write_EVT4(val) bfin_write32(EVT4,val)
301#define pEVT5 ((volatile void **)EVT5)
302#define bfin_read_EVT5() bfin_read32(EVT5) 219#define bfin_read_EVT5() bfin_read32(EVT5)
303#define bfin_write_EVT5(val) bfin_write32(EVT5,val) 220#define bfin_write_EVT5(val) bfin_write32(EVT5,val)
304#define pEVT6 ((volatile void **)EVT6)
305#define bfin_read_EVT6() bfin_read32(EVT6) 221#define bfin_read_EVT6() bfin_read32(EVT6)
306#define bfin_write_EVT6(val) bfin_write32(EVT6,val) 222#define bfin_write_EVT6(val) bfin_write32(EVT6,val)
307#define pEVT7 ((volatile void **)EVT7)
308#define bfin_read_EVT7() bfin_read32(EVT7) 223#define bfin_read_EVT7() bfin_read32(EVT7)
309#define bfin_write_EVT7(val) bfin_write32(EVT7,val) 224#define bfin_write_EVT7(val) bfin_write32(EVT7,val)
310#define pEVT8 ((volatile void **)EVT8)
311#define bfin_read_EVT8() bfin_read32(EVT8) 225#define bfin_read_EVT8() bfin_read32(EVT8)
312#define bfin_write_EVT8(val) bfin_write32(EVT8,val) 226#define bfin_write_EVT8(val) bfin_write32(EVT8,val)
313#define pEVT9 ((volatile void **)EVT9)
314#define bfin_read_EVT9() bfin_read32(EVT9) 227#define bfin_read_EVT9() bfin_read32(EVT9)
315#define bfin_write_EVT9(val) bfin_write32(EVT9,val) 228#define bfin_write_EVT9(val) bfin_write32(EVT9,val)
316#define pEVT10 ((volatile void **)EVT10)
317#define bfin_read_EVT10() bfin_read32(EVT10) 229#define bfin_read_EVT10() bfin_read32(EVT10)
318#define bfin_write_EVT10(val) bfin_write32(EVT10,val) 230#define bfin_write_EVT10(val) bfin_write32(EVT10,val)
319#define pEVT11 ((volatile void **)EVT11)
320#define bfin_read_EVT11() bfin_read32(EVT11) 231#define bfin_read_EVT11() bfin_read32(EVT11)
321#define bfin_write_EVT11(val) bfin_write32(EVT11,val) 232#define bfin_write_EVT11(val) bfin_write32(EVT11,val)
322#define pEVT12 ((volatile void **)EVT12)
323#define bfin_read_EVT12() bfin_read32(EVT12) 233#define bfin_read_EVT12() bfin_read32(EVT12)
324#define bfin_write_EVT12(val) bfin_write32(EVT12,val) 234#define bfin_write_EVT12(val) bfin_write32(EVT12,val)
325#define pEVT13 ((volatile void **)EVT13)
326#define bfin_read_EVT13() bfin_read32(EVT13) 235#define bfin_read_EVT13() bfin_read32(EVT13)
327#define bfin_write_EVT13(val) bfin_write32(EVT13,val) 236#define bfin_write_EVT13(val) bfin_write32(EVT13,val)
328#define pEVT14 ((volatile void **)EVT14)
329#define bfin_read_EVT14() bfin_read32(EVT14) 237#define bfin_read_EVT14() bfin_read32(EVT14)
330#define bfin_write_EVT14(val) bfin_write32(EVT14,val) 238#define bfin_write_EVT14(val) bfin_write32(EVT14,val)
331#define pEVT15 ((volatile void **)EVT15)
332#define bfin_read_EVT15() bfin_read32(EVT15) 239#define bfin_read_EVT15() bfin_read32(EVT15)
333#define bfin_write_EVT15(val) bfin_write32(EVT15,val) 240#define bfin_write_EVT15(val) bfin_write32(EVT15,val)
334#define pIMASK ((volatile unsigned long *)IMASK)
335#define bfin_read_IMASK() bfin_read32(IMASK) 241#define bfin_read_IMASK() bfin_read32(IMASK)
336#define bfin_write_IMASK(val) bfin_write32(IMASK,val) 242#define bfin_write_IMASK(val) bfin_write32(IMASK,val)
337#define pIPEND ((volatile unsigned long *)IPEND)
338#define bfin_read_IPEND() bfin_read32(IPEND) 243#define bfin_read_IPEND() bfin_read32(IPEND)
339#define bfin_write_IPEND(val) bfin_write32(IPEND,val) 244#define bfin_write_IPEND(val) bfin_write32(IPEND,val)
340#define pILAT ((volatile unsigned long *)ILAT)
341#define bfin_read_ILAT() bfin_read32(ILAT) 245#define bfin_read_ILAT() bfin_read32(ILAT)
342#define bfin_write_ILAT(val) bfin_write32(ILAT,val) 246#define bfin_write_ILAT(val) bfin_write32(ILAT,val)
343 247
344/*Core Timer Registers*/ 248/*Core Timer Registers*/
345#define pTCNTL ((volatile unsigned long *)TCNTL)
346#define bfin_read_TCNTL() bfin_read32(TCNTL) 249#define bfin_read_TCNTL() bfin_read32(TCNTL)
347#define bfin_write_TCNTL(val) bfin_write32(TCNTL,val) 250#define bfin_write_TCNTL(val) bfin_write32(TCNTL,val)
348#define pTPERIOD ((volatile unsigned long *)TPERIOD)
349#define bfin_read_TPERIOD() bfin_read32(TPERIOD) 251#define bfin_read_TPERIOD() bfin_read32(TPERIOD)
350#define bfin_write_TPERIOD(val) bfin_write32(TPERIOD,val) 252#define bfin_write_TPERIOD(val) bfin_write32(TPERIOD,val)
351#define pTSCALE ((volatile unsigned long *)TSCALE)
352#define bfin_read_TSCALE() bfin_read32(TSCALE) 253#define bfin_read_TSCALE() bfin_read32(TSCALE)
353#define bfin_write_TSCALE(val) bfin_write32(TSCALE,val) 254#define bfin_write_TSCALE(val) bfin_write32(TSCALE,val)
354#define pTCOUNT ((volatile unsigned long *)TCOUNT)
355#define bfin_read_TCOUNT() bfin_read32(TCOUNT) 255#define bfin_read_TCOUNT() bfin_read32(TCOUNT)
356#define bfin_write_TCOUNT(val) bfin_write32(TCOUNT,val) 256#define bfin_write_TCOUNT(val) bfin_write32(TCOUNT,val)
357 257
358/*Debug/MP/Emulation Registers*/ 258/*Debug/MP/Emulation Registers*/
359#define pDSPID ((volatile unsigned long *)DSPID)
360#define bfin_read_DSPID() bfin_read32(DSPID) 259#define bfin_read_DSPID() bfin_read32(DSPID)
361#define bfin_write_DSPID(val) bfin_write32(DSPID,val) 260#define bfin_write_DSPID(val) bfin_write32(DSPID,val)
362#define pDBGCTL ((volatile unsigned long *)DBGCTL)
363#define bfin_read_DBGCTL() bfin_read32(DBGCTL) 261#define bfin_read_DBGCTL() bfin_read32(DBGCTL)
364#define bfin_write_DBGCTL(val) bfin_write32(DBGCTL,val) 262#define bfin_write_DBGCTL(val) bfin_write32(DBGCTL,val)
365#define pDBGSTAT ((volatile unsigned long *)DBGSTAT)
366#define bfin_read_DBGSTAT() bfin_read32(DBGSTAT) 263#define bfin_read_DBGSTAT() bfin_read32(DBGSTAT)
367#define bfin_write_DBGSTAT(val) bfin_write32(DBGSTAT,val) 264#define bfin_write_DBGSTAT(val) bfin_write32(DBGSTAT,val)
368#define pEMUDAT ((volatile unsigned long *)EMUDAT)
369#define bfin_read_EMUDAT() bfin_read32(EMUDAT) 265#define bfin_read_EMUDAT() bfin_read32(EMUDAT)
370#define bfin_write_EMUDAT(val) bfin_write32(EMUDAT,val) 266#define bfin_write_EMUDAT(val) bfin_write32(EMUDAT,val)
371 267
372/*Trace Buffer Registers*/ 268/*Trace Buffer Registers*/
373#define pTBUFCTL ((volatile unsigned long *)TBUFCTL)
374#define bfin_read_TBUFCTL() bfin_read32(TBUFCTL) 269#define bfin_read_TBUFCTL() bfin_read32(TBUFCTL)
375#define bfin_write_TBUFCTL(val) bfin_write32(TBUFCTL,val) 270#define bfin_write_TBUFCTL(val) bfin_write32(TBUFCTL,val)
376#define pTBUFSTAT ((volatile unsigned long *)TBUFSTAT)
377#define bfin_read_TBUFSTAT() bfin_read32(TBUFSTAT) 271#define bfin_read_TBUFSTAT() bfin_read32(TBUFSTAT)
378#define bfin_write_TBUFSTAT(val) bfin_write32(TBUFSTAT,val) 272#define bfin_write_TBUFSTAT(val) bfin_write32(TBUFSTAT,val)
379#define pTBUF ((volatile void **)TBUF)
380#define bfin_read_TBUF() bfin_read32(TBUF) 273#define bfin_read_TBUF() bfin_read32(TBUF)
381#define bfin_write_TBUF(val) bfin_write32(TBUF,val) 274#define bfin_write_TBUF(val) bfin_write32(TBUF,val)
382 275
383/*Watch Point Control Registers*/ 276/*Watch Point Control Registers*/
384#define pWPIACTL ((volatile unsigned long *)WPIACTL)
385#define bfin_read_WPIACTL() bfin_read32(WPIACTL) 277#define bfin_read_WPIACTL() bfin_read32(WPIACTL)
386#define bfin_write_WPIACTL(val) bfin_write32(WPIACTL,val) 278#define bfin_write_WPIACTL(val) bfin_write32(WPIACTL,val)
387#define pWPIA0 ((volatile void **)WPIA0)
388#define bfin_read_WPIA0() bfin_read32(WPIA0) 279#define bfin_read_WPIA0() bfin_read32(WPIA0)
389#define bfin_write_WPIA0(val) bfin_write32(WPIA0,val) 280#define bfin_write_WPIA0(val) bfin_write32(WPIA0,val)
390#define pWPIA1 ((volatile void **)WPIA1)
391#define bfin_read_WPIA1() bfin_read32(WPIA1) 281#define bfin_read_WPIA1() bfin_read32(WPIA1)
392#define bfin_write_WPIA1(val) bfin_write32(WPIA1,val) 282#define bfin_write_WPIA1(val) bfin_write32(WPIA1,val)
393#define pWPIA2 ((volatile void **)WPIA2)
394#define bfin_read_WPIA2() bfin_read32(WPIA2) 283#define bfin_read_WPIA2() bfin_read32(WPIA2)
395#define bfin_write_WPIA2(val) bfin_write32(WPIA2,val) 284#define bfin_write_WPIA2(val) bfin_write32(WPIA2,val)
396#define pWPIA3 ((volatile void **)WPIA3)
397#define bfin_read_WPIA3() bfin_read32(WPIA3) 285#define bfin_read_WPIA3() bfin_read32(WPIA3)
398#define bfin_write_WPIA3(val) bfin_write32(WPIA3,val) 286#define bfin_write_WPIA3(val) bfin_write32(WPIA3,val)
399#define pWPIA4 ((volatile void **)WPIA4)
400#define bfin_read_WPIA4() bfin_read32(WPIA4) 287#define bfin_read_WPIA4() bfin_read32(WPIA4)
401#define bfin_write_WPIA4(val) bfin_write32(WPIA4,val) 288#define bfin_write_WPIA4(val) bfin_write32(WPIA4,val)
402#define pWPIA5 ((volatile void **)WPIA5)
403#define bfin_read_WPIA5() bfin_read32(WPIA5) 289#define bfin_read_WPIA5() bfin_read32(WPIA5)
404#define bfin_write_WPIA5(val) bfin_write32(WPIA5,val) 290#define bfin_write_WPIA5(val) bfin_write32(WPIA5,val)
405#define pWPIACNT0 ((volatile unsigned long *)WPIACNT0)
406#define bfin_read_WPIACNT0() bfin_read32(WPIACNT0) 291#define bfin_read_WPIACNT0() bfin_read32(WPIACNT0)
407#define bfin_write_WPIACNT0(val) bfin_write32(WPIACNT0,val) 292#define bfin_write_WPIACNT0(val) bfin_write32(WPIACNT0,val)
408#define pWPIACNT1 ((volatile unsigned long *)WPIACNT1)
409#define bfin_read_WPIACNT1() bfin_read32(WPIACNT1) 293#define bfin_read_WPIACNT1() bfin_read32(WPIACNT1)
410#define bfin_write_WPIACNT1(val) bfin_write32(WPIACNT1,val) 294#define bfin_write_WPIACNT1(val) bfin_write32(WPIACNT1,val)
411#define pWPIACNT2 ((volatile unsigned long *)WPIACNT2)
412#define bfin_read_WPIACNT2() bfin_read32(WPIACNT2) 295#define bfin_read_WPIACNT2() bfin_read32(WPIACNT2)
413#define bfin_write_WPIACNT2(val) bfin_write32(WPIACNT2,val) 296#define bfin_write_WPIACNT2(val) bfin_write32(WPIACNT2,val)
414#define pWPIACNT3 ((volatile unsigned long *)WPIACNT3)
415#define bfin_read_WPIACNT3() bfin_read32(WPIACNT3) 297#define bfin_read_WPIACNT3() bfin_read32(WPIACNT3)
416#define bfin_write_WPIACNT3(val) bfin_write32(WPIACNT3,val) 298#define bfin_write_WPIACNT3(val) bfin_write32(WPIACNT3,val)
417#define pWPIACNT4 ((volatile unsigned long *)WPIACNT4)
418#define bfin_read_WPIACNT4() bfin_read32(WPIACNT4) 299#define bfin_read_WPIACNT4() bfin_read32(WPIACNT4)
419#define bfin_write_WPIACNT4(val) bfin_write32(WPIACNT4,val) 300#define bfin_write_WPIACNT4(val) bfin_write32(WPIACNT4,val)
420#define pWPIACNT5 ((volatile unsigned long *)WPIACNT5)
421#define bfin_read_WPIACNT5() bfin_read32(WPIACNT5) 301#define bfin_read_WPIACNT5() bfin_read32(WPIACNT5)
422#define bfin_write_WPIACNT5(val) bfin_write32(WPIACNT5,val) 302#define bfin_write_WPIACNT5(val) bfin_write32(WPIACNT5,val)
423#define pWPDACTL ((volatile unsigned long *)WPDACTL)
424#define bfin_read_WPDACTL() bfin_read32(WPDACTL) 303#define bfin_read_WPDACTL() bfin_read32(WPDACTL)
425#define bfin_write_WPDACTL(val) bfin_write32(WPDACTL,val) 304#define bfin_write_WPDACTL(val) bfin_write32(WPDACTL,val)
426#define pWPDA0 ((volatile void **)WPDA0)
427#define bfin_read_WPDA0() bfin_read32(WPDA0) 305#define bfin_read_WPDA0() bfin_read32(WPDA0)
428#define bfin_write_WPDA0(val) bfin_write32(WPDA0,val) 306#define bfin_write_WPDA0(val) bfin_write32(WPDA0,val)
429#define pWPDA1 ((volatile void **)WPDA1)
430#define bfin_read_WPDA1() bfin_read32(WPDA1) 307#define bfin_read_WPDA1() bfin_read32(WPDA1)
431#define bfin_write_WPDA1(val) bfin_write32(WPDA1,val) 308#define bfin_write_WPDA1(val) bfin_write32(WPDA1,val)
432#define pWPDACNT0 ((volatile unsigned long *)WPDACNT0)
433#define bfin_read_WPDACNT0() bfin_read32(WPDACNT0) 309#define bfin_read_WPDACNT0() bfin_read32(WPDACNT0)
434#define bfin_write_WPDACNT0(val) bfin_write32(WPDACNT0,val) 310#define bfin_write_WPDACNT0(val) bfin_write32(WPDACNT0,val)
435#define pWPDACNT1 ((volatile unsigned long *)WPDACNT1)
436#define bfin_read_WPDACNT1() bfin_read32(WPDACNT1) 311#define bfin_read_WPDACNT1() bfin_read32(WPDACNT1)
437#define bfin_write_WPDACNT1(val) bfin_write32(WPDACNT1,val) 312#define bfin_write_WPDACNT1(val) bfin_write32(WPDACNT1,val)
438#define pWPSTAT ((volatile unsigned long *)WPSTAT)
439#define bfin_read_WPSTAT() bfin_read32(WPSTAT) 313#define bfin_read_WPSTAT() bfin_read32(WPSTAT)
440#define bfin_write_WPSTAT(val) bfin_write32(WPSTAT,val) 314#define bfin_write_WPSTAT(val) bfin_write32(WPSTAT,val)
441 315
442/*Performance Monitor Registers*/ 316/*Performance Monitor Registers*/
443#define pPFCTL ((volatile unsigned long *)PFCTL)
444#define bfin_read_PFCTL() bfin_read32(PFCTL) 317#define bfin_read_PFCTL() bfin_read32(PFCTL)
445#define bfin_write_PFCTL(val) bfin_write32(PFCTL,val) 318#define bfin_write_PFCTL(val) bfin_write32(PFCTL,val)
446#define pPFCNTR0 ((volatile unsigned long *)PFCNTR0)
447#define bfin_read_PFCNTR0() bfin_read32(PFCNTR0) 319#define bfin_read_PFCNTR0() bfin_read32(PFCNTR0)
448#define bfin_write_PFCNTR0(val) bfin_write32(PFCNTR0,val) 320#define bfin_write_PFCNTR0(val) bfin_write32(PFCNTR0,val)
449#define pPFCNTR1 ((volatile unsigned long *)PFCNTR1)
450#define bfin_read_PFCNTR1() bfin_read32(PFCNTR1) 321#define bfin_read_PFCNTR1() bfin_read32(PFCNTR1)
451#define bfin_write_PFCNTR1(val) bfin_write32(PFCNTR1,val) 322#define bfin_write_PFCNTR1(val) bfin_write32(PFCNTR1,val)
452 323
@@ -454,18 +325,4 @@
454#define IPRIO 0xFFE02110 325#define IPRIO 0xFFE02110
455*/ 326*/
456 327
457#if defined(CONFIG_BFIN_ALIVE_LED)
458#define pCONFIG_BFIN_ALIVE_LED_DPORT \
459 (volatile unsigned short *)CONFIG_BFIN_ALIVE_LED_DPORT
460#define pCONFIG_BFIN_ALIVE_LED_PORT \
461 (volatile unsigned short *)CONFIG_BFIN_ALIVE_LED_PORT
462#endif
463
464#if defined(CONFIG_BFIN_IDLE_LED)
465#define pCONFIG_BFIN_IDLE_LED_DPORT \
466 (volatile unsigned short *)CONFIG_BFIN_IDLE_LED_DPORT
467#define pCONFIG_BFIN_IDLE_LED_PORT \
468 (volatile unsigned short *)CONFIG_BFIN_IDLE_LED_PORT
469#endif
470
471#endif /* _CDEF_LPBLACKFIN_H */ 328#endif /* _CDEF_LPBLACKFIN_H */
diff --git a/include/asm-blackfin/processor.h b/include/asm-blackfin/processor.h
index 0336ff132c16..aba2b30a8ed8 100644
--- a/include/asm-blackfin/processor.h
+++ b/include/asm-blackfin/processor.h
@@ -104,13 +104,13 @@ unsigned long get_wchan(struct task_struct *p);
104#define cpu_relax() barrier() 104#define cpu_relax() barrier()
105 105
106/* Get the Silicon Revision of the chip */ 106/* Get the Silicon Revision of the chip */
107static inline uint32_t bfin_revid(void) 107static inline __attribute_pure__ uint32_t bfin_revid(void)
108{ 108{
109 /* stored in the upper 4 bits */ 109 /* stored in the upper 4 bits */
110 return bfin_read_CHIPID() >> 28; 110 return bfin_read_CHIPID() >> 28;
111} 111}
112 112
113static inline uint32_t bfin_compiled_revid(void) 113static inline __attribute_pure__ uint32_t bfin_compiled_revid(void)
114{ 114{
115#if defined(CONFIG_BF_REV_0_0) 115#if defined(CONFIG_BF_REV_0_0)
116 return 0; 116 return 0;
diff --git a/include/asm-blackfin/uaccess.h b/include/asm-blackfin/uaccess.h
index bfcb6794c672..2233f8f9314d 100644
--- a/include/asm-blackfin/uaccess.h
+++ b/include/asm-blackfin/uaccess.h
@@ -14,7 +14,7 @@
14#include <linux/string.h> 14#include <linux/string.h>
15 15
16#include <asm/segment.h> 16#include <asm/segment.h>
17#ifndef CONFIG_NO_ACCESS_CHECK 17#ifdef CONFIG_ACCESS_CHECK
18# include <asm/bfin-global.h> 18# include <asm/bfin-global.h>
19#endif 19#endif
20 20
@@ -56,7 +56,7 @@ static inline int is_in_rom(unsigned long addr)
56 * get_fs() == KERNEL_DS, checking is bypassed. 56 * get_fs() == KERNEL_DS, checking is bypassed.
57 */ 57 */
58 58
59#ifdef CONFIG_NO_ACCESS_CHECK 59#ifndef CONFIG_ACCESS_CHECK
60static inline int _access_ok(unsigned long addr, unsigned long size) { return 1; } 60static inline int _access_ok(unsigned long addr, unsigned long size) { return 1; }
61#else 61#else
62#ifdef CONFIG_ACCESS_OK_L1 62#ifdef CONFIG_ACCESS_OK_L1
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 14fae1fa87df..7f30cce52857 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -35,7 +35,7 @@ struct bug_entry {
35#define WARN_ON(condition) ({ \ 35#define WARN_ON(condition) ({ \
36 typeof(condition) __ret_warn_on = (condition); \ 36 typeof(condition) __ret_warn_on = (condition); \
37 if (unlikely(__ret_warn_on)) { \ 37 if (unlikely(__ret_warn_on)) { \
38 printk("BUG: at %s:%d %s()\n", __FILE__, \ 38 printk("WARNING: at %s:%d %s()\n", __FILE__, \
39 __LINE__, __FUNCTION__); \ 39 __LINE__, __FUNCTION__); \
40 dump_stack(); \ 40 dump_stack(); \
41 } \ 41 } \
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f3806a74c478..84155eb67f1d 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -9,8 +9,13 @@
9/* Align . to a 8 byte boundary equals to maximum function alignment. */ 9/* Align . to a 8 byte boundary equals to maximum function alignment. */
10#define ALIGN_FUNCTION() . = ALIGN(8) 10#define ALIGN_FUNCTION() . = ALIGN(8)
11 11
12#define RODATA \ 12/* .data section */
13 . = ALIGN(4096); \ 13#define DATA_DATA \
14 *(.data) \
15 *(.data.init.refok)
16
17#define RO_DATA(align) \
18 . = ALIGN((align)); \
14 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ 19 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
15 VMLINUX_SYMBOL(__start_rodata) = .; \ 20 VMLINUX_SYMBOL(__start_rodata) = .; \
16 *(.rodata) *(.rodata.*) \ 21 *(.rodata) *(.rodata.*) \
@@ -130,7 +135,11 @@
130 VMLINUX_SYMBOL(__end_rodata) = .; \ 135 VMLINUX_SYMBOL(__end_rodata) = .; \
131 } \ 136 } \
132 \ 137 \
133 . = ALIGN(4096); 138 . = ALIGN((align));
139
140/* RODATA provided for backward compatibility.
141 * All archs are supposed to use RO_DATA() */
142#define RODATA RO_DATA(4096)
134 143
135#define SECURITY_INIT \ 144#define SECURITY_INIT \
136 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ 145 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
@@ -139,6 +148,13 @@
139 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 148 VMLINUX_SYMBOL(__security_initcall_end) = .; \
140 } 149 }
141 150
151/* .text section. Map to function alignment to avoid address changes
152 * during second ld run in second ld pass when generating System.map */
153#define TEXT_TEXT \
154 ALIGN_FUNCTION(); \
155 *(.text) \
156 *(.text.init.refok)
157
142/* sched.text is aling to function alignment to secure we have same 158/* sched.text is aling to function alignment to secure we have same
143 * address even at second ld pass when generating System.map */ 159 * address even at second ld pass when generating System.map */
144#define SCHED_TEXT \ 160#define SCHED_TEXT \
diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h
index 99b664aa2083..49fc886a6232 100644
--- a/include/asm-h8300/processor.h
+++ b/include/asm-h8300/processor.h
@@ -78,7 +78,7 @@ struct thread_struct {
78do { \ 78do { \
79 set_fs(USER_DS); /* reads from user space */ \ 79 set_fs(USER_DS); /* reads from user space */ \
80 (_regs)->pc = (_pc); \ 80 (_regs)->pc = (_pc); \
81 (_regs)->ccr &= 0x00; /* clear kernel flag */ \ 81 (_regs)->ccr = 0x00; /* clear all flags */ \
82 (_regs)->er5 = current->mm->start_data; /* GOT base */ \ 82 (_regs)->er5 = current->mm->start_data; /* GOT base */ \
83 wrusp((unsigned long)(_usp) - sizeof(unsigned long)*3); \ 83 wrusp((unsigned long)(_usp) - sizeof(unsigned long)*3); \
84} while(0) 84} while(0)
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index 0baa2f89463c..437aac801711 100644
--- a/include/asm-i386/atomic.h
+++ b/include/asm-i386/atomic.h
@@ -182,7 +182,7 @@ static __inline__ int atomic_add_return(int i, atomic_t *v)
182 int __i; 182 int __i;
183#ifdef CONFIG_M386 183#ifdef CONFIG_M386
184 unsigned long flags; 184 unsigned long flags;
185 if(unlikely(boot_cpu_data.x86==3)) 185 if(unlikely(boot_cpu_data.x86 <= 3))
186 goto no_xadd; 186 goto no_xadd;
187#endif 187#endif
188 /* Modern 486+ processor */ 188 /* Modern 486+ processor */
diff --git a/include/asm-i386/local.h b/include/asm-i386/local.h
index e13d3e98823f..6e85975b9ed2 100644
--- a/include/asm-i386/local.h
+++ b/include/asm-i386/local.h
@@ -135,7 +135,7 @@ static __inline__ long local_add_return(long i, local_t *l)
135 long __i; 135 long __i;
136#ifdef CONFIG_M386 136#ifdef CONFIG_M386
137 unsigned long flags; 137 unsigned long flags;
138 if(unlikely(boot_cpu_data.x86==3)) 138 if(unlikely(boot_cpu_data.x86 <= 3))
139 goto no_xadd; 139 goto no_xadd;
140#endif 140#endif
141 /* Modern 486+ processor */ 141 /* Modern 486+ processor */
diff --git a/include/asm-i386/tlbflush.h b/include/asm-i386/tlbflush.h
index db7f77eacfa0..fc525c5cd5a9 100644
--- a/include/asm-i386/tlbflush.h
+++ b/include/asm-i386/tlbflush.h
@@ -90,6 +90,8 @@
90 90
91#ifndef CONFIG_SMP 91#ifndef CONFIG_SMP
92 92
93#include <linux/sched.h>
94
93#define flush_tlb() __flush_tlb() 95#define flush_tlb() __flush_tlb()
94#define flush_tlb_all() __flush_tlb_all() 96#define flush_tlb_all() __flush_tlb_all()
95#define local_flush_tlb() __flush_tlb() 97#define local_flush_tlb() __flush_tlb()
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 5d03792d4f65..5b526357d178 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -30,6 +30,8 @@
30 30
31#ifdef __KERNEL__ 31#ifdef __KERNEL__
32 32
33#include <acpi/pdc_intel.h>
34
33#include <linux/init.h> 35#include <linux/init.h>
34#include <linux/numa.h> 36#include <linux/numa.h>
35#include <asm/system.h> 37#include <asm/system.h>
@@ -119,11 +121,6 @@ extern int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS];
119extern int __initdata nid_to_pxm_map[MAX_NUMNODES]; 121extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
120#endif 122#endif
121 123
122/*
123 * Refer Intel ACPI _PDC support document for bit definitions
124 */
125#define ACPI_PDC_EST_CAPABILITY_SMP 0x8
126
127#endif /*__KERNEL__*/ 124#endif /*__KERNEL__*/
128 125
129#endif /*_ASM_ACPI_H*/ 126#endif /*_ASM_ACPI_H*/
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index d7781a2ddefe..441c9e001776 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -305,6 +305,19 @@
305 305
306#define NR_syscalls 286 /* length of syscall table */ 306#define NR_syscalls 286 /* length of syscall table */
307 307
308/*
309 * The following defines stop scripts/checksyscalls.sh from complaining about
310 * unimplemented system calls. Glibc provides for each of these by using
311 * more modern equivalent system calls.
312 */
313#define __IGNORE_fork /* clone() */
314#define __IGNORE_time /* gettimeofday() */
315#define __IGNORE_alarm /* setitimer(ITIMER_REAL, ... */
316#define __IGNORE_pause /* rt_sigprocmask(), rt_sigsuspend() */
317#define __IGNORE_utime /* utimes() */
318#define __IGNORE_getpgrp /* getpgid() */
319#define __IGNORE_vfork /* clone() */
320
308#define __ARCH_WANT_SYS_RT_SIGACTION 321#define __ARCH_WANT_SYS_RT_SIGACTION
309#define __ARCH_WANT_SYS_RT_SIGSUSPEND 322#define __ARCH_WANT_SYS_RT_SIGSUSPEND
310 323
diff --git a/include/asm-m68k/mmzone.h b/include/asm-m68k/mmzone.h
new file mode 100644
index 000000000000..e1f1ec7b7006
--- /dev/null
+++ b/include/asm-m68k/mmzone.h
@@ -0,0 +1,9 @@
1#ifndef _ASM_M68K_MMZONE_H_
2#define _ASM_M68K_MMZONE_H_
3
4extern pg_data_t pg_data_map[];
5
6#define NODE_DATA(nid) (&pg_data_map[nid])
7#define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map)
8
9#endif /* _ASM_M68K_MMZONE_H_ */
diff --git a/include/asm-m68k/module.h b/include/asm-m68k/module.h
index c6d75af2d8d3..382d20a6fc18 100644
--- a/include/asm-m68k/module.h
+++ b/include/asm-m68k/module.h
@@ -1,7 +1,39 @@
1#ifndef _ASM_M68K_MODULE_H 1#ifndef _ASM_M68K_MODULE_H
2#define _ASM_M68K_MODULE_H 2#define _ASM_M68K_MODULE_H
3struct mod_arch_specific { }; 3
4struct mod_arch_specific {
5 struct m68k_fixup_info *fixup_start, *fixup_end;
6};
7
8#define MODULE_ARCH_INIT { \
9 .fixup_start = __start_fixup, \
10 .fixup_end = __stop_fixup, \
11}
12
4#define Elf_Shdr Elf32_Shdr 13#define Elf_Shdr Elf32_Shdr
5#define Elf_Sym Elf32_Sym 14#define Elf_Sym Elf32_Sym
6#define Elf_Ehdr Elf32_Ehdr 15#define Elf_Ehdr Elf32_Ehdr
16
17
18enum m68k_fixup_type {
19 m68k_fixup_memoffset,
20 m68k_fixup_vnode_shift,
21};
22
23struct m68k_fixup_info {
24 enum m68k_fixup_type type;
25 void *addr;
26};
27
28#define m68k_fixup(type, addr) \
29 " .section \".m68k_fixup\",\"aw\"\n" \
30 " .long " #type "," #addr "\n" \
31 " .previous\n"
32
33extern struct m68k_fixup_info __start_fixup[], __stop_fixup[];
34
35struct module;
36extern void module_fixup(struct module *mod, struct m68k_fixup_info *start,
37 struct m68k_fixup_info *end);
38
7#endif /* _ASM_M68K_MODULE_H */ 39#endif /* _ASM_M68K_MODULE_H */
diff --git a/include/asm-m68k/motorola_pgtable.h b/include/asm-m68k/motorola_pgtable.h
index 61e4406ed96a..b5b78c01eb6c 100644
--- a/include/asm-m68k/motorola_pgtable.h
+++ b/include/asm-m68k/motorola_pgtable.h
@@ -130,7 +130,7 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
130#define pte_present(pte) (pte_val(pte) & (_PAGE_PRESENT | _PAGE_PROTNONE)) 130#define pte_present(pte) (pte_val(pte) & (_PAGE_PRESENT | _PAGE_PROTNONE))
131#define pte_clear(mm,addr,ptep) ({ pte_val(*(ptep)) = 0; }) 131#define pte_clear(mm,addr,ptep) ({ pte_val(*(ptep)) = 0; })
132 132
133#define pte_page(pte) (mem_map + ((unsigned long)(__va(pte_val(pte)) - PAGE_OFFSET) >> PAGE_SHIFT)) 133#define pte_page(pte) virt_to_page(__va(pte_val(pte)))
134#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT) 134#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
135#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 135#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
136 136
@@ -143,7 +143,7 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
143 while (--__i >= 0) \ 143 while (--__i >= 0) \
144 *__ptr++ = 0; \ 144 *__ptr++ = 0; \
145}) 145})
146#define pmd_page(pmd) (mem_map + ((unsigned long)(__va(pmd_val(pmd)) - PAGE_OFFSET) >> PAGE_SHIFT)) 146#define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd)))
147 147
148 148
149#define pgd_none(pgd) (!pgd_val(pgd)) 149#define pgd_none(pgd) (!pgd_val(pgd))
@@ -223,10 +223,10 @@ static inline pte_t *pte_offset_kernel(pmd_t *pmdp, unsigned long address)
223 return (pte_t *)__pmd_page(*pmdp) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)); 223 return (pte_t *)__pmd_page(*pmdp) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
224} 224}
225 225
226#define pte_offset_map(pmdp,address) ((pte_t *)kmap(pmd_page(*pmdp)) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) 226#define pte_offset_map(pmdp,address) ((pte_t *)__pmd_page(*pmdp) + (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
227#define pte_offset_map_nested(pmdp, address) pte_offset_map(pmdp, address) 227#define pte_offset_map_nested(pmdp, address) pte_offset_map(pmdp, address)
228#define pte_unmap(pte) kunmap(pte) 228#define pte_unmap(pte) ((void)0)
229#define pte_unmap_nested(pte) kunmap(pte) 229#define pte_unmap_nested(pte) ((void)0)
230 230
231/* 231/*
232 * Allocate and free page tables. The xxx_kernel() versions are 232 * Allocate and free page tables. The xxx_kernel() versions are
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index fcc165ddd09e..9e6d0d6debdb 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -27,6 +27,8 @@
27 27
28#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
29 29
30#include <asm/module.h>
31
30#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) 32#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
31#define free_user_page(page, addr) free_page(addr) 33#define free_user_page(page, addr) free_page(addr)
32 34
@@ -114,18 +116,33 @@ typedef struct { unsigned long pgprot; } pgprot_t;
114 116
115#ifndef __ASSEMBLY__ 117#ifndef __ASSEMBLY__
116 118
119extern unsigned long m68k_memoffset;
120
117#ifndef CONFIG_SUN3 121#ifndef CONFIG_SUN3
118 122
119#define WANT_PAGE_VIRTUAL 123#define WANT_PAGE_VIRTUAL
120#ifdef CONFIG_SINGLE_MEMORY_CHUNK
121extern unsigned long m68k_memoffset;
122 124
123#define __pa(vaddr) ((unsigned long)(vaddr)+m68k_memoffset) 125static inline unsigned long ___pa(void *vaddr)
124#define __va(paddr) ((void *)((unsigned long)(paddr)-m68k_memoffset)) 126{
125#else 127 unsigned long paddr;
126#define __pa(vaddr) virt_to_phys((void *)(vaddr)) 128 asm (
127#define __va(paddr) phys_to_virt((unsigned long)(paddr)) 129 "1: addl #0,%0\n"
128#endif 130 m68k_fixup(%c2, 1b+2)
131 : "=r" (paddr)
132 : "0" (vaddr), "i" (m68k_fixup_memoffset));
133 return paddr;
134}
135#define __pa(vaddr) ___pa((void *)(vaddr))
136static inline void *__va(unsigned long paddr)
137{
138 void *vaddr;
139 asm (
140 "1: subl #0,%0\n"
141 m68k_fixup(%c2, 1b+2)
142 : "=r" (vaddr)
143 : "0" (paddr), "i" (m68k_fixup_memoffset));
144 return vaddr;
145}
129 146
130#else /* !CONFIG_SUN3 */ 147#else /* !CONFIG_SUN3 */
131/* This #define is a horrible hack to suppress lots of warnings. --m */ 148/* This #define is a horrible hack to suppress lots of warnings. --m */
@@ -161,11 +178,47 @@ static inline void *__va(unsigned long x)
161#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) 178#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
162#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) 179#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
163 180
164#define virt_to_page(kaddr) (mem_map + (((unsigned long)(kaddr)-PAGE_OFFSET) >> PAGE_SHIFT)) 181extern int m68k_virt_to_node_shift;
165#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) 182
183#ifdef CONFIG_SINGLE_MEMORY_CHUNK
184#define __virt_to_node(addr) (&pg_data_map[0])
185#else
186extern struct pglist_data *pg_data_table[];
187
188static inline __attribute_const__ int __virt_to_node_shift(void)
189{
190 int shift;
191
192 asm (
193 "1: moveq #0,%0\n"
194 m68k_fixup(%c1, 1b)
195 : "=d" (shift)
196 : "i" (m68k_fixup_vnode_shift));
197 return shift;
198}
199
200#define __virt_to_node(addr) (pg_data_table[(unsigned long)(addr) >> __virt_to_node_shift()])
201#endif
166 202
167#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) 203#define virt_to_page(addr) ({ \
168#define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) 204 pfn_to_page(virt_to_pfn(addr)); \
205})
206#define page_to_virt(page) ({ \
207 pfn_to_virt(page_to_pfn(page)); \
208})
209
210#define pfn_to_page(pfn) ({ \
211 unsigned long __pfn = (pfn); \
212 struct pglist_data *pgdat; \
213 pgdat = __virt_to_node((unsigned long)pfn_to_virt(__pfn)); \
214 pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn); \
215})
216#define page_to_pfn(_page) ({ \
217 struct page *__p = (_page); \
218 struct pglist_data *pgdat; \
219 pgdat = &pg_data_map[page_to_nid(__p)]; \
220 ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \
221})
169 222
170#define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory) 223#define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
171#define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn)) 224#define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
diff --git a/include/asm-m68k/pgalloc.h b/include/asm-m68k/pgalloc.h
index a9cfb4b99d88..4cb1a57ab763 100644
--- a/include/asm-m68k/pgalloc.h
+++ b/include/asm-m68k/pgalloc.h
@@ -8,11 +8,12 @@
8#include <asm/virtconvert.h> 8#include <asm/virtconvert.h>
9 9
10 10
11
12#ifdef CONFIG_SUN3 11#ifdef CONFIG_SUN3
13#include <asm/sun3_pgalloc.h> 12#include <asm/sun3_pgalloc.h>
14#else 13#else
15#include <asm/motorola_pgalloc.h> 14#include <asm/motorola_pgalloc.h>
16#endif 15#endif
17 16
17extern void m68k_setup_node(int node);
18
18#endif /* M68K_PGALLOC_H */ 19#endif /* M68K_PGALLOC_H */
diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h
index 555b87a1f7e3..778a4c538eb2 100644
--- a/include/asm-m68k/pgtable.h
+++ b/include/asm-m68k/pgtable.h
@@ -107,22 +107,7 @@ extern void *empty_zero_page;
107/* 64-bit machines, beware! SRB. */ 107/* 64-bit machines, beware! SRB. */
108#define SIZEOF_PTR_LOG2 2 108#define SIZEOF_PTR_LOG2 2
109 109
110/* 110#define mm_end_of_chunk(addr, len) 0
111 * Check if the addr/len goes up to the end of a physical
112 * memory chunk. Used for DMA functions.
113 */
114#ifdef CONFIG_SINGLE_MEMORY_CHUNK
115/*
116 * It makes no sense to consider whether we cross a memory boundary if
117 * we support just one physical chunk of memory.
118 */
119static inline int mm_end_of_chunk(unsigned long addr, int len)
120{
121 return 0;
122}
123#else
124int mm_end_of_chunk (unsigned long addr, int len);
125#endif
126 111
127extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode); 112extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode);
128 113
diff --git a/include/asm-m68k/sun3_pgtable.h b/include/asm-m68k/sun3_pgtable.h
index 5156a28a18d8..b9e62c1e7ae3 100644
--- a/include/asm-m68k/sun3_pgtable.h
+++ b/include/asm-m68k/sun3_pgtable.h
@@ -132,8 +132,8 @@ static inline void pte_clear (struct mm_struct *mm, unsigned long addr, pte_t *p
132#define pfn_pte(pfn, pgprot) \ 132#define pfn_pte(pfn, pgprot) \
133({ pte_t __pte; pte_val(__pte) = pfn | pgprot_val(pgprot); __pte; }) 133({ pte_t __pte; pte_val(__pte) = pfn | pgprot_val(pgprot); __pte; })
134 134
135#define pte_page(pte) (mem_map+((__pte_page(pte) - PAGE_OFFSET) >> PAGE_SHIFT)) 135#define pte_page(pte) virt_to_page(__pte_page(pte))
136#define pmd_page(pmd) (mem_map+((__pmd_page(pmd) - PAGE_OFFSET) >> PAGE_SHIFT)) 136#define pmd_page(pmd) virt_to_page(__pmd_page(pmd))
137 137
138 138
139static inline int pmd_none2 (pmd_t *pmd) { return !pmd_val (*pmd); } 139static inline int pmd_none2 (pmd_t *pmd) { return !pmd_val (*pmd); }
diff --git a/include/asm-m68k/virtconvert.h b/include/asm-m68k/virtconvert.h
index 83a87c9b1a16..dea32fbc7e51 100644
--- a/include/asm-m68k/virtconvert.h
+++ b/include/asm-m68k/virtconvert.h
@@ -8,56 +8,35 @@
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9 9
10#include <linux/compiler.h> 10#include <linux/compiler.h>
11#include <linux/mmzone.h>
11#include <asm/setup.h> 12#include <asm/setup.h>
12#include <asm/page.h> 13#include <asm/page.h>
13 14
14#ifdef CONFIG_AMIGA
15#include <asm/amigahw.h>
16#endif
17
18/* 15/*
19 * Change virtual addresses to physical addresses and vv. 16 * Change virtual addresses to physical addresses and vv.
20 */ 17 */
21#ifndef CONFIG_SUN3
22extern unsigned long mm_vtop(unsigned long addr) __attribute_const__;
23extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
24#else
25static inline unsigned long mm_vtop(unsigned long vaddr)
26{
27 return __pa(vaddr);
28}
29
30static inline unsigned long mm_ptov(unsigned long paddr)
31{
32 return (unsigned long)__va(paddr);
33}
34#endif
35
36#ifdef CONFIG_SINGLE_MEMORY_CHUNK
37static inline unsigned long virt_to_phys(void *vaddr)
38{
39 return (unsigned long)vaddr - PAGE_OFFSET + m68k_memory[0].addr;
40}
41
42static inline void * phys_to_virt(unsigned long paddr)
43{
44 return (void *)(paddr - m68k_memory[0].addr + PAGE_OFFSET);
45}
46#else
47static inline unsigned long virt_to_phys(void *address) 18static inline unsigned long virt_to_phys(void *address)
48{ 19{
49 return mm_vtop((unsigned long)address); 20 return __pa(address);
50} 21}
51 22
52static inline void *phys_to_virt(unsigned long address) 23static inline void *phys_to_virt(unsigned long address)
53{ 24{
54 return (void *) mm_ptov(address); 25 return __va(address);
55} 26}
56#endif
57 27
58/* Permanent address of a page. */ 28/* Permanent address of a page. */
59#define __page_address(page) (PAGE_OFFSET + (((page) - mem_map) << PAGE_SHIFT)) 29#ifdef CONFIG_SINGLE_MEMORY_CHUNK
60#define page_to_phys(page) virt_to_phys((void *)__page_address(page)) 30#define page_to_phys(page) \
31 __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
32#else
33#define page_to_phys(_page) ({ \
34 struct page *__page = _page; \
35 struct pglist_data *pgdat; \
36 pgdat = pg_data_table[page_to_nid(__page)]; \
37 page_to_pfn(__page) << PAGE_SHIFT; \
38})
39#endif
61 40
62/* 41/*
63 * IO bus memory addresses are 1:1 with the physical address, 42 * IO bus memory addresses are 1:1 with the physical address,
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
index 5685d4fc7881..9fb57c035213 100644
--- a/include/asm-mips/pgalloc.h
+++ b/include/asm-mips/pgalloc.h
@@ -11,6 +11,7 @@
11 11
12#include <linux/highmem.h> 12#include <linux/highmem.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/sched.h>
14 15
15static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, 16static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
16 pte_t *pte) 17 pte_t *pte)
diff --git a/include/asm-parisc/mmu_context.h b/include/asm-parisc/mmu_context.h
index bad690298f0c..85856c74ad1d 100644
--- a/include/asm-parisc/mmu_context.h
+++ b/include/asm-parisc/mmu_context.h
@@ -2,6 +2,7 @@
2#define __PARISC_MMU_CONTEXT_H 2#define __PARISC_MMU_CONTEXT_H
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/sched.h>
5#include <asm/atomic.h> 6#include <asm/atomic.h>
6#include <asm/pgalloc.h> 7#include <asm/pgalloc.h>
7#include <asm/pgtable.h> 8#include <asm/pgtable.h>
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h
index 3313da9ea00f..270cf309772b 100644
--- a/include/asm-parisc/tlbflush.h
+++ b/include/asm-parisc/tlbflush.h
@@ -4,6 +4,7 @@
4/* TLB flushing routines.... */ 4/* TLB flushing routines.... */
5 5
6#include <linux/mm.h> 6#include <linux/mm.h>
7#include <linux/sched.h>
7#include <asm/mmu_context.h> 8#include <asm/mmu_context.h>
8 9
9 10
diff --git a/include/asm-powerpc/mmu_context.h b/include/asm-powerpc/mmu_context.h
index c0d7795e3d25..40c9e5a13ff1 100644
--- a/include/asm-powerpc/mmu_context.h
+++ b/include/asm-powerpc/mmu_context.h
@@ -8,6 +8,7 @@
8 8
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/sched.h>
11#include <asm/mmu.h> 12#include <asm/mmu.h>
12#include <asm/cputable.h> 13#include <asm/cputable.h>
13#include <asm-generic/mm_hooks.h> 14#include <asm-generic/mm_hooks.h>
diff --git a/include/asm-powerpc/pgalloc-64.h b/include/asm-powerpc/pgalloc-64.h
index d9a3a8ca58a1..94d0294341d6 100644
--- a/include/asm-powerpc/pgalloc-64.h
+++ b/include/asm-powerpc/pgalloc-64.h
@@ -90,7 +90,8 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
90static inline struct page *pte_alloc_one(struct mm_struct *mm, 90static inline struct page *pte_alloc_one(struct mm_struct *mm,
91 unsigned long address) 91 unsigned long address)
92{ 92{
93 return virt_to_page(pte_alloc_one_kernel(mm, address)); 93 pte_t *pte = pte_alloc_one_kernel(mm, address);
94 return pte ? virt_to_page(pte) : NULL;
94} 95}
95 96
96static inline void pte_free_kernel(pte_t *pte) 97static inline void pte_free_kernel(pte_t *pte)
diff --git a/include/asm-powerpc/tlb.h b/include/asm-powerpc/tlb.h
index 0a17682663d8..66714042e438 100644
--- a/include/asm-powerpc/tlb.h
+++ b/include/asm-powerpc/tlb.h
@@ -38,6 +38,15 @@ extern void pte_free_finish(void);
38 38
39static inline void tlb_flush(struct mmu_gather *tlb) 39static inline void tlb_flush(struct mmu_gather *tlb)
40{ 40{
41 struct ppc64_tlb_batch *tlbbatch = &__get_cpu_var(ppc64_tlb_batch);
42
43 /* If there's a TLB batch pending, then we must flush it because the
44 * pages are going to be freed and we really don't want to have a CPU
45 * access a freed page because it has a stale TLB
46 */
47 if (tlbbatch->index)
48 __flush_tlb_pending(tlbbatch);
49
41 pte_free_finish(); 50 pte_free_finish();
42} 51}
43 52
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 5c6f00d62df8..790c1c557417 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -251,8 +251,12 @@
251#define __NR_getcpu 311 251#define __NR_getcpu 311
252#define __NR_epoll_pwait 312 252#define __NR_epoll_pwait 312
253#define __NR_utimes 313 253#define __NR_utimes 313
254 254/* Number 314 is reserved for new sys_fallocate */
255#define NR_syscalls 314 255#define __NR_utimensat 315
256#define __NR_signalfd 316
257#define __NR_timerfd 317
258#define __NR_eventfd 318
259#define NR_syscalls 319
256 260
257/* 261/*
258 * There are some system calls that are not present on 64 bit, some 262 * There are some system calls that are not present on 64 bit, some
@@ -346,6 +350,19 @@
346 350
347#ifdef __KERNEL__ 351#ifdef __KERNEL__
348 352
353#ifndef CONFIG_64BIT
354#define __IGNORE_select
355#else
356#define __IGNORE_time
357#endif
358
359/* Ignore NUMA system calls. Not wired up on s390. */
360#define __IGNORE_mbind
361#define __IGNORE_get_mempolicy
362#define __IGNORE_set_mempolicy
363#define __IGNORE_migrate_pages
364#define __IGNORE_move_pages
365
349#define __ARCH_WANT_IPC_PARSE_VERSION 366#define __ARCH_WANT_IPC_PARSE_VERSION
350#define __ARCH_WANT_OLD_READDIR 367#define __ARCH_WANT_OLD_READDIR
351#define __ARCH_WANT_SYS_ALARM 368#define __ARCH_WANT_SYS_ALARM
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h
index 86564e7a26ae..39f41fcd509d 100644
--- a/include/asm-sh/cpu-sh4/freq.h
+++ b/include/asm-sh/cpu-sh4/freq.h
@@ -24,6 +24,9 @@
24#define FRQMR1 0xffc80014 24#define FRQMR1 0xffc80014
25#else 25#else
26#define FRQCR 0xffc00000 26#define FRQCR 0xffc00000
27#define FRQCR_PSTBY 0x0200
28#define FRQCR_PLLEN 0x0400
29#define FRQCR_CKOEN 0x0800
27#endif 30#endif
28#define MIN_DIVISOR_NR 0 31#define MIN_DIVISOR_NR 0
29#define MAX_DIVISOR_NR 3 32#define MAX_DIVISOR_NR 3
diff --git a/include/asm-sh/dma.h b/include/asm-sh/dma.h
index faf3051cd429..6034d4a29e73 100644
--- a/include/asm-sh/dma.h
+++ b/include/asm-sh/dma.h
@@ -13,6 +13,7 @@
13 13
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/wait.h> 15#include <linux/wait.h>
16#include <linux/sched.h>
16#include <linux/sysdev.h> 17#include <linux/sysdev.h>
17#include <asm/cpu/dma.h> 18#include <asm/cpu/dma.h>
18 19
diff --git a/include/asm-sh/dreamcast/sysasic.h b/include/asm-sh/dreamcast/sysasic.h
index 7874e3dac736..f33426608a87 100644
--- a/include/asm-sh/dreamcast/sysasic.h
+++ b/include/asm-sh/dreamcast/sysasic.h
@@ -23,7 +23,7 @@
23 takes. 23 takes.
24*/ 24*/
25 25
26#define HW_EVENT_IRQ_BASE OFFCHIP_IRQ_BASE /* 48 */ 26#define HW_EVENT_IRQ_BASE 48
27 27
28/* IRQ 13 */ 28/* IRQ 13 */
29#define HW_EVENT_VSYNC (HW_EVENT_IRQ_BASE + 5) /* VSync */ 29#define HW_EVENT_VSYNC (HW_EVENT_IRQ_BASE + 5) /* VSync */
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index a0e55b09e4fd..aa80930ce8e4 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -116,13 +116,13 @@ void __raw_readsl(unsigned long addr, void *data, int longlen);
116 * redefined by userlevel programs. 116 * redefined by userlevel programs.
117 */ 117 */
118#ifdef __readb 118#ifdef __readb
119# define readb(a) ({ unsigned long r_ = __raw_readb(a); mb(); r_; }) 119# define readb(a) ({ unsigned int r_ = __raw_readb(a); mb(); r_; })
120#endif 120#endif
121#ifdef __raw_readw 121#ifdef __raw_readw
122# define readw(a) ({ unsigned long r_ = __raw_readw(a); mb(); r_; }) 122# define readw(a) ({ unsigned int r_ = __raw_readw(a); mb(); r_; })
123#endif 123#endif
124#ifdef __raw_readl 124#ifdef __raw_readl
125# define readl(a) ({ unsigned long r_ = __raw_readl(a); mb(); r_; }) 125# define readl(a) ({ unsigned int r_ = __raw_readl(a); mb(); r_; })
126#endif 126#endif
127 127
128#ifdef __raw_writeb 128#ifdef __raw_writeb
diff --git a/include/asm-sh/kdebug.h b/include/asm-sh/kdebug.h
index 16578b7c9da1..382cfc7deb73 100644
--- a/include/asm-sh/kdebug.h
+++ b/include/asm-sh/kdebug.h
@@ -6,10 +6,6 @@
6/* Grossly misnamed. */ 6/* Grossly misnamed. */
7enum die_val { 7enum die_val {
8 DIE_TRAP, 8 DIE_TRAP,
9 DIE_PAGE_FAULT,
10}; 9};
11 10
12int register_page_fault_notifier(struct notifier_block *nb);
13int unregister_page_fault_notifier(struct notifier_block *nb);
14
15#endif /* __ASM_SH_KDEBUG_H */ 11#endif /* __ASM_SH_KDEBUG_H */
diff --git a/include/asm-sh/landisk/gio.h b/include/asm-sh/landisk/gio.h
index 3fce4c451a46..35d7368b718a 100644
--- a/include/asm-sh/landisk/gio.h
+++ b/include/asm-sh/landisk/gio.h
@@ -29,16 +29,8 @@
29#define GIODRV_IOCGGIODATA4 _IOR(GIODRV_IOC_MAGIC, 6, unsigned long *) 29#define GIODRV_IOCGGIODATA4 _IOR(GIODRV_IOC_MAGIC, 6, unsigned long *)
30#define GIODRV_IOCSGIOSETADDR _IOW(GIODRV_IOC_MAGIC, 7, unsigned long *) 30#define GIODRV_IOCSGIOSETADDR _IOW(GIODRV_IOC_MAGIC, 7, unsigned long *)
31#define GIODRV_IOCHARDRESET _IO(GIODRV_IOC_MAGIC, 8) /* debugging tool */ 31#define GIODRV_IOCHARDRESET _IO(GIODRV_IOC_MAGIC, 8) /* debugging tool */
32
33#define GIODRV_IOCSGIO_LED _IOW(GIODRV_IOC_MAGIC, 9, unsigned long *)
34#define GIODRV_IOCGGIO_LED _IOR(GIODRV_IOC_MAGIC, 10, unsigned long *)
35#define GIODRV_IOCSGIO_BUZZER _IOW(GIODRV_IOC_MAGIC, 11, unsigned long *)
36#define GIODRV_IOCGGIO_LANDISK _IOR(GIODRV_IOC_MAGIC, 14, unsigned long *)
37#define GIODRV_IOCGGIO_BTN _IOR(GIODRV_IOC_MAGIC, 22, unsigned long *)
38#define GIODRV_IOCSGIO_BTNPID _IOW(GIODRV_IOC_MAGIC, 23, unsigned long *)
39#define GIODRV_IOCGGIO_BTNPID _IOR(GIODRV_IOC_MAGIC, 24, unsigned long *)
40
41#define GIODRV_IOC_MAXNR 8 32#define GIODRV_IOC_MAXNR 8
33
42#define GIO_READ 0x00000000 34#define GIO_READ 0x00000000
43#define GIO_WRITE 0x00000001 35#define GIO_WRITE 0x00000001
44 36
diff --git a/include/asm-sh/landisk/iodata_landisk.h b/include/asm-sh/landisk/iodata_landisk.h
index c74d3c73f377..6fb04ab38b9f 100644
--- a/include/asm-sh/landisk/iodata_landisk.h
+++ b/include/asm-sh/landisk/iodata_landisk.h
@@ -22,16 +22,6 @@
22/* 2003.10.31 I-O DATA NSD NWG add. for shutdown port clear */ 22/* 2003.10.31 I-O DATA NSD NWG add. for shutdown port clear */
23#define PA_PWRINT_CLR 0xb0000006 /* Shutdown Interrupt clear Register */ 23#define PA_PWRINT_CLR 0xb0000006 /* Shutdown Interrupt clear Register */
24 24
25#define PA_LCD_CLRDSP 0x00 /* LCD Clear Display Offset */
26#define PA_LCD_RTNHOME 0x00 /* LCD Return Home Offset */
27#define PA_LCD_ENTMODE 0x00 /* LCD Entry Mode Offset */
28#define PA_LCD_DSPCTL 0x00 /* LCD Display ON/OFF Control Offset */
29#define PA_LCD_FUNC 0x00 /* LCD Function Set Offset */
30#define PA_LCD_CGRAM 0x00 /* LCD Set CGRAM Address Offset */
31#define PA_LCD_DDRAM 0x00 /* LCD Set DDRAM Address Offset */
32#define PA_LCD_RDFLAG 0x01 /* LCD Read Busy Flag Offset */
33#define PA_LCD_WTDATA 0x02 /* LCD Write Datat to RAM Offset */
34#define PA_LCD_RDDATA 0x03 /* LCD Read Data from RAM Offset */
35#define PA_PIDE_OFFSET 0x40 /* CF IDE Offset */ 25#define PA_PIDE_OFFSET 0x40 /* CF IDE Offset */
36#define PA_SIDE_OFFSET 0x40 /* HDD IDE Offset */ 26#define PA_SIDE_OFFSET 0x40 /* HDD IDE Offset */
37 27
@@ -45,33 +35,6 @@
45#define IRQ_BUTTON 12 /* USL-5P Button IRQ */ 35#define IRQ_BUTTON 12 /* USL-5P Button IRQ */
46#define IRQ_FAULT 13 /* USL-5P Fault IRQ */ 36#define IRQ_FAULT 13 /* USL-5P Fault IRQ */
47 37
48#define SHUTDOWN_BTN_MAJOR 99 /* Shutdown button device major no. */
49
50#define SHUTDOWN_LOOP_CNT 5 /* Shutdown button Detection loop */
51#define SHUTDOWN_DELAY 200 /* Shutdown button delay value(ms) */
52
53
54/* added by kogiidena */
55/*
56 * landisk_ledparam
57 *
58 * led ------10 -6543210 -6543210 -6543210
59 * |000000..|0.......|0.......|U.......|
60 * | HARD |fastblik| blink | on |
61 *
62 * led0: power U:update flag
63 * led1: error
64 * led2: usb1
65 * led3: usb2
66 * led4: usb3
67 * led5: usb4
68 * led6: usb5
69 *
70 */
71extern int landisk_ledparam; /* from setup.c */
72extern int landisk_buzzerparam; /* from setup.c */
73extern int landisk_arch; /* from setup.c */
74
75#define __IO_PREFIX landisk 38#define __IO_PREFIX landisk
76#include <asm/io_generic.h> 39#include <asm/io_generic.h>
77 40
diff --git a/include/asm-sh/smp.h b/include/asm-sh/smp.h
index 71ecddf70db3..caa7b93f1bce 100644
--- a/include/asm-sh/smp.h
+++ b/include/asm-sh/smp.h
@@ -15,7 +15,7 @@
15 15
16#ifdef CONFIG_SMP 16#ifdef CONFIG_SMP
17 17
18#include <asm/spinlock.h> 18#include <linux/spinlock.h>
19#include <asm/atomic.h> 19#include <asm/atomic.h>
20#include <asm/current.h> 20#include <asm/current.h>
21 21
diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h
index 2586eef07d57..92f6e2008b2e 100644
--- a/include/asm-sh/spinlock.h
+++ b/include/asm-sh/spinlock.h
@@ -11,6 +11,7 @@
11#define __ASM_SH_SPINLOCK_H 11#define __ASM_SH_SPINLOCK_H
12 12
13#include <asm/atomic.h> 13#include <asm/atomic.h>
14#include <asm/spinlock_types.h>
14 15
15/* 16/*
16 * Your basic SMP spinlocks, allowing only a single CPU anywhere 17 * Your basic SMP spinlocks, allowing only a single CPU anywhere
@@ -42,7 +43,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
42 43
43static inline void __raw_spin_unlock(raw_spinlock_t *lock) 44static inline void __raw_spin_unlock(raw_spinlock_t *lock)
44{ 45{
45 assert_spin_locked(lock); 46 //assert_spin_locked(lock);
46 47
47 lock->lock = 0; 48 lock->lock = 0;
48} 49}
@@ -88,6 +89,11 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
88 __raw_spin_unlock(&rw->lock); 89 __raw_spin_unlock(&rw->lock);
89} 90}
90 91
92static inline int __raw_write_can_lock(raw_rwlock_t *rw)
93{
94 return (atomic_read(&rw->counter) == RW_LOCK_BIAS);
95}
96
91static inline int __raw_read_trylock(raw_rwlock_t *lock) 97static inline int __raw_read_trylock(raw_rwlock_t *lock)
92{ 98{
93 atomic_t *count = (atomic_t*)lock; 99 atomic_t *count = (atomic_t*)lock;
diff --git a/include/asm-sh/spinlock_types.h b/include/asm-sh/spinlock_types.h
index 8c41b6c3aac8..5c58134f2c4e 100644
--- a/include/asm-sh/spinlock_types.h
+++ b/include/asm-sh/spinlock_types.h
@@ -9,7 +9,9 @@ typedef struct {
9 volatile unsigned long lock; 9 volatile unsigned long lock;
10} raw_spinlock_t; 10} raw_spinlock_t;
11 11
12#define __SPIN_LOCK_UNLOCKED { 0 } 12#define __RAW_SPIN_LOCK_UNLOCKED { 1 }
13
14#include <asm/atomic.h>
13 15
14typedef struct { 16typedef struct {
15 raw_spinlock_t lock; 17 raw_spinlock_t lock;
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index af71e379a5ee..77bcb09d6ac8 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -329,8 +329,11 @@
329#define __NR_getcpu 318 329#define __NR_getcpu 318
330#define __NR_epoll_pwait 319 330#define __NR_epoll_pwait 319
331#define __NR_utimensat 320 331#define __NR_utimensat 320
332#define __NR_signalfd 321
333#define __NR_timerfd 322
334#define __NR_eventfd 323
332 335
333#define NR_syscalls 321 336#define NR_syscalls 324
334 337
335#ifdef __KERNEL__ 338#ifdef __KERNEL__
336 339
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h
index 731fa56e0c37..bdca5416d8b0 100644
--- a/include/asm-sparc/atomic.h
+++ b/include/asm-sparc/atomic.h
@@ -2,6 +2,7 @@
2 * 2 *
3 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
4 * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com.au) 4 * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com.au)
5 * Copyright (C) 2007 Kyle McMartin (kyle@parisc-linux.org)
5 * 6 *
6 * Additions by Keith M Wesolowski (wesolows@foobazco.org) based 7 * Additions by Keith M Wesolowski (wesolows@foobazco.org) based
7 * on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>. 8 * on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>.
@@ -10,11 +11,48 @@
10#ifndef __ARCH_SPARC_ATOMIC__ 11#ifndef __ARCH_SPARC_ATOMIC__
11#define __ARCH_SPARC_ATOMIC__ 12#define __ARCH_SPARC_ATOMIC__
12 13
14#include <linux/types.h>
13 15
14typedef struct { volatile int counter; } atomic_t; 16typedef struct { volatile int counter; } atomic_t;
15 17
16#ifdef __KERNEL__ 18#ifdef __KERNEL__
17 19
20/* Emulate cmpxchg() the same way we emulate atomics,
21 * by hashing the object address and indexing into an array
22 * of spinlocks to get a bit of performance...
23 *
24 * See arch/sparc/lib/atomic32.c for implementation.
25 *
26 * Cribbed from <asm-parisc/atomic.h>
27 */
28#define __HAVE_ARCH_CMPXCHG 1
29
30/* bug catcher for when unsupported size is used - won't link */
31extern void __cmpxchg_called_with_bad_pointer(void);
32/* we only need to support cmpxchg of a u32 on sparc */
33extern unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_);
34
35/* don't worry...optimizer will get rid of most of this */
36static __inline__ unsigned long
37__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
38{
39 switch(size) {
40 case 4:
41 return __cmpxchg_u32((u32 *)ptr, (u32)old, (u32)new_);
42 default:
43 __cmpxchg_called_with_bad_pointer();
44 break;
45 }
46 return old;
47}
48
49#define cmpxchg(ptr,o,n) ({ \
50 __typeof__(*(ptr)) _o_ = (o); \
51 __typeof__(*(ptr)) _n_ = (n); \
52 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
53 (unsigned long)_n_, sizeof(*(ptr))); \
54})
55
18#define ATOMIC_INIT(i) { (i) } 56#define ATOMIC_INIT(i) { (i) }
19 57
20extern int __atomic_add_return(int, atomic_t *); 58extern int __atomic_add_return(int, atomic_t *);
diff --git a/include/asm-sparc64/bugs.h b/include/asm-sparc64/bugs.h
index 120422fdb02f..bf39d86c0c9e 100644
--- a/include/asm-sparc64/bugs.h
+++ b/include/asm-sparc64/bugs.h
@@ -1,9 +1,8 @@
1/* $Id: bugs.h,v 1.1 1996/12/26 13:25:20 davem Exp $ 1/* bugs.h: Sparc64 probes for various bugs.
2 * include/asm-sparc64/bugs.h: Sparc probes for various bugs.
3 * 2 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net)
5 */ 4 */
6 5#include <asm/sstate.h>
7 6
8extern unsigned long loops_per_jiffy; 7extern unsigned long loops_per_jiffy;
9 8
@@ -12,4 +11,5 @@ static void __init check_bugs(void)
12#ifndef CONFIG_SMP 11#ifndef CONFIG_SMP
13 cpu_data(0).udelay_val = loops_per_jiffy; 12 cpu_data(0).udelay_val = loops_per_jiffy;
14#endif 13#endif
14 sstate_running();
15} 15}
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h
index e89922d6718c..03c385de7619 100644
--- a/include/asm-sparc64/cpudata.h
+++ b/include/asm-sparc64/cpudata.h
@@ -17,11 +17,11 @@
17typedef struct { 17typedef struct {
18 /* Dcache line 1 */ 18 /* Dcache line 1 */
19 unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ 19 unsigned int __softirq_pending; /* must be 1st, see rtrap.S */
20 unsigned int __pad0_1; 20 unsigned int __pad0;
21 unsigned int __pad0_2;
22 unsigned int __pad1;
23 unsigned long clock_tick; /* %tick's per second */ 21 unsigned long clock_tick; /* %tick's per second */
24 unsigned long udelay_val; 22 unsigned long udelay_val;
23 unsigned int __pad1;
24 unsigned int __pad2;
25 25
26 /* Dcache line 2, rarely used */ 26 /* Dcache line 2, rarely used */
27 unsigned int dcache_size; 27 unsigned int dcache_size;
@@ -30,8 +30,8 @@ typedef struct {
30 unsigned int icache_line_size; 30 unsigned int icache_line_size;
31 unsigned int ecache_size; 31 unsigned int ecache_size;
32 unsigned int ecache_line_size; 32 unsigned int ecache_line_size;
33 int core_id;
33 unsigned int __pad3; 34 unsigned int __pad3;
34 unsigned int __pad4;
35} cpuinfo_sparc; 35} cpuinfo_sparc;
36 36
37DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data); 37DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
@@ -76,12 +76,18 @@ struct trap_per_cpu {
76 76
77/* Dcache line 8: IRQ work list, and keep trap_block a power-of-2 in size. */ 77/* Dcache line 8: IRQ work list, and keep trap_block a power-of-2 in size. */
78 unsigned int irq_worklist; 78 unsigned int irq_worklist;
79 unsigned int __pad1; 79 unsigned int cpu_mondo_qmask;
80 unsigned long __pad2[3]; 80 unsigned int dev_mondo_qmask;
81 unsigned int resum_qmask;
82 unsigned int nonresum_qmask;
83 unsigned int __pad2[3];
81} __attribute__((aligned(64))); 84} __attribute__((aligned(64)));
82extern struct trap_per_cpu trap_block[NR_CPUS]; 85extern struct trap_per_cpu trap_block[NR_CPUS];
83extern void init_cur_cpu_trap(struct thread_info *); 86extern void init_cur_cpu_trap(struct thread_info *);
84extern void setup_tba(void); 87extern void setup_tba(void);
88extern int ncpus_probed;
89
90extern unsigned long real_hard_smp_processor_id(void);
85 91
86struct cpuid_patch_entry { 92struct cpuid_patch_entry {
87 unsigned int addr; 93 unsigned int addr;
@@ -122,6 +128,10 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
122#define TRAP_PER_CPU_TSB_HUGE 0xd0 128#define TRAP_PER_CPU_TSB_HUGE 0xd0
123#define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8 129#define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8
124#define TRAP_PER_CPU_IRQ_WORKLIST 0xe0 130#define TRAP_PER_CPU_IRQ_WORKLIST 0xe0
131#define TRAP_PER_CPU_CPU_MONDO_QMASK 0xe4
132#define TRAP_PER_CPU_DEV_MONDO_QMASK 0xe8
133#define TRAP_PER_CPU_RESUM_QMASK 0xec
134#define TRAP_PER_CPU_NONRESUM_QMASK 0xf0
125 135
126#define TRAP_BLOCK_SZ_SHIFT 8 136#define TRAP_BLOCK_SZ_SHIFT 8
127 137
@@ -192,7 +202,7 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
192 * the calculations done by the macro mid-stream. 202 * the calculations done by the macro mid-stream.
193 */ 203 */
194#define LOAD_PER_CPU_BASE(DEST, THR, REG1, REG2, REG3) \ 204#define LOAD_PER_CPU_BASE(DEST, THR, REG1, REG2, REG3) \
195 ldub [THR + TI_CPU], REG1; \ 205 lduh [THR + TI_CPU], REG1; \
196 sethi %hi(__per_cpu_shift), REG3; \ 206 sethi %hi(__per_cpu_shift), REG3; \
197 sethi %hi(__per_cpu_base), REG2; \ 207 sethi %hi(__per_cpu_base), REG2; \
198 ldx [REG3 + %lo(__per_cpu_shift)], REG3; \ 208 ldx [REG3 + %lo(__per_cpu_shift)], REG3; \
diff --git a/include/asm-sparc64/hypervisor.h b/include/asm-sparc64/hypervisor.h
index a5558c87556d..4a43075a0619 100644
--- a/include/asm-sparc64/hypervisor.h
+++ b/include/asm-sparc64/hypervisor.h
@@ -73,6 +73,8 @@
73#define HV_ENOTSUPPORTED 13 /* Function not supported */ 73#define HV_ENOTSUPPORTED 13 /* Function not supported */
74#define HV_ENOMAP 14 /* No mapping found */ 74#define HV_ENOMAP 14 /* No mapping found */
75#define HV_ETOOMANY 15 /* Too many items specified */ 75#define HV_ETOOMANY 15 /* Too many items specified */
76#define HV_ECHANNEL 16 /* Invalid LDC channel */
77#define HV_EBUSY 17 /* Resource busy */
76 78
77/* mach_exit() 79/* mach_exit()
78 * TRAP: HV_FAST_TRAP 80 * TRAP: HV_FAST_TRAP
@@ -95,6 +97,10 @@
95 */ 97 */
96#define HV_FAST_MACH_EXIT 0x00 98#define HV_FAST_MACH_EXIT 0x00
97 99
100#ifndef __ASSEMBLY__
101extern void sun4v_mach_exit(unsigned long exit_core);
102#endif
103
98/* Domain services. */ 104/* Domain services. */
99 105
100/* mach_desc() 106/* mach_desc()
@@ -120,7 +126,13 @@
120 */ 126 */
121#define HV_FAST_MACH_DESC 0x01 127#define HV_FAST_MACH_DESC 0x01
122 128
123/* mach_exit() 129#ifndef __ASSEMBLY__
130extern unsigned long sun4v_mach_desc(unsigned long buffer_pa,
131 unsigned long buf_len,
132 unsigned long *real_buf_len);
133#endif
134
135/* mach_sir()
124 * TRAP: HV_FAST_TRAP 136 * TRAP: HV_FAST_TRAP
125 * FUNCTION: HV_FAST_MACH_SIR 137 * FUNCTION: HV_FAST_MACH_SIR
126 * ERRORS: This service does not return. 138 * ERRORS: This service does not return.
@@ -135,53 +147,66 @@
135 */ 147 */
136#define HV_FAST_MACH_SIR 0x02 148#define HV_FAST_MACH_SIR 0x02
137 149
138/* mach_set_soft_state() 150#ifndef __ASSEMBLY__
151extern void sun4v_mach_sir(void);
152#endif
153
154/* mach_set_watchdog()
139 * TRAP: HV_FAST_TRAP 155 * TRAP: HV_FAST_TRAP
140 * FUNCTION: HV_FAST_MACH_SET_SOFT_STATE 156 * FUNCTION: HV_FAST_MACH_SET_WATCHDOG
141 * ARG0: software state 157 * ARG0: timeout in milliseconds
142 * ARG1: software state description pointer
143 * RET0: status 158 * RET0: status
144 * ERRORS: EINVAL software state not valid or software state 159 * RET1: time remaining in milliseconds
145 * description is not NULL terminated
146 * ENORADDR software state description pointer is not a
147 * valid real address
148 * EBADALIGNED software state description is not correctly
149 * aligned
150 * 160 *
151 * This allows the guest to report it's soft state to the hypervisor. There 161 * A guest uses this API to set a watchdog timer. Once the gues has set
152 * are two primary components to this state. The first part states whether 162 * the timer, it must call the timer service again either to disable or
153 * the guest software is running or not. The second containts optional 163 * postpone the expiration. If the timer expires before being reset or
154 * details specific to the software. 164 * disabled, then the hypervisor take a platform specific action leading
165 * to guest termination within a bounded time period. The platform action
166 * may include recovery actions such as reporting the expiration to a
167 * Service Processor, and/or automatically restarting the gues.
155 * 168 *
156 * The software state argument is defined below in HV_SOFT_STATE_*, and 169 * The 'timeout' parameter is specified in milliseconds, however the
157 * indicates whether the guest is operating normally or in a transitional 170 * implementated granularity is given by the 'watchdog-resolution'
158 * state. 171 * property in the 'platform' node of the guest's machine description.
172 * The largest allowed timeout value is specified by the
173 * 'watchdog-max-timeout' property of the 'platform' node.
159 * 174 *
160 * The software state description argument is a real address of a data buffer 175 * If the 'timeout' argument is not zero, the watchdog timer is set to
161 * of size 32-bytes aligned on a 32-byte boundary. It is treated as a NULL 176 * expire after a minimum of 'timeout' milliseconds.
162 * terminated 7-bit ASCII string of up to 31 characters not including the
163 * NULL termination.
164 */
165#define HV_FAST_MACH_SET_SOFT_STATE 0x03
166#define HV_SOFT_STATE_NORMAL 0x01
167#define HV_SOFT_STATE_TRANSITION 0x02
168
169/* mach_get_soft_state()
170 * TRAP: HV_FAST_TRAP
171 * FUNCTION: HV_FAST_MACH_GET_SOFT_STATE
172 * ARG0: software state description pointer
173 * RET0: status
174 * RET1: software state
175 * ERRORS: ENORADDR software state description pointer is not a
176 * valid real address
177 * EBADALIGNED software state description is not correctly
178 * aligned
179 * 177 *
180 * Retrieve the current value of the guest's software state. The rules 178 * If the 'timeout' argument is zero, the watchdog timer is disabled.
181 * for the software state pointer are the same as for mach_set_soft_state() 179 *
182 * above. 180 * If the 'timeout' value exceeds the value of the 'max-watchdog-timeout'
181 * property, the hypervisor leaves the watchdog timer state unchanged,
182 * and returns a status of EINVAL.
183 *
184 * The 'time remaining' return value is valid regardless of whether the
185 * return status is EOK or EINVAL. A non-zero return value indicates the
186 * number of milliseconds that were remaining until the timer was to expire.
187 * If less than one millisecond remains, the return value is '1'. If the
188 * watchdog timer was disabled at the time of the call, the return value is
189 * zero.
190 *
191 * If the hypervisor cannot support the exact timeout value requested, but
192 * can support a larger timeout value, the hypervisor may round the actual
193 * timeout to a value larger than the requested timeout, consequently the
194 * 'time remaining' return value may be larger than the previously requested
195 * timeout value.
196 *
197 * Any guest OS debugger should be aware that the watchdog service may be in
198 * use. Consequently, it is recommended that the watchdog service is
199 * disabled upon debugger entry (e.g. reaching a breakpoint), and then
200 * re-enabled upon returning to normal execution. The API has been designed
201 * with this in mind, and the 'time remaining' result of the disable call may
202 * be used directly as the timeout argument of the re-enable call.
183 */ 203 */
184#define HV_FAST_MACH_GET_SOFT_STATE 0x04 204#define HV_FAST_MACH_SET_WATCHDOG 0x05
205
206#ifndef __ASSEMBLY__
207extern unsigned long sun4v_mach_set_watchdog(unsigned long timeout,
208 unsigned long *orig_timeout);
209#endif
185 210
186/* CPU services. 211/* CPU services.
187 * 212 *
@@ -206,8 +231,8 @@
206 * FUNCTION: HV_FAST_CPU_START 231 * FUNCTION: HV_FAST_CPU_START
207 * ARG0: CPU ID 232 * ARG0: CPU ID
208 * ARG1: PC 233 * ARG1: PC
209 * ARG1: RTBA 234 * ARG2: RTBA
210 * ARG1: target ARG0 235 * ARG3: target ARG0
211 * RET0: status 236 * RET0: status
212 * ERRORS: ENOCPU Invalid CPU ID 237 * ERRORS: ENOCPU Invalid CPU ID
213 * EINVAL Target CPU ID is not in the stopped state 238 * EINVAL Target CPU ID is not in the stopped state
@@ -224,6 +249,13 @@
224 */ 249 */
225#define HV_FAST_CPU_START 0x10 250#define HV_FAST_CPU_START 0x10
226 251
252#ifndef __ASSEMBLY__
253extern unsigned long sun4v_cpu_start(unsigned long cpuid,
254 unsigned long pc,
255 unsigned long rtba,
256 unsigned long arg0);
257#endif
258
227/* cpu_stop() 259/* cpu_stop()
228 * TRAP: HV_FAST_TRAP 260 * TRAP: HV_FAST_TRAP
229 * FUNCTION: HV_FAST_CPU_STOP 261 * FUNCTION: HV_FAST_CPU_STOP
@@ -245,6 +277,10 @@
245 */ 277 */
246#define HV_FAST_CPU_STOP 0x11 278#define HV_FAST_CPU_STOP 0x11
247 279
280#ifndef __ASSEMBLY__
281extern unsigned long sun4v_cpu_stop(unsigned long cpuid);
282#endif
283
248/* cpu_yield() 284/* cpu_yield()
249 * TRAP: HV_FAST_TRAP 285 * TRAP: HV_FAST_TRAP
250 * FUNCTION: HV_FAST_CPU_YIELD 286 * FUNCTION: HV_FAST_CPU_YIELD
@@ -588,6 +624,11 @@ struct hv_fault_status {
588 */ 624 */
589#define HV_FAST_MMU_TSB_CTX0 0x20 625#define HV_FAST_MMU_TSB_CTX0 0x20
590 626
627#ifndef __ASSEMBLY__
628extern unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions,
629 unsigned long tsb_desc_ra);
630#endif
631
591/* mmu_tsb_ctxnon0() 632/* mmu_tsb_ctxnon0()
592 * TRAP: HV_FAST_TRAP 633 * TRAP: HV_FAST_TRAP
593 * FUNCTION: HV_FAST_MMU_TSB_CTXNON0 634 * FUNCTION: HV_FAST_MMU_TSB_CTXNON0
@@ -694,6 +735,13 @@ struct hv_fault_status {
694 */ 735 */
695#define HV_FAST_MMU_MAP_PERM_ADDR 0x25 736#define HV_FAST_MMU_MAP_PERM_ADDR 0x25
696 737
738#ifndef __ASSEMBLY__
739extern unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr,
740 unsigned long set_to_zero,
741 unsigned long tte,
742 unsigned long flags);
743#endif
744
697/* mmu_fault_area_conf() 745/* mmu_fault_area_conf()
698 * TRAP: HV_FAST_TRAP 746 * TRAP: HV_FAST_TRAP
699 * FUNCTION: HV_FAST_MMU_FAULT_AREA_CONF 747 * FUNCTION: HV_FAST_MMU_FAULT_AREA_CONF
@@ -892,6 +940,10 @@ struct hv_fault_status {
892 */ 940 */
893#define HV_FAST_TOD_GET 0x50 941#define HV_FAST_TOD_GET 0x50
894 942
943#ifndef __ASSEMBLY__
944extern unsigned long sun4v_tod_get(unsigned long *time);
945#endif
946
895/* tod_set() 947/* tod_set()
896 * TRAP: HV_FAST_TRAP 948 * TRAP: HV_FAST_TRAP
897 * FUNCTION: HV_FAST_TOD_SET 949 * FUNCTION: HV_FAST_TOD_SET
@@ -905,6 +957,10 @@ struct hv_fault_status {
905 */ 957 */
906#define HV_FAST_TOD_SET 0x51 958#define HV_FAST_TOD_SET 0x51
907 959
960#ifndef __ASSEMBLY__
961extern unsigned long sun4v_tod_set(unsigned long time);
962#endif
963
908/* Console services */ 964/* Console services */
909 965
910/* con_getchar() 966/* con_getchar()
@@ -988,6 +1044,133 @@ extern unsigned long sun4v_con_write(unsigned long buffer,
988 unsigned long *bytes_written); 1044 unsigned long *bytes_written);
989#endif 1045#endif
990 1046
1047/* mach_set_soft_state()
1048 * TRAP: HV_FAST_TRAP
1049 * FUNCTION: HV_FAST_MACH_SET_SOFT_STATE
1050 * ARG0: software state
1051 * ARG1: software state description pointer
1052 * RET0: status
1053 * ERRORS: EINVAL software state not valid or software state
1054 * description is not NULL terminated
1055 * ENORADDR software state description pointer is not a
1056 * valid real address
1057 * EBADALIGNED software state description is not correctly
1058 * aligned
1059 *
1060 * This allows the guest to report it's soft state to the hypervisor. There
1061 * are two primary components to this state. The first part states whether
1062 * the guest software is running or not. The second containts optional
1063 * details specific to the software.
1064 *
1065 * The software state argument is defined below in HV_SOFT_STATE_*, and
1066 * indicates whether the guest is operating normally or in a transitional
1067 * state.
1068 *
1069 * The software state description argument is a real address of a data buffer
1070 * of size 32-bytes aligned on a 32-byte boundary. It is treated as a NULL
1071 * terminated 7-bit ASCII string of up to 31 characters not including the
1072 * NULL termination.
1073 */
1074#define HV_FAST_MACH_SET_SOFT_STATE 0x70
1075#define HV_SOFT_STATE_NORMAL 0x01
1076#define HV_SOFT_STATE_TRANSITION 0x02
1077
1078#ifndef __ASSEMBLY__
1079extern unsigned long sun4v_mach_set_soft_state(unsigned long soft_state,
1080 unsigned long msg_string_ra);
1081#endif
1082
1083/* mach_get_soft_state()
1084 * TRAP: HV_FAST_TRAP
1085 * FUNCTION: HV_FAST_MACH_GET_SOFT_STATE
1086 * ARG0: software state description pointer
1087 * RET0: status
1088 * RET1: software state
1089 * ERRORS: ENORADDR software state description pointer is not a
1090 * valid real address
1091 * EBADALIGNED software state description is not correctly
1092 * aligned
1093 *
1094 * Retrieve the current value of the guest's software state. The rules
1095 * for the software state pointer are the same as for mach_set_soft_state()
1096 * above.
1097 */
1098#define HV_FAST_MACH_GET_SOFT_STATE 0x71
1099
1100/* svc_send()
1101 * TRAP: HV_FAST_TRAP
1102 * FUNCTION: HV_FAST_SVC_SEND
1103 * ARG0: service ID
1104 * ARG1: buffer real address
1105 * ARG2: buffer size
1106 * RET0: STATUS
1107 * RET1: sent_bytes
1108 *
1109 * Be careful, all output registers are clobbered by this operation,
1110 * so for example it is not possible to save away a value in %o4
1111 * across the trap.
1112 */
1113#define HV_FAST_SVC_SEND 0x80
1114
1115/* svc_recv()
1116 * TRAP: HV_FAST_TRAP
1117 * FUNCTION: HV_FAST_SVC_RECV
1118 * ARG0: service ID
1119 * ARG1: buffer real address
1120 * ARG2: buffer size
1121 * RET0: STATUS
1122 * RET1: recv_bytes
1123 *
1124 * Be careful, all output registers are clobbered by this operation,
1125 * so for example it is not possible to save away a value in %o4
1126 * across the trap.
1127 */
1128#define HV_FAST_SVC_RECV 0x81
1129
1130/* svc_getstatus()
1131 * TRAP: HV_FAST_TRAP
1132 * FUNCTION: HV_FAST_SVC_GETSTATUS
1133 * ARG0: service ID
1134 * RET0: STATUS
1135 * RET1: status bits
1136 */
1137#define HV_FAST_SVC_GETSTATUS 0x82
1138
1139/* svc_setstatus()
1140 * TRAP: HV_FAST_TRAP
1141 * FUNCTION: HV_FAST_SVC_SETSTATUS
1142 * ARG0: service ID
1143 * ARG1: bits to set
1144 * RET0: STATUS
1145 */
1146#define HV_FAST_SVC_SETSTATUS 0x83
1147
1148/* svc_clrstatus()
1149 * TRAP: HV_FAST_TRAP
1150 * FUNCTION: HV_FAST_SVC_CLRSTATUS
1151 * ARG0: service ID
1152 * ARG1: bits to clear
1153 * RET0: STATUS
1154 */
1155#define HV_FAST_SVC_CLRSTATUS 0x84
1156
1157#ifndef __ASSEMBLY__
1158extern unsigned long sun4v_svc_send(unsigned long svc_id,
1159 unsigned long buffer,
1160 unsigned long buffer_size,
1161 unsigned long *sent_bytes);
1162extern unsigned long sun4v_svc_recv(unsigned long svc_id,
1163 unsigned long buffer,
1164 unsigned long buffer_size,
1165 unsigned long *recv_bytes);
1166extern unsigned long sun4v_svc_getstatus(unsigned long svc_id,
1167 unsigned long *status_bits);
1168extern unsigned long sun4v_svc_setstatus(unsigned long svc_id,
1169 unsigned long status_bits);
1170extern unsigned long sun4v_svc_clrstatus(unsigned long svc_id,
1171 unsigned long status_bits);
1172#endif
1173
991/* Trap trace services. 1174/* Trap trace services.
992 * 1175 *
993 * The hypervisor provides a trap tracing capability for privileged 1176 * The hypervisor provides a trap tracing capability for privileged
@@ -1379,6 +1562,113 @@ extern unsigned long sun4v_intr_gettarget(unsigned long sysino);
1379extern unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid); 1562extern unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid);
1380#endif 1563#endif
1381 1564
1565/* vintr_get_cookie()
1566 * TRAP: HV_FAST_TRAP
1567 * FUNCTION: HV_FAST_VINTR_GET_COOKIE
1568 * ARG0: device handle
1569 * ARG1: device ino
1570 * RET0: status
1571 * RET1: cookie
1572 */
1573#define HV_FAST_VINTR_GET_COOKIE 0xa7
1574
1575/* vintr_set_cookie()
1576 * TRAP: HV_FAST_TRAP
1577 * FUNCTION: HV_FAST_VINTR_SET_COOKIE
1578 * ARG0: device handle
1579 * ARG1: device ino
1580 * ARG2: cookie
1581 * RET0: status
1582 */
1583#define HV_FAST_VINTR_SET_COOKIE 0xa8
1584
1585/* vintr_get_valid()
1586 * TRAP: HV_FAST_TRAP
1587 * FUNCTION: HV_FAST_VINTR_GET_VALID
1588 * ARG0: device handle
1589 * ARG1: device ino
1590 * RET0: status
1591 * RET1: valid state
1592 */
1593#define HV_FAST_VINTR_GET_VALID 0xa9
1594
1595/* vintr_set_valid()
1596 * TRAP: HV_FAST_TRAP
1597 * FUNCTION: HV_FAST_VINTR_SET_VALID
1598 * ARG0: device handle
1599 * ARG1: device ino
1600 * ARG2: valid state
1601 * RET0: status
1602 */
1603#define HV_FAST_VINTR_SET_VALID 0xaa
1604
1605/* vintr_get_state()
1606 * TRAP: HV_FAST_TRAP
1607 * FUNCTION: HV_FAST_VINTR_GET_STATE
1608 * ARG0: device handle
1609 * ARG1: device ino
1610 * RET0: status
1611 * RET1: state
1612 */
1613#define HV_FAST_VINTR_GET_STATE 0xab
1614
1615/* vintr_set_state()
1616 * TRAP: HV_FAST_TRAP
1617 * FUNCTION: HV_FAST_VINTR_SET_STATE
1618 * ARG0: device handle
1619 * ARG1: device ino
1620 * ARG2: state
1621 * RET0: status
1622 */
1623#define HV_FAST_VINTR_SET_STATE 0xac
1624
1625/* vintr_get_target()
1626 * TRAP: HV_FAST_TRAP
1627 * FUNCTION: HV_FAST_VINTR_GET_TARGET
1628 * ARG0: device handle
1629 * ARG1: device ino
1630 * RET0: status
1631 * RET1: cpuid
1632 */
1633#define HV_FAST_VINTR_GET_TARGET 0xad
1634
1635/* vintr_set_target()
1636 * TRAP: HV_FAST_TRAP
1637 * FUNCTION: HV_FAST_VINTR_SET_TARGET
1638 * ARG0: device handle
1639 * ARG1: device ino
1640 * ARG2: cpuid
1641 * RET0: status
1642 */
1643#define HV_FAST_VINTR_SET_TARGET 0xae
1644
1645#ifndef __ASSEMBLY__
1646extern unsigned long sun4v_vintr_get_cookie(unsigned long dev_handle,
1647 unsigned long dev_ino,
1648 unsigned long *cookie);
1649extern unsigned long sun4v_vintr_set_cookie(unsigned long dev_handle,
1650 unsigned long dev_ino,
1651 unsigned long cookie);
1652extern unsigned long sun4v_vintr_get_valid(unsigned long dev_handle,
1653 unsigned long dev_ino,
1654 unsigned long *valid);
1655extern unsigned long sun4v_vintr_set_valid(unsigned long dev_handle,
1656 unsigned long dev_ino,
1657 unsigned long valid);
1658extern unsigned long sun4v_vintr_get_state(unsigned long dev_handle,
1659 unsigned long dev_ino,
1660 unsigned long *state);
1661extern unsigned long sun4v_vintr_set_state(unsigned long dev_handle,
1662 unsigned long dev_ino,
1663 unsigned long state);
1664extern unsigned long sun4v_vintr_get_target(unsigned long dev_handle,
1665 unsigned long dev_ino,
1666 unsigned long *cpuid);
1667extern unsigned long sun4v_vintr_set_target(unsigned long dev_handle,
1668 unsigned long dev_ino,
1669 unsigned long cpuid);
1670#endif
1671
1382/* PCI IO services. 1672/* PCI IO services.
1383 * 1673 *
1384 * See the terminology descriptions in the device interrupt services 1674 * See the terminology descriptions in the device interrupt services
@@ -2037,6 +2327,346 @@ extern unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cp
2037 */ 2327 */
2038#define HV_FAST_PCI_MSG_SETVALID 0xd3 2328#define HV_FAST_PCI_MSG_SETVALID 0xd3
2039 2329
2330/* Logical Domain Channel services. */
2331
2332#define LDC_CHANNEL_DOWN 0
2333#define LDC_CHANNEL_UP 1
2334#define LDC_CHANNEL_RESETTING 2
2335
2336/* ldc_tx_qconf()
2337 * TRAP: HV_FAST_TRAP
2338 * FUNCTION: HV_FAST_LDC_TX_QCONF
2339 * ARG0: channel ID
2340 * ARG1: real address base of queue
2341 * ARG2: num entries in queue
2342 * RET0: status
2343 *
2344 * Configure transmit queue for the LDC endpoint specified by the
2345 * given channel ID, to be placed at the given real address, and
2346 * be of the given num entries. Num entries must be a power of two.
2347 * The real address base of the queue must be aligned on the queue
2348 * size. Each queue entry is 64-bytes, so for example, a 32 entry
2349 * queue must be aligned on a 2048 byte real address boundary.
2350 *
2351 * Upon configuration of a valid transmit queue the head and tail
2352 * pointers are set to a hypervisor specific identical value indicating
2353 * that the queue initially is empty.
2354 *
2355 * The endpoint's transmit queue is un-configured if num entries is zero.
2356 *
2357 * The maximum number of entries for each queue for a specific cpu may be
2358 * determined from the machine description. A transmit queue may be
2359 * specified even in the event that the LDC is down (peer endpoint has no
2360 * receive queue specified). Transmission will begin as soon as the peer
2361 * endpoint defines a receive queue.
2362 *
2363 * It is recommended that a guest wait for a transmit queue to empty prior
2364 * to reconfiguring it, or un-configuring it. Re or un-configuring of a
2365 * non-empty transmit queue behaves exactly as defined above, however it
2366 * is undefined as to how many of the pending entries in the original queue
2367 * will be delivered prior to the re-configuration taking effect.
2368 * Furthermore, as the queue configuration causes a reset of the head and
2369 * tail pointers there is no way for a guest to determine how many entries
2370 * have been sent after the configuration operation.
2371 */
2372#define HV_FAST_LDC_TX_QCONF 0xe0
2373
2374/* ldc_tx_qinfo()
2375 * TRAP: HV_FAST_TRAP
2376 * FUNCTION: HV_FAST_LDC_TX_QINFO
2377 * ARG0: channel ID
2378 * RET0: status
2379 * RET1: real address base of queue
2380 * RET2: num entries in queue
2381 *
2382 * Return the configuration info for the transmit queue of LDC endpoint
2383 * defined by the given channel ID. The real address is the currently
2384 * defined real address base of the defined queue, and num entries is the
2385 * size of the queue in terms of number of entries.
2386 *
2387 * If the specified channel ID is a valid endpoint number, but no transmit
2388 * queue has been defined this service will return success, but with num
2389 * entries set to zero and the real address will have an undefined value.
2390 */
2391#define HV_FAST_LDC_TX_QINFO 0xe1
2392
2393/* ldc_tx_get_state()
2394 * TRAP: HV_FAST_TRAP
2395 * FUNCTION: HV_FAST_LDC_TX_GET_STATE
2396 * ARG0: channel ID
2397 * RET0: status
2398 * RET1: head offset
2399 * RET2: tail offset
2400 * RET3: channel state
2401 *
2402 * Return the transmit state, and the head and tail queue pointers, for
2403 * the transmit queue of the LDC endpoint defined by the given channel ID.
2404 * The head and tail values are the byte offset of the head and tail
2405 * positions of the transmit queue for the specified endpoint.
2406 */
2407#define HV_FAST_LDC_TX_GET_STATE 0xe2
2408
2409/* ldc_tx_set_qtail()
2410 * TRAP: HV_FAST_TRAP
2411 * FUNCTION: HV_FAST_LDC_TX_SET_QTAIL
2412 * ARG0: channel ID
2413 * ARG1: tail offset
2414 * RET0: status
2415 *
2416 * Update the tail pointer for the transmit queue associated with the LDC
2417 * endpoint defined by the given channel ID. The tail offset specified
2418 * must be aligned on a 64 byte boundary, and calculated so as to increase
2419 * the number of pending entries on the transmit queue. Any attempt to
2420 * decrease the number of pending transmit queue entires is considered
2421 * an invalid tail offset and will result in an EINVAL error.
2422 *
2423 * Since the tail of the transmit queue may not be moved backwards, the
2424 * transmit queue may be flushed by configuring a new transmit queue,
2425 * whereupon the hypervisor will configure the initial transmit head and
2426 * tail pointers to be equal.
2427 */
2428#define HV_FAST_LDC_TX_SET_QTAIL 0xe3
2429
2430/* ldc_rx_qconf()
2431 * TRAP: HV_FAST_TRAP
2432 * FUNCTION: HV_FAST_LDC_RX_QCONF
2433 * ARG0: channel ID
2434 * ARG1: real address base of queue
2435 * ARG2: num entries in queue
2436 * RET0: status
2437 *
2438 * Configure receive queue for the LDC endpoint specified by the
2439 * given channel ID, to be placed at the given real address, and
2440 * be of the given num entries. Num entries must be a power of two.
2441 * The real address base of the queue must be aligned on the queue
2442 * size. Each queue entry is 64-bytes, so for example, a 32 entry
2443 * queue must be aligned on a 2048 byte real address boundary.
2444 *
2445 * The endpoint's transmit queue is un-configured if num entries is zero.
2446 *
2447 * If a valid receive queue is specified for a local endpoint the LDC is
2448 * in the up state for the purpose of transmission to this endpoint.
2449 *
2450 * The maximum number of entries for each queue for a specific cpu may be
2451 * determined from the machine description.
2452 *
2453 * As receive queue configuration causes a reset of the queue's head and
2454 * tail pointers there is no way for a gues to determine how many entries
2455 * have been received between a preceeding ldc_get_rx_state() API call
2456 * and the completion of the configuration operation. It should be noted
2457 * that datagram delivery is not guarenteed via domain channels anyway,
2458 * and therefore any higher protocol should be resilient to datagram
2459 * loss if necessary. However, to overcome this specific race potential
2460 * it is recommended, for example, that a higher level protocol be employed
2461 * to ensure either retransmission, or ensure that no datagrams are pending
2462 * on the peer endpoint's transmit queue prior to the configuration process.
2463 */
2464#define HV_FAST_LDC_RX_QCONF 0xe4
2465
2466/* ldc_rx_qinfo()
2467 * TRAP: HV_FAST_TRAP
2468 * FUNCTION: HV_FAST_LDC_RX_QINFO
2469 * ARG0: channel ID
2470 * RET0: status
2471 * RET1: real address base of queue
2472 * RET2: num entries in queue
2473 *
2474 * Return the configuration info for the receive queue of LDC endpoint
2475 * defined by the given channel ID. The real address is the currently
2476 * defined real address base of the defined queue, and num entries is the
2477 * size of the queue in terms of number of entries.
2478 *
2479 * If the specified channel ID is a valid endpoint number, but no receive
2480 * queue has been defined this service will return success, but with num
2481 * entries set to zero and the real address will have an undefined value.
2482 */
2483#define HV_FAST_LDC_RX_QINFO 0xe5
2484
2485/* ldc_rx_get_state()
2486 * TRAP: HV_FAST_TRAP
2487 * FUNCTION: HV_FAST_LDC_RX_GET_STATE
2488 * ARG0: channel ID
2489 * RET0: status
2490 * RET1: head offset
2491 * RET2: tail offset
2492 * RET3: channel state
2493 *
2494 * Return the receive state, and the head and tail queue pointers, for
2495 * the receive queue of the LDC endpoint defined by the given channel ID.
2496 * The head and tail values are the byte offset of the head and tail
2497 * positions of the receive queue for the specified endpoint.
2498 */
2499#define HV_FAST_LDC_RX_GET_STATE 0xe6
2500
2501/* ldc_rx_set_qhead()
2502 * TRAP: HV_FAST_TRAP
2503 * FUNCTION: HV_FAST_LDC_RX_SET_QHEAD
2504 * ARG0: channel ID
2505 * ARG1: head offset
2506 * RET0: status
2507 *
2508 * Update the head pointer for the receive queue associated with the LDC
2509 * endpoint defined by the given channel ID. The head offset specified
2510 * must be aligned on a 64 byte boundary, and calculated so as to decrease
2511 * the number of pending entries on the receive queue. Any attempt to
2512 * increase the number of pending receive queue entires is considered
2513 * an invalid head offset and will result in an EINVAL error.
2514 *
2515 * The receive queue may be flushed by setting the head offset equal
2516 * to the current tail offset.
2517 */
2518#define HV_FAST_LDC_RX_SET_QHEAD 0xe7
2519
2520/* LDC Map Table Entry. Each slot is defined by a translation table
2521 * entry, as specified by the LDC_MTE_* bits below, and a 64-bit
2522 * hypervisor invalidation cookie.
2523 */
2524#define LDC_MTE_PADDR 0x0fffffffffffe000 /* pa[55:13] */
2525#define LDC_MTE_COPY_W 0x0000000000000400 /* copy write access */
2526#define LDC_MTE_COPY_R 0x0000000000000200 /* copy read access */
2527#define LDC_MTE_IOMMU_W 0x0000000000000100 /* IOMMU write access */
2528#define LDC_MTE_IOMMU_R 0x0000000000000080 /* IOMMU read access */
2529#define LDC_MTE_EXEC 0x0000000000000040 /* execute */
2530#define LDC_MTE_WRITE 0x0000000000000020 /* read */
2531#define LDC_MTE_READ 0x0000000000000010 /* write */
2532#define LDC_MTE_SZALL 0x000000000000000f /* page size bits */
2533#define LDC_MTE_SZ16GB 0x0000000000000007 /* 16GB page */
2534#define LDC_MTE_SZ2GB 0x0000000000000006 /* 2GB page */
2535#define LDC_MTE_SZ256MB 0x0000000000000005 /* 256MB page */
2536#define LDC_MTE_SZ32MB 0x0000000000000004 /* 32MB page */
2537#define LDC_MTE_SZ4MB 0x0000000000000003 /* 4MB page */
2538#define LDC_MTE_SZ512K 0x0000000000000002 /* 512K page */
2539#define LDC_MTE_SZ64K 0x0000000000000001 /* 64K page */
2540#define LDC_MTE_SZ8K 0x0000000000000000 /* 8K page */
2541
2542#ifndef __ASSEMBLY__
2543struct ldc_mtable_entry {
2544 unsigned long mte;
2545 unsigned long cookie;
2546};
2547#endif
2548
2549/* ldc_set_map_table()
2550 * TRAP: HV_FAST_TRAP
2551 * FUNCTION: HV_FAST_LDC_SET_MAP_TABLE
2552 * ARG0: channel ID
2553 * ARG1: table real address
2554 * ARG2: num entries
2555 * RET0: status
2556 *
2557 * Register the MTE table at the given table real address, with the
2558 * specified num entries, for the LDC indicated by the given channel
2559 * ID.
2560 */
2561#define HV_FAST_LDC_SET_MAP_TABLE 0xea
2562
2563/* ldc_get_map_table()
2564 * TRAP: HV_FAST_TRAP
2565 * FUNCTION: HV_FAST_LDC_GET_MAP_TABLE
2566 * ARG0: channel ID
2567 * RET0: status
2568 * RET1: table real address
2569 * RET2: num entries
2570 *
2571 * Return the configuration of the current mapping table registered
2572 * for the given channel ID.
2573 */
2574#define HV_FAST_LDC_GET_MAP_TABLE 0xeb
2575
2576#define LDC_COPY_IN 0
2577#define LDC_COPY_OUT 1
2578
2579/* ldc_copy()
2580 * TRAP: HV_FAST_TRAP
2581 * FUNCTION: HV_FAST_LDC_COPY
2582 * ARG0: channel ID
2583 * ARG1: LDC_COPY_* direction code
2584 * ARG2: target real address
2585 * ARG3: local real address
2586 * ARG4: length in bytes
2587 * RET0: status
2588 * RET1: actual length in bytes
2589 */
2590#define HV_FAST_LDC_COPY 0xec
2591
2592#define LDC_MEM_READ 1
2593#define LDC_MEM_WRITE 2
2594#define LDC_MEM_EXEC 4
2595
2596/* ldc_mapin()
2597 * TRAP: HV_FAST_TRAP
2598 * FUNCTION: HV_FAST_LDC_MAPIN
2599 * ARG0: channel ID
2600 * ARG1: cookie
2601 * RET0: status
2602 * RET1: real address
2603 * RET2: LDC_MEM_* permissions
2604 */
2605#define HV_FAST_LDC_MAPIN 0xed
2606
2607/* ldc_unmap()
2608 * TRAP: HV_FAST_TRAP
2609 * FUNCTION: HV_FAST_LDC_UNMAP
2610 * ARG0: real address
2611 * RET0: status
2612 */
2613#define HV_FAST_LDC_UNMAP 0xee
2614
2615/* ldc_revoke()
2616 * TRAP: HV_FAST_TRAP
2617 * FUNCTION: HV_FAST_LDC_REVOKE
2618 * ARG0: cookie
2619 * ARG1: ldc_mtable_entry cookie
2620 * RET0: status
2621 */
2622#define HV_FAST_LDC_REVOKE 0xef
2623
2624#ifndef __ASSEMBLY__
2625extern unsigned long sun4v_ldc_tx_qconf(unsigned long channel,
2626 unsigned long ra,
2627 unsigned long num_entries);
2628extern unsigned long sun4v_ldc_tx_qinfo(unsigned long channel,
2629 unsigned long *ra,
2630 unsigned long *num_entries);
2631extern unsigned long sun4v_ldc_tx_get_state(unsigned long channel,
2632 unsigned long *head_off,
2633 unsigned long *tail_off,
2634 unsigned long *chan_state);
2635extern unsigned long sun4v_ldc_tx_set_qtail(unsigned long channel,
2636 unsigned long tail_off);
2637extern unsigned long sun4v_ldc_rx_qconf(unsigned long channel,
2638 unsigned long ra,
2639 unsigned long num_entries);
2640extern unsigned long sun4v_ldc_rx_qinfo(unsigned long channel,
2641 unsigned long *ra,
2642 unsigned long *num_entries);
2643extern unsigned long sun4v_ldc_rx_get_state(unsigned long channel,
2644 unsigned long *head_off,
2645 unsigned long *tail_off,
2646 unsigned long *chan_state);
2647extern unsigned long sun4v_ldc_rx_set_qhead(unsigned long channel,
2648 unsigned long head_off);
2649extern unsigned long sun4v_ldc_set_map_table(unsigned long channel,
2650 unsigned long ra,
2651 unsigned long num_entries);
2652extern unsigned long sun4v_ldc_get_map_table(unsigned long channel,
2653 unsigned long *ra,
2654 unsigned long *num_entries);
2655extern unsigned long sun4v_ldc_copy(unsigned long channel,
2656 unsigned long dir_code,
2657 unsigned long tgt_raddr,
2658 unsigned long lcl_raddr,
2659 unsigned long len,
2660 unsigned long *actual_len);
2661extern unsigned long sun4v_ldc_mapin(unsigned long channel,
2662 unsigned long cookie,
2663 unsigned long *ra,
2664 unsigned long *perm);
2665extern unsigned long sun4v_ldc_unmap(unsigned long ra);
2666extern unsigned long sun4v_ldc_revoke(unsigned long cookie,
2667 unsigned long mte_cookie);
2668#endif
2669
2040/* Performance counter services. */ 2670/* Performance counter services. */
2041 2671
2042#define HV_PERF_JBUS_PERF_CTRL_REG 0x00 2672#define HV_PERF_JBUS_PERF_CTRL_REG 0x00
@@ -2168,6 +2798,100 @@ struct hv_mmu_statistics {
2168 */ 2798 */
2169#define HV_FAST_MMUSTAT_INFO 0x103 2799#define HV_FAST_MMUSTAT_INFO 0x103
2170 2800
2801/* NCS crypto services */
2802
2803/* ncs_request() sub-function numbers */
2804#define HV_NCS_QCONF 0x01
2805#define HV_NCS_QTAIL_UPDATE 0x02
2806
2807#ifndef __ASSEMBLY__
2808struct hv_ncs_queue_entry {
2809 /* MAU Control Register */
2810 unsigned long mau_control;
2811#define MAU_CONTROL_INV_PARITY 0x0000000000002000
2812#define MAU_CONTROL_STRAND 0x0000000000001800
2813#define MAU_CONTROL_BUSY 0x0000000000000400
2814#define MAU_CONTROL_INT 0x0000000000000200
2815#define MAU_CONTROL_OP 0x00000000000001c0
2816#define MAU_CONTROL_OP_SHIFT 6
2817#define MAU_OP_LOAD_MA_MEMORY 0x0
2818#define MAU_OP_STORE_MA_MEMORY 0x1
2819#define MAU_OP_MODULAR_MULT 0x2
2820#define MAU_OP_MODULAR_REDUCE 0x3
2821#define MAU_OP_MODULAR_EXP_LOOP 0x4
2822#define MAU_CONTROL_LEN 0x000000000000003f
2823#define MAU_CONTROL_LEN_SHIFT 0
2824
2825 /* Real address of bytes to load or store bytes
2826 * into/out-of the MAU.
2827 */
2828 unsigned long mau_mpa;
2829
2830 /* Modular Arithmetic MA Offset Register. */
2831 unsigned long mau_ma;
2832
2833 /* Modular Arithmetic N Prime Register. */
2834 unsigned long mau_np;
2835};
2836
2837struct hv_ncs_qconf_arg {
2838 unsigned long mid; /* MAU ID, 1 per core on Niagara */
2839 unsigned long base; /* Real address base of queue */
2840 unsigned long end; /* Real address end of queue */
2841 unsigned long num_ents; /* Number of entries in queue */
2842};
2843
2844struct hv_ncs_qtail_update_arg {
2845 unsigned long mid; /* MAU ID, 1 per core on Niagara */
2846 unsigned long tail; /* New tail index to use */
2847 unsigned long syncflag; /* only SYNCFLAG_SYNC is implemented */
2848#define HV_NCS_SYNCFLAG_SYNC 0x00
2849#define HV_NCS_SYNCFLAG_ASYNC 0x01
2850};
2851#endif
2852
2853/* ncs_request()
2854 * TRAP: HV_FAST_TRAP
2855 * FUNCTION: HV_FAST_NCS_REQUEST
2856 * ARG0: NCS sub-function
2857 * ARG1: sub-function argument real address
2858 * ARG2: size in bytes of sub-function argument
2859 * RET0: status
2860 *
2861 * The MAU chip of the Niagara processor is not directly accessible
2862 * to privileged code, instead it is programmed indirectly via this
2863 * hypervisor API.
2864 *
2865 * The interfaces defines a queue of MAU operations to perform.
2866 * Privileged code registers a queue with the hypervisor by invoking
2867 * this HVAPI with the HV_NCS_QCONF sub-function, which defines the
2868 * base, end, and number of entries of the queue. Each queue entry
2869 * contains a MAU register struct block.
2870 *
2871 * The privileged code then proceeds to add entries to the queue and
2872 * then invoke the HV_NCS_QTAIL_UPDATE sub-function. Since only
2873 * synchronous operations are supported by the current hypervisor,
2874 * HV_NCS_QTAIL_UPDATE will run all the pending queue entries to
2875 * completion and return HV_EOK, or return an error code.
2876 *
2877 * The real address of the sub-function argument must be aligned on at
2878 * least an 8-byte boundary.
2879 *
2880 * The tail argument of HV_NCS_QTAIL_UPDATE is an index, not a byte
2881 * offset, into the queue and must be less than or equal the 'num_ents'
2882 * argument given in the HV_NCS_QCONF call.
2883 */
2884#define HV_FAST_NCS_REQUEST 0x110
2885
2886#ifndef __ASSEMBLY__
2887extern unsigned long sun4v_ncs_request(unsigned long request,
2888 unsigned long arg_ra,
2889 unsigned long arg_size);
2890#endif
2891
2892#define HV_FAST_FIRE_GET_PERFREG 0x120
2893#define HV_FAST_FIRE_SET_PERFREG 0x121
2894
2171/* Function numbers for HV_CORE_TRAP. */ 2895/* Function numbers for HV_CORE_TRAP. */
2172#define HV_CORE_SET_VER 0x00 2896#define HV_CORE_SET_VER 0x00
2173#define HV_CORE_PUTCHAR 0x01 2897#define HV_CORE_PUTCHAR 0x01
@@ -2204,6 +2928,7 @@ extern void sun4v_hvapi_unregister(unsigned long group);
2204extern int sun4v_hvapi_get(unsigned long group, 2928extern int sun4v_hvapi_get(unsigned long group,
2205 unsigned long *major, 2929 unsigned long *major,
2206 unsigned long *minor); 2930 unsigned long *minor);
2931extern void sun4v_hvapi_init(void);
2207#endif 2932#endif
2208 2933
2209#endif /* !(_SPARC64_HYPERVISOR_H) */ 2934#endif /* !(_SPARC64_HYPERVISOR_H) */
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h
index 627e3396a5f0..9974c7b0aebc 100644
--- a/include/asm-sparc64/kdebug.h
+++ b/include/asm-sparc64/kdebug.h
@@ -32,7 +32,6 @@ enum die_val {
32 DIE_TRAP, 32 DIE_TRAP,
33 DIE_TRAP_TL1, 33 DIE_TRAP_TL1,
34 DIE_CALL, 34 DIE_CALL,
35 DIE_PAGE_FAULT,
36}; 35};
37 36
38#endif 37#endif
diff --git a/include/asm-sparc64/mdesc.h b/include/asm-sparc64/mdesc.h
new file mode 100644
index 000000000000..124eb8ca2378
--- /dev/null
+++ b/include/asm-sparc64/mdesc.h
@@ -0,0 +1,39 @@
1#ifndef _SPARC64_MDESC_H
2#define _SPARC64_MDESC_H
3
4#include <linux/types.h>
5#include <asm/prom.h>
6
7struct mdesc_node;
8struct mdesc_arc {
9 const char *name;
10 struct mdesc_node *arc;
11};
12
13struct mdesc_node {
14 const char *name;
15 u64 node;
16 unsigned int unique_id;
17 unsigned int num_arcs;
18 struct property *properties;
19 struct mdesc_node *hash_next;
20 struct mdesc_node *allnodes_next;
21 struct mdesc_arc arcs[0];
22};
23
24extern struct mdesc_node *md_find_node_by_name(struct mdesc_node *from,
25 const char *name);
26#define md_for_each_node_by_name(__mn, __name) \
27 for (__mn = md_find_node_by_name(NULL, __name); __mn; \
28 __mn = md_find_node_by_name(__mn, __name))
29
30extern struct property *md_find_property(const struct mdesc_node *mp,
31 const char *name,
32 int *lenp);
33extern const void *md_get_property(const struct mdesc_node *mp,
34 const char *name,
35 int *lenp);
36
37extern void sun4v_mdesc_init(void);
38
39#endif
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h
index 6a0da3b1695c..992f9f7a476c 100644
--- a/include/asm-sparc64/oplib.h
+++ b/include/asm-sparc64/oplib.h
@@ -316,11 +316,8 @@ extern int prom_setprop(int node, const char *prop_name, char *prop_value,
316 316
317extern int prom_pathtoinode(const char *path); 317extern int prom_pathtoinode(const char *path);
318extern int prom_inst2pkg(int); 318extern int prom_inst2pkg(int);
319 319extern int prom_service_exists(const char *service_name);
320/* CPU probing helpers. */ 320extern void prom_sun4v_guest_soft_state(void);
321struct device_node;
322int cpu_find_by_instance(int instance, struct device_node **dev_node, int *mid);
323int cpu_find_by_mid(int mid, struct device_node **prom_node);
324 321
325/* Client interface level routines. */ 322/* Client interface level routines. */
326extern void prom_set_trap_table(unsigned long tba); 323extern void prom_set_trap_table(unsigned long tba);
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h
index ced8cbde046d..88db872ce2f8 100644
--- a/include/asm-sparc64/percpu.h
+++ b/include/asm-sparc64/percpu.h
@@ -5,7 +5,8 @@
5 5
6#ifdef CONFIG_SMP 6#ifdef CONFIG_SMP
7 7
8extern void setup_per_cpu_areas(void); 8#define setup_per_cpu_areas() do { } while (0)
9extern void real_setup_per_cpu_areas(void);
9 10
10extern unsigned long __per_cpu_base; 11extern unsigned long __per_cpu_base;
11extern unsigned long __per_cpu_shift; 12extern unsigned long __per_cpu_shift;
@@ -34,6 +35,7 @@ do { \
34} while (0) 35} while (0)
35#else /* ! SMP */ 36#else /* ! SMP */
36 37
38#define real_setup_per_cpu_areas() do { } while (0)
37#define DEFINE_PER_CPU(type, name) \ 39#define DEFINE_PER_CPU(type, name) \
38 __typeof__(type) per_cpu__##name 40 __typeof__(type) per_cpu__##name
39 41
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index ddad5f99ac7f..b4df3042add0 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -90,6 +90,7 @@ extern struct device_node *of_find_compatible_node(struct device_node *from,
90 const char *type, const char *compat); 90 const char *type, const char *compat);
91extern struct device_node *of_find_node_by_path(const char *path); 91extern struct device_node *of_find_node_by_path(const char *path);
92extern struct device_node *of_find_node_by_phandle(phandle handle); 92extern struct device_node *of_find_node_by_phandle(phandle handle);
93extern struct device_node *of_find_node_by_cpuid(int cpuid);
93extern struct device_node *of_get_parent(const struct device_node *node); 94extern struct device_node *of_get_parent(const struct device_node *node);
94extern struct device_node *of_get_next_child(const struct device_node *node, 95extern struct device_node *of_get_next_child(const struct device_node *node,
95 struct device_node *prev); 96 struct device_node *prev);
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h
index 869d16fb907b..f76e1492add5 100644
--- a/include/asm-sparc64/smp.h
+++ b/include/asm-sparc64/smp.h
@@ -41,7 +41,7 @@ extern cpumask_t cpu_sibling_map[NR_CPUS];
41extern int hard_smp_processor_id(void); 41extern int hard_smp_processor_id(void);
42#define raw_smp_processor_id() (current_thread_info()->cpu) 42#define raw_smp_processor_id() (current_thread_info()->cpu)
43 43
44extern void smp_setup_cpu_possible_map(void); 44extern void smp_fill_in_sib_core_maps(void);
45extern unsigned char boot_cpu_id; 45extern unsigned char boot_cpu_id;
46 46
47#endif /* !(__ASSEMBLY__) */ 47#endif /* !(__ASSEMBLY__) */
@@ -49,7 +49,7 @@ extern unsigned char boot_cpu_id;
49#else 49#else
50 50
51#define hard_smp_processor_id() 0 51#define hard_smp_processor_id() 0
52#define smp_setup_cpu_possible_map() do { } while (0) 52#define smp_fill_in_sib_core_maps() do { } while (0)
53#define boot_cpu_id (0) 53#define boot_cpu_id (0)
54 54
55#endif /* !(CONFIG_SMP) */ 55#endif /* !(CONFIG_SMP) */
diff --git a/include/asm-sparc64/sstate.h b/include/asm-sparc64/sstate.h
new file mode 100644
index 000000000000..a7c35dbcb281
--- /dev/null
+++ b/include/asm-sparc64/sstate.h
@@ -0,0 +1,13 @@
1#ifndef _SPARC64_SSTATE_H
2#define _SPARC64_SSTATE_H
3
4extern void sstate_booting(void);
5extern void sstate_running(void);
6extern void sstate_halt(void);
7extern void sstate_poweroff(void);
8extern void sstate_panic(void);
9extern void sstate_reboot(void);
10
11extern void sun4v_sstate_init(void);
12
13#endif /* _SPARC64_SSTATE_H */
diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h
index 2ebf7f27bf91..98252cd44dd6 100644
--- a/include/asm-sparc64/thread_info.h
+++ b/include/asm-sparc64/thread_info.h
@@ -38,8 +38,8 @@ struct thread_info {
38 /* D$ line 1 */ 38 /* D$ line 1 */
39 struct task_struct *task; 39 struct task_struct *task;
40 unsigned long flags; 40 unsigned long flags;
41 __u8 cpu;
42 __u8 fpsaved[7]; 41 __u8 fpsaved[7];
42 __u8 pad;
43 unsigned long ksp; 43 unsigned long ksp;
44 44
45 /* D$ line 2 */ 45 /* D$ line 2 */
@@ -49,7 +49,7 @@ struct thread_info {
49 int preempt_count; /* 0 => preemptable, <0 => BUG */ 49 int preempt_count; /* 0 => preemptable, <0 => BUG */
50 __u8 new_child; 50 __u8 new_child;
51 __u8 syscall_noerror; 51 __u8 syscall_noerror;
52 __u16 __pad; 52 __u16 cpu;
53 53
54 unsigned long *utraps; 54 unsigned long *utraps;
55 55
@@ -83,8 +83,7 @@ struct thread_info {
83#define TI_CURRENT_DS (TI_FLAGS + TI_FLAG_BYTE_CURRENT_DS) 83#define TI_CURRENT_DS (TI_FLAGS + TI_FLAG_BYTE_CURRENT_DS)
84#define TI_FPDEPTH (TI_FLAGS + TI_FLAG_BYTE_FPDEPTH) 84#define TI_FPDEPTH (TI_FLAGS + TI_FLAG_BYTE_FPDEPTH)
85#define TI_WSAVED (TI_FLAGS + TI_FLAG_BYTE_WSAVED) 85#define TI_WSAVED (TI_FLAGS + TI_FLAG_BYTE_WSAVED)
86#define TI_CPU 0x00000010 86#define TI_FPSAVED 0x00000010
87#define TI_FPSAVED 0x00000011
88#define TI_KSP 0x00000018 87#define TI_KSP 0x00000018
89#define TI_FAULT_ADDR 0x00000020 88#define TI_FAULT_ADDR 0x00000020
90#define TI_KREGS 0x00000028 89#define TI_KREGS 0x00000028
@@ -92,6 +91,7 @@ struct thread_info {
92#define TI_PRE_COUNT 0x00000038 91#define TI_PRE_COUNT 0x00000038
93#define TI_NEW_CHILD 0x0000003c 92#define TI_NEW_CHILD 0x0000003c
94#define TI_SYS_NOERROR 0x0000003d 93#define TI_SYS_NOERROR 0x0000003d
94#define TI_CPU 0x0000003e
95#define TI_UTRAPS 0x00000040 95#define TI_UTRAPS 0x00000040
96#define TI_REG_WINDOW 0x00000048 96#define TI_REG_WINDOW 0x00000048
97#define TI_RWIN_SPTRS 0x000003c8 97#define TI_RWIN_SPTRS 0x000003c8
diff --git a/include/asm-sparc64/topology.h b/include/asm-sparc64/topology.h
index 98a6c613589d..e0d450d600ec 100644
--- a/include/asm-sparc64/topology.h
+++ b/include/asm-sparc64/topology.h
@@ -6,4 +6,7 @@
6 6
7#include <asm-generic/topology.h> 7#include <asm-generic/topology.h>
8 8
9#define topology_core_id(cpu) (cpu_data(cpu).core_id)
10#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
11
9#endif /* _ASM_SPARC64_TOPOLOGY_H */ 12#endif /* _ASM_SPARC64_TOPOLOGY_H */
diff --git a/include/asm-sparc64/tsb.h b/include/asm-sparc64/tsb.h
index ab55ffcb7bf4..76e4299dd9bc 100644
--- a/include/asm-sparc64/tsb.h
+++ b/include/asm-sparc64/tsb.h
@@ -271,7 +271,7 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end;
271#define KERN_TSB4M_LOOKUP_TL1(TAG, REG1, REG2, REG3, REG4, OK_LABEL) \ 271#define KERN_TSB4M_LOOKUP_TL1(TAG, REG1, REG2, REG3, REG4, OK_LABEL) \
272 sethi %hi(swapper_4m_tsb), REG1; \ 272 sethi %hi(swapper_4m_tsb), REG1; \
273 or REG1, %lo(swapper_4m_tsb), REG1; \ 273 or REG1, %lo(swapper_4m_tsb), REG1; \
274 and TAG, (KERNEL_TSB_NENTRIES - 1), REG2; \ 274 and TAG, (KERNEL_TSB4M_NENTRIES - 1), REG2; \
275 sllx REG2, 4, REG2; \ 275 sllx REG2, 4, REG2; \
276 add REG1, REG2, REG2; \ 276 add REG1, REG2, REG2; \
277 KTSB_LOAD_QUAD(REG2, REG3); \ 277 KTSB_LOAD_QUAD(REG2, REG3); \
diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86_64/calgary.h
index 7ee900645719..4d5747a0923c 100644
--- a/include/asm-x86_64/calgary.h
+++ b/include/asm-x86_64/calgary.h
@@ -27,6 +27,7 @@
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/device.h> 28#include <linux/device.h>
29#include <linux/dma-mapping.h> 29#include <linux/dma-mapping.h>
30#include <linux/timer.h>
30#include <asm/types.h> 31#include <asm/types.h>
31 32
32struct iommu_table { 33struct iommu_table {
diff --git a/include/asm-x86_64/tlbflush.h b/include/asm-x86_64/tlbflush.h
index 512401b8725f..8516225a8389 100644
--- a/include/asm-x86_64/tlbflush.h
+++ b/include/asm-x86_64/tlbflush.h
@@ -2,6 +2,7 @@
2#define _X8664_TLBFLUSH_H 2#define _X8664_TLBFLUSH_H
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/sched.h>
5#include <asm/processor.h> 6#include <asm/processor.h>
6#include <asm/system.h> 7#include <asm/system.h>
7 8
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index bcd01f269f60..f317c270d4bf 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -62,6 +62,8 @@ header-y += fadvise.h
62header-y += fd.h 62header-y += fd.h
63header-y += fdreg.h 63header-y += fdreg.h
64header-y += fib_rules.h 64header-y += fib_rules.h
65header-y += firewire-cdev.h
66header-y += firewire-constants.h
65header-y += fuse.h 67header-y += fuse.h
66header-y += genetlink.h 68header-y += genetlink.h
67header-y += gen_stats.h 69header-y += gen_stats.h
@@ -239,6 +241,7 @@ unifdef-y += ipc.h
239unifdef-y += ipmi.h 241unifdef-y += ipmi.h
240unifdef-y += ipv6.h 242unifdef-y += ipv6.h
241unifdef-y += ipv6_route.h 243unifdef-y += ipv6_route.h
244unifdef-y += ip6_tunnel.h
242unifdef-y += isdn.h 245unifdef-y += isdn.h
243unifdef-y += isdnif.h 246unifdef-y += isdnif.h
244unifdef-y += isdn_divertif.h 247unifdef-y += isdn_divertif.h
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 0365ec9fc0c9..c83534ee1e79 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -59,6 +59,7 @@ extern void *__alloc_bootmem_core(struct bootmem_data *bdata,
59 unsigned long align, 59 unsigned long align,
60 unsigned long goal, 60 unsigned long goal,
61 unsigned long limit); 61 unsigned long limit);
62extern void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size);
62 63
63#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE 64#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
64extern void reserve_bootmem(unsigned long addr, unsigned long size); 65extern void reserve_bootmem(unsigned long addr, unsigned long size);
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 6548b35ab9f6..bbf8df7de28f 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -16,6 +16,8 @@
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/compiler.h> 17#include <linux/compiler.h>
18 18
19struct task_struct;
20
19/* User-level do most of the mapping between kernel and user 21/* User-level do most of the mapping between kernel and user
20 capabilities based on the version tag given by the kernel. The 22 capabilities based on the version tag given by the kernel. The
21 kernel might be somewhat backwards compatible, but don't bet on 23 kernel might be somewhat backwards compatible, but don't bet on
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 498c35920762..8287a72bb6a9 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -36,9 +36,7 @@ extern void __chk_io_ptr(const void __iomem *);
36 36
37#ifdef __KERNEL__ 37#ifdef __KERNEL__
38 38
39#if __GNUC__ > 4 39#if __GNUC__ >= 4
40#error no compiler-gcc.h file for this gcc version
41#elif __GNUC__ == 4
42# include <linux/compiler-gcc4.h> 40# include <linux/compiler-gcc4.h>
43#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2 41#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2
44# include <linux/compiler-gcc3.h> 42# include <linux/compiler-gcc3.h>
diff --git a/include/linux/errno.h b/include/linux/errno.h
index d90b80f9b28c..46685832ed99 100644
--- a/include/linux/errno.h
+++ b/include/linux/errno.h
@@ -5,7 +5,12 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7 7
8/* Should never be seen by user programs */ 8/*
9 * These should never be seen by user programs. To return one of ERESTART*
10 * codes, signal_pending() MUST be set. Note that ptrace can observe these
11 * at syscall exit tracing, but they will never be left for the debugged user
12 * process to see.
13 */
9#define ERESTARTSYS 512 14#define ERESTARTSYS 512
10#define ERESTARTNOINTR 513 15#define ERESTARTNOINTR 513
11#define ERESTARTNOHAND 514 /* restart if no handler.. */ 16#define ERESTARTNOHAND 514 /* restart if no handler.. */
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index 54c576d414c3..de1f9f78625a 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -32,9 +32,9 @@
32/* 32/*
33 * Define EXT4_RESERVATION to reserve data blocks for expanding files 33 * Define EXT4_RESERVATION to reserve data blocks for expanding files
34 */ 34 */
35#define EXT4_DEFAULT_RESERVE_BLOCKS 8 35#define EXT4_DEFAULT_RESERVE_BLOCKS 8
36/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ 36/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
37#define EXT4_MAX_RESERVE_BLOCKS 1027 37#define EXT4_MAX_RESERVE_BLOCKS 1027
38#define EXT4_RESERVE_WINDOW_NOT_ALLOCATED 0 38#define EXT4_RESERVE_WINDOW_NOT_ALLOCATED 0
39/* 39/*
40 * Always enable hashed directories 40 * Always enable hashed directories
@@ -204,12 +204,12 @@ struct ext4_group_desc
204 204
205/* Used to pass group descriptor data when online resize is done */ 205/* Used to pass group descriptor data when online resize is done */
206struct ext4_new_group_input { 206struct ext4_new_group_input {
207 __u32 group; /* Group number for this data */ 207 __u32 group; /* Group number for this data */
208 __u64 block_bitmap; /* Absolute block number of block bitmap */ 208 __u64 block_bitmap; /* Absolute block number of block bitmap */
209 __u64 inode_bitmap; /* Absolute block number of inode bitmap */ 209 __u64 inode_bitmap; /* Absolute block number of inode bitmap */
210 __u64 inode_table; /* Absolute block number of inode table start */ 210 __u64 inode_table; /* Absolute block number of inode table start */
211 __u32 blocks_count; /* Total number of blocks in this group */ 211 __u32 blocks_count; /* Total number of blocks in this group */
212 __u16 reserved_blocks; /* Number of reserved blocks in this group */ 212 __u16 reserved_blocks; /* Number of reserved blocks in this group */
213 __u16 unused; 213 __u16 unused;
214}; 214};
215 215
@@ -310,7 +310,7 @@ struct ext4_inode {
310 __u8 l_i_frag; /* Fragment number */ 310 __u8 l_i_frag; /* Fragment number */
311 __u8 l_i_fsize; /* Fragment size */ 311 __u8 l_i_fsize; /* Fragment size */
312 __le16 l_i_file_acl_high; 312 __le16 l_i_file_acl_high;
313 __le16 l_i_uid_high; /* these 2 fields */ 313 __le16 l_i_uid_high; /* these 2 fields */
314 __le16 l_i_gid_high; /* were reserved2[0] */ 314 __le16 l_i_gid_high; /* were reserved2[0] */
315 __u32 l_i_reserved2; 315 __u32 l_i_reserved2;
316 } linux2; 316 } linux2;
@@ -513,7 +513,14 @@ struct ext4_super_block {
513/*150*/ __le32 s_blocks_count_hi; /* Blocks count */ 513/*150*/ __le32 s_blocks_count_hi; /* Blocks count */
514 __le32 s_r_blocks_count_hi; /* Reserved blocks count */ 514 __le32 s_r_blocks_count_hi; /* Reserved blocks count */
515 __le32 s_free_blocks_count_hi; /* Free blocks count */ 515 __le32 s_free_blocks_count_hi; /* Free blocks count */
516 __u32 s_reserved[169]; /* Padding to the end of the block */ 516 __u16 s_min_extra_isize; /* All inodes have at least # bytes */
517 __u16 s_want_extra_isize; /* New inodes should reserve # bytes */
518 __u32 s_flags; /* Miscellaneous flags */
519 __u16 s_raid_stride; /* RAID stride */
520 __u16 s_mmp_interval; /* # seconds to wait in MMP checking */
521 __u64 s_mmp_block; /* Block for multi-mount protection */
522 __u32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/
523 __u32 s_reserved[163]; /* Padding to the end of the block */
517}; 524};
518 525
519#ifdef __KERNEL__ 526#ifdef __KERNEL__
@@ -780,9 +787,9 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
780 * Ok, these declarations are also in <linux/kernel.h> but none of the 787 * Ok, these declarations are also in <linux/kernel.h> but none of the
781 * ext4 source programs needs to include it so they are duplicated here. 788 * ext4 source programs needs to include it so they are duplicated here.
782 */ 789 */
783# define NORET_TYPE /**/ 790# define NORET_TYPE /**/
784# define ATTRIB_NORET __attribute__((noreturn)) 791# define ATTRIB_NORET __attribute__((noreturn))
785# define NORET_AND noreturn, 792# define NORET_AND noreturn,
786 793
787/* balloc.c */ 794/* balloc.c */
788extern unsigned int ext4_block_group(struct super_block *sb, 795extern unsigned int ext4_block_group(struct super_block *sb,
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h
index 7eb1d73fc5d1..acfe59740b03 100644
--- a/include/linux/ext4_fs_extents.h
+++ b/include/linux/ext4_fs_extents.h
@@ -151,8 +151,8 @@ typedef int (*ext_prepare_callback)(struct inode *, struct ext4_ext_path *,
151 ((struct ext4_extent_idx *) (((char *) (__hdr__)) + \ 151 ((struct ext4_extent_idx *) (((char *) (__hdr__)) + \
152 sizeof(struct ext4_extent_header))) 152 sizeof(struct ext4_extent_header)))
153#define EXT_HAS_FREE_INDEX(__path__) \ 153#define EXT_HAS_FREE_INDEX(__path__) \
154 (le16_to_cpu((__path__)->p_hdr->eh_entries) \ 154 (le16_to_cpu((__path__)->p_hdr->eh_entries) \
155 < le16_to_cpu((__path__)->p_hdr->eh_max)) 155 < le16_to_cpu((__path__)->p_hdr->eh_max))
156#define EXT_LAST_EXTENT(__hdr__) \ 156#define EXT_LAST_EXTENT(__hdr__) \
157 (EXT_FIRST_EXTENT((__hdr__)) + le16_to_cpu((__hdr__)->eh_entries) - 1) 157 (EXT_FIRST_EXTENT((__hdr__)) + le16_to_cpu((__hdr__)->eh_entries) - 1)
158#define EXT_LAST_INDEX(__hdr__) \ 158#define EXT_LAST_INDEX(__hdr__) \
@@ -190,6 +190,7 @@ ext4_ext_invalidate_cache(struct inode *inode)
190 190
191extern int ext4_extent_tree_init(handle_t *, struct inode *); 191extern int ext4_extent_tree_init(handle_t *, struct inode *);
192extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *); 192extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *);
193extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *);
193extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *); 194extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *);
194extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *); 195extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *);
195extern struct ext4_ext_path * ext4_ext_find_extent(struct inode *, int, struct ext4_ext_path *); 196extern struct ext4_ext_path * ext4_ext_find_extent(struct inode *, int, struct ext4_ext_path *);
diff --git a/include/linux/ext4_fs_i.h b/include/linux/ext4_fs_i.h
index d5b177e5b395..9de494406995 100644
--- a/include/linux/ext4_fs_i.h
+++ b/include/linux/ext4_fs_i.h
@@ -41,14 +41,14 @@ struct ext4_reserve_window_node {
41 41
42struct ext4_block_alloc_info { 42struct ext4_block_alloc_info {
43 /* information about reservation window */ 43 /* information about reservation window */
44 struct ext4_reserve_window_node rsv_window_node; 44 struct ext4_reserve_window_node rsv_window_node;
45 /* 45 /*
46 * was i_next_alloc_block in ext4_inode_info 46 * was i_next_alloc_block in ext4_inode_info
47 * is the logical (file-relative) number of the 47 * is the logical (file-relative) number of the
48 * most-recently-allocated block in this file. 48 * most-recently-allocated block in this file.
49 * We use this for detecting linearly ascending allocation requests. 49 * We use this for detecting linearly ascending allocation requests.
50 */ 50 */
51 __u32 last_alloc_logical_block; 51 __u32 last_alloc_logical_block;
52 /* 52 /*
53 * Was i_next_alloc_goal in ext4_inode_info 53 * Was i_next_alloc_goal in ext4_inode_info
54 * is the *physical* companion to i_next_alloc_block. 54 * is the *physical* companion to i_next_alloc_block.
@@ -56,7 +56,7 @@ struct ext4_block_alloc_info {
56 * allocated to this file. This give us the goal (target) for the next 56 * allocated to this file. This give us the goal (target) for the next
57 * allocation when we detect linearly ascending requests. 57 * allocation when we detect linearly ascending requests.
58 */ 58 */
59 ext4_fsblk_t last_alloc_physical_block; 59 ext4_fsblk_t last_alloc_physical_block;
60}; 60};
61 61
62#define rsv_start rsv_window._rsv_start 62#define rsv_start rsv_window._rsv_start
diff --git a/include/linux/fb.h b/include/linux/fb.h
index c654d0e9ce33..66226824ab68 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -942,6 +942,7 @@ extern int fb_new_modelist(struct fb_info *info);
942 942
943extern struct fb_info *registered_fb[FB_MAX]; 943extern struct fb_info *registered_fb[FB_MAX];
944extern int num_registered_fb; 944extern int num_registered_fb;
945extern struct class *fb_class;
945 946
946static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, 947static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
947 u8 *src, u32 s_pitch, u32 height) 948 u8 *src, u32 s_pitch, u32 height)
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index d4455eb2ae35..efbe1fda1a22 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -198,13 +198,15 @@ struct fw_cdev_create_iso_context {
198 __u32 handle; 198 __u32 handle;
199}; 199};
200 200
201#define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
202#define FW_CDEV_ISO_INTERRUPT (1 << 16)
203#define FW_CDEV_ISO_SKIP (1 << 17)
204#define FW_CDEV_ISO_TAG(v) ((v) << 18)
205#define FW_CDEV_ISO_SY(v) ((v) << 20)
206#define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
207
201struct fw_cdev_iso_packet { 208struct fw_cdev_iso_packet {
202 __u16 payload_length; /* Length of indirect payload. */ 209 __u32 control;
203 __u32 interrupt : 1; /* Generate interrupt on this packet */
204 __u32 skip : 1; /* Set to not send packet at all. */
205 __u32 tag : 2;
206 __u32 sy : 4;
207 __u32 header_length : 8; /* Length of immediate header. */
208 __u32 header[0]; 210 __u32 header[0];
209}; 211};
210 212
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 5e75e26d4787..4631086f5060 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -37,25 +37,25 @@ static inline void do_not_freeze(struct task_struct *p)
37 37
38/* 38/*
39 * Wake up a frozen process 39 * Wake up a frozen process
40 *
41 * task_lock() is taken to prevent the race with refrigerator() which may
42 * occur if the freezing of tasks fails. Namely, without the lock, if the
43 * freezing of tasks failed, thaw_tasks() might have run before a task in
44 * refrigerator() could call frozen_process(), in which case the task would be
45 * frozen and no one would thaw it.
40 */ 46 */
41static inline int thaw_process(struct task_struct *p) 47static inline int thaw_process(struct task_struct *p)
42{ 48{
49 task_lock(p);
43 if (frozen(p)) { 50 if (frozen(p)) {
44 p->flags &= ~PF_FROZEN; 51 p->flags &= ~PF_FROZEN;
52 task_unlock(p);
45 wake_up_process(p); 53 wake_up_process(p);
46 return 1; 54 return 1;
47 } 55 }
48 return 0;
49}
50
51/*
52 * freezing is complete, mark process as frozen
53 */
54static inline void frozen_process(struct task_struct *p)
55{
56 p->flags |= PF_FROZEN;
57 wmb();
58 clear_tsk_thread_flag(p, TIF_FREEZE); 56 clear_tsk_thread_flag(p, TIF_FREEZE);
57 task_unlock(p);
58 return 0;
59} 59}
60 60
61extern void refrigerator(void); 61extern void refrigerator(void);
@@ -71,14 +71,55 @@ static inline int try_to_freeze(void)
71 return 0; 71 return 0;
72} 72}
73 73
74extern void thaw_some_processes(int all); 74/*
75 * The PF_FREEZER_SKIP flag should be set by a vfork parent right before it
76 * calls wait_for_completion(&vfork) and reset right after it returns from this
77 * function. Next, the parent should call try_to_freeze() to freeze itself
78 * appropriately in case the child has exited before the freezing of tasks is
79 * complete. However, we don't want kernel threads to be frozen in unexpected
80 * places, so we allow them to block freeze_processes() instead or to set
81 * PF_NOFREEZE if needed and PF_FREEZER_SKIP is only set for userland vfork
82 * parents. Fortunately, in the ____call_usermodehelper() case the parent won't
83 * really block freeze_processes(), since ____call_usermodehelper() (the child)
84 * does a little before exec/exit and it can't be frozen before waking up the
85 * parent.
86 */
87
88/*
89 * If the current task is a user space one, tell the freezer not to count it as
90 * freezable.
91 */
92static inline void freezer_do_not_count(void)
93{
94 if (current->mm)
95 current->flags |= PF_FREEZER_SKIP;
96}
97
98/*
99 * If the current task is a user space one, tell the freezer to count it as
100 * freezable again and try to freeze it.
101 */
102static inline void freezer_count(void)
103{
104 if (current->mm) {
105 current->flags &= ~PF_FREEZER_SKIP;
106 try_to_freeze();
107 }
108}
109
110/*
111 * Check if the task should be counted as freezeable by the freezer
112 */
113static inline int freezer_should_skip(struct task_struct *p)
114{
115 return !!(p->flags & PF_FREEZER_SKIP);
116}
75 117
76#else 118#else
77static inline int frozen(struct task_struct *p) { return 0; } 119static inline int frozen(struct task_struct *p) { return 0; }
78static inline int freezing(struct task_struct *p) { return 0; } 120static inline int freezing(struct task_struct *p) { return 0; }
79static inline void freeze(struct task_struct *p) { BUG(); } 121static inline void freeze(struct task_struct *p) { BUG(); }
80static inline int thaw_process(struct task_struct *p) { return 1; } 122static inline int thaw_process(struct task_struct *p) { return 1; }
81static inline void frozen_process(struct task_struct *p) { BUG(); }
82 123
83static inline void refrigerator(void) {} 124static inline void refrigerator(void) {}
84static inline int freeze_processes(void) { BUG(); return 0; } 125static inline int freeze_processes(void) { BUG(); return 0; }
@@ -86,5 +127,7 @@ static inline void thaw_processes(void) {}
86 127
87static inline int try_to_freeze(void) { return 0; } 128static inline int try_to_freeze(void) { return 0; }
88 129
89 130static inline void freezer_do_not_count(void) {}
131static inline void freezer_count(void) {}
132static inline int freezer_should_skip(struct task_struct *p) { return 0; }
90#endif 133#endif
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 4c03ee353e78..9756fc102a83 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -66,6 +66,7 @@ struct partition {
66#include <linux/smp.h> 66#include <linux/smp.h>
67#include <linux/string.h> 67#include <linux/string.h>
68#include <linux/fs.h> 68#include <linux/fs.h>
69#include <linux/workqueue.h>
69 70
70struct partition { 71struct partition {
71 unsigned char boot_ind; /* 0x80 - active */ 72 unsigned char boot_ind; /* 0x80 - active */
@@ -94,6 +95,7 @@ struct hd_struct {
94 95
95#define GENHD_FL_REMOVABLE 1 96#define GENHD_FL_REMOVABLE 1
96#define GENHD_FL_DRIVERFS 2 97#define GENHD_FL_DRIVERFS 2
98#define GENHD_FL_MEDIA_CHANGE_NOTIFY 4
97#define GENHD_FL_CD 8 99#define GENHD_FL_CD 8
98#define GENHD_FL_UP 16 100#define GENHD_FL_UP 16
99#define GENHD_FL_SUPPRESS_PARTITION_INFO 32 101#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
@@ -138,6 +140,7 @@ struct gendisk {
138#else 140#else
139 struct disk_stats dkstats; 141 struct disk_stats dkstats;
140#endif 142#endif
143 struct work_struct async_notify;
141}; 144};
142 145
143/* Structure for sysfs attributes on block devices */ 146/* Structure for sysfs attributes on block devices */
@@ -419,7 +422,7 @@ extern struct gendisk *alloc_disk_node(int minors, int node_id);
419extern struct gendisk *alloc_disk(int minors); 422extern struct gendisk *alloc_disk(int minors);
420extern struct kobject *get_disk(struct gendisk *disk); 423extern struct kobject *get_disk(struct gendisk *disk);
421extern void put_disk(struct gendisk *disk); 424extern void put_disk(struct gendisk *disk);
422 425extern void genhd_media_change_notify(struct gendisk *disk);
423extern void blk_register_region(dev_t dev, unsigned long range, 426extern void blk_register_region(dev_t dev, unsigned long range,
424 struct module *module, 427 struct module *module,
425 struct kobject *(*probe)(dev_t, int *, void *), 428 struct kobject *(*probe)(dev_t, int *, void *),
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 1db774cf9dc2..3213f6f4aa58 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -33,6 +33,7 @@
33#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ 33#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
34#define ETH_DATA_LEN 1500 /* Max. octets in payload */ 34#define ETH_DATA_LEN 1500 /* Max. octets in payload */
35#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ 35#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
36#define ETH_FCS_LEN 4 /* Octets in the FCS */
36 37
37/* 38/*
38 * These are the defined Ethernet Protocol ID's. 39 * These are the defined Ethernet Protocol ID's.
diff --git a/include/linux/init.h b/include/linux/init.h
index e007ae4dc41e..56ec4c62eee0 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -45,6 +45,19 @@
45#define __exitdata __attribute__ ((__section__(".exit.data"))) 45#define __exitdata __attribute__ ((__section__(".exit.data")))
46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) 46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
47 47
48/* modpost check for section mismatches during the kernel build.
49 * A section mismatch happens when there are references from a
50 * code or data section to an init section (both code or data).
51 * The init sections are (for most archs) discarded by the kernel
52 * when early init has completed so all such references are potential bugs.
53 * For exit sections the same issue exists.
54 * The following markers are used for the cases where the reference to
55 * the init/exit section (code or data) is valid and will teach modpost
56 * not to issue a warning.
57 * The markers follow same syntax rules as __init / __initdata. */
58#define __init_refok noinline __attribute__ ((__section__ (".text.init.refok")))
59#define __initdata_refok __attribute__ ((__section__ (".data.init.refok")))
60
48#ifdef MODULE 61#ifdef MODULE
49#define __exit __attribute__ ((__section__(".exit.text"))) 62#define __exit __attribute__ ((__section__(".exit.text")))
50#else 63#else
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 09ea01a8a99c..648bd1f0912d 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -209,9 +209,8 @@ enum {
209 DEVCONF_RTR_PROBE_INTERVAL, 209 DEVCONF_RTR_PROBE_INTERVAL,
210 DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, 210 DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
211 DEVCONF_PROXY_NDP, 211 DEVCONF_PROXY_NDP,
212 __DEVCONF_OPTIMISTIC_DAD,
213 DEVCONF_ACCEPT_SOURCE_ROUTE,
214 DEVCONF_OPTIMISTIC_DAD, 212 DEVCONF_OPTIMISTIC_DAD,
213 DEVCONF_ACCEPT_SOURCE_ROUTE,
215 DEVCONF_MAX 214 DEVCONF_MAX
216}; 215};
217 216
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 666592ef0b25..85f7b1bd1482 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -574,8 +574,6 @@ struct ata_port_operations {
574 void (*phy_reset) (struct ata_port *ap); /* obsolete */ 574 void (*phy_reset) (struct ata_port *ap); /* obsolete */
575 int (*set_mode) (struct ata_port *ap, struct ata_device **r_failed_dev); 575 int (*set_mode) (struct ata_port *ap, struct ata_device **r_failed_dev);
576 576
577 void (*post_set_mode) (struct ata_port *ap);
578
579 int (*cable_detect) (struct ata_port *ap); 577 int (*cable_detect) (struct ata_port *ap);
580 578
581 int (*check_atapi_dma) (struct ata_queued_cmd *qc); 579 int (*check_atapi_dma) (struct ata_queued_cmd *qc);
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 4670ebd1f622..e4183c6c7de3 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_MM_H 1#ifndef _LINUX_MM_H
2#define _LINUX_MM_H 2#define _LINUX_MM_H
3 3
4#include <linux/sched.h>
5#include <linux/errno.h> 4#include <linux/errno.h>
6#include <linux/capability.h> 5#include <linux/capability.h>
7 6
@@ -20,6 +19,7 @@
20 19
21struct mempolicy; 20struct mempolicy;
22struct anon_vma; 21struct anon_vma;
22struct user_struct;
23 23
24#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ 24#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */
25extern unsigned long max_mapnr; 25extern unsigned long max_mapnr;
@@ -717,14 +717,7 @@ extern unsigned long shmem_get_unmapped_area(struct file *file,
717 unsigned long flags); 717 unsigned long flags);
718#endif 718#endif
719 719
720static inline int can_do_mlock(void) 720extern int can_do_mlock(void);
721{
722 if (capable(CAP_IPC_LOCK))
723 return 1;
724 if (current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur != 0)
725 return 1;
726 return 0;
727}
728extern int user_shm_lock(size_t, struct user_struct *); 721extern int user_shm_lock(size_t, struct user_struct *);
729extern void user_shm_unlock(size_t, struct user_struct *); 722extern void user_shm_unlock(size_t, struct user_struct *);
730 723
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f671cd2f133f..3a70f553b28f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -910,6 +910,17 @@ static inline int netif_rx_reschedule(struct net_device *dev, int undo)
910 return 0; 910 return 0;
911} 911}
912 912
913/* same as netif_rx_complete, except that local_irq_save(flags)
914 * has already been issued
915 */
916static inline void __netif_rx_complete(struct net_device *dev)
917{
918 BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
919 list_del(&dev->poll_list);
920 smp_mb__before_clear_bit();
921 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
922}
923
913/* Remove interface from poll list: it must be in the poll list 924/* Remove interface from poll list: it must be in the poll list
914 * on current cpu. This primitive is called by dev->poll(), when 925 * on current cpu. This primitive is called by dev->poll(), when
915 * it completes the work. The device cannot be out of poll list at this 926 * it completes the work. The device cannot be out of poll list at this
@@ -920,10 +931,7 @@ static inline void netif_rx_complete(struct net_device *dev)
920 unsigned long flags; 931 unsigned long flags;
921 932
922 local_irq_save(flags); 933 local_irq_save(flags);
923 BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state)); 934 __netif_rx_complete(dev);
924 list_del(&dev->poll_list);
925 smp_mb__before_clear_bit();
926 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
927 local_irq_restore(flags); 935 local_irq_restore(flags);
928} 936}
929 937
@@ -940,17 +948,6 @@ static inline void netif_poll_enable(struct net_device *dev)
940 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 948 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
941} 949}
942 950
943/* same as netif_rx_complete, except that local_irq_save(flags)
944 * has already been issued
945 */
946static inline void __netif_rx_complete(struct net_device *dev)
947{
948 BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
949 list_del(&dev->poll_list);
950 smp_mb__before_clear_bit();
951 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
952}
953
954static inline void netif_tx_lock(struct net_device *dev) 951static inline void netif_tx_lock(struct net_device *dev)
955{ 952{
956 spin_lock(&dev->_xmit_lock); 953 spin_lock(&dev->_xmit_lock);
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h
index 81453ea7e4c2..b7c360ffd0d0 100644
--- a/include/linux/netfilter/nf_conntrack_ftp.h
+++ b/include/linux/netfilter/nf_conntrack_ftp.h
@@ -37,8 +37,7 @@ extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff **pskb,
37 enum nf_ct_ftp_type type, 37 enum nf_ct_ftp_type type,
38 unsigned int matchoff, 38 unsigned int matchoff,
39 unsigned int matchlen, 39 unsigned int matchlen,
40 struct nf_conntrack_expect *exp, 40 struct nf_conntrack_expect *exp);
41 u32 *seq);
42#endif /* __KERNEL__ */ 41#endif /* __KERNEL__ */
43 42
44#endif /* _NF_CONNTRACK_FTP_H */ 43#endif /* _NF_CONNTRACK_FTP_H */
diff --git a/include/linux/netfilter/nf_conntrack_h323_types.h b/include/linux/netfilter/nf_conntrack_h323_types.h
index 38d74d5c9700..f35b6b4801e7 100644
--- a/include/linux/netfilter/nf_conntrack_h323_types.h
+++ b/include/linux/netfilter/nf_conntrack_h323_types.h
@@ -1,4 +1,4 @@
1/* Generated by Jing Min Zhao's ASN.1 parser, Apr 20 2006 1/* Generated by Jing Min Zhao's ASN.1 parser, May 16 2007
2 * 2 *
3 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net> 3 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net>
4 * 4 *
@@ -12,7 +12,7 @@ typedef struct TransportAddress_ipAddress { /* SEQUENCE */
12 12
13typedef struct TransportAddress_ip6Address { /* SEQUENCE */ 13typedef struct TransportAddress_ip6Address { /* SEQUENCE */
14 int options; /* No use */ 14 int options; /* No use */
15 unsigned ip6; 15 unsigned ip;
16} TransportAddress_ip6Address; 16} TransportAddress_ip6Address;
17 17
18typedef struct TransportAddress { /* CHOICE */ 18typedef struct TransportAddress { /* CHOICE */
@@ -364,23 +364,6 @@ typedef struct Alerting_UUIE { /* SEQUENCE */
364 Alerting_UUIE_fastStart fastStart; 364 Alerting_UUIE_fastStart fastStart;
365} Alerting_UUIE; 365} Alerting_UUIE;
366 366
367typedef struct Information_UUIE_fastStart { /* SEQUENCE OF */
368 int count;
369 OpenLogicalChannel item[30];
370} Information_UUIE_fastStart;
371
372typedef struct Information_UUIE { /* SEQUENCE */
373 enum {
374 eInformation_UUIE_callIdentifier = (1 << 31),
375 eInformation_UUIE_tokens = (1 << 30),
376 eInformation_UUIE_cryptoTokens = (1 << 29),
377 eInformation_UUIE_fastStart = (1 << 28),
378 eInformation_UUIE_fastConnectRefused = (1 << 27),
379 eInformation_UUIE_circuitInfo = (1 << 26),
380 } options;
381 Information_UUIE_fastStart fastStart;
382} Information_UUIE;
383
384typedef struct FacilityReason { /* CHOICE */ 367typedef struct FacilityReason { /* CHOICE */
385 enum { 368 enum {
386 eFacilityReason_routeCallToGatekeeper, 369 eFacilityReason_routeCallToGatekeeper,
@@ -471,7 +454,6 @@ typedef struct H323_UU_PDU_h323_message_body { /* CHOICE */
471 CallProceeding_UUIE callProceeding; 454 CallProceeding_UUIE callProceeding;
472 Connect_UUIE connect; 455 Connect_UUIE connect;
473 Alerting_UUIE alerting; 456 Alerting_UUIE alerting;
474 Information_UUIE information;
475 Facility_UUIE facility; 457 Facility_UUIE facility;
476 Progress_UUIE progress; 458 Progress_UUIE progress;
477 }; 459 };
@@ -561,6 +543,7 @@ typedef struct OpenLogicalChannelAck { /* SEQUENCE */
561 } options; 543 } options;
562 OpenLogicalChannelAck_reverseLogicalChannelParameters 544 OpenLogicalChannelAck_reverseLogicalChannelParameters
563 reverseLogicalChannelParameters; 545 reverseLogicalChannelParameters;
546 NetworkAccessParameters separateStack;
564 OpenLogicalChannelAck_forwardMultiplexAckParameters 547 OpenLogicalChannelAck_forwardMultiplexAckParameters
565 forwardMultiplexAckParameters; 548 forwardMultiplexAckParameters;
566} OpenLogicalChannelAck; 549} OpenLogicalChannelAck;
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 41afab6b5f09..bd193af80162 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -81,6 +81,7 @@ extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
81extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, 81extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *,
82 struct nfs_page *); 82 struct nfs_page *);
83extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc); 83extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc);
84extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t);
84extern int nfs_wait_on_request(struct nfs_page *); 85extern int nfs_wait_on_request(struct nfs_page *);
85extern void nfs_unlock_request(struct nfs_page *req); 86extern void nfs_unlock_request(struct nfs_page *req);
86extern int nfs_set_page_writeback_locked(struct nfs_page *req); 87extern int nfs_set_page_writeback_locked(struct nfs_page *req);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 62b3e008e641..6a115cffea34 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -371,6 +371,7 @@
371#define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385 371#define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385
372#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c 372#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c
373#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 373#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390
374#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c
374 375
375#define PCI_VENDOR_ID_VLSI 0x1004 376#define PCI_VENDOR_ID_VLSI 0x1004
376#define PCI_DEVICE_ID_VLSI_82C592 0x0005 377#define PCI_DEVICE_ID_VLSI_82C592 0x0005
@@ -1291,6 +1292,7 @@
1291#define PCI_DEVICE_ID_VIA_P4M890 0x0327 1292#define PCI_DEVICE_ID_VIA_P4M890 0x0327
1292#define PCI_DEVICE_ID_VIA_VT3324 0x0324 1293#define PCI_DEVICE_ID_VIA_VT3324 0x0324
1293#define PCI_DEVICE_ID_VIA_VT3336 0x0336 1294#define PCI_DEVICE_ID_VIA_VT3336 0x0336
1295#define PCI_DEVICE_ID_VIA_VT3351 0x0351
1294#define PCI_DEVICE_ID_VIA_8371_0 0x0391 1296#define PCI_DEVICE_ID_VIA_8371_0 0x0391
1295#define PCI_DEVICE_ID_VIA_8501_0 0x0501 1297#define PCI_DEVICE_ID_VIA_8501_0 0x0501
1296#define PCI_DEVICE_ID_VIA_82C561 0x0561 1298#define PCI_DEVICE_ID_VIA_82C561 0x0561
@@ -1436,6 +1438,7 @@
1436#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 1438#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009
1437#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 1439#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017
1438#define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103 1440#define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103
1441#define PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX 0x0104
1439#define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132 1442#define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132
1440#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 1443#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200
1441#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 1444#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201
@@ -2266,11 +2269,11 @@
2266#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e 2269#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
2267#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 2270#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
2268#define PCI_DEVICE_ID_INTEL_ICH9_0 0x2910 2271#define PCI_DEVICE_ID_INTEL_ICH9_0 0x2910
2269#define PCI_DEVICE_ID_INTEL_ICH9_1 0x2911 2272#define PCI_DEVICE_ID_INTEL_ICH9_1 0x2917
2270#define PCI_DEVICE_ID_INTEL_ICH9_2 0x2912 2273#define PCI_DEVICE_ID_INTEL_ICH9_2 0x2912
2271#define PCI_DEVICE_ID_INTEL_ICH9_3 0x2913 2274#define PCI_DEVICE_ID_INTEL_ICH9_3 0x2913
2272#define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914 2275#define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914
2273#define PCI_DEVICE_ID_INTEL_ICH9_5 0x2915 2276#define PCI_DEVICE_ID_INTEL_ICH9_5 0x2919
2274#define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930 2277#define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930
2275#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2278#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2276#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2279#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 6db9a4c15355..dd5a05d03d4f 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -232,6 +232,7 @@ struct bitmap {
232 struct page **filemap; /* list of cache pages for the file */ 232 struct page **filemap; /* list of cache pages for the file */
233 unsigned long *filemap_attr; /* attributes associated w/ filemap pages */ 233 unsigned long *filemap_attr; /* attributes associated w/ filemap pages */
234 unsigned long file_pages; /* number of pages in the file */ 234 unsigned long file_pages; /* number of pages in the file */
235 int last_page_size; /* bytes in the last page */
235 236
236 unsigned long flags; 237 unsigned long flags;
237 238
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a81897e2a244..d58e74b98367 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1182,6 +1182,7 @@ static inline void put_task_struct(struct task_struct *t)
1182#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ 1182#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */
1183#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ 1183#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
1184#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ 1184#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */
1185#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */
1185 1186
1186/* 1187/*
1187 * Only the _current_ task can read/write to tsk->flags, but other 1188 * Only the _current_ task can read/write to tsk->flags, but other
@@ -1615,11 +1616,13 @@ static inline int lock_need_resched(spinlock_t *lock)
1615 return 0; 1616 return 0;
1616} 1617}
1617 1618
1618/* Reevaluate whether the task has signals pending delivery. 1619/*
1619 This is required every time the blocked sigset_t changes. 1620 * Reevaluate whether the task has signals pending delivery.
1620 callers must hold sighand->siglock. */ 1621 * Wake the task if so.
1621 1622 * This is required every time the blocked sigset_t changes.
1622extern FASTCALL(void recalc_sigpending_tsk(struct task_struct *t)); 1623 * callers must hold sighand->siglock.
1624 */
1625extern void recalc_sigpending_and_wake(struct task_struct *t);
1623extern void recalc_sigpending(void); 1626extern void recalc_sigpending(void);
1624 1627
1625extern void signal_wake_up(struct task_struct *t, int resume_stopped); 1628extern void signal_wake_up(struct task_struct *t, int resume_stopped);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index a3ac4c896831..7f2c99d66e9d 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -152,6 +152,7 @@
152#include <linux/sched.h> 152#include <linux/sched.h>
153#include <linux/tty.h> 153#include <linux/tty.h>
154#include <linux/mutex.h> 154#include <linux/mutex.h>
155#include <linux/sysrq.h>
155 156
156struct uart_port; 157struct uart_port;
157struct uart_info; 158struct uart_info;
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
index 13b3af547864..2c5cd55f44ff 100644
--- a/include/linux/smb_fs.h
+++ b/include/linux/smb_fs.h
@@ -29,6 +29,7 @@
29#include <linux/pagemap.h> 29#include <linux/pagemap.h>
30#include <linux/vmalloc.h> 30#include <linux/vmalloc.h>
31#include <linux/smb_mount.h> 31#include <linux/smb_mount.h>
32#include <linux/jiffies.h>
32#include <asm/unaligned.h> 33#include <asm/unaligned.h>
33 34
34static inline struct smb_sb_info *SMB_SB(struct super_block *sb) 35static inline struct smb_sb_info *SMB_SB(struct super_block *sb)
diff --git a/include/linux/task_io_accounting_ops.h b/include/linux/task_io_accounting_ops.h
index 1218733ec6b5..ff46c6fad79d 100644
--- a/include/linux/task_io_accounting_ops.h
+++ b/include/linux/task_io_accounting_ops.h
@@ -4,6 +4,8 @@
4#ifndef __TASK_IO_ACCOUNTING_OPS_INCLUDED 4#ifndef __TASK_IO_ACCOUNTING_OPS_INCLUDED
5#define __TASK_IO_ACCOUNTING_OPS_INCLUDED 5#define __TASK_IO_ACCOUNTING_OPS_INCLUDED
6 6
7#include <linux/sched.h>
8
7#ifdef CONFIG_TASK_IO_ACCOUNTING 9#ifdef CONFIG_TASK_IO_ACCOUNTING
8static inline void task_io_account_read(size_t bytes) 10static inline void task_io_account_read(size_t bytes)
9{ 11{
diff --git a/include/linux/timer.h b/include/linux/timer.h
index e0c5c16c992f..c661710d3627 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -69,6 +69,12 @@ extern int __mod_timer(struct timer_list *timer, unsigned long expires);
69extern int mod_timer(struct timer_list *timer, unsigned long expires); 69extern int mod_timer(struct timer_list *timer, unsigned long expires);
70 70
71/* 71/*
72 * The jiffies value which is added to now, when there is no timer
73 * in the timer wheel:
74 */
75#define NEXT_TIMER_MAX_DELTA ((1UL << 30) - 1)
76
77/*
72 * Return when the next timer-wheel timeout occurs (in absolute jiffies), 78 * Return when the next timer-wheel timeout occurs (in absolute jiffies),
73 * locks the timer base: 79 * locks the timer base:
74 */ 80 */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index a25c2afa67e1..e7560389079c 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -267,8 +267,6 @@ struct v4l2_pix_format
267 __u32 sizeimage; 267 __u32 sizeimage;
268 enum v4l2_colorspace colorspace; 268 enum v4l2_colorspace colorspace;
269 __u32 priv; /* private data, depends on pixelformat */ 269 __u32 priv; /* private data, depends on pixelformat */
270 __u32 left; /* only valid if V4L2_CAP_VIDEO_OUTPUT_POS is set */
271 __u32 top; /* only valid if V4L2_CAP_VIDEO_OUTPUT_POS is set */
272}; 270};
273 271
274/* Pixel format FOURCC depth Description */ 272/* Pixel format FOURCC depth Description */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 050915b59576..4ef4d22e5e43 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -4,6 +4,8 @@
4#ifndef WRITEBACK_H 4#ifndef WRITEBACK_H
5#define WRITEBACK_H 5#define WRITEBACK_H
6 6
7#include <linux/sched.h>
8
7struct backing_dev_info; 9struct backing_dev_info;
8 10
9extern spinlock_t inode_lock; 11extern spinlock_t inode_lock;
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 8242a0ee1f58..87df4e87622d 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -129,8 +129,10 @@ struct l2cap_conf_rsp {
129 __u8 data[0]; 129 __u8 data[0];
130} __attribute__ ((packed)); 130} __attribute__ ((packed));
131 131
132#define L2CAP_CONF_SUCCESS 0x00 132#define L2CAP_CONF_SUCCESS 0x0000
133#define L2CAP_CONF_UNACCEPT 0x01 133#define L2CAP_CONF_UNACCEPT 0x0001
134#define L2CAP_CONF_REJECT 0x0002
135#define L2CAP_CONF_UNKNOWN 0x0003
134 136
135struct l2cap_conf_opt { 137struct l2cap_conf_opt {
136 __u8 type; 138 __u8 type;
@@ -215,6 +217,8 @@ struct l2cap_pinfo {
215 217
216 __u32 link_mode; 218 __u32 link_mode;
217 219
220 __u8 conf_req[64];
221 __u8 conf_len;
218 __u8 conf_state; 222 __u8 conf_state;
219 __u8 conf_retry; 223 __u8 conf_retry;
220 __u16 conf_mtu; 224 __u16 conf_mtu;
diff --git a/include/net/dst.h b/include/net/dst.h
index e12a8ce0b9b3..82270f9332db 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -265,9 +265,16 @@ static inline int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
265{ 265{
266 return 0; 266 return 0;
267} 267}
268static inline int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
269 struct sock *sk, int flags)
270{
271 return 0;
272}
268#else 273#else
269extern int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, 274extern int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
270 struct sock *sk, int flags); 275 struct sock *sk, int flags);
276extern int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
277 struct sock *sk, int flags);
271#endif 278#endif
272#endif 279#endif
273 280
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 4fa5dfe886c4..78a0d06d98d5 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -469,6 +469,9 @@ extern void ip6_flush_pending_frames(struct sock *sk);
469extern int ip6_dst_lookup(struct sock *sk, 469extern int ip6_dst_lookup(struct sock *sk,
470 struct dst_entry **dst, 470 struct dst_entry **dst,
471 struct flowi *fl); 471 struct flowi *fl);
472extern int ip6_dst_blackhole(struct sock *sk,
473 struct dst_entry **dst,
474 struct flowi *fl);
472extern int ip6_sk_dst_lookup(struct sock *sk, 475extern int ip6_sk_dst_lookup(struct sock *sk,
473 struct dst_entry **dst, 476 struct dst_entry **dst,
474 struct flowi *fl); 477 struct flowi *fl);
diff --git a/include/net/sock.h b/include/net/sock.h
index 689b886038da..dfeb8b13024f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -218,13 +218,13 @@ struct sock {
218 atomic_t sk_rmem_alloc; 218 atomic_t sk_rmem_alloc;
219 atomic_t sk_wmem_alloc; 219 atomic_t sk_wmem_alloc;
220 atomic_t sk_omem_alloc; 220 atomic_t sk_omem_alloc;
221 int sk_sndbuf;
221 struct sk_buff_head sk_receive_queue; 222 struct sk_buff_head sk_receive_queue;
222 struct sk_buff_head sk_write_queue; 223 struct sk_buff_head sk_write_queue;
223 struct sk_buff_head sk_async_wait_queue; 224 struct sk_buff_head sk_async_wait_queue;
224 int sk_wmem_queued; 225 int sk_wmem_queued;
225 int sk_forward_alloc; 226 int sk_forward_alloc;
226 gfp_t sk_allocation; 227 gfp_t sk_allocation;
227 int sk_sndbuf;
228 int sk_route_caps; 228 int sk_route_caps;
229 int sk_gso_type; 229 int sk_gso_type;
230 int sk_rcvlowat; 230 int sk_rcvlowat;
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e22b4f0305a3..a8af9ae00177 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -254,6 +254,12 @@ static inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
254 return seq3 - seq2 >= seq1 - seq2; 254 return seq3 - seq2 >= seq1 - seq2;
255} 255}
256 256
257static inline int tcp_too_many_orphans(struct sock *sk, int num)
258{
259 return (num > sysctl_tcp_max_orphans) ||
260 (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
261 atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]);
262}
257 263
258extern struct proto tcp_prot; 264extern struct proto tcp_prot;
259 265
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 39ef925d39dd..90185e8b335e 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -237,7 +237,6 @@ extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo);
237extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); 237extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo);
238extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); 238extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c);
239extern void km_state_notify(struct xfrm_state *x, struct km_event *c); 239extern void km_state_notify(struct xfrm_state *x, struct km_event *c);
240#define XFRM_ACQ_EXPIRES 30
241 240
242struct xfrm_tmpl; 241struct xfrm_tmpl;
243extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); 242extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol);
diff --git a/include/rdma/ib_umem.h b/include/rdma/ib_umem.h
index b3a36f7d79e5..c533d6c7903f 100644
--- a/include/rdma/ib_umem.h
+++ b/include/rdma/ib_umem.h
@@ -35,6 +35,7 @@
35 35
36#include <linux/list.h> 36#include <linux/list.h>
37#include <linux/scatterlist.h> 37#include <linux/scatterlist.h>
38#include <linux/workqueue.h>
38 39
39struct ib_ucontext; 40struct ib_ucontext;
40 41
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 47cefca59c89..0627a6aa282a 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -890,6 +890,8 @@ struct ib_device {
890 spinlock_t client_data_lock; 890 spinlock_t client_data_lock;
891 891
892 struct ib_cache cache; 892 struct ib_cache cache;
893 int *pkey_tbl_len;
894 int *gid_tbl_len;
893 895
894 u32 flags; 896 u32 flags;
895 897
@@ -1118,6 +1120,12 @@ int ib_modify_port(struct ib_device *device,
1118 u8 port_num, int port_modify_mask, 1120 u8 port_num, int port_modify_mask,
1119 struct ib_port_modify *port_modify); 1121 struct ib_port_modify *port_modify);
1120 1122
1123int ib_find_gid(struct ib_device *device, union ib_gid *gid,
1124 u8 *port_num, u16 *index);
1125
1126int ib_find_pkey(struct ib_device *device,
1127 u8 port_num, u16 pkey, u16 *index);
1128
1121/** 1129/**
1122 * ib_alloc_pd - Allocates an unused protection domain. 1130 * ib_alloc_pd - Allocates an unused protection domain.
1123 * @device: The device on which to allocate the protection domain. 1131 * @device: The device on which to allocate the protection domain.
diff --git a/include/sound/version.h b/include/sound/version.h
index 50ee4fd420fa..8e5b2f0f5946 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by alsa/ksync script. */ 1/* include/version.h. Generated by alsa/ksync script. */
2#define CONFIG_SND_VERSION "1.0.14rc4" 2#define CONFIG_SND_VERSION "1.0.14"
3#define CONFIG_SND_DATE " (Wed May 16 09:45:46 2007 UTC)" 3#define CONFIG_SND_DATE " (Thu May 31 09:03:25 2007 UTC)"
diff --git a/init/main.c b/init/main.c
index 1940fa75e82e..eb8bdbae4fc7 100644
--- a/init/main.c
+++ b/init/main.c
@@ -423,7 +423,7 @@ static void __init setup_command_line(char *command_line)
423 * gcc-3.4 accidentally inlines this function, so use noinline. 423 * gcc-3.4 accidentally inlines this function, so use noinline.
424 */ 424 */
425 425
426static void noinline rest_init(void) 426static void noinline __init_refok rest_init(void)
427 __releases(kernel_lock) 427 __releases(kernel_lock)
428{ 428{
429 int pid; 429 int pid;
diff --git a/kernel/exit.c b/kernel/exit.c
index c6d14b8008dd..5b888c24e43e 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -762,11 +762,8 @@ static void exit_notify(struct task_struct *tsk)
762 read_lock(&tasklist_lock); 762 read_lock(&tasklist_lock);
763 spin_lock_irq(&tsk->sighand->siglock); 763 spin_lock_irq(&tsk->sighand->siglock);
764 for (t = next_thread(tsk); t != tsk; t = next_thread(t)) 764 for (t = next_thread(tsk); t != tsk; t = next_thread(t))
765 if (!signal_pending(t) && !(t->flags & PF_EXITING)) { 765 if (!signal_pending(t) && !(t->flags & PF_EXITING))
766 recalc_sigpending_tsk(t); 766 recalc_sigpending_and_wake(t);
767 if (signal_pending(t))
768 signal_wake_up(t, 0);
769 }
770 spin_unlock_irq(&tsk->sighand->siglock); 767 spin_unlock_irq(&tsk->sighand->siglock);
771 read_unlock(&tasklist_lock); 768 read_unlock(&tasklist_lock);
772 } 769 }
diff --git a/kernel/fork.c b/kernel/fork.c
index 87069cfc18a1..73ad5cda1bcd 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -45,6 +45,7 @@
45#include <linux/acct.h> 45#include <linux/acct.h>
46#include <linux/tsacct_kern.h> 46#include <linux/tsacct_kern.h>
47#include <linux/cn_proc.h> 47#include <linux/cn_proc.h>
48#include <linux/freezer.h>
48#include <linux/delayacct.h> 49#include <linux/delayacct.h>
49#include <linux/taskstats_kern.h> 50#include <linux/taskstats_kern.h>
50#include <linux/random.h> 51#include <linux/random.h>
@@ -1405,7 +1406,9 @@ long do_fork(unsigned long clone_flags,
1405 } 1406 }
1406 1407
1407 if (clone_flags & CLONE_VFORK) { 1408 if (clone_flags & CLONE_VFORK) {
1409 freezer_do_not_count();
1408 wait_for_completion(&vfork); 1410 wait_for_completion(&vfork);
1411 freezer_count();
1409 if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE)) { 1412 if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE)) {
1410 current->ptrace_message = nr; 1413 current->ptrace_message = nr;
1411 ptrace_notify ((PTRACE_EVENT_VFORK_DONE << 8) | SIGTRAP); 1414 ptrace_notify ((PTRACE_EVENT_VFORK_DONE << 8) | SIGTRAP);
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
index 338a9b489fbc..27478948b318 100644
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -144,20 +144,21 @@ asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
144 struct timespec ts; 144 struct timespec ts;
145 ktime_t t, *tp = NULL; 145 ktime_t t, *tp = NULL;
146 int val2 = 0; 146 int val2 = 0;
147 int cmd = op & FUTEX_CMD_MASK;
147 148
148 if (utime && (op == FUTEX_WAIT || op == FUTEX_LOCK_PI)) { 149 if (utime && (cmd == FUTEX_WAIT || cmd == FUTEX_LOCK_PI)) {
149 if (get_compat_timespec(&ts, utime)) 150 if (get_compat_timespec(&ts, utime))
150 return -EFAULT; 151 return -EFAULT;
151 if (!timespec_valid(&ts)) 152 if (!timespec_valid(&ts))
152 return -EINVAL; 153 return -EINVAL;
153 154
154 t = timespec_to_ktime(ts); 155 t = timespec_to_ktime(ts);
155 if (op == FUTEX_WAIT) 156 if (cmd == FUTEX_WAIT)
156 t = ktime_add(ktime_get(), t); 157 t = ktime_add(ktime_get(), t);
157 tp = &t; 158 tp = &t;
158 } 159 }
159 if (op == FUTEX_REQUEUE || op == FUTEX_CMP_REQUEUE 160 if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE
160 || op == FUTEX_CMP_REQUEUE_PI) 161 || cmd == FUTEX_CMP_REQUEUE_PI)
161 val2 = (int) (unsigned long) utime; 162 val2 = (int) (unsigned long) utime;
162 163
163 return do_futex(uaddr, op, val, tp, uaddr2, val2, val3); 164 return do_futex(uaddr, op, val, tp, uaddr2, val2, val3);
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index b0d81aae472f..bd9e272d55e9 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -135,6 +135,39 @@ report_bad_irq(unsigned int irq, struct irq_desc *desc, irqreturn_t action_ret)
135 } 135 }
136} 136}
137 137
138static inline int try_misrouted_irq(unsigned int irq, struct irq_desc *desc, irqreturn_t action_ret)
139{
140 struct irqaction *action;
141
142 if (!irqfixup)
143 return 0;
144
145 /* We didn't actually handle the IRQ - see if it was misrouted? */
146 if (action_ret == IRQ_NONE)
147 return 1;
148
149 /*
150 * But for 'irqfixup == 2' we also do it for handled interrupts if
151 * they are marked as IRQF_IRQPOLL (or for irq zero, which is the
152 * traditional PC timer interrupt.. Legacy)
153 */
154 if (irqfixup < 2)
155 return 0;
156
157 if (!irq)
158 return 1;
159
160 /*
161 * Since we don't get the descriptor lock, "action" can
162 * change under us. We don't really care, but we don't
163 * want to follow a NULL pointer. So tell the compiler to
164 * just load it once by using a barrier.
165 */
166 action = desc->action;
167 barrier();
168 return action && (action->flags & IRQF_IRQPOLL);
169}
170
138void note_interrupt(unsigned int irq, struct irq_desc *desc, 171void note_interrupt(unsigned int irq, struct irq_desc *desc,
139 irqreturn_t action_ret) 172 irqreturn_t action_ret)
140{ 173{
@@ -144,15 +177,10 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
144 report_bad_irq(irq, desc, action_ret); 177 report_bad_irq(irq, desc, action_ret);
145 } 178 }
146 179
147 if (unlikely(irqfixup)) { 180 if (unlikely(try_misrouted_irq(irq, desc, action_ret))) {
148 /* Don't punish working computers */ 181 int ok = misrouted_irq(irq);
149 if ((irqfixup == 2 && ((irq == 0) || 182 if (action_ret == IRQ_NONE)
150 (desc->action->flags & IRQF_IRQPOLL))) || 183 desc->irqs_unhandled -= ok;
151 action_ret == IRQ_NONE) {
152 int ok = misrouted_irq(irq);
153 if (action_ret == IRQ_NONE)
154 desc->irqs_unhandled -= ok;
155 }
156 } 184 }
157 185
158 desc->irq_count++; 186 desc->irq_count++;
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index f1bda23140b2..fed54418626c 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -257,7 +257,8 @@ const char *kallsyms_lookup(unsigned long addr,
257 pos = get_symbol_pos(addr, symbolsize, offset); 257 pos = get_symbol_pos(addr, symbolsize, offset);
258 /* Grab name */ 258 /* Grab name */
259 kallsyms_expand_symbol(get_symbol_offset(pos), namebuf); 259 kallsyms_expand_symbol(get_symbol_offset(pos), namebuf);
260 *modname = NULL; 260 if (modname)
261 *modname = NULL;
261 return namebuf; 262 return namebuf;
262 } 263 }
263 264
diff --git a/kernel/kthread.c b/kernel/kthread.c
index df8a8e8f6ca4..bbd51b81a3e8 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -70,7 +70,7 @@ static int kthread(void *_create)
70 data = create->data; 70 data = create->data;
71 71
72 /* OK, tell user we're spawned, wait for stop or wakeup */ 72 /* OK, tell user we're spawned, wait for stop or wakeup */
73 __set_current_state(TASK_INTERRUPTIBLE); 73 __set_current_state(TASK_UNINTERRUPTIBLE);
74 complete(&create->started); 74 complete(&create->started);
75 schedule(); 75 schedule();
76 76
@@ -162,7 +162,10 @@ EXPORT_SYMBOL(kthread_create);
162 */ 162 */
163void kthread_bind(struct task_struct *k, unsigned int cpu) 163void kthread_bind(struct task_struct *k, unsigned int cpu)
164{ 164{
165 BUG_ON(k->state != TASK_INTERRUPTIBLE); 165 if (k->state != TASK_UNINTERRUPTIBLE) {
166 WARN_ON(1);
167 return;
168 }
166 /* Must have done schedule() in kthread() before we set_task_cpu */ 169 /* Must have done schedule() in kthread() before we set_task_cpu */
167 wait_task_inactive(k); 170 wait_task_inactive(k);
168 set_task_cpu(k, cpu); 171 set_task_cpu(k, cpu);
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 088419387388..e0233d8422b9 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -31,16 +31,36 @@ static inline int freezeable(struct task_struct * p)
31 return 1; 31 return 1;
32} 32}
33 33
34/*
35 * freezing is complete, mark current process as frozen
36 */
37static inline void frozen_process(void)
38{
39 if (!unlikely(current->flags & PF_NOFREEZE)) {
40 current->flags |= PF_FROZEN;
41 wmb();
42 }
43 clear_tsk_thread_flag(current, TIF_FREEZE);
44}
45
34/* Refrigerator is place where frozen processes are stored :-). */ 46/* Refrigerator is place where frozen processes are stored :-). */
35void refrigerator(void) 47void refrigerator(void)
36{ 48{
37 /* Hmm, should we be allowed to suspend when there are realtime 49 /* Hmm, should we be allowed to suspend when there are realtime
38 processes around? */ 50 processes around? */
39 long save; 51 long save;
52
53 task_lock(current);
54 if (freezing(current)) {
55 frozen_process();
56 task_unlock(current);
57 } else {
58 task_unlock(current);
59 return;
60 }
40 save = current->state; 61 save = current->state;
41 pr_debug("%s entered refrigerator\n", current->comm); 62 pr_debug("%s entered refrigerator\n", current->comm);
42 63
43 frozen_process(current);
44 spin_lock_irq(&current->sighand->siglock); 64 spin_lock_irq(&current->sighand->siglock);
45 recalc_sigpending(); /* We sent fake signal, clean it up */ 65 recalc_sigpending(); /* We sent fake signal, clean it up */
46 spin_unlock_irq(&current->sighand->siglock); 66 spin_unlock_irq(&current->sighand->siglock);
@@ -81,7 +101,7 @@ static void cancel_freezing(struct task_struct *p)
81 pr_debug(" clean up: %s\n", p->comm); 101 pr_debug(" clean up: %s\n", p->comm);
82 do_not_freeze(p); 102 do_not_freeze(p);
83 spin_lock_irqsave(&p->sighand->siglock, flags); 103 spin_lock_irqsave(&p->sighand->siglock, flags);
84 recalc_sigpending_tsk(p); 104 recalc_sigpending_and_wake(p);
85 spin_unlock_irqrestore(&p->sighand->siglock, flags); 105 spin_unlock_irqrestore(&p->sighand->siglock, flags);
86 } 106 }
87} 107}
@@ -112,22 +132,12 @@ static unsigned int try_to_freeze_tasks(int freeze_user_space)
112 cancel_freezing(p); 132 cancel_freezing(p);
113 continue; 133 continue;
114 } 134 }
115 if (is_user_space(p)) { 135 if (freeze_user_space && !is_user_space(p))
116 if (!freeze_user_space) 136 continue;
117 continue; 137
118 138 freeze_process(p);
119 /* Freeze the task unless there is a vfork 139 if (!freezer_should_skip(p))
120 * completion pending 140 todo++;
121 */
122 if (!p->vfork_done)
123 freeze_process(p);
124 } else {
125 if (freeze_user_space)
126 continue;
127
128 freeze_process(p);
129 }
130 todo++;
131 } while_each_thread(g, p); 141 } while_each_thread(g, p);
132 read_unlock(&tasklist_lock); 142 read_unlock(&tasklist_lock);
133 yield(); /* Yield is okay here */ 143 yield(); /* Yield is okay here */
@@ -149,13 +159,16 @@ static unsigned int try_to_freeze_tasks(int freeze_user_space)
149 TIMEOUT / HZ, todo); 159 TIMEOUT / HZ, todo);
150 read_lock(&tasklist_lock); 160 read_lock(&tasklist_lock);
151 do_each_thread(g, p) { 161 do_each_thread(g, p) {
152 if (is_user_space(p) == !freeze_user_space) 162 if (freeze_user_space && !is_user_space(p))
153 continue; 163 continue;
154 164
155 if (freezeable(p) && !frozen(p)) 165 task_lock(p);
166 if (freezeable(p) && !frozen(p) &&
167 !freezer_should_skip(p))
156 printk(KERN_ERR " %s\n", p->comm); 168 printk(KERN_ERR " %s\n", p->comm);
157 169
158 cancel_freezing(p); 170 cancel_freezing(p);
171 task_unlock(p);
159 } while_each_thread(g, p); 172 } while_each_thread(g, p);
160 read_unlock(&tasklist_lock); 173 read_unlock(&tasklist_lock);
161 } 174 }
@@ -200,9 +213,7 @@ static void thaw_tasks(int thaw_user_space)
200 if (is_user_space(p) == !thaw_user_space) 213 if (is_user_space(p) == !thaw_user_space)
201 continue; 214 continue;
202 215
203 if (!thaw_process(p)) 216 thaw_process(p);
204 printk(KERN_WARNING " Strange, %s not stopped\n",
205 p->comm );
206 } while_each_thread(g, p); 217 } while_each_thread(g, p);
207 read_unlock(&tasklist_lock); 218 read_unlock(&tasklist_lock);
208} 219}
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index b8b235cc19d1..8b1a1b837145 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -584,7 +584,7 @@ int swsusp_check(void)
584 resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_READ); 584 resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_READ);
585 if (!IS_ERR(resume_bdev)) { 585 if (!IS_ERR(resume_bdev)) {
586 set_blocksize(resume_bdev, PAGE_SIZE); 586 set_blocksize(resume_bdev, PAGE_SIZE);
587 memset(swsusp_header, 0, sizeof(PAGE_SIZE)); 587 memset(swsusp_header, 0, PAGE_SIZE);
588 error = bio_read_page(swsusp_resume_block, 588 error = bio_read_page(swsusp_resume_block,
589 swsusp_header, NULL); 589 swsusp_header, NULL);
590 if (error) 590 if (error)
diff --git a/kernel/profile.c b/kernel/profile.c
index cc91b9bf759d..5b20fe977bed 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -26,6 +26,7 @@
26#include <asm/sections.h> 26#include <asm/sections.h>
27#include <asm/semaphore.h> 27#include <asm/semaphore.h>
28#include <asm/irq_regs.h> 28#include <asm/irq_regs.h>
29#include <asm/ptrace.h>
29 30
30struct profile_hit { 31struct profile_hit {
31 u32 pc, hits; 32 u32 pc, hits;
diff --git a/kernel/sched.c b/kernel/sched.c
index 799d23b4e35d..13cdab3b4c48 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4775,9 +4775,7 @@ int __sched cond_resched_softirq(void)
4775 BUG_ON(!in_softirq()); 4775 BUG_ON(!in_softirq());
4776 4776
4777 if (need_resched() && system_state == SYSTEM_RUNNING) { 4777 if (need_resched() && system_state == SYSTEM_RUNNING) {
4778 raw_local_irq_disable(); 4778 local_bh_enable();
4779 _local_bh_enable();
4780 raw_local_irq_enable();
4781 __cond_resched(); 4779 __cond_resched();
4782 local_bh_disable(); 4780 local_bh_disable();
4783 return 1; 4781 return 1;
diff --git a/kernel/signal.c b/kernel/signal.c
index 364fc95bf97c..acdfc0549c6f 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -96,15 +96,27 @@ static inline int has_pending_signals(sigset_t *signal, sigset_t *blocked)
96 96
97#define PENDING(p,b) has_pending_signals(&(p)->signal, (b)) 97#define PENDING(p,b) has_pending_signals(&(p)->signal, (b))
98 98
99fastcall void recalc_sigpending_tsk(struct task_struct *t) 99static int recalc_sigpending_tsk(struct task_struct *t)
100{ 100{
101 if (t->signal->group_stop_count > 0 || 101 if (t->signal->group_stop_count > 0 ||
102 (freezing(t)) || 102 (freezing(t)) ||
103 PENDING(&t->pending, &t->blocked) || 103 PENDING(&t->pending, &t->blocked) ||
104 PENDING(&t->signal->shared_pending, &t->blocked)) 104 PENDING(&t->signal->shared_pending, &t->blocked)) {
105 set_tsk_thread_flag(t, TIF_SIGPENDING); 105 set_tsk_thread_flag(t, TIF_SIGPENDING);
106 else 106 return 1;
107 clear_tsk_thread_flag(t, TIF_SIGPENDING); 107 }
108 clear_tsk_thread_flag(t, TIF_SIGPENDING);
109 return 0;
110}
111
112/*
113 * After recalculating TIF_SIGPENDING, we need to make sure the task wakes up.
114 * This is superfluous when called on current, the wakeup is a harmless no-op.
115 */
116void recalc_sigpending_and_wake(struct task_struct *t)
117{
118 if (recalc_sigpending_tsk(t))
119 signal_wake_up(t, 0);
108} 120}
109 121
110void recalc_sigpending(void) 122void recalc_sigpending(void)
@@ -744,7 +756,7 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
744 action->sa.sa_handler = SIG_DFL; 756 action->sa.sa_handler = SIG_DFL;
745 if (blocked) { 757 if (blocked) {
746 sigdelset(&t->blocked, sig); 758 sigdelset(&t->blocked, sig);
747 recalc_sigpending_tsk(t); 759 recalc_sigpending_and_wake(t);
748 } 760 }
749 } 761 }
750 ret = specific_send_sig_info(sig, info, t); 762 ret = specific_send_sig_info(sig, info, t);
@@ -2273,7 +2285,7 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
2273 rm_from_queue_full(&mask, &t->signal->shared_pending); 2285 rm_from_queue_full(&mask, &t->signal->shared_pending);
2274 do { 2286 do {
2275 rm_from_queue_full(&mask, &t->pending); 2287 rm_from_queue_full(&mask, &t->pending);
2276 recalc_sigpending_tsk(t); 2288 recalc_sigpending_and_wake(t);
2277 t = next_thread(t); 2289 t = next_thread(t);
2278 } while (t != current); 2290 } while (t != current);
2279 } 2291 }
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index cb25649c6f50..87aa5ff931e0 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -11,6 +11,8 @@
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <linux/time.h> 12#include <linux/time.h>
13#include <linux/timex.h> 13#include <linux/timex.h>
14#include <linux/jiffies.h>
15#include <linux/hrtimer.h>
14 16
15#include <asm/div64.h> 17#include <asm/div64.h>
16#include <asm/timex.h> 18#include <asm/timex.h>
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index eadfce2fff74..8001d37071f5 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -243,11 +243,18 @@ void tick_broadcast_on_off(unsigned long reason, int *oncpu)
243{ 243{
244 int cpu = get_cpu(); 244 int cpu = get_cpu();
245 245
246 if (cpu == *oncpu) 246 if (!cpu_isset(*oncpu, cpu_online_map)) {
247 tick_do_broadcast_on_off(&reason); 247 printk(KERN_ERR "tick-braodcast: ignoring broadcast for "
248 else 248 "offline CPU #%d\n", *oncpu);
249 smp_call_function_single(*oncpu, tick_do_broadcast_on_off, 249 } else {
250 &reason, 1, 1); 250
251 if (cpu == *oncpu)
252 tick_do_broadcast_on_off(&reason);
253 else
254 smp_call_function_single(*oncpu,
255 tick_do_broadcast_on_off,
256 &reason, 1, 1);
257 }
251 put_cpu(); 258 put_cpu();
252} 259}
253 260
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 3483e6cb9549..52db9e3c526e 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -167,9 +167,15 @@ void tick_nohz_stop_sched_tick(void)
167 goto end; 167 goto end;
168 168
169 cpu = smp_processor_id(); 169 cpu = smp_processor_id();
170 if (unlikely(local_softirq_pending())) 170 if (unlikely(local_softirq_pending())) {
171 printk(KERN_ERR "NOHZ: local_softirq_pending %02x\n", 171 static int ratelimit;
172 local_softirq_pending()); 172
173 if (ratelimit < 10) {
174 printk(KERN_ERR "NOHZ: local_softirq_pending %02x\n",
175 local_softirq_pending());
176 ratelimit++;
177 }
178 }
173 179
174 now = ktime_get(); 180 now = ktime_get();
175 /* 181 /*
@@ -241,6 +247,21 @@ void tick_nohz_stop_sched_tick(void)
241 if (cpu == tick_do_timer_cpu) 247 if (cpu == tick_do_timer_cpu)
242 tick_do_timer_cpu = -1; 248 tick_do_timer_cpu = -1;
243 249
250 ts->idle_sleeps++;
251
252 /*
253 * delta_jiffies >= NEXT_TIMER_MAX_DELTA signals that
254 * there is no timer pending or at least extremly far
255 * into the future (12 days for HZ=1000). In this case
256 * we simply stop the tick timer:
257 */
258 if (unlikely(delta_jiffies >= NEXT_TIMER_MAX_DELTA)) {
259 ts->idle_expires.tv64 = KTIME_MAX;
260 if (ts->nohz_mode == NOHZ_MODE_HIGHRES)
261 hrtimer_cancel(&ts->sched_timer);
262 goto out;
263 }
264
244 /* 265 /*
245 * calculate the expiry time for the next timer wheel 266 * calculate the expiry time for the next timer wheel
246 * timer 267 * timer
@@ -248,7 +269,6 @@ void tick_nohz_stop_sched_tick(void)
248 expires = ktime_add_ns(last_update, tick_period.tv64 * 269 expires = ktime_add_ns(last_update, tick_period.tv64 *
249 delta_jiffies); 270 delta_jiffies);
250 ts->idle_expires = expires; 271 ts->idle_expires = expires;
251 ts->idle_sleeps++;
252 272
253 if (ts->nohz_mode == NOHZ_MODE_HIGHRES) { 273 if (ts->nohz_mode == NOHZ_MODE_HIGHRES) {
254 hrtimer_start(&ts->sched_timer, expires, 274 hrtimer_start(&ts->sched_timer, expires,
diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c
index 868f1bceb07f..321693724ad7 100644
--- a/kernel/time/timer_stats.c
+++ b/kernel/time/timer_stats.c
@@ -117,21 +117,6 @@ static struct entry entries[MAX_ENTRIES];
117 117
118static atomic_t overflow_count; 118static atomic_t overflow_count;
119 119
120static void reset_entries(void)
121{
122 nr_entries = 0;
123 memset(entries, 0, sizeof(entries));
124 atomic_set(&overflow_count, 0);
125}
126
127static struct entry *alloc_entry(void)
128{
129 if (nr_entries >= MAX_ENTRIES)
130 return NULL;
131
132 return entries + nr_entries++;
133}
134
135/* 120/*
136 * The entries are in a hash-table, for fast lookup: 121 * The entries are in a hash-table, for fast lookup:
137 */ 122 */
@@ -149,6 +134,22 @@ static struct entry *alloc_entry(void)
149 134
150static struct entry *tstat_hash_table[TSTAT_HASH_SIZE] __read_mostly; 135static struct entry *tstat_hash_table[TSTAT_HASH_SIZE] __read_mostly;
151 136
137static void reset_entries(void)
138{
139 nr_entries = 0;
140 memset(entries, 0, sizeof(entries));
141 memset(tstat_hash_table, 0, sizeof(tstat_hash_table));
142 atomic_set(&overflow_count, 0);
143}
144
145static struct entry *alloc_entry(void)
146{
147 if (nr_entries >= MAX_ENTRIES)
148 return NULL;
149
150 return entries + nr_entries++;
151}
152
152static int match_entries(struct entry *entry1, struct entry *entry2) 153static int match_entries(struct entry *entry1, struct entry *entry2)
153{ 154{
154 return entry1->timer == entry2->timer && 155 return entry1->timer == entry2->timer &&
@@ -202,12 +203,15 @@ static struct entry *tstat_lookup(struct entry *entry, char *comm)
202 if (curr) { 203 if (curr) {
203 *curr = *entry; 204 *curr = *entry;
204 curr->count = 0; 205 curr->count = 0;
206 curr->next = NULL;
205 memcpy(curr->comm, comm, TASK_COMM_LEN); 207 memcpy(curr->comm, comm, TASK_COMM_LEN);
208
209 smp_mb(); /* Ensure that curr is initialized before insert */
210
206 if (prev) 211 if (prev)
207 prev->next = curr; 212 prev->next = curr;
208 else 213 else
209 *head = curr; 214 *head = curr;
210 curr->next = NULL;
211 } 215 }
212 out_unlock: 216 out_unlock:
213 spin_unlock(&table_lock); 217 spin_unlock(&table_lock);
@@ -232,10 +236,15 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
232 /* 236 /*
233 * It doesnt matter which lock we take: 237 * It doesnt matter which lock we take:
234 */ 238 */
235 spinlock_t *lock = &per_cpu(lookup_lock, raw_smp_processor_id()); 239 spinlock_t *lock;
236 struct entry *entry, input; 240 struct entry *entry, input;
237 unsigned long flags; 241 unsigned long flags;
238 242
243 if (likely(!active))
244 return;
245
246 lock = &per_cpu(lookup_lock, raw_smp_processor_id());
247
239 input.timer = timer; 248 input.timer = timer;
240 input.start_func = startf; 249 input.start_func = startf;
241 input.expire_func = timerf; 250 input.expire_func = timerf;
@@ -360,6 +369,7 @@ static ssize_t tstats_write(struct file *file, const char __user *buf,
360 if (!active) { 369 if (!active) {
361 reset_entries(); 370 reset_entries();
362 time_start = ktime_get(); 371 time_start = ktime_get();
372 smp_mb();
363 active = 1; 373 active = 1;
364 } 374 }
365 break; 375 break;
diff --git a/kernel/timer.c b/kernel/timer.c
index 5ec5490f8d85..1a69705c2fb9 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -666,7 +666,7 @@ static inline void __run_timers(tvec_base_t *base)
666static unsigned long __next_timer_interrupt(tvec_base_t *base) 666static unsigned long __next_timer_interrupt(tvec_base_t *base)
667{ 667{
668 unsigned long timer_jiffies = base->timer_jiffies; 668 unsigned long timer_jiffies = base->timer_jiffies;
669 unsigned long expires = timer_jiffies + (LONG_MAX >> 1); 669 unsigned long expires = timer_jiffies + NEXT_TIMER_MAX_DELTA;
670 int index, slot, array, found = 0; 670 int index, slot, array, found = 0;
671 struct timer_list *nte; 671 struct timer_list *nte;
672 tvec_t *varray[4]; 672 tvec_t *varray[4];
@@ -752,6 +752,14 @@ static unsigned long cmp_next_hrtimer_event(unsigned long now,
752 752
753 tsdelta = ktime_to_timespec(hr_delta); 753 tsdelta = ktime_to_timespec(hr_delta);
754 delta = timespec_to_jiffies(&tsdelta); 754 delta = timespec_to_jiffies(&tsdelta);
755
756 /*
757 * Limit the delta to the max value, which is checked in
758 * tick_nohz_stop_sched_tick():
759 */
760 if (delta > NEXT_TIMER_MAX_DELTA)
761 delta = NEXT_TIMER_MAX_DELTA;
762
755 /* 763 /*
756 * Take rounding errors in to account and make sure, that it 764 * Take rounding errors in to account and make sure, that it
757 * expires in the next tick. Otherwise we go into an endless 765 * expires in the next tick. Otherwise we go into an endless
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index fb56fedd5c02..3bebf73be976 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -47,7 +47,6 @@ struct cpu_workqueue_struct {
47 47
48 struct workqueue_struct *wq; 48 struct workqueue_struct *wq;
49 struct task_struct *thread; 49 struct task_struct *thread;
50 int should_stop;
51 50
52 int run_depth; /* Detect run_workqueue() recursion depth */ 51 int run_depth; /* Detect run_workqueue() recursion depth */
53} ____cacheline_aligned; 52} ____cacheline_aligned;
@@ -71,7 +70,13 @@ static LIST_HEAD(workqueues);
71 70
72static int singlethread_cpu __read_mostly; 71static int singlethread_cpu __read_mostly;
73static cpumask_t cpu_singlethread_map __read_mostly; 72static cpumask_t cpu_singlethread_map __read_mostly;
74/* optimization, we could use cpu_possible_map */ 73/*
74 * _cpu_down() first removes CPU from cpu_online_map, then CPU_DEAD
75 * flushes cwq->worklist. This means that flush_workqueue/wait_on_work
76 * which comes in between can't use for_each_online_cpu(). We could
77 * use cpu_possible_map, the cpumask below is more a documentation
78 * than optimization.
79 */
75static cpumask_t cpu_populated_map __read_mostly; 80static cpumask_t cpu_populated_map __read_mostly;
76 81
77/* If it's single threaded, it isn't in the list of workqueues. */ 82/* If it's single threaded, it isn't in the list of workqueues. */
@@ -272,24 +277,6 @@ static void run_workqueue(struct cpu_workqueue_struct *cwq)
272 spin_unlock_irq(&cwq->lock); 277 spin_unlock_irq(&cwq->lock);
273} 278}
274 279
275/*
276 * NOTE: the caller must not touch *cwq if this func returns true
277 */
278static int cwq_should_stop(struct cpu_workqueue_struct *cwq)
279{
280 int should_stop = cwq->should_stop;
281
282 if (unlikely(should_stop)) {
283 spin_lock_irq(&cwq->lock);
284 should_stop = cwq->should_stop && list_empty(&cwq->worklist);
285 if (should_stop)
286 cwq->thread = NULL;
287 spin_unlock_irq(&cwq->lock);
288 }
289
290 return should_stop;
291}
292
293static int worker_thread(void *__cwq) 280static int worker_thread(void *__cwq)
294{ 281{
295 struct cpu_workqueue_struct *cwq = __cwq; 282 struct cpu_workqueue_struct *cwq = __cwq;
@@ -302,14 +289,15 @@ static int worker_thread(void *__cwq)
302 289
303 for (;;) { 290 for (;;) {
304 prepare_to_wait(&cwq->more_work, &wait, TASK_INTERRUPTIBLE); 291 prepare_to_wait(&cwq->more_work, &wait, TASK_INTERRUPTIBLE);
305 if (!freezing(current) && !cwq->should_stop 292 if (!freezing(current) &&
306 && list_empty(&cwq->worklist)) 293 !kthread_should_stop() &&
294 list_empty(&cwq->worklist))
307 schedule(); 295 schedule();
308 finish_wait(&cwq->more_work, &wait); 296 finish_wait(&cwq->more_work, &wait);
309 297
310 try_to_freeze(); 298 try_to_freeze();
311 299
312 if (cwq_should_stop(cwq)) 300 if (kthread_should_stop())
313 break; 301 break;
314 302
315 run_workqueue(cwq); 303 run_workqueue(cwq);
@@ -340,18 +328,21 @@ static void insert_wq_barrier(struct cpu_workqueue_struct *cwq,
340 insert_work(cwq, &barr->work, tail); 328 insert_work(cwq, &barr->work, tail);
341} 329}
342 330
343static void flush_cpu_workqueue(struct cpu_workqueue_struct *cwq) 331static int flush_cpu_workqueue(struct cpu_workqueue_struct *cwq)
344{ 332{
333 int active;
334
345 if (cwq->thread == current) { 335 if (cwq->thread == current) {
346 /* 336 /*
347 * Probably keventd trying to flush its own queue. So simply run 337 * Probably keventd trying to flush its own queue. So simply run
348 * it by hand rather than deadlocking. 338 * it by hand rather than deadlocking.
349 */ 339 */
350 run_workqueue(cwq); 340 run_workqueue(cwq);
341 active = 1;
351 } else { 342 } else {
352 struct wq_barrier barr; 343 struct wq_barrier barr;
353 int active = 0;
354 344
345 active = 0;
355 spin_lock_irq(&cwq->lock); 346 spin_lock_irq(&cwq->lock);
356 if (!list_empty(&cwq->worklist) || cwq->current_work != NULL) { 347 if (!list_empty(&cwq->worklist) || cwq->current_work != NULL) {
357 insert_wq_barrier(cwq, &barr, 1); 348 insert_wq_barrier(cwq, &barr, 1);
@@ -362,6 +353,8 @@ static void flush_cpu_workqueue(struct cpu_workqueue_struct *cwq)
362 if (active) 353 if (active)
363 wait_for_completion(&barr.done); 354 wait_for_completion(&barr.done);
364 } 355 }
356
357 return active;
365} 358}
366 359
367/** 360/**
@@ -674,7 +667,6 @@ static int create_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu)
674 return PTR_ERR(p); 667 return PTR_ERR(p);
675 668
676 cwq->thread = p; 669 cwq->thread = p;
677 cwq->should_stop = 0;
678 670
679 return 0; 671 return 0;
680} 672}
@@ -740,29 +732,27 @@ EXPORT_SYMBOL_GPL(__create_workqueue);
740 732
741static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu) 733static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu)
742{ 734{
743 struct wq_barrier barr; 735 /*
744 int alive = 0; 736 * Our caller is either destroy_workqueue() or CPU_DEAD,
745 737 * workqueue_mutex protects cwq->thread
746 spin_lock_irq(&cwq->lock); 738 */
747 if (cwq->thread != NULL) { 739 if (cwq->thread == NULL)
748 insert_wq_barrier(cwq, &barr, 1); 740 return;
749 cwq->should_stop = 1;
750 alive = 1;
751 }
752 spin_unlock_irq(&cwq->lock);
753 741
754 if (alive) { 742 /*
755 wait_for_completion(&barr.done); 743 * If the caller is CPU_DEAD the single flush_cpu_workqueue()
744 * is not enough, a concurrent flush_workqueue() can insert a
745 * barrier after us.
746 * When ->worklist becomes empty it is safe to exit because no
747 * more work_structs can be queued on this cwq: flush_workqueue
748 * checks list_empty(), and a "normal" queue_work() can't use
749 * a dead CPU.
750 */
751 while (flush_cpu_workqueue(cwq))
752 ;
756 753
757 while (unlikely(cwq->thread != NULL)) 754 kthread_stop(cwq->thread);
758 cpu_relax(); 755 cwq->thread = NULL;
759 /*
760 * Wait until cwq->thread unlocks cwq->lock,
761 * it won't touch *cwq after that.
762 */
763 smp_rmb();
764 spin_unlock_wait(&cwq->lock);
765 }
766} 756}
767 757
768/** 758/**
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index fbc5c622acb0..da95e10cfd70 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -126,7 +126,10 @@ config TIMER_STATS
126 reprogrammed. The statistics can be read from /proc/timer_stats. 126 reprogrammed. The statistics can be read from /proc/timer_stats.
127 The statistics collection is started by writing 1 to /proc/timer_stats, 127 The statistics collection is started by writing 1 to /proc/timer_stats,
128 writing 0 stops it. This feature is useful to collect information 128 writing 0 stops it. This feature is useful to collect information
129 about timer usage patterns in kernel and userspace. 129 about timer usage patterns in kernel and userspace. This feature
130 is lightweight if enabled in the kernel config but not activated
131 (it defaults to deactivated on bootup and will only be activated
132 if some application like powertop activates it explicitly).
130 133
131config DEBUG_SLAB 134config DEBUG_SLAB
132 bool "Debug slab memory allocations" 135 bool "Debug slab memory allocations"
@@ -378,14 +381,13 @@ config FORCED_INLINING
378config RCU_TORTURE_TEST 381config RCU_TORTURE_TEST
379 tristate "torture tests for RCU" 382 tristate "torture tests for RCU"
380 depends on DEBUG_KERNEL 383 depends on DEBUG_KERNEL
384 depends on m
381 default n 385 default n
382 help 386 help
383 This option provides a kernel module that runs torture tests 387 This option provides a kernel module that runs torture tests
384 on the RCU infrastructure. The kernel module may be built 388 on the RCU infrastructure. The kernel module may be built
385 after the fact on the running kernel to be tested, if desired. 389 after the fact on the running kernel to be tested, if desired.
386 390
387 Say Y here if you want RCU torture tests to start automatically
388 at boot time (you probably don't).
389 Say M if you want the RCU torture tests to build as a module. 391 Say M if you want the RCU torture tests to build as a module.
390 Say N if you are unsure. 392 Say N if you are unsure.
391 393
diff --git a/lib/ioremap.c b/lib/ioremap.c
index a9e4415b02dc..760521417b69 100644
--- a/lib/ioremap.c
+++ b/lib/ioremap.c
@@ -7,7 +7,7 @@
7 */ 7 */
8#include <linux/vmalloc.h> 8#include <linux/vmalloc.h>
9#include <linux/mm.h> 9#include <linux/mm.h>
10 10#include <linux/sched.h>
11#include <asm/cacheflush.h> 11#include <asm/cacheflush.h>
12#include <asm/pgtable.h> 12#include <asm/pgtable.h>
13 13
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c
index 1b49dab9b25d..fa360e566d88 100644
--- a/mm/filemap_xip.c
+++ b/mm/filemap_xip.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/uio.h> 14#include <linux/uio.h>
15#include <linux/rmap.h> 15#include <linux/rmap.h>
16#include <linux/sched.h>
16#include <asm/tlbflush.h> 17#include <asm/tlbflush.h>
17#include "filemap.h" 18#include "filemap.h"
18 19
diff --git a/mm/madvise.c b/mm/madvise.c
index e75096b5a6d3..60542d006ec1 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -10,6 +10,7 @@
10#include <linux/syscalls.h> 10#include <linux/syscalls.h>
11#include <linux/mempolicy.h> 11#include <linux/mempolicy.h>
12#include <linux/hugetlb.h> 12#include <linux/hugetlb.h>
13#include <linux/sched.h>
13 14
14/* 15/*
15 * Any behaviour which results in changes to the vma->vm_flags needs to 16 * Any behaviour which results in changes to the vma->vm_flags needs to
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 84279127fcd3..df9d554bea30 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -65,7 +65,7 @@ static int __add_zone(struct zone *zone, unsigned long phys_start_pfn)
65 int zone_type; 65 int zone_type;
66 66
67 zone_type = zone - pgdat->node_zones; 67 zone_type = zone - pgdat->node_zones;
68 if (!populated_zone(zone)) { 68 if (!zone->wait_table) {
69 int ret = 0; 69 int ret = 0;
70 ret = init_currently_empty_zone(zone, phys_start_pfn, 70 ret = init_currently_empty_zone(zone, phys_start_pfn,
71 nr_pages, MEMMAP_HOTPLUG); 71 nr_pages, MEMMAP_HOTPLUG);
diff --git a/mm/mlock.c b/mm/mlock.c
index 3446b7ef731e..4d3fea267e0d 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -10,7 +10,18 @@
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/mempolicy.h> 11#include <linux/mempolicy.h>
12#include <linux/syscalls.h> 12#include <linux/syscalls.h>
13#include <linux/sched.h>
14#include <linux/module.h>
13 15
16int can_do_mlock(void)
17{
18 if (capable(CAP_IPC_LOCK))
19 return 1;
20 if (current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur != 0)
21 return 1;
22 return 0;
23}
24EXPORT_SYMBOL(can_do_mlock);
14 25
15static int mlock_fixup(struct vm_area_struct *vma, struct vm_area_struct **prev, 26static int mlock_fixup(struct vm_area_struct *vma, struct vm_area_struct **prev,
16 unsigned long start, unsigned long end, unsigned int newflags) 27 unsigned long start, unsigned long end, unsigned int newflags)
diff --git a/mm/msync.c b/mm/msync.c
index 358d73cf7b78..144a7570535d 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -12,6 +12,7 @@
12#include <linux/mman.h> 12#include <linux/mman.h>
13#include <linux/file.h> 13#include <linux/file.h>
14#include <linux/syscalls.h> 14#include <linux/syscalls.h>
15#include <linux/sched.h>
15 16
16/* 17/*
17 * MS_SYNC syncs the entire file - including mappings. 18 * MS_SYNC syncs the entire file - including mappings.
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ae96dd844432..bd8e33582d25 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -136,6 +136,11 @@ static unsigned long __meminitdata dma_reserve;
136#endif /* CONFIG_MEMORY_HOTPLUG_RESERVE */ 136#endif /* CONFIG_MEMORY_HOTPLUG_RESERVE */
137#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ 137#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
138 138
139#if MAX_NUMNODES > 1
140int nr_node_ids __read_mostly = MAX_NUMNODES;
141EXPORT_SYMBOL(nr_node_ids);
142#endif
143
139#ifdef CONFIG_DEBUG_VM 144#ifdef CONFIG_DEBUG_VM
140static int page_outside_zone_boundaries(struct zone *zone, struct page *page) 145static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
141{ 146{
@@ -669,26 +674,6 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
669 return i; 674 return i;
670} 675}
671 676
672#if MAX_NUMNODES > 1
673int nr_node_ids __read_mostly = MAX_NUMNODES;
674EXPORT_SYMBOL(nr_node_ids);
675
676/*
677 * Figure out the number of possible node ids.
678 */
679static void __init setup_nr_node_ids(void)
680{
681 unsigned int node;
682 unsigned int highest = 0;
683
684 for_each_node_mask(node, node_possible_map)
685 highest = node;
686 nr_node_ids = highest + 1;
687}
688#else
689static void __init setup_nr_node_ids(void) {}
690#endif
691
692#ifdef CONFIG_NUMA 677#ifdef CONFIG_NUMA
693/* 678/*
694 * Called from the vmstat counter updater to drain pagesets of this 679 * Called from the vmstat counter updater to drain pagesets of this
@@ -2165,7 +2150,7 @@ void __init setup_per_cpu_pageset(void)
2165 2150
2166#endif 2151#endif
2167 2152
2168static __meminit noinline 2153static noinline __init_refok
2169int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages) 2154int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
2170{ 2155{
2171 int i; 2156 int i;
@@ -2678,7 +2663,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
2678 } 2663 }
2679} 2664}
2680 2665
2681static void __meminit alloc_node_mem_map(struct pglist_data *pgdat) 2666static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
2682{ 2667{
2683 /* Skip empty nodes */ 2668 /* Skip empty nodes */
2684 if (!pgdat->node_spanned_pages) 2669 if (!pgdat->node_spanned_pages)
@@ -2704,7 +2689,7 @@ static void __meminit alloc_node_mem_map(struct pglist_data *pgdat)
2704 map = alloc_bootmem_node(pgdat, size); 2689 map = alloc_bootmem_node(pgdat, size);
2705 pgdat->node_mem_map = map + (pgdat->node_start_pfn - start); 2690 pgdat->node_mem_map = map + (pgdat->node_start_pfn - start);
2706 } 2691 }
2707#ifdef CONFIG_FLATMEM 2692#ifndef CONFIG_NEED_MULTIPLE_NODES
2708 /* 2693 /*
2709 * With no DISCONTIG, the global mem_map is just set as node 0's 2694 * With no DISCONTIG, the global mem_map is just set as node 0's
2710 */ 2695 */
@@ -2733,6 +2718,26 @@ void __meminit free_area_init_node(int nid, struct pglist_data *pgdat,
2733} 2718}
2734 2719
2735#ifdef CONFIG_ARCH_POPULATES_NODE_MAP 2720#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
2721
2722#if MAX_NUMNODES > 1
2723/*
2724 * Figure out the number of possible node ids.
2725 */
2726static void __init setup_nr_node_ids(void)
2727{
2728 unsigned int node;
2729 unsigned int highest = 0;
2730
2731 for_each_node_mask(node, node_possible_map)
2732 highest = node;
2733 nr_node_ids = highest + 1;
2734}
2735#else
2736static inline void setup_nr_node_ids(void)
2737{
2738}
2739#endif
2740
2736/** 2741/**
2737 * add_active_range - Register a range of PFNs backed by physical memory 2742 * add_active_range - Register a range of PFNs backed by physical memory
2738 * @nid: The node ID the range resides on 2743 * @nid: The node ID the range resides on
diff --git a/mm/slab.c b/mm/slab.c
index 528243e15cc8..2e71a328aa09 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2037,7 +2037,7 @@ static size_t calculate_slab_order(struct kmem_cache *cachep,
2037 return left_over; 2037 return left_over;
2038} 2038}
2039 2039
2040static int setup_cpu_cache(struct kmem_cache *cachep) 2040static int __init_refok setup_cpu_cache(struct kmem_cache *cachep)
2041{ 2041{
2042 if (g_cpucache_up == FULL) 2042 if (g_cpucache_up == FULL)
2043 return enable_cpucache(cachep); 2043 return enable_cpucache(cachep);
diff --git a/mm/slub.c b/mm/slub.c
index 98801d404d69..51663a3c3c24 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -939,7 +939,7 @@ static void kmem_cache_open_debug_check(struct kmem_cache *s)
939 * Debugging or ctor may create a need to move the free 939 * Debugging or ctor may create a need to move the free
940 * pointer. Fail if this happens. 940 * pointer. Fail if this happens.
941 */ 941 */
942 if (s->size >= 65535 * sizeof(void *)) { 942 if (s->objsize >= 65535 * sizeof(void *)) {
943 BUG_ON(s->flags & (SLAB_RED_ZONE | SLAB_POISON | 943 BUG_ON(s->flags & (SLAB_RED_ZONE | SLAB_POISON |
944 SLAB_STORE_USER | SLAB_DESTROY_BY_RCU)); 944 SLAB_STORE_USER | SLAB_DESTROY_BY_RCU));
945 BUG_ON(s->ctor); 945 BUG_ON(s->ctor);
@@ -1917,7 +1917,6 @@ static int calculate_sizes(struct kmem_cache *s)
1917 */ 1917 */
1918 s->inuse = size; 1918 s->inuse = size;
1919 1919
1920#ifdef CONFIG_SLUB_DEBUG
1921 if (((flags & (SLAB_DESTROY_BY_RCU | SLAB_POISON)) || 1920 if (((flags & (SLAB_DESTROY_BY_RCU | SLAB_POISON)) ||
1922 s->ctor)) { 1921 s->ctor)) {
1923 /* 1922 /*
@@ -1932,6 +1931,7 @@ static int calculate_sizes(struct kmem_cache *s)
1932 size += sizeof(void *); 1931 size += sizeof(void *);
1933 } 1932 }
1934 1933
1934#ifdef CONFIG_SLUB_DEBUG
1935 if (flags & SLAB_STORE_USER) 1935 if (flags & SLAB_STORE_USER)
1936 /* 1936 /*
1937 * Need to store information about allocs and frees after 1937 * Need to store information about allocs and frees after
@@ -2435,6 +2435,7 @@ void __init kmem_cache_init(void)
2435 */ 2435 */
2436 create_kmalloc_cache(&kmalloc_caches[0], "kmem_cache_node", 2436 create_kmalloc_cache(&kmalloc_caches[0], "kmem_cache_node",
2437 sizeof(struct kmem_cache_node), GFP_KERNEL); 2437 sizeof(struct kmem_cache_node), GFP_KERNEL);
2438 kmalloc_caches[0].refcount = -1;
2438#endif 2439#endif
2439 2440
2440 /* Able to allocate the per node structures */ 2441 /* Able to allocate the per node structures */
@@ -2482,6 +2483,12 @@ static int slab_unmergeable(struct kmem_cache *s)
2482 if (s->ctor) 2483 if (s->ctor)
2483 return 1; 2484 return 1;
2484 2485
2486 /*
2487 * We may have set a slab to be unmergeable during bootstrap.
2488 */
2489 if (s->refcount < 0)
2490 return 1;
2491
2485 return 0; 2492 return 0;
2486} 2493}
2487 2494
@@ -2601,6 +2608,19 @@ static void for_all_slabs(void (*func)(struct kmem_cache *, int), int cpu)
2601} 2608}
2602 2609
2603/* 2610/*
2611 * Version of __flush_cpu_slab for the case that interrupts
2612 * are enabled.
2613 */
2614static void cpu_slab_flush(struct kmem_cache *s, int cpu)
2615{
2616 unsigned long flags;
2617
2618 local_irq_save(flags);
2619 __flush_cpu_slab(s, cpu);
2620 local_irq_restore(flags);
2621}
2622
2623/*
2604 * Use the cpu notifier to insure that the cpu slabs are flushed when 2624 * Use the cpu notifier to insure that the cpu slabs are flushed when
2605 * necessary. 2625 * necessary.
2606 */ 2626 */
@@ -2614,7 +2634,7 @@ static int __cpuinit slab_cpuup_callback(struct notifier_block *nfb,
2614 case CPU_UP_CANCELED_FROZEN: 2634 case CPU_UP_CANCELED_FROZEN:
2615 case CPU_DEAD: 2635 case CPU_DEAD:
2616 case CPU_DEAD_FROZEN: 2636 case CPU_DEAD_FROZEN:
2617 for_all_slabs(__flush_cpu_slab, cpu); 2637 for_all_slabs(cpu_slab_flush, cpu);
2618 break; 2638 break;
2619 default: 2639 default:
2620 break; 2640 break;
diff --git a/mm/sparse.c b/mm/sparse.c
index 6f3fff907bc2..545e4d3afcdf 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -44,7 +44,7 @@ EXPORT_SYMBOL(page_to_nid);
44#endif 44#endif
45 45
46#ifdef CONFIG_SPARSEMEM_EXTREME 46#ifdef CONFIG_SPARSEMEM_EXTREME
47static struct mem_section noinline *sparse_index_alloc(int nid) 47static struct mem_section noinline __init_refok *sparse_index_alloc(int nid)
48{ 48{
49 struct mem_section *section = NULL; 49 struct mem_section *section = NULL;
50 unsigned long array_size = SECTIONS_PER_ROOT * 50 unsigned long array_size = SECTIONS_PER_ROOT *
@@ -209,6 +209,12 @@ static int __meminit sparse_init_one_section(struct mem_section *ms,
209 return 1; 209 return 1;
210} 210}
211 211
212__attribute__((weak))
213void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
214{
215 return NULL;
216}
217
212static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum) 218static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum)
213{ 219{
214 struct page *map; 220 struct page *map;
@@ -219,6 +225,11 @@ static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum)
219 if (map) 225 if (map)
220 return map; 226 return map;
221 227
228 map = alloc_bootmem_high_node(NODE_DATA(nid),
229 sizeof(struct page) * PAGES_PER_SECTION);
230 if (map)
231 return map;
232
222 map = alloc_bootmem_node(NODE_DATA(nid), 233 map = alloc_bootmem_node(NODE_DATA(nid),
223 sizeof(struct page) * PAGES_PER_SECTION); 234 sizeof(struct page) * PAGES_PER_SECTION);
224 if (map) 235 if (map)
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 8faf27e5aa98..38254297a494 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -12,6 +12,7 @@
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/cpu.h> 14#include <linux/cpu.h>
15#include <linux/sched.h>
15 16
16#ifdef CONFIG_VM_EVENT_COUNTERS 17#ifdef CONFIG_VM_EVENT_COUNTERS
17DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}}; 18DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}};
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index a59b1fb63b76..670ff95ca64b 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -507,6 +507,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
507 } 507 }
508 508
509 /* Default config options */ 509 /* Default config options */
510 pi->conf_len = 0;
510 pi->conf_mtu = L2CAP_DEFAULT_MTU; 511 pi->conf_mtu = L2CAP_DEFAULT_MTU;
511 pi->flush_to = L2CAP_DEFAULT_FLUSH_TO; 512 pi->flush_to = L2CAP_DEFAULT_FLUSH_TO;
512} 513}
@@ -1271,42 +1272,6 @@ static inline int l2cap_get_conf_opt(void **ptr, int *type, int *olen, unsigned
1271 return len; 1272 return len;
1272} 1273}
1273 1274
1274static inline void l2cap_parse_conf_req(struct sock *sk, void *data, int len)
1275{
1276 int type, hint, olen;
1277 unsigned long val;
1278 void *ptr = data;
1279
1280 BT_DBG("sk %p len %d", sk, len);
1281
1282 while (len >= L2CAP_CONF_OPT_SIZE) {
1283 len -= l2cap_get_conf_opt(&ptr, &type, &olen, &val);
1284
1285 hint = type & 0x80;
1286 type &= 0x7f;
1287
1288 switch (type) {
1289 case L2CAP_CONF_MTU:
1290 l2cap_pi(sk)->conf_mtu = val;
1291 break;
1292
1293 case L2CAP_CONF_FLUSH_TO:
1294 l2cap_pi(sk)->flush_to = val;
1295 break;
1296
1297 case L2CAP_CONF_QOS:
1298 break;
1299
1300 default:
1301 if (hint)
1302 break;
1303
1304 /* FIXME: Reject unknown option */
1305 break;
1306 }
1307 }
1308}
1309
1310static void l2cap_add_conf_opt(void **ptr, u8 type, u8 len, unsigned long val) 1275static void l2cap_add_conf_opt(void **ptr, u8 type, u8 len, unsigned long val)
1311{ 1276{
1312 struct l2cap_conf_opt *opt = *ptr; 1277 struct l2cap_conf_opt *opt = *ptr;
@@ -1358,39 +1323,75 @@ static int l2cap_build_conf_req(struct sock *sk, void *data)
1358 return ptr - data; 1323 return ptr - data;
1359} 1324}
1360 1325
1361static inline int l2cap_conf_output(struct sock *sk, void **ptr) 1326static int l2cap_parse_conf_req(struct sock *sk, void *data)
1362{ 1327{
1363 struct l2cap_pinfo *pi = l2cap_pi(sk); 1328 struct l2cap_pinfo *pi = l2cap_pi(sk);
1364 int result = 0; 1329 struct l2cap_conf_rsp *rsp = data;
1330 void *ptr = rsp->data;
1331 void *req = pi->conf_req;
1332 int len = pi->conf_len;
1333 int type, hint, olen;
1334 unsigned long val;
1335 u16 result = L2CAP_CONF_SUCCESS;
1365 1336
1366 /* Configure output options and let the other side know 1337 BT_DBG("sk %p", sk);
1367 * which ones we don't like. */ 1338
1368 if (pi->conf_mtu < pi->omtu) 1339 while (len >= L2CAP_CONF_OPT_SIZE) {
1369 result = L2CAP_CONF_UNACCEPT; 1340 len -= l2cap_get_conf_opt(&req, &type, &olen, &val);
1370 else
1371 pi->omtu = pi->conf_mtu;
1372 1341
1373 l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu); 1342 hint = type & 0x80;
1343 type &= 0x7f;
1344
1345 switch (type) {
1346 case L2CAP_CONF_MTU:
1347 pi->conf_mtu = val;
1348 break;
1349
1350 case L2CAP_CONF_FLUSH_TO:
1351 pi->flush_to = val;
1352 break;
1353
1354 case L2CAP_CONF_QOS:
1355 break;
1356
1357 default:
1358 if (hint)
1359 break;
1360
1361 result = L2CAP_CONF_UNKNOWN;
1362 *((u8 *) ptr++) = type;
1363 break;
1364 }
1365 }
1366
1367 if (result == L2CAP_CONF_SUCCESS) {
1368 /* Configure output options and let the other side know
1369 * which ones we don't like. */
1370
1371 if (pi->conf_mtu < pi->omtu)
1372 result = L2CAP_CONF_UNACCEPT;
1373 else
1374 pi->omtu = pi->conf_mtu;
1375
1376 l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, pi->omtu);
1377 }
1374 1378
1375 BT_DBG("sk %p result %d", sk, result); 1379 rsp->scid = cpu_to_le16(pi->dcid);
1376 return result; 1380 rsp->result = cpu_to_le16(result);
1381 rsp->flags = cpu_to_le16(0x0000);
1382
1383 return ptr - data;
1377} 1384}
1378 1385
1379static int l2cap_build_conf_rsp(struct sock *sk, void *data, int *result) 1386static int l2cap_build_conf_rsp(struct sock *sk, void *data, u16 result, u16 flags)
1380{ 1387{
1381 struct l2cap_conf_rsp *rsp = data; 1388 struct l2cap_conf_rsp *rsp = data;
1382 void *ptr = rsp->data; 1389 void *ptr = rsp->data;
1383 u16 flags = 0;
1384
1385 BT_DBG("sk %p complete %d", sk, result ? 1 : 0);
1386 1390
1387 if (result) 1391 BT_DBG("sk %p", sk);
1388 *result = l2cap_conf_output(sk, &ptr);
1389 else
1390 flags = 0x0001;
1391 1392
1392 rsp->scid = cpu_to_le16(l2cap_pi(sk)->dcid); 1393 rsp->scid = cpu_to_le16(l2cap_pi(sk)->dcid);
1393 rsp->result = cpu_to_le16(result ? *result : 0); 1394 rsp->result = cpu_to_le16(result);
1394 rsp->flags = cpu_to_le16(flags); 1395 rsp->flags = cpu_to_le16(flags);
1395 1396
1396 return ptr - data; 1397 return ptr - data;
@@ -1535,7 +1536,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
1535 u16 dcid, flags; 1536 u16 dcid, flags;
1536 u8 rsp[64]; 1537 u8 rsp[64];
1537 struct sock *sk; 1538 struct sock *sk;
1538 int result; 1539 int len;
1539 1540
1540 dcid = __le16_to_cpu(req->dcid); 1541 dcid = __le16_to_cpu(req->dcid);
1541 flags = __le16_to_cpu(req->flags); 1542 flags = __le16_to_cpu(req->flags);
@@ -1548,25 +1549,40 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
1548 if (sk->sk_state == BT_DISCONN) 1549 if (sk->sk_state == BT_DISCONN)
1549 goto unlock; 1550 goto unlock;
1550 1551
1551 l2cap_parse_conf_req(sk, req->data, cmd->len - sizeof(*req)); 1552 /* Reject if config buffer is too small. */
1553 len = cmd->len - sizeof(*req);
1554 if (l2cap_pi(sk)->conf_len + len > sizeof(l2cap_pi(sk)->conf_req)) {
1555 l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
1556 l2cap_build_conf_rsp(sk, rsp,
1557 L2CAP_CONF_REJECT, flags), rsp);
1558 goto unlock;
1559 }
1560
1561 /* Store config. */
1562 memcpy(l2cap_pi(sk)->conf_req + l2cap_pi(sk)->conf_len, req->data, len);
1563 l2cap_pi(sk)->conf_len += len;
1552 1564
1553 if (flags & 0x0001) { 1565 if (flags & 0x0001) {
1554 /* Incomplete config. Send empty response. */ 1566 /* Incomplete config. Send empty response. */
1555 l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP, 1567 l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
1556 l2cap_build_conf_rsp(sk, rsp, NULL), rsp); 1568 l2cap_build_conf_rsp(sk, rsp,
1569 L2CAP_CONF_SUCCESS, 0x0001), rsp);
1557 goto unlock; 1570 goto unlock;
1558 } 1571 }
1559 1572
1560 /* Complete config. */ 1573 /* Complete config. */
1561 l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP, 1574 len = l2cap_parse_conf_req(sk, rsp);
1562 l2cap_build_conf_rsp(sk, rsp, &result), rsp); 1575 if (len < 0)
1563
1564 if (result)
1565 goto unlock; 1576 goto unlock;
1566 1577
1567 /* Output config done */ 1578 l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP, len, rsp);
1579
1580 /* Output config done. */
1568 l2cap_pi(sk)->conf_state |= L2CAP_CONF_OUTPUT_DONE; 1581 l2cap_pi(sk)->conf_state |= L2CAP_CONF_OUTPUT_DONE;
1569 1582
1583 /* Reset config buffer. */
1584 l2cap_pi(sk)->conf_len = 0;
1585
1570 if (l2cap_pi(sk)->conf_state & L2CAP_CONF_INPUT_DONE) { 1586 if (l2cap_pi(sk)->conf_state & L2CAP_CONF_INPUT_DONE) {
1571 sk->sk_state = BT_CONNECTED; 1587 sk->sk_state = BT_CONNECTED;
1572 l2cap_chan_ready(sk); 1588 l2cap_chan_ready(sk);
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 91b017016d5b..3fc697293819 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -121,6 +121,7 @@ void br_fdb_cleanup(unsigned long _data)
121{ 121{
122 struct net_bridge *br = (struct net_bridge *)_data; 122 struct net_bridge *br = (struct net_bridge *)_data;
123 unsigned long delay = hold_time(br); 123 unsigned long delay = hold_time(br);
124 unsigned long next_timer = jiffies + br->forward_delay;
124 int i; 125 int i;
125 126
126 spin_lock_bh(&br->hash_lock); 127 spin_lock_bh(&br->hash_lock);
@@ -129,14 +130,21 @@ void br_fdb_cleanup(unsigned long _data)
129 struct hlist_node *h, *n; 130 struct hlist_node *h, *n;
130 131
131 hlist_for_each_entry_safe(f, h, n, &br->hash[i], hlist) { 132 hlist_for_each_entry_safe(f, h, n, &br->hash[i], hlist) {
132 if (!f->is_static && 133 unsigned long this_timer;
133 time_before_eq(f->ageing_timer + delay, jiffies)) 134 if (f->is_static)
135 continue;
136 this_timer = f->ageing_timer + delay;
137 if (time_before_eq(this_timer, jiffies))
134 fdb_delete(f); 138 fdb_delete(f);
139 else if (this_timer < next_timer)
140 next_timer = this_timer;
135 } 141 }
136 } 142 }
137 spin_unlock_bh(&br->hash_lock); 143 spin_unlock_bh(&br->hash_lock);
138 144
139 mod_timer(&br->gc_timer, jiffies + HZ/10); 145 /* Add HZ/4 to ensure we round the jiffies upwards to be after the next
146 * timer, otherwise we might round down and will have no-op run. */
147 mod_timer(&br->gc_timer, round_jiffies(next_timer + HZ/4));
140} 148}
141 149
142/* Completely flush all dynamic entries in forwarding database.*/ 150/* Completely flush all dynamic entries in forwarding database.*/
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index 0e035d6162cc..e38034aa56f5 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -178,7 +178,8 @@ void br_transmit_config(struct net_bridge_port *p)
178 br_send_config_bpdu(p, &bpdu); 178 br_send_config_bpdu(p, &bpdu);
179 p->topology_change_ack = 0; 179 p->topology_change_ack = 0;
180 p->config_pending = 0; 180 p->config_pending = 0;
181 mod_timer(&p->hold_timer, jiffies + BR_HOLD_TIME); 181 mod_timer(&p->hold_timer,
182 round_jiffies(jiffies + BR_HOLD_TIME));
182 } 183 }
183} 184}
184 185
diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c
index 24e0ca4a3131..77f5255e6915 100644
--- a/net/bridge/br_stp_timer.c
+++ b/net/bridge/br_stp_timer.c
@@ -42,7 +42,7 @@ static void br_hello_timer_expired(unsigned long arg)
42 if (br->dev->flags & IFF_UP) { 42 if (br->dev->flags & IFF_UP) {
43 br_config_bpdu_generation(br); 43 br_config_bpdu_generation(br);
44 44
45 mod_timer(&br->hello_timer, jiffies + br->hello_time); 45 mod_timer(&br->hello_timer, round_jiffies(jiffies + br->hello_time));
46 } 46 }
47 spin_unlock(&br->lock); 47 spin_unlock(&br->lock);
48} 48}
diff --git a/net/core/dev.c b/net/core/dev.c
index f2b61111e26d..5a7f20f78574 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3314,7 +3314,6 @@ void netdev_run_todo(void)
3314 continue; 3314 continue;
3315 } 3315 }
3316 3316
3317 netdev_unregister_sysfs(dev);
3318 dev->reg_state = NETREG_UNREGISTERED; 3317 dev->reg_state = NETREG_UNREGISTERED;
3319 3318
3320 netdev_wait_allrefs(dev); 3319 netdev_wait_allrefs(dev);
@@ -3325,11 +3324,11 @@ void netdev_run_todo(void)
3325 BUG_TRAP(!dev->ip6_ptr); 3324 BUG_TRAP(!dev->ip6_ptr);
3326 BUG_TRAP(!dev->dn_ptr); 3325 BUG_TRAP(!dev->dn_ptr);
3327 3326
3328 /* It must be the very last action,
3329 * after this 'dev' may point to freed up memory.
3330 */
3331 if (dev->destructor) 3327 if (dev->destructor)
3332 dev->destructor(dev); 3328 dev->destructor(dev);
3329
3330 /* Free network device */
3331 kobject_put(&dev->dev.kobj);
3333 } 3332 }
3334 3333
3335out: 3334out:
@@ -3480,6 +3479,9 @@ void unregister_netdevice(struct net_device *dev)
3480 /* Notifier chain MUST detach us from master device. */ 3479 /* Notifier chain MUST detach us from master device. */
3481 BUG_TRAP(!dev->master); 3480 BUG_TRAP(!dev->master);
3482 3481
3482 /* Remove entries from sysfs */
3483 netdev_unregister_sysfs(dev);
3484
3483 /* Finish processing unregister after unlock */ 3485 /* Finish processing unregister after unlock */
3484 net_set_todo(dev); 3486 net_set_todo(dev);
3485 3487
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index b21307b15b82..5c19b0646d7a 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -456,9 +456,15 @@ static struct class net_class = {
456#endif 456#endif
457}; 457};
458 458
459/* Delete sysfs entries but hold kobject reference until after all
460 * netdev references are gone.
461 */
459void netdev_unregister_sysfs(struct net_device * net) 462void netdev_unregister_sysfs(struct net_device * net)
460{ 463{
461 device_del(&(net->dev)); 464 struct device *dev = &(net->dev);
465
466 kobject_get(&dev->kobj);
467 device_del(dev);
462} 468}
463 469
464/* Create sysfs entries for network device. */ 470/* Create sysfs entries for network device. */
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 8c971a2efe2a..27da9cdec6a8 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -437,7 +437,7 @@ static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
437 a->tx_compressed = b->tx_compressed; 437 a->tx_compressed = b->tx_compressed;
438}; 438};
439 439
440static inline size_t if_nlmsg_size(int iwbuflen) 440static inline size_t if_nlmsg_size(void)
441{ 441{
442 return NLMSG_ALIGN(sizeof(struct ifinfomsg)) 442 return NLMSG_ALIGN(sizeof(struct ifinfomsg))
443 + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */ 443 + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */
@@ -452,13 +452,12 @@ static inline size_t if_nlmsg_size(int iwbuflen)
452 + nla_total_size(4) /* IFLA_LINK */ 452 + nla_total_size(4) /* IFLA_LINK */
453 + nla_total_size(4) /* IFLA_MASTER */ 453 + nla_total_size(4) /* IFLA_MASTER */
454 + nla_total_size(1) /* IFLA_OPERSTATE */ 454 + nla_total_size(1) /* IFLA_OPERSTATE */
455 + nla_total_size(1) /* IFLA_LINKMODE */ 455 + nla_total_size(1); /* IFLA_LINKMODE */
456 + nla_total_size(iwbuflen);
457} 456}
458 457
459static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, 458static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
460 void *iwbuf, int iwbuflen, int type, u32 pid, 459 int type, u32 pid, u32 seq, u32 change,
461 u32 seq, u32 change, unsigned int flags) 460 unsigned int flags)
462{ 461{
463 struct ifinfomsg *ifm; 462 struct ifinfomsg *ifm;
464 struct nlmsghdr *nlh; 463 struct nlmsghdr *nlh;
@@ -523,9 +522,6 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
523 } 522 }
524 } 523 }
525 524
526 if (iwbuf)
527 NLA_PUT(skb, IFLA_WIRELESS, iwbuflen, iwbuf);
528
529 return nlmsg_end(skb, nlh); 525 return nlmsg_end(skb, nlh);
530 526
531nla_put_failure: 527nla_put_failure:
@@ -543,7 +539,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
543 for_each_netdev(dev) { 539 for_each_netdev(dev) {
544 if (idx < s_idx) 540 if (idx < s_idx)
545 goto cont; 541 goto cont;
546 if (rtnl_fill_ifinfo(skb, dev, NULL, 0, RTM_NEWLINK, 542 if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
547 NETLINK_CB(cb->skb).pid, 543 NETLINK_CB(cb->skb).pid,
548 cb->nlh->nlmsg_seq, 0, NLM_F_MULTI) <= 0) 544 cb->nlh->nlmsg_seq, 0, NLM_F_MULTI) <= 0)
549 break; 545 break;
@@ -689,8 +685,15 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
689 } 685 }
690 686
691 687
692 if (ifm->ifi_flags) 688 if (ifm->ifi_flags || ifm->ifi_change) {
693 dev_change_flags(dev, ifm->ifi_flags); 689 unsigned int flags = ifm->ifi_flags;
690
691 /* bugwards compatibility: ifi_change == 0 is treated as ~0 */
692 if (ifm->ifi_change)
693 flags = (flags & ifm->ifi_change) |
694 (dev->flags & ~ifm->ifi_change);
695 dev_change_flags(dev, flags);
696 }
694 697
695 if (tb[IFLA_TXQLEN]) 698 if (tb[IFLA_TXQLEN])
696 dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); 699 dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
@@ -730,8 +733,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
730 struct nlattr *tb[IFLA_MAX+1]; 733 struct nlattr *tb[IFLA_MAX+1];
731 struct net_device *dev = NULL; 734 struct net_device *dev = NULL;
732 struct sk_buff *nskb; 735 struct sk_buff *nskb;
733 char *iw_buf = NULL, *iw = NULL;
734 int iw_buf_len = 0;
735 int err; 736 int err;
736 737
737 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); 738 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy);
@@ -746,14 +747,14 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
746 } else 747 } else
747 return -EINVAL; 748 return -EINVAL;
748 749
749 nskb = nlmsg_new(if_nlmsg_size(iw_buf_len), GFP_KERNEL); 750 nskb = nlmsg_new(if_nlmsg_size(), GFP_KERNEL);
750 if (nskb == NULL) { 751 if (nskb == NULL) {
751 err = -ENOBUFS; 752 err = -ENOBUFS;
752 goto errout; 753 goto errout;
753 } 754 }
754 755
755 err = rtnl_fill_ifinfo(nskb, dev, iw, iw_buf_len, RTM_NEWLINK, 756 err = rtnl_fill_ifinfo(nskb, dev, RTM_NEWLINK, NETLINK_CB(skb).pid,
756 NETLINK_CB(skb).pid, nlh->nlmsg_seq, 0, 0); 757 nlh->nlmsg_seq, 0, 0);
757 if (err < 0) { 758 if (err < 0) {
758 /* -EMSGSIZE implies BUG in if_nlmsg_size */ 759 /* -EMSGSIZE implies BUG in if_nlmsg_size */
759 WARN_ON(err == -EMSGSIZE); 760 WARN_ON(err == -EMSGSIZE);
@@ -762,7 +763,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
762 } 763 }
763 err = rtnl_unicast(nskb, NETLINK_CB(skb).pid); 764 err = rtnl_unicast(nskb, NETLINK_CB(skb).pid);
764errout: 765errout:
765 kfree(iw_buf);
766 dev_put(dev); 766 dev_put(dev);
767 767
768 return err; 768 return err;
@@ -797,11 +797,11 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
797 struct sk_buff *skb; 797 struct sk_buff *skb;
798 int err = -ENOBUFS; 798 int err = -ENOBUFS;
799 799
800 skb = nlmsg_new(if_nlmsg_size(0), GFP_KERNEL); 800 skb = nlmsg_new(if_nlmsg_size(), GFP_KERNEL);
801 if (skb == NULL) 801 if (skb == NULL)
802 goto errout; 802 goto errout;
803 803
804 err = rtnl_fill_ifinfo(skb, dev, NULL, 0, type, 0, 0, change, 0); 804 err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0);
805 if (err < 0) { 805 if (err < 0) {
806 /* -EMSGSIZE implies BUG in if_nlmsg_size() */ 806 /* -EMSGSIZE implies BUG in if_nlmsg_size() */
807 WARN_ON(err == -EMSGSIZE); 807 WARN_ON(err == -EMSGSIZE);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 142257307fa2..7c6a34e21eee 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -644,11 +644,10 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
644 644
645 /* Copy only real data... and, alas, header. This should be 645 /* Copy only real data... and, alas, header. This should be
646 * optimized for the cases when header is void. */ 646 * optimized for the cases when header is void. */
647 memcpy(data + nhead, skb->head,
648#ifdef NET_SKBUFF_DATA_USES_OFFSET 647#ifdef NET_SKBUFF_DATA_USES_OFFSET
649 skb->tail); 648 memcpy(data + nhead, skb->head, skb->tail);
650#else 649#else
651 skb->tail - skb->head); 650 memcpy(data + nhead, skb->head, skb->tail - skb->head);
652#endif 651#endif
653 memcpy(data + size, skb_end_pointer(skb), 652 memcpy(data + size, skb_end_pointer(skb),
654 sizeof(struct skb_shared_info)); 653 sizeof(struct skb_shared_info));
diff --git a/net/core/sock.c b/net/core/sock.c
index 22183c2ef284..7e51d3a5e4f6 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -206,7 +206,19 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen)
206 return -EINVAL; 206 return -EINVAL;
207 if (copy_from_user(&tv, optval, sizeof(tv))) 207 if (copy_from_user(&tv, optval, sizeof(tv)))
208 return -EFAULT; 208 return -EFAULT;
209 209 if (tv.tv_usec < 0 || tv.tv_usec >= USEC_PER_SEC)
210 return -EDOM;
211
212 if (tv.tv_sec < 0) {
213 static int warned = 0;
214 *timeo_p = 0;
215 if (warned < 10 && net_ratelimit())
216 warned++;
217 printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) "
218 "tries to set negative timeout\n",
219 current->comm, current->pid);
220 return 0;
221 }
210 *timeo_p = MAX_SCHEDULE_TIMEOUT; 222 *timeo_p = MAX_SCHEDULE_TIMEOUT;
211 if (tv.tv_sec == 0 && tv.tv_usec == 0) 223 if (tv.tv_sec == 0 && tv.tv_usec == 0)
212 return 0; 224 return 0;
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index b29712033dd4..6d5ea9762040 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -24,6 +24,8 @@ extern int sysctl_core_destroy_delay;
24#ifdef CONFIG_XFRM 24#ifdef CONFIG_XFRM
25extern u32 sysctl_xfrm_aevent_etime; 25extern u32 sysctl_xfrm_aevent_etime;
26extern u32 sysctl_xfrm_aevent_rseqth; 26extern u32 sysctl_xfrm_aevent_rseqth;
27extern int sysctl_xfrm_larval_drop;
28extern u32 sysctl_xfrm_acq_expires;
27#endif 29#endif
28 30
29ctl_table core_table[] = { 31ctl_table core_table[] = {
@@ -118,6 +120,22 @@ ctl_table core_table[] = {
118 .mode = 0644, 120 .mode = 0644,
119 .proc_handler = &proc_dointvec 121 .proc_handler = &proc_dointvec
120 }, 122 },
123 {
124 .ctl_name = CTL_UNNUMBERED,
125 .procname = "xfrm_larval_drop",
126 .data = &sysctl_xfrm_larval_drop,
127 .maxlen = sizeof(int),
128 .mode = 0644,
129 .proc_handler = &proc_dointvec
130 },
131 {
132 .ctl_name = CTL_UNNUMBERED,
133 .procname = "xfrm_acq_expires",
134 .data = &sysctl_xfrm_acq_expires,
135 .maxlen = sizeof(int),
136 .mode = 0644,
137 .proc_handler = &proc_dointvec
138 },
121#endif /* CONFIG_XFRM */ 139#endif /* CONFIG_XFRM */
122#endif /* CONFIG_NET */ 140#endif /* CONFIG_NET */
123 { 141 {
diff --git a/net/core/utils.c b/net/core/utils.c
index adecfd281ae9..2030bb8c2d30 100644
--- a/net/core/utils.c
+++ b/net/core/utils.c
@@ -139,16 +139,16 @@ int in4_pton(const char *src, int srclen,
139 while(1) { 139 while(1) {
140 int c; 140 int c;
141 c = xdigit2bin(srclen > 0 ? *s : '\0', delim); 141 c = xdigit2bin(srclen > 0 ? *s : '\0', delim);
142 if (!(c & (IN6PTON_DIGIT | IN6PTON_DOT | IN6PTON_DELIM))) { 142 if (!(c & (IN6PTON_DIGIT | IN6PTON_DOT | IN6PTON_DELIM | IN6PTON_COLON_MASK))) {
143 goto out; 143 goto out;
144 } 144 }
145 if (c & (IN6PTON_DOT | IN6PTON_DELIM)) { 145 if (c & (IN6PTON_DOT | IN6PTON_DELIM | IN6PTON_COLON_MASK)) {
146 if (w == 0) 146 if (w == 0)
147 goto out; 147 goto out;
148 *d++ = w & 0xff; 148 *d++ = w & 0xff;
149 w = 0; 149 w = 0;
150 i++; 150 i++;
151 if (c & IN6PTON_DELIM) { 151 if (c & (IN6PTON_DELIM | IN6PTON_COLON_MASK)) {
152 if (i != 4) 152 if (i != 4)
153 goto out; 153 goto out;
154 break; 154 break;
diff --git a/net/dccp/Kconfig b/net/dccp/Kconfig
index b8a68dd41000..0549e4719b13 100644
--- a/net/dccp/Kconfig
+++ b/net/dccp/Kconfig
@@ -1,8 +1,6 @@
1menu "DCCP Configuration (EXPERIMENTAL)" 1menuconfig IP_DCCP
2 depends on INET && EXPERIMENTAL
3
4config IP_DCCP
5 tristate "The DCCP Protocol (EXPERIMENTAL)" 2 tristate "The DCCP Protocol (EXPERIMENTAL)"
3 depends on INET && EXPERIMENTAL
6 ---help--- 4 ---help---
7 Datagram Congestion Control Protocol (RFC 4340) 5 Datagram Congestion Control Protocol (RFC 4340)
8 6
@@ -19,19 +17,20 @@ config IP_DCCP
19 17
20 If in doubt, say N. 18 If in doubt, say N.
21 19
20if IP_DCCP
21
22config INET_DCCP_DIAG 22config INET_DCCP_DIAG
23 depends on IP_DCCP && INET_DIAG 23 depends on INET_DIAG
24 def_tristate y if (IP_DCCP = y && INET_DIAG = y) 24 def_tristate y if (IP_DCCP = y && INET_DIAG = y)
25 def_tristate m 25 def_tristate m
26 26
27config IP_DCCP_ACKVEC 27config IP_DCCP_ACKVEC
28 depends on IP_DCCP
29 bool 28 bool
30 29
31source "net/dccp/ccids/Kconfig" 30source "net/dccp/ccids/Kconfig"
32 31
33menu "DCCP Kernel Hacking" 32menu "DCCP Kernel Hacking"
34 depends on IP_DCCP && DEBUG_KERNEL=y 33 depends on DEBUG_KERNEL=y
35 34
36config IP_DCCP_DEBUG 35config IP_DCCP_DEBUG
37 bool "DCCP debug messages" 36 bool "DCCP debug messages"
@@ -61,4 +60,4 @@ config NET_DCCPPROBE
61 60
62endmenu 61endmenu
63 62
64endmenu 63endif # IP_DDCP
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index d7d9ce737244..ec7fa4d67f08 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -419,7 +419,6 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more,
419 419
420static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) 420static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
421{ 421{
422 const struct dccp_sock *dp = dccp_sk(sk);
423 struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); 422 struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
424 struct ccid3_options_received *opt_recv; 423 struct ccid3_options_received *opt_recv;
425 struct dccp_tx_hist_entry *packet; 424 struct dccp_tx_hist_entry *packet;
@@ -491,7 +490,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
491 ccid3_pr_debug("%s(%p), s=%u, MSS=%u, " 490 ccid3_pr_debug("%s(%p), s=%u, MSS=%u, "
492 "R_sample=%uus, X=%u\n", dccp_role(sk), 491 "R_sample=%uus, X=%u\n", dccp_role(sk),
493 sk, hctx->ccid3hctx_s, 492 sk, hctx->ccid3hctx_s,
494 dp->dccps_mss_cache, r_sample, 493 dccp_sk(sk)->dccps_mss_cache, r_sample,
495 (unsigned)(hctx->ccid3hctx_x >> 6)); 494 (unsigned)(hctx->ccid3hctx_x >> 6));
496 495
497 ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK); 496 ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK);
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 64eac2515aa2..31737cdf156a 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -1043,9 +1043,13 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
1043 if (final_p) 1043 if (final_p)
1044 ipv6_addr_copy(&fl.fl6_dst, final_p); 1044 ipv6_addr_copy(&fl.fl6_dst, final_p);
1045 1045
1046 err = xfrm_lookup(&dst, &fl, sk, 1); 1046 err = __xfrm_lookup(&dst, &fl, sk, 1);
1047 if (err < 0) 1047 if (err < 0) {
1048 goto failure; 1048 if (err == -EREMOTE)
1049 err = ip6_dst_blackhole(sk, &dst, &fl);
1050 if (err < 0)
1051 goto failure;
1052 }
1049 1053
1050 if (saddr == NULL) { 1054 if (saddr == NULL) {
1051 saddr = &fl.fl6_src; 1055 saddr = &fl.fl6_src;
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
index 7ec6610841ba..17ad278696ed 100644
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -140,7 +140,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
140 140
141 dev = alloc_etherdev(sizeof(struct ieee80211_device) + sizeof_priv); 141 dev = alloc_etherdev(sizeof(struct ieee80211_device) + sizeof_priv);
142 if (!dev) { 142 if (!dev) {
143 IEEE80211_ERROR("Unable to network device.\n"); 143 IEEE80211_ERROR("Unable to allocate network device.\n");
144 goto failed; 144 goto failed;
145 } 145 }
146 ieee = netdev_priv(dev); 146 ieee = netdev_priv(dev);
diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c b/net/ieee80211/softmac/ieee80211softmac_module.c
index e9cdc6615ddc..c308756c2f9d 100644
--- a/net/ieee80211/softmac/ieee80211softmac_module.c
+++ b/net/ieee80211/softmac/ieee80211softmac_module.c
@@ -33,7 +33,10 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv)
33 struct ieee80211softmac_device *softmac; 33 struct ieee80211softmac_device *softmac;
34 struct net_device *dev; 34 struct net_device *dev;
35 35
36 dev = alloc_ieee80211(sizeof(struct ieee80211softmac_device) + sizeof_priv); 36 dev = alloc_ieee80211(sizeof(*softmac) + sizeof_priv);
37 if (!dev)
38 return NULL;
39
37 softmac = ieee80211_priv(dev); 40 softmac = ieee80211_priv(dev);
38 softmac->dev = dev; 41 softmac->dev = dev;
39 softmac->ieee = netdev_priv(dev); 42 softmac->ieee = netdev_priv(dev);
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 837f2957fa83..9ad1f6252a97 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -250,8 +250,6 @@ e_inval:
250 return -EINVAL; 250 return -EINVAL;
251} 251}
252 252
253#ifndef CONFIG_IP_NOSIOCRT
254
255static inline __be32 sk_extract_addr(struct sockaddr *addr) 253static inline __be32 sk_extract_addr(struct sockaddr *addr)
256{ 254{
257 return ((struct sockaddr_in *) addr)->sin_addr.s_addr; 255 return ((struct sockaddr_in *) addr)->sin_addr.s_addr;
@@ -443,15 +441,6 @@ int ip_rt_ioctl(unsigned int cmd, void __user *arg)
443 return -EINVAL; 441 return -EINVAL;
444} 442}
445 443
446#else
447
448int ip_rt_ioctl(unsigned int cmd, void *arg)
449{
450 return -EINVAL;
451}
452
453#endif
454
455struct nla_policy rtm_ipv4_policy[RTA_MAX+1] __read_mostly = { 444struct nla_policy rtm_ipv4_policy[RTA_MAX+1] __read_mostly = {
456 [RTA_DST] = { .type = NLA_U32 }, 445 [RTA_DST] = { .type = NLA_U32 },
457 [RTA_SRC] = { .type = NLA_U32 }, 446 [RTA_SRC] = { .type = NLA_U32 },
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 9cfecf1215c9..07e843a47dde 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -456,6 +456,8 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)
456 fib_release_info(fi_drop); 456 fib_release_info(fi_drop);
457 if (state & FA_S_ACCESSED) 457 if (state & FA_S_ACCESSED)
458 rt_cache_flush(-1); 458 rt_cache_flush(-1);
459 rtmsg_fib(RTM_NEWROUTE, key, fa, cfg->fc_dst_len, tb->tb_id,
460 &cfg->fc_nlinfo, NLM_F_REPLACE);
459 return 0; 461 return 0;
460 } 462 }
461 463
@@ -523,7 +525,7 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)
523 rt_cache_flush(-1); 525 rt_cache_flush(-1);
524 526
525 rtmsg_fib(RTM_NEWROUTE, key, new_fa, cfg->fc_dst_len, tb->tb_id, 527 rtmsg_fib(RTM_NEWROUTE, key, new_fa, cfg->fc_dst_len, tb->tb_id,
526 &cfg->fc_nlinfo); 528 &cfg->fc_nlinfo, 0);
527 return 0; 529 return 0;
528 530
529out_free_new_fa: 531out_free_new_fa:
@@ -589,7 +591,7 @@ static int fn_hash_delete(struct fib_table *tb, struct fib_config *cfg)
589 591
590 fa = fa_to_delete; 592 fa = fa_to_delete;
591 rtmsg_fib(RTM_DELROUTE, key, fa, cfg->fc_dst_len, 593 rtmsg_fib(RTM_DELROUTE, key, fa, cfg->fc_dst_len,
592 tb->tb_id, &cfg->fc_nlinfo); 594 tb->tb_id, &cfg->fc_nlinfo, 0);
593 595
594 kill_fn = 0; 596 kill_fn = 0;
595 write_lock_bh(&fib_hash_lock); 597 write_lock_bh(&fib_hash_lock);
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h
index 0e8b70bad4e1..eef9eec17e0c 100644
--- a/net/ipv4/fib_lookup.h
+++ b/net/ipv4/fib_lookup.h
@@ -30,7 +30,8 @@ extern int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
30 int dst_len, u8 tos, struct fib_info *fi, 30 int dst_len, u8 tos, struct fib_info *fi,
31 unsigned int); 31 unsigned int);
32extern void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, 32extern void rtmsg_fib(int event, __be32 key, struct fib_alias *fa,
33 int dst_len, u32 tb_id, struct nl_info *info); 33 int dst_len, u32 tb_id, struct nl_info *info,
34 unsigned int nlm_flags);
34extern struct fib_alias *fib_find_alias(struct list_head *fah, 35extern struct fib_alias *fib_find_alias(struct list_head *fah,
35 u8 tos, u32 prio); 36 u8 tos, u32 prio);
36extern int fib_detect_death(struct fib_info *fi, int order, 37extern int fib_detect_death(struct fib_info *fi, int order,
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 406ea7050aed..bb94550d95c3 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -301,7 +301,8 @@ static inline size_t fib_nlmsg_size(struct fib_info *fi)
301} 301}
302 302
303void rtmsg_fib(int event, __be32 key, struct fib_alias *fa, 303void rtmsg_fib(int event, __be32 key, struct fib_alias *fa,
304 int dst_len, u32 tb_id, struct nl_info *info) 304 int dst_len, u32 tb_id, struct nl_info *info,
305 unsigned int nlm_flags)
305{ 306{
306 struct sk_buff *skb; 307 struct sk_buff *skb;
307 u32 seq = info->nlh ? info->nlh->nlmsg_seq : 0; 308 u32 seq = info->nlh ? info->nlh->nlmsg_seq : 0;
@@ -313,7 +314,7 @@ void rtmsg_fib(int event, __be32 key, struct fib_alias *fa,
313 314
314 err = fib_dump_info(skb, info->pid, seq, event, tb_id, 315 err = fib_dump_info(skb, info->pid, seq, event, tb_id,
315 fa->fa_type, fa->fa_scope, key, dst_len, 316 fa->fa_type, fa->fa_scope, key, dst_len,
316 fa->fa_tos, fa->fa_info, 0); 317 fa->fa_tos, fa->fa_info, nlm_flags);
317 if (err < 0) { 318 if (err < 0) {
318 /* -EMSGSIZE implies BUG in fib_nlmsg_size() */ 319 /* -EMSGSIZE implies BUG in fib_nlmsg_size() */
319 WARN_ON(err == -EMSGSIZE); 320 WARN_ON(err == -EMSGSIZE);
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 9be7da7c3a8f..30e332ade61b 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1226,6 +1226,8 @@ static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg)
1226 fib_release_info(fi_drop); 1226 fib_release_info(fi_drop);
1227 if (state & FA_S_ACCESSED) 1227 if (state & FA_S_ACCESSED)
1228 rt_cache_flush(-1); 1228 rt_cache_flush(-1);
1229 rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen,
1230 tb->tb_id, &cfg->fc_nlinfo, NLM_F_REPLACE);
1229 1231
1230 goto succeeded; 1232 goto succeeded;
1231 } 1233 }
@@ -1278,7 +1280,7 @@ static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg)
1278 1280
1279 rt_cache_flush(-1); 1281 rt_cache_flush(-1);
1280 rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, tb->tb_id, 1282 rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, tb->tb_id,
1281 &cfg->fc_nlinfo); 1283 &cfg->fc_nlinfo, 0);
1282succeeded: 1284succeeded:
1283 return 0; 1285 return 0;
1284 1286
@@ -1624,7 +1626,7 @@ static int fn_trie_delete(struct fib_table *tb, struct fib_config *cfg)
1624 1626
1625 fa = fa_to_delete; 1627 fa = fa_to_delete;
1626 rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id, 1628 rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id,
1627 &cfg->fc_nlinfo); 1629 &cfg->fc_nlinfo, 0);
1628 1630
1629 l = fib_find_node(t, key); 1631 l = fib_find_node(t, key);
1630 li = find_leaf_info(l, plen); 1632 li = find_leaf_info(l, plen);
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index d38cbba92a4d..e238b17f554c 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -514,7 +514,10 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
514 514
515 saddr = iph->daddr; 515 saddr = iph->daddr;
516 if (!(rt->rt_flags & RTCF_LOCAL)) { 516 if (!(rt->rt_flags & RTCF_LOCAL)) {
517 if (sysctl_icmp_errors_use_inbound_ifaddr) 517 /* This is broken, skb_in->dev points to the outgoing device
518 * after the packet passes through ip_output().
519 */
520 if (skb_in->dev && sysctl_icmp_errors_use_inbound_ifaddr)
518 saddr = inet_select_addr(skb_in->dev, 0, RT_SCOPE_LINK); 521 saddr = inet_select_addr(skb_in->dev, 0, RT_SCOPE_LINK);
519 else 522 else
520 saddr = 0; 523 saddr = 0;
diff --git a/net/ipv4/ipvs/Kconfig b/net/ipv4/ipvs/Kconfig
index 891b9355cf96..09d0c3f35669 100644
--- a/net/ipv4/ipvs/Kconfig
+++ b/net/ipv4/ipvs/Kconfig
@@ -1,10 +1,7 @@
1# 1#
2# IP Virtual Server configuration 2# IP Virtual Server configuration
3# 3#
4menu "IP: Virtual Server Configuration" 4menuconfig IP_VS
5 depends on NETFILTER
6
7config IP_VS
8 tristate "IP virtual server support (EXPERIMENTAL)" 5 tristate "IP virtual server support (EXPERIMENTAL)"
9 depends on NETFILTER 6 depends on NETFILTER
10 ---help--- 7 ---help---
@@ -25,9 +22,10 @@ config IP_VS
25 If you want to compile it in kernel, say Y. To compile it as a 22 If you want to compile it in kernel, say Y. To compile it as a
26 module, choose M here. If unsure, say N. 23 module, choose M here. If unsure, say N.
27 24
25if IP_VS
26
28config IP_VS_DEBUG 27config IP_VS_DEBUG
29 bool "IP virtual server debugging" 28 bool "IP virtual server debugging"
30 depends on IP_VS
31 ---help--- 29 ---help---
32 Say Y here if you want to get additional messages useful in 30 Say Y here if you want to get additional messages useful in
33 debugging the IP virtual server code. You can change the debug 31 debugging the IP virtual server code. You can change the debug
@@ -35,7 +33,6 @@ config IP_VS_DEBUG
35 33
36config IP_VS_TAB_BITS 34config IP_VS_TAB_BITS
37 int "IPVS connection table size (the Nth power of 2)" 35 int "IPVS connection table size (the Nth power of 2)"
38 depends on IP_VS
39 default "12" 36 default "12"
40 ---help--- 37 ---help---
41 The IPVS connection hash table uses the chaining scheme to handle 38 The IPVS connection hash table uses the chaining scheme to handle
@@ -61,42 +58,35 @@ config IP_VS_TAB_BITS
61 needed for your box. 58 needed for your box.
62 59
63comment "IPVS transport protocol load balancing support" 60comment "IPVS transport protocol load balancing support"
64 depends on IP_VS
65 61
66config IP_VS_PROTO_TCP 62config IP_VS_PROTO_TCP
67 bool "TCP load balancing support" 63 bool "TCP load balancing support"
68 depends on IP_VS
69 ---help--- 64 ---help---
70 This option enables support for load balancing TCP transport 65 This option enables support for load balancing TCP transport
71 protocol. Say Y if unsure. 66 protocol. Say Y if unsure.
72 67
73config IP_VS_PROTO_UDP 68config IP_VS_PROTO_UDP
74 bool "UDP load balancing support" 69 bool "UDP load balancing support"
75 depends on IP_VS
76 ---help--- 70 ---help---
77 This option enables support for load balancing UDP transport 71 This option enables support for load balancing UDP transport
78 protocol. Say Y if unsure. 72 protocol. Say Y if unsure.
79 73
80config IP_VS_PROTO_ESP 74config IP_VS_PROTO_ESP
81 bool "ESP load balancing support" 75 bool "ESP load balancing support"
82 depends on IP_VS
83 ---help--- 76 ---help---
84 This option enables support for load balancing ESP (Encapsulation 77 This option enables support for load balancing ESP (Encapsulation
85 Security Payload) transport protocol. Say Y if unsure. 78 Security Payload) transport protocol. Say Y if unsure.
86 79
87config IP_VS_PROTO_AH 80config IP_VS_PROTO_AH
88 bool "AH load balancing support" 81 bool "AH load balancing support"
89 depends on IP_VS
90 ---help--- 82 ---help---
91 This option enables support for load balancing AH (Authentication 83 This option enables support for load balancing AH (Authentication
92 Header) transport protocol. Say Y if unsure. 84 Header) transport protocol. Say Y if unsure.
93 85
94comment "IPVS scheduler" 86comment "IPVS scheduler"
95 depends on IP_VS
96 87
97config IP_VS_RR 88config IP_VS_RR
98 tristate "round-robin scheduling" 89 tristate "round-robin scheduling"
99 depends on IP_VS
100 ---help--- 90 ---help---
101 The robin-robin scheduling algorithm simply directs network 91 The robin-robin scheduling algorithm simply directs network
102 connections to different real servers in a round-robin manner. 92 connections to different real servers in a round-robin manner.
@@ -106,7 +96,6 @@ config IP_VS_RR
106 96
107config IP_VS_WRR 97config IP_VS_WRR
108 tristate "weighted round-robin scheduling" 98 tristate "weighted round-robin scheduling"
109 depends on IP_VS
110 ---help--- 99 ---help---
111 The weighted robin-robin scheduling algorithm directs network 100 The weighted robin-robin scheduling algorithm directs network
112 connections to different real servers based on server weights 101 connections to different real servers based on server weights
@@ -120,7 +109,6 @@ config IP_VS_WRR
120 109
121config IP_VS_LC 110config IP_VS_LC
122 tristate "least-connection scheduling" 111 tristate "least-connection scheduling"
123 depends on IP_VS
124 ---help--- 112 ---help---
125 The least-connection scheduling algorithm directs network 113 The least-connection scheduling algorithm directs network
126 connections to the server with the least number of active 114 connections to the server with the least number of active
@@ -131,7 +119,6 @@ config IP_VS_LC
131 119
132config IP_VS_WLC 120config IP_VS_WLC
133 tristate "weighted least-connection scheduling" 121 tristate "weighted least-connection scheduling"
134 depends on IP_VS
135 ---help--- 122 ---help---
136 The weighted least-connection scheduling algorithm directs network 123 The weighted least-connection scheduling algorithm directs network
137 connections to the server with the least active connections 124 connections to the server with the least active connections
@@ -142,7 +129,6 @@ config IP_VS_WLC
142 129
143config IP_VS_LBLC 130config IP_VS_LBLC
144 tristate "locality-based least-connection scheduling" 131 tristate "locality-based least-connection scheduling"
145 depends on IP_VS
146 ---help--- 132 ---help---
147 The locality-based least-connection scheduling algorithm is for 133 The locality-based least-connection scheduling algorithm is for
148 destination IP load balancing. It is usually used in cache cluster. 134 destination IP load balancing. It is usually used in cache cluster.
@@ -157,7 +143,6 @@ config IP_VS_LBLC
157 143
158config IP_VS_LBLCR 144config IP_VS_LBLCR
159 tristate "locality-based least-connection with replication scheduling" 145 tristate "locality-based least-connection with replication scheduling"
160 depends on IP_VS
161 ---help--- 146 ---help---
162 The locality-based least-connection with replication scheduling 147 The locality-based least-connection with replication scheduling
163 algorithm is also for destination IP load balancing. It is 148 algorithm is also for destination IP load balancing. It is
@@ -176,7 +161,6 @@ config IP_VS_LBLCR
176 161
177config IP_VS_DH 162config IP_VS_DH
178 tristate "destination hashing scheduling" 163 tristate "destination hashing scheduling"
179 depends on IP_VS
180 ---help--- 164 ---help---
181 The destination hashing scheduling algorithm assigns network 165 The destination hashing scheduling algorithm assigns network
182 connections to the servers through looking up a statically assigned 166 connections to the servers through looking up a statically assigned
@@ -187,7 +171,6 @@ config IP_VS_DH
187 171
188config IP_VS_SH 172config IP_VS_SH
189 tristate "source hashing scheduling" 173 tristate "source hashing scheduling"
190 depends on IP_VS
191 ---help--- 174 ---help---
192 The source hashing scheduling algorithm assigns network 175 The source hashing scheduling algorithm assigns network
193 connections to the servers through looking up a statically assigned 176 connections to the servers through looking up a statically assigned
@@ -198,7 +181,6 @@ config IP_VS_SH
198 181
199config IP_VS_SED 182config IP_VS_SED
200 tristate "shortest expected delay scheduling" 183 tristate "shortest expected delay scheduling"
201 depends on IP_VS
202 ---help--- 184 ---help---
203 The shortest expected delay scheduling algorithm assigns network 185 The shortest expected delay scheduling algorithm assigns network
204 connections to the server with the shortest expected delay. The 186 connections to the server with the shortest expected delay. The
@@ -212,7 +194,6 @@ config IP_VS_SED
212 194
213config IP_VS_NQ 195config IP_VS_NQ
214 tristate "never queue scheduling" 196 tristate "never queue scheduling"
215 depends on IP_VS
216 ---help--- 197 ---help---
217 The never queue scheduling algorithm adopts a two-speed model. 198 The never queue scheduling algorithm adopts a two-speed model.
218 When there is an idle server available, the job will be sent to 199 When there is an idle server available, the job will be sent to
@@ -225,11 +206,10 @@ config IP_VS_NQ
225 module, choose M here. If unsure, say N. 206 module, choose M here. If unsure, say N.
226 207
227comment 'IPVS application helper' 208comment 'IPVS application helper'
228 depends on IP_VS
229 209
230config IP_VS_FTP 210config IP_VS_FTP
231 tristate "FTP protocol helper" 211 tristate "FTP protocol helper"
232 depends on IP_VS && IP_VS_PROTO_TCP 212 depends on IP_VS_PROTO_TCP
233 ---help--- 213 ---help---
234 FTP is a protocol that transfers IP address and/or port number in 214 FTP is a protocol that transfers IP address and/or port number in
235 the payload. In the virtual server via Network Address Translation, 215 the payload. In the virtual server via Network Address Translation,
@@ -241,4 +221,4 @@ config IP_VS_FTP
241 If you want to compile it in kernel, say Y. To compile it as a 221 If you want to compile it in kernel, say Y. To compile it as a
242 module, choose M here. If unsure, say N. 222 module, choose M here. If unsure, say N.
243 223
244endmenu 224endif # IP_VS
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 0654eaae70c9..fd62a41d69cc 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -154,12 +154,10 @@ static unsigned int ipv4_conntrack_defrag(unsigned int hooknum,
154 const struct net_device *out, 154 const struct net_device *out,
155 int (*okfn)(struct sk_buff *)) 155 int (*okfn)(struct sk_buff *))
156{ 156{
157#if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE)
158 /* Previously seen (loopback)? Ignore. Do this before 157 /* Previously seen (loopback)? Ignore. Do this before
159 fragment check. */ 158 fragment check. */
160 if ((*pskb)->nfct) 159 if ((*pskb)->nfct)
161 return NF_ACCEPT; 160 return NF_ACCEPT;
162#endif
163 161
164 /* Gather fragments. */ 162 /* Gather fragments. */
165 if (ip_hdr(*pskb)->frag_off & htons(IP_MF | IP_OFFSET)) { 163 if (ip_hdr(*pskb)->frag_off & htons(IP_MF | IP_OFFSET)) {
diff --git a/net/ipv4/netfilter/nf_nat_ftp.c b/net/ipv4/netfilter/nf_nat_ftp.c
index 751b59801755..e6bc8e5a72f1 100644
--- a/net/ipv4/netfilter/nf_nat_ftp.c
+++ b/net/ipv4/netfilter/nf_nat_ftp.c
@@ -40,8 +40,7 @@ mangle_rfc959_packet(struct sk_buff **pskb,
40 unsigned int matchoff, 40 unsigned int matchoff,
41 unsigned int matchlen, 41 unsigned int matchlen,
42 struct nf_conn *ct, 42 struct nf_conn *ct,
43 enum ip_conntrack_info ctinfo, 43 enum ip_conntrack_info ctinfo)
44 u32 *seq)
45{ 44{
46 char buffer[sizeof("nnn,nnn,nnn,nnn,nnn,nnn")]; 45 char buffer[sizeof("nnn,nnn,nnn,nnn,nnn,nnn")];
47 46
@@ -50,7 +49,6 @@ mangle_rfc959_packet(struct sk_buff **pskb,
50 49
51 DEBUGP("calling nf_nat_mangle_tcp_packet\n"); 50 DEBUGP("calling nf_nat_mangle_tcp_packet\n");
52 51
53 *seq += strlen(buffer) - matchlen;
54 return nf_nat_mangle_tcp_packet(pskb, ct, ctinfo, matchoff, 52 return nf_nat_mangle_tcp_packet(pskb, ct, ctinfo, matchoff,
55 matchlen, buffer, strlen(buffer)); 53 matchlen, buffer, strlen(buffer));
56} 54}
@@ -63,8 +61,7 @@ mangle_eprt_packet(struct sk_buff **pskb,
63 unsigned int matchoff, 61 unsigned int matchoff,
64 unsigned int matchlen, 62 unsigned int matchlen,
65 struct nf_conn *ct, 63 struct nf_conn *ct,
66 enum ip_conntrack_info ctinfo, 64 enum ip_conntrack_info ctinfo)
67 u32 *seq)
68{ 65{
69 char buffer[sizeof("|1|255.255.255.255|65535|")]; 66 char buffer[sizeof("|1|255.255.255.255|65535|")];
70 67
@@ -72,7 +69,6 @@ mangle_eprt_packet(struct sk_buff **pskb,
72 69
73 DEBUGP("calling nf_nat_mangle_tcp_packet\n"); 70 DEBUGP("calling nf_nat_mangle_tcp_packet\n");
74 71
75 *seq += strlen(buffer) - matchlen;
76 return nf_nat_mangle_tcp_packet(pskb, ct, ctinfo, matchoff, 72 return nf_nat_mangle_tcp_packet(pskb, ct, ctinfo, matchoff,
77 matchlen, buffer, strlen(buffer)); 73 matchlen, buffer, strlen(buffer));
78} 74}
@@ -85,8 +81,7 @@ mangle_epsv_packet(struct sk_buff **pskb,
85 unsigned int matchoff, 81 unsigned int matchoff,
86 unsigned int matchlen, 82 unsigned int matchlen,
87 struct nf_conn *ct, 83 struct nf_conn *ct,
88 enum ip_conntrack_info ctinfo, 84 enum ip_conntrack_info ctinfo)
89 u32 *seq)
90{ 85{
91 char buffer[sizeof("|||65535|")]; 86 char buffer[sizeof("|||65535|")];
92 87
@@ -94,14 +89,13 @@ mangle_epsv_packet(struct sk_buff **pskb,
94 89
95 DEBUGP("calling nf_nat_mangle_tcp_packet\n"); 90 DEBUGP("calling nf_nat_mangle_tcp_packet\n");
96 91
97 *seq += strlen(buffer) - matchlen;
98 return nf_nat_mangle_tcp_packet(pskb, ct, ctinfo, matchoff, 92 return nf_nat_mangle_tcp_packet(pskb, ct, ctinfo, matchoff,
99 matchlen, buffer, strlen(buffer)); 93 matchlen, buffer, strlen(buffer));
100} 94}
101 95
102static int (*mangle[])(struct sk_buff **, __be32, u_int16_t, 96static int (*mangle[])(struct sk_buff **, __be32, u_int16_t,
103 unsigned int, unsigned int, struct nf_conn *, 97 unsigned int, unsigned int, struct nf_conn *,
104 enum ip_conntrack_info, u32 *seq) 98 enum ip_conntrack_info)
105= { 99= {
106 [NF_CT_FTP_PORT] = mangle_rfc959_packet, 100 [NF_CT_FTP_PORT] = mangle_rfc959_packet,
107 [NF_CT_FTP_PASV] = mangle_rfc959_packet, 101 [NF_CT_FTP_PASV] = mangle_rfc959_packet,
@@ -116,8 +110,7 @@ static unsigned int nf_nat_ftp(struct sk_buff **pskb,
116 enum nf_ct_ftp_type type, 110 enum nf_ct_ftp_type type,
117 unsigned int matchoff, 111 unsigned int matchoff,
118 unsigned int matchlen, 112 unsigned int matchlen,
119 struct nf_conntrack_expect *exp, 113 struct nf_conntrack_expect *exp)
120 u32 *seq)
121{ 114{
122 __be32 newip; 115 __be32 newip;
123 u_int16_t port; 116 u_int16_t port;
@@ -145,8 +138,7 @@ static unsigned int nf_nat_ftp(struct sk_buff **pskb,
145 if (port == 0) 138 if (port == 0)
146 return NF_DROP; 139 return NF_DROP;
147 140
148 if (!mangle[type](pskb, newip, port, matchoff, matchlen, ct, ctinfo, 141 if (!mangle[type](pskb, newip, port, matchoff, matchlen, ct, ctinfo)) {
149 seq)) {
150 nf_conntrack_unexpect_related(exp); 142 nf_conntrack_unexpect_related(exp);
151 return NF_DROP; 143 return NF_DROP;
152 } 144 }
diff --git a/net/ipv4/netfilter/nf_nat_h323.c b/net/ipv4/netfilter/nf_nat_h323.c
index fcebc968d37f..c5d2a2d690b8 100644
--- a/net/ipv4/netfilter/nf_nat_h323.c
+++ b/net/ipv4/netfilter/nf_nat_h323.c
@@ -455,9 +455,9 @@ static int nat_q931(struct sk_buff **pskb, struct nf_conn *ct,
455 if (idx > 0 && 455 if (idx > 0 &&
456 get_h225_addr(ct, *data, &taddr[0], &addr, &port) && 456 get_h225_addr(ct, *data, &taddr[0], &addr, &port) &&
457 (ntohl(addr.ip) & 0xff000000) == 0x7f000000) { 457 (ntohl(addr.ip) & 0xff000000) == 0x7f000000) {
458 set_h225_addr_hook(pskb, data, 0, &taddr[0], 458 set_h225_addr(pskb, data, 0, &taddr[0],
459 &ct->tuplehash[!dir].tuple.dst.u3, 459 &ct->tuplehash[!dir].tuple.dst.u3,
460 info->sig_port[!dir]); 460 info->sig_port[!dir]);
461 } 461 }
462 } else { 462 } else {
463 nf_conntrack_unexpect_related(exp); 463 nf_conntrack_unexpect_related(exp);
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index df9fe4f2e8cc..8603cfb271f2 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2598,6 +2598,69 @@ int __ip_route_output_key(struct rtable **rp, const struct flowi *flp)
2598 2598
2599EXPORT_SYMBOL_GPL(__ip_route_output_key); 2599EXPORT_SYMBOL_GPL(__ip_route_output_key);
2600 2600
2601static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)
2602{
2603}
2604
2605static struct dst_ops ipv4_dst_blackhole_ops = {
2606 .family = AF_INET,
2607 .protocol = __constant_htons(ETH_P_IP),
2608 .destroy = ipv4_dst_destroy,
2609 .check = ipv4_dst_check,
2610 .update_pmtu = ipv4_rt_blackhole_update_pmtu,
2611 .entry_size = sizeof(struct rtable),
2612};
2613
2614
2615static int ipv4_blackhole_output(struct sk_buff *skb)
2616{
2617 kfree_skb(skb);
2618 return 0;
2619}
2620
2621static int ipv4_dst_blackhole(struct rtable **rp, struct flowi *flp, struct sock *sk)
2622{
2623 struct rtable *ort = *rp;
2624 struct rtable *rt = (struct rtable *)
2625 dst_alloc(&ipv4_dst_blackhole_ops);
2626
2627 if (rt) {
2628 struct dst_entry *new = &rt->u.dst;
2629
2630 atomic_set(&new->__refcnt, 1);
2631 new->__use = 1;
2632 new->input = ipv4_blackhole_output;
2633 new->output = ipv4_blackhole_output;
2634 memcpy(new->metrics, ort->u.dst.metrics, RTAX_MAX*sizeof(u32));
2635
2636 new->dev = ort->u.dst.dev;
2637 if (new->dev)
2638 dev_hold(new->dev);
2639
2640 rt->fl = ort->fl;
2641
2642 rt->idev = ort->idev;
2643 if (rt->idev)
2644 in_dev_hold(rt->idev);
2645 rt->rt_flags = ort->rt_flags;
2646 rt->rt_type = ort->rt_type;
2647 rt->rt_dst = ort->rt_dst;
2648 rt->rt_src = ort->rt_src;
2649 rt->rt_iif = ort->rt_iif;
2650 rt->rt_gateway = ort->rt_gateway;
2651 rt->rt_spec_dst = ort->rt_spec_dst;
2652 rt->peer = ort->peer;
2653 if (rt->peer)
2654 atomic_inc(&rt->peer->refcnt);
2655
2656 dst_free(new);
2657 }
2658
2659 dst_release(&(*rp)->u.dst);
2660 *rp = rt;
2661 return (rt ? 0 : -ENOMEM);
2662}
2663
2601int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags) 2664int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags)
2602{ 2665{
2603 int err; 2666 int err;
@@ -2610,7 +2673,11 @@ int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk,
2610 flp->fl4_src = (*rp)->rt_src; 2673 flp->fl4_src = (*rp)->rt_src;
2611 if (!flp->fl4_dst) 2674 if (!flp->fl4_dst)
2612 flp->fl4_dst = (*rp)->rt_dst; 2675 flp->fl4_dst = (*rp)->rt_dst;
2613 return xfrm_lookup((struct dst_entry **)rp, flp, sk, flags); 2676 err = __xfrm_lookup((struct dst_entry **)rp, flp, sk, flags);
2677 if (err == -EREMOTE)
2678 err = ipv4_dst_blackhole(rp, flp, sk);
2679
2680 return err;
2614 } 2681 }
2615 2682
2616 return 0; 2683 return 0;
@@ -3139,6 +3206,8 @@ int __init ip_rt_init(void)
3139 kmem_cache_create("ip_dst_cache", sizeof(struct rtable), 0, 3206 kmem_cache_create("ip_dst_cache", sizeof(struct rtable), 0,
3140 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); 3207 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
3141 3208
3209 ipv4_dst_blackhole_ops.kmem_cachep = ipv4_dst_ops.kmem_cachep;
3210
3142 rt_hash_table = (struct rt_hash_bucket *) 3211 rt_hash_table = (struct rt_hash_bucket *)
3143 alloc_large_system_hash("IP route cache", 3212 alloc_large_system_hash("IP route cache",
3144 sizeof(struct rt_hash_bucket), 3213 sizeof(struct rt_hash_bucket),
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index bd4c295f5d79..766314505c09 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1674,9 +1674,8 @@ adjudge_to_death:
1674 } 1674 }
1675 if (sk->sk_state != TCP_CLOSE) { 1675 if (sk->sk_state != TCP_CLOSE) {
1676 sk_stream_mem_reclaim(sk); 1676 sk_stream_mem_reclaim(sk);
1677 if (atomic_read(sk->sk_prot->orphan_count) > sysctl_tcp_max_orphans || 1677 if (tcp_too_many_orphans(sk,
1678 (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && 1678 atomic_read(sk->sk_prot->orphan_count))) {
1679 atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])) {
1680 if (net_ratelimit()) 1679 if (net_ratelimit())
1681 printk(KERN_INFO "TCP: too many of orphaned " 1680 printk(KERN_INFO "TCP: too many of orphaned "
1682 "sockets\n"); 1681 "sockets\n");
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 7641b2761a14..38cb25b48bf3 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1501,6 +1501,8 @@ void tcp_enter_loss(struct sock *sk, int how)
1501 tcp_set_ca_state(sk, TCP_CA_Loss); 1501 tcp_set_ca_state(sk, TCP_CA_Loss);
1502 tp->high_seq = tp->snd_nxt; 1502 tp->high_seq = tp->snd_nxt;
1503 TCP_ECN_queue_cwr(tp); 1503 TCP_ECN_queue_cwr(tp);
1504 /* Abort FRTO algorithm if one is in progress */
1505 tp->frto_counter = 0;
1504 1506
1505 clear_all_retrans_hints(tp); 1507 clear_all_retrans_hints(tp);
1506} 1508}
@@ -2608,6 +2610,7 @@ static void tcp_conservative_spur_to_response(struct tcp_sock *tp)
2608{ 2610{
2609 tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh); 2611 tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh);
2610 tp->snd_cwnd_cnt = 0; 2612 tp->snd_cwnd_cnt = 0;
2613 TCP_ECN_queue_cwr(tp);
2611 tcp_moderate_cwnd(tp); 2614 tcp_moderate_cwnd(tp);
2612} 2615}
2613 2616
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 3938d5dbdf20..760165a0800c 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -80,7 +80,8 @@ static void printl(const char *fmt, ...)
80 80
81 kfifo_put(tcpw.fifo, tbuf, len); 81 kfifo_put(tcpw.fifo, tbuf, len);
82 wake_up(&tcpw.wait); 82 wake_up(&tcpw.wait);
83} 83} __attribute__ ((format (printf, 1, 2)));
84
84 85
85/* 86/*
86 * Hook inserted to be called before each receive packet. 87 * Hook inserted to be called before each receive packet.
@@ -95,7 +96,7 @@ static int jtcp_rcv_established(struct sock *sk, struct sk_buff *skb,
95 /* Only update if port matches */ 96 /* Only update if port matches */
96 if ((port == 0 || ntohs(inet->dport) == port || ntohs(inet->sport) == port) 97 if ((port == 0 || ntohs(inet->dport) == port || ntohs(inet->sport) == port)
97 && (full || tp->snd_cwnd != tcpw.lastcwnd)) { 98 && (full || tp->snd_cwnd != tcpw.lastcwnd)) {
98 printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %#x %#x %u %u %u\n", 99 printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %#x %#x %u %u %u %u\n",
99 NIPQUAD(inet->saddr), ntohs(inet->sport), 100 NIPQUAD(inet->saddr), ntohs(inet->sport),
100 NIPQUAD(inet->daddr), ntohs(inet->dport), 101 NIPQUAD(inet->daddr), ntohs(inet->dport),
101 skb->len, tp->snd_nxt, tp->snd_una, 102 skb->len, tp->snd_nxt, tp->snd_una,
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 2ca97b20929d..e61340150ba6 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -78,9 +78,7 @@ static int tcp_out_of_resources(struct sock *sk, int do_reset)
78 if (sk->sk_err_soft) 78 if (sk->sk_err_soft)
79 orphans <<= 1; 79 orphans <<= 1;
80 80
81 if (orphans >= sysctl_tcp_max_orphans || 81 if (tcp_too_many_orphans(sk, orphans)) {
82 (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
83 atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])) {
84 if (net_ratelimit()) 82 if (net_ratelimit())
85 printk(KERN_INFO "Out of socket memory\n"); 83 printk(KERN_INFO "Out of socket memory\n");
86 84
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c
index 5ceca951d73f..fa1902dc81b8 100644
--- a/net/ipv4/xfrm4_input.c
+++ b/net/ipv4/xfrm4_input.c
@@ -139,10 +139,8 @@ int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type)
139 nf_reset(skb); 139 nf_reset(skb);
140 140
141 if (decaps) { 141 if (decaps) {
142 if (!(skb->dev->flags&IFF_LOOPBACK)) { 142 dst_release(skb->dst);
143 dst_release(skb->dst); 143 skb->dst = NULL;
144 skb->dst = NULL;
145 }
146 netif_rx(skb); 144 netif_rx(skb);
147 return 0; 145 return 0;
148 } else { 146 } else {
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
index a2f2e6a5ec5d..9963700e74c1 100644
--- a/net/ipv4/xfrm4_mode_tunnel.c
+++ b/net/ipv4/xfrm4_mode_tunnel.c
@@ -85,6 +85,8 @@ static int xfrm4_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
85 top_iph->saddr = x->props.saddr.a4; 85 top_iph->saddr = x->props.saddr.a4;
86 top_iph->daddr = x->id.daddr.a4; 86 top_iph->daddr = x->id.daddr.a4;
87 87
88 skb->protocol = htons(ETH_P_IP);
89
88 memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); 90 memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
89 return 0; 91 return 0;
90} 92}
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index c7ea248fae2e..329de679ac38 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2154,15 +2154,6 @@ static void addrconf_dev_config(struct net_device *dev)
2154 2154
2155 ASSERT_RTNL(); 2155 ASSERT_RTNL();
2156 2156
2157 if ((dev->type != ARPHRD_ETHER) &&
2158 (dev->type != ARPHRD_FDDI) &&
2159 (dev->type != ARPHRD_IEEE802_TR) &&
2160 (dev->type != ARPHRD_ARCNET) &&
2161 (dev->type != ARPHRD_INFINIBAND)) {
2162 /* Alas, we support only Ethernet autoconfiguration. */
2163 return;
2164 }
2165
2166 idev = addrconf_add_dev(dev); 2157 idev = addrconf_add_dev(dev);
2167 if (idev == NULL) 2158 if (idev == NULL)
2168 return; 2159 return;
@@ -2250,13 +2241,33 @@ static void addrconf_ip6_tnl_config(struct net_device *dev)
2250 ip6_tnl_add_linklocal(idev); 2241 ip6_tnl_add_linklocal(idev);
2251} 2242}
2252 2243
2244static int ipv6_hwtype(struct net_device *dev)
2245{
2246 if ((dev->type == ARPHRD_ETHER) ||
2247 (dev->type == ARPHRD_LOOPBACK) ||
2248 (dev->type == ARPHRD_SIT) ||
2249 (dev->type == ARPHRD_TUNNEL6) ||
2250 (dev->type == ARPHRD_FDDI) ||
2251 (dev->type == ARPHRD_IEEE802_TR) ||
2252 (dev->type == ARPHRD_ARCNET) ||
2253 (dev->type == ARPHRD_INFINIBAND))
2254 return 1;
2255
2256 return 0;
2257}
2258
2253static int addrconf_notify(struct notifier_block *this, unsigned long event, 2259static int addrconf_notify(struct notifier_block *this, unsigned long event,
2254 void * data) 2260 void * data)
2255{ 2261{
2256 struct net_device *dev = (struct net_device *) data; 2262 struct net_device *dev = (struct net_device *) data;
2257 struct inet6_dev *idev = __in6_dev_get(dev); 2263 struct inet6_dev *idev;
2258 int run_pending = 0; 2264 int run_pending = 0;
2259 2265
2266 if (!ipv6_hwtype(dev))
2267 return NOTIFY_OK;
2268
2269 idev = __in6_dev_get(dev);
2270
2260 switch(event) { 2271 switch(event) {
2261 case NETDEV_REGISTER: 2272 case NETDEV_REGISTER:
2262 if (!idev) { 2273 if (!idev) {
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index b696c8401200..128f94c79c64 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -247,7 +247,7 @@ static int ah6_output(struct xfrm_state *x, struct sk_buff *skb)
247 memcpy(tmp_base, top_iph, sizeof(tmp_base)); 247 memcpy(tmp_base, top_iph, sizeof(tmp_base));
248 248
249 tmp_ext = NULL; 249 tmp_ext = NULL;
250 extlen = skb_transport_offset(skb) + sizeof(struct ipv6hdr); 250 extlen = skb_transport_offset(skb) - sizeof(struct ipv6hdr);
251 if (extlen) { 251 if (extlen) {
252 extlen += sizeof(*tmp_ext); 252 extlen += sizeof(*tmp_ext);
253 tmp_ext = kmalloc(extlen, GFP_ATOMIC); 253 tmp_ext = kmalloc(extlen, GFP_ATOMIC);
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 403eee66b9c5..b1fe7ac5dc90 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -177,8 +177,12 @@ ipv4_connected:
177 if (final_p) 177 if (final_p)
178 ipv6_addr_copy(&fl.fl6_dst, final_p); 178 ipv6_addr_copy(&fl.fl6_dst, final_p);
179 179
180 if ((err = xfrm_lookup(&dst, &fl, sk, 1)) < 0) 180 if ((err = __xfrm_lookup(&dst, &fl, sk, 1)) < 0) {
181 goto out; 181 if (err == -EREMOTE)
182 err = ip6_dst_blackhole(sk, &dst, &fl);
183 if (err < 0)
184 goto out;
185 }
182 186
183 /* source address lookup done in ip6_dst_lookup */ 187 /* source address lookup done in ip6_dst_lookup */
184 188
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index ca08ee88d07f..662a7d9681fd 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -619,14 +619,6 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
619 619
620 ins = &fn->leaf; 620 ins = &fn->leaf;
621 621
622 if (fn->fn_flags&RTN_TL_ROOT &&
623 fn->leaf == &ip6_null_entry &&
624 !(rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) ){
625 fn->leaf = rt;
626 rt->u.dst.rt6_next = NULL;
627 goto out;
628 }
629
630 for (iter = fn->leaf; iter; iter=iter->u.dst.rt6_next) { 622 for (iter = fn->leaf; iter; iter=iter->u.dst.rt6_next) {
631 /* 623 /*
632 * Search for duplicates 624 * Search for duplicates
@@ -666,7 +658,6 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
666 * insert node 658 * insert node
667 */ 659 */
668 660
669out:
670 rt->u.dst.rt6_next = iter; 661 rt->u.dst.rt6_next = iter;
671 *ins = rt; 662 *ins = rt;
672 rt->rt6i_node = fn; 663 rt->rt6i_node = fn;
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 009a1047fc3f..a58459a76684 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -818,8 +818,12 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
818 if (final_p) 818 if (final_p)
819 ipv6_addr_copy(&fl.fl6_dst, final_p); 819 ipv6_addr_copy(&fl.fl6_dst, final_p);
820 820
821 if ((err = xfrm_lookup(&dst, &fl, sk, 1)) < 0) 821 if ((err = __xfrm_lookup(&dst, &fl, sk, 1)) < 0) {
822 goto out; 822 if (err == -EREMOTE)
823 err = ip6_dst_blackhole(sk, &dst, &fl);
824 if (err < 0)
825 goto out;
826 }
823 827
824 if (hlimit < 0) { 828 if (hlimit < 0) {
825 if (ipv6_addr_is_multicast(&fl.fl6_dst)) 829 if (ipv6_addr_is_multicast(&fl.fl6_dst))
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b46ad53044ba..1324b06796c0 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -119,6 +119,19 @@ static struct dst_ops ip6_dst_ops = {
119 .entry_size = sizeof(struct rt6_info), 119 .entry_size = sizeof(struct rt6_info),
120}; 120};
121 121
122static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)
123{
124}
125
126static struct dst_ops ip6_dst_blackhole_ops = {
127 .family = AF_INET6,
128 .protocol = __constant_htons(ETH_P_IPV6),
129 .destroy = ip6_dst_destroy,
130 .check = ip6_dst_check,
131 .update_pmtu = ip6_rt_blackhole_update_pmtu,
132 .entry_size = sizeof(struct rt6_info),
133};
134
122struct rt6_info ip6_null_entry = { 135struct rt6_info ip6_null_entry = {
123 .u = { 136 .u = {
124 .dst = { 137 .dst = {
@@ -833,6 +846,54 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)
833 846
834EXPORT_SYMBOL(ip6_route_output); 847EXPORT_SYMBOL(ip6_route_output);
835 848
849static int ip6_blackhole_output(struct sk_buff *skb)
850{
851 kfree_skb(skb);
852 return 0;
853}
854
855int ip6_dst_blackhole(struct sock *sk, struct dst_entry **dstp, struct flowi *fl)
856{
857 struct rt6_info *ort = (struct rt6_info *) *dstp;
858 struct rt6_info *rt = (struct rt6_info *)
859 dst_alloc(&ip6_dst_blackhole_ops);
860 struct dst_entry *new = NULL;
861
862 if (rt) {
863 new = &rt->u.dst;
864
865 atomic_set(&new->__refcnt, 1);
866 new->__use = 1;
867 new->input = ip6_blackhole_output;
868 new->output = ip6_blackhole_output;
869
870 memcpy(new->metrics, ort->u.dst.metrics, RTAX_MAX*sizeof(u32));
871 new->dev = ort->u.dst.dev;
872 if (new->dev)
873 dev_hold(new->dev);
874 rt->rt6i_idev = ort->rt6i_idev;
875 if (rt->rt6i_idev)
876 in6_dev_hold(rt->rt6i_idev);
877 rt->rt6i_expires = 0;
878
879 ipv6_addr_copy(&rt->rt6i_gateway, &ort->rt6i_gateway);
880 rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES;
881 rt->rt6i_metric = 0;
882
883 memcpy(&rt->rt6i_dst, &ort->rt6i_dst, sizeof(struct rt6key));
884#ifdef CONFIG_IPV6_SUBTREES
885 memcpy(&rt->rt6i_src, &ort->rt6i_src, sizeof(struct rt6key));
886#endif
887
888 dst_free(new);
889 }
890
891 dst_release(*dstp);
892 *dstp = new;
893 return (new ? 0 : -ENOMEM);
894}
895EXPORT_SYMBOL_GPL(ip6_dst_blackhole);
896
836/* 897/*
837 * Destination cache support functions 898 * Destination cache support functions
838 */ 899 */
@@ -2495,6 +2556,8 @@ void __init ip6_route_init(void)
2495 ip6_dst_ops.kmem_cachep = 2556 ip6_dst_ops.kmem_cachep =
2496 kmem_cache_create("ip6_dst_cache", sizeof(struct rt6_info), 0, 2557 kmem_cache_create("ip6_dst_cache", sizeof(struct rt6_info), 0,
2497 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); 2558 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
2559 ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops.kmem_cachep;
2560
2498 fib6_init(); 2561 fib6_init();
2499#ifdef CONFIG_PROC_FS 2562#ifdef CONFIG_PROC_FS
2500 p = proc_net_create("ipv6_route", 0, rt6_proc_info); 2563 p = proc_net_create("ipv6_route", 0, rt6_proc_info);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index e2f25ea43b68..4f06a51ad4fd 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -265,8 +265,12 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
265 if (final_p) 265 if (final_p)
266 ipv6_addr_copy(&fl.fl6_dst, final_p); 266 ipv6_addr_copy(&fl.fl6_dst, final_p);
267 267
268 if ((err = xfrm_lookup(&dst, &fl, sk, 1)) < 0) 268 if ((err = __xfrm_lookup(&dst, &fl, sk, 1)) < 0) {
269 goto failure; 269 if (err == -EREMOTE)
270 err = ip6_dst_blackhole(sk, &dst, &fl);
271 if (err < 0)
272 goto failure;
273 }
270 274
271 if (saddr == NULL) { 275 if (saddr == NULL) {
272 saddr = &fl.fl6_src; 276 saddr = &fl.fl6_src;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index a7ae59c954d5..d1fbddd172e7 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -767,8 +767,12 @@ do_udp_sendmsg:
767 if (final_p) 767 if (final_p)
768 ipv6_addr_copy(&fl.fl6_dst, final_p); 768 ipv6_addr_copy(&fl.fl6_dst, final_p);
769 769
770 if ((err = xfrm_lookup(&dst, &fl, sk, 1)) < 0) 770 if ((err = __xfrm_lookup(&dst, &fl, sk, 1)) < 0) {
771 goto out; 771 if (err == -EREMOTE)
772 err = ip6_dst_blackhole(sk, &dst, &fl);
773 if (err < 0)
774 goto out;
775 }
772 776
773 if (hlimit < 0) { 777 if (hlimit < 0) {
774 if (ipv6_addr_is_multicast(&fl.fl6_dst)) 778 if (ipv6_addr_is_multicast(&fl.fl6_dst))
diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c
index d7ed8aa56ec1..c858537cec4b 100644
--- a/net/ipv6/xfrm6_input.c
+++ b/net/ipv6/xfrm6_input.c
@@ -104,10 +104,8 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
104 nf_reset(skb); 104 nf_reset(skb);
105 105
106 if (decaps) { 106 if (decaps) {
107 if (!(skb->dev->flags&IFF_LOOPBACK)) { 107 dst_release(skb->dst);
108 dst_release(skb->dst); 108 skb->dst = NULL;
109 skb->dst = NULL;
110 }
111 netif_rx(skb); 109 netif_rx(skb);
112 return -1; 110 return -1;
113 } else { 111 } else {
diff --git a/net/ipv6/xfrm6_mode_tunnel.c b/net/ipv6/xfrm6_mode_tunnel.c
index a6c0cdf46ad6..9fc95bc6509f 100644
--- a/net/ipv6/xfrm6_mode_tunnel.c
+++ b/net/ipv6/xfrm6_mode_tunnel.c
@@ -80,6 +80,7 @@ static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
80 top_iph->hop_limit = dst_metric(dst->child, RTAX_HOPLIMIT); 80 top_iph->hop_limit = dst_metric(dst->child, RTAX_HOPLIMIT);
81 ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr); 81 ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr);
82 ipv6_addr_copy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr); 82 ipv6_addr_copy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr);
83 skb->protocol = htons(ETH_P_IPV6);
83 return 0; 84 return 0;
84} 85}
85 86
diff --git a/net/key/af_key.c b/net/key/af_key.c
index a99444142dc7..d302ddae580c 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1448,8 +1448,6 @@ static int pfkey_add(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr,
1448 int err; 1448 int err;
1449 struct km_event c; 1449 struct km_event c;
1450 1450
1451 xfrm_probe_algs();
1452
1453 x = pfkey_msg2xfrm_state(hdr, ext_hdrs); 1451 x = pfkey_msg2xfrm_state(hdr, ext_hdrs);
1454 if (IS_ERR(x)) 1452 if (IS_ERR(x))
1455 return PTR_ERR(x); 1453 return PTR_ERR(x);
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 6e36df67f8d5..4e84f24fd439 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -2474,6 +2474,8 @@ static int ieee80211_open(struct net_device *dev)
2474 if (sdata->type == IEEE80211_IF_TYPE_STA && 2474 if (sdata->type == IEEE80211_IF_TYPE_STA &&
2475 !local->user_space_mlme) 2475 !local->user_space_mlme)
2476 netif_carrier_off(dev); 2476 netif_carrier_off(dev);
2477 else
2478 netif_carrier_on(dev);
2477 2479
2478 netif_start_queue(dev); 2480 netif_start_queue(dev);
2479 return 0; 2481 return 0;
@@ -3278,8 +3280,10 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
3278 return TXRX_DROP; 3280 return TXRX_DROP;
3279 } 3281 }
3280 } 3282 }
3281 while ((skb = __skb_dequeue(&entry->skb_list))) 3283 while ((skb = __skb_dequeue(&entry->skb_list))) {
3282 memcpy(skb_put(rx->skb, skb->len), skb->data, skb->len); 3284 memcpy(skb_put(rx->skb, skb->len), skb->data, skb->len);
3285 dev_kfree_skb(skb);
3286 }
3283 3287
3284 /* Complete frame has been reassembled - process it now */ 3288 /* Complete frame has been reassembled - process it now */
3285 rx->fragmented = 1; 3289 rx->fragmented = 1;
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 3e07e9d6fa42..9f30ae4c2ab3 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -1155,6 +1155,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
1155 if (status_code != WLAN_STATUS_SUCCESS) { 1155 if (status_code != WLAN_STATUS_SUCCESS) {
1156 printk(KERN_DEBUG "%s: AP denied association (code=%d)\n", 1156 printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
1157 dev->name, status_code); 1157 dev->name, status_code);
1158 if (status_code == WLAN_STATUS_REASSOC_NO_ASSOC)
1159 ifsta->prev_bssid_set = 0;
1158 return; 1160 return;
1159 } 1161 }
1160 1162
@@ -2995,7 +2997,7 @@ struct sta_info * ieee80211_ibss_add_sta(struct net_device *dev,
2995{ 2997{
2996 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 2998 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
2997 struct sta_info *sta; 2999 struct sta_info *sta;
2998 struct ieee80211_sub_if_data *sdata = NULL; 3000 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
2999 3001
3000 /* TODO: Could consider removing the least recently used entry and 3002 /* TODO: Could consider removing the least recently used entry and
3001 * allow new one to be added. */ 3003 * allow new one to be added. */
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index e8b5c2d7db62..483e927a9ca4 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -298,7 +298,6 @@ static void
298destroy_conntrack(struct nf_conntrack *nfct) 298destroy_conntrack(struct nf_conntrack *nfct)
299{ 299{
300 struct nf_conn *ct = (struct nf_conn *)nfct; 300 struct nf_conn *ct = (struct nf_conn *)nfct;
301 struct nf_conn_help *help = nfct_help(ct);
302 struct nf_conntrack_l4proto *l4proto; 301 struct nf_conntrack_l4proto *l4proto;
303 typeof(nf_conntrack_destroyed) destroyed; 302 typeof(nf_conntrack_destroyed) destroyed;
304 303
@@ -309,9 +308,6 @@ destroy_conntrack(struct nf_conntrack *nfct)
309 nf_conntrack_event(IPCT_DESTROY, ct); 308 nf_conntrack_event(IPCT_DESTROY, ct);
310 set_bit(IPS_DYING_BIT, &ct->status); 309 set_bit(IPS_DYING_BIT, &ct->status);
311 310
312 if (help && help->helper && help->helper->destroy)
313 help->helper->destroy(ct);
314
315 /* To make sure we don't get any weird locking issues here: 311 /* To make sure we don't get any weird locking issues here:
316 * destroy_conntrack() MUST NOT be called with a write lock 312 * destroy_conntrack() MUST NOT be called with a write lock
317 * to nf_conntrack_lock!!! -HW */ 313 * to nf_conntrack_lock!!! -HW */
@@ -353,6 +349,10 @@ destroy_conntrack(struct nf_conntrack *nfct)
353static void death_by_timeout(unsigned long ul_conntrack) 349static void death_by_timeout(unsigned long ul_conntrack)
354{ 350{
355 struct nf_conn *ct = (void *)ul_conntrack; 351 struct nf_conn *ct = (void *)ul_conntrack;
352 struct nf_conn_help *help = nfct_help(ct);
353
354 if (help && help->helper && help->helper->destroy)
355 help->helper->destroy(ct);
356 356
357 write_lock_bh(&nf_conntrack_lock); 357 write_lock_bh(&nf_conntrack_lock);
358 /* Inside lock so preempt is disabled on module removal path. 358 /* Inside lock so preempt is disabled on module removal path.
diff --git a/net/netfilter/nf_conntrack_ftp.c b/net/netfilter/nf_conntrack_ftp.c
index a186799f6542..82db2aa53bfc 100644
--- a/net/netfilter/nf_conntrack_ftp.c
+++ b/net/netfilter/nf_conntrack_ftp.c
@@ -48,8 +48,7 @@ unsigned int (*nf_nat_ftp_hook)(struct sk_buff **pskb,
48 enum nf_ct_ftp_type type, 48 enum nf_ct_ftp_type type,
49 unsigned int matchoff, 49 unsigned int matchoff,
50 unsigned int matchlen, 50 unsigned int matchlen,
51 struct nf_conntrack_expect *exp, 51 struct nf_conntrack_expect *exp);
52 u32 *seq);
53EXPORT_SYMBOL_GPL(nf_nat_ftp_hook); 52EXPORT_SYMBOL_GPL(nf_nat_ftp_hook);
54 53
55#if 0 54#if 0
@@ -335,15 +334,17 @@ static void update_nl_seq(u32 nl_seq, struct nf_ct_ftp_master *info, int dir,
335 if (info->seq_aft_nl[dir][i] == nl_seq) 334 if (info->seq_aft_nl[dir][i] == nl_seq)
336 return; 335 return;
337 336
338 if (oldest == info->seq_aft_nl_num[dir] 337 if (oldest == info->seq_aft_nl_num[dir] ||
339 || before(info->seq_aft_nl[dir][i], oldest)) 338 before(info->seq_aft_nl[dir][i],
339 info->seq_aft_nl[dir][oldest]))
340 oldest = i; 340 oldest = i;
341 } 341 }
342 342
343 if (info->seq_aft_nl_num[dir] < NUM_SEQ_TO_REMEMBER) { 343 if (info->seq_aft_nl_num[dir] < NUM_SEQ_TO_REMEMBER) {
344 info->seq_aft_nl[dir][info->seq_aft_nl_num[dir]++] = nl_seq; 344 info->seq_aft_nl[dir][info->seq_aft_nl_num[dir]++] = nl_seq;
345 nf_conntrack_event_cache(IPCT_HELPINFO_VOLATILE, skb); 345 nf_conntrack_event_cache(IPCT_HELPINFO_VOLATILE, skb);
346 } else if (oldest != NUM_SEQ_TO_REMEMBER) { 346 } else if (oldest != NUM_SEQ_TO_REMEMBER &&
347 after(nl_seq, info->seq_aft_nl[dir][oldest])) {
347 info->seq_aft_nl[dir][oldest] = nl_seq; 348 info->seq_aft_nl[dir][oldest] = nl_seq;
348 nf_conntrack_event_cache(IPCT_HELPINFO_VOLATILE, skb); 349 nf_conntrack_event_cache(IPCT_HELPINFO_VOLATILE, skb);
349 } 350 }
@@ -519,7 +520,7 @@ static int help(struct sk_buff **pskb,
519 nf_nat_ftp = rcu_dereference(nf_nat_ftp_hook); 520 nf_nat_ftp = rcu_dereference(nf_nat_ftp_hook);
520 if (nf_nat_ftp && ct->status & IPS_NAT_MASK) 521 if (nf_nat_ftp && ct->status & IPS_NAT_MASK)
521 ret = nf_nat_ftp(pskb, ctinfo, search[dir][i].ftptype, 522 ret = nf_nat_ftp(pskb, ctinfo, search[dir][i].ftptype,
522 matchoff, matchlen, exp, &seq); 523 matchoff, matchlen, exp);
523 else { 524 else {
524 /* Can't expect this? Best to drop packet now. */ 525 /* Can't expect this? Best to drop packet now. */
525 if (nf_conntrack_expect_related(exp) != 0) 526 if (nf_conntrack_expect_related(exp) != 0)
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
index b284db73ca7c..a1b95acad297 100644
--- a/net/netfilter/nf_conntrack_h323_main.c
+++ b/net/netfilter/nf_conntrack_h323_main.c
@@ -520,6 +520,16 @@ static int process_olca(struct sk_buff **pskb, struct nf_conn *ct,
520 } 520 }
521 } 521 }
522 522
523 if ((olca->options & eOpenLogicalChannelAck_separateStack) &&
524 olca->separateStack.networkAddress.choice ==
525 eNetworkAccessParameters_networkAddress_localAreaAddress) {
526 ret = expect_t120(pskb, ct, ctinfo, data, dataoff,
527 &olca->separateStack.networkAddress.
528 localAreaAddress);
529 if (ret < 0)
530 return -1;
531 }
532
523 return 0; 533 return 0;
524} 534}
525 535
@@ -640,7 +650,7 @@ int get_h225_addr(struct nf_conn *ct, unsigned char *data,
640 case eTransportAddress_ip6Address: 650 case eTransportAddress_ip6Address:
641 if (family != AF_INET6) 651 if (family != AF_INET6)
642 return 0; 652 return 0;
643 p = data + taddr->ip6Address.ip6; 653 p = data + taddr->ip6Address.ip;
644 len = 16; 654 len = 16;
645 break; 655 break;
646 default: 656 default:
@@ -977,30 +987,6 @@ static int process_alerting(struct sk_buff **pskb, struct nf_conn *ct,
977} 987}
978 988
979/****************************************************************************/ 989/****************************************************************************/
980static int process_information(struct sk_buff **pskb,
981 struct nf_conn *ct,
982 enum ip_conntrack_info ctinfo,
983 unsigned char **data, int dataoff,
984 Information_UUIE *info)
985{
986 int ret;
987 int i;
988
989 DEBUGP("nf_ct_q931: Information\n");
990
991 if (info->options & eInformation_UUIE_fastStart) {
992 for (i = 0; i < info->fastStart.count; i++) {
993 ret = process_olc(pskb, ct, ctinfo, data, dataoff,
994 &info->fastStart.item[i]);
995 if (ret < 0)
996 return -1;
997 }
998 }
999
1000 return 0;
1001}
1002
1003/****************************************************************************/
1004static int process_facility(struct sk_buff **pskb, struct nf_conn *ct, 990static int process_facility(struct sk_buff **pskb, struct nf_conn *ct,
1005 enum ip_conntrack_info ctinfo, 991 enum ip_conntrack_info ctinfo,
1006 unsigned char **data, int dataoff, 992 unsigned char **data, int dataoff,
@@ -1096,11 +1082,6 @@ static int process_q931(struct sk_buff **pskb, struct nf_conn *ct,
1096 ret = process_alerting(pskb, ct, ctinfo, data, dataoff, 1082 ret = process_alerting(pskb, ct, ctinfo, data, dataoff,
1097 &pdu->h323_message_body.alerting); 1083 &pdu->h323_message_body.alerting);
1098 break; 1084 break;
1099 case eH323_UU_PDU_h323_message_body_information:
1100 ret = process_information(pskb, ct, ctinfo, data, dataoff,
1101 &pdu->h323_message_body.
1102 information);
1103 break;
1104 case eH323_UU_PDU_h323_message_body_facility: 1085 case eH323_UU_PDU_h323_message_body_facility:
1105 ret = process_facility(pskb, ct, ctinfo, data, dataoff, 1086 ret = process_facility(pskb, ct, ctinfo, data, dataoff,
1106 &pdu->h323_message_body.facility); 1087 &pdu->h323_message_body.facility);
diff --git a/net/netfilter/nf_conntrack_h323_types.c b/net/netfilter/nf_conntrack_h323_types.c
index 4c6f8b3b1208..3a21fdf1a265 100644
--- a/net/netfilter/nf_conntrack_h323_types.c
+++ b/net/netfilter/nf_conntrack_h323_types.c
@@ -1,4 +1,4 @@
1/* Generated by Jing Min Zhao's ASN.1 parser, Apr 20 2006 1/* Generated by Jing Min Zhao's ASN.1 parser, May 16 2007
2 * 2 *
3 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net> 3 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net>
4 * 4 *
@@ -37,7 +37,7 @@ static field_t _TransportAddress_ipxAddress[] = { /* SEQUENCE */
37 37
38static field_t _TransportAddress_ip6Address[] = { /* SEQUENCE */ 38static field_t _TransportAddress_ip6Address[] = { /* SEQUENCE */
39 {FNAME("ip") OCTSTR, FIXD, 16, 0, DECODE, 39 {FNAME("ip") OCTSTR, FIXD, 16, 0, DECODE,
40 offsetof(TransportAddress_ip6Address, ip6), NULL}, 40 offsetof(TransportAddress_ip6Address, ip), NULL},
41 {FNAME("port") INT, WORD, 0, 0, SKIP, 0, NULL}, 41 {FNAME("port") INT, WORD, 0, 0, SKIP, 0, NULL},
42}; 42};
43 43
@@ -67,7 +67,8 @@ static field_t _TransportAddress[] = { /* CHOICE */
67 {FNAME("ipxAddress") SEQ, 0, 3, 3, SKIP, 0, 67 {FNAME("ipxAddress") SEQ, 0, 3, 3, SKIP, 0,
68 _TransportAddress_ipxAddress}, 68 _TransportAddress_ipxAddress},
69 {FNAME("ip6Address") SEQ, 0, 2, 2, DECODE | EXT, 69 {FNAME("ip6Address") SEQ, 0, 2, 2, DECODE | EXT,
70 offsetof(TransportAddress, ip6Address), _TransportAddress_ip6Address}, 70 offsetof(TransportAddress, ip6Address),
71 _TransportAddress_ip6Address},
71 {FNAME("netBios") OCTSTR, FIXD, 16, 0, SKIP, 0, NULL}, 72 {FNAME("netBios") OCTSTR, FIXD, 16, 0, SKIP, 0, NULL},
72 {FNAME("nsap") OCTSTR, 5, 1, 0, SKIP, 0, NULL}, 73 {FNAME("nsap") OCTSTR, 5, 1, 0, SKIP, 0, NULL},
73 {FNAME("nonStandardAddress") SEQ, 0, 2, 2, SKIP, 0, 74 {FNAME("nonStandardAddress") SEQ, 0, 2, 2, SKIP, 0,
@@ -638,7 +639,8 @@ static field_t _UnicastAddress_iPXAddress[] = { /* SEQUENCE */
638}; 639};
639 640
640static field_t _UnicastAddress_iP6Address[] = { /* SEQUENCE */ 641static field_t _UnicastAddress_iP6Address[] = { /* SEQUENCE */
641 {FNAME("network") OCTSTR, FIXD, 16, 0, SKIP, 0, NULL}, 642 {FNAME("network") OCTSTR, FIXD, 16, 0, DECODE,
643 offsetof(UnicastAddress_iP6Address, network), NULL},
642 {FNAME("tsapIdentifier") INT, WORD, 0, 0, SKIP, 0, NULL}, 644 {FNAME("tsapIdentifier") INT, WORD, 0, 0, SKIP, 0, NULL},
643}; 645};
644 646
@@ -665,8 +667,8 @@ static field_t _UnicastAddress[] = { /* CHOICE */
665 offsetof(UnicastAddress, iPAddress), _UnicastAddress_iPAddress}, 667 offsetof(UnicastAddress, iPAddress), _UnicastAddress_iPAddress},
666 {FNAME("iPXAddress") SEQ, 0, 3, 3, SKIP | EXT, 0, 668 {FNAME("iPXAddress") SEQ, 0, 3, 3, SKIP | EXT, 0,
667 _UnicastAddress_iPXAddress}, 669 _UnicastAddress_iPXAddress},
668 {FNAME("iP6Address") SEQ, 0, 2, 2, SKIP | EXT, 0, 670 {FNAME("iP6Address") SEQ, 0, 2, 2, DECODE | EXT,
669 _UnicastAddress_iP6Address}, 671 offsetof(UnicastAddress, iP6Address), _UnicastAddress_iP6Address},
670 {FNAME("netBios") OCTSTR, FIXD, 16, 0, SKIP, 0, NULL}, 672 {FNAME("netBios") OCTSTR, FIXD, 16, 0, SKIP, 0, NULL},
671 {FNAME("iPSourceRouteAddress") SEQ, 0, 4, 4, SKIP | EXT, 0, 673 {FNAME("iPSourceRouteAddress") SEQ, 0, 4, 4, SKIP | EXT, 0,
672 _UnicastAddress_iPSourceRouteAddress}, 674 _UnicastAddress_iPSourceRouteAddress},
@@ -984,19 +986,12 @@ static field_t _Alerting_UUIE[] = { /* SEQUENCE */
984 {FNAME("featureSet") SEQ, 3, 4, 4, SKIP | EXT | OPT, 0, NULL}, 986 {FNAME("featureSet") SEQ, 3, 4, 4, SKIP | EXT | OPT, 0, NULL},
985}; 987};
986 988
987static field_t _Information_UUIE_fastStart[] = { /* SEQUENCE OF */
988 {FNAME("item") SEQ, 1, 3, 5, DECODE | OPEN | EXT,
989 sizeof(OpenLogicalChannel), _OpenLogicalChannel}
990 ,
991};
992
993static field_t _Information_UUIE[] = { /* SEQUENCE */ 989static field_t _Information_UUIE[] = { /* SEQUENCE */
994 {FNAME("protocolIdentifier") OID, BYTE, 0, 0, SKIP, 0, NULL}, 990 {FNAME("protocolIdentifier") OID, BYTE, 0, 0, SKIP, 0, NULL},
995 {FNAME("callIdentifier") SEQ, 0, 1, 1, SKIP | EXT, 0, NULL}, 991 {FNAME("callIdentifier") SEQ, 0, 1, 1, SKIP | EXT, 0, NULL},
996 {FNAME("tokens") SEQOF, SEMI, 0, 0, SKIP | OPT, 0, NULL}, 992 {FNAME("tokens") SEQOF, SEMI, 0, 0, SKIP | OPT, 0, NULL},
997 {FNAME("cryptoTokens") SEQOF, SEMI, 0, 0, SKIP | OPT, 0, NULL}, 993 {FNAME("cryptoTokens") SEQOF, SEMI, 0, 0, SKIP | OPT, 0, NULL},
998 {FNAME("fastStart") SEQOF, SEMI, 0, 30, DECODE | OPT, 994 {FNAME("fastStart") SEQOF, SEMI, 0, 30, SKIP | OPT, 0, NULL},
999 offsetof(Information_UUIE, fastStart), _Information_UUIE_fastStart},
1000 {FNAME("fastConnectRefused") NUL, FIXD, 0, 0, SKIP | OPT, 0, NULL}, 995 {FNAME("fastConnectRefused") NUL, FIXD, 0, 0, SKIP | OPT, 0, NULL},
1001 {FNAME("circuitInfo") SEQ, 3, 3, 3, SKIP | EXT | OPT, 0, NULL}, 996 {FNAME("circuitInfo") SEQ, 3, 3, 3, SKIP | EXT | OPT, 0, NULL},
1002}; 997};
@@ -1343,9 +1338,7 @@ static field_t _H323_UU_PDU_h323_message_body[] = { /* CHOICE */
1343 offsetof(H323_UU_PDU_h323_message_body, connect), _Connect_UUIE}, 1338 offsetof(H323_UU_PDU_h323_message_body, connect), _Connect_UUIE},
1344 {FNAME("alerting") SEQ, 1, 3, 17, DECODE | EXT, 1339 {FNAME("alerting") SEQ, 1, 3, 17, DECODE | EXT,
1345 offsetof(H323_UU_PDU_h323_message_body, alerting), _Alerting_UUIE}, 1340 offsetof(H323_UU_PDU_h323_message_body, alerting), _Alerting_UUIE},
1346 {FNAME("information") SEQ, 0, 1, 7, DECODE | EXT, 1341 {FNAME("information") SEQ, 0, 1, 7, SKIP | EXT, 0, _Information_UUIE},
1347 offsetof(H323_UU_PDU_h323_message_body, information),
1348 _Information_UUIE},
1349 {FNAME("releaseComplete") SEQ, 1, 2, 11, SKIP | EXT, 0, 1342 {FNAME("releaseComplete") SEQ, 1, 2, 11, SKIP | EXT, 0,
1350 _ReleaseComplete_UUIE}, 1343 _ReleaseComplete_UUIE},
1351 {FNAME("facility") SEQ, 3, 5, 21, DECODE | EXT, 1344 {FNAME("facility") SEQ, 3, 5, 21, DECODE | EXT,
@@ -1430,7 +1423,9 @@ static field_t _OpenLogicalChannelAck[] = { /* SEQUENCE */
1430 DECODE | EXT | OPT, offsetof(OpenLogicalChannelAck, 1423 DECODE | EXT | OPT, offsetof(OpenLogicalChannelAck,
1431 reverseLogicalChannelParameters), 1424 reverseLogicalChannelParameters),
1432 _OpenLogicalChannelAck_reverseLogicalChannelParameters}, 1425 _OpenLogicalChannelAck_reverseLogicalChannelParameters},
1433 {FNAME("separateStack") SEQ, 2, 4, 5, SKIP | EXT | OPT, 0, NULL}, 1426 {FNAME("separateStack") SEQ, 2, 4, 5, DECODE | EXT | OPT,
1427 offsetof(OpenLogicalChannelAck, separateStack),
1428 _NetworkAccessParameters},
1434 {FNAME("forwardMultiplexAckParameters") CHOICE, 0, 1, 1, 1429 {FNAME("forwardMultiplexAckParameters") CHOICE, 0, 1, 1,
1435 DECODE | EXT | OPT, offsetof(OpenLogicalChannelAck, 1430 DECODE | EXT | OPT, offsetof(OpenLogicalChannelAck,
1436 forwardMultiplexAckParameters), 1431 forwardMultiplexAckParameters),
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 02e401cd683f..f8b83014ccca 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -83,22 +83,6 @@
83#include <net/inet_common.h> 83#include <net/inet_common.h>
84#endif 84#endif
85 85
86#define CONFIG_SOCK_PACKET 1
87
88/*
89 Proposed replacement for SIOC{ADD,DEL}MULTI and
90 IFF_PROMISC, IFF_ALLMULTI flags.
91
92 It is more expensive, but I believe,
93 it is really correct solution: reentereble, safe and fault tolerant.
94
95 IFF_PROMISC/IFF_ALLMULTI/SIOC{ADD/DEL}MULTI are faked by keeping
96 reference count and global flag, so that real status is
97 (gflag|(count != 0)), so that we can use obsolete faulty interface
98 not harming clever users.
99 */
100#define CONFIG_PACKET_MULTICAST 1
101
102/* 86/*
103 Assumptions: 87 Assumptions:
104 - if device has no dev->hard_header routine, it adds and removes ll header 88 - if device has no dev->hard_header routine, it adds and removes ll header
@@ -159,7 +143,6 @@ static atomic_t packet_socks_nr;
159 143
160/* Private packet socket structures. */ 144/* Private packet socket structures. */
161 145
162#ifdef CONFIG_PACKET_MULTICAST
163struct packet_mclist 146struct packet_mclist
164{ 147{
165 struct packet_mclist *next; 148 struct packet_mclist *next;
@@ -179,7 +162,7 @@ struct packet_mreq_max
179 unsigned short mr_alen; 162 unsigned short mr_alen;
180 unsigned char mr_address[MAX_ADDR_LEN]; 163 unsigned char mr_address[MAX_ADDR_LEN];
181}; 164};
182#endif 165
183#ifdef CONFIG_PACKET_MMAP 166#ifdef CONFIG_PACKET_MMAP
184static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing); 167static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing);
185#endif 168#endif
@@ -205,9 +188,7 @@ struct packet_sock {
205 origdev:1; 188 origdev:1;
206 int ifindex; /* bound device */ 189 int ifindex; /* bound device */
207 __be16 num; 190 __be16 num;
208#ifdef CONFIG_PACKET_MULTICAST
209 struct packet_mclist *mclist; 191 struct packet_mclist *mclist;
210#endif
211#ifdef CONFIG_PACKET_MMAP 192#ifdef CONFIG_PACKET_MMAP
212 atomic_t mapped; 193 atomic_t mapped;
213 unsigned int pg_vec_order; 194 unsigned int pg_vec_order;
@@ -263,7 +244,6 @@ static void packet_sock_destruct(struct sock *sk)
263 244
264static const struct proto_ops packet_ops; 245static const struct proto_ops packet_ops;
265 246
266#ifdef CONFIG_SOCK_PACKET
267static const struct proto_ops packet_ops_spkt; 247static const struct proto_ops packet_ops_spkt;
268 248
269static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) 249static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
@@ -435,7 +415,6 @@ out_unlock:
435 dev_put(dev); 415 dev_put(dev);
436 return err; 416 return err;
437} 417}
438#endif
439 418
440static inline unsigned int run_filter(struct sk_buff *skb, struct sock *sk, 419static inline unsigned int run_filter(struct sk_buff *skb, struct sock *sk,
441 unsigned int res) 420 unsigned int res)
@@ -851,9 +830,7 @@ static int packet_release(struct socket *sock)
851 __sock_put(sk); 830 __sock_put(sk);
852 } 831 }
853 832
854#ifdef CONFIG_PACKET_MULTICAST
855 packet_flush_mclist(sk); 833 packet_flush_mclist(sk);
856#endif
857 834
858#ifdef CONFIG_PACKET_MMAP 835#ifdef CONFIG_PACKET_MMAP
859 if (po->pg_vec) { 836 if (po->pg_vec) {
@@ -936,8 +913,6 @@ out_unlock:
936 * Bind a packet socket to a device 913 * Bind a packet socket to a device
937 */ 914 */
938 915
939#ifdef CONFIG_SOCK_PACKET
940
941static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int addr_len) 916static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int addr_len)
942{ 917{
943 struct sock *sk=sock->sk; 918 struct sock *sk=sock->sk;
@@ -960,7 +935,6 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int add
960 } 935 }
961 return err; 936 return err;
962} 937}
963#endif
964 938
965static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) 939static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
966{ 940{
@@ -1012,11 +986,8 @@ static int packet_create(struct socket *sock, int protocol)
1012 986
1013 if (!capable(CAP_NET_RAW)) 987 if (!capable(CAP_NET_RAW))
1014 return -EPERM; 988 return -EPERM;
1015 if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW 989 if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW &&
1016#ifdef CONFIG_SOCK_PACKET 990 sock->type != SOCK_PACKET)
1017 && sock->type != SOCK_PACKET
1018#endif
1019 )
1020 return -ESOCKTNOSUPPORT; 991 return -ESOCKTNOSUPPORT;
1021 992
1022 sock->state = SS_UNCONNECTED; 993 sock->state = SS_UNCONNECTED;
@@ -1027,10 +998,9 @@ static int packet_create(struct socket *sock, int protocol)
1027 goto out; 998 goto out;
1028 999
1029 sock->ops = &packet_ops; 1000 sock->ops = &packet_ops;
1030#ifdef CONFIG_SOCK_PACKET
1031 if (sock->type == SOCK_PACKET) 1001 if (sock->type == SOCK_PACKET)
1032 sock->ops = &packet_ops_spkt; 1002 sock->ops = &packet_ops_spkt;
1033#endif 1003
1034 sock_init_data(sock, sk); 1004 sock_init_data(sock, sk);
1035 1005
1036 po = pkt_sk(sk); 1006 po = pkt_sk(sk);
@@ -1046,10 +1016,10 @@ static int packet_create(struct socket *sock, int protocol)
1046 1016
1047 spin_lock_init(&po->bind_lock); 1017 spin_lock_init(&po->bind_lock);
1048 po->prot_hook.func = packet_rcv; 1018 po->prot_hook.func = packet_rcv;
1049#ifdef CONFIG_SOCK_PACKET 1019
1050 if (sock->type == SOCK_PACKET) 1020 if (sock->type == SOCK_PACKET)
1051 po->prot_hook.func = packet_rcv_spkt; 1021 po->prot_hook.func = packet_rcv_spkt;
1052#endif 1022
1053 po->prot_hook.af_packet_priv = sk; 1023 po->prot_hook.af_packet_priv = sk;
1054 1024
1055 if (proto) { 1025 if (proto) {
@@ -1169,7 +1139,6 @@ out:
1169 return err; 1139 return err;
1170} 1140}
1171 1141
1172#ifdef CONFIG_SOCK_PACKET
1173static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr, 1142static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
1174 int *uaddr_len, int peer) 1143 int *uaddr_len, int peer)
1175{ 1144{
@@ -1190,7 +1159,6 @@ static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
1190 1159
1191 return 0; 1160 return 0;
1192} 1161}
1193#endif
1194 1162
1195static int packet_getname(struct socket *sock, struct sockaddr *uaddr, 1163static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
1196 int *uaddr_len, int peer) 1164 int *uaddr_len, int peer)
@@ -1221,7 +1189,6 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
1221 return 0; 1189 return 0;
1222} 1190}
1223 1191
1224#ifdef CONFIG_PACKET_MULTICAST
1225static void packet_dev_mc(struct net_device *dev, struct packet_mclist *i, int what) 1192static void packet_dev_mc(struct net_device *dev, struct packet_mclist *i, int what)
1226{ 1193{
1227 switch (i->type) { 1194 switch (i->type) {
@@ -1349,7 +1316,6 @@ static void packet_flush_mclist(struct sock *sk)
1349 } 1316 }
1350 rtnl_unlock(); 1317 rtnl_unlock();
1351} 1318}
1352#endif
1353 1319
1354static int 1320static int
1355packet_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen) 1321packet_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen)
@@ -1362,7 +1328,6 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
1362 return -ENOPROTOOPT; 1328 return -ENOPROTOOPT;
1363 1329
1364 switch(optname) { 1330 switch(optname) {
1365#ifdef CONFIG_PACKET_MULTICAST
1366 case PACKET_ADD_MEMBERSHIP: 1331 case PACKET_ADD_MEMBERSHIP:
1367 case PACKET_DROP_MEMBERSHIP: 1332 case PACKET_DROP_MEMBERSHIP:
1368 { 1333 {
@@ -1383,7 +1348,7 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
1383 ret = packet_mc_drop(sk, &mreq); 1348 ret = packet_mc_drop(sk, &mreq);
1384 return ret; 1349 return ret;
1385 } 1350 }
1386#endif 1351
1387#ifdef CONFIG_PACKET_MMAP 1352#ifdef CONFIG_PACKET_MMAP
1388 case PACKET_RX_RING: 1353 case PACKET_RX_RING:
1389 { 1354 {
@@ -1506,11 +1471,10 @@ static int packet_notifier(struct notifier_block *this, unsigned long msg, void
1506 1471
1507 switch (msg) { 1472 switch (msg) {
1508 case NETDEV_UNREGISTER: 1473 case NETDEV_UNREGISTER:
1509#ifdef CONFIG_PACKET_MULTICAST
1510 if (po->mclist) 1474 if (po->mclist)
1511 packet_dev_mclist(dev, po->mclist, -1); 1475 packet_dev_mclist(dev, po->mclist, -1);
1512 // fallthrough 1476 /* fallthrough */
1513#endif 1477
1514 case NETDEV_DOWN: 1478 case NETDEV_DOWN:
1515 if (dev->ifindex == po->ifindex) { 1479 if (dev->ifindex == po->ifindex) {
1516 spin_lock(&po->bind_lock); 1480 spin_lock(&po->bind_lock);
@@ -1856,7 +1820,6 @@ out:
1856#endif 1820#endif
1857 1821
1858 1822
1859#ifdef CONFIG_SOCK_PACKET
1860static const struct proto_ops packet_ops_spkt = { 1823static const struct proto_ops packet_ops_spkt = {
1861 .family = PF_PACKET, 1824 .family = PF_PACKET,
1862 .owner = THIS_MODULE, 1825 .owner = THIS_MODULE,
@@ -1877,7 +1840,6 @@ static const struct proto_ops packet_ops_spkt = {
1877 .mmap = sock_no_mmap, 1840 .mmap = sock_no_mmap,
1878 .sendpage = sock_no_sendpage, 1841 .sendpage = sock_no_sendpage,
1879}; 1842};
1880#endif
1881 1843
1882static const struct proto_ops packet_ops = { 1844static const struct proto_ops packet_ops = {
1883 .family = PF_PACKET, 1845 .family = PF_PACKET,
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index a973603e3880..f3986d498b40 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -296,7 +296,7 @@ struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type)
296 struct device *dev; 296 struct device *dev;
297 297
298 rfkill = kzalloc(sizeof(struct rfkill), GFP_KERNEL); 298 rfkill = kzalloc(sizeof(struct rfkill), GFP_KERNEL);
299 if (rfkill) 299 if (!rfkill)
300 return NULL; 300 return NULL;
301 301
302 mutex_init(&rfkill->mutex); 302 mutex_init(&rfkill->mutex);
diff --git a/net/rxrpc/Kconfig b/net/rxrpc/Kconfig
index 91b3d52f6f1a..e662f1d07664 100644
--- a/net/rxrpc/Kconfig
+++ b/net/rxrpc/Kconfig
@@ -4,7 +4,7 @@
4 4
5config AF_RXRPC 5config AF_RXRPC
6 tristate "RxRPC session sockets" 6 tristate "RxRPC session sockets"
7 depends on EXPERIMENTAL 7 depends on INET && EXPERIMENTAL
8 select KEYS 8 select KEYS
9 help 9 help
10 Say Y or M here to include support for RxRPC session sockets (just 10 Say Y or M here to include support for RxRPC session sockets (just
diff --git a/net/rxrpc/ar-call.c b/net/rxrpc/ar-call.c
index 4d92d88ff1fc..3c04b00dab74 100644
--- a/net/rxrpc/ar-call.c
+++ b/net/rxrpc/ar-call.c
@@ -15,6 +15,25 @@
15#include <net/af_rxrpc.h> 15#include <net/af_rxrpc.h>
16#include "ar-internal.h" 16#include "ar-internal.h"
17 17
18const char *rxrpc_call_states[] = {
19 [RXRPC_CALL_CLIENT_SEND_REQUEST] = "ClSndReq",
20 [RXRPC_CALL_CLIENT_AWAIT_REPLY] = "ClAwtRpl",
21 [RXRPC_CALL_CLIENT_RECV_REPLY] = "ClRcvRpl",
22 [RXRPC_CALL_CLIENT_FINAL_ACK] = "ClFnlACK",
23 [RXRPC_CALL_SERVER_SECURING] = "SvSecure",
24 [RXRPC_CALL_SERVER_ACCEPTING] = "SvAccept",
25 [RXRPC_CALL_SERVER_RECV_REQUEST] = "SvRcvReq",
26 [RXRPC_CALL_SERVER_ACK_REQUEST] = "SvAckReq",
27 [RXRPC_CALL_SERVER_SEND_REPLY] = "SvSndRpl",
28 [RXRPC_CALL_SERVER_AWAIT_ACK] = "SvAwtACK",
29 [RXRPC_CALL_COMPLETE] = "Complete",
30 [RXRPC_CALL_SERVER_BUSY] = "SvBusy ",
31 [RXRPC_CALL_REMOTELY_ABORTED] = "RmtAbort",
32 [RXRPC_CALL_LOCALLY_ABORTED] = "LocAbort",
33 [RXRPC_CALL_NETWORK_ERROR] = "NetError",
34 [RXRPC_CALL_DEAD] = "Dead ",
35};
36
18struct kmem_cache *rxrpc_call_jar; 37struct kmem_cache *rxrpc_call_jar;
19LIST_HEAD(rxrpc_calls); 38LIST_HEAD(rxrpc_calls);
20DEFINE_RWLOCK(rxrpc_call_lock); 39DEFINE_RWLOCK(rxrpc_call_lock);
diff --git a/net/rxrpc/ar-proc.c b/net/rxrpc/ar-proc.c
index 58f4b4e5cece..1c0be0e77b16 100644
--- a/net/rxrpc/ar-proc.c
+++ b/net/rxrpc/ar-proc.c
@@ -25,25 +25,6 @@ static const char *rxrpc_conn_states[] = {
25 [RXRPC_CONN_NETWORK_ERROR] = "NetError", 25 [RXRPC_CONN_NETWORK_ERROR] = "NetError",
26}; 26};
27 27
28const char *rxrpc_call_states[] = {
29 [RXRPC_CALL_CLIENT_SEND_REQUEST] = "ClSndReq",
30 [RXRPC_CALL_CLIENT_AWAIT_REPLY] = "ClAwtRpl",
31 [RXRPC_CALL_CLIENT_RECV_REPLY] = "ClRcvRpl",
32 [RXRPC_CALL_CLIENT_FINAL_ACK] = "ClFnlACK",
33 [RXRPC_CALL_SERVER_SECURING] = "SvSecure",
34 [RXRPC_CALL_SERVER_ACCEPTING] = "SvAccept",
35 [RXRPC_CALL_SERVER_RECV_REQUEST] = "SvRcvReq",
36 [RXRPC_CALL_SERVER_ACK_REQUEST] = "SvAckReq",
37 [RXRPC_CALL_SERVER_SEND_REPLY] = "SvSndRpl",
38 [RXRPC_CALL_SERVER_AWAIT_ACK] = "SvAwtACK",
39 [RXRPC_CALL_COMPLETE] = "Complete",
40 [RXRPC_CALL_SERVER_BUSY] = "SvBusy ",
41 [RXRPC_CALL_REMOTELY_ABORTED] = "RmtAbort",
42 [RXRPC_CALL_LOCALLY_ABORTED] = "LocAbort",
43 [RXRPC_CALL_NETWORK_ERROR] = "NetError",
44 [RXRPC_CALL_DEAD] = "Dead ",
45};
46
47/* 28/*
48 * generate a list of extant and dead calls in /proc/net/rxrpc_calls 29 * generate a list of extant and dead calls in /proc/net/rxrpc_calls
49 */ 30 */
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index f28bb2dc58d0..cbefe225581e 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -169,8 +169,8 @@ requeue:
169 else 169 else
170 q->ops->requeue(skb, q); 170 q->ops->requeue(skb, q);
171 netif_schedule(dev); 171 netif_schedule(dev);
172 return 0;
173 } 172 }
173 return 0;
174 174
175out: 175out:
176 BUG_ON((int) q->q.qlen < 0); 176 BUG_ON((int) q->q.qlen < 0);
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 99bcec8dd04c..035788c5b7f8 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -976,8 +976,9 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch)
976 976
977 if (q->now >= q->near_ev_cache[level]) { 977 if (q->now >= q->near_ev_cache[level]) {
978 event = htb_do_events(q, level); 978 event = htb_do_events(q, level);
979 q->near_ev_cache[level] = event ? event : 979 if (!event)
980 PSCHED_TICKS_PER_SEC; 980 event = q->now + PSCHED_TICKS_PER_SEC;
981 q->near_ev_cache[level] = event;
981 } else 982 } else
982 event = q->near_ev_cache[level]; 983 event = q->near_ev_cache[level];
983 984
diff --git a/net/sctp/Kconfig b/net/sctp/Kconfig
index 9cba49e2ad43..8210f549c492 100644
--- a/net/sctp/Kconfig
+++ b/net/sctp/Kconfig
@@ -2,11 +2,9 @@
2# SCTP configuration 2# SCTP configuration
3# 3#
4 4
5menu "SCTP Configuration (EXPERIMENTAL)" 5menuconfig IP_SCTP
6 depends on INET && EXPERIMENTAL
7
8config IP_SCTP
9 tristate "The SCTP Protocol (EXPERIMENTAL)" 6 tristate "The SCTP Protocol (EXPERIMENTAL)"
7 depends on INET && EXPERIMENTAL
10 depends on IPV6 || IPV6=n 8 depends on IPV6 || IPV6=n
11 select CRYPTO if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5 9 select CRYPTO if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
12 select CRYPTO_HMAC if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5 10 select CRYPTO_HMAC if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
@@ -36,9 +34,10 @@ config IP_SCTP
36 34
37 If in doubt, say N. 35 If in doubt, say N.
38 36
37if IP_SCTP
38
39config SCTP_DBG_MSG 39config SCTP_DBG_MSG
40 bool "SCTP: Debug messages" 40 bool "SCTP: Debug messages"
41 depends on IP_SCTP
42 help 41 help
43 If you say Y, this will enable verbose debugging messages. 42 If you say Y, this will enable verbose debugging messages.
44 43
@@ -47,7 +46,6 @@ config SCTP_DBG_MSG
47 46
48config SCTP_DBG_OBJCNT 47config SCTP_DBG_OBJCNT
49 bool "SCTP: Debug object counts" 48 bool "SCTP: Debug object counts"
50 depends on IP_SCTP
51 help 49 help
52 If you say Y, this will enable debugging support for counting the 50 If you say Y, this will enable debugging support for counting the
53 type of objects that are currently allocated. This is useful for 51 type of objects that are currently allocated. This is useful for
@@ -59,7 +57,6 @@ config SCTP_DBG_OBJCNT
59 57
60choice 58choice
61 prompt "SCTP: Cookie HMAC Algorithm" 59 prompt "SCTP: Cookie HMAC Algorithm"
62 depends on IP_SCTP
63 default SCTP_HMAC_MD5 60 default SCTP_HMAC_MD5
64 help 61 help
65 HMAC algorithm to be used during association initialization. It 62 HMAC algorithm to be used during association initialization. It
@@ -86,4 +83,5 @@ config SCTP_HMAC_MD5
86 advised to use either HMAC-MD5 or HMAC-SHA1. 83 advised to use either HMAC-MD5 or HMAC-SHA1.
87 84
88endchoice 85endchoice
89endmenu 86
87endif # IP_SCTP
diff --git a/net/tipc/Kconfig b/net/tipc/Kconfig
index f9e367d946eb..3b30d1130b61 100644
--- a/net/tipc/Kconfig
+++ b/net/tipc/Kconfig
@@ -2,11 +2,9 @@
2# TIPC configuration 2# TIPC configuration
3# 3#
4 4
5menu "TIPC Configuration (EXPERIMENTAL)" 5menuconfig TIPC
6 depends on INET && EXPERIMENTAL
7
8config TIPC
9 tristate "The TIPC Protocol (EXPERIMENTAL)" 6 tristate "The TIPC Protocol (EXPERIMENTAL)"
7 depends on INET && EXPERIMENTAL
10 ---help--- 8 ---help---
11 The Transparent Inter Process Communication (TIPC) protocol is 9 The Transparent Inter Process Communication (TIPC) protocol is
12 specially designed for intra cluster communication. This protocol 10 specially designed for intra cluster communication. This protocol
@@ -22,9 +20,10 @@ config TIPC
22 20
23 If in doubt, say N. 21 If in doubt, say N.
24 22
23if TIPC
24
25config TIPC_ADVANCED 25config TIPC_ADVANCED
26 bool "TIPC: Advanced configuration" 26 bool "TIPC: Advanced configuration"
27 depends on TIPC
28 default n 27 default n
29 help 28 help
30 Saying Y here will open some advanced configuration 29 Saying Y here will open some advanced configuration
@@ -33,7 +32,7 @@ config TIPC_ADVANCED
33 32
34config TIPC_ZONES 33config TIPC_ZONES
35 int "Maximum number of zones in network" 34 int "Maximum number of zones in network"
36 depends on TIPC && TIPC_ADVANCED 35 depends on TIPC_ADVANCED
37 default "3" 36 default "3"
38 help 37 help
39 Max number of zones inside TIPC network. Max supported value 38 Max number of zones inside TIPC network. Max supported value
@@ -44,7 +43,7 @@ config TIPC_ZONES
44 43
45config TIPC_CLUSTERS 44config TIPC_CLUSTERS
46 int "Maximum number of clusters in a zone" 45 int "Maximum number of clusters in a zone"
47 depends on TIPC && TIPC_ADVANCED 46 depends on TIPC_ADVANCED
48 default "1" 47 default "1"
49 help 48 help
50 ***Only 1 (one cluster in a zone) is supported by current code. 49 ***Only 1 (one cluster in a zone) is supported by current code.
@@ -59,7 +58,7 @@ config TIPC_CLUSTERS
59 58
60config TIPC_NODES 59config TIPC_NODES
61 int "Maximum number of nodes in cluster" 60 int "Maximum number of nodes in cluster"
62 depends on TIPC && TIPC_ADVANCED 61 depends on TIPC_ADVANCED
63 default "255" 62 default "255"
64 help 63 help
65 Maximum number of nodes inside a TIPC cluster. Maximum 64 Maximum number of nodes inside a TIPC cluster. Maximum
@@ -70,7 +69,7 @@ config TIPC_NODES
70 69
71config TIPC_SLAVE_NODES 70config TIPC_SLAVE_NODES
72 int "Maximum number of slave nodes in cluster" 71 int "Maximum number of slave nodes in cluster"
73 depends on TIPC && TIPC_ADVANCED 72 depends on TIPC_ADVANCED
74 default "0" 73 default "0"
75 help 74 help
76 ***This capability is not supported by current code.*** 75 ***This capability is not supported by current code.***
@@ -83,7 +82,7 @@ config TIPC_SLAVE_NODES
83 82
84config TIPC_PORTS 83config TIPC_PORTS
85 int "Maximum number of ports in a node" 84 int "Maximum number of ports in a node"
86 depends on TIPC && TIPC_ADVANCED 85 depends on TIPC_ADVANCED
87 default "8191" 86 default "8191"
88 help 87 help
89 Maximum number of ports within a node. Maximum 88 Maximum number of ports within a node. Maximum
@@ -94,7 +93,7 @@ config TIPC_PORTS
94 93
95config TIPC_LOG 94config TIPC_LOG
96 int "Size of log buffer" 95 int "Size of log buffer"
97 depends on TIPC && TIPC_ADVANCED 96 depends on TIPC_ADVANCED
98 default 0 97 default 0
99 help 98 help
100 Size (in bytes) of TIPC's internal log buffer, which records the 99 Size (in bytes) of TIPC's internal log buffer, which records the
@@ -106,7 +105,6 @@ config TIPC_LOG
106 105
107config TIPC_DEBUG 106config TIPC_DEBUG
108 bool "Enable debugging support" 107 bool "Enable debugging support"
109 depends on TIPC
110 default n 108 default n
111 help 109 help
112 This will enable debugging of TIPC. 110 This will enable debugging of TIPC.
@@ -114,4 +112,4 @@ config TIPC_DEBUG
114 Only say Y here if you are having trouble with TIPC. It will 112 Only say Y here if you are having trouble with TIPC. It will
115 enable the display of detailed information about what is going on. 113 enable the display of detailed information about what is going on.
116 114
117endmenu 115endif # TIPC
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 0ee6ded18f3a..77d2d9ce8962 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -120,18 +120,20 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev,
120 120
121static int enable_bearer(struct tipc_bearer *tb_ptr) 121static int enable_bearer(struct tipc_bearer *tb_ptr)
122{ 122{
123 struct net_device *dev, *pdev; 123 struct net_device *dev = NULL;
124 struct net_device *pdev = NULL;
124 struct eth_bearer *eb_ptr = &eth_bearers[0]; 125 struct eth_bearer *eb_ptr = &eth_bearers[0];
125 struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS]; 126 struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS];
126 char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1; 127 char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1;
127 128
128 /* Find device with specified name */ 129 /* Find device with specified name */
129 dev = NULL; 130
130 for_each_netdev(pdev) 131 for_each_netdev(pdev){
131 if (!strncmp(dev->name, driver_name, IFNAMSIZ)) { 132 if (!strncmp(pdev->name, driver_name, IFNAMSIZ)) {
132 dev = pdev; 133 dev = pdev;
133 break; 134 break;
134 } 135 }
136 }
135 if (!dev) 137 if (!dev)
136 return -ENODEV; 138 return -ENODEV;
137 139
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 6249a9405bb8..5ced62c19c63 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -347,67 +347,44 @@ static inline int calg_entries(void)
347 return ARRAY_SIZE(calg_list); 347 return ARRAY_SIZE(calg_list);
348} 348}
349 349
350/* Todo: generic iterators */ 350struct xfrm_algo_list {
351struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id) 351 struct xfrm_algo_desc *algs;
352{ 352 int entries;
353 int i; 353 u32 type;
354 354 u32 mask;
355 for (i = 0; i < aalg_entries(); i++) { 355};
356 if (aalg_list[i].desc.sadb_alg_id == alg_id) {
357 if (aalg_list[i].available)
358 return &aalg_list[i];
359 else
360 break;
361 }
362 }
363 return NULL;
364}
365EXPORT_SYMBOL_GPL(xfrm_aalg_get_byid);
366
367struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id)
368{
369 int i;
370 356
371 for (i = 0; i < ealg_entries(); i++) { 357static const struct xfrm_algo_list xfrm_aalg_list = {
372 if (ealg_list[i].desc.sadb_alg_id == alg_id) { 358 .algs = aalg_list,
373 if (ealg_list[i].available) 359 .entries = ARRAY_SIZE(aalg_list),
374 return &ealg_list[i]; 360 .type = CRYPTO_ALG_TYPE_HASH,
375 else 361 .mask = CRYPTO_ALG_TYPE_HASH_MASK | CRYPTO_ALG_ASYNC,
376 break; 362};
377 }
378 }
379 return NULL;
380}
381EXPORT_SYMBOL_GPL(xfrm_ealg_get_byid);
382 363
383struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id) 364static const struct xfrm_algo_list xfrm_ealg_list = {
384{ 365 .algs = ealg_list,
385 int i; 366 .entries = ARRAY_SIZE(ealg_list),
367 .type = CRYPTO_ALG_TYPE_BLKCIPHER,
368 .mask = CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC,
369};
386 370
387 for (i = 0; i < calg_entries(); i++) { 371static const struct xfrm_algo_list xfrm_calg_list = {
388 if (calg_list[i].desc.sadb_alg_id == alg_id) { 372 .algs = calg_list,
389 if (calg_list[i].available) 373 .entries = ARRAY_SIZE(calg_list),
390 return &calg_list[i]; 374 .type = CRYPTO_ALG_TYPE_COMPRESS,
391 else 375 .mask = CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC,
392 break; 376};
393 }
394 }
395 return NULL;
396}
397EXPORT_SYMBOL_GPL(xfrm_calg_get_byid);
398 377
399static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list, 378static struct xfrm_algo_desc *xfrm_find_algo(
400 int entries, u32 type, u32 mask, 379 const struct xfrm_algo_list *algo_list,
401 char *name, int probe) 380 int match(const struct xfrm_algo_desc *entry, const void *data),
381 const void *data, int probe)
402{ 382{
383 struct xfrm_algo_desc *list = algo_list->algs;
403 int i, status; 384 int i, status;
404 385
405 if (!name) 386 for (i = 0; i < algo_list->entries; i++) {
406 return NULL; 387 if (!match(list + i, data))
407
408 for (i = 0; i < entries; i++) {
409 if (strcmp(name, list[i].name) &&
410 (!list[i].compat || strcmp(name, list[i].compat)))
411 continue; 388 continue;
412 389
413 if (list[i].available) 390 if (list[i].available)
@@ -416,8 +393,8 @@ static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list,
416 if (!probe) 393 if (!probe)
417 break; 394 break;
418 395
419 status = crypto_has_alg(list[i].name, type, 396 status = crypto_has_alg(list[i].name, algo_list->type,
420 mask | CRYPTO_ALG_ASYNC); 397 algo_list->mask);
421 if (!status) 398 if (!status)
422 break; 399 break;
423 400
@@ -427,27 +404,60 @@ static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list,
427 return NULL; 404 return NULL;
428} 405}
429 406
407static int xfrm_alg_id_match(const struct xfrm_algo_desc *entry,
408 const void *data)
409{
410 return entry->desc.sadb_alg_id == (unsigned long)data;
411}
412
413struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id)
414{
415 return xfrm_find_algo(&xfrm_aalg_list, xfrm_alg_id_match,
416 (void *)(unsigned long)alg_id, 1);
417}
418EXPORT_SYMBOL_GPL(xfrm_aalg_get_byid);
419
420struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id)
421{
422 return xfrm_find_algo(&xfrm_ealg_list, xfrm_alg_id_match,
423 (void *)(unsigned long)alg_id, 1);
424}
425EXPORT_SYMBOL_GPL(xfrm_ealg_get_byid);
426
427struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id)
428{
429 return xfrm_find_algo(&xfrm_calg_list, xfrm_alg_id_match,
430 (void *)(unsigned long)alg_id, 1);
431}
432EXPORT_SYMBOL_GPL(xfrm_calg_get_byid);
433
434static int xfrm_alg_name_match(const struct xfrm_algo_desc *entry,
435 const void *data)
436{
437 const char *name = data;
438
439 return name && (!strcmp(name, entry->name) ||
440 (entry->compat && !strcmp(name, entry->compat)));
441}
442
430struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe) 443struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe)
431{ 444{
432 return xfrm_get_byname(aalg_list, aalg_entries(), 445 return xfrm_find_algo(&xfrm_aalg_list, xfrm_alg_name_match, name,
433 CRYPTO_ALG_TYPE_HASH, CRYPTO_ALG_TYPE_HASH_MASK, 446 probe);
434 name, probe);
435} 447}
436EXPORT_SYMBOL_GPL(xfrm_aalg_get_byname); 448EXPORT_SYMBOL_GPL(xfrm_aalg_get_byname);
437 449
438struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe) 450struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe)
439{ 451{
440 return xfrm_get_byname(ealg_list, ealg_entries(), 452 return xfrm_find_algo(&xfrm_ealg_list, xfrm_alg_name_match, name,
441 CRYPTO_ALG_TYPE_BLKCIPHER, CRYPTO_ALG_TYPE_MASK, 453 probe);
442 name, probe);
443} 454}
444EXPORT_SYMBOL_GPL(xfrm_ealg_get_byname); 455EXPORT_SYMBOL_GPL(xfrm_ealg_get_byname);
445 456
446struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe) 457struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe)
447{ 458{
448 return xfrm_get_byname(calg_list, calg_entries(), 459 return xfrm_find_algo(&xfrm_calg_list, xfrm_alg_name_match, name,
449 CRYPTO_ALG_TYPE_COMPRESS, CRYPTO_ALG_TYPE_MASK, 460 probe);
450 name, probe);
451} 461}
452EXPORT_SYMBOL_GPL(xfrm_calg_get_byname); 462EXPORT_SYMBOL_GPL(xfrm_calg_get_byname);
453 463
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index d0882e53b6fc..64a375178c5f 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -26,9 +26,12 @@
26#include <net/xfrm.h> 26#include <net/xfrm.h>
27#include <net/ip.h> 27#include <net/ip.h>
28#include <linux/audit.h> 28#include <linux/audit.h>
29#include <linux/cache.h>
29 30
30#include "xfrm_hash.h" 31#include "xfrm_hash.h"
31 32
33int sysctl_xfrm_larval_drop __read_mostly;
34
32DEFINE_MUTEX(xfrm_cfg_mutex); 35DEFINE_MUTEX(xfrm_cfg_mutex);
33EXPORT_SYMBOL(xfrm_cfg_mutex); 36EXPORT_SYMBOL(xfrm_cfg_mutex);
34 37
@@ -1390,8 +1393,8 @@ static int stale_bundle(struct dst_entry *dst);
1390 * At the moment we eat a raw IP route. Mostly to speed up lookups 1393 * At the moment we eat a raw IP route. Mostly to speed up lookups
1391 * on interfaces with disabled IPsec. 1394 * on interfaces with disabled IPsec.
1392 */ 1395 */
1393int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, 1396int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
1394 struct sock *sk, int flags) 1397 struct sock *sk, int flags)
1395{ 1398{
1396 struct xfrm_policy *policy; 1399 struct xfrm_policy *policy;
1397 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; 1400 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
@@ -1509,6 +1512,13 @@ restart:
1509 1512
1510 if (unlikely(nx<0)) { 1513 if (unlikely(nx<0)) {
1511 err = nx; 1514 err = nx;
1515 if (err == -EAGAIN && sysctl_xfrm_larval_drop) {
1516 /* EREMOTE tells the caller to generate
1517 * a one-shot blackhole route.
1518 */
1519 xfrm_pol_put(policy);
1520 return -EREMOTE;
1521 }
1512 if (err == -EAGAIN && flags) { 1522 if (err == -EAGAIN && flags) {
1513 DECLARE_WAITQUEUE(wait, current); 1523 DECLARE_WAITQUEUE(wait, current);
1514 1524
@@ -1598,6 +1608,21 @@ error:
1598 *dst_p = NULL; 1608 *dst_p = NULL;
1599 return err; 1609 return err;
1600} 1610}
1611EXPORT_SYMBOL(__xfrm_lookup);
1612
1613int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
1614 struct sock *sk, int flags)
1615{
1616 int err = __xfrm_lookup(dst_p, fl, sk, flags);
1617
1618 if (err == -EREMOTE) {
1619 dst_release(*dst_p);
1620 *dst_p = NULL;
1621 err = -EAGAIN;
1622 }
1623
1624 return err;
1625}
1601EXPORT_SYMBOL(xfrm_lookup); 1626EXPORT_SYMBOL(xfrm_lookup);
1602 1627
1603static inline int 1628static inline int
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 9955ff4da0a2..372f06eb8bb7 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -21,18 +21,21 @@
21#include <linux/cache.h> 21#include <linux/cache.h>
22#include <asm/uaccess.h> 22#include <asm/uaccess.h>
23#include <linux/audit.h> 23#include <linux/audit.h>
24#include <linux/cache.h>
24 25
25#include "xfrm_hash.h" 26#include "xfrm_hash.h"
26 27
27struct sock *xfrm_nl; 28struct sock *xfrm_nl;
28EXPORT_SYMBOL(xfrm_nl); 29EXPORT_SYMBOL(xfrm_nl);
29 30
30u32 sysctl_xfrm_aevent_etime = XFRM_AE_ETIME; 31u32 sysctl_xfrm_aevent_etime __read_mostly = XFRM_AE_ETIME;
31EXPORT_SYMBOL(sysctl_xfrm_aevent_etime); 32EXPORT_SYMBOL(sysctl_xfrm_aevent_etime);
32 33
33u32 sysctl_xfrm_aevent_rseqth = XFRM_AE_SEQT_SIZE; 34u32 sysctl_xfrm_aevent_rseqth __read_mostly = XFRM_AE_SEQT_SIZE;
34EXPORT_SYMBOL(sysctl_xfrm_aevent_rseqth); 35EXPORT_SYMBOL(sysctl_xfrm_aevent_rseqth);
35 36
37u32 sysctl_xfrm_acq_expires __read_mostly = 30;
38
36/* Each xfrm_state may be linked to two tables: 39/* Each xfrm_state may be linked to two tables:
37 40
38 1. Hash table by (spi,daddr,ah/esp) to find SA by SPI. (input,ctl) 41 1. Hash table by (spi,daddr,ah/esp) to find SA by SPI. (input,ctl)
@@ -622,8 +625,8 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
622 h = xfrm_spi_hash(&x->id.daddr, x->id.spi, x->id.proto, family); 625 h = xfrm_spi_hash(&x->id.daddr, x->id.spi, x->id.proto, family);
623 hlist_add_head(&x->byspi, xfrm_state_byspi+h); 626 hlist_add_head(&x->byspi, xfrm_state_byspi+h);
624 } 627 }
625 x->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES; 628 x->lft.hard_add_expires_seconds = sysctl_xfrm_acq_expires;
626 x->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ; 629 x->timer.expires = jiffies + sysctl_xfrm_acq_expires*HZ;
627 add_timer(&x->timer); 630 add_timer(&x->timer);
628 xfrm_state_num++; 631 xfrm_state_num++;
629 xfrm_hash_grow_check(x->bydst.next != NULL); 632 xfrm_hash_grow_check(x->bydst.next != NULL);
@@ -772,9 +775,9 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re
772 x->props.family = family; 775 x->props.family = family;
773 x->props.mode = mode; 776 x->props.mode = mode;
774 x->props.reqid = reqid; 777 x->props.reqid = reqid;
775 x->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES; 778 x->lft.hard_add_expires_seconds = sysctl_xfrm_acq_expires;
776 xfrm_state_hold(x); 779 xfrm_state_hold(x);
777 x->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ; 780 x->timer.expires = jiffies + sysctl_xfrm_acq_expires*HZ;
778 add_timer(&x->timer); 781 add_timer(&x->timer);
779 hlist_add_head(&x->bydst, xfrm_state_bydst+h); 782 hlist_add_head(&x->bydst, xfrm_state_bydst+h);
780 h = xfrm_src_hash(daddr, saddr, family); 783 h = xfrm_src_hash(daddr, saddr, family);
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index f7b6705fd6a3..8cd63014a0d1 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -144,7 +144,7 @@ $(check-y) : $(INSTALL_HDR_PATH)/$(_dst)/.check.%.h : $(INSTALL_HDR_PATH)/$(_dst
144 $(call cmd,check) 144 $(call cmd,check)
145 145
146# Other dependencies for $(check-y) 146# Other dependencies for $(check-y)
147-include /dev/null $(check-y) 147include /dev/null $(wildcard $(check-y))
148 148
149# ... but leave $(check-y) as .PHONY for now until those deps are actually correct. 149# ... but leave $(check-y) as .PHONY for now until those deps are actually correct.
150.PHONY: $(check-y) 150.PHONY: $(check-y)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
new file mode 100644
index 000000000000..e216d49624b7
--- /dev/null
+++ b/scripts/checkpatch.pl
@@ -0,0 +1,595 @@
1#!/usr/bin/perl -w
2# (c) 2001, Dave Jones. <davej@codemonkey.org.uk> (the file handling bit)
3# (c) 2005, Joel Scohpp <jschopp@austin.ibm.com> (the ugly bit)
4# (c) 2007, Andy Whitcroft <apw@uk.ibm.com> (new conditions, test suite, etc)
5# Licensed under the terms of the GNU GPL License version 2
6
7use strict;
8
9my $P = $0;
10
11my $V = '0.01';
12
13use Getopt::Long qw(:config no_auto_abbrev);
14
15my $quiet = 0;
16my $tree = 1;
17my $chk_signoff = 1;
18my $chk_patch = 1;
19GetOptions(
20 'q|quiet' => \$quiet,
21 'tree!' => \$tree,
22 'signoff!' => \$chk_signoff,
23 'patch!' => \$chk_patch,
24) or exit;
25
26my $exit = 0;
27
28if ($#ARGV < 0) {
29 print "usage: patchstylecheckemail.pl [options] patchfile\n";
30 print "version: $V\n";
31 print "options: -q => quiet\n";
32 print " --no-tree => run without a kernel tree\n";
33 exit(1);
34}
35
36if ($tree && !top_of_kernel_tree()) {
37 print "Must be run from the top-level dir. of a kernel tree\n";
38 exit(2);
39}
40
41my @deprecated = ();
42my $removal = 'Documentation/feature-removal-schedule.txt';
43if ($tree && -f $removal) {
44 open(REMOVE, "<$removal") || die "$P: $removal: open failed - $!\n";
45 while (<REMOVE>) {
46 if (/^Files:\s+(.*\S)/) {
47 for my $file (split(/[, ]+/, $1)) {
48 if ($file =~ m@include/(.*)@) {
49 push(@deprecated, $1);
50 }
51 }
52 }
53 }
54}
55
56my @lines = ();
57while (<>) {
58 chomp;
59 push(@lines, $_);
60 if (eof(ARGV)) {
61 if (!process($ARGV, @lines)) {
62 $exit = 1;
63 }
64 @lines = ();
65 }
66}
67
68exit($exit);
69
70sub top_of_kernel_tree {
71 if ((-f "COPYING") && (-f "CREDITS") && (-f "Kbuild") &&
72 (-f "MAINTAINERS") && (-f "Makefile") && (-f "README") &&
73 (-d "Documentation") && (-d "arch") && (-d "include") &&
74 (-d "drivers") && (-d "fs") && (-d "init") && (-d "ipc") &&
75 (-d "kernel") && (-d "lib") && (-d "scripts")) {
76 return 1;
77 }
78 return 0;
79}
80
81sub expand_tabs {
82 my ($str) = @_;
83
84 my $res = '';
85 my $n = 0;
86 for my $c (split(//, $str)) {
87 if ($c eq "\t") {
88 $res .= ' ';
89 $n++;
90 for (; ($n % 8) != 0; $n++) {
91 $res .= ' ';
92 }
93 next;
94 }
95 $res .= $c;
96 $n++;
97 }
98
99 return $res;
100}
101
102sub cat_vet {
103 my ($vet) = @_;
104
105 $vet =~ s/\t/^I/;
106 $vet =~ s/$/\$/;
107
108 return $vet;
109}
110
111sub process {
112 my $filename = shift;
113 my @lines = @_;
114
115 my $linenr=0;
116 my $prevline="";
117 my $stashline="";
118
119 my $lineforcounting='';
120 my $indent;
121 my $previndent=0;
122 my $stashindent=0;
123
124 my $clean = 1;
125 my $signoff = 0;
126 my $is_patch = 0;
127
128 # Trace the real file/line as we go.
129 my $realfile = '';
130 my $realline = 0;
131 my $realcnt = 0;
132 my $here = '';
133 my $in_comment = 0;
134 my $first_line = 0;
135
136 foreach my $line (@lines) {
137 $linenr++;
138
139#extract the filename as it passes
140 if ($line=~/^\+\+\+\s+(\S+)/) {
141 $realfile=$1;
142 $in_comment = 0;
143 next;
144 }
145#extract the line range in the file after the patch is applied
146 if ($line=~/^\@\@ -\d+,\d+ \+(\d+)(,(\d+))? \@\@/) {
147 $is_patch = 1;
148 $first_line = 1;
149 $in_comment = 0;
150 $realline=$1-1;
151 if (defined $2) {
152 $realcnt=$3+1;
153 } else {
154 $realcnt=1+1;
155 }
156 next;
157 }
158
159#track the line number as we move through the hunk
160 if ($line=~/^[ \+]/) {
161 $realline++;
162 $realcnt-- if ($realcnt != 0);
163
164 # track any sort of multi-line comment. Obviously if
165 # the added text or context do not include the whole
166 # comment we will not see it. Such is life.
167 #
168 # Guestimate if this is a continuing comment. If this
169 # is the start of a diff block and this line starts
170 # ' *' then it is very likely a comment.
171 if ($first_line and $line =~ m@^.\s*\*@) {
172 $in_comment = 1;
173 }
174 if ($line =~ m@/\*@) {
175 $in_comment = 1;
176 }
177 if ($line =~ m@\*/@) {
178 $in_comment = 0;
179 }
180
181 $lineforcounting = $line;
182 $lineforcounting =~ s/^\+//;
183 $lineforcounting = expand_tabs($lineforcounting);
184
185 my ($white) = ($lineforcounting =~ /^(\s*)/);
186 $indent = length($white);
187
188 # Track the previous line.
189 ($prevline, $stashline) = ($stashline, $line);
190 ($previndent, $stashindent) = ($stashindent, $indent);
191 $first_line = 0;
192 }
193
194#make up the handle for any error we report on this line
195 $here = "PATCH: $ARGV:$linenr:";
196 $here .= "\nFILE: $realfile:$realline:" if ($realcnt != 0);
197
198 my $herecurr = "$here\n$line\n\n";
199 my $hereprev = "$here\n$prevline\n$line\n\n";
200
201#check the patch for a signoff:
202 if ($line =~ /^\s*Signed-off-by:\s/) {
203 $signoff++;
204
205 } elsif ($line =~ /^\s*signed-off-by:/i) {
206 if (!($line =~ /^\s*Signed-off-by:/)) {
207 print "use Signed-off-by:\n";
208 print "$herecurr";
209 $clean = 0;
210 }
211 if ($line =~ /^\s*signed-off-by:\S/i) {
212 print "need space after Signed-off-by:\n";
213 print "$herecurr";
214 $clean = 0;
215 }
216 }
217
218#ignore lines not being added
219 if ($line=~/^[^\+]/) {next;}
220
221# check we are in a valid source file *.[hcsS] if not then ignore this hunk
222 next if ($realfile !~ /\.[hcsS]$/);
223
224#trailing whitespace
225 if ($line=~/\S\s+$/) {
226 my $herevet = "$here\n" . cat_vet($line) . "\n\n";
227 print "trailing whitespace\n";
228 print "$herevet";
229 $clean = 0;
230 }
231#80 column limit
232 if (!($prevline=~/\/\*\*/) && length($lineforcounting) > 80) {
233 print "line over 80 characters\n";
234 print "$herecurr";
235 $clean = 0;
236 }
237
238# check we are in a valid source file *.[hc] if not then ignore this hunk
239 next if ($realfile !~ /\.[hc]$/);
240
241# at the beginning of a line any tabs must come first and anything
242# more than 8 must use tabs.
243 if ($line=~/^\+\s* \t\s*\S/ or $line=~/^\+\s* \s*/) {
244 my $herevet = "$here\n" . cat_vet($line) . "\n\n";
245 print "use tabs not spaces\n";
246 print "$herevet";
247 $clean = 0;
248 }
249
250 #
251 # The rest of our checks refer specifically to C style
252 # only apply those _outside_ comments.
253 #
254 next if ($in_comment);
255
256# no C99 // comments
257 if ($line =~ m@//@ and !($line =~ m@\".*//.*\"@)) {
258 print "do not use C99 // comments\n";
259 print "$herecurr";
260 $clean = 0;
261 }
262
263 # Remove comments from the line before processing.
264 $line =~ s@/\*.*\*/@@g;
265 $line =~ s@/\*.*@@;
266 $line =~ s@.*\*/@@;
267 $line =~ s@//.*@@;
268
269#EXPORT_SYMBOL should immediately follow its function closing }.
270 if (($line =~ /EXPORT_SYMBOL.*\(.*\)/) ||
271 ($line =~ /EXPORT_UNUSED_SYMBOL.*\(.*\)/)) {
272 if (($prevline !~ /^}/) &&
273 ($prevline !~ /^\+}/) &&
274 ($prevline !~ /^ }/)) {
275 print "EXPORT_SYMBOL(func); should immediately follow its function\n";
276 print "$herecurr";
277 $clean = 0;
278 }
279 }
280
281 # check for static initialisers.
282 if ($line=~/\s*static\s.*=\s+(0|NULL);/) {
283 print "do not initialise statics to 0 or NULL\n";
284 print "$herecurr";
285 $clean = 0;
286 }
287
288 # check for new typedefs.
289 if ($line=~/\s*typedef\s/) {
290 print "do not add new typedefs\n";
291 print "$herecurr";
292 $clean = 0;
293 }
294
295# * goes on variable not on type
296 if ($line=~/[A-Za-z\d_]+\* [A-Za-z\d_]+/) {
297 print "\"foo* bar\" should be \"foo *bar\"\n";
298 print "$herecurr";
299 $clean = 0;
300 }
301
302# # no BUG() or BUG_ON()
303# if ($line =~ /\b(BUG|BUG_ON)\b/) {
304# print "Try to use WARN_ON & Recovery code rather than BUG() or BUG_ON()\n";
305# print "$herecurr";
306# $clean = 0;
307# }
308
309# printk should use KERN_* levels
310 if ($line =~ /\bprintk\((?!KERN_)/) {
311 print "printk() should include KERN_ facility level\n";
312 print "$herecurr";
313 $clean = 0;
314 }
315
316#function brace can't be on same line, except for #defines of do while, or if closed on same line
317 if (($line=~/[A-Za-z\d_]+\**\s+\**[A-Za-z\d_]+\(.*\).* {/) and
318 !($line=~/\#define.*do\s{/) and !($line=~/}/)) {
319 print "braces following function declarations go on the next line\n";
320 print "$herecurr";
321 $clean = 0;
322 }
323 my $opline = $line;
324 $opline =~ s/^.//;
325 if (!($line=~/\#\s*include/)) {
326 # Check operator spacing.
327 my @elements = split(/(<<=|>>=|<=|>=|==|!=|\+=|-=|\*=|\/=|%=|\^=|\|=|&=|->|<<|>>|<|>|=|!|~|&&|\|\||,|\^|\+\+|--|;|&|\||\+|-|\*|\/\/|\/)/, $opline);
328 for (my $n = 0; $n < $#elements; $n += 2) {
329 # $wN says we have white-space before or after
330 # $sN says we have a separator before or after
331 # $oN says we have another operator before or after
332 my $w1 = $elements[$n] =~ /\s$/;
333 my $s1 = $elements[$n] =~ /(\[|\(|\s)$/;
334 my $o1 = $elements[$n] eq '';
335 my $op = $elements[$n + 1];
336 my $w2 = 1;
337 my $s2 = 1;
338 my $o2 = 0;
339 # If we have something after the operator handle it.
340 if (defined $elements[$n + 2]) {
341 $w2 = $elements[$n + 2] =~ /^\s/;
342 $s2 = $elements[$n + 2] =~ /^(\s|\)|\]|;)/;
343 $o2 = $elements[$n + 2] eq '';
344 }
345
346 # Generate the context.
347 my $at = "here: ";
348 for (my $m = $n; $m >= 0; $m--) {
349 if ($elements[$m] ne '') {
350 $at .= $elements[$m];
351 last;
352 }
353 }
354 $at .= $op;
355 for (my $m = $n + 2; defined $elements[$m]; $m++) {
356 if ($elements[$m] ne '') {
357 $at .= $elements[$m];
358 last;
359 }
360 }
361
362 ##print "<$s1:$op:$s2> <$elements[$n]:$elements[$n + 1]:$elements[$n + 2]>\n";
363 # Skip things apparently in quotes.
364 next if ($line=~/\".*\Q$op\E.*\"/ or $line=~/\'\Q$op\E\'/);
365
366 # We need ; as an operator. // is a comment.
367 if ($op eq ';' or $op eq '//') {
368
369 # -> should have no spaces
370 } elsif ($op eq '->') {
371 if ($s1 or $s2) {
372 print "no spaces around that '$op' $at\n";
373 print "$herecurr";
374 $clean = 0;
375 }
376
377 # , must have a space on the right.
378 } elsif ($op eq ',') {
379 if (!$s2) {
380 print "need space after that '$op' $at\n";
381 print "$herecurr";
382 $clean = 0;
383 }
384
385 # unary ! and unary ~ are allowed no space on the right
386 } elsif ($op eq '!' or $op eq '~') {
387 if (!$s1 && !$o1) {
388 print "need space before that '$op' $at\n";
389 print "$herecurr";
390 $clean = 0;
391 }
392 if ($s2) {
393 print "no space after that '$op' $at\n";
394 print "$herecurr";
395 $clean = 0;
396 }
397
398 # unary ++ and unary -- are allowed no space on one side.
399 } elsif ($op eq '++' or $op eq '--') {
400 if (($s1 && $s2) || ((!$s1 && !$o1) && (!$s2 && !$o2))) {
401 print "need space one side of that '$op' $at\n";
402 print "$herecurr";
403 $clean = 0;
404 }
405
406 # & is both unary and binary
407 # unary:
408 # a &b
409 # binary (consistent spacing):
410 # a&b OK
411 # a & b OK
412 #
413 # boiling down to: if there is a space on the right then there
414 # should be one on the left.
415 #
416 # - is the same
417 #
418 # * is the same only adding:
419 # type:
420 # (foo *)
421 # (foo **)
422 #
423 } elsif ($op eq '&' or $op eq '-' or $op eq '*') {
424 if ($w2 and !$w1) {
425 print "need space before that '$op' $at\n";
426 print "$herecurr";
427 $clean = 0;
428 }
429
430 # << and >> may either have or not have spaces both sides
431 } elsif ($op eq '<<' or $op eq '>>' or $op eq '+' or $op eq '/' or
432 $op eq '^' or $op eq '|')
433 {
434 if ($s1 != $s2) {
435 print "need consistent spacing around '$op' $at\n";
436 print "$herecurr";
437 $clean = 0;
438 }
439
440 # All the others need spaces both sides.
441 } elsif (!$s1 or !$s2) {
442 print "need spaces around that '$op' $at\n";
443 print "$herecurr";
444 $clean = 0;
445 }
446 }
447 }
448
449#need space before brace following if, while, etc
450 if ($line=~/\(.*\){/) {
451 print "need a space before the brace\n";
452 print "$herecurr";
453 $clean = 0;
454 }
455
456#goto labels aren't indented, allow a single space however
457 if ($line=~/^.\s+[A-Za-z\d_]+:/ and
458 !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) {
459 print "labels should not be indented\n";
460 print "$herecurr";
461 $clean = 0;
462 }
463
464# Need a space before open parenthesis after if, while etc
465 if ($line=~/(if|while|for|switch)\(/) {
466 print "need a space before the open parenthesis\n";
467 print "$herecurr";
468 $clean = 0;
469 }
470
471# Check for illegal assignment in if conditional.
472 if ($line=~/(if|while)\s*\(.*[^<>!=]=[^=].*\)/) {
473 print "do not use assignment in if condition\n";
474 print "$herecurr";
475 $clean = 0;
476 }
477
478 # Check for }<nl>else {, these must be at the same
479 # indent level to be relevant to each other.
480 if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ and
481 $previndent == $indent) {
482 print "else should follow close brace\n";
483 print "$hereprev";
484 $clean = 0;
485 }
486
487 # Check for switch () {<nl>case, these must be at the
488 # same indent. We will only catch the first one, as our
489 # context is very small but people tend to be consistent
490 # so we will catch them out more often than not.
491 if ($prevline=~/\s*switch\s*\(.*\)/ and $line=~/\s*case\s+/
492 and $previndent != $indent) {
493 print "switch and case should be at the same indent\n";
494 print "$hereprev";
495 $clean = 0;
496 }
497
498#studly caps, commented out until figure out how to distinguish between use of existing and adding new
499# if (($line=~/[\w_][a-z\d]+[A-Z]/) and !($line=~/print/)) {
500# print "No studly caps, use _\n";
501# print "$herecurr";
502# $clean = 0;
503# }
504
505#no spaces allowed after \ in define
506 if ($line=~/\#define.*\\\s$/) {
507 print("Whitepspace after \\ makes next lines useless\n");
508 print "$herecurr";
509 $clean = 0;
510 }
511
512#warn if <asm/foo.h> is #included and <linux/foo.h> is available.
513 if ($tree && $line =~ qr|\s*\#\s*include\s*\<asm\/(.*)\.h\>|) {
514 my $checkfile = "include/linux/$1.h";
515 if (-f $checkfile) {
516 print "Use #include <linux/$1.h> instead of <asm/$1.h>\n";
517 print $herecurr;
518 $clean = 0;
519 }
520 }
521
522#if/while/etc brace do not go on next line, unless #defining a do while loop, or if that brace on the next line is for something else
523 if ($prevline=~/(if|while|for|switch)\s*\(/) {
524 my @opened = $prevline=~/\(/g;
525 my @closed = $prevline=~/\)/g;
526 my $nr_line = $linenr;
527 my $remaining = $realcnt;
528 my $next_line = $line;
529 my $extra_lines = 0;
530 my $display_segment = $prevline;
531
532 while ($remaining > 0 && scalar @opened > scalar @closed) {
533 $prevline .= $next_line;
534 $display_segment .= "\n" . $next_line;
535 $next_line = $lines[$nr_line];
536 $nr_line++;
537 $remaining--;
538
539 @opened = $prevline=~/\(/g;
540 @closed = $prevline=~/\)/g;
541 }
542
543 if (($prevline=~/(if|while|for|switch)\s*\(.*\)\s*$/) and ($next_line=~/{/) and
544 !($next_line=~/(if|while|for)/) and !($next_line=~/\#define.*do.*while/)) {
545 print "That { should be on the previous line\n";
546 print "$display_segment\n$next_line\n\n";
547 $clean = 0;
548 }
549 }
550
551#multiline macros should be enclosed in a do while loop
552 if (($prevline=~/\#define.*\\/) and !($prevline=~/do\s+{/) and
553 !($prevline=~/\(\{/) and ($line=~/;\s*\\/) and
554 !($line=~/do.*{/) and !($line=~/\(\{/)) {
555 print "Macros with multiple statements should be enclosed in a do - while loop\n";
556 print "$hereprev";
557 $clean = 0;
558 }
559
560# don't include deprecated include files
561 for my $inc (@deprecated) {
562 if ($line =~ m@\#\s*include\s*\<$inc>@) {
563 print "Don't use <$inc>: see Documentation/feature-removal-schedule.txt\n";
564 print "$herecurr";
565 $clean = 0;
566 }
567 }
568
569# don't use kernel_thread()
570 if ($line =~ /\bkernel_thread\b/) {
571 print "Don't use kernel_thread(), use kthread(): see Documentation/feature-removal-schedule.txt\n";
572 print "$herecurr";
573 $clean = 0;
574 }
575 }
576
577 if ($chk_patch && !$is_patch) {
578 $clean = 0;
579 print "Does not appear to be a unified-diff format patch\n";
580 }
581 if ($is_patch && $chk_signoff && $signoff == 0) {
582 $clean = 0;
583 print "Missing Signed-off-by: line(s)\n";
584 }
585
586 if ($clean == 1 && $quiet == 0) {
587 print "Your patch has no obvious style problems and is ready for submission.\n"
588 }
589 if ($clean == 0 && $quiet == 0) {
590 print "Your patch has style problems, please review. If any of these errors\n";
591 print "are false positives report them to the maintainer, see\n";
592 print "CHECKPATCH in MAINTAINERS.\n";
593 }
594 return $clean;
595}
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 120d624e672c..cdca7388e0f1 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,21 +4,15 @@
4# What library to link 4# What library to link
5ldflags() 5ldflags()
6{ 6{
7 $cc -print-file-name=libncursesw.so | grep -q / 7 for ext in so a dylib ; do
8 if [ $? -eq 0 ]; then 8 for lib in ncursesw ncurses curses ; do
9 echo '-lncursesw' 9 $cc -print-file-name=lib${lib}.${ext} | grep -q /
10 exit 10 if [ $? -eq 0 ]; then
11 fi 11 echo "-l${lib}"
12 $cc -print-file-name=libncurses.so | grep -q / 12 exit
13 if [ $? -eq 0 ]; then 13 fi
14 echo '-lncurses' 14 done
15 exit 15 done
16 fi
17 $cc -print-file-name=libcurses.so | grep -q /
18 if [ $? -eq 0 ]; then
19 echo '-lcurses'
20 exit
21 fi
22 exit 1 16 exit 1
23} 17}
24 18
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index ed1244dd58d0..f646381dc015 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -353,11 +353,16 @@ static int do_pcmcia_entry(const char *filename,
353 353
354static int do_of_entry (const char *filename, struct of_device_id *of, char *alias) 354static int do_of_entry (const char *filename, struct of_device_id *of, char *alias)
355{ 355{
356 int len;
356 char *tmp; 357 char *tmp;
357 sprintf (alias, "of:N%sT%sC%s", 358 len = sprintf (alias, "of:N%sT%s",
358 of->name[0] ? of->name : "*", 359 of->name[0] ? of->name : "*",
359 of->type[0] ? of->type : "*", 360 of->type[0] ? of->type : "*");
360 of->compatible[0] ? of->compatible : "*"); 361
362 if (of->compatible[0])
363 sprintf (&alias[len], "%sC%s",
364 of->type[0] ? "*" : "",
365 of->compatible);
361 366
362 /* Replace all whitespace with underscores */ 367 /* Replace all whitespace with underscores */
363 for (tmp = alias; tmp && *tmp; tmp++) 368 for (tmp = alias; tmp && *tmp; tmp++)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 113dc77b9f60..8e5610d428c5 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -582,6 +582,12 @@ static int strrcmp(const char *s, const char *sub)
582 582
583/** 583/**
584 * Whitelist to allow certain references to pass with no warning. 584 * Whitelist to allow certain references to pass with no warning.
585 *
586 * Pattern 0:
587 * Do not warn if funtion/data are marked with __init_refok/__initdata_refok.
588 * The pattern is identified by:
589 * fromsec = .text.init.refok | .data.init.refok
590 *
585 * Pattern 1: 591 * Pattern 1:
586 * If a module parameter is declared __initdata and permissions=0 592 * If a module parameter is declared __initdata and permissions=0
587 * then this is legal despite the warning generated. 593 * then this is legal despite the warning generated.
@@ -619,14 +625,6 @@ static int strrcmp(const char *s, const char *sub)
619 * This pattern is identified by 625 * This pattern is identified by
620 * refsymname = __init_begin, _sinittext, _einittext 626 * refsymname = __init_begin, _sinittext, _einittext
621 * 627 *
622 * Pattern 6:
623 * During the early init phase we have references from .init.text to
624 * .text we have an intended section mismatch - do not warn about it.
625 * See kernel_init() in init/main.c
626 * tosec = .init.text
627 * fromsec = .text
628 * atsym = kernel_init
629 *
630 * Pattern 7: 628 * Pattern 7:
631 * Logos used in drivers/video/logo reside in __initdata but the 629 * Logos used in drivers/video/logo reside in __initdata but the
632 * funtion that references them are EXPORT_SYMBOL() so cannot be 630 * funtion that references them are EXPORT_SYMBOL() so cannot be
@@ -642,16 +640,11 @@ static int strrcmp(const char *s, const char *sub)
642 * tosec = .init.text 640 * tosec = .init.text
643 * fromsec = .paravirtprobe 641 * fromsec = .paravirtprobe
644 * 642 *
645 * Pattern 9:
646 * Some of functions are common code between boot time and hotplug
647 * time. The bootmem allocater is called only boot time in its
648 * functions. So it's ok to reference.
649 * tosec = .init.text
650 *
651 * Pattern 10: 643 * Pattern 10:
652 * ia64 has machvec table for each platform. It is mixture of function 644 * ia64 has machvec table for each platform and
653 * pointer of .init.text and .text. 645 * powerpc has a machine desc table for each platform.
654 * fromsec = .machvec 646 * It is mixture of function pointers of .init.text and .text.
647 * fromsec = .machvec | .machine.desc
655 **/ 648 **/
656static int secref_whitelist(const char *modname, const char *tosec, 649static int secref_whitelist(const char *modname, const char *tosec,
657 const char *fromsec, const char *atsym, 650 const char *fromsec, const char *atsym,
@@ -678,11 +671,10 @@ static int secref_whitelist(const char *modname, const char *tosec,
678 NULL 671 NULL
679 }; 672 };
680 673
681 const char *pat4sym[] = { 674 /* Check for pattern 0 */
682 "sparse_index_alloc", 675 if ((strcmp(fromsec, ".text.init.refok") == 0) ||
683 "zone_wait_table_init", 676 (strcmp(fromsec, ".data.init.refok") == 0))
684 NULL 677 return 1;
685 };
686 678
687 /* Check for pattern 1 */ 679 /* Check for pattern 1 */
688 if (strcmp(tosec, ".init.data") != 0) 680 if (strcmp(tosec, ".init.data") != 0)
@@ -725,12 +717,6 @@ static int secref_whitelist(const char *modname, const char *tosec,
725 if (strcmp(refsymname, *s) == 0) 717 if (strcmp(refsymname, *s) == 0)
726 return 1; 718 return 1;
727 719
728 /* Check for pattern 6 */
729 if ((strcmp(tosec, ".init.text") == 0) &&
730 (strcmp(fromsec, ".text") == 0) &&
731 (strcmp(refsymname, "kernel_init") == 0))
732 return 1;
733
734 /* Check for pattern 7 */ 720 /* Check for pattern 7 */
735 if ((strcmp(tosec, ".init.data") == 0) && 721 if ((strcmp(tosec, ".init.data") == 0) &&
736 (strncmp(fromsec, ".text", strlen(".text")) == 0) && 722 (strncmp(fromsec, ".text", strlen(".text")) == 0) &&
@@ -742,15 +728,9 @@ static int secref_whitelist(const char *modname, const char *tosec,
742 (strcmp(fromsec, ".paravirtprobe") == 0)) 728 (strcmp(fromsec, ".paravirtprobe") == 0))
743 return 1; 729 return 1;
744 730
745 /* Check for pattern 9 */
746 if ((strcmp(tosec, ".init.text") == 0) &&
747 (strcmp(fromsec, ".text") == 0))
748 for (s = pat4sym; *s; s++)
749 if (strcmp(atsym, *s) == 0)
750 return 1;
751
752 /* Check for pattern 10 */ 731 /* Check for pattern 10 */
753 if (strcmp(fromsec, ".machvec") == 0) 732 if ((strcmp(fromsec, ".machvec") == 0) ||
733 (strcmp(fromsec, ".machine.desc") == 0))
754 return 1; 734 return 1;
755 735
756 return 0; 736 return 0;
@@ -884,30 +864,34 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec,
884 elf->strtab + before->st_name, refsymname)) 864 elf->strtab + before->st_name, refsymname))
885 return; 865 return;
886 866
867 /* fromsec whitelist - without a valid 'before'
868 * powerpc has a GOT table in .got2 section */
869 if (strcmp(fromsec, ".got2") == 0)
870 return;
871
887 if (before && after) { 872 if (before && after) {
888 warn("%s - Section mismatch: reference to %s:%s from %s " 873 warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s "
889 "between '%s' (at offset 0x%llx) and '%s'\n", 874 "(between '%s' and '%s')\n",
890 modname, secname, refsymname, fromsec, 875 modname, fromsec, (unsigned long long)r.r_offset,
876 secname, refsymname,
891 elf->strtab + before->st_name, 877 elf->strtab + before->st_name,
892 (long long)r.r_offset,
893 elf->strtab + after->st_name); 878 elf->strtab + after->st_name);
894 } else if (before) { 879 } else if (before) {
895 warn("%s - Section mismatch: reference to %s:%s from %s " 880 warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s "
896 "after '%s' (at offset 0x%llx)\n", 881 "(after '%s')\n",
897 modname, secname, refsymname, fromsec, 882 modname, fromsec, (unsigned long long)r.r_offset,
898 elf->strtab + before->st_name, 883 secname, refsymname,
899 (long long)r.r_offset); 884 elf->strtab + before->st_name);
900 } else if (after) { 885 } else if (after) {
901 warn("%s - Section mismatch: reference to %s:%s from %s " 886 warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s "
902 "before '%s' (at offset -0x%llx)\n", 887 "before '%s' (at offset -0x%llx)\n",
903 modname, secname, refsymname, fromsec, 888 modname, fromsec, (unsigned long long)r.r_offset,
904 elf->strtab + after->st_name, 889 secname, refsymname,
905 (long long)r.r_offset); 890 elf->strtab + after->st_name);
906 } else { 891 } else {
907 warn("%s - Section mismatch: reference to %s:%s from %s " 892 warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s\n",
908 "(offset 0x%llx)\n", 893 modname, fromsec, (unsigned long long)r.r_offset,
909 modname, secname, fromsec, refsymname, 894 secname, refsymname);
910 (long long)r.r_offset);
911 } 895 }
912} 896}
913 897
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
index 6873d5af80d5..d9cc6901d680 100644
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -7,6 +7,7 @@
7#include <ctype.h> 7#include <ctype.h>
8#include <errno.h> 8#include <errno.h>
9#include <string.h> 9#include <string.h>
10#include <limits.h>
10#include "modpost.h" 11#include "modpost.h"
11 12
12/* 13/*
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index 88b5281ac41e..aa0ccdbd1f47 100644
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -69,8 +69,8 @@ cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}"
69# Install arch-specific kernel image(s) 69# Install arch-specific kernel image(s)
70# 70#
71case "${ARCH}" in 71case "${ARCH}" in
72 i386) 72 i386|x86_64)
73 [ -f "${objtree}/arch/i386/boot/bzImage" ] && cp -v -- "${objtree}/arch/i386/boot/bzImage" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" 73 [ -f "${objtree}/arch/$ARCH/boot/bzImage" ] && cp -v -- "${objtree}/arch/$ARCH/boot/bzImage" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
74 ;; 74 ;;
75 alpha) 75 alpha)
76 [ -f "${objtree}/arch/alpha/boot/vmlinux.gz" ] && cp -v -- "${objtree}/arch/alpha/boot/vmlinux.gz" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" 76 [ -f "${objtree}/arch/alpha/boot/vmlinux.gz" ] && cp -v -- "${objtree}/arch/alpha/boot/vmlinux.gz" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c
index c7e1b2646193..e7ed868fa7c0 100644
--- a/sound/arm/sa11xx-uda1341.c
+++ b/sound/arm/sa11xx-uda1341.c
@@ -987,7 +987,7 @@ static int __init sa11xx_uda1341_init(void)
987 if (platform_get_drvdata(device)) 987 if (platform_get_drvdata(device))
988 return 0; 988 return 0;
989 platform_device_unregister(device); 989 platform_device_unregister(device);
990 err = -ENODEV 990 err = -ENODEV;
991 } else 991 } else
992 err = PTR_ERR(device); 992 err = PTR_ERR(device);
993 platform_driver_unregister(&sa11xx_uda1341_driver); 993 platform_driver_unregister(&sa11xx_uda1341_driver);
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index e1ed59549c50..cb59f994c68f 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -1250,7 +1250,7 @@ static int snd_ali_playback_hw_params(struct snd_pcm_substream *substream,
1250 evoice->substream = substream; 1250 evoice->substream = substream;
1251 } 1251 }
1252 } else { 1252 } else {
1253 if (!evoice) { 1253 if (evoice) {
1254 snd_ali_free_voice(codec, evoice); 1254 snd_ali_free_voice(codec, evoice);
1255 pvoice->extra = evoice = NULL; 1255 pvoice->extra = evoice = NULL;
1256 } 1256 }
@@ -1267,7 +1267,7 @@ static int snd_ali_playback_hw_free(struct snd_pcm_substream *substream)
1267 struct snd_ali_voice *evoice = pvoice ? pvoice->extra : NULL; 1267 struct snd_ali_voice *evoice = pvoice ? pvoice->extra : NULL;
1268 1268
1269 snd_pcm_lib_free_pages(substream); 1269 snd_pcm_lib_free_pages(substream);
1270 if (!evoice) { 1270 if (evoice) {
1271 snd_ali_free_voice(codec, evoice); 1271 snd_ali_free_voice(codec, evoice);
1272 pvoice->extra = NULL; 1272 pvoice->extra = NULL;
1273 } 1273 }
@@ -1356,7 +1356,7 @@ static int snd_ali_playback_prepare(struct snd_pcm_substream *substream)
1356 VOL, 1356 VOL,
1357 CTRL, 1357 CTRL,
1358 EC); 1358 EC);
1359 if (!evoice) { 1359 if (evoice) {
1360 evoice->count = pvoice->count; 1360 evoice->count = pvoice->count;
1361 evoice->eso = pvoice->count << 1; 1361 evoice->eso = pvoice->count << 1;
1362 ESO = evoice->eso - 1; 1362 ESO = evoice->eso - 1;
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 8e89d56b6400..f87f8f088956 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -713,6 +713,19 @@ static u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction)
713 return info->amp_caps; 713 return info->amp_caps;
714} 714}
715 715
716int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
717 unsigned int caps)
718{
719 struct hda_amp_info *info;
720
721 info = get_alloc_amp_hash(codec, HDA_HASH_KEY(nid, dir, 0));
722 if (!info)
723 return -EINVAL;
724 info->amp_caps = caps;
725 info->status |= INFO_AMP_CAPS;
726 return 0;
727}
728
716/* 729/*
717 * read the current volume to info 730 * read the current volume to info
718 * if the cache exists, read the cache value. 731 * if the cache exists, read the cache value.
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index be12b8814c39..f91ea5ec9f6d 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -277,5 +277,7 @@ static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid)
277 return codec->wcaps[nid - codec->start_nid]; 277 return codec->wcaps[nid - codec->start_nid];
278} 278}
279 279
280int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
281 unsigned int caps);
280 282
281#endif /* __SOUND_HDA_LOCAL_H */ 283#endif /* __SOUND_HDA_LOCAL_H */
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index a5a4b2bddf20..bef214bcdddf 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -705,6 +705,17 @@ static struct snd_kcontrol_new cxt5045_test_mixer[] = {
705 .get = conexant_mux_enum_get, 705 .get = conexant_mux_enum_get,
706 .put = conexant_mux_enum_put, 706 .put = conexant_mux_enum_put,
707 }, 707 },
708 /* Audio input controls */
709 HDA_CODEC_VOLUME("Input-1 Volume", 0x1a, 0x0, HDA_INPUT),
710 HDA_CODEC_MUTE("Input-1 Switch", 0x1a, 0x0, HDA_INPUT),
711 HDA_CODEC_VOLUME("Input-2 Volume", 0x1a, 0x1, HDA_INPUT),
712 HDA_CODEC_MUTE("Input-2 Switch", 0x1a, 0x1, HDA_INPUT),
713 HDA_CODEC_VOLUME("Input-3 Volume", 0x1a, 0x2, HDA_INPUT),
714 HDA_CODEC_MUTE("Input-3 Switch", 0x1a, 0x2, HDA_INPUT),
715 HDA_CODEC_VOLUME("Input-4 Volume", 0x1a, 0x3, HDA_INPUT),
716 HDA_CODEC_MUTE("Input-4 Switch", 0x1a, 0x3, HDA_INPUT),
717 HDA_CODEC_VOLUME("Input-5 Volume", 0x1a, 0x4, HDA_INPUT),
718 HDA_CODEC_MUTE("Input-5 Switch", 0x1a, 0x4, HDA_INPUT),
708 { } /* end */ 719 { } /* end */
709}; 720};
710 721
@@ -947,6 +958,23 @@ static void cxt5047_hp_automute(struct hda_codec *codec)
947 snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0x80, bits); 958 snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0x80, bits);
948} 959}
949 960
961/* mute internal speaker if HP is plugged */
962static void cxt5047_hp2_automute(struct hda_codec *codec)
963{
964 struct conexant_spec *spec = codec->spec;
965 unsigned int bits;
966
967 spec->hp_present = snd_hda_codec_read(codec, 0x13, 0,
968 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
969
970 bits = spec->hp_present ? 0x80 : 0;
971 snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits);
972 snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits);
973 /* Mute/Unmute PCM 2 for good measure - some systems need this */
974 snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 0x80, bits);
975 snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0x80, bits);
976}
977
950/* toggle input of built-in and mic jack appropriately */ 978/* toggle input of built-in and mic jack appropriately */
951static void cxt5047_hp_automic(struct hda_codec *codec) 979static void cxt5047_hp_automic(struct hda_codec *codec)
952{ 980{
@@ -985,6 +1013,21 @@ static void cxt5047_hp_unsol_event(struct hda_codec *codec,
985 } 1013 }
986} 1014}
987 1015
1016/* unsolicited event for HP jack sensing - non-EAPD systems */
1017static void cxt5047_hp2_unsol_event(struct hda_codec *codec,
1018 unsigned int res)
1019{
1020 res >>= 26;
1021 switch (res) {
1022 case CONEXANT_HP_EVENT:
1023 cxt5047_hp2_automute(codec);
1024 break;
1025 case CONEXANT_MIC_EVENT:
1026 cxt5047_hp_automic(codec);
1027 break;
1028 }
1029}
1030
988static struct snd_kcontrol_new cxt5047_mixers[] = { 1031static struct snd_kcontrol_new cxt5047_mixers[] = {
989 HDA_CODEC_VOLUME("Mic Bypass Capture Volume", 0x19, 0x02, HDA_INPUT), 1032 HDA_CODEC_VOLUME("Mic Bypass Capture Volume", 0x19, 0x02, HDA_INPUT),
990 HDA_CODEC_MUTE("Mic Bypass Capture Switch", 0x19, 0x02, HDA_INPUT), 1033 HDA_CODEC_MUTE("Mic Bypass Capture Switch", 0x19, 0x02, HDA_INPUT),
@@ -1300,19 +1343,20 @@ static int patch_cxt5047(struct hda_codec *codec)
1300 spec->channel_mode = cxt5047_modes, 1343 spec->channel_mode = cxt5047_modes,
1301 1344
1302 codec->patch_ops = conexant_patch_ops; 1345 codec->patch_ops = conexant_patch_ops;
1303 codec->patch_ops.unsol_event = cxt5047_hp_unsol_event;
1304 1346
1305 board_config = snd_hda_check_board_config(codec, CXT5047_MODELS, 1347 board_config = snd_hda_check_board_config(codec, CXT5047_MODELS,
1306 cxt5047_models, 1348 cxt5047_models,
1307 cxt5047_cfg_tbl); 1349 cxt5047_cfg_tbl);
1308 switch (board_config) { 1350 switch (board_config) {
1309 case CXT5047_LAPTOP: 1351 case CXT5047_LAPTOP:
1352 codec->patch_ops.unsol_event = cxt5047_hp2_unsol_event;
1310 break; 1353 break;
1311 case CXT5047_LAPTOP_HP: 1354 case CXT5047_LAPTOP_HP:
1312 spec->input_mux = &cxt5047_hp_capture_source; 1355 spec->input_mux = &cxt5047_hp_capture_source;
1313 spec->num_init_verbs = 2; 1356 spec->num_init_verbs = 2;
1314 spec->init_verbs[1] = cxt5047_hp_init_verbs; 1357 spec->init_verbs[1] = cxt5047_hp_init_verbs;
1315 spec->mixers[0] = cxt5047_hp_mixers; 1358 spec->mixers[0] = cxt5047_hp_mixers;
1359 codec->patch_ops.unsol_event = cxt5047_hp_unsol_event;
1316 codec->patch_ops.init = cxt5047_hp_init; 1360 codec->patch_ops.init = cxt5047_hp_init;
1317 break; 1361 break;
1318 case CXT5047_LAPTOP_EAPD: 1362 case CXT5047_LAPTOP_EAPD:
@@ -1320,12 +1364,14 @@ static int patch_cxt5047(struct hda_codec *codec)
1320 spec->num_init_verbs = 2; 1364 spec->num_init_verbs = 2;
1321 spec->init_verbs[1] = cxt5047_toshiba_init_verbs; 1365 spec->init_verbs[1] = cxt5047_toshiba_init_verbs;
1322 spec->mixers[0] = cxt5047_toshiba_mixers; 1366 spec->mixers[0] = cxt5047_toshiba_mixers;
1367 codec->patch_ops.unsol_event = cxt5047_hp_unsol_event;
1323 break; 1368 break;
1324#ifdef CONFIG_SND_DEBUG 1369#ifdef CONFIG_SND_DEBUG
1325 case CXT5047_TEST: 1370 case CXT5047_TEST:
1326 spec->input_mux = &cxt5047_test_capture_source; 1371 spec->input_mux = &cxt5047_test_capture_source;
1327 spec->mixers[0] = cxt5047_test_mixer; 1372 spec->mixers[0] = cxt5047_test_mixer;
1328 spec->init_verbs[0] = cxt5047_test_init_verbs; 1373 spec->init_verbs[0] = cxt5047_test_init_verbs;
1374 codec->patch_ops.unsol_event = cxt5047_hp_unsol_event;
1329#endif 1375#endif
1330 } 1376 }
1331 return 0; 1377 return 0;
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 34ac63469532..4776de93928b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6379,8 +6379,10 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
6379 SND_PCI_QUIRK(0x1458, 0xa002, "MSI", ALC883_6ST_DIG), 6379 SND_PCI_QUIRK(0x1458, 0xa002, "MSI", ALC883_6ST_DIG),
6380 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG), 6380 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG),
6381 SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG), 6381 SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG),
6382 SND_PCI_QUIRK(0x1462, 0x7250, "MSI", ALC883_6ST_DIG),
6382 SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG), 6383 SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG),
6383 SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG), 6384 SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG),
6385 SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG),
6384 SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG), 6386 SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG),
6385 SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG), 6387 SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG),
6386 SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG), 6388 SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG),
@@ -6391,6 +6393,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
6391 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG), 6393 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
6392 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG), 6394 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
6393 SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), 6395 SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER),
6396 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch),
6394 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), 6397 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
6395 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), 6398 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
6396 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), 6399 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch),
@@ -8765,7 +8768,6 @@ static struct snd_pci_quirk alc861_cfg_tbl[] = {
8765 SND_PCI_QUIRK(0x1043, 0x1338, "ASUS F2/3", ALC861_ASUS_LAPTOP), 8768 SND_PCI_QUIRK(0x1043, 0x1338, "ASUS F2/3", ALC861_ASUS_LAPTOP),
8766 SND_PCI_QUIRK(0x1043, 0x13d7, "ASUS A9rp", ALC861_ASUS_LAPTOP), 8769 SND_PCI_QUIRK(0x1043, 0x13d7, "ASUS A9rp", ALC861_ASUS_LAPTOP),
8767 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS", ALC861_ASUS), 8770 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS", ALC861_ASUS),
8768 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660_3ST),
8769 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba", ALC861_TOSHIBA), 8771 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba", ALC861_TOSHIBA),
8770 SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba", ALC861_TOSHIBA), 8772 SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba", ALC861_TOSHIBA),
8771 SND_PCI_QUIRK(0x1584, 0x9072, "Uniwill m31", ALC861_UNIWILL_M31), 8773 SND_PCI_QUIRK(0x1584, 0x9072, "Uniwill m31", ALC861_UNIWILL_M31),
@@ -9473,6 +9475,7 @@ static const char *alc861vd_models[ALC861VD_MODEL_LAST] = {
9473static struct snd_pci_quirk alc861vd_cfg_tbl[] = { 9475static struct snd_pci_quirk alc861vd_cfg_tbl[] = {
9474 SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), 9476 SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST),
9475 SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST), 9477 SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST),
9478 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST),
9476 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), 9479 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST),
9477 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), 9480 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST),
9478 9481
diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c
index 6fcda9bcf0cf..43f537ef40bf 100644
--- a/sound/pci/hda/patch_si3054.c
+++ b/sound/pci/hda/patch_si3054.c
@@ -304,6 +304,8 @@ struct hda_codec_preset snd_hda_preset_si3054[] = {
304 { .id = 0x10573055, .name = "Si3054", .patch = patch_si3054 }, 304 { .id = 0x10573055, .name = "Si3054", .patch = patch_si3054 },
305 { .id = 0x10573057, .name = "Si3054", .patch = patch_si3054 }, 305 { .id = 0x10573057, .name = "Si3054", .patch = patch_si3054 },
306 { .id = 0x10573155, .name = "Si3054", .patch = patch_si3054 }, 306 { .id = 0x10573155, .name = "Si3054", .patch = patch_si3054 },
307 /* Asus A8J Modem (SM56) */
308 { .id = 0x15433155, .name = "Si3054", .patch = patch_si3054 },
307 {} 309 {}
308}; 310};
309 311
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index a6a0a80edc3b..e3964fc4c405 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -51,6 +51,7 @@ enum {
51 STAC_925x_REF, 51 STAC_925x_REF,
52 STAC_M2_2, 52 STAC_M2_2,
53 STAC_MA6, 53 STAC_MA6,
54 STAC_PA6,
54 STAC_925x_MODELS 55 STAC_925x_MODELS
55}; 56};
56 57
@@ -152,6 +153,10 @@ static hda_nid_t stac925x_dac_nids[1] = {
152 0x02, 153 0x02,
153}; 154};
154 155
156static hda_nid_t stac925x_dmic_nids[1] = {
157 0x15,
158};
159
155static hda_nid_t stac922x_adc_nids[2] = { 160static hda_nid_t stac922x_adc_nids[2] = {
156 0x06, 0x07, 161 0x06, 0x07,
157}; 162};
@@ -469,6 +474,14 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = {
469 "Dell Precision M90", STAC_REF), 474 "Dell Precision M90", STAC_REF),
470 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d6, 475 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d6,
471 "unknown Dell", STAC_REF), 476 "unknown Dell", STAC_REF),
477 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d8,
478 "Dell Inspiron 640m", STAC_REF),
479 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f5,
480 "Dell Inspiron 1501", STAC_REF),
481
482 /* Panasonic */
483 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_REF),
484
472 {} /* terminator */ 485 {} /* terminator */
473}; 486};
474 487
@@ -482,29 +495,38 @@ static unsigned int stac925x_MA6_pin_configs[8] = {
482 0x90a70320, 0x90100211, 0x400003f1, 0x9033032e, 495 0x90a70320, 0x90100211, 0x400003f1, 0x9033032e,
483}; 496};
484 497
498static unsigned int stac925x_PA6_pin_configs[8] = {
499 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021,
500 0x50a103f0, 0x90100211, 0x400003f1, 0x9033032e,
501};
502
485static unsigned int stac925xM2_2_pin_configs[8] = { 503static unsigned int stac925xM2_2_pin_configs[8] = {
486 0x40c003f3, 0x424503f2, 0x041800f4, 0x02a19020, 504 0x40c003f3, 0x424503f2, 0x04180011, 0x02a19020,
487 0x50a103F0, 0x90100210, 0x400003f1, 0x9033032e, 505 0x50a103f0, 0x90100212, 0x400003f1, 0x9033032e,
488}; 506};
489 507
490static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { 508static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = {
491 [STAC_REF] = ref925x_pin_configs, 509 [STAC_REF] = ref925x_pin_configs,
492 [STAC_M2_2] = stac925xM2_2_pin_configs, 510 [STAC_M2_2] = stac925xM2_2_pin_configs,
493 [STAC_MA6] = stac925x_MA6_pin_configs, 511 [STAC_MA6] = stac925x_MA6_pin_configs,
512 [STAC_PA6] = stac925x_PA6_pin_configs,
494}; 513};
495 514
496static const char *stac925x_models[STAC_925x_MODELS] = { 515static const char *stac925x_models[STAC_925x_MODELS] = {
497 [STAC_REF] = "ref", 516 [STAC_REF] = "ref",
498 [STAC_M2_2] = "m2-2", 517 [STAC_M2_2] = "m2-2",
499 [STAC_MA6] = "m6", 518 [STAC_MA6] = "m6",
519 [STAC_PA6] = "pa6",
500}; 520};
501 521
502static struct snd_pci_quirk stac925x_cfg_tbl[] = { 522static struct snd_pci_quirk stac925x_cfg_tbl[] = {
503 /* SigmaTel reference board */ 523 /* SigmaTel reference board */
504 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), 524 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF),
525 SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF),
505 SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_REF), 526 SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_REF),
506 SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_REF), 527 SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_REF),
507 SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_MA6), 528 SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_MA6),
529 SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_PA6),
508 SND_PCI_QUIRK(0x1002, 0x437b, "Gateway MX6453", STAC_M2_2), 530 SND_PCI_QUIRK(0x1002, 0x437b, "Gateway MX6453", STAC_M2_2),
509 {} /* terminator */ 531 {} /* terminator */
510}; 532};
@@ -1742,6 +1764,21 @@ static void stac92xx_set_pinctl(struct hda_codec *codec, hda_nid_t nid,
1742 unsigned int pin_ctl = snd_hda_codec_read(codec, nid, 1764 unsigned int pin_ctl = snd_hda_codec_read(codec, nid,
1743 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0x00); 1765 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0x00);
1744 1766
1767 if (pin_ctl & AC_PINCTL_IN_EN) {
1768 /*
1769 * we need to check the current set-up direction of
1770 * shared input pins since they can be switched via
1771 * "xxx as Output" mixer switch
1772 */
1773 struct sigmatel_spec *spec = codec->spec;
1774 struct auto_pin_cfg *cfg = &spec->autocfg;
1775 if ((nid == cfg->input_pins[AUTO_PIN_LINE] &&
1776 spec->line_switch) ||
1777 (nid == cfg->input_pins[AUTO_PIN_MIC] &&
1778 spec->mic_switch))
1779 return;
1780 }
1781
1745 /* if setting pin direction bits, clear the current 1782 /* if setting pin direction bits, clear the current
1746 direction bits first */ 1783 direction bits first */
1747 if (flag & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)) 1784 if (flag & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))
@@ -1911,7 +1948,8 @@ static int patch_stac925x(struct hda_codec *codec)
1911 stac925x_cfg_tbl); 1948 stac925x_cfg_tbl);
1912 again: 1949 again:
1913 if (spec->board_config < 0) { 1950 if (spec->board_config < 0) {
1914 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x, using BIOS defaults\n"); 1951 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x,"
1952 "using BIOS defaults\n");
1915 err = stac92xx_save_bios_config_regs(codec); 1953 err = stac92xx_save_bios_config_regs(codec);
1916 if (err < 0) { 1954 if (err < 0) {
1917 stac92xx_free(codec); 1955 stac92xx_free(codec);
@@ -1929,7 +1967,18 @@ static int patch_stac925x(struct hda_codec *codec)
1929 spec->adc_nids = stac925x_adc_nids; 1967 spec->adc_nids = stac925x_adc_nids;
1930 spec->mux_nids = stac925x_mux_nids; 1968 spec->mux_nids = stac925x_mux_nids;
1931 spec->num_muxes = 1; 1969 spec->num_muxes = 1;
1932 spec->num_dmics = 0; 1970 switch (codec->vendor_id) {
1971 case 0x83847632: /* STAC9202 */
1972 case 0x83847633: /* STAC9202D */
1973 case 0x83847636: /* STAC9251 */
1974 case 0x83847637: /* STAC9251D */
1975 spec->num_dmics = 1;
1976 spec->dmic_nids = stac925x_dmic_nids;
1977 break;
1978 default:
1979 spec->num_dmics = 0;
1980 break;
1981 }
1933 1982
1934 spec->init = stac925x_core_init; 1983 spec->init = stac925x_core_init;
1935 spec->mixer = stac925x_mixer; 1984 spec->mixer = stac925x_mixer;
@@ -2110,6 +2159,13 @@ static int patch_stac927x(struct hda_codec *codec)
2110 2159
2111 codec->patch_ops = stac92xx_patch_ops; 2160 codec->patch_ops = stac92xx_patch_ops;
2112 2161
2162 /* Fix Mux capture level; max to 2 */
2163 snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT,
2164 (0 << AC_AMPCAP_OFFSET_SHIFT) |
2165 (2 << AC_AMPCAP_NUM_STEPS_SHIFT) |
2166 (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT) |
2167 (0 << AC_AMPCAP_MUTE_SHIFT));
2168
2113 return 0; 2169 return 0;
2114} 2170}
2115 2171
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index 21dc6974d6a3..bfbdc3cbd43b 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -337,6 +337,8 @@ static int s3c24xx_pcm_open(struct snd_pcm_substream *substream)
337 if (prtd == NULL) 337 if (prtd == NULL)
338 return -ENOMEM; 338 return -ENOMEM;
339 339
340 spin_lock_init(&prtd->lock);
341
340 runtime->private_data = prtd; 342 runtime->private_data = prtd;
341 return 0; 343 return 0;
342} 344}
diff --git a/sound/sound_firmware.c b/sound/sound_firmware.c
index 3304344713ae..96deaefaa897 100644
--- a/sound/sound_firmware.c
+++ b/sound/sound_firmware.c
@@ -3,6 +3,7 @@
3#include <linux/fs.h> 3#include <linux/fs.h>
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/slab.h> 5#include <linux/slab.h>
6#include <linux/sched.h>
6#include <asm/uaccess.h> 7#include <asm/uaccess.h>
7#include "oss/sound_firmware.h" 8#include "oss/sound_firmware.h"
8 9