aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/CodingStyle49
-rw-r--r--Documentation/DocBook/gadget.tmpl2
-rw-r--r--Documentation/DocBook/kernel-locking.tmpl123
-rw-r--r--Documentation/DocBook/usb.tmpl28
-rw-r--r--Documentation/HOWTO20
-rw-r--r--Documentation/block/capability.txt15
-rw-r--r--Documentation/dontdiff42
-rw-r--r--Documentation/feature-removal-schedule.txt27
-rw-r--r--Documentation/filesystems/directory-locking5
-rw-r--r--Documentation/filesystems/porting8
-rw-r--r--Documentation/gpio.txt8
-rw-r--r--Documentation/i386/boot.txt401
-rw-r--r--Documentation/initrd.txt74
-rw-r--r--Documentation/kernel-parameters.txt24
-rw-r--r--Documentation/ldm.txt21
-rw-r--r--Documentation/memory-barriers.txt98
-rw-r--r--Documentation/networking/netdevices.txt2
-rw-r--r--Documentation/s390/cds.txt82
-rw-r--r--Documentation/spi/spi-summary53
-rw-r--r--Documentation/vm/slabinfo.c26
-rw-r--r--MAINTAINERS41
-rw-r--r--Makefile6
-rw-r--r--arch/alpha/kernel/entry.S7
-rw-r--r--arch/alpha/kernel/pci_iommu.c3
-rw-r--r--arch/alpha/kernel/setup.c3
-rw-r--r--arch/alpha/kernel/signal.c110
-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.c2
-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/boards/atstk1000/atstk1000.h15
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c10
-rw-r--r--arch/avr32/boards/atstk1000/setup.c45
-rw-r--r--arch/avr32/kernel/irq.c9
-rw-r--r--arch/avr32/kernel/kprobes.c7
-rw-r--r--arch/avr32/kernel/syscall_table.S3
-rw-r--r--arch/avr32/kernel/vmlinux.lds.c4
-rw-r--r--arch/avr32/mach-at32ap/at32ap7000.c77
-rw-r--r--arch/avr32/mm/fault.c36
-rw-r--r--arch/blackfin/Kconfig20
-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/Kconfig8
-rw-r--r--arch/frv/kernel/vmlinux.lds.S6
-rw-r--r--arch/h8300/kernel/vmlinux.lds.S4
-rw-r--r--arch/i386/Kconfig2
-rw-r--r--arch/i386/Makefile2
-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/generic.c2
-rw-r--r--arch/i386/kernel/cpu/mtrr/main.c2
-rw-r--r--arch/i386/kernel/cpu/mtrr/state.c2
-rw-r--r--arch/i386/kernel/smp.c2
-rw-r--r--arch/i386/kernel/verify_cpu.S27
-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.c9
-rw-r--r--arch/ia64/kernel/acpi-processor.c2
-rw-r--r--arch/ia64/kernel/acpi.c5
-rw-r--r--arch/ia64/kernel/crash.c24
-rw-r--r--arch/ia64/kernel/entry.S3
-rw-r--r--arch/ia64/kernel/irq.c6
-rw-r--r--arch/ia64/kernel/irq_lsapic.c2
-rw-r--r--arch/ia64/kernel/kprobes.c15
-rw-r--r--arch/ia64/kernel/mca.c5
-rw-r--r--arch/ia64/kernel/mca_drv.c4
-rw-r--r--arch/ia64/kernel/module.c2
-rw-r--r--arch/ia64/kernel/perfmon.c18
-rw-r--r--arch/ia64/kernel/perfmon_mckinley.h2
-rw-r--r--arch/ia64/kernel/process.c5
-rw-r--r--arch/ia64/kernel/sal.c2
-rw-r--r--arch/ia64/kernel/salinfo.c2
-rw-r--r--arch/ia64/kernel/setup.c6
-rw-r--r--arch/ia64/kernel/smp.c12
-rw-r--r--arch/ia64/kernel/smpboot.c10
-rw-r--r--arch/ia64/kernel/traps.c2
-rw-r--r--arch/ia64/kernel/unwind.c23
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S9
-rw-r--r--arch/ia64/mm/discontig.c2
-rw-r--r--arch/ia64/mm/fault.c41
-rw-r--r--arch/ia64/pci/pci.c11
-rw-r--r--arch/ia64/sn/kernel/bte.c12
-rw-r--r--arch/ia64/sn/kernel/bte_error.c4
-rw-r--r--arch/ia64/sn/kernel/io_common.c2
-rw-r--r--arch/ia64/sn/kernel/setup.c4
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c2
-rw-r--r--arch/ia64/sn/kernel/xpc_channel.c8
-rw-r--r--arch/ia64/sn/kernel/xpnet.c2
-rw-r--r--arch/ia64/sn/pci/pci_dma.c8
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_ate.c6
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_dma.c2
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c6
-rw-r--r--arch/ia64/sn/pci/tioce_provider.c16
-rw-r--r--arch/m32r/kernel/vmlinux.lds.S4
-rw-r--r--arch/m68k/kernel/vmlinux-std.lds4
-rw-r--r--arch/m68k/kernel/vmlinux-sun3.lds4
-rw-r--r--arch/m68knommu/Kconfig8
-rw-r--r--arch/m68knommu/kernel/vmlinux.lds.S4
-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/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/Makefile3
-rw-r--r--arch/powerpc/boot/Makefile15
-rw-r--r--arch/powerpc/boot/dts/ebony.dts37
-rw-r--r--arch/powerpc/boot/dts/kuroboxHD.dts44
-rw-r--r--arch/powerpc/boot/dts/kuroboxHG.dts45
-rw-r--r--arch/powerpc/boot/dts/lite5200.dts67
-rw-r--r--arch/powerpc/boot/dts/lite5200b.dts75
-rw-r--r--arch/powerpc/boot/dts/mpc7448hpc2.dts72
-rw-r--r--arch/powerpc/boot/dts/mpc8540ads.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8541cds.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8544ds.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8548cds.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8555cds.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8560ads.dts18
-rw-r--r--arch/powerpc/boot/dts/mpc8568mds.dts16
-rw-r--r--arch/powerpc/boot/flatdevtree.c17
-rw-r--r--arch/powerpc/configs/cell_defconfig15
-rw-r--r--arch/powerpc/configs/iseries_defconfig209
-rw-r--r--arch/powerpc/configs/pasemi_defconfig383
-rw-r--r--arch/powerpc/kernel/cputable.c6
-rw-r--r--arch/powerpc/kernel/entry_32.S18
-rw-r--r--arch/powerpc/kernel/of_platform.c10
-rw-r--r--arch/powerpc/kernel/pci_64.c23
-rw-r--r--arch/powerpc/kernel/pmc.c6
-rw-r--r--arch/powerpc/kernel/prom.c5
-rw-r--r--arch/powerpc/kernel/rtas-proc.c2
-rw-r--r--arch/powerpc/kernel/smp.c34
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S4
-rw-r--r--arch/powerpc/lib/rheap.c22
-rw-r--r--arch/powerpc/mm/hash_low_32.S18
-rw-r--r--arch/powerpc/mm/hash_utils_64.c4
-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/mm/pgtable_64.c4
-rw-r--r--arch/powerpc/platforms/44x/Kconfig3
-rw-r--r--arch/powerpc/platforms/44x/ebony.c6
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c4
-rw-r--r--arch/powerpc/platforms/chrp/pegasos_eth.c2
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c21
-rw-r--r--arch/powerpc/platforms/pasemi/Kconfig1
-rw-r--r--arch/powerpc/platforms/powermac/setup.c2
-rw-r--r--arch/powerpc/platforms/pseries/pseries.h4
-rw-r--r--arch/powerpc/sysdev/mpic.c12
-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/pq2_sys.c36
-rw-r--r--arch/s390/kernel/compat_wrapper.S28
-rw-r--r--arch/s390/kernel/kprobes.c2
-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/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.c2
-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.c2
-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/sh4/fpu.c2
-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/syscalls.S3
-rw-r--r--arch/sh/kernel/traps.c13
-rw-r--r--arch/sh/kernel/vmlinux.lds.S4
-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.S669
-rw-r--r--arch/sparc64/kernel/head.S31
-rw-r--r--arch/sparc64/kernel/hvapi.c192
-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.c21
-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.c49
-rw-r--r--arch/sparc64/kernel/traps.c27
-rw-r--r--arch/sparc64/kernel/vmlinux.lds.S4
-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/Kconfig8
-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/xtensa/kernel/vmlinux.lds.S6
-rw-r--r--block/genhd.c33
-rw-r--r--crypto/api.c4
-rw-r--r--crypto/tcrypt.c2
-rw-r--r--drivers/acpi/numa.c8
-rw-r--r--drivers/ata/Kconfig2
-rw-r--r--drivers/ata/ahci.c16
-rw-r--r--drivers/ata/ata_generic.c2
-rw-r--r--drivers/ata/ata_piix.c10
-rw-r--r--drivers/ata/libata-acpi.c10
-rw-r--r--drivers/ata/libata-core.c104
-rw-r--r--drivers/ata/libata-eh.c2
-rw-r--r--drivers/ata/libata-scsi.c50
-rw-r--r--drivers/ata/libata.h4
-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.c50
-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.c24
-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.c5
-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.c7
-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/base/dmapool.c1
-rw-r--r--drivers/block/cciss.c45
-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/hangcheck-timer.c2
-rw-r--r--drivers/char/random.c67
-rw-r--r--drivers/char/watchdog/booke_wdt.c2
-rw-r--r--drivers/crypto/Kconfig4
-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-cdev.c2
-rw-r--r--drivers/firewire/fw-ohci.c5
-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/raw1394.c8
-rw-r--r--drivers/ieee1394/sbp2.c1
-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/hardware/eicon/capifunc.c16
-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/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.c1
-rw-r--r--drivers/macintosh/Kconfig1
-rw-r--r--drivers/macintosh/adbhid.c16
-rw-r--r--drivers/macintosh/windfarm_core.c10
-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/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/ubi/eba.c3
-rw-r--r--drivers/net/Kconfig3
-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.h4
-rw-r--r--drivers/net/e1000/e1000_main.c44
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c2
-rw-r--r--drivers/net/forcedeth.c2
-rw-r--r--drivers/net/gianfar.c11
-rw-r--r--drivers/net/ibm_emac/ibm_emac_core.c2
-rw-r--r--drivers/net/ibm_emac/ibm_emac_mal.c3
-rw-r--r--drivers/net/ibm_emac/ibm_emac_mal.h3
-rw-r--r--drivers/net/ibm_emac/ibm_emac_phy.c60
-rw-r--r--drivers/net/ibm_emac/ibm_emac_rgmii.c2
-rw-r--r--drivers/net/ibm_emac/ibm_emac_rgmii.h2
-rw-r--r--drivers/net/ibm_emac/ibm_emac_tah.c2
-rw-r--r--drivers/net/ibm_emac/ibm_emac_tah.h2
-rw-r--r--drivers/net/ibm_emac/ibm_emac_zmii.c2
-rw-r--r--drivers/net/ibm_emac/ibm_emac_zmii.h2
-rw-r--r--drivers/net/ixgb/ixgb.h2
-rw-r--r--drivers/net/ixgb/ixgb_main.c36
-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/netxen/netxen_nic_init.c2
-rw-r--r--drivers/net/phy/fixed.c4
-rw-r--r--drivers/net/sky2.c75
-rw-r--r--drivers/net/sky2.h24
-rw-r--r--drivers/net/spider_net.c9
-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/parport/parport_pc.c1
-rw-r--r--drivers/pci/hotplug/ibmphp_hpc.c1
-rw-r--r--drivers/pci/pcie/aer/aerdrv.h1
-rw-r--r--drivers/rtc/Kconfig6
-rw-r--r--drivers/rtc/rtc-omap.c4
-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/scsi/Kconfig14
-rw-r--r--drivers/scsi/Makefile3
-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/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/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/8250.c21
-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/icom.c55
-rw-r--r--drivers/serial/serial_ks8695.c6
-rw-r--r--drivers/serial/suncore.c6
-rw-r--r--drivers/serial/sunhv.c276
-rw-r--r--drivers/serial/sunzilog.c4
-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/spidev.c15
-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/console/vgacon.c9
-rw-r--r--drivers/video/imxfb.c24
-rw-r--r--drivers/video/pm2fb.c17
-rw-r--r--drivers/video/pm3fb.c333
-rw-r--r--drivers/video/ps3fb.c8
-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/adfs/super.c3
-rw-r--r--fs/affs/inode.c2
-rw-r--r--fs/affs/super.c9
-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.h1
-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.c22
-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/afs/write.c3
-rw-r--r--fs/befs/linuxvfs.c6
-rw-r--r--fs/bfs/inode.c3
-rw-r--r--fs/binfmt_misc.c2
-rw-r--r--fs/block_dev.c16
-rw-r--r--fs/buffer.c27
-rw-r--r--fs/cifs/cifsfs.c6
-rw-r--r--fs/coda/cache.c1
-rw-r--r--fs/coda/inode.c3
-rw-r--r--fs/coda/upcall.c2
-rw-r--r--fs/compat.c30
-rw-r--r--fs/compat_ioctl.c33
-rw-r--r--fs/configfs/inode.c1
-rw-r--r--fs/dquot.c2
-rw-r--r--fs/ecryptfs/file.c59
-rw-r--r--fs/ecryptfs/main.c3
-rw-r--r--fs/ecryptfs/messaging.c2
-rw-r--r--fs/ecryptfs/mmap.c52
-rw-r--r--fs/efs/super.c3
-rw-r--r--fs/eventfd.c26
-rw-r--r--fs/exec.c7
-rw-r--r--fs/ext2/super.c8
-rw-r--r--fs/ext3/super.c10
-rw-r--r--fs/ext4/super.c10
-rw-r--r--fs/fat/cache.c3
-rw-r--r--fs/fat/inode.c14
-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.c5
-rw-r--r--fs/gfs2/glock.h1
-rw-r--r--fs/gfs2/main.c34
-rw-r--r--fs/hfs/inode.c1
-rw-r--r--fs/hfs/super.c3
-rw-r--r--fs/hfsplus/inode.c1
-rw-r--r--fs/hfsplus/super.c3
-rw-r--r--fs/hpfs/buffer.c2
-rw-r--r--fs/hpfs/namei.c2
-rw-r--r--fs/hpfs/super.c9
-rw-r--r--fs/hugetlbfs/inode.c3
-rw-r--r--fs/inode.c3
-rw-r--r--fs/isofs/inode.c3
-rw-r--r--fs/jffs2/super.c6
-rw-r--r--fs/jfs/jfs_metapage.c18
-rw-r--r--fs/jfs/super.c22
-rw-r--r--fs/lockd/clntlock.c2
-rw-r--r--fs/lockd/host.c2
-rw-r--r--fs/lockd/xdr.c4
-rw-r--r--fs/lockd/xdr4.c6
-rw-r--r--fs/locks.c3
-rw-r--r--fs/minix/bitmap.c1
-rw-r--r--fs/minix/inode.c3
-rw-r--r--fs/ncpfs/file.c1
-rw-r--r--fs/ncpfs/inode.c6
-rw-r--r--fs/ncpfs/ioctl.c1
-rw-r--r--fs/nfs/callback.h4
-rw-r--r--fs/nfs/client.c2
-rw-r--r--fs/nfs/delegation.c2
-rw-r--r--fs/nfs/dir.c5
-rw-r--r--fs/nfs/direct.c65
-rw-r--r--fs/nfs/file.c1
-rw-r--r--fs/nfs/inode.c30
-rw-r--r--fs/nfs/nfs4proc.c4
-rw-r--r--fs/nfs/nfs4state.c2
-rw-r--r--fs/nfs/nfs4xdr.c96
-rw-r--r--fs/nfs/pagelist.c21
-rw-r--r--fs/nfs/read.c10
-rw-r--r--fs/nfs/write.c12
-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/super.c3
-rw-r--r--fs/ocfs2/aops.c11
-rw-r--r--fs/ocfs2/dlm/dlmfs.c8
-rw-r--r--fs/ocfs2/file.c33
-rw-r--r--fs/ocfs2/localalloc.c7
-rw-r--r--fs/ocfs2/super.c38
-rw-r--r--fs/openpromfs/inode.c3
-rw-r--r--fs/partitions/Kconfig12
-rw-r--r--fs/partitions/ldm.c206
-rw-r--r--fs/partitions/ldm.h6
-rw-r--r--fs/proc/inode.c3
-rw-r--r--fs/qnx4/inode.c3
-rw-r--r--fs/quota.c23
-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/reiserfs/super.c10
-rw-r--r--fs/romfs/inode.c7
-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.c4
-rw-r--r--fs/smbfs/request.c1
-rw-r--r--fs/sysfs/inode.c1
-rw-r--r--fs/sysv/inode.c3
-rw-r--r--fs/timerfd.c24
-rw-r--r--fs/udf/file.c1
-rw-r--r--fs/udf/namei.c1
-rw-r--r--fs/udf/super.c6
-rw-r--r--fs/ufs/super.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c26
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c3
-rw-r--r--include/acpi/acpi_numa.h7
-rw-r--r--include/asm-alpha/bitops.h50
-rw-r--r--include/asm-alpha/thread_info.h2
-rw-r--r--include/asm-alpha/unistd.h48
-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-avr32/arch-at32ap/board.h8
-rw-r--r--include/asm-avr32/kdebug.h17
-rw-r--r--include/asm-avr32/kprobes.h1
-rw-r--r--include/asm-avr32/unistd.h5
-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.h12
-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/kdebug.h16
-rw-r--r--include/asm-ia64/kprobes.h1
-rw-r--r--include/asm-ia64/unistd.h18
-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/cputable.h6
-rw-r--r--include/asm-powerpc/mmu-44x.h2
-rw-r--r--include/asm-powerpc/mmu_context.h1
-rw-r--r--include/asm-powerpc/mpc8260.h6
-rw-r--r--include/asm-powerpc/pgtable-ppc32.h15
-rw-r--r--include/asm-powerpc/pmac_feature.h6
-rw-r--r--include/asm-powerpc/systbl.h3
-rw-r--r--include/asm-powerpc/tsi108_irq.h6
-rw-r--r--include/asm-powerpc/tsi108_pci.h6
-rw-r--r--include/asm-powerpc/unistd.h11
-rw-r--r--include/asm-s390/unistd.h21
-rw-r--r--include/asm-sh/dreamcast/sysasic.h2
-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/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.h726
-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/Kbuild1
-rw-r--r--include/linux/binfmts.h2
-rw-r--r--include/linux/capability.h2
-rw-r--r--include/linux/compiler.h4
-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/kmalloc_sizes.h20
-rw-r--r--include/linux/libata.h5
-rw-r--r--include/linux/lockd/xdr4.h1
-rw-r--r--include/linux/log2.h2
-rw-r--r--include/linux/mii.h4
-rw-r--r--include/linux/mm.h11
-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/nfs4.h3
-rw-r--r--include/linux/nfs_page.h1
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/raid/bitmap.h1
-rw-r--r--include/linux/rmap.h13
-rw-r--r--include/linux/sched.h13
-rw-r--r--include/linux/slab.h21
-rw-r--r--include/linux/slab_def.h3
-rw-r--r--include/linux/slub_def.h27
-rw-r--r--include/linux/smb_fs.h1
-rw-r--r--include/linux/smp.h7
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h2
-rw-r--r--include/linux/sunrpc/xprt.h2
-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/workqueue.h4
-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/rdma/ib_umem.h1
-rw-r--r--include/rdma/ib_verbs.h8
-rw-r--r--include/sound/soc.h4
-rw-r--r--include/sound/version.h2
-rw-r--r--init/Kconfig8
-rw-r--r--init/main.c2
-rw-r--r--ipc/mqueue.c3
-rw-r--r--kernel/exit.c7
-rw-r--r--kernel/fork.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/disk.c3
-rw-r--r--kernel/power/main.c19
-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/sysctl.c2
-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/timer.c10
-rw-r--r--kernel/workqueue.c84
-rw-r--r--lib/Kconfig.debug3
-rw-r--r--lib/ioremap.c2
-rw-r--r--mm/filemap.c3
-rw-r--r--mm/filemap_xip.c1
-rw-r--r--mm/madvise.c1
-rw-r--r--mm/memory.c2
-rw-r--r--mm/mlock.c11
-rw-r--r--mm/msync.c1
-rw-r--r--mm/page_alloc.c49
-rw-r--r--mm/rmap.c66
-rw-r--r--mm/shmem.c8
-rw-r--r--mm/slab.c59
-rw-r--r--mm/slob.c53
-rw-r--r--mm/slub.c238
-rw-r--r--mm/sparse.c2
-rw-r--r--mm/vmalloc.c2
-rw-r--r--mm/vmstat.c1
-rw-r--r--net/bluetooth/hci_sock.c6
-rw-r--r--net/bluetooth/l2cap.c144
-rw-r--r--net/core/dev.c79
-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.c9
-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/Kconfig7
-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.c75
-rw-r--r--net/ipv4/tcp_cong.c40
-rw-r--r--net/ipv4/tcp_input.c3
-rw-r--r--net/ipv6/addrconf.c31
-rw-r--r--net/ipv6/datagram.c8
-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/ipx/af_ipx.c2
-rw-r--r--net/key/af_key.c2
-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/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/socket.c3
-rw-r--r--net/sunrpc/rpc_pipe.c24
-rw-r--r--net/sunrpc/sched.c2
-rw-r--r--net/sunrpc/sunrpc_syms.c4
-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.c28
-rw-r--r--scripts/Makefile.headersinst2
-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/isa/cmi8330.c15
-rw-r--r--sound/isa/cs423x/cs4236.c20
-rw-r--r--sound/isa/es18xx.c19
-rw-r--r--sound/isa/gus/interwave.c15
-rw-r--r--sound/isa/opl3sa2.c15
-rw-r--r--sound/isa/sb/sb16.c15
-rw-r--r--sound/isa/sscape.c28
-rw-r--r--sound/isa/wavefront/wavefront.c14
-rw-r--r--sound/pci/ac97/ac97_patch.c5
-rw-r--r--sound/pci/hda/hda_codec.c3
-rw-r--r--sound/pci/hda/patch_realtek.c532
-rw-r--r--sound/pci/hda/patch_sigmatel.c2
-rw-r--r--sound/pci/intel8x0.c20
-rw-r--r--sound/soc/codecs/ac97.c3
-rw-r--r--sound/soc/codecs/wm9712.c1
-rw-r--r--sound/soc/soc-core.c18
-rw-r--r--sound/sound_firmware.c1
-rw-r--r--sound/usb/usbmixer.c2
-rw-r--r--sound/usb/usbquirks.h9
1042 files changed, 45286 insertions, 7328 deletions
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index afc28677589..b49b92edb39 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 e7fc9643340..6996d977bf8 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/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl
index 644c3884fab..0a441f73261 100644
--- a/Documentation/DocBook/kernel-locking.tmpl
+++ b/Documentation/DocBook/kernel-locking.tmpl
@@ -551,10 +551,12 @@
551 <function>spin_lock_irqsave()</function>, which is a superset 551 <function>spin_lock_irqsave()</function>, which is a superset
552 of all other spinlock primitives. 552 of all other spinlock primitives.
553 </para> 553 </para>
554
554 <table> 555 <table>
555<title>Table of Locking Requirements</title> 556<title>Table of Locking Requirements</title>
556<tgroup cols="11"> 557<tgroup cols="11">
557<tbody> 558<tbody>
559
558<row> 560<row>
559<entry></entry> 561<entry></entry>
560<entry>IRQ Handler A</entry> 562<entry>IRQ Handler A</entry>
@@ -576,97 +578,128 @@
576 578
577<row> 579<row>
578<entry>IRQ Handler B</entry> 580<entry>IRQ Handler B</entry>
579<entry>spin_lock_irqsave</entry> 581<entry>SLIS</entry>
580<entry>None</entry> 582<entry>None</entry>
581</row> 583</row>
582 584
583<row> 585<row>
584<entry>Softirq A</entry> 586<entry>Softirq A</entry>
585<entry>spin_lock_irq</entry> 587<entry>SLI</entry>
586<entry>spin_lock_irq</entry> 588<entry>SLI</entry>
587<entry>spin_lock</entry> 589<entry>SL</entry>
588</row> 590</row>
589 591
590<row> 592<row>
591<entry>Softirq B</entry> 593<entry>Softirq B</entry>
592<entry>spin_lock_irq</entry> 594<entry>SLI</entry>
593<entry>spin_lock_irq</entry> 595<entry>SLI</entry>
594<entry>spin_lock</entry> 596<entry>SL</entry>
595<entry>spin_lock</entry> 597<entry>SL</entry>
596</row> 598</row>
597 599
598<row> 600<row>
599<entry>Tasklet A</entry> 601<entry>Tasklet A</entry>
600<entry>spin_lock_irq</entry> 602<entry>SLI</entry>
601<entry>spin_lock_irq</entry> 603<entry>SLI</entry>
602<entry>spin_lock</entry> 604<entry>SL</entry>
603<entry>spin_lock</entry> 605<entry>SL</entry>
604<entry>None</entry> 606<entry>None</entry>
605</row> 607</row>
606 608
607<row> 609<row>
608<entry>Tasklet B</entry> 610<entry>Tasklet B</entry>
609<entry>spin_lock_irq</entry> 611<entry>SLI</entry>
610<entry>spin_lock_irq</entry> 612<entry>SLI</entry>
611<entry>spin_lock</entry> 613<entry>SL</entry>
612<entry>spin_lock</entry> 614<entry>SL</entry>
613<entry>spin_lock</entry> 615<entry>SL</entry>
614<entry>None</entry> 616<entry>None</entry>
615</row> 617</row>
616 618
617<row> 619<row>
618<entry>Timer A</entry> 620<entry>Timer A</entry>
619<entry>spin_lock_irq</entry> 621<entry>SLI</entry>
620<entry>spin_lock_irq</entry> 622<entry>SLI</entry>
621<entry>spin_lock</entry> 623<entry>SL</entry>
622<entry>spin_lock</entry> 624<entry>SL</entry>
623<entry>spin_lock</entry> 625<entry>SL</entry>
624<entry>spin_lock</entry> 626<entry>SL</entry>
625<entry>None</entry> 627<entry>None</entry>
626</row> 628</row>
627 629
628<row> 630<row>
629<entry>Timer B</entry> 631<entry>Timer B</entry>
630<entry>spin_lock_irq</entry> 632<entry>SLI</entry>
631<entry>spin_lock_irq</entry> 633<entry>SLI</entry>
632<entry>spin_lock</entry> 634<entry>SL</entry>
633<entry>spin_lock</entry> 635<entry>SL</entry>
634<entry>spin_lock</entry> 636<entry>SL</entry>
635<entry>spin_lock</entry> 637<entry>SL</entry>
636<entry>spin_lock</entry> 638<entry>SL</entry>
637<entry>None</entry> 639<entry>None</entry>
638</row> 640</row>
639 641
640<row> 642<row>
641<entry>User Context A</entry> 643<entry>User Context A</entry>
642<entry>spin_lock_irq</entry> 644<entry>SLI</entry>
643<entry>spin_lock_irq</entry> 645<entry>SLI</entry>
644<entry>spin_lock_bh</entry> 646<entry>SLBH</entry>
645<entry>spin_lock_bh</entry> 647<entry>SLBH</entry>
646<entry>spin_lock_bh</entry> 648<entry>SLBH</entry>
647<entry>spin_lock_bh</entry> 649<entry>SLBH</entry>
648<entry>spin_lock_bh</entry> 650<entry>SLBH</entry>
649<entry>spin_lock_bh</entry> 651<entry>SLBH</entry>
650<entry>None</entry> 652<entry>None</entry>
651</row> 653</row>
652 654
653<row> 655<row>
654<entry>User Context B</entry> 656<entry>User Context B</entry>
657<entry>SLI</entry>
658<entry>SLI</entry>
659<entry>SLBH</entry>
660<entry>SLBH</entry>
661<entry>SLBH</entry>
662<entry>SLBH</entry>
663<entry>SLBH</entry>
664<entry>SLBH</entry>
665<entry>DI</entry>
666<entry>None</entry>
667</row>
668
669</tbody>
670</tgroup>
671</table>
672
673 <table>
674<title>Legend for Locking Requirements Table</title>
675<tgroup cols="2">
676<tbody>
677
678<row>
679<entry>SLIS</entry>
680<entry>spin_lock_irqsave</entry>
681</row>
682<row>
683<entry>SLI</entry>
655<entry>spin_lock_irq</entry> 684<entry>spin_lock_irq</entry>
656<entry>spin_lock_irq</entry> 685</row>
657<entry>spin_lock_bh</entry> 686<row>
658<entry>spin_lock_bh</entry> 687<entry>SL</entry>
659<entry>spin_lock_bh</entry> 688<entry>spin_lock</entry>
660<entry>spin_lock_bh</entry> 689</row>
661<entry>spin_lock_bh</entry> 690<row>
691<entry>SLBH</entry>
662<entry>spin_lock_bh</entry> 692<entry>spin_lock_bh</entry>
693</row>
694<row>
695<entry>DI</entry>
663<entry>down_interruptible</entry> 696<entry>down_interruptible</entry>
664<entry>None</entry>
665</row> 697</row>
666 698
667</tbody> 699</tbody>
668</tgroup> 700</tgroup>
669</table> 701</table>
702
670</sect1> 703</sect1>
671</chapter> 704</chapter>
672 705
diff --git a/Documentation/DocBook/usb.tmpl b/Documentation/DocBook/usb.tmpl
index a2ebd651b05..af293606fbe 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 48123dba5e6..ced9207bedc 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/block/capability.txt b/Documentation/block/capability.txt
new file mode 100644
index 00000000000..2f1729424ef
--- /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 64e9f6c4826..595a5ea4c69 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 498ff31f3aa..2d7ea85075b 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
@@ -328,21 +328,20 @@ Who: Adrian Bunk <bunk@stusta.de>
328 328
329--------------------------- 329---------------------------
330 330
331What: libata.spindown_compat module parameter 331What: libata spindown skipping and warning
332When: Dec 2008 332When: Dec 2008
333Why: halt(8) synchronizes caches for and spins down libata disks 333Why: Some halt(8) implementations synchronize caches for and spin
334 because libata didn't use to spin down disk on system halt 334 down libata disks because libata didn't use to spin down disk on
335 (only synchronized caches). 335 system halt (only synchronized caches).
336 Spin down on system halt is now implemented and can be tested 336 Spin down on system halt is now implemented. sysfs node
337 using sysfs node /sys/class/scsi_disk/h:c:i:l/manage_start_stop. 337 /sys/class/scsi_disk/h:c:i:l/manage_start_stop is present if
338 spin down support is available.
338 Because issuing spin down command to an already spun down disk 339 Because issuing spin down command to an already spun down disk
339 makes some disks spin up just to spin down again, the old 340 makes some disks spin up just to spin down again, libata tracks
340 behavior needs to be maintained till userspace tool is updated 341 device spindown status to skip the extra spindown command and
341 to check the sysfs node and not to spin down disks with the 342 warn about it.
342 node set to one. 343 This is to give userspace tools the time to get updated and will
343 This module parameter is to give userspace tool the time to 344 be removed after userspace is reasonably updated.
344 get updated and should be removed after userspace is
345 reasonably updated.
346Who: Tejun Heo <htejun@gmail.com> 345Who: Tejun Heo <htejun@gmail.com>
347 346
348--------------------------- 347---------------------------
diff --git a/Documentation/filesystems/directory-locking b/Documentation/filesystems/directory-locking
index d7099a9266f..ff7b611abf3 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 5531694059a..dac45c92d87 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/gpio.txt b/Documentation/gpio.txt
index e8be0abb346..36af58eba13 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -111,7 +111,9 @@ setting up a platform_device using the GPIO, is mark its direction:
111 111
112The return value is zero for success, else a negative errno. It should 112The return value is zero for success, else a negative errno. It should
113be checked, since the get/set calls don't have error returns and since 113be checked, since the get/set calls don't have error returns and since
114misconfiguration is possible. (These calls could sleep.) 114misconfiguration is possible. You should normally issue these calls from
115a task context. However, for spinlock-safe GPIOs it's OK to use them
116before tasking is enabled, as part of early board setup.
115 117
116For output GPIOs, the value provided becomes the initial output value. 118For output GPIOs, the value provided becomes the initial output value.
117This helps avoid signal glitching during system startup. 119This helps avoid signal glitching during system startup.
@@ -197,7 +199,9 @@ However, many platforms don't currently support this mechanism.
197 199
198Passing invalid GPIO numbers to gpio_request() will fail, as will requesting 200Passing invalid GPIO numbers to gpio_request() will fail, as will requesting
199GPIOs that have already been claimed with that call. The return value of 201GPIOs that have already been claimed with that call. The return value of
200gpio_request() must be checked. (These calls could sleep.) 202gpio_request() must be checked. You should normally issue these calls from
203a task context. However, for spinlock-safe GPIOs it's OK to request GPIOs
204before tasking is enabled, as part of early board setup.
201 205
202These calls serve two basic purposes. One is marking the signals which 206These calls serve two basic purposes. One is marking the signals which
203are actually in use as GPIOs, for better diagnostics; systems may have 207are actually in use as GPIOs, for better diagnostics; systems may have
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt
index d01b7a2a0f2..35985b34d5a 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-07 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
@@ -52,7 +52,8 @@ zImage kernels, typically looks like:
520A0000 +------------------------+ 520A0000 +------------------------+
53 | Reserved for BIOS | Do not use. Reserved for BIOS EBDA. 53 | Reserved for BIOS | Do not use. Reserved for BIOS EBDA.
5409A000 +------------------------+ 5409A000 +------------------------+
55 | Stack/heap/cmdline | For use by the kernel real-mode code. 55 | Command line |
56 | Stack/heap | For use by the kernel real-mode code.
56098000 +------------------------+ 57098000 +------------------------+
57 | Kernel setup | The kernel real-mode code. 58 | Kernel setup | The kernel real-mode code.
58090200 +------------------------+ 59090200 +------------------------+
@@ -73,10 +74,9 @@ zImage kernels, typically looks like:
73When using bzImage, the protected-mode kernel was relocated to 74When using bzImage, the protected-mode kernel was relocated to
740x100000 ("high memory"), and the kernel real-mode block (boot sector, 750x100000 ("high memory"), and the kernel real-mode block (boot sector,
75setup, and stack/heap) was made relocatable to any address between 76setup, and stack/heap) was made relocatable to any address between
760x10000 and end of low memory. Unfortunately, in protocols 2.00 and 770x10000 and end of low memory. Unfortunately, in protocols 2.00 and
772.01 the command line is still required to live in the 0x9XXXX memory 782.01 the 0x90000+ memory range is still used internally by the kernel;
78range, and that memory range is still overwritten by the early kernel. 79the 2.02 protocol resolves that problem.
79The 2.02 protocol resolves that problem.
80 80
81It is desirable to keep the "memory ceiling" -- the highest point in 81It is desirable to keep the "memory ceiling" -- the highest point in
82low memory touched by the boot loader -- as low as possible, since 82low memory touched by the boot loader -- as low as possible, since
@@ -93,6 +93,35 @@ zImage or old bzImage kernels, which need data written into the
930x90000 segment, the boot loader should make sure not to use memory 930x90000 segment, the boot loader should make sure not to use memory
94above the 0x9A000 point; too many BIOSes will break above that point. 94above the 0x9A000 point; too many BIOSes will break above that point.
95 95
96For a modern bzImage kernel with boot protocol version >= 2.02, a
97memory layout like the following is suggested:
98
99 ~ ~
100 | Protected-mode kernel |
101100000 +------------------------+
102 | I/O memory hole |
1030A0000 +------------------------+
104 | Reserved for BIOS | Leave as much as possible unused
105 ~ ~
106 | Command line | (Can also be below the X+10000 mark)
107X+10000 +------------------------+
108 | Stack/heap | For use by the kernel real-mode code.
109X+08000 +------------------------+
110 | Kernel setup | The kernel real-mode code.
111 | Kernel boot sector | The kernel legacy boot sector.
112X +------------------------+
113 | Boot loader | <- Boot sector entry point 0000:7C00
114001000 +------------------------+
115 | Reserved for MBR/BIOS |
116000800 +------------------------+
117 | Typically used by MBR |
118000600 +------------------------+
119 | BIOS use only |
120000000 +------------------------+
121
122... where the address X is as low as the design of the boot loader
123permits.
124
96 125
97**** THE REAL-MODE KERNEL HEADER 126**** THE REAL-MODE KERNEL HEADER
98 127
@@ -160,29 +189,147 @@ e.g. protocol version 2.01 will contain 0x0201 in this field. When
160setting fields in the header, you must make sure only to set fields 189setting fields in the header, you must make sure only to set fields
161supported by the protocol version in use. 190supported by the protocol version in use.
162 191
163The "kernel_version" field, if set to a nonzero value, contains a 192
164pointer to a null-terminated human-readable kernel version number 193**** DETAILS OF HEADER FIELDS
165string, less 0x200. This can be used to display the kernel version to 194
166the user. This value should be less than (0x200*setup_sects). For 195For each field, some are information from the kernel to the bootloader
167example, if this value is set to 0x1c00, the kernel version number 196("read"), some are expected to be filled out by the bootloader
168string can be found at offset 0x1e00 in the kernel file. This is a 197("write"), and some are expected to be read and modified by the
169valid value if and only if the "setup_sects" field contains the value 198bootloader ("modify").
17014 or higher. 199
171 200All general purpose boot loaders should write the fields marked
172Most boot loaders will simply load the kernel at its target address 201(obligatory). Boot loaders who want to load the kernel at a
173directly. Such boot loaders do not need to worry about filling in 202nonstandard address should fill in the fields marked (reloc); other
174most of the fields in the header. The following fields should be 203boot loaders can ignore those fields.
175filled out, however: 204
176 205The byte order of all fields is littleendian (this is x86, after all.)
177 vid_mode: 206
178 Please see the section on SPECIAL COMMAND LINE OPTIONS. 207Field name: setup_secs
179 208Type: read
180 type_of_loader: 209Offset/size: 0x1f1/1
181 If your boot loader has an assigned id (see table below), enter 210Protocol: ALL
182 0xTV here, where T is an identifier for the boot loader and V is 211
183 a version number. Otherwise, enter 0xFF here. 212 The size of the setup code in 512-byte sectors. If this field is
184 213 0, the real value is 4. The real-mode code consists of the boot
185 Assigned boot loader ids: 214 sector (always one 512-byte sector) plus the setup code.
215
216Field name: root_flags
217Type: modify (optional)
218Offset/size: 0x1f2/2
219Protocol: ALL
220
221 If this field is nonzero, the root defaults to readonly. The use of
222 this field is deprecated; use the "ro" or "rw" options on the
223 command line instead.
224
225Field name: syssize
226Type: read
227Offset/size: 0x1f4/4 (protocol 2.04+) 0x1f4/2 (protocol ALL)
228Protocol: 2.04+
229
230 The size of the protected-mode code in units of 16-byte paragraphs.
231 For protocol versions older than 2.04 this field is only two bytes
232 wide, and therefore cannot be trusted for the size of a kernel if
233 the LOAD_HIGH flag is set.
234
235Field name: ram_size
236Type: kernel internal
237Offset/size: 0x1f8/2
238Protocol: ALL
239
240 This field is obsolete.
241
242Field name: vid_mode
243Type: modify (obligatory)
244Offset/size: 0x1fa/2
245
246 Please see the section on SPECIAL COMMAND LINE OPTIONS.
247
248Field name: root_dev
249Type: modify (optional)
250Offset/size: 0x1fc/2
251Protocol: ALL
252
253 The default root device device number. The use of this field is
254 deprecated, use the "root=" option on the command line instead.
255
256Field name: boot_flag
257Type: read
258Offset/size: 0x1fe/2
259Protocol: ALL
260
261 Contains 0xAA55. This is the closest thing old Linux kernels have
262 to a magic number.
263
264Field name: jump
265Type: read
266Offset/size: 0x200/2
267Protocol: 2.00+
268
269 Contains an x86 jump instruction, 0xEB followed by a signed offset
270 relative to byte 0x202. This can be used to determine the size of
271 the header.
272
273Field name: header
274Type: read
275Offset/size: 0x202/4
276Protocol: 2.00+
277
278 Contains the magic number "HdrS" (0x53726448).
279
280Field name: version
281Type: read
282Offset/size: 0x206/2
283Protocol: 2.00+
284
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.
288
289Field name: readmode_swtch
290Type: modify (optional)
291Offset/size: 0x208/4
292Protocol: 2.00+
293
294 Boot loader hook (see ADVANCED BOOT LOADER HOOKS below.)
295
296Field name: start_sys
297Type: read
298Offset/size: 0x20c/4
299Protocol: 2.00+
300
301 The load low segment (0x1000). Obsolete.
302
303Field name: kernel_version
304Type: read
305Offset/size: 0x20e/2
306Protocol: 2.00+
307
308 If set to a nonzero value, contains a pointer to a NUL-terminated
309 human-readable kernel version number string, less 0x200. This can
310 be used to display the kernel version to the user. This value
311 should be less than (0x200*setup_sects).
312
313 For example, if this value is set to 0x1c00, the kernel version
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.
322
323Field name: type_of_loader
324Type: write (obligatory)
325Offset/size: 0x210/1
326Protocol: 2.00+
327
328 If your boot loader has an assigned id (see table below), enter
329 0xTV here, where T is an identifier for the boot loader and V is
330 a version number. Otherwise, enter 0xFF here.
331
332 Assigned boot loader ids:
186 0 LILO (0x00 reserved for pre-2.00 bootloader) 333 0 LILO (0x00 reserved for pre-2.00 bootloader)
187 1 Loadlin 334 1 Loadlin
188 2 bootsect-loader (0x20, all other values reserved) 335 2 bootsect-loader (0x20, all other values reserved)
@@ -193,60 +340,145 @@ filled out, however:
193 8 U-BOOT 340 8 U-BOOT
194 9 Xen 341 9 Xen
195 A Gujin 342 A Gujin
343 B Qemu
344
345 Please contact <hpa@zytor.com> if you need a bootloader ID
346 value assigned.
347
348Field name: loadflags
349Type: modify (obligatory)
350Offset/size: 0x211/1
351Protocol: 2.00+
352
353 This field is a bitmask.
354
355 Bit 0 (read): LOADED_HIGH
356 - If 0, the protected-mode code is loaded at 0x10000.
357 - If 1, the protected-mode code is loaded at 0x100000.
358
359 Bit 7 (write): CAN_USE_HEAP
360 Set this bit to 1 to indicate that the value entered in the
361 heap_end_ptr is valid. If this field is clear, some setup code
362 functionality will be disabled.
363
364Field name: setup_move_size
365Type: modify (obligatory)
366Offset/size: 0x212/2
367Protocol: 2.00-2.01
368
369 When using protocol 2.00 or 2.01, if the real mode kernel is not
370 loaded at 0x90000, it gets moved there later in the loading
371 sequence. Fill in this field if you want additional data (such as
372 the kernel command line) moved in addition to the real-mode kernel
373 itself.
374
375 The unit is bytes starting with the beginning of the boot sector.
376
377 This field is can be ignored when the protocol is 2.02 or higher, or
378 if the real-mode code is loaded at 0x90000.
379
380Field name: code32_start
381Type: modify (optional, reloc)
382Offset/size: 0x214/4
383Protocol: 2.00+
384
385 The address to jump to in protected mode. This defaults to the load
386 address of the kernel, and can be used by the boot loader to
387 determine the proper load address.
388
389 This field can be modified for two purposes:
390
391 1. as a boot loader hook (see ADVANCED BOOT LOADER HOOKS below.)
392
393 2. if a bootloader which does not install a hook loads a
394 relocatable kernel at a nonstandard address it will have to modify
395 this field to point to the load address.
396
397Field name: ramdisk_image
398Type: write (obligatory)
399Offset/size: 0x218/4
400Protocol: 2.00+
401
402 The 32-bit linear address of the initial ramdisk or ramfs. Leave at
403 zero if there is no initial ramdisk/ramfs.
404
405Field name: ramdisk_size
406Type: write (obligatory)
407Offset/size: 0x21c/4
408Protocol: 2.00+
409
410 Size of the initial ramdisk or ramfs. Leave at zero if there is no
411 initial ramdisk/ramfs.
412
413Field name: bootsect_kludge
414Type: kernel internal
415Offset/size: 0x220/4
416Protocol: 2.00+
417
418 This field is obsolete.
419
420Field name: heap_end_ptr
421Type: write (obligatory)
422Offset/size: 0x224/2
423Protocol: 2.01+
424
425 Set this field to the offset (from the beginning of the real-mode
426 code) of the end of the setup stack/heap, minus 0x0200.
427
428Field name: cmd_line_ptr
429Type: write (obligatory)
430Offset/size: 0x228/4
431Protocol: 2.02+
432
433 Set this field to the linear address of the kernel command line.
434 The kernel command line can be located anywhere between the end of
435 the setup heap and 0xA0000; it does not have to be located in the
436 same 64K segment as the real-mode code itself.
437
438 Fill in this field even if your boot loader does not support a
439 command line, in which case you can point this to an empty string
440 (or better yet, to the string "auto".) If this field is left at
441 zero, the kernel will assume that your boot loader does not support
442 the 2.02+ protocol.
443
444Field name: initrd_addr_max
445Type: read
446Offset/size: 0x22c/4
447Protocol: 2.03+
448
449 The maximum address that may be occupied by the initial
450 ramdisk/ramfs contents. For boot protocols 2.02 or earlier, this
451 field is not present, and the maximum address is 0x37FFFFFF. (This
452 address is defined as the address of the highest safe byte, so if
453 your ramdisk is exactly 131072 bytes long and this field is
454 0x37FFFFFF, you can start your ramdisk at 0x37FE0000.)
455
456Field name: kernel_alignment
457Type: read (reloc)
458Offset/size: 0x230/4
459Protocol: 2.05+
460
461 Alignment unit required by the kernel (if relocatable_kernel is true.)
462
463Field name: relocatable_kernel
464Type: read (reloc)
465Offset/size: 0x234/1
466Protocol: 2.05+
467
468 If this field is nonzero, the protected-mode part of the kernel can
469 be loaded at any address that satisfies the kernel_alignment field.
470 After loading, the boot loader must set the code32_start field to
471 point to the loaded code, or to a boot loader hook.
472
473Field name: cmdline_size
474Type: read
475Offset/size: 0x238/4
476Protocol: 2.06+
196 477
197 Please contact <hpa@zytor.com> if you need a bootloader ID 478 The maximum size of the command line without the terminating
198 value assigned. 479 zero. This means that the command line can contain at most
199 480 cmdline_size characters. With protocol version 2.05 and earlier, the
200 loadflags, heap_end_ptr: 481 maximum size was 255.
201 If the protocol version is 2.01 or higher, enter the
202 offset limit of the setup heap into heap_end_ptr and set the
203 0x80 bit (CAN_USE_HEAP) of loadflags. heap_end_ptr appears to
204 be relative to the start of setup (offset 0x0200).
205
206 setup_move_size:
207 When using protocol 2.00 or 2.01, if the real mode
208 kernel is not loaded at 0x90000, it gets moved there later in
209 the loading sequence. Fill in this field if you want
210 additional data (such as the kernel command line) moved in
211 addition to the real-mode kernel itself.
212
213 The unit is bytes starting with the beginning of the boot
214 sector.
215
216 ramdisk_image, ramdisk_size:
217 If your boot loader has loaded an initial ramdisk (initrd),
218 set ramdisk_image to the 32-bit pointer to the ramdisk data
219 and the ramdisk_size to the size of the ramdisk data.
220
221 The initrd should typically be located as high in memory as
222 possible, as it may otherwise get overwritten by the early
223 kernel initialization sequence. However, it must never be
224 located above the address specified in the initrd_addr_max
225 field. The initrd should be at least 4K page aligned.
226
227 cmd_line_ptr:
228 If the protocol version is 2.02 or higher, this is a 32-bit
229 pointer to the kernel command line. The kernel command line
230 can be located anywhere between the end of setup and 0xA0000.
231 Fill in this field even if your boot loader does not support a
232 command line, in which case you can point this to an empty
233 string (or better yet, to the string "auto".) If this field
234 is left at zero, the kernel will assume that your boot loader
235 does not support the 2.02+ protocol.
236
237 ramdisk_max:
238 The maximum address that may be occupied by the initrd
239 contents. For boot protocols 2.02 or earlier, this field is
240 not present, and the maximum address is 0x37FFFFFF. (This
241 address is defined as the address of the highest safe byte, so
242 if your ramdisk is exactly 131072 bytes long and this field is
243 0x37FFFFFF, you can start your ramdisk at 0x37FE0000.)
244
245 cmdline_size:
246 The maximum size of the command line without the terminating
247 zero. This means that the command line can contain at most
248 cmdline_size characters. With protocol version 2.05 and
249 earlier, the maximum size was 255.
250 482
251 483
252**** THE KERNEL COMMAND LINE 484**** THE KERNEL COMMAND LINE
@@ -494,7 +726,7 @@ switched off, especially if the loaded kernel has the floppy driver as
494a demand-loaded module! 726a demand-loaded module!
495 727
496 728
497**** ADVANCED BOOT TIME HOOKS 729**** ADVANCED BOOT LOADER HOOKS
498 730
499If the boot loader runs in a particularly hostile environment (such as 731If the boot loader runs in a particularly hostile environment (such as
500LOADLIN, which runs under DOS) it may be impossible to follow the 732LOADLIN, which runs under DOS) it may be impossible to follow the
@@ -519,4 +751,5 @@ IMPORTANT: All the hooks are required to preserve %esp, %ebp, %esi and
519 set them up to BOOT_DS (0x18) yourself. 751 set them up to BOOT_DS (0x18) yourself.
520 752
521 After completing your hook, you should jump to the address 753 After completing your hook, you should jump to the address
522 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/initrd.txt b/Documentation/initrd.txt
index 15f1b35deb3..d3dc505104d 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 09220a1e22d..aae2282600c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -396,6 +396,26 @@ and is between 256 and 4096 characters. It is defined in the file
396 clocksource is not available, it defaults to PIT. 396 clocksource is not available, it defaults to PIT.
397 Format: { pit | tsc | cyclone | pmtmr } 397 Format: { pit | tsc | cyclone | pmtmr }
398 398
399 clocksource= [GENERIC_TIME] Override the default clocksource
400 Format: <string>
401 Override the default clocksource and use the clocksource
402 with the name specified.
403 Some clocksource names to choose from, depending on
404 the platform:
405 [all] jiffies (this is the base, fallback clocksource)
406 [ACPI] acpi_pm
407 [ARM] imx_timer1,OSTS,netx_timer,mpu_timer2,
408 pxa_timer,timer3,32k_counter,timer0_1
409 [AVR32] avr32
410 [IA-32] pit,hpet,tsc,vmi-timer;
411 scx200_hrt on Geode; cyclone on IBM x440
412 [MIPS] MIPS
413 [PARISC] cr16
414 [S390] tod
415 [SH] SuperH
416 [SPARC64] tick
417 [X86-64] hpet,tsc
418
399 code_bytes [IA32] How many bytes of object code to print in an 419 code_bytes [IA32] How many bytes of object code to print in an
400 oops report. 420 oops report.
401 Range: 0 - 8192 421 Range: 0 - 8192
@@ -1807,10 +1827,6 @@ and is between 256 and 4096 characters. It is defined in the file
1807 1827
1808 time Show timing data prefixed to each printk message line 1828 time Show timing data prefixed to each printk message line
1809 1829
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] 1830 tipar.timeout= [HW,PPT]
1815 Set communications timeout in tenths of a second 1831 Set communications timeout in tenths of a second
1816 (default 15). 1832 (default 15).
diff --git a/Documentation/ldm.txt b/Documentation/ldm.txt
index e266e11c19a..718085bc9f1 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 58408dd023c..650657c5473 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/netdevices.txt b/Documentation/networking/netdevices.txt
index 847cedb238f..ce1361f9524 100644
--- a/Documentation/networking/netdevices.txt
+++ b/Documentation/networking/netdevices.txt
@@ -49,7 +49,7 @@ dev->hard_start_xmit:
49 for this and return -1 when the spin lock fails. 49 for this and return -1 when the spin lock fails.
50 The locking there should also properly protect against 50 The locking there should also properly protect against
51 set_multicast_list 51 set_multicast_list
52 Context: BHs disabled 52 Context: Process with BHs disabled or BH (timer).
53 Notes: netif_queue_stopped() is guaranteed false 53 Notes: netif_queue_stopped() is guaranteed false
54 Interrupts must be enabled when calling hard_start_xmit. 54 Interrupts must be enabled when calling hard_start_xmit.
55 (Interrupts must also be enabled when enabling the BH handler.) 55 (Interrupts must also be enabled when enabling the BH handler.)
diff --git a/Documentation/s390/cds.txt b/Documentation/s390/cds.txt
index 05a2b4f7e38..58919d6a593 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/spi/spi-summary b/Documentation/spi/spi-summary
index 795fbb48ffa..76ea6c837be 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/vm/slabinfo.c b/Documentation/vm/slabinfo.c
index 686a8e04a4f..d4f21ffd140 100644
--- a/Documentation/vm/slabinfo.c
+++ b/Documentation/vm/slabinfo.c
@@ -242,6 +242,9 @@ void decode_numa_list(int *numa, char *t)
242 242
243 memset(numa, 0, MAX_NODES * sizeof(int)); 243 memset(numa, 0, MAX_NODES * sizeof(int));
244 244
245 if (!t)
246 return;
247
245 while (*t == 'N') { 248 while (*t == 'N') {
246 t++; 249 t++;
247 node = strtoul(t, &t, 10); 250 node = strtoul(t, &t, 10);
@@ -259,11 +262,17 @@ void decode_numa_list(int *numa, char *t)
259 262
260void slab_validate(struct slabinfo *s) 263void slab_validate(struct slabinfo *s)
261{ 264{
265 if (strcmp(s->name, "*") == 0)
266 return;
267
262 set_obj(s, "validate", 1); 268 set_obj(s, "validate", 1);
263} 269}
264 270
265void slab_shrink(struct slabinfo *s) 271void slab_shrink(struct slabinfo *s)
266{ 272{
273 if (strcmp(s->name, "*") == 0)
274 return;
275
267 set_obj(s, "shrink", 1); 276 set_obj(s, "shrink", 1);
268} 277}
269 278
@@ -386,7 +395,9 @@ void report(struct slabinfo *s)
386{ 395{
387 if (strcmp(s->name, "*") == 0) 396 if (strcmp(s->name, "*") == 0)
388 return; 397 return;
389 printf("\nSlabcache: %-20s Aliases: %2d Order : %2d\n", s->name, s->aliases, s->order); 398
399 printf("\nSlabcache: %-20s Aliases: %2d Order : %2d Objects: %d\n",
400 s->name, s->aliases, s->order, s->objects);
390 if (s->hwcache_align) 401 if (s->hwcache_align)
391 printf("** Hardware cacheline aligned\n"); 402 printf("** Hardware cacheline aligned\n");
392 if (s->cache_dma) 403 if (s->cache_dma)
@@ -545,6 +556,9 @@ int slab_empty(struct slabinfo *s)
545 556
546void slab_debug(struct slabinfo *s) 557void slab_debug(struct slabinfo *s)
547{ 558{
559 if (strcmp(s->name, "*") == 0)
560 return;
561
548 if (sanity && !s->sanity_checks) { 562 if (sanity && !s->sanity_checks) {
549 set_obj(s, "sanity", 1); 563 set_obj(s, "sanity", 1);
550 } 564 }
@@ -791,11 +805,11 @@ void totals(void)
791 805
792 store_size(b1, total_size);store_size(b2, total_waste); 806 store_size(b1, total_size);store_size(b2, total_waste);
793 store_size(b3, total_waste * 100 / total_used); 807 store_size(b3, total_waste * 100 / total_used);
794 printf("Memory used: %6s # Loss : %6s MRatio: %6s%%\n", b1, b2, b3); 808 printf("Memory used: %6s # Loss : %6s MRatio:%6s%%\n", b1, b2, b3);
795 809
796 store_size(b1, total_objects);store_size(b2, total_partobj); 810 store_size(b1, total_objects);store_size(b2, total_partobj);
797 store_size(b3, total_partobj * 100 / total_objects); 811 store_size(b3, total_partobj * 100 / total_objects);
798 printf("# Objects : %6s # PartObj: %6s ORatio: %6s%%\n", b1, b2, b3); 812 printf("# Objects : %6s # PartObj: %6s ORatio:%6s%%\n", b1, b2, b3);
799 813
800 printf("\n"); 814 printf("\n");
801 printf("Per Cache Average Min Max Total\n"); 815 printf("Per Cache Average Min Max Total\n");
@@ -818,7 +832,7 @@ void totals(void)
818 store_size(b1, avg_ppart);store_size(b2, min_ppart); 832 store_size(b1, avg_ppart);store_size(b2, min_ppart);
819 store_size(b3, max_ppart); 833 store_size(b3, max_ppart);
820 store_size(b4, total_partial * 100 / total_slabs); 834 store_size(b4, total_partial * 100 / total_slabs);
821 printf("%%PartSlab %10s%% %10s%% %10s%% %10s%%\n", 835 printf("%%PartSlab%10s%% %10s%% %10s%% %10s%%\n",
822 b1, b2, b3, b4); 836 b1, b2, b3, b4);
823 837
824 store_size(b1, avg_partobj);store_size(b2, min_partobj); 838 store_size(b1, avg_partobj);store_size(b2, min_partobj);
@@ -830,7 +844,7 @@ void totals(void)
830 store_size(b1, avg_ppartobj);store_size(b2, min_ppartobj); 844 store_size(b1, avg_ppartobj);store_size(b2, min_ppartobj);
831 store_size(b3, max_ppartobj); 845 store_size(b3, max_ppartobj);
832 store_size(b4, total_partobj * 100 / total_objects); 846 store_size(b4, total_partobj * 100 / total_objects);
833 printf("%% PartObj %10s%% %10s%% %10s%% %10s%%\n", 847 printf("%% PartObj%10s%% %10s%% %10s%% %10s%%\n",
834 b1, b2, b3, b4); 848 b1, b2, b3, b4);
835 849
836 store_size(b1, avg_size);store_size(b2, min_size); 850 store_size(b1, avg_size);store_size(b2, min_size);
@@ -1100,6 +1114,8 @@ void output_slabs(void)
1100 ops(slab); 1114 ops(slab);
1101 else if (show_slab) 1115 else if (show_slab)
1102 slabcache(slab); 1116 slabcache(slab);
1117 else if (show_report)
1118 report(slab);
1103 } 1119 }
1104} 1120}
1105 1121
diff --git a/MAINTAINERS b/MAINTAINERS
index bbeb5b6b5b0..4cc17b993b6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -332,6 +332,9 @@ L: linux-usb-devel@lists.sourceforge.net
332W: http://www.linux-usb.org/SpeedTouch/ 332W: http://www.linux-usb.org/SpeedTouch/
333S: Maintained 333S: Maintained
334 334
335ALCHEMY AU1XX0 MMC DRIVER
336S: Orphan
337
335ALI1563 I2C DRIVER 338ALI1563 I2C DRIVER
336P: Rudolf Marek 339P: Rudolf Marek
337M: r.marek@assembler.cz 340M: r.marek@assembler.cz
@@ -418,6 +421,12 @@ P: Ian Molton
418M: spyro@f2s.com 421M: spyro@f2s.com
419S: Maintained 422S: Maintained
420 423
424ARM PRIMECELL MMCI PL180/1 DRIVER
425P: Russell King
426M: rmk@arm.linux.org.uk
427L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
428S: Maintained
429
421ARM/ADI ROADRUNNER MACHINE SUPPORT 430ARM/ADI ROADRUNNER MACHINE SUPPORT
422P: Lennert Buytenhek 431P: Lennert Buytenhek
423M: kernel@wantstofly.org 432M: kernel@wantstofly.org
@@ -649,6 +658,9 @@ L: linux-atm-general@lists.sourceforge.net (subscribers-only)
649W: http://linux-atm.sourceforge.net 658W: http://linux-atm.sourceforge.net
650S: Maintained 659S: Maintained
651 660
661ATMEL AT91 MCI DRIVER
662S: Orphan
663
652ATMEL MACB ETHERNET DRIVER 664ATMEL MACB ETHERNET DRIVER
653P: Haavard Skinnemoen 665P: Haavard Skinnemoen
654M: hskinnemoen@atmel.com 666M: hskinnemoen@atmel.com
@@ -2231,11 +2243,11 @@ M: khali@linux-fr.org
2231L: lm-sensors@lm-sensors.org 2243L: lm-sensors@lm-sensors.org
2232S: Maintained 2244S: Maintained
2233 2245
2234LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP Dynamic Disks) 2246LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks)
2235P: Richard Russon (FlatCap) 2247P: Richard Russon (FlatCap)
2236M: ldm@flatcap.org 2248M: ldm@flatcap.org
2237L: ldm-devel@lists.sourceforge.net 2249L: linux-ntfs-dev@lists.sourceforge.net
2238W: http://ldm.sourceforge.net 2250W: http://www.linux-ntfs.org/content/view/19/37/
2239S: Maintained 2251S: Maintained
2240 2252
2241LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) 2253LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
@@ -2322,7 +2334,7 @@ S: Maintained
2322 2334
2323MEGARAID SCSI DRIVERS 2335MEGARAID SCSI DRIVERS
2324P: Neela Syam Kolli 2336P: Neela Syam Kolli
2325M: Neela.Kolli@engenio.com 2337M: megaraidlinux@lsi.com
2326S: linux-scsi@vger.kernel.org 2338S: linux-scsi@vger.kernel.org
2327W: http://megaraid.lsilogic.com 2339W: http://megaraid.lsilogic.com
2328S: Maintained 2340S: Maintained
@@ -2380,6 +2392,13 @@ M: stelian@popies.net
2380W: http://popies.net/meye/ 2392W: http://popies.net/meye/
2381S: Maintained 2393S: Maintained
2382 2394
2395MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER
2396P: Pavel Pisa
2397M: ppisa@pikron.com
2398L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
2399W: http://mmc.drzeus.cx/wiki/Controllers/Freescale/SDHC
2400S: Maintained
2401
2383MOUSE AND MISC DEVICES [GENERAL] 2402MOUSE AND MISC DEVICES [GENERAL]
2384P: Alessandro Rubini 2403P: Alessandro Rubini
2385M: rubini@ipvvis.unipv.it 2404M: rubini@ipvvis.unipv.it
@@ -2689,13 +2708,13 @@ L: i2c@lm-sensors.org
2689S: Maintained 2708S: Maintained
2690 2709
2691PARALLEL PORT SUPPORT 2710PARALLEL PORT SUPPORT
2692L: linux-parport@lists.infradead.org 2711L: linux-parport@lists.infradead.org (subscribers-only)
2693S: Orphan 2712S: Orphan
2694 2713
2695PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES 2714PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES
2696P: Tim Waugh 2715P: Tim Waugh
2697M: tim@cyberelk.net 2716M: tim@cyberelk.net
2698L: linux-parport@lists.infradead.org 2717L: linux-parport@lists.infradead.org (subscribers-only)
2699W: http://www.torque.net/linux-pp.html 2718W: http://www.torque.net/linux-pp.html
2700S: Maintained 2719S: Maintained
2701 2720
@@ -2900,6 +2919,9 @@ M: nico@cam.org
2900L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 2919L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
2901S: Maintained 2920S: Maintained
2902 2921
2922PXA MMCI DRIVER
2923S: Orphan
2924
2903QLOGIC QLA2XXX FC-SCSI DRIVER 2925QLOGIC QLA2XXX FC-SCSI DRIVER
2904P: Andrew Vasquez 2926P: Andrew Vasquez
2905M: linux-driver@qlogic.com 2927M: linux-driver@qlogic.com
@@ -3416,6 +3438,13 @@ P: Alex Dubov
3416M: oakad@yahoo.com 3438M: oakad@yahoo.com
3417S: Maintained 3439S: Maintained
3418 3440
3441TI OMAP MMC INTERFACE DRIVER
3442P: Carlos Aguiar, Anderson Briglia and Syed Khasim
3443M: linux-omap-open-source@linux.omap.com
3444W: http://linux.omap.com
3445W: http://www.muru.com/linux/omap/
3446S: Maintained
3447
3419TI OMAP RANDOM NUMBER GENERATOR SUPPORT 3448TI OMAP RANDOM NUMBER GENERATOR SUPPORT
3420P: Deepak Saxena 3449P: Deepak Saxena
3421M: dsaxena@plexity.net 3450M: dsaxena@plexity.net
diff --git a/Makefile b/Makefile
index e6990e2cdaf..562a90902cf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 22 3SUBLEVEL = 22
4EXTRAVERSION = -rc1 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"
@@ -491,7 +491,7 @@ endif
491include $(srctree)/arch/$(ARCH)/Makefile 491include $(srctree)/arch/$(ARCH)/Makefile
492 492
493ifdef CONFIG_FRAME_POINTER 493ifdef CONFIG_FRAME_POINTER
494CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls 494CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
495else 495else
496CFLAGS += -fomit-frame-pointer 496CFLAGS += -fomit-frame-pointer
497endif 497endif
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index c95e95e1ab0..debc8f03886 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 6e7d1fe6e93..28c84e55feb 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/setup.c b/arch/alpha/kernel/setup.c
index 915f26345c4..bd5e68cd61e 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 7f64aa767d5..410af4f3140 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/systbls.S b/arch/alpha/kernel/systbls.S
index f6cfe8ce3f9..79de99e32c3 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 cf1e6fc6c68..449e76f118d 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 ea098f3b629..266f78e1307 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 00000000000..7ad84ea0acf
--- /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 e55bbd32dca..50d9f3e4e0f 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 6fbe7722aa4..b36b1e8a105 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 4deece5fbdf..0c89bd35e06 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 c94864c5b1a..aad4d94ba8f 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 5972df2b9af..3bf3a927ae2 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 9179e822031..f73d62e8ab6 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 3c078e34675..3278e713c32 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 ae89cdd82b1..19326d7cdeb 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 0453dcc757b..650eac1bc0a 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 8b63ad89d0a..ae31deb2d06 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 3d4fcbc1627..1ca2d5174fc 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 e4156e7868c..2b7a8f5d8cf 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 54225102174..2e787d40d59 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 b4518619063..76ec856cd4f 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 6043c38c0a9..af497896a96 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 76f6e1e553e..7d9b1a278fd 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 1f0c8a400b3..26ca8ab3f62 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 f57458559fb..c164c8e58ae 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 30c79aca84d..9b61320f295 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 4f984fde737..35eb232a649 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 82e420d6fd1..0a1a25fb8ba 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 7e70e0b0b98..467d899fbe7 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 6d50d85a618..bc6fb02d213 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 7a7fa51ec62..1c474cf709c 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 ebb255bdce8..158daaf9e3b 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 897c21c2fb5..e9c82deb791 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 ceaa88e30d7..00000000000
--- 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 af9ebccac7c..d4d8134ce56 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 613b841a10f..00000000000
--- 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 5791addd436..69f07b25b3c 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 2d236930222..63ef1124ca5 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 1c9e94c38b7..9d63d7f260c 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 45f4f13ae11..5776fd88411 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 7b21c6e13e5..d4eefbea1fe 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 bc25fb91e7b..8d9f49164a8 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 82598dc18d8..c971171c290 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 5f07344d96f..d55005d6478 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 376c932830b..2b063180687 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 58c81496c6f..7889ce3cb08 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 c65ea78a242..f09dd054b9c 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 500e997ba7a..9c49435d42c 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 0fdd03ab36e..ce7c15c7300 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 70d247f09a7..14f09b80ab7 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 52b368b3434..73c651e83d9 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 3084a5fa751..d3d730d2fc2 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 5a09a90c08f..03f4cf7f9de 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 b644bbab7d0..16356ffc86a 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 7a86a2516ea..c41a6b5a0ac 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 ac7d43d23c2..227f808dc0e 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 d06e21b70de..e35644961aa 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 9715ef506c2..060909870b5 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 64685da1462..8112f726ffa 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 7bc94f3def1..ad2e5b97966 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 1caff65e22c..1e75e105c4f 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 30f1300e0e2..dc6725bda3c 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 509a95a692a..d1e75b7dc3b 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 9a31444d921..78a17413cec 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 162c266e5f8..9bf8ccbcacc 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 4fb2efc4950..df6e38ed425 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 dd257084441..b97d0c54a38 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 856c681ebbb..f6ecdd3a247 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 7d0cf7af88c..e7130293a03 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 4bc8a62909b..01582418562 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 8caee68aa09..5bb348e2e31 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 5170481afea..588adb5ab47 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 162978fd535..4f791866b91 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 a72476c2462..365b9435f74 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 ff6b4ee037f..40dea3d5142 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 caf6b8bb6c9..c7bdf04ab09 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 e98543742eb..00000000000
--- 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 bc308ceb91c..435adcce648 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 5ccd0be23a3..5c9bcea7476 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 9cc4253d7bb..d86e6f18bac 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 d0f4695c09d..668cccefe7b 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 aafe0bc593f..782b5814ced 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 324f5a23792..4d6c7a574c1 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 c3cc4bf158f..866ff71c01d 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 0b6e360aeae..58402948c47 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 b71ee53c286..b1eb709ee65 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 11b1d0b310c..8d8117158d2 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 d7c038a0256..4cbf9468f65 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 416e277054c..29cb0c1604a 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 15f0284010c..e7904bc92c7 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 b5bd335ff14..762702765fc 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 19ca333240e..36440c89958 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 *
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index d6167ad4e01..f3ade18862a 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 2c4c2422cd1..2728b0e7d2b 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 2ba1530d1ce..02e050ae59f 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 dd823dd4a37..718f4782ee8 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 00000000000..b56dda8052f
--- /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 0a3067452cd..260fe29d73f 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 89850071824..7791da791f5 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 e2744b7227c..2b5aa1135b1 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 dd8708ad0a7..7987aa6e95f 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 55a4d3be16b..88d5b6d9f95 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 bc46f33aede..1f23f0459e5 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 25489aafb11..a5aedf964b8 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 908efa7d745..7ed19b23ce5 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 0fe53b39cb2..5875da0ae0e 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 6f03c937097..08d80f2f51f 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 bd965f2feec..cb0b3a4ccf1 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 c6b03f8ab26..5692eccdf4d 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 046a8505401..4ec715c25de 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 1d2949e83be..6c44f6a17bf 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/boards/atstk1000/atstk1000.h b/arch/avr32/boards/atstk1000/atstk1000.h
new file mode 100644
index 00000000000..9a49ed036b7
--- /dev/null
+++ b/arch/avr32/boards/atstk1000/atstk1000.h
@@ -0,0 +1,15 @@
1/*
2 * ATSTK1000 setup code: Daughterboard interface
3 *
4 * Copyright (C) 2007 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H
11#define __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H
12
13extern struct atmel_lcdfb_info atstk1000_lcdc_data;
14
15#endif /* __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H */
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c
index abe6ca203fa..fe1dbe2e28f 100644
--- a/arch/avr32/boards/atstk1000/atstk1002.c
+++ b/arch/avr32/boards/atstk1000/atstk1002.c
@@ -16,6 +16,8 @@
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/spi/spi.h> 17#include <linux/spi/spi.h>
18 18
19#include <video/atmel_lcdc.h>
20
19#include <asm/io.h> 21#include <asm/io.h>
20#include <asm/setup.h> 22#include <asm/setup.h>
21#include <asm/arch/at32ap7000.h> 23#include <asm/arch/at32ap7000.h>
@@ -23,6 +25,7 @@
23#include <asm/arch/init.h> 25#include <asm/arch/init.h>
24#include <asm/arch/portmux.h> 26#include <asm/arch/portmux.h>
25 27
28#include "atstk1000.h"
26 29
27#define SW2_DEFAULT /* MMCI and UART_A available */ 30#define SW2_DEFAULT /* MMCI and UART_A available */
28 31
@@ -31,9 +34,7 @@ struct eth_addr {
31}; 34};
32 35
33static struct eth_addr __initdata hw_addr[2]; 36static struct eth_addr __initdata hw_addr[2];
34
35static struct eth_platform_data __initdata eth_data[2]; 37static struct eth_platform_data __initdata eth_data[2];
36static struct lcdc_platform_data atstk1000_fb0_data;
37 38
38static struct spi_board_info spi0_board_info[] __initdata = { 39static struct spi_board_info spi0_board_info[] __initdata = {
39 { 40 {
@@ -148,9 +149,8 @@ static int __init atstk1002_init(void)
148 set_hw_addr(at32_add_device_eth(0, &eth_data[0])); 149 set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
149 150
150 at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); 151 at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
151 atstk1000_fb0_data.fbmem_start = fbmem_start; 152 at32_add_device_lcdc(0, &atstk1000_lcdc_data,
152 atstk1000_fb0_data.fbmem_size = fbmem_size; 153 fbmem_start, fbmem_size);
153 at32_add_device_lcdc(0, &atstk1000_fb0_data);
154 154
155 return 0; 155 return 0;
156} 156}
diff --git a/arch/avr32/boards/atstk1000/setup.c b/arch/avr32/boards/atstk1000/setup.c
index 2bc4b88d7ed..c9af409ada9 100644
--- a/arch/avr32/boards/atstk1000/setup.c
+++ b/arch/avr32/boards/atstk1000/setup.c
@@ -8,13 +8,56 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/bootmem.h> 10#include <linux/bootmem.h>
11#include <linux/fb.h>
11#include <linux/init.h> 12#include <linux/init.h>
12#include <linux/types.h> 13#include <linux/types.h>
13#include <linux/linkage.h> 14#include <linux/linkage.h>
14 15
15#include <asm/setup.h> 16#include <video/atmel_lcdc.h>
16 17
18#include <asm/setup.h>
17#include <asm/arch/board.h> 19#include <asm/arch/board.h>
18 20
21#include "atstk1000.h"
22
19/* Initialized by bootloader-specific startup code. */ 23/* Initialized by bootloader-specific startup code. */
20struct tag *bootloader_tags __initdata; 24struct tag *bootloader_tags __initdata;
25
26static struct fb_videomode __initdata ltv350qv_modes[] = {
27 {
28 .name = "320x240 @ 75",
29 .refresh = 75,
30 .xres = 320, .yres = 240,
31 .pixclock = KHZ2PICOS(6891),
32
33 .left_margin = 17, .right_margin = 33,
34 .upper_margin = 10, .lower_margin = 10,
35 .hsync_len = 16, .vsync_len = 1,
36
37 .sync = 0,
38 .vmode = FB_VMODE_NONINTERLACED,
39 },
40};
41
42static struct fb_monspecs __initdata atstk1000_default_monspecs = {
43 .manufacturer = "SNG",
44 .monitor = "LTV350QV",
45 .modedb = ltv350qv_modes,
46 .modedb_len = ARRAY_SIZE(ltv350qv_modes),
47 .hfmin = 14820,
48 .hfmax = 22230,
49 .vfmin = 60,
50 .vfmax = 90,
51 .dclkmax = 30000000,
52};
53
54struct atmel_lcdfb_info __initdata atstk1000_lcdc_data = {
55 .default_bpp = 24,
56 .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
57 .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
58 | ATMEL_LCDC_INVCLK
59 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
60 | ATMEL_LCDC_MEMOR_BIG),
61 .default_monspecs = &atstk1000_default_monspecs,
62 .guard_time = 2,
63};
diff --git a/arch/avr32/kernel/irq.c b/arch/avr32/kernel/irq.c
index fd311248c14..61f2de266f6 100644
--- a/arch/avr32/kernel/irq.c
+++ b/arch/avr32/kernel/irq.c
@@ -7,15 +7,6 @@
7 * This program is free software; you can redistribute it and/or modify 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 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 *
11 * This file contains the code used by various IRQ handling routines:
12 * asking for different IRQ's should be done through these routines
13 * instead of just grabbing them. Thus setups with different IRQ numbers
14 * shouldn't result in any weird surprises, and installing new handlers
15 * should be easier.
16 *
17 * IRQ's are in fact implemented a bit like signal handlers for the kernel.
18 * Naturally it's not a 1:1 relation, but there are similarities.
19 */ 10 */
20 11
21#include <linux/interrupt.h> 12#include <linux/interrupt.h>
diff --git a/arch/avr32/kernel/kprobes.c b/arch/avr32/kernel/kprobes.c
index 004c94b6fc1..4942ee662e0 100644
--- a/arch/avr32/kernel/kprobes.c
+++ b/arch/avr32/kernel/kprobes.c
@@ -179,7 +179,7 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
179 return 1; 179 return 1;
180} 180}
181 181
182static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) 182int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
183{ 183{
184 struct kprobe *cur = kprobe_running(); 184 struct kprobe *cur = kprobe_running();
185 185
@@ -216,11 +216,6 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
216 if (post_kprobe_handler(args->regs)) 216 if (post_kprobe_handler(args->regs))
217 ret = NOTIFY_STOP; 217 ret = NOTIFY_STOP;
218 break; 218 break;
219 case DIE_FAULT:
220 if (kprobe_running()
221 && kprobe_fault_handler(args->regs, args->trapnr))
222 ret = NOTIFY_STOP;
223 break;
224 default: 219 default:
225 break; 220 break;
226 } 221 }
diff --git a/arch/avr32/kernel/syscall_table.S b/arch/avr32/kernel/syscall_table.S
index 07f6a6fa340..75c81f2dd0b 100644
--- a/arch/avr32/kernel/syscall_table.S
+++ b/arch/avr32/kernel/syscall_table.S
@@ -292,4 +292,7 @@ sys_call_table:
292 .long sys_shmdt 292 .long sys_shmdt
293 .long sys_shmctl 293 .long sys_shmctl
294 .long sys_utimensat 294 .long sys_utimensat
295 .long sys_signalfd
296 .long sys_timerfd /* 280 */
297 .long sys_eventfd
295 .long sys_ni_syscall /* r8 is saturated at nr_syscalls */ 298 .long sys_ni_syscall /* r8 is saturated at nr_syscalls */
diff --git a/arch/avr32/kernel/vmlinux.lds.c b/arch/avr32/kernel/vmlinux.lds.c
index e7f72c995a3..db0438f35c0 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/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c
index 56db45b99a0..1d2bf347a1d 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -6,6 +6,7 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8#include <linux/clk.h> 8#include <linux/clk.h>
9#include <linux/fb.h>
9#include <linux/init.h> 10#include <linux/init.h>
10#include <linux/platform_device.h> 11#include <linux/platform_device.h>
11#include <linux/spi/spi.h> 12#include <linux/spi/spi.h>
@@ -17,6 +18,8 @@
17#include <asm/arch/portmux.h> 18#include <asm/arch/portmux.h>
18#include <asm/arch/sm.h> 19#include <asm/arch/sm.h>
19 20
21#include <video/atmel_lcdc.h>
22
20#include "clock.h" 23#include "clock.h"
21#include "hmatrix.h" 24#include "hmatrix.h"
22#include "pio.h" 25#include "pio.h"
@@ -881,20 +884,26 @@ at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n)
881/* -------------------------------------------------------------------- 884/* --------------------------------------------------------------------
882 * LCDC 885 * LCDC
883 * -------------------------------------------------------------------- */ 886 * -------------------------------------------------------------------- */
884static struct lcdc_platform_data lcdc0_data; 887static struct atmel_lcdfb_info atmel_lcdfb0_data;
885static struct resource lcdc0_resource[] = { 888static struct resource atmel_lcdfb0_resource[] = {
886 { 889 {
887 .start = 0xff000000, 890 .start = 0xff000000,
888 .end = 0xff000fff, 891 .end = 0xff000fff,
889 .flags = IORESOURCE_MEM, 892 .flags = IORESOURCE_MEM,
890 }, 893 },
891 IRQ(1), 894 IRQ(1),
895 {
896 /* Placeholder for pre-allocated fb memory */
897 .start = 0x00000000,
898 .end = 0x00000000,
899 .flags = 0,
900 },
892}; 901};
893DEFINE_DEV_DATA(lcdc, 0); 902DEFINE_DEV_DATA(atmel_lcdfb, 0);
894DEV_CLK(hclk, lcdc0, hsb, 7); 903DEV_CLK(hck1, atmel_lcdfb0, hsb, 7);
895static struct clk lcdc0_pixclk = { 904static struct clk atmel_lcdfb0_pixclk = {
896 .name = "pixclk", 905 .name = "lcdc_clk",
897 .dev = &lcdc0_device.dev, 906 .dev = &atmel_lcdfb0_device.dev,
898 .mode = genclk_mode, 907 .mode = genclk_mode,
899 .get_rate = genclk_get_rate, 908 .get_rate = genclk_get_rate,
900 .set_rate = genclk_set_rate, 909 .set_rate = genclk_set_rate,
@@ -903,13 +912,34 @@ static struct clk lcdc0_pixclk = {
903}; 912};
904 913
905struct platform_device *__init 914struct platform_device *__init
906at32_add_device_lcdc(unsigned int id, struct lcdc_platform_data *data) 915at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
916 unsigned long fbmem_start, unsigned long fbmem_len)
907{ 917{
908 struct platform_device *pdev; 918 struct platform_device *pdev;
919 struct atmel_lcdfb_info *info;
920 struct fb_monspecs *monspecs;
921 struct fb_videomode *modedb;
922 unsigned int modedb_size;
923
924 /*
925 * Do a deep copy of the fb data, monspecs and modedb. Make
926 * sure all allocations are done before setting up the
927 * portmux.
928 */
929 monspecs = kmemdup(data->default_monspecs,
930 sizeof(struct fb_monspecs), GFP_KERNEL);
931 if (!monspecs)
932 return NULL;
933
934 modedb_size = sizeof(struct fb_videomode) * monspecs->modedb_len;
935 modedb = kmemdup(monspecs->modedb, modedb_size, GFP_KERNEL);
936 if (!modedb)
937 goto err_dup_modedb;
938 monspecs->modedb = modedb;
909 939
910 switch (id) { 940 switch (id) {
911 case 0: 941 case 0:
912 pdev = &lcdc0_device; 942 pdev = &atmel_lcdfb0_device;
913 select_peripheral(PC(19), PERIPH_A, 0); /* CC */ 943 select_peripheral(PC(19), PERIPH_A, 0); /* CC */
914 select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */ 944 select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */
915 select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */ 945 select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */
@@ -942,19 +972,32 @@ at32_add_device_lcdc(unsigned int id, struct lcdc_platform_data *data)
942 select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */ 972 select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */
943 select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */ 973 select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */
944 974
945 clk_set_parent(&lcdc0_pixclk, &pll0); 975 clk_set_parent(&atmel_lcdfb0_pixclk, &pll0);
946 clk_set_rate(&lcdc0_pixclk, clk_get_rate(&pll0)); 976 clk_set_rate(&atmel_lcdfb0_pixclk, clk_get_rate(&pll0));
947 break; 977 break;
948 978
949 default: 979 default:
950 return NULL; 980 goto err_invalid_id;
951 } 981 }
952 982
953 memcpy(pdev->dev.platform_data, data, 983 if (fbmem_len) {
954 sizeof(struct lcdc_platform_data)); 984 pdev->resource[2].start = fbmem_start;
985 pdev->resource[2].end = fbmem_start + fbmem_len - 1;
986 pdev->resource[2].flags = IORESOURCE_MEM;
987 }
988
989 info = pdev->dev.platform_data;
990 memcpy(info, data, sizeof(struct atmel_lcdfb_info));
991 info->default_monspecs = monspecs;
955 992
956 platform_device_register(pdev); 993 platform_device_register(pdev);
957 return pdev; 994 return pdev;
995
996err_invalid_id:
997 kfree(modedb);
998err_dup_modedb:
999 kfree(monspecs);
1000 return NULL;
958} 1001}
959 1002
960/* -------------------------------------------------------------------- 1003/* --------------------------------------------------------------------
@@ -1037,8 +1080,8 @@ struct clk *at32_clock_list[] = {
1037 &macb1_pclk, 1080 &macb1_pclk,
1038 &atmel_spi0_spi_clk, 1081 &atmel_spi0_spi_clk,
1039 &atmel_spi1_spi_clk, 1082 &atmel_spi1_spi_clk,
1040 &lcdc0_hclk, 1083 &atmel_lcdfb0_hck1,
1041 &lcdc0_pixclk, 1084 &atmel_lcdfb0_pixclk,
1042 &gclk0, 1085 &gclk0,
1043 &gclk1, 1086 &gclk1,
1044 &gclk2, 1087 &gclk2,
@@ -1077,7 +1120,7 @@ void __init at32_clock_init(void)
1077 genclk_init_parent(&gclk2); 1120 genclk_init_parent(&gclk2);
1078 genclk_init_parent(&gclk3); 1121 genclk_init_parent(&gclk3);
1079 genclk_init_parent(&gclk4); 1122 genclk_init_parent(&gclk4);
1080 genclk_init_parent(&lcdc0_pixclk); 1123 genclk_init_parent(&atmel_lcdfb0_pixclk);
1081 1124
1082 /* 1125 /*
1083 * Turn on all clocks that have at least one user already, and 1126 * Turn on all clocks that have at least one user already, and
diff --git a/arch/avr32/mm/fault.c b/arch/avr32/mm/fault.c
index 88b00b15970..e011f1ce187 100644
--- a/arch/avr32/mm/fault.c
+++ b/arch/avr32/mm/fault.c
@@ -12,41 +12,30 @@
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/pagemap.h> 14#include <linux/pagemap.h>
15
16#include <linux/kdebug.h> 15#include <linux/kdebug.h>
16#include <linux/kprobes.h>
17
17#include <asm/mmu_context.h> 18#include <asm/mmu_context.h>
18#include <asm/sysreg.h> 19#include <asm/sysreg.h>
19#include <asm/tlb.h> 20#include <asm/tlb.h>
20#include <asm/uaccess.h> 21#include <asm/uaccess.h>
21 22
22#ifdef CONFIG_KPROBES 23#ifdef CONFIG_KPROBES
23ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); 24static inline int notify_page_fault(struct pt_regs *regs, int trap)
24
25/* Hook to register for page fault notifications */
26int register_page_fault_notifier(struct notifier_block *nb)
27{ 25{
28 return atomic_notifier_chain_register(&notify_page_fault_chain, nb); 26 int ret = 0;
29}
30 27
31int unregister_page_fault_notifier(struct notifier_block *nb) 28 if (!user_mode(regs)) {
32{ 29 if (kprobe_running() && kprobe_fault_handler(regs, trap))
33 return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb); 30 ret = 1;
34} 31 }
35 32
36static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, 33 return ret;
37 int trap, int sig)
38{
39 struct die_args args = {
40 .regs = regs,
41 .trapnr = trap,
42 };
43 return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
44} 34}
45#else 35#else
46static inline int notify_page_fault(enum die_val val, struct pt_regs *regs, 36static inline int notify_page_fault(struct pt_regs *regs, int trap)
47 int trap, int sig)
48{ 37{
49 return NOTIFY_DONE; 38 return 0;
50} 39}
51#endif 40#endif
52 41
@@ -76,8 +65,7 @@ asmlinkage void do_page_fault(unsigned long ecr, struct pt_regs *regs)
76 long signr; 65 long signr;
77 int code; 66 int code;
78 67
79 if (notify_page_fault(DIE_PAGE_FAULT, regs, 68 if (notify_page_fault(regs, ecr))
80 ecr, SIGSEGV) == NOTIFY_STOP)
81 return; 69 return;
82 70
83 address = sysreg_read(TLBEAR); 71 address = sysreg_read(TLBEAR);
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 1a493050932..b1b111bb2f3 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)
@@ -560,14 +570,6 @@ endchoice
560 570
561source "mm/Kconfig" 571source "mm/Kconfig"
562 572
563config LARGE_ALLOCS
564 bool "Allow allocating large blocks (> 1MB) of memory"
565 help
566 Allow the slab memory allocator to keep chains for very large
567 memory sizes - upto 32MB. You may need this if your system has
568 a lot of RAM, and you need to able to allocate very large
569 contiguous chunks. If unsure, say N.
570
571config BFIN_DMA_5XX 573config BFIN_DMA_5XX
572 bool "Enable DMA Support" 574 bool "Enable DMA Support"
573 depends on (BF533 || BF532 || BF531 || BF537 || BF536 || BF534 || BF561) 575 depends on (BF533 || BF532 || BF531 || BF537 || BF536 || BF534 || BF561)
diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index 52d4dbdb2b1..75e89c32475 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 00000000000..377c8e05e4a
--- /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 00000000000..14a948c288a
--- /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 00000000000..8ed67dc450f
--- /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 00000000000..e32ca2072cb
--- /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 00000000000..97b4ffa2b4a
--- /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 d5904ca994c..a513fbe3956 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 8ea079ebecb..0ccb0dc3f83 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 e9f24a9a46b..3f49fae1cb1 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 342bb8dd56a..02dc7430192 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 9556b73de80..9932edee8cb 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 6ae9ebbd8e5..86fe6799580 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 730d2b42753..7d5e9846311 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 d7b3a5d74e8..9a472fe1583 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 4808edb0680..4db9e624090 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 2d83b7e3546..0442c4c7f72 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 d104e1d8e07..2c2652bee7e 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 886edc739ab..495a1cf9d45 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 14eb4f9a68e..9720b5c307a 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 00000000000..db308c7ccab
--- /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 7bca478526b..ad9187a866a 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 8eb0a902348..7d0368772cd 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 deb27272c65..afed5246dd9 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 73f72abed43..d6cf1059560 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/Kconfig b/arch/frv/Kconfig
index 114738a4558..74eef7111f2 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -102,14 +102,6 @@ config HIGHPTE
102 with a lot of RAM, this can be wasteful of precious low memory. 102 with a lot of RAM, this can be wasteful of precious low memory.
103 Setting this option will put user-space page tables in high memory. 103 Setting this option will put user-space page tables in high memory.
104 104
105config LARGE_ALLOCS
106 bool "Allow allocating large blocks (> 1MB) of memory"
107 help
108 Allow the slab memory allocator to keep chains for very large memory
109 sizes - up to 32MB. You may need this if your system has a lot of
110 RAM, and you need to able to allocate very large contiguous chunks.
111 If unsure, say N.
112
113source "mm/Kconfig" 105source "mm/Kconfig"
114 106
115choice 107choice
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index 28eae9735ad..481dc137464 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/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S
index 65f1cdc5ee0..a2e72d49555 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 c2d54b80223..8770a5d0b14 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/Makefile b/arch/i386/Makefile
index 6dc5e5d90fe..bd28f9f9b4b 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -34,7 +34,7 @@ CHECKFLAGS += -D__i386__
34CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return 34CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return
35 35
36# prevent gcc from keeping the stack 16 byte aligned 36# prevent gcc from keeping the stack 16 byte aligned
37CFLAGS += -mpreferred-stack-boundary=4 37CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
38 38
39# CPU-specific tuning. Anything which can be shared with UML should go here. 39# CPU-specific tuning. Anything which can be shared with UML should go here.
40include $(srctree)/arch/i386/Makefile.cpu 40include $(srctree)/arch/i386/Makefile.cpu
diff --git a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
index f8b3b9cda2b..6dbcc95b212 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 9da84412a83..1a3a2217b7c 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 4fec702afd7..6f47eeeb93e 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 b425cd3d183..698f980eb44 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 0b8411a864f..e88d2fba156 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 f9fa4142551..eef63e3630c 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 0737a596db4..9edf5625584 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/generic.c b/arch/i386/kernel/cpu/mtrr/generic.c
index 5367e32e040..c4ebb5126ef 100644
--- a/arch/i386/kernel/cpu/mtrr/generic.c
+++ b/arch/i386/kernel/cpu/mtrr/generic.c
@@ -78,7 +78,7 @@ static void __cpuinit print_fixed(unsigned base, unsigned step, const mtrr_type*
78} 78}
79 79
80/* Grab all of the MTRR state for this CPU into *state */ 80/* Grab all of the MTRR state for this CPU into *state */
81void __init get_mtrr_state(void) 81void get_mtrr_state(void)
82{ 82{
83 unsigned int i; 83 unsigned int i;
84 struct mtrr_var_range *vrs; 84 struct mtrr_var_range *vrs;
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c
index 02a2f39e5e0..1cf466df330 100644
--- a/arch/i386/kernel/cpu/mtrr/main.c
+++ b/arch/i386/kernel/cpu/mtrr/main.c
@@ -639,7 +639,7 @@ static struct sysdev_driver mtrr_sysdev_driver = {
639 * initialized (i.e. before smp_init()). 639 * initialized (i.e. before smp_init()).
640 * 640 *
641 */ 641 */
642void __init mtrr_bp_init(void) 642void mtrr_bp_init(void)
643{ 643{
644 init_ifs(); 644 init_ifs();
645 645
diff --git a/arch/i386/kernel/cpu/mtrr/state.c b/arch/i386/kernel/cpu/mtrr/state.c
index f62ecd15811..7b39a2f954d 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/smp.c b/arch/i386/kernel/smp.c
index c9a7c9835ab..6299c080f6e 100644
--- a/arch/i386/kernel/smp.c
+++ b/arch/i386/kernel/smp.c
@@ -421,7 +421,7 @@ void flush_tlb_mm (struct mm_struct * mm)
421 } 421 }
422 if (!cpus_empty(cpu_mask)) 422 if (!cpus_empty(cpu_mask))
423 flush_tlb_others(cpu_mask, mm, TLB_FLUSH_ALL); 423 flush_tlb_others(cpu_mask, mm, TLB_FLUSH_ALL);
424 check_pgt_cache(); 424
425 preempt_enable(); 425 preempt_enable();
426} 426}
427 427
diff --git a/arch/i386/kernel/verify_cpu.S b/arch/i386/kernel/verify_cpu.S
index b2a9d80b642..f1d1eacf4ab 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/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S
index 80bec664023..aa87b06c7c8 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 e932d3485ae..58a477baec3 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 e4730a1a43d..552e0847375 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 8e185208dfd..a7c0783b269 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
@@ -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,13 @@ 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 cpu_msrs[cpu] = cpu_msrs[0];
216 }
210 on_each_cpu(nmi_save_registers, NULL, 0, 1); 217 on_each_cpu(nmi_save_registers, NULL, 0, 1);
211 on_each_cpu(nmi_cpu_setup, NULL, 0, 1); 218 on_each_cpu(nmi_cpu_setup, NULL, 0, 1);
212 nmi_enabled = 1; 219 nmi_enabled = 1;
diff --git a/arch/ia64/kernel/acpi-processor.c b/arch/ia64/kernel/acpi-processor.c
index 4d4993a47e5..5a216c01992 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 3549c94467b..103dd8edda7 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;
@@ -791,7 +792,7 @@ static __init int setup_additional_cpus(char *s)
791early_param("additional_cpus", setup_additional_cpus); 792early_param("additional_cpus", setup_additional_cpus);
792 793
793/* 794/*
794 * cpu_possible_map should be static, it cannot change as cpu's 795 * cpu_possible_map should be static, it cannot change as CPUs
795 * are onlined, or offlined. The reason is per-cpu data-structures 796 * are onlined, or offlined. The reason is per-cpu data-structures
796 * are allocated by some modules at init time, and dont expect to 797 * are allocated by some modules at init time, and dont expect to
797 * do this dynamically on cpu arrival/departure. 798 * do this dynamically on cpu arrival/departure.
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index aeb79fb28f0..1d64ef478dd 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -156,24 +156,30 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)
156 if (!kdump_on_init) 156 if (!kdump_on_init)
157 return NOTIFY_DONE; 157 return NOTIFY_DONE;
158 158
159 if (val != DIE_INIT_MONARCH_ENTER && 159 if (val != DIE_INIT_MONARCH_LEAVE &&
160 val != DIE_INIT_SLAVE_ENTER && 160 val != DIE_INIT_SLAVE_LEAVE &&
161 val != DIE_INIT_MONARCH_PROCESS &&
161 val != DIE_MCA_RENDZVOUS_LEAVE && 162 val != DIE_MCA_RENDZVOUS_LEAVE &&
162 val != DIE_MCA_MONARCH_LEAVE) 163 val != DIE_MCA_MONARCH_LEAVE)
163 return NOTIFY_DONE; 164 return NOTIFY_DONE;
164 165
165 nd = (struct ia64_mca_notify_die *)args->err; 166 nd = (struct ia64_mca_notify_die *)args->err;
166 /* Reason code 1 means machine check rendezous*/ 167 /* Reason code 1 means machine check rendezvous*/
167 if ((val == DIE_INIT_MONARCH_ENTER || val == DIE_INIT_SLAVE_ENTER) && 168 if ((val == DIE_INIT_MONARCH_LEAVE || val == DIE_INIT_SLAVE_LEAVE
168 nd->sos->rv_rc == 1) 169 || val == DIE_INIT_MONARCH_PROCESS) && nd->sos->rv_rc == 1)
169 return NOTIFY_DONE; 170 return NOTIFY_DONE;
170 171
171 switch (val) { 172 switch (val) {
172 case DIE_INIT_MONARCH_ENTER: 173 case DIE_INIT_MONARCH_PROCESS:
174 atomic_set(&kdump_in_progress, 1);
175 *(nd->monarch_cpu) = -1;
176 break;
177 case DIE_INIT_MONARCH_LEAVE:
173 machine_kdump_on_init(); 178 machine_kdump_on_init();
174 break; 179 break;
175 case DIE_INIT_SLAVE_ENTER: 180 case DIE_INIT_SLAVE_LEAVE:
176 unw_init_running(kdump_cpu_freeze, NULL); 181 if (atomic_read(&kdump_in_progress))
182 unw_init_running(kdump_cpu_freeze, NULL);
177 break; 183 break;
178 case DIE_MCA_RENDZVOUS_LEAVE: 184 case DIE_MCA_RENDZVOUS_LEAVE:
179 if (atomic_read(&kdump_in_progress)) 185 if (atomic_read(&kdump_in_progress))
@@ -215,8 +221,10 @@ static ctl_table sys_table[] = {
215static int 221static int
216machine_crash_setup(void) 222machine_crash_setup(void)
217{ 223{
224 /* be notified before default_monarch_init_process */
218 static struct notifier_block kdump_init_notifier_nb = { 225 static struct notifier_block kdump_init_notifier_nb = {
219 .notifier_call = kdump_init_notifier, 226 .notifier_call = kdump_init_notifier,
227 .priority = 1,
220 }; 228 };
221 int ret; 229 int ret;
222 if((ret = register_die_notifier(&kdump_init_notifier_nb)) != 0) 230 if((ret = register_die_notifier(&kdump_init_notifier_nb)) != 0)
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 144b056282a..95f51751523 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1585,5 +1585,8 @@ sys_call_table:
1585 data8 sys_getcpu 1585 data8 sys_getcpu
1586 data8 sys_epoll_pwait // 1305 1586 data8 sys_epoll_pwait // 1305
1587 data8 sys_utimensat 1587 data8 sys_utimensat
1588 data8 sys_signalfd
1589 data8 sys_timerfd
1590 data8 sys_eventfd
1588 1591
1589 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls 1592 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index b4c239685d2..407b4587048 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -4,7 +4,7 @@
4 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar 4 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
5 * 5 *
6 * This file contains the code used by various IRQ handling routines: 6 * This file contains the code used by various IRQ handling routines:
7 * asking for different IRQ's should be done through these routines 7 * asking for different IRQs should be done through these routines
8 * instead of just grabbing them. Thus setups with different IRQ numbers 8 * instead of just grabbing them. Thus setups with different IRQ numbers
9 * shouldn't result in any weird surprises, and installing new handlers 9 * shouldn't result in any weird surprises, and installing new handlers
10 * should be easier. 10 * should be easier.
@@ -12,7 +12,7 @@
12 * Copyright (C) Ashok Raj<ashok.raj@intel.com>, Intel Corporation 2004 12 * Copyright (C) Ashok Raj<ashok.raj@intel.com>, Intel Corporation 2004
13 * 13 *
14 * 4/14/2004: Added code to handle cpu migration and do safe irq 14 * 4/14/2004: Added code to handle cpu migration and do safe irq
15 * migration without lossing interrupts for iosapic 15 * migration without losing interrupts for iosapic
16 * architecture. 16 * architecture.
17 */ 17 */
18 18
@@ -190,7 +190,7 @@ void fixup_irqs(void)
190 } 190 }
191 191
192 /* 192 /*
193 * Phase 1: Locate irq's bound to this cpu and 193 * Phase 1: Locate IRQs bound to this cpu and
194 * relocate them for cpu removal. 194 * relocate them for cpu removal.
195 */ 195 */
196 migrate_irqs(); 196 migrate_irqs();
diff --git a/arch/ia64/kernel/irq_lsapic.c b/arch/ia64/kernel/irq_lsapic.c
index c2f07beb175..e56a7a36aca 100644
--- a/arch/ia64/kernel/irq_lsapic.c
+++ b/arch/ia64/kernel/irq_lsapic.c
@@ -23,7 +23,7 @@ lsapic_noop_startup (unsigned int irq)
23static void 23static void
24lsapic_noop (unsigned int irq) 24lsapic_noop (unsigned int irq)
25{ 25{
26 /* nuthing to do... */ 26 /* nothing to do... */
27} 27}
28 28
29static int lsapic_retrigger(unsigned int irq) 29static int lsapic_retrigger(unsigned int irq)
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 72e593e9405..5bc46f15134 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -151,12 +151,12 @@ static uint __kprobes is_cmp_ctype_unc_inst(uint template, uint slot,
151 151
152 cmp_inst.l = kprobe_inst; 152 cmp_inst.l = kprobe_inst;
153 if ((cmp_inst.f.x2 == 0) || (cmp_inst.f.x2 == 1)) { 153 if ((cmp_inst.f.x2 == 0) || (cmp_inst.f.x2 == 1)) {
154 /* Integere compare - Register Register (A6 type)*/ 154 /* Integer compare - Register Register (A6 type)*/
155 if ((cmp_inst.f.tb == 0) && (cmp_inst.f.ta == 0) 155 if ((cmp_inst.f.tb == 0) && (cmp_inst.f.ta == 0)
156 &&(cmp_inst.f.c == 1)) 156 &&(cmp_inst.f.c == 1))
157 ctype_unc = 1; 157 ctype_unc = 1;
158 } else if ((cmp_inst.f.x2 == 2)||(cmp_inst.f.x2 == 3)) { 158 } else if ((cmp_inst.f.x2 == 2)||(cmp_inst.f.x2 == 3)) {
159 /* Integere compare - Immediate Register (A8 type)*/ 159 /* Integer compare - Immediate Register (A8 type)*/
160 if ((cmp_inst.f.ta == 0) &&(cmp_inst.f.c == 1)) 160 if ((cmp_inst.f.ta == 0) &&(cmp_inst.f.c == 1))
161 ctype_unc = 1; 161 ctype_unc = 1;
162 } 162 }
@@ -820,7 +820,7 @@ out:
820 return 1; 820 return 1;
821} 821}
822 822
823static int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr) 823int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr)
824{ 824{
825 struct kprobe *cur = kprobe_running(); 825 struct kprobe *cur = kprobe_running();
826 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 826 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
@@ -904,13 +904,6 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
904 if (post_kprobes_handler(args->regs)) 904 if (post_kprobes_handler(args->regs))
905 ret = NOTIFY_STOP; 905 ret = NOTIFY_STOP;
906 break; 906 break;
907 case DIE_PAGE_FAULT:
908 /* kprobe_running() needs smp_processor_id() */
909 preempt_disable();
910 if (kprobe_running() &&
911 kprobes_fault_handler(args->regs, args->trapnr))
912 ret = NOTIFY_STOP;
913 preempt_enable();
914 default: 907 default:
915 break; 908 break;
916 } 909 }
@@ -954,7 +947,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
954 /* 947 /*
955 * Callee owns the argument space and could overwrite it, eg 948 * Callee owns the argument space and could overwrite it, eg
956 * tail call optimization. So to be absolutely safe 949 * tail call optimization. So to be absolutely safe
957 * we save the argument space before transfering the control 950 * we save the argument space before transferring the control
958 * to instrumented jprobe function which runs in 951 * to instrumented jprobe function which runs in
959 * the process context 952 * the process context
960 */ 953 */
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 26814de6c29..1ead5ea6c5c 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -273,7 +273,6 @@ static void ia64_mlogbuf_finish(int wait)
273 273
274 mlogbuf_finished = 1; 274 mlogbuf_finished = 1;
275} 275}
276EXPORT_SYMBOL(ia64_mlogbuf_finish);
277 276
278/* 277/*
279 * Print buffered messages from INIT context. 278 * Print buffered messages from INIT context.
@@ -1477,6 +1476,10 @@ default_monarch_init_process(struct notifier_block *self, unsigned long val, voi
1477 struct task_struct *g, *t; 1476 struct task_struct *g, *t;
1478 if (val != DIE_INIT_MONARCH_PROCESS) 1477 if (val != DIE_INIT_MONARCH_PROCESS)
1479 return NOTIFY_DONE; 1478 return NOTIFY_DONE;
1479#ifdef CONFIG_KEXEC
1480 if (atomic_read(&kdump_in_progress))
1481 return NOTIFY_DONE;
1482#endif
1480 1483
1481 /* 1484 /*
1482 * FIXME: mlogbuf will brim over with INIT stack dumps. 1485 * FIXME: mlogbuf will brim over with INIT stack dumps.
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index 70b8bdbb7e6..aba813c2c15 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -438,7 +438,7 @@ is_mca_global(peidx_table_t *peidx, pal_bus_check_info_t *pbci,
438 * @peidx: pointer of index of processor error section 438 * @peidx: pointer of index of processor error section
439 * 439 *
440 * Return value: 440 * Return value:
441 * target address on Success / 0 on Failue 441 * target address on Success / 0 on Failure
442 */ 442 */
443static u64 443static u64
444get_target_identifier(peidx_table_t *peidx) 444get_target_identifier(peidx_table_t *peidx)
@@ -701,7 +701,7 @@ recover_from_processor_error(int platform, slidx_table_t *slidx,
701 return fatal_mca("External bus check fatal status"); 701 return fatal_mca("External bus check fatal status");
702 702
703 /* 703 /*
704 * This is a local MCA and estimated as a recoverble error. 704 * This is a local MCA and estimated as a recoverable error.
705 */ 705 */
706 if (platform) 706 if (platform)
707 return recover_from_platform_error(slidx, peidx, pbci, sos); 707 return recover_from_platform_error(slidx, peidx, pbci, sos);
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index 158e3c51bb7..196287928ba 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -861,7 +861,7 @@ apply_relocate (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symindex,
861/* 861/*
862 * Modules contain a single unwind table which covers both the core and the init text 862 * Modules contain a single unwind table which covers both the core and the init text
863 * sections but since the two are not contiguous, we need to split this table up such that 863 * sections but since the two are not contiguous, we need to split this table up such that
864 * we can register (and unregister) each "segment" seperately. Fortunately, this sounds 864 * we can register (and unregister) each "segment" separately. Fortunately, this sounds
865 * more complicated than it really is. 865 * more complicated than it really is.
866 */ 866 */
867static void 867static void
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index e7191ca30b1..b7133cabdbe 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -1318,7 +1318,7 @@ pfm_reserve_session(struct task_struct *task, int is_syswide, unsigned int cpu)
1318{ 1318{
1319 unsigned long flags; 1319 unsigned long flags;
1320 /* 1320 /*
1321 * validy checks on cpu_mask have been done upstream 1321 * validity checks on cpu_mask have been done upstream
1322 */ 1322 */
1323 LOCK_PFS(flags); 1323 LOCK_PFS(flags);
1324 1324
@@ -1384,7 +1384,7 @@ pfm_unreserve_session(pfm_context_t *ctx, int is_syswide, unsigned int cpu)
1384{ 1384{
1385 unsigned long flags; 1385 unsigned long flags;
1386 /* 1386 /*
1387 * validy checks on cpu_mask have been done upstream 1387 * validity checks on cpu_mask have been done upstream
1388 */ 1388 */
1389 LOCK_PFS(flags); 1389 LOCK_PFS(flags);
1390 1390
@@ -1835,7 +1835,7 @@ pfm_flush(struct file *filp, fl_owner_t id)
1835 /* 1835 /*
1836 * remove our file from the async queue, if we use this mode. 1836 * remove our file from the async queue, if we use this mode.
1837 * This can be done without the context being protected. We come 1837 * This can be done without the context being protected. We come
1838 * here when the context has become unreacheable by other tasks. 1838 * here when the context has become unreachable by other tasks.
1839 * 1839 *
1840 * We may still have active monitoring at this point and we may 1840 * We may still have active monitoring at this point and we may
1841 * end up in pfm_overflow_handler(). However, fasync_helper() 1841 * end up in pfm_overflow_handler(). However, fasync_helper()
@@ -2132,7 +2132,7 @@ doit:
2132 filp->private_data = NULL; 2132 filp->private_data = NULL;
2133 2133
2134 /* 2134 /*
2135 * if we free on the spot, the context is now completely unreacheable 2135 * if we free on the spot, the context is now completely unreachable
2136 * from the callers side. The monitored task side is also cut, so we 2136 * from the callers side. The monitored task side is also cut, so we
2137 * can freely cut. 2137 * can freely cut.
2138 * 2138 *
@@ -2562,7 +2562,7 @@ pfm_reset_pmu_state(pfm_context_t *ctx)
2562 ctx->ctx_all_pmcs[0] = pmu_conf->impl_pmcs[0] & ~0x1; 2562 ctx->ctx_all_pmcs[0] = pmu_conf->impl_pmcs[0] & ~0x1;
2563 2563
2564 /* 2564 /*
2565 * bitmask of all PMDs that are accesible to this context 2565 * bitmask of all PMDs that are accessible to this context
2566 */ 2566 */
2567 ctx->ctx_all_pmds[0] = pmu_conf->impl_pmds[0]; 2567 ctx->ctx_all_pmds[0] = pmu_conf->impl_pmds[0];
2568 2568
@@ -3395,7 +3395,7 @@ pfm_read_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
3395 if (unlikely(!PMD_IS_IMPL(cnum))) goto error; 3395 if (unlikely(!PMD_IS_IMPL(cnum))) goto error;
3396 /* 3396 /*
3397 * we can only read the register that we use. That includes 3397 * we can only read the register that we use. That includes
3398 * the one we explicitely initialize AND the one we want included 3398 * the one we explicitly initialize AND the one we want included
3399 * in the sampling buffer (smpl_regs). 3399 * in the sampling buffer (smpl_regs).
3400 * 3400 *
3401 * Having this restriction allows optimization in the ctxsw routine 3401 * Having this restriction allows optimization in the ctxsw routine
@@ -3715,7 +3715,7 @@ pfm_restart(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
3715 * if non-blocking, then we ensure that the task will go into 3715 * if non-blocking, then we ensure that the task will go into
3716 * pfm_handle_work() before returning to user mode. 3716 * pfm_handle_work() before returning to user mode.
3717 * 3717 *
3718 * We cannot explicitely reset another task, it MUST always 3718 * We cannot explicitly reset another task, it MUST always
3719 * be done by the task itself. This works for system wide because 3719 * be done by the task itself. This works for system wide because
3720 * the tool that is controlling the session is logically doing 3720 * the tool that is controlling the session is logically doing
3721 * "self-monitoring". 3721 * "self-monitoring".
@@ -4644,7 +4644,7 @@ pfm_exit_thread(struct task_struct *task)
4644 switch(state) { 4644 switch(state) {
4645 case PFM_CTX_UNLOADED: 4645 case PFM_CTX_UNLOADED:
4646 /* 4646 /*
4647 * only comes to thios function if pfm_context is not NULL, i.e., cannot 4647 * only comes to this function if pfm_context is not NULL, i.e., cannot
4648 * be in unloaded state 4648 * be in unloaded state
4649 */ 4649 */
4650 printk(KERN_ERR "perfmon: pfm_exit_thread [%d] ctx unloaded\n", task->pid); 4650 printk(KERN_ERR "perfmon: pfm_exit_thread [%d] ctx unloaded\n", task->pid);
@@ -5247,7 +5247,7 @@ pfm_end_notify_user(pfm_context_t *ctx)
5247 5247
5248/* 5248/*
5249 * main overflow processing routine. 5249 * main overflow processing routine.
5250 * it can be called from the interrupt path or explicitely during the context switch code 5250 * it can be called from the interrupt path or explicitly during the context switch code
5251 */ 5251 */
5252static void 5252static void
5253pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, struct pt_regs *regs) 5253pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, struct pt_regs *regs)
diff --git a/arch/ia64/kernel/perfmon_mckinley.h b/arch/ia64/kernel/perfmon_mckinley.h
index 9becccda289..c4bec7a9d18 100644
--- a/arch/ia64/kernel/perfmon_mckinley.h
+++ b/arch/ia64/kernel/perfmon_mckinley.h
@@ -181,7 +181,7 @@ static pmu_config_t pmu_conf_mck={
181 .pmc_desc = pfm_mck_pmc_desc, 181 .pmc_desc = pfm_mck_pmc_desc,
182 .num_ibrs = 8, 182 .num_ibrs = 8,
183 .num_dbrs = 8, 183 .num_dbrs = 8,
184 .use_rr_dbregs = 1 /* debug register are use for range retrictions */ 184 .use_rr_dbregs = 1 /* debug register are use for range restrictions */
185}; 185};
186 186
187 187
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index d1c3ed9943e..af73b8dfde2 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/sal.c b/arch/ia64/kernel/sal.c
index 37c876f95db..27c2ef445a5 100644
--- a/arch/ia64/kernel/sal.c
+++ b/arch/ia64/kernel/sal.c
@@ -134,7 +134,7 @@ set_smp_redirect (int flag)
134 * interrupt redirection. The reason is this would require that 134 * interrupt redirection. The reason is this would require that
135 * All interrupts be stopped and hard bind the irq to a cpu. 135 * All interrupts be stopped and hard bind the irq to a cpu.
136 * Later when the interrupt is fired we need to set the redir hint 136 * Later when the interrupt is fired we need to set the redir hint
137 * on again in the vector. This is combersome for something that the 137 * on again in the vector. This is cumbersome for something that the
138 * user mode irq balancer will solve anyways. 138 * user mode irq balancer will solve anyways.
139 */ 139 */
140 no_int_routing=1; 140 no_int_routing=1;
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index 89f6b138a62..25cd75f50ab 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -162,7 +162,7 @@ static DEFINE_SPINLOCK(data_saved_lock);
162/** salinfo_platform_oemdata - optional callback to decode oemdata from an error 162/** salinfo_platform_oemdata - optional callback to decode oemdata from an error
163 * record. 163 * record.
164 * @sect_header: pointer to the start of the section to decode. 164 * @sect_header: pointer to the start of the section to decode.
165 * @oemdata: returns vmalloc area containing the decded output. 165 * @oemdata: returns vmalloc area containing the decoded output.
166 * @oemdata_size: returns length of decoded output (strlen). 166 * @oemdata_size: returns length of decoded output (strlen).
167 * 167 *
168 * Description: If user space asks for oem data to be decoded by the kernel 168 * Description: If user space asks for oem data to be decoded by the kernel
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 9df1efe7487..eaa6a24bc0b 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -576,7 +576,7 @@ setup_arch (char **cmdline_p)
576} 576}
577 577
578/* 578/*
579 * Display cpu info for all cpu's. 579 * Display cpu info for all CPUs.
580 */ 580 */
581static int 581static int
582show_cpuinfo (struct seq_file *m, void *v) 582show_cpuinfo (struct seq_file *m, void *v)
@@ -761,7 +761,7 @@ identify_cpu (struct cpuinfo_ia64 *c)
761 c->cpu = smp_processor_id(); 761 c->cpu = smp_processor_id();
762 762
763 /* below default values will be overwritten by identify_siblings() 763 /* below default values will be overwritten by identify_siblings()
764 * for Multi-Threading/Multi-Core capable cpu's 764 * for Multi-Threading/Multi-Core capable CPUs
765 */ 765 */
766 c->threads_per_core = c->cores_per_socket = c->num_log = 1; 766 c->threads_per_core = c->cores_per_socket = c->num_log = 1;
767 c->socket_id = -1; 767 c->socket_id = -1;
@@ -947,7 +947,7 @@ cpu_init (void)
947 ia32_cpu_init(); 947 ia32_cpu_init();
948#endif 948#endif
949 949
950 /* Clear ITC to eliminiate sched_clock() overflows in human time. */ 950 /* Clear ITC to eliminate sched_clock() overflows in human time. */
951 ia64_set_itc(0); 951 ia64_set_itc(0);
952 952
953 /* disable all local interrupt sources: */ 953 /* disable all local interrupt sources: */
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index 221de380456..b3a47f986e1 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -186,7 +186,7 @@ handle_IPI (int irq, void *dev_id)
186} 186}
187 187
188/* 188/*
189 * Called with preeemption disabled. 189 * Called with preemption disabled.
190 */ 190 */
191static inline void 191static inline void
192send_IPI_single (int dest_cpu, int op) 192send_IPI_single (int dest_cpu, int op)
@@ -196,7 +196,7 @@ send_IPI_single (int dest_cpu, int op)
196} 196}
197 197
198/* 198/*
199 * Called with preeemption disabled. 199 * Called with preemption disabled.
200 */ 200 */
201static inline void 201static inline void
202send_IPI_allbutself (int op) 202send_IPI_allbutself (int op)
@@ -210,7 +210,7 @@ send_IPI_allbutself (int op)
210} 210}
211 211
212/* 212/*
213 * Called with preeemption disabled. 213 * Called with preemption disabled.
214 */ 214 */
215static inline void 215static inline void
216send_IPI_all (int op) 216send_IPI_all (int op)
@@ -223,7 +223,7 @@ send_IPI_all (int op)
223} 223}
224 224
225/* 225/*
226 * Called with preeemption disabled. 226 * Called with preemption disabled.
227 */ 227 */
228static inline void 228static inline void
229send_IPI_self (int op) 229send_IPI_self (int op)
@@ -252,7 +252,7 @@ kdump_smp_send_init(void)
252} 252}
253#endif 253#endif
254/* 254/*
255 * Called with preeemption disabled. 255 * Called with preemption disabled.
256 */ 256 */
257void 257void
258smp_send_reschedule (int cpu) 258smp_send_reschedule (int cpu)
@@ -261,7 +261,7 @@ smp_send_reschedule (int cpu)
261} 261}
262 262
263/* 263/*
264 * Called with preeemption disabled. 264 * Called with preemption disabled.
265 */ 265 */
266static void 266static void
267smp_send_local_flush_tlb (int cpu) 267smp_send_local_flush_tlb (int cpu)
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index a44792d0f3a..3c9d8e6089c 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 */
@@ -694,7 +694,7 @@ int migrate_platform_irqs(unsigned int cpu)
694 set_cpei_target_cpu(new_cpei_cpu); 694 set_cpei_target_cpu(new_cpei_cpu);
695 desc = irq_desc + ia64_cpe_irq; 695 desc = irq_desc + ia64_cpe_irq;
696 /* 696 /*
697 * Switch for now, immediatly, we need to do fake intr 697 * Switch for now, immediately, we need to do fake intr
698 * as other interrupts, but need to study CPEI behaviour with 698 * as other interrupts, but need to study CPEI behaviour with
699 * polling before making changes. 699 * polling before making changes.
700 */ 700 */
@@ -840,7 +840,7 @@ __cpu_up (unsigned int cpu)
840} 840}
841 841
842/* 842/*
843 * Assume that CPU's have been discovered by some platform-dependent interface. For 843 * Assume that CPUs have been discovered by some platform-dependent interface. For
844 * SoftSDV/Lion, that would be ACPI. 844 * SoftSDV/Lion, that would be ACPI.
845 * 845 *
846 * Setup of the IPI irq handler is done in irq.c:init_IRQ_SMP(). 846 * Setup of the IPI irq handler is done in irq.c:init_IRQ_SMP().
@@ -854,7 +854,7 @@ init_smp_config(void)
854 } *ap_startup; 854 } *ap_startup;
855 long sal_ret; 855 long sal_ret;
856 856
857 /* Tell SAL where to drop the AP's. */ 857 /* Tell SAL where to drop the APs. */
858 ap_startup = (struct fptr *) start_ap; 858 ap_startup = (struct fptr *) start_ap;
859 sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ, 859 sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ,
860 ia64_tpa(ap_startup->fp), ia64_tpa(ap_startup->gp), 0, 0, 0, 0); 860 ia64_tpa(ap_startup->fp), ia64_tpa(ap_startup->gp), 0, 0, 0, 0);
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index b8e0d70bf98..15ad85da15a 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -304,7 +304,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
304 * Lower 4 bits are used as a count. Upper bits are a sequence 304 * Lower 4 bits are used as a count. Upper bits are a sequence
305 * number that is updated when count is reset. The cmpxchg will 305 * number that is updated when count is reset. The cmpxchg will
306 * fail is seqno has changed. This minimizes mutiple cpus 306 * fail is seqno has changed. This minimizes mutiple cpus
307 * reseting the count. 307 * resetting the count.
308 */ 308 */
309 if (current_jiffies > last.time) 309 if (current_jiffies > last.time)
310 (void) cmpxchg_acq(&last.count, count, 16 + (count & ~15)); 310 (void) cmpxchg_acq(&last.count, count, 16 + (count & ~15));
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c
index fe1426266b9..b0b08b5f3ec 100644
--- a/arch/ia64/kernel/unwind.c
+++ b/arch/ia64/kernel/unwind.c
@@ -2,7 +2,7 @@
2 * Copyright (C) 1999-2004 Hewlett-Packard Co 2 * Copyright (C) 1999-2004 Hewlett-Packard Co
3 * David Mosberger-Tang <davidm@hpl.hp.com> 3 * David Mosberger-Tang <davidm@hpl.hp.com>
4 * Copyright (C) 2003 Fenghua Yu <fenghua.yu@intel.com> 4 * Copyright (C) 2003 Fenghua Yu <fenghua.yu@intel.com>
5 * - Change pt_regs_off() to make it less dependant on pt_regs structure. 5 * - Change pt_regs_off() to make it less dependent on pt_regs structure.
6 */ 6 */
7/* 7/*
8 * This file implements call frame unwind support for the Linux 8 * This file implements call frame unwind support for the Linux
@@ -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 69238264211..5a65965c8b5 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/mm/discontig.c b/arch/ia64/mm/discontig.c
index 38085ac1833..0dbf0e81f8c 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -317,7 +317,7 @@ static void __meminit scatter_node_data(void)
317 * node_online_map is not set for hot-added nodes at this time, 317 * node_online_map is not set for hot-added nodes at this time,
318 * because we are halfway through initialization of the new node's 318 * because we are halfway through initialization of the new node's
319 * structures. If for_each_online_node() is used, a new node's 319 * structures. If for_each_online_node() is used, a new node's
320 * pg_data_ptrs will be not initialized. Insted of using it, 320 * pg_data_ptrs will be not initialized. Instead of using it,
321 * pgdat_list[] is checked. 321 * pgdat_list[] is checked.
322 */ 322 */
323 for_each_node(node) { 323 for_each_node(node) {
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
index 21658e02116..b87f785c241 100644
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -19,36 +19,24 @@
19extern void die (char *, struct pt_regs *, long); 19extern void die (char *, struct pt_regs *, long);
20 20
21#ifdef CONFIG_KPROBES 21#ifdef CONFIG_KPROBES
22ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); 22static inline int notify_page_fault(struct pt_regs *regs, int trap)
23
24/* Hook to register for page fault notifications */
25int register_page_fault_notifier(struct notifier_block *nb)
26{
27 return atomic_notifier_chain_register(&notify_page_fault_chain, nb);
28}
29
30int unregister_page_fault_notifier(struct notifier_block *nb)
31{ 23{
32 return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb); 24 int ret = 0;
33} 25
26 if (!user_mode(regs)) {
27 /* kprobe_running() needs smp_processor_id() */
28 preempt_disable();
29 if (kprobe_running() && kprobes_fault_handler(regs, trap))
30 ret = 1;
31 preempt_enable();
32 }
34 33
35static inline int notify_page_fault(enum die_val val, const char *str, 34 return ret;
36 struct pt_regs *regs, long err, int trap, int sig)
37{
38 struct die_args args = {
39 .regs = regs,
40 .str = str,
41 .err = err,
42 .trapnr = trap,
43 .signr = sig
44 };
45 return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
46} 35}
47#else 36#else
48static inline int notify_page_fault(enum die_val val, const char *str, 37static inline int notify_page_fault(struct pt_regs *regs, int trap)
49 struct pt_regs *regs, long err, int trap, int sig)
50{ 38{
51 return NOTIFY_DONE; 39 return 0;
52} 40}
53#endif 41#endif
54 42
@@ -117,8 +105,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
117 /* 105 /*
118 * This is to handle the kprobes on user space access instructions 106 * This is to handle the kprobes on user space access instructions
119 */ 107 */
120 if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT, 108 if (notify_page_fault(regs, TRAP_BRKPT))
121 SIGSEGV) == NOTIFY_STOP)
122 return; 109 return;
123 110
124 down_read(&mm->mmap_sem); 111 down_read(&mm->mmap_sem);
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 3549f3b4259..73696b4a2ee 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/bte.c b/arch/ia64/sn/kernel/bte.c
index ff1c5560117..b362d6d6a8c 100644
--- a/arch/ia64/sn/kernel/bte.c
+++ b/arch/ia64/sn/kernel/bte.c
@@ -63,7 +63,7 @@ static inline void bte_start_transfer(struct bteinfo_s *bte, u64 len, u64 mode)
63 * Use the block transfer engine to move kernel memory from src to dest 63 * Use the block transfer engine to move kernel memory from src to dest
64 * using the assigned mode. 64 * using the assigned mode.
65 * 65 *
66 * Paramaters: 66 * Parameters:
67 * src - physical address of the transfer source. 67 * src - physical address of the transfer source.
68 * dest - physical address of the transfer destination. 68 * dest - physical address of the transfer destination.
69 * len - number of bytes to transfer from source to dest. 69 * len - number of bytes to transfer from source to dest.
@@ -247,7 +247,7 @@ EXPORT_SYMBOL(bte_copy);
247 * use the block transfer engine to move kernel 247 * use the block transfer engine to move kernel
248 * memory from src to dest using the assigned mode. 248 * memory from src to dest using the assigned mode.
249 * 249 *
250 * Paramaters: 250 * Parameters:
251 * src - physical address of the transfer source. 251 * src - physical address of the transfer source.
252 * dest - physical address of the transfer destination. 252 * dest - physical address of the transfer destination.
253 * len - number of bytes to transfer from source to dest. 253 * len - number of bytes to transfer from source to dest.
@@ -255,7 +255,7 @@ EXPORT_SYMBOL(bte_copy);
255 * for IBCT0/1 in the SGI documentation. 255 * for IBCT0/1 in the SGI documentation.
256 * 256 *
257 * NOTE: If the source, dest, and len are all cache line aligned, 257 * NOTE: If the source, dest, and len are all cache line aligned,
258 * then it would be _FAR_ preferrable to use bte_copy instead. 258 * then it would be _FAR_ preferable to use bte_copy instead.
259 */ 259 */
260bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode) 260bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
261{ 261{
@@ -300,7 +300,7 @@ bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
300 * a standard bte copy. 300 * a standard bte copy.
301 * 301 *
302 * One nasty exception to the above rule is when the 302 * One nasty exception to the above rule is when the
303 * source and destination are not symetrically 303 * source and destination are not symmetrically
304 * mis-aligned. If the source offset from the first 304 * mis-aligned. If the source offset from the first
305 * cache line is different from the destination offset, 305 * cache line is different from the destination offset,
306 * we make the first section be the entire transfer 306 * we make the first section be the entire transfer
@@ -337,7 +337,7 @@ bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
337 337
338 if (footBcopyDest == (headBcopyDest + headBcopyLen)) { 338 if (footBcopyDest == (headBcopyDest + headBcopyLen)) {
339 /* 339 /*
340 * We have two contigous bcopy 340 * We have two contiguous bcopy
341 * blocks. Merge them. 341 * blocks. Merge them.
342 */ 342 */
343 headBcopyLen += footBcopyLen; 343 headBcopyLen += footBcopyLen;
@@ -375,7 +375,7 @@ bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
375 } else { 375 } else {
376 376
377 /* 377 /*
378 * The transfer is not symetric, we will 378 * The transfer is not symmetric, we will
379 * allocate a buffer large enough for all the 379 * allocate a buffer large enough for all the
380 * data, bte_copy into that buffer and then 380 * data, bte_copy into that buffer and then
381 * bcopy to the destination. 381 * bcopy to the destination.
diff --git a/arch/ia64/sn/kernel/bte_error.c b/arch/ia64/sn/kernel/bte_error.c
index b6fcf8164f2..27c5936ccfe 100644
--- a/arch/ia64/sn/kernel/bte_error.c
+++ b/arch/ia64/sn/kernel/bte_error.c
@@ -105,7 +105,7 @@ int shub1_bte_error_handler(unsigned long _nodepda)
105 } 105 }
106 106
107 BTE_PRINTK(("eh:%p:%d Cleaning up\n", err_nodepda, smp_processor_id())); 107 BTE_PRINTK(("eh:%p:%d Cleaning up\n", err_nodepda, smp_processor_id()));
108 /* Reenable both bte interfaces */ 108 /* Re-enable both bte interfaces */
109 imem.ii_imem_regval = REMOTE_HUB_L(nasid, IIO_IMEM); 109 imem.ii_imem_regval = REMOTE_HUB_L(nasid, IIO_IMEM);
110 imem.ii_imem_fld_s.i_b0_esd = imem.ii_imem_fld_s.i_b1_esd = 1; 110 imem.ii_imem_fld_s.i_b0_esd = imem.ii_imem_fld_s.i_b1_esd = 1;
111 REMOTE_HUB_S(nasid, IIO_IMEM, imem.ii_imem_regval); 111 REMOTE_HUB_S(nasid, IIO_IMEM, imem.ii_imem_regval);
@@ -243,7 +243,7 @@ bte_crb_error_handler(cnodeid_t cnode, int btenum,
243 243
244 /* 244 /*
245 * The caller has already figured out the error type, we save that 245 * The caller has already figured out the error type, we save that
246 * in the bte handle structure for the thread excercising the 246 * in the bte handle structure for the thread exercising the
247 * interface to consume. 247 * interface to consume.
248 */ 248 */
249 bte->bh_error = ioe->ie_errortype + BTEFAIL_OFFSET; 249 bte->bh_error = ioe->ie_errortype + BTEFAIL_OFFSET;
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index 7ed72d3faf7..787ed642dd4 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -479,7 +479,7 @@ sn_io_early_init(void)
479 } 479 }
480 480
481 /* 481 /*
482 * prime sn_pci_provider[]. Individial provider init routines will 482 * prime sn_pci_provider[]. Individual provider init routines will
483 * override their respective default entries. 483 * override their respective default entries.
484 */ 484 */
485 485
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index a9bed5ca2ed..684b1c984a4 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -167,7 +167,7 @@ void __init early_sn_setup(void)
167 * IO on SN2 is done via SAL calls, early_printk won't work without this. 167 * IO on SN2 is done via SAL calls, early_printk won't work without this.
168 * 168 *
169 * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c. 169 * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c.
170 * Any changes to those file may have to be made hereas well. 170 * Any changes to those file may have to be made here as well.
171 */ 171 */
172 efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab); 172 efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab);
173 config_tables = __va(efi_systab->tables); 173 config_tables = __va(efi_systab->tables);
@@ -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/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index 5d318b579fb..033c8a9f000 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -104,7 +104,7 @@ static inline unsigned long wait_piowc(void)
104 * 104 *
105 * SN2 PIO writes from separate CPUs are not guaranteed to arrive in order. 105 * SN2 PIO writes from separate CPUs are not guaranteed to arrive in order.
106 * Context switching user threads which have memory-mapped MMIO may cause 106 * Context switching user threads which have memory-mapped MMIO may cause
107 * PIOs to issue from seperate CPUs, thus the PIO writes must be drained 107 * PIOs to issue from separate CPUs, thus the PIO writes must be drained
108 * from the previous CPU's Shub before execution resumes on the new CPU. 108 * from the previous CPU's Shub before execution resumes on the new CPU.
109 */ 109 */
110void sn_migrate(struct task_struct *task) 110void sn_migrate(struct task_struct *task)
diff --git a/arch/ia64/sn/kernel/xpc_channel.c b/arch/ia64/sn/kernel/xpc_channel.c
index c08db9c2375..44ccc0d789c 100644
--- a/arch/ia64/sn/kernel/xpc_channel.c
+++ b/arch/ia64/sn/kernel/xpc_channel.c
@@ -293,7 +293,7 @@ xpc_pull_remote_cachelines(struct xpc_partition *part, void *dst,
293 293
294 294
295/* 295/*
296 * Pull the remote per partititon specific variables from the specified 296 * Pull the remote per partition specific variables from the specified
297 * partition. 297 * partition.
298 */ 298 */
299enum xpc_retval 299enum xpc_retval
@@ -461,7 +461,7 @@ xpc_allocate_local_msgqueue(struct xpc_channel *ch)
461 // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between 461 // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between
462 // >>> iterations of the for-loop, bail if set? 462 // >>> iterations of the for-loop, bail if set?
463 463
464 // >>> should we impose a minumum #of entries? like 4 or 8? 464 // >>> should we impose a minimum #of entries? like 4 or 8?
465 for (nentries = ch->local_nentries; nentries > 0; nentries--) { 465 for (nentries = ch->local_nentries; nentries > 0; nentries--) {
466 466
467 nbytes = nentries * ch->msg_size; 467 nbytes = nentries * ch->msg_size;
@@ -514,7 +514,7 @@ xpc_allocate_remote_msgqueue(struct xpc_channel *ch)
514 // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between 514 // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between
515 // >>> iterations of the for-loop, bail if set? 515 // >>> iterations of the for-loop, bail if set?
516 516
517 // >>> should we impose a minumum #of entries? like 4 or 8? 517 // >>> should we impose a minimum #of entries? like 4 or 8?
518 for (nentries = ch->remote_nentries; nentries > 0; nentries--) { 518 for (nentries = ch->remote_nentries; nentries > 0; nentries--) {
519 519
520 nbytes = nentries * ch->msg_size; 520 nbytes = nentries * ch->msg_size;
@@ -1478,7 +1478,7 @@ xpc_teardown_infrastructure(struct xpc_partition *part)
1478 1478
1479 1479
1480 /* 1480 /*
1481 * Before proceding with the teardown we have to wait until all 1481 * Before proceeding with the teardown we have to wait until all
1482 * existing references cease. 1482 * existing references cease.
1483 */ 1483 */
1484 wait_event(part->teardown_wq, (atomic_read(&part->references) == 0)); 1484 wait_event(part->teardown_wq, (atomic_read(&part->references) == 0));
diff --git a/arch/ia64/sn/kernel/xpnet.c b/arch/ia64/sn/kernel/xpnet.c
index da721353097..e58fcadff2e 100644
--- a/arch/ia64/sn/kernel/xpnet.c
+++ b/arch/ia64/sn/kernel/xpnet.c
@@ -531,7 +531,7 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
531 dev_dbg(xpnet, "destination Partitions mask (dp) = 0x%lx\n", dp); 531 dev_dbg(xpnet, "destination Partitions mask (dp) = 0x%lx\n", dp);
532 532
533 /* 533 /*
534 * If we wanted to allow promiscous mode to work like an 534 * If we wanted to allow promiscuous mode to work like an
535 * unswitched network, this would be a good point to OR in a 535 * unswitched network, this would be a good point to OR in a
536 * mask of partitions which should be receiving all packets. 536 * mask of partitions which should be receiving all packets.
537 */ 537 */
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index 7a291a27151..d79ddacfba2 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -333,7 +333,7 @@ int sn_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size)
333 /* 333 /*
334 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work 334 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work
335 * around hw issues at the pci bus level. SGI proms older than 335 * around hw issues at the pci bus level. SGI proms older than
336 * 4.10 don't implment this. 336 * 4.10 don't implement this.
337 */ 337 */
338 338
339 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE, 339 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE,
@@ -348,7 +348,7 @@ int sn_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size)
348 /* 348 /*
349 * If the above failed, retry using the SAL_PROBE call which should 349 * If the above failed, retry using the SAL_PROBE call which should
350 * be present in all proms (but which cannot work round PCI chipset 350 * be present in all proms (but which cannot work round PCI chipset
351 * bugs). This code is retained for compatability with old 351 * bugs). This code is retained for compatibility with old
352 * pre-4.10 proms, and should be removed at some point in the future. 352 * pre-4.10 proms, and should be removed at some point in the future.
353 */ 353 */
354 354
@@ -379,7 +379,7 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)
379 /* 379 /*
380 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work 380 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work
381 * around hw issues at the pci bus level. SGI proms older than 381 * around hw issues at the pci bus level. SGI proms older than
382 * 4.10 don't implment this. 382 * 4.10 don't implement this.
383 */ 383 */
384 384
385 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE, 385 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE,
@@ -394,7 +394,7 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)
394 /* 394 /*
395 * If the above failed, retry using the SAL_PROBE call which should 395 * If the above failed, retry using the SAL_PROBE call which should
396 * be present in all proms (but which cannot work round PCI chipset 396 * be present in all proms (but which cannot work round PCI chipset
397 * bugs). This code is retained for compatability with old 397 * bugs). This code is retained for compatibility with old
398 * pre-4.10 proms, and should be removed at some point in the future. 398 * pre-4.10 proms, and should be removed at some point in the future.
399 */ 399 */
400 400
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_ate.c b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
index 935029fc400..239b3cedcf2 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_ate.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
@@ -30,7 +30,7 @@ static void mark_ate(struct ate_resource *ate_resource, int start, int number,
30 30
31/* 31/*
32 * find_free_ate: Find the first free ate index starting from the given 32 * find_free_ate: Find the first free ate index starting from the given
33 * index for the desired consequtive count. 33 * index for the desired consecutive count.
34 */ 34 */
35static int find_free_ate(struct ate_resource *ate_resource, int start, 35static int find_free_ate(struct ate_resource *ate_resource, int start,
36 int count) 36 int count)
@@ -88,7 +88,7 @@ static inline int alloc_ate_resource(struct ate_resource *ate_resource,
88 return -1; 88 return -1;
89 89
90 /* 90 /*
91 * Find the required number of free consequtive ates. 91 * Find the required number of free consecutive ates.
92 */ 92 */
93 start_index = 93 start_index =
94 find_free_ate(ate_resource, ate_resource->lowest_free_index, 94 find_free_ate(ate_resource, ate_resource->lowest_free_index,
@@ -105,7 +105,7 @@ static inline int alloc_ate_resource(struct ate_resource *ate_resource,
105/* 105/*
106 * Allocate "count" contiguous Bridge Address Translation Entries 106 * Allocate "count" contiguous Bridge Address Translation Entries
107 * on the specified bridge to be used for PCI to XTALK mappings. 107 * on the specified bridge to be used for PCI to XTALK mappings.
108 * Indices in rm map range from 1..num_entries. Indicies returned 108 * Indices in rm map range from 1..num_entries. Indices returned
109 * to caller range from 0..num_entries-1. 109 * to caller range from 0..num_entries-1.
110 * 110 *
111 * Return the start index on success, -1 on failure. 111 * Return the start index on success, -1 on failure.
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_dma.c b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
index 95af40cb22f..e626e50a938 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_dma.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
@@ -201,7 +201,7 @@ pcibr_dmatrans_direct32(struct pcidev_info * info,
201} 201}
202 202
203/* 203/*
204 * Wrapper routine for free'ing DMA maps 204 * Wrapper routine for freeing DMA maps
205 * DMA mappings for Direct 64 and 32 do not have any DMA maps. 205 * DMA mappings for Direct 64 and 32 do not have any DMA maps.
206 */ 206 */
207void 207void
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 8a2cb4e691f..b9bedbd6e1d 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -223,7 +223,7 @@ tioca_fastwrite_enable(struct tioca_kernel *tioca_kern)
223 223
224 /* 224 /*
225 * Scan all vga controllers on this bus making sure they all 225 * Scan all vga controllers on this bus making sure they all
226 * suport FW. If not, return. 226 * support FW. If not, return.
227 */ 227 */
228 228
229 list_for_each_entry(pdev, tioca_kern->ca_devices, bus_list) { 229 list_for_each_entry(pdev, tioca_kern->ca_devices, bus_list) {
@@ -364,7 +364,7 @@ tioca_dma_d48(struct pci_dev *pdev, u64 paddr)
364 * @req_size: len (bytes) to map 364 * @req_size: len (bytes) to map
365 * 365 *
366 * Map @paddr into CA address space using the GART mechanism. The mapped 366 * Map @paddr into CA address space using the GART mechanism. The mapped
367 * dma_addr_t is guarenteed to be contiguous in CA bus space. 367 * dma_addr_t is guaranteed to be contiguous in CA bus space.
368 */ 368 */
369static dma_addr_t 369static dma_addr_t
370tioca_dma_mapped(struct pci_dev *pdev, u64 paddr, size_t req_size) 370tioca_dma_mapped(struct pci_dev *pdev, u64 paddr, size_t req_size)
@@ -526,7 +526,7 @@ tioca_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags)
526 return 0; 526 return 0;
527 527
528 /* 528 /*
529 * If card is 64 or 48 bit addresable, use a direct mapping. 32 529 * If card is 64 or 48 bit addressable, use a direct mapping. 32
530 * bit direct is so restrictive w.r.t. where the memory resides that 530 * bit direct is so restrictive w.r.t. where the memory resides that
531 * we don't use it even though CA has some support. 531 * we don't use it even though CA has some support.
532 */ 532 */
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c
index 35f854fb612..f4c0b961a93 100644
--- a/arch/ia64/sn/pci/tioce_provider.c
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -256,9 +256,9 @@ pcidev_to_tioce(struct pci_dev *pdev, struct tioce __iomem **base,
256 * @ct_addr: the coretalk address to map 256 * @ct_addr: the coretalk address to map
257 * @len: number of bytes to map 257 * @len: number of bytes to map
258 * 258 *
259 * Given the addressing type, set up various paramaters that define the 259 * Given the addressing type, set up various parameters that define the
260 * ATE pool to use. Search for a contiguous block of entries to cover the 260 * ATE pool to use. Search for a contiguous block of entries to cover the
261 * length, and if enough resources exist, fill in the ATE's and construct a 261 * length, and if enough resources exist, fill in the ATEs and construct a
262 * tioce_dmamap struct to track the mapping. 262 * tioce_dmamap struct to track the mapping.
263 */ 263 */
264static u64 264static u64
@@ -581,8 +581,8 @@ tioce_do_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count,
581 */ 581 */
582 if (!mapaddr && !barrier && dma_mask >= 0xffffffffffUL) { 582 if (!mapaddr && !barrier && dma_mask >= 0xffffffffffUL) {
583 /* 583 /*
584 * We have two options for 40-bit mappings: 16GB "super" ATE's 584 * We have two options for 40-bit mappings: 16GB "super" ATEs
585 * and 64MB "regular" ATE's. We'll try both if needed for a 585 * and 64MB "regular" ATEs. We'll try both if needed for a
586 * given mapping but which one we try first depends on the 586 * given mapping but which one we try first depends on the
587 * size. For requests >64MB, prefer to use a super page with 587 * size. For requests >64MB, prefer to use a super page with
588 * regular as the fallback. Otherwise, try in the reverse order. 588 * regular as the fallback. Otherwise, try in the reverse order.
@@ -687,8 +687,8 @@ tioce_error_intr_handler(int irq, void *arg)
687} 687}
688 688
689/** 689/**
690 * tioce_reserve_m32 - reserve M32 ate's for the indicated address range 690 * tioce_reserve_m32 - reserve M32 ATEs for the indicated address range
691 * @tioce_kernel: TIOCE context to reserve ate's for 691 * @tioce_kernel: TIOCE context to reserve ATEs for
692 * @base: starting bus address to reserve 692 * @base: starting bus address to reserve
693 * @limit: last bus address to reserve 693 * @limit: last bus address to reserve
694 * 694 *
@@ -763,7 +763,7 @@ tioce_kern_init(struct tioce_common *tioce_common)
763 763
764 /* 764 /*
765 * Set PMU pagesize to the largest size available, and zero out 765 * Set PMU pagesize to the largest size available, and zero out
766 * the ate's. 766 * the ATEs.
767 */ 767 */
768 768
769 tioce_mmr = (struct tioce __iomem *)tioce_common->ce_pcibus.bs_base; 769 tioce_mmr = (struct tioce __iomem *)tioce_common->ce_pcibus.bs_base;
@@ -784,7 +784,7 @@ tioce_kern_init(struct tioce_common *tioce_common)
784 } 784 }
785 785
786 /* 786 /*
787 * Reserve ATE's corresponding to reserved address ranges. These 787 * Reserve ATEs corresponding to reserved address ranges. These
788 * include: 788 * include:
789 * 789 *
790 * Memory space covered by each PPB mem base/limit register 790 * Memory space covered by each PPB mem base/limit register
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 6c73bca3f47..4e2d5b9f0a9 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/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 437b4f8d86c..78f139226a1 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
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 2868e206fc7..c8999b2db23 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 = .;
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 823f73736bb..adc64a2bafb 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -470,14 +470,6 @@ config AVNET
470 default y 470 default y
471 depends on (AVNET5282) 471 depends on (AVNET5282)
472 472
473config LARGE_ALLOCS
474 bool "Allow allocating large blocks (> 1MB) of memory"
475 help
476 Allow the slab memory allocator to keep chains for very large
477 memory sizes - upto 32MB. You may need this if your system has
478 a lot of RAM, and you need to able to allocate very large
479 contiguous chunks. If unsure, say N.
480
481config 4KSTACKS 473config 4KSTACKS
482 bool "Use 4Kb for kernel stacks instead of 8Kb" 474 bool "Use 4Kb for kernel stacks instead of 8Kb"
483 default y 475 default y
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index c86a1bf589d..07a0055602f 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/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index a7d49ae805b..18c4a3c45a3 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 043f637e3d1..9b9992cd562 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 cea7d0ea36e..59945b9ee23 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/sgi-ip32/Makefile b/arch/mips/sgi-ip32/Makefile
index 7e1416768a6..60f0227425e 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 00000000000..120b15932ca
--- /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 0dc924ccceb..395bbce6499 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 dd5d0cb6b34..566226d78bc 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 c7458599059..4d96ba4b984 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 56d3c0dcd2b..5eaeafd30bd 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 d6014a67694..6238b5875fd 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -29,7 +29,7 @@ CROSS32CC := $(CC) -m32
29CROSS32AS := $(AS) -a32 29CROSS32AS := $(AS) -a32
30CROSS32LD := $(LD) -m elf32ppc 30CROSS32LD := $(LD) -m elf32ppc
31CROSS32OBJCOPY := $(OBJCOPY) 31CROSS32OBJCOPY := $(OBJCOPY)
32CROSS32AR := $(AR) 32CROSS32AR := GNUTARGET=elf32-powerpc $(AR)
33endif 33endif
34endif 34endif
35 35
@@ -58,6 +58,7 @@ ifeq ($(HAS_BIARCH),y)
58override AS += -a$(SZ) 58override AS += -a$(SZ)
59override LD += -m elf$(SZ)ppc 59override LD += -m elf$(SZ)ppc
60override CC += -m$(SZ) 60override CC += -m$(SZ)
61override AR := GNUTARGET=elf$(SZ)-powerpc $(AR)
61endif 62endif
62 63
63LDFLAGS_vmlinux := -Bstatic 64LDFLAGS_vmlinux := -Bstatic
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index d4f9fef7f9e..83788986b93 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -33,6 +33,9 @@ endif
33 33
34BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) 34BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
35 35
36$(obj)/44x.o: BOOTCFLAGS += -Wa,-mbooke
37$(obj)/ebony.o: BOOTCFLAGS += -Wa,-mbooke
38
36zlib := inffast.c inflate.c inftrees.c 39zlib := inffast.c inflate.c inftrees.c
37zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h 40zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
38zliblinuxheader := zlib.h zconf.h zutil.h 41zliblinuxheader := zlib.h zconf.h zutil.h
@@ -54,13 +57,13 @@ obj-wlib := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-wlib))))
54obj-plat := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-plat)))) 57obj-plat := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-plat))))
55 58
56quiet_cmd_copy_zlib = COPY $@ 59quiet_cmd_copy_zlib = COPY $@
57 cmd_copy_zlib = sed "s@__attribute_used__@@;s@<linux/\([^>]\+\).*@\"\1\"@" $< > $@ 60 cmd_copy_zlib = sed "s@__attribute_used__@@;s@<linux/\([^>]*\).*@\"\1\"@" $< > $@
58 61
59quiet_cmd_copy_zlibheader = COPY $@ 62quiet_cmd_copy_zlibheader = COPY $@
60 cmd_copy_zlibheader = sed "s@<linux/\([^>]\+\).*@\"\1\"@" $< > $@ 63 cmd_copy_zlibheader = sed "s@<linux/\([^>]*\).*@\"\1\"@" $< > $@
61# stddef.h for NULL 64# stddef.h for NULL
62quiet_cmd_copy_zliblinuxheader = COPY $@ 65quiet_cmd_copy_zliblinuxheader = COPY $@
63 cmd_copy_zliblinuxheader = sed "s@<linux/string.h>@\"string.h\"@;s@<linux/kernel.h>@<stddef.h>@;s@<linux/\([^>]\+\).*@\"\1\"@" $< > $@ 66 cmd_copy_zliblinuxheader = sed "s@<linux/string.h>@\"string.h\"@;s@<linux/kernel.h>@<stddef.h>@;s@<linux/\([^>]*\).*@\"\1\"@" $< > $@
64 67
65$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/% 68$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
66 $(call cmd,copy_zlib) 69 $(call cmd,copy_zlib)
@@ -204,12 +207,12 @@ dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\
204$(obj)/cuImage.%: vmlinux $(dts) $(wrapperbits) 207$(obj)/cuImage.%: vmlinux $(dts) $(wrapperbits)
205 $(call if_changed,wrap,cuboot-$*,$(dts)) 208 $(call if_changed,wrap,cuboot-$*,$(dts))
206 209
207$(obj)/treeImage.%: vmlinux $(dts) $(wrapperbits)
208 $(call if_changed,wrap,treeboot-$*,$(dts))
209
210$(obj)/treeImage.initrd.%: vmlinux $(dts) $(wrapperbits) 210$(obj)/treeImage.initrd.%: vmlinux $(dts) $(wrapperbits)
211 $(call if_changed,wrap,treeboot-$*,$(dts),,$(obj)/ramdisk.image.gz) 211 $(call if_changed,wrap,treeboot-$*,$(dts),,$(obj)/ramdisk.image.gz)
212 212
213$(obj)/treeImage.%: vmlinux $(dts) $(wrapperbits)
214 $(call if_changed,wrap,treeboot-$*,$(dts))
215
213$(obj)/zImage: $(addprefix $(obj)/, $(image-y)) 216$(obj)/zImage: $(addprefix $(obj)/, $(image-y))
214 @rm -f $@; ln $< $@ 217 @rm -f $@; ln $< $@
215$(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y)) 218$(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y))
diff --git a/arch/powerpc/boot/dts/ebony.dts b/arch/powerpc/boot/dts/ebony.dts
index b67918651c4..0ec02f4726b 100644
--- a/arch/powerpc/boot/dts/ebony.dts
+++ b/arch/powerpc/boot/dts/ebony.dts
@@ -33,8 +33,8 @@
33 timebase-frequency = <0>; // Filled in by zImage 33 timebase-frequency = <0>; // Filled in by zImage
34 i-cache-line-size = <32>; 34 i-cache-line-size = <32>;
35 d-cache-line-size = <32>; 35 d-cache-line-size = <32>;
36 i-cache-size = <0>; 36 i-cache-size = <8000>; /* 32 kB */
37 d-cache-size = <0>; 37 d-cache-size = <8000>; /* 32 kB */
38 dcr-controller; 38 dcr-controller;
39 dcr-access-method = "native"; 39 dcr-access-method = "native";
40 }; 40 };
@@ -46,7 +46,6 @@
46 }; 46 };
47 47
48 UIC0: interrupt-controller0 { 48 UIC0: interrupt-controller0 {
49 device_type = "ibm,uic";
50 compatible = "ibm,uic-440gp", "ibm,uic"; 49 compatible = "ibm,uic-440gp", "ibm,uic";
51 interrupt-controller; 50 interrupt-controller;
52 cell-index = <0>; 51 cell-index = <0>;
@@ -58,7 +57,6 @@
58 }; 57 };
59 58
60 UIC1: interrupt-controller1 { 59 UIC1: interrupt-controller1 {
61 device_type = "ibm,uic";
62 compatible = "ibm,uic-440gp", "ibm,uic"; 60 compatible = "ibm,uic-440gp", "ibm,uic";
63 interrupt-controller; 61 interrupt-controller;
64 cell-index = <1>; 62 cell-index = <1>;
@@ -71,36 +69,36 @@
71 }; 69 };
72 70
73 CPC0: cpc { 71 CPC0: cpc {
74 device_type = "ibm,cpc";
75 compatible = "ibm,cpc-440gp"; 72 compatible = "ibm,cpc-440gp";
76 dcr-reg = <0b0 003 0e0 010>; 73 dcr-reg = <0b0 003 0e0 010>;
77 // FIXME: anything else? 74 // FIXME: anything else?
78 }; 75 };
79 76
80 plb { 77 plb {
81 device_type = "ibm,plb";
82 compatible = "ibm,plb-440gp", "ibm,plb4"; 78 compatible = "ibm,plb-440gp", "ibm,plb4";
83 #address-cells = <2>; 79 #address-cells = <2>;
84 #size-cells = <1>; 80 #size-cells = <1>;
85 ranges; 81 ranges;
86 clock-frequency = <0>; // Filled in by zImage 82 clock-frequency = <0>; // Filled in by zImage
87 83
88 SDRAM0: sdram { 84 SDRAM0: memory-controller {
89 device_type = "memory-controller"; 85 compatible = "ibm,sdram-440gp";
90 compatible = "ibm,sdram-440gp", "ibm,sdram";
91 dcr-reg = <010 2>; 86 dcr-reg = <010 2>;
92 // FIXME: anything else? 87 // FIXME: anything else?
93 }; 88 };
94 89
90 SRAM0: sram {
91 compatible = "ibm,sram-440gp";
92 dcr-reg = <020 8 00a 1>;
93 };
94
95 DMA0: dma { 95 DMA0: dma {
96 // FIXME: ??? 96 // FIXME: ???
97 device_type = "ibm,dma-4xx"; 97 compatible = "ibm,dma-440gp";
98 compatible = "ibm,dma-440gp", "ibm,dma-4xx";
99 dcr-reg = <100 027>; 98 dcr-reg = <100 027>;
100 }; 99 };
101 100
102 MAL0: mcmal { 101 MAL0: mcmal {
103 device_type = "mcmal-dma";
104 compatible = "ibm,mcmal-440gp", "ibm,mcmal"; 102 compatible = "ibm,mcmal-440gp", "ibm,mcmal";
105 dcr-reg = <180 62>; 103 dcr-reg = <180 62>;
106 num-tx-chans = <4>; 104 num-tx-chans = <4>;
@@ -119,7 +117,6 @@
119 }; 117 };
120 118
121 POB0: opb { 119 POB0: opb {
122 device_type = "ibm,opb";
123 compatible = "ibm,opb-440gp", "ibm,opb"; 120 compatible = "ibm,opb-440gp", "ibm,opb";
124 #address-cells = <1>; 121 #address-cells = <1>;
125 #size-cells = <1>; 122 #size-cells = <1>;
@@ -133,8 +130,7 @@
133 clock-frequency = <0>; // Filled in by zImage 130 clock-frequency = <0>; // Filled in by zImage
134 131
135 EBC0: ebc { 132 EBC0: ebc {
136 device_type = "ibm,ebc"; 133 compatible = "ibm,ebc-440gp", "ibm,ebc";
137 compatible = "ibm,ebc-440gp";
138 dcr-reg = <012 2>; 134 dcr-reg = <012 2>;
139 #address-cells = <2>; 135 #address-cells = <2>;
140 #size-cells = <1>; 136 #size-cells = <1>;
@@ -147,7 +143,7 @@
147 interrupts = <5 4>; 143 interrupts = <5 4>;
148 interrupt-parent = <&UIC1>; 144 interrupt-parent = <&UIC1>;
149 145
150 small-flash@0,0 { 146 small-flash@0,80000 {
151 device_type = "rom"; 147 device_type = "rom";
152 compatible = "direct-mapped"; 148 compatible = "direct-mapped";
153 probe-type = "JEDEC"; 149 probe-type = "JEDEC";
@@ -159,7 +155,6 @@
159 155
160 ds1743@1,0 { 156 ds1743@1,0 {
161 /* NVRAM & RTC */ 157 /* NVRAM & RTC */
162 device_type = "nvram";
163 compatible = "ds1743"; 158 compatible = "ds1743";
164 reg = <1 0 2000>; 159 reg = <1 0 2000>;
165 }; 160 };
@@ -170,7 +165,7 @@
170 probe-type = "JEDEC"; 165 probe-type = "JEDEC";
171 bank-width = <1>; 166 bank-width = <1>;
172 partitions = <0 380000 167 partitions = <0 380000
173 280000 80000>; 168 380000 80000>;
174 partition-names = "fs", "firmware"; 169 partition-names = "fs", "firmware";
175 reg = <2 0 400000>; 170 reg = <2 0 400000>;
176 }; 171 };
@@ -226,13 +221,11 @@
226 221
227 GPIO0: gpio@40000700 { 222 GPIO0: gpio@40000700 {
228 /* FIXME */ 223 /* FIXME */
229 device_type = "gpio";
230 compatible = "ibm,gpio-440gp"; 224 compatible = "ibm,gpio-440gp";
231 reg = <40000700 20>; 225 reg = <40000700 20>;
232 }; 226 };
233 227
234 ZMII0: emac-zmii@40000780 { 228 ZMII0: emac-zmii@40000780 {
235 device_type = "emac-zmii";
236 compatible = "ibm,zmii-440gp", "ibm,zmii"; 229 compatible = "ibm,zmii-440gp", "ibm,zmii";
237 reg = <40000780 c>; 230 reg = <40000780 c>;
238 }; 231 };
@@ -299,9 +292,5 @@
299 292
300 chosen { 293 chosen {
301 linux,stdout-path = "/plb/opb/serial@40000200"; 294 linux,stdout-path = "/plb/opb/serial@40000200";
302// linux,initrd-start = <0>; /* FIXME */
303// linux,initrd-end = <0>;
304// bootargs = "";
305 }; 295 };
306}; 296};
307
diff --git a/arch/powerpc/boot/dts/kuroboxHD.dts b/arch/powerpc/boot/dts/kuroboxHD.dts
index 157dc98d398..a983680c326 100644
--- a/arch/powerpc/boot/dts/kuroboxHD.dts
+++ b/arch/powerpc/boot/dts/kuroboxHD.dts
@@ -21,19 +21,16 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
21 */ 21 */
22 22
23/ { 23/ {
24 linux,phandle = <1000>;
25 model = "KuroboxHD"; 24 model = "KuroboxHD";
26 compatible = "linkstation"; 25 compatible = "linkstation";
27 #address-cells = <1>; 26 #address-cells = <1>;
28 #size-cells = <1>; 27 #size-cells = <1>;
29 28
30 cpus { 29 cpus {
31 linux,phandle = <2000>;
32 #address-cells = <1>; 30 #address-cells = <1>;
33 #size-cells = <0>; 31 #size-cells = <0>;
34 32
35 PowerPC,603e { /* Really 8241 */ 33 PowerPC,603e { /* Really 8241 */
36 linux,phandle = <2100>;
37 device_type = "cpu"; 34 device_type = "cpu";
38 reg = <0>; 35 reg = <0>;
39 clock-frequency = <bebc200>; /* Fixed by bootwrapper */ 36 clock-frequency = <bebc200>; /* Fixed by bootwrapper */
@@ -48,13 +45,11 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
48 }; 45 };
49 46
50 memory { 47 memory {
51 linux,phandle = <3000>;
52 device_type = "memory"; 48 device_type = "memory";
53 reg = <00000000 04000000>; 49 reg = <00000000 04000000>;
54 }; 50 };
55 51
56 soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */ 52 soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */
57 linux,phandle = <4000>;
58 #address-cells = <1>; 53 #address-cells = <1>;
59 #size-cells = <1>; 54 #size-cells = <1>;
60 #interrupt-cells = <2>; 55 #interrupt-cells = <2>;
@@ -69,38 +64,34 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
69 fef00000 fef00000 00100000>; /* pci iack */ 64 fef00000 fef00000 00100000>; /* pci iack */
70 65
71 i2c@80003000 { 66 i2c@80003000 {
72 linux,phandle = <4300>;
73 device_type = "i2c"; 67 device_type = "i2c";
74 compatible = "fsl-i2c"; 68 compatible = "fsl-i2c";
75 reg = <80003000 1000>; 69 reg = <80003000 1000>;
76 interrupts = <5 2>; 70 interrupts = <5 2>;
77 interrupt-parent = <4400>; 71 interrupt-parent = <&mpic>;
78 }; 72 };
79 73
80 serial@80004500 { 74 serial@80004500 {
81 linux,phandle = <4511>;
82 device_type = "serial"; 75 device_type = "serial";
83 compatible = "ns16550"; 76 compatible = "ns16550";
84 reg = <80004500 8>; 77 reg = <80004500 8>;
85 clock-frequency = <5d08d88>; 78 clock-frequency = <5d08d88>;
86 current-speed = <2580>; 79 current-speed = <2580>;
87 interrupts = <9 2>; 80 interrupts = <9 2>;
88 interrupt-parent = <4400>; 81 interrupt-parent = <&mpic>;
89 }; 82 };
90 83
91 serial@80004600 { 84 serial@80004600 {
92 linux,phandle = <4512>;
93 device_type = "serial"; 85 device_type = "serial";
94 compatible = "ns16550"; 86 compatible = "ns16550";
95 reg = <80004600 8>; 87 reg = <80004600 8>;
96 clock-frequency = <5d08d88>; 88 clock-frequency = <5d08d88>;
97 current-speed = <e100>; 89 current-speed = <e100>;
98 interrupts = <a 0>; 90 interrupts = <a 0>;
99 interrupt-parent = <4400>; 91 interrupt-parent = <&mpic>;
100 }; 92 };
101 93
102 pic@80040000 { 94 mpic: pic@80040000 {
103 linux,phandle = <4400>;
104 #interrupt-cells = <2>; 95 #interrupt-cells = <2>;
105 #address-cells = <0>; 96 #address-cells = <0>;
106 device_type = "open-pic"; 97 device_type = "open-pic";
@@ -111,7 +102,6 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
111 }; 102 };
112 103
113 pci@fec00000 { 104 pci@fec00000 {
114 linux,phandle = <4500>;
115 #address-cells = <3>; 105 #address-cells = <3>;
116 #size-cells = <2>; 106 #size-cells = <2>;
117 #interrupt-cells = <1>; 107 #interrupt-cells = <1>;
@@ -122,24 +112,24 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
122 02000000 0 80000000 80000000 0 70000000>; 112 02000000 0 80000000 80000000 0 70000000>;
123 bus-range = <0 ff>; 113 bus-range = <0 ff>;
124 clock-frequency = <7f28155>; 114 clock-frequency = <7f28155>;
125 interrupt-parent = <4400>; 115 interrupt-parent = <&mpic>;
126 interrupt-map-mask = <f800 0 0 7>; 116 interrupt-map-mask = <f800 0 0 7>;
127 interrupt-map = < 117 interrupt-map = <
128 /* IDSEL 11 - IRQ0 ETH */ 118 /* IDSEL 11 - IRQ0 ETH */
129 5800 0 0 1 4400 0 1 119 5800 0 0 1 &mpic 0 1
130 5800 0 0 2 4400 1 1 120 5800 0 0 2 &mpic 1 1
131 5800 0 0 3 4400 2 1 121 5800 0 0 3 &mpic 2 1
132 5800 0 0 4 4400 3 1 122 5800 0 0 4 &mpic 3 1
133 /* IDSEL 12 - IRQ1 IDE0 */ 123 /* IDSEL 12 - IRQ1 IDE0 */
134 6000 0 0 1 4400 1 1 124 6000 0 0 1 &mpic 1 1
135 6000 0 0 2 4400 2 1 125 6000 0 0 2 &mpic 2 1
136 6000 0 0 3 4400 3 1 126 6000 0 0 3 &mpic 3 1
137 6000 0 0 4 4400 0 1 127 6000 0 0 4 &mpic 0 1
138 /* IDSEL 14 - IRQ3 USB2.0 */ 128 /* IDSEL 14 - IRQ3 USB2.0 */
139 7000 0 0 1 4400 3 1 129 7000 0 0 1 &mpic 3 1
140 7000 0 0 2 4400 3 1 130 7000 0 0 2 &mpic 3 1
141 7000 0 0 3 4400 3 1 131 7000 0 0 3 &mpic 3 1
142 7000 0 0 4 4400 3 1 132 7000 0 0 4 &mpic 3 1
143 >; 133 >;
144 }; 134 };
145 }; 135 };
diff --git a/arch/powerpc/boot/dts/kuroboxHG.dts b/arch/powerpc/boot/dts/kuroboxHG.dts
index 919eb29097d..5cf42dc022d 100644
--- a/arch/powerpc/boot/dts/kuroboxHG.dts
+++ b/arch/powerpc/boot/dts/kuroboxHG.dts
@@ -21,19 +21,16 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
21 */ 21 */
22 22
23/ { 23/ {
24 linux,phandle = <1000>;
25 model = "KuroboxHG"; 24 model = "KuroboxHG";
26 compatible = "linkstation"; 25 compatible = "linkstation";
27 #address-cells = <1>; 26 #address-cells = <1>;
28 #size-cells = <1>; 27 #size-cells = <1>;
29 28
30 cpus { 29 cpus {
31 linux,phandle = <2000>;
32 #address-cells = <1>; 30 #address-cells = <1>;
33 #size-cells = <0>; 31 #size-cells = <0>;
34 32
35 PowerPC,603e { /* Really 8241 */ 33 PowerPC,603e { /* Really 8241 */
36 linux,phandle = <2100>;
37 device_type = "cpu"; 34 device_type = "cpu";
38 reg = <0>; 35 reg = <0>;
39 clock-frequency = <fdad680>; /* Fixed by bootwrapper */ 36 clock-frequency = <fdad680>; /* Fixed by bootwrapper */
@@ -48,13 +45,11 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
48 }; 45 };
49 46
50 memory { 47 memory {
51 linux,phandle = <3000>;
52 device_type = "memory"; 48 device_type = "memory";
53 reg = <00000000 08000000>; 49 reg = <00000000 08000000>;
54 }; 50 };
55 51
56 soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */ 52 soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */
57 linux,phandle = <4000>;
58 #address-cells = <1>; 53 #address-cells = <1>;
59 #size-cells = <1>; 54 #size-cells = <1>;
60 #interrupt-cells = <2>; 55 #interrupt-cells = <2>;
@@ -69,38 +64,35 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
69 fef00000 fef00000 00100000>; /* pci iack */ 64 fef00000 fef00000 00100000>; /* pci iack */
70 65
71 i2c@80003000 { 66 i2c@80003000 {
72 linux,phandle = <4300>;
73 device_type = "i2c"; 67 device_type = "i2c";
74 compatible = "fsl-i2c"; 68 compatible = "fsl-i2c";
75 reg = <80003000 1000>; 69 reg = <80003000 1000>;
76 interrupts = <5 2>; 70 interrupts = <5 2>;
77 interrupt-parent = <4400>; 71 interrupt-parent = <&mpic>;
78 }; 72 };
79 73
80 serial@80004500 { 74 serial@80004500 {
81 linux,phandle = <4511>;
82 device_type = "serial"; 75 device_type = "serial";
83 compatible = "ns16550"; 76 compatible = "ns16550";
84 reg = <80004500 8>; 77 reg = <80004500 8>;
85 clock-frequency = <7c044a8>; 78 clock-frequency = <7c044a8>;
86 current-speed = <2580>; 79 current-speed = <2580>;
87 interrupts = <9 2>; 80 interrupts = <9 2>;
88 interrupt-parent = <4400>; 81 interrupt-parent = <&mpic>;
89 }; 82 };
90 83
91 serial@80004600 { 84 serial@80004600 {
92 linux,phandle = <4512>;
93 device_type = "serial"; 85 device_type = "serial";
94 compatible = "ns16550"; 86 compatible = "ns16550";
95 reg = <80004600 8>; 87 reg = <80004600 8>;
96 clock-frequency = <7c044a8>; 88 clock-frequency = <7c044a8>;
97 current-speed = <e100>; 89 current-speed = <e100>;
98 interrupts = <a 0>; 90 interrupts = <a 0>;
99 interrupt-parent = <4400>; 91 interrupt-parent = <&mpic>;
100 }; 92 };
101 93
102 pic@80040000 { 94 mpic: pic@80040000 {
103 linux,phandle = <4400>; 95 interrupt-parent = <&mpic>;
104 #interrupt-cells = <2>; 96 #interrupt-cells = <2>;
105 #address-cells = <0>; 97 #address-cells = <0>;
106 device_type = "open-pic"; 98 device_type = "open-pic";
@@ -111,7 +103,6 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
111 }; 103 };
112 104
113 pci@fec00000 { 105 pci@fec00000 {
114 linux,phandle = <4500>;
115 #address-cells = <3>; 106 #address-cells = <3>;
116 #size-cells = <2>; 107 #size-cells = <2>;
117 #interrupt-cells = <1>; 108 #interrupt-cells = <1>;
@@ -122,24 +113,24 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
122 02000000 0 80000000 80000000 0 70000000>; 113 02000000 0 80000000 80000000 0 70000000>;
123 bus-range = <0 ff>; 114 bus-range = <0 ff>;
124 clock-frequency = <7f28155>; 115 clock-frequency = <7f28155>;
125 interrupt-parent = <4400>; 116 interrupt-parent = <&mpic>;
126 interrupt-map-mask = <f800 0 0 7>; 117 interrupt-map-mask = <f800 0 0 7>;
127 interrupt-map = < 118 interrupt-map = <
128 /* IDSEL 11 - IRQ0 ETH */ 119 /* IDSEL 11 - IRQ0 ETH */
129 5800 0 0 1 4400 0 1 120 5800 0 0 1 &mpic 0 1
130 5800 0 0 2 4400 1 1 121 5800 0 0 2 &mpic 1 1
131 5800 0 0 3 4400 2 1 122 5800 0 0 3 &mpic 2 1
132 5800 0 0 4 4400 3 1 123 5800 0 0 4 &mpic 3 1
133 /* IDSEL 12 - IRQ1 IDE0 */ 124 /* IDSEL 12 - IRQ1 IDE0 */
134 6000 0 0 1 4400 1 1 125 6000 0 0 1 &mpic 1 1
135 6000 0 0 2 4400 2 1 126 6000 0 0 2 &mpic 2 1
136 6000 0 0 3 4400 3 1 127 6000 0 0 3 &mpic 3 1
137 6000 0 0 4 4400 0 1 128 6000 0 0 4 &mpic 0 1
138 /* IDSEL 14 - IRQ3 USB2.0 */ 129 /* IDSEL 14 - IRQ3 USB2.0 */
139 7000 0 0 1 4400 3 1 130 7000 0 0 1 &mpic 3 1
140 7000 0 0 2 4400 3 1 131 7000 0 0 2 &mpic 3 1
141 7000 0 0 3 4400 3 1 132 7000 0 0 3 &mpic 3 1
142 7000 0 0 4 4400 3 1 133 7000 0 0 4 &mpic 3 1
143 >; 134 >;
144 }; 135 };
145 }; 136 };
diff --git a/arch/powerpc/boot/dts/lite5200.dts b/arch/powerpc/boot/dts/lite5200.dts
index e13ac6ef05a..d29308fe4c2 100644
--- a/arch/powerpc/boot/dts/lite5200.dts
+++ b/arch/powerpc/boot/dts/lite5200.dts
@@ -49,7 +49,7 @@
49 soc5200@f0000000 { 49 soc5200@f0000000 {
50 model = "fsl,mpc5200"; 50 model = "fsl,mpc5200";
51 compatible = "mpc5200"; 51 compatible = "mpc5200";
52 revision = "" // from bootloader 52 revision = ""; // from bootloader
53 #interrupt-cells = <3>; 53 #interrupt-cells = <3>;
54 device_type = "soc"; 54 device_type = "soc";
55 ranges = <0 f0000000 f0010000>; 55 ranges = <0 f0000000 f0010000>;
@@ -62,9 +62,8 @@
62 reg = <200 38>; 62 reg = <200 38>;
63 }; 63 };
64 64
65 pic@500 { 65 mpc5200_pic: pic@500 {
66 // 5200 interrupts are encoded into two levels; 66 // 5200 interrupts are encoded into two levels;
67 linux,phandle = <500>;
68 interrupt-controller; 67 interrupt-controller;
69 #interrupt-cells = <3>; 68 #interrupt-cells = <3>;
70 device_type = "interrupt-controller"; 69 device_type = "interrupt-controller";
@@ -79,7 +78,7 @@
79 cell-index = <0>; 78 cell-index = <0>;
80 reg = <600 10>; 79 reg = <600 10>;
81 interrupts = <1 9 0>; 80 interrupts = <1 9 0>;
82 interrupt-parent = <500>; 81 interrupt-parent = <&mpc5200_pic>;
83 has-wdt; 82 has-wdt;
84 }; 83 };
85 84
@@ -89,7 +88,7 @@
89 cell-index = <1>; 88 cell-index = <1>;
90 reg = <610 10>; 89 reg = <610 10>;
91 interrupts = <1 a 0>; 90 interrupts = <1 a 0>;
92 interrupt-parent = <500>; 91 interrupt-parent = <&mpc5200_pic>;
93 }; 92 };
94 93
95 gpt@620 { // General Purpose Timer 94 gpt@620 { // General Purpose Timer
@@ -98,7 +97,7 @@
98 cell-index = <2>; 97 cell-index = <2>;
99 reg = <620 10>; 98 reg = <620 10>;
100 interrupts = <1 b 0>; 99 interrupts = <1 b 0>;
101 interrupt-parent = <500>; 100 interrupt-parent = <&mpc5200_pic>;
102 }; 101 };
103 102
104 gpt@630 { // General Purpose Timer 103 gpt@630 { // General Purpose Timer
@@ -107,7 +106,7 @@
107 cell-index = <3>; 106 cell-index = <3>;
108 reg = <630 10>; 107 reg = <630 10>;
109 interrupts = <1 c 0>; 108 interrupts = <1 c 0>;
110 interrupt-parent = <500>; 109 interrupt-parent = <&mpc5200_pic>;
111 }; 110 };
112 111
113 gpt@640 { // General Purpose Timer 112 gpt@640 { // General Purpose Timer
@@ -116,7 +115,7 @@
116 cell-index = <4>; 115 cell-index = <4>;
117 reg = <640 10>; 116 reg = <640 10>;
118 interrupts = <1 d 0>; 117 interrupts = <1 d 0>;
119 interrupt-parent = <500>; 118 interrupt-parent = <&mpc5200_pic>;
120 }; 119 };
121 120
122 gpt@650 { // General Purpose Timer 121 gpt@650 { // General Purpose Timer
@@ -125,7 +124,7 @@
125 cell-index = <5>; 124 cell-index = <5>;
126 reg = <650 10>; 125 reg = <650 10>;
127 interrupts = <1 e 0>; 126 interrupts = <1 e 0>;
128 interrupt-parent = <500>; 127 interrupt-parent = <&mpc5200_pic>;
129 }; 128 };
130 129
131 gpt@660 { // General Purpose Timer 130 gpt@660 { // General Purpose Timer
@@ -134,7 +133,7 @@
134 cell-index = <6>; 133 cell-index = <6>;
135 reg = <660 10>; 134 reg = <660 10>;
136 interrupts = <1 f 0>; 135 interrupts = <1 f 0>;
137 interrupt-parent = <500>; 136 interrupt-parent = <&mpc5200_pic>;
138 }; 137 };
139 138
140 gpt@670 { // General Purpose Timer 139 gpt@670 { // General Purpose Timer
@@ -143,7 +142,7 @@
143 cell-index = <7>; 142 cell-index = <7>;
144 reg = <670 10>; 143 reg = <670 10>;
145 interrupts = <1 10 0>; 144 interrupts = <1 10 0>;
146 interrupt-parent = <500>; 145 interrupt-parent = <&mpc5200_pic>;
147 }; 146 };
148 147
149 rtc@800 { // Real time clock 148 rtc@800 { // Real time clock
@@ -151,7 +150,7 @@
151 device_type = "rtc"; 150 device_type = "rtc";
152 reg = <800 100>; 151 reg = <800 100>;
153 interrupts = <1 5 0 1 6 0>; 152 interrupts = <1 5 0 1 6 0>;
154 interrupt-parent = <500>; 153 interrupt-parent = <&mpc5200_pic>;
155 }; 154 };
156 155
157 mscan@900 { 156 mscan@900 {
@@ -159,7 +158,7 @@
159 compatible = "mpc5200-mscan"; 158 compatible = "mpc5200-mscan";
160 cell-index = <0>; 159 cell-index = <0>;
161 interrupts = <2 11 0>; 160 interrupts = <2 11 0>;
162 interrupt-parent = <500>; 161 interrupt-parent = <&mpc5200_pic>;
163 reg = <900 80>; 162 reg = <900 80>;
164 }; 163 };
165 164
@@ -168,7 +167,7 @@
168 compatible = "mpc5200-mscan"; 167 compatible = "mpc5200-mscan";
169 cell-index = <1>; 168 cell-index = <1>;
170 interrupts = <2 12 0>; 169 interrupts = <2 12 0>;
171 interrupt-parent = <500>; 170 interrupt-parent = <&mpc5200_pic>;
172 reg = <980 80>; 171 reg = <980 80>;
173 }; 172 };
174 173
@@ -176,14 +175,14 @@
176 compatible = "mpc5200-gpio"; 175 compatible = "mpc5200-gpio";
177 reg = <b00 40>; 176 reg = <b00 40>;
178 interrupts = <1 7 0>; 177 interrupts = <1 7 0>;
179 interrupt-parent = <500>; 178 interrupt-parent = <&mpc5200_pic>;
180 }; 179 };
181 180
182 gpio-wkup@c00 { 181 gpio-wkup@c00 {
183 compatible = "mpc5200-gpio-wkup"; 182 compatible = "mpc5200-gpio-wkup";
184 reg = <c00 40>; 183 reg = <c00 40>;
185 interrupts = <1 8 0 0 3 0>; 184 interrupts = <1 8 0 0 3 0>;
186 interrupt-parent = <500>; 185 interrupt-parent = <&mpc5200_pic>;
187 }; 186 };
188 187
189 pci@0d00 { 188 pci@0d00 {
@@ -194,13 +193,13 @@
194 compatible = "mpc5200-pci"; 193 compatible = "mpc5200-pci";
195 reg = <d00 100>; 194 reg = <d00 100>;
196 interrupt-map-mask = <f800 0 0 7>; 195 interrupt-map-mask = <f800 0 0 7>;
197 interrupt-map = <c000 0 0 1 500 0 0 3 196 interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3
198 c000 0 0 2 500 0 0 3 197 c000 0 0 2 &mpc5200_pic 0 0 3
199 c000 0 0 3 500 0 0 3 198 c000 0 0 3 &mpc5200_pic 0 0 3
200 c000 0 0 4 500 0 0 3>; 199 c000 0 0 4 &mpc5200_pic 0 0 3>;
201 clock-frequency = <0>; // From boot loader 200 clock-frequency = <0>; // From boot loader
202 interrupts = <2 8 0 2 9 0 2 a 0>; 201 interrupts = <2 8 0 2 9 0 2 a 0>;
203 interrupt-parent = <500>; 202 interrupt-parent = <&mpc5200_pic>;
204 bus-range = <0 0>; 203 bus-range = <0 0>;
205 ranges = <42000000 0 80000000 80000000 0 20000000 204 ranges = <42000000 0 80000000 80000000 0 20000000
206 02000000 0 a0000000 a0000000 0 10000000 205 02000000 0 a0000000 a0000000 0 10000000
@@ -212,7 +211,7 @@
212 compatible = "mpc5200-spi"; 211 compatible = "mpc5200-spi";
213 reg = <f00 20>; 212 reg = <f00 20>;
214 interrupts = <2 d 0 2 e 0>; 213 interrupts = <2 d 0 2 e 0>;
215 interrupt-parent = <500>; 214 interrupt-parent = <&mpc5200_pic>;
216 }; 215 };
217 216
218 usb@1000 { 217 usb@1000 {
@@ -220,7 +219,7 @@
220 compatible = "mpc5200-ohci\0ohci-be"; 219 compatible = "mpc5200-ohci\0ohci-be";
221 reg = <1000 ff>; 220 reg = <1000 ff>;
222 interrupts = <2 6 0>; 221 interrupts = <2 6 0>;
223 interrupt-parent = <500>; 222 interrupt-parent = <&mpc5200_pic>;
224 }; 223 };
225 224
226 bestcomm@1200 { 225 bestcomm@1200 {
@@ -231,7 +230,7 @@
231 3 4 0 3 5 0 3 6 0 3 7 0 230 3 4 0 3 5 0 3 6 0 3 7 0
232 3 8 0 3 9 0 3 a 0 3 b 0 231 3 8 0 3 9 0 3 a 0 3 b 0
233 3 c 0 3 d 0 3 e 0 3 f 0>; 232 3 c 0 3 d 0 3 e 0 3 f 0>;
234 interrupt-parent = <500>; 233 interrupt-parent = <&mpc5200_pic>;
235 }; 234 };
236 235
237 xlb@1f00 { 236 xlb@1f00 {
@@ -246,7 +245,7 @@
246 cell-index = <0>; 245 cell-index = <0>;
247 reg = <2000 100>; 246 reg = <2000 100>;
248 interrupts = <2 1 0>; 247 interrupts = <2 1 0>;
249 interrupt-parent = <500>; 248 interrupt-parent = <&mpc5200_pic>;
250 }; 249 };
251 250
252 // PSC2 in ac97 mode example 251 // PSC2 in ac97 mode example
@@ -256,7 +255,7 @@
256 // cell-index = <1>; 255 // cell-index = <1>;
257 // reg = <2200 100>; 256 // reg = <2200 100>;
258 // interrupts = <2 2 0>; 257 // interrupts = <2 2 0>;
259 // interrupt-parent = <500>; 258 // interrupt-parent = <&mpc5200_pic>;
260 //}; 259 //};
261 260
262 // PSC3 in CODEC mode example 261 // PSC3 in CODEC mode example
@@ -266,7 +265,7 @@
266 // cell-index = <2>; 265 // cell-index = <2>;
267 // reg = <2400 100>; 266 // reg = <2400 100>;
268 // interrupts = <2 3 0>; 267 // interrupts = <2 3 0>;
269 // interrupt-parent = <500>; 268 // interrupt-parent = <&mpc5200_pic>;
270 //}; 269 //};
271 270
272 // PSC4 in uart mode example 271 // PSC4 in uart mode example
@@ -276,7 +275,7 @@
276 // cell-index = <3>; 275 // cell-index = <3>;
277 // reg = <2600 100>; 276 // reg = <2600 100>;
278 // interrupts = <2 b 0>; 277 // interrupts = <2 b 0>;
279 // interrupt-parent = <500>; 278 // interrupt-parent = <&mpc5200_pic>;
280 //}; 279 //};
281 280
282 // PSC5 in uart mode example 281 // PSC5 in uart mode example
@@ -286,7 +285,7 @@
286 // cell-index = <4>; 285 // cell-index = <4>;
287 // reg = <2800 100>; 286 // reg = <2800 100>;
288 // interrupts = <2 c 0>; 287 // interrupts = <2 c 0>;
289 // interrupt-parent = <500>; 288 // interrupt-parent = <&mpc5200_pic>;
290 //}; 289 //};
291 290
292 // PSC6 in spi mode example 291 // PSC6 in spi mode example
@@ -296,7 +295,7 @@
296 // cell-index = <5>; 295 // cell-index = <5>;
297 // reg = <2c00 100>; 296 // reg = <2c00 100>;
298 // interrupts = <2 4 0>; 297 // interrupts = <2 4 0>;
299 // interrupt-parent = <500>; 298 // interrupt-parent = <&mpc5200_pic>;
300 //}; 299 //};
301 300
302 ethernet@3000 { 301 ethernet@3000 {
@@ -305,7 +304,7 @@
305 reg = <3000 800>; 304 reg = <3000 800>;
306 mac-address = [ 02 03 04 05 06 07 ]; // Bad! 305 mac-address = [ 02 03 04 05 06 07 ]; // Bad!
307 interrupts = <2 5 0>; 306 interrupts = <2 5 0>;
308 interrupt-parent = <500>; 307 interrupt-parent = <&mpc5200_pic>;
309 }; 308 };
310 309
311 ata@3a00 { 310 ata@3a00 {
@@ -313,7 +312,7 @@
313 compatible = "mpc5200-ata"; 312 compatible = "mpc5200-ata";
314 reg = <3a00 100>; 313 reg = <3a00 100>;
315 interrupts = <2 7 0>; 314 interrupts = <2 7 0>;
316 interrupt-parent = <500>; 315 interrupt-parent = <&mpc5200_pic>;
317 }; 316 };
318 317
319 i2c@3d00 { 318 i2c@3d00 {
@@ -322,7 +321,7 @@
322 cell-index = <0>; 321 cell-index = <0>;
323 reg = <3d00 40>; 322 reg = <3d00 40>;
324 interrupts = <2 f 0>; 323 interrupts = <2 f 0>;
325 interrupt-parent = <500>; 324 interrupt-parent = <&mpc5200_pic>;
326 fsl5200-clocking; 325 fsl5200-clocking;
327 }; 326 };
328 327
@@ -332,7 +331,7 @@
332 cell-index = <1>; 331 cell-index = <1>;
333 reg = <3d40 40>; 332 reg = <3d40 40>;
334 interrupts = <2 10 0>; 333 interrupts = <2 10 0>;
335 interrupt-parent = <500>; 334 interrupt-parent = <&mpc5200_pic>;
336 fsl5200-clocking; 335 fsl5200-clocking;
337 }; 336 };
338 sram@8000 { 337 sram@8000 {
diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts
index 00211b39a34..f242531f045 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -62,9 +62,8 @@
62 reg = <200 38>; 62 reg = <200 38>;
63 }; 63 };
64 64
65 pic@500 { 65 mpc5200_pic: pic@500 {
66 // 5200 interrupts are encoded into two levels; 66 // 5200 interrupts are encoded into two levels;
67 linux,phandle = <500>;
68 interrupt-controller; 67 interrupt-controller;
69 #interrupt-cells = <3>; 68 #interrupt-cells = <3>;
70 device_type = "interrupt-controller"; 69 device_type = "interrupt-controller";
@@ -79,7 +78,7 @@
79 cell-index = <0>; 78 cell-index = <0>;
80 reg = <600 10>; 79 reg = <600 10>;
81 interrupts = <1 9 0>; 80 interrupts = <1 9 0>;
82 interrupt-parent = <500>; 81 interrupt-parent = <&mpc5200_pic>;
83 has-wdt; 82 has-wdt;
84 }; 83 };
85 84
@@ -89,7 +88,7 @@
89 cell-index = <1>; 88 cell-index = <1>;
90 reg = <610 10>; 89 reg = <610 10>;
91 interrupts = <1 a 0>; 90 interrupts = <1 a 0>;
92 interrupt-parent = <500>; 91 interrupt-parent = <&mpc5200_pic>;
93 }; 92 };
94 93
95 gpt@620 { // General Purpose Timer 94 gpt@620 { // General Purpose Timer
@@ -98,7 +97,7 @@
98 cell-index = <2>; 97 cell-index = <2>;
99 reg = <620 10>; 98 reg = <620 10>;
100 interrupts = <1 b 0>; 99 interrupts = <1 b 0>;
101 interrupt-parent = <500>; 100 interrupt-parent = <&mpc5200_pic>;
102 }; 101 };
103 102
104 gpt@630 { // General Purpose Timer 103 gpt@630 { // General Purpose Timer
@@ -107,7 +106,7 @@
107 cell-index = <3>; 106 cell-index = <3>;
108 reg = <630 10>; 107 reg = <630 10>;
109 interrupts = <1 c 0>; 108 interrupts = <1 c 0>;
110 interrupt-parent = <500>; 109 interrupt-parent = <&mpc5200_pic>;
111 }; 110 };
112 111
113 gpt@640 { // General Purpose Timer 112 gpt@640 { // General Purpose Timer
@@ -116,7 +115,7 @@
116 cell-index = <4>; 115 cell-index = <4>;
117 reg = <640 10>; 116 reg = <640 10>;
118 interrupts = <1 d 0>; 117 interrupts = <1 d 0>;
119 interrupt-parent = <500>; 118 interrupt-parent = <&mpc5200_pic>;
120 }; 119 };
121 120
122 gpt@650 { // General Purpose Timer 121 gpt@650 { // General Purpose Timer
@@ -125,7 +124,7 @@
125 cell-index = <5>; 124 cell-index = <5>;
126 reg = <650 10>; 125 reg = <650 10>;
127 interrupts = <1 e 0>; 126 interrupts = <1 e 0>;
128 interrupt-parent = <500>; 127 interrupt-parent = <&mpc5200_pic>;
129 }; 128 };
130 129
131 gpt@660 { // General Purpose Timer 130 gpt@660 { // General Purpose Timer
@@ -134,7 +133,7 @@
134 cell-index = <6>; 133 cell-index = <6>;
135 reg = <660 10>; 134 reg = <660 10>;
136 interrupts = <1 f 0>; 135 interrupts = <1 f 0>;
137 interrupt-parent = <500>; 136 interrupt-parent = <&mpc5200_pic>;
138 }; 137 };
139 138
140 gpt@670 { // General Purpose Timer 139 gpt@670 { // General Purpose Timer
@@ -143,7 +142,7 @@
143 cell-index = <7>; 142 cell-index = <7>;
144 reg = <670 10>; 143 reg = <670 10>;
145 interrupts = <1 10 0>; 144 interrupts = <1 10 0>;
146 interrupt-parent = <500>; 145 interrupt-parent = <&mpc5200_pic>;
147 }; 146 };
148 147
149 rtc@800 { // Real time clock 148 rtc@800 { // Real time clock
@@ -151,7 +150,7 @@
151 device_type = "rtc"; 150 device_type = "rtc";
152 reg = <800 100>; 151 reg = <800 100>;
153 interrupts = <1 5 0 1 6 0>; 152 interrupts = <1 5 0 1 6 0>;
154 interrupt-parent = <500>; 153 interrupt-parent = <&mpc5200_pic>;
155 }; 154 };
156 155
157 mscan@900 { 156 mscan@900 {
@@ -159,7 +158,7 @@
159 compatible = "mpc5200b-mscan\0mpc5200-mscan"; 158 compatible = "mpc5200b-mscan\0mpc5200-mscan";
160 cell-index = <0>; 159 cell-index = <0>;
161 interrupts = <2 11 0>; 160 interrupts = <2 11 0>;
162 interrupt-parent = <500>; 161 interrupt-parent = <&mpc5200_pic>;
163 reg = <900 80>; 162 reg = <900 80>;
164 }; 163 };
165 164
@@ -168,7 +167,7 @@
168 compatible = "mpc5200b-mscan\0mpc5200-mscan"; 167 compatible = "mpc5200b-mscan\0mpc5200-mscan";
169 cell-index = <1>; 168 cell-index = <1>;
170 interrupts = <2 12 0>; 169 interrupts = <2 12 0>;
171 interrupt-parent = <500>; 170 interrupt-parent = <&mpc5200_pic>;
172 reg = <980 80>; 171 reg = <980 80>;
173 }; 172 };
174 173
@@ -176,14 +175,14 @@
176 compatible = "mpc5200b-gpio\0mpc5200-gpio"; 175 compatible = "mpc5200b-gpio\0mpc5200-gpio";
177 reg = <b00 40>; 176 reg = <b00 40>;
178 interrupts = <1 7 0>; 177 interrupts = <1 7 0>;
179 interrupt-parent = <500>; 178 interrupt-parent = <&mpc5200_pic>;
180 }; 179 };
181 180
182 gpio-wkup@c00 { 181 gpio-wkup@c00 {
183 compatible = "mpc5200b-gpio-wkup\0mpc5200-gpio-wkup"; 182 compatible = "mpc5200b-gpio-wkup\0mpc5200-gpio-wkup";
184 reg = <c00 40>; 183 reg = <c00 40>;
185 interrupts = <1 8 0 0 3 0>; 184 interrupts = <1 8 0 0 3 0>;
186 interrupt-parent = <500>; 185 interrupt-parent = <&mpc5200_pic>;
187 }; 186 };
188 187
189 pci@0d00 { 188 pci@0d00 {
@@ -194,18 +193,18 @@
194 compatible = "mpc5200b-pci\0mpc5200-pci"; 193 compatible = "mpc5200b-pci\0mpc5200-pci";
195 reg = <d00 100>; 194 reg = <d00 100>;
196 interrupt-map-mask = <f800 0 0 7>; 195 interrupt-map-mask = <f800 0 0 7>;
197 interrupt-map = <c000 0 0 1 500 0 0 3 // 1st slot 196 interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot
198 c000 0 0 2 500 1 1 3 197 c000 0 0 2 &mpc5200_pic 1 1 3
199 c000 0 0 3 500 1 2 3 198 c000 0 0 3 &mpc5200_pic 1 2 3
200 c000 0 0 4 500 1 3 3 199 c000 0 0 4 &mpc5200_pic 1 3 3
201 200
202 c800 0 0 1 500 1 1 3 // 2nd slot 201 c800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot
203 c800 0 0 2 500 1 2 3 202 c800 0 0 2 &mpc5200_pic 1 2 3
204 c800 0 0 3 500 1 3 3 203 c800 0 0 3 &mpc5200_pic 1 3 3
205 c800 0 0 4 500 0 0 3>; 204 c800 0 0 4 &mpc5200_pic 0 0 3>;
206 clock-frequency = <0>; // From boot loader 205 clock-frequency = <0>; // From boot loader
207 interrupts = <2 8 0 2 9 0 2 a 0>; 206 interrupts = <2 8 0 2 9 0 2 a 0>;
208 interrupt-parent = <500>; 207 interrupt-parent = <&mpc5200_pic>;
209 bus-range = <0 0>; 208 bus-range = <0 0>;
210 ranges = <42000000 0 80000000 80000000 0 20000000 209 ranges = <42000000 0 80000000 80000000 0 20000000
211 02000000 0 a0000000 a0000000 0 10000000 210 02000000 0 a0000000 a0000000 0 10000000
@@ -217,7 +216,7 @@
217 compatible = "mpc5200b-spi\0mpc5200-spi"; 216 compatible = "mpc5200b-spi\0mpc5200-spi";
218 reg = <f00 20>; 217 reg = <f00 20>;
219 interrupts = <2 d 0 2 e 0>; 218 interrupts = <2 d 0 2 e 0>;
220 interrupt-parent = <500>; 219 interrupt-parent = <&mpc5200_pic>;
221 }; 220 };
222 221
223 usb@1000 { 222 usb@1000 {
@@ -225,7 +224,7 @@
225 compatible = "mpc5200b-ohci\0mpc5200-ohci\0ohci-be"; 224 compatible = "mpc5200b-ohci\0mpc5200-ohci\0ohci-be";
226 reg = <1000 ff>; 225 reg = <1000 ff>;
227 interrupts = <2 6 0>; 226 interrupts = <2 6 0>;
228 interrupt-parent = <500>; 227 interrupt-parent = <&mpc5200_pic>;
229 }; 228 };
230 229
231 bestcomm@1200 { 230 bestcomm@1200 {
@@ -236,7 +235,7 @@
236 3 4 0 3 5 0 3 6 0 3 7 0 235 3 4 0 3 5 0 3 6 0 3 7 0
237 3 8 0 3 9 0 3 a 0 3 b 0 236 3 8 0 3 9 0 3 a 0 3 b 0
238 3 c 0 3 d 0 3 e 0 3 f 0>; 237 3 c 0 3 d 0 3 e 0 3 f 0>;
239 interrupt-parent = <500>; 238 interrupt-parent = <&mpc5200_pic>;
240 }; 239 };
241 240
242 xlb@1f00 { 241 xlb@1f00 {
@@ -251,7 +250,7 @@
251 cell-index = <0>; 250 cell-index = <0>;
252 reg = <2000 100>; 251 reg = <2000 100>;
253 interrupts = <2 1 0>; 252 interrupts = <2 1 0>;
254 interrupt-parent = <500>; 253 interrupt-parent = <&mpc5200_pic>;
255 }; 254 };
256 255
257 // PSC2 in ac97 mode example 256 // PSC2 in ac97 mode example
@@ -261,7 +260,7 @@
261 // cell-index = <1>; 260 // cell-index = <1>;
262 // reg = <2200 100>; 261 // reg = <2200 100>;
263 // interrupts = <2 2 0>; 262 // interrupts = <2 2 0>;
264 // interrupt-parent = <500>; 263 // interrupt-parent = <&mpc5200_pic>;
265 //}; 264 //};
266 265
267 // PSC3 in CODEC mode example 266 // PSC3 in CODEC mode example
@@ -271,7 +270,7 @@
271 // cell-index = <2>; 270 // cell-index = <2>;
272 // reg = <2400 100>; 271 // reg = <2400 100>;
273 // interrupts = <2 3 0>; 272 // interrupts = <2 3 0>;
274 // interrupt-parent = <500>; 273 // interrupt-parent = <&mpc5200_pic>;
275 //}; 274 //};
276 275
277 // PSC4 in uart mode example 276 // PSC4 in uart mode example
@@ -281,7 +280,7 @@
281 // cell-index = <3>; 280 // cell-index = <3>;
282 // reg = <2600 100>; 281 // reg = <2600 100>;
283 // interrupts = <2 b 0>; 282 // interrupts = <2 b 0>;
284 // interrupt-parent = <500>; 283 // interrupt-parent = <&mpc5200_pic>;
285 //}; 284 //};
286 285
287 // PSC5 in uart mode example 286 // PSC5 in uart mode example
@@ -291,7 +290,7 @@
291 // cell-index = <4>; 290 // cell-index = <4>;
292 // reg = <2800 100>; 291 // reg = <2800 100>;
293 // interrupts = <2 c 0>; 292 // interrupts = <2 c 0>;
294 // interrupt-parent = <500>; 293 // interrupt-parent = <&mpc5200_pic>;
295 //}; 294 //};
296 295
297 // PSC6 in spi mode example 296 // PSC6 in spi mode example
@@ -301,7 +300,7 @@
301 // cell-index = <5>; 300 // cell-index = <5>;
302 // reg = <2c00 100>; 301 // reg = <2c00 100>;
303 // interrupts = <2 4 0>; 302 // interrupts = <2 4 0>;
304 // interrupt-parent = <500>; 303 // interrupt-parent = <&mpc5200_pic>;
305 //}; 304 //};
306 305
307 ethernet@3000 { 306 ethernet@3000 {
@@ -310,7 +309,7 @@
310 reg = <3000 800>; 309 reg = <3000 800>;
311 mac-address = [ 02 03 04 05 06 07 ]; // Bad! 310 mac-address = [ 02 03 04 05 06 07 ]; // Bad!
312 interrupts = <2 5 0>; 311 interrupts = <2 5 0>;
313 interrupt-parent = <500>; 312 interrupt-parent = <&mpc5200_pic>;
314 }; 313 };
315 314
316 ata@3a00 { 315 ata@3a00 {
@@ -318,7 +317,7 @@
318 compatible = "mpc5200b-ata\0mpc5200-ata"; 317 compatible = "mpc5200b-ata\0mpc5200-ata";
319 reg = <3a00 100>; 318 reg = <3a00 100>;
320 interrupts = <2 7 0>; 319 interrupts = <2 7 0>;
321 interrupt-parent = <500>; 320 interrupt-parent = <&mpc5200_pic>;
322 }; 321 };
323 322
324 i2c@3d00 { 323 i2c@3d00 {
@@ -327,7 +326,7 @@
327 cell-index = <0>; 326 cell-index = <0>;
328 reg = <3d00 40>; 327 reg = <3d00 40>;
329 interrupts = <2 f 0>; 328 interrupts = <2 f 0>;
330 interrupt-parent = <500>; 329 interrupt-parent = <&mpc5200_pic>;
331 fsl5200-clocking; 330 fsl5200-clocking;
332 }; 331 };
333 332
@@ -337,7 +336,7 @@
337 cell-index = <1>; 336 cell-index = <1>;
338 reg = <3d40 40>; 337 reg = <3d40 40>;
339 interrupts = <2 10 0>; 338 interrupts = <2 10 0>;
340 interrupt-parent = <500>; 339 interrupt-parent = <&mpc5200_pic>;
341 fsl5200-clocking; 340 fsl5200-clocking;
342 }; 341 };
343 sram@8000 { 342 sram@8000 {
diff --git a/arch/powerpc/boot/dts/mpc7448hpc2.dts b/arch/powerpc/boot/dts/mpc7448hpc2.dts
index 6fa3754f293..765c306ecf8 100644
--- a/arch/powerpc/boot/dts/mpc7448hpc2.dts
+++ b/arch/powerpc/boot/dts/mpc7448hpc2.dts
@@ -16,12 +16,10 @@
16 compatible = "mpc74xx"; 16 compatible = "mpc74xx";
17 #address-cells = <1>; 17 #address-cells = <1>;
18 #size-cells = <1>; 18 #size-cells = <1>;
19 linux,phandle = <100>;
20 19
21 cpus { 20 cpus {
22 #address-cells = <1>; 21 #address-cells = <1>;
23 #size-cells =<0>; 22 #size-cells =<0>;
24 linux,phandle = <200>;
25 23
26 PowerPC,7448@0 { 24 PowerPC,7448@0 {
27 device_type = "cpu"; 25 device_type = "cpu";
@@ -34,13 +32,11 @@
34 clock-frequency = <0>; // From U-Boot 32 clock-frequency = <0>; // From U-Boot
35 bus-frequency = <0>; // From U-Boot 33 bus-frequency = <0>; // From U-Boot
36 32-bit; 34 32-bit;
37 linux,phandle = <201>;
38 }; 35 };
39 }; 36 };
40 37
41 memory { 38 memory {
42 device_type = "memory"; 39 device_type = "memory";
43 linux,phandle = <300>;
44 reg = <00000000 20000000 // DDR2 512M at 0 40 reg = <00000000 20000000 // DDR2 512M at 0
45 >; 41 >;
46 }; 42 };
@@ -55,7 +51,7 @@
55 bus-frequency = <0>; 51 bus-frequency = <0>;
56 52
57 i2c@7000 { 53 i2c@7000 {
58 interrupt-parent = <7400>; 54 interrupt-parent = <&mpic>;
59 interrupts = <E 0>; 55 interrupts = <E 0>;
60 reg = <7000 400>; 56 reg = <7000 400>;
61 device_type = "i2c"; 57 device_type = "i2c";
@@ -66,18 +62,16 @@
66 device_type = "mdio"; 62 device_type = "mdio";
67 compatible = "tsi-ethernet"; 63 compatible = "tsi-ethernet";
68 64
69 ethernet-phy@6000 { 65 phy8: ethernet-phy@6000 {
70 linux,phandle = <6000>; 66 interrupt-parent = <&mpic>;
71 interrupt-parent = <7400>;
72 interrupts = <2 1>; 67 interrupts = <2 1>;
73 reg = <6000 50>; 68 reg = <6000 50>;
74 phy-id = <8>; 69 phy-id = <8>;
75 device_type = "ethernet-phy"; 70 device_type = "ethernet-phy";
76 }; 71 };
77 72
78 ethernet-phy@6400 { 73 phy9: ethernet-phy@6400 {
79 linux,phandle = <6400>; 74 interrupt-parent = <&mpic>;
80 interrupt-parent = <7400>;
81 interrupts = <2 1>; 75 interrupts = <2 1>;
82 reg = <6000 50>; 76 reg = <6000 50>;
83 phy-id = <9>; 77 phy-id = <9>;
@@ -94,8 +88,8 @@
94 reg = <6000 200>; 88 reg = <6000 200>;
95 address = [ 00 06 D2 00 00 01 ]; 89 address = [ 00 06 D2 00 00 01 ];
96 interrupts = <10 2>; 90 interrupts = <10 2>;
97 interrupt-parent = <7400>; 91 interrupt-parent = <&mpic>;
98 phy-handle = <6000>; 92 phy-handle = <&phy8>;
99 }; 93 };
100 94
101 ethernet@6600 { 95 ethernet@6600 {
@@ -107,8 +101,8 @@
107 reg = <6400 200>; 101 reg = <6400 200>;
108 address = [ 00 06 D2 00 00 02 ]; 102 address = [ 00 06 D2 00 00 02 ];
109 interrupts = <11 2>; 103 interrupts = <11 2>;
110 interrupt-parent = <7400>; 104 interrupt-parent = <&mpic>;
111 phy-handle = <6400>; 105 phy-handle = <&phy9>;
112 }; 106 };
113 107
114 serial@7808 { 108 serial@7808 {
@@ -117,7 +111,7 @@
117 reg = <7808 200>; 111 reg = <7808 200>;
118 clock-frequency = <3f6b5a00>; 112 clock-frequency = <3f6b5a00>;
119 interrupts = <c 0>; 113 interrupts = <c 0>;
120 interrupt-parent = <7400>; 114 interrupt-parent = <&mpic>;
121 }; 115 };
122 116
123 serial@7c08 { 117 serial@7c08 {
@@ -126,11 +120,10 @@
126 reg = <7c08 200>; 120 reg = <7c08 200>;
127 clock-frequency = <3f6b5a00>; 121 clock-frequency = <3f6b5a00>;
128 interrupts = <d 0>; 122 interrupts = <d 0>;
129 interrupt-parent = <7400>; 123 interrupt-parent = <&mpic>;
130 }; 124 };
131 125
132 pic@7400 { 126 mpic: pic@7400 {
133 linux,phandle = <7400>;
134 clock-frequency = <0>; 127 clock-frequency = <0>;
135 interrupt-controller; 128 interrupt-controller;
136 #address-cells = <0>; 129 #address-cells = <0>;
@@ -144,7 +137,6 @@
144 pci@1000 { 137 pci@1000 {
145 compatible = "tsi10x"; 138 compatible = "tsi10x";
146 device_type = "pci"; 139 device_type = "pci";
147 linux,phandle = <1000>;
148 #interrupt-cells = <1>; 140 #interrupt-cells = <1>;
149 #size-cells = <2>; 141 #size-cells = <2>;
150 #address-cells = <3>; 142 #address-cells = <3>;
@@ -153,37 +145,37 @@
153 ranges = <02000000 0 e0000000 e0000000 0 1A000000 145 ranges = <02000000 0 e0000000 e0000000 0 1A000000
154 01000000 0 00000000 fa000000 0 00010000>; 146 01000000 0 00000000 fa000000 0 00010000>;
155 clock-frequency = <7f28154>; 147 clock-frequency = <7f28154>;
156 interrupt-parent = <7400>; 148 interrupt-parent = <&mpic>;
157 interrupts = <17 2>; 149 interrupts = <17 2>;
158 interrupt-map-mask = <f800 0 0 7>; 150 interrupt-map-mask = <f800 0 0 7>;
159 interrupt-map = < 151 interrupt-map = <
160 152
161 /* IDSEL 0x11 */ 153 /* IDSEL 0x11 */
162 0800 0 0 1 1180 24 0 154 0800 0 0 1 &RT0 24 0
163 0800 0 0 2 1180 25 0 155 0800 0 0 2 &RT0 25 0
164 0800 0 0 3 1180 26 0 156 0800 0 0 3 &RT0 26 0
165 0800 0 0 4 1180 27 0 157 0800 0 0 4 &RT0 27 0
166 158
167 /* IDSEL 0x12 */ 159 /* IDSEL 0x12 */
168 1000 0 0 1 1180 25 0 160 1000 0 0 1 &RT0 25 0
169 1000 0 0 2 1180 26 0 161 1000 0 0 2 &RT0 26 0
170 1000 0 0 3 1180 27 0 162 1000 0 0 3 &RT0 27 0
171 1000 0 0 4 1180 24 0 163 1000 0 0 4 &RT0 24 0
172 164
173 /* IDSEL 0x13 */ 165 /* IDSEL 0x13 */
174 1800 0 0 1 1180 26 0 166 1800 0 0 1 &RT0 26 0
175 1800 0 0 2 1180 27 0 167 1800 0 0 2 &RT0 27 0
176 1800 0 0 3 1180 24 0 168 1800 0 0 3 &RT0 24 0
177 1800 0 0 4 1180 25 0 169 1800 0 0 4 &RT0 25 0
178 170
179 /* IDSEL 0x14 */ 171 /* IDSEL 0x14 */
180 2000 0 0 1 1180 27 0 172 2000 0 0 1 &RT0 27 0
181 2000 0 0 2 1180 24 0 173 2000 0 0 2 &RT0 24 0
182 2000 0 0 3 1180 25 0 174 2000 0 0 3 &RT0 25 0
183 2000 0 0 4 1180 26 0 175 2000 0 0 4 &RT0 26 0
184 >; 176 >;
185 router@1180 { 177
186 linux,phandle = <1180>; 178 RT0: router@1180 {
187 clock-frequency = <0>; 179 clock-frequency = <0>;
188 interrupt-controller; 180 interrupt-controller;
189 device_type = "pic-router"; 181 device_type = "pic-router";
@@ -192,7 +184,7 @@
192 built-in; 184 built-in;
193 big-endian; 185 big-endian;
194 interrupts = <17 2>; 186 interrupts = <17 2>;
195 interrupt-parent = <7400>; 187 interrupt-parent = <&mpic>;
196 }; 188 };
197 }; 189 };
198 }; 190 };
diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts
index f261d647ac8..d91e81c009f 100644
--- a/arch/powerpc/boot/dts/mpc8540ads.dts
+++ b/arch/powerpc/boot/dts/mpc8540ads.dts
@@ -48,6 +48,22 @@
48 reg = <e0000000 00100000>; // CCSRBAR 1M 48 reg = <e0000000 00100000>; // CCSRBAR 1M
49 bus-frequency = <0>; 49 bus-frequency = <0>;
50 50
51 memory-controller@2000 {
52 compatible = "fsl,8540-memory-controller";
53 reg = <2000 1000>;
54 interrupt-parent = <&mpic>;
55 interrupts = <2 2>;
56 };
57
58 l2-cache-controller@20000 {
59 compatible = "fsl,8540-l2-cache-controller";
60 reg = <20000 1000>;
61 cache-line-size = <20>; // 32 bytes
62 cache-size = <40000>; // L2, 256K
63 interrupt-parent = <&mpic>;
64 interrupts = <0 2>;
65 };
66
51 i2c@3000 { 67 i2c@3000 {
52 device_type = "i2c"; 68 device_type = "i2c";
53 compatible = "fsl-i2c"; 69 compatible = "fsl-i2c";
diff --git a/arch/powerpc/boot/dts/mpc8541cds.dts b/arch/powerpc/boot/dts/mpc8541cds.dts
index 5fdcb69554f..4f2c3af2e05 100644
--- a/arch/powerpc/boot/dts/mpc8541cds.dts
+++ b/arch/powerpc/boot/dts/mpc8541cds.dts
@@ -48,6 +48,22 @@
48 reg = <e0000000 00100000>; // CCSRBAR 1M 48 reg = <e0000000 00100000>; // CCSRBAR 1M
49 bus-frequency = <0>; 49 bus-frequency = <0>;
50 50
51 memory-controller@2000 {
52 compatible = "fsl,8541-memory-controller";
53 reg = <2000 1000>;
54 interrupt-parent = <&mpic>;
55 interrupts = <2 2>;
56 };
57
58 l2-cache-controller@20000 {
59 compatible = "fsl,8541-l2-cache-controller";
60 reg = <20000 1000>;
61 cache-line-size = <20>; // 32 bytes
62 cache-size = <40000>; // L2, 256K
63 interrupt-parent = <&mpic>;
64 interrupts = <0 2>;
65 };
66
51 i2c@3000 { 67 i2c@3000 {
52 device_type = "i2c"; 68 device_type = "i2c";
53 compatible = "fsl-i2c"; 69 compatible = "fsl-i2c";
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index 6b084605bb4..3033599e74e 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -48,6 +48,22 @@
48 reg = <e0000000 00100000>; // CCSRBAR 1M 48 reg = <e0000000 00100000>; // CCSRBAR 1M
49 bus-frequency = <0>; // Filled out by uboot. 49 bus-frequency = <0>; // Filled out by uboot.
50 50
51 memory-controller@2000 {
52 compatible = "fsl,8544-memory-controller";
53 reg = <2000 1000>;
54 interrupt-parent = <&mpic>;
55 interrupts = <2 2>;
56 };
57
58 l2-cache-controller@20000 {
59 compatible = "fsl,8544-l2-cache-controller";
60 reg = <20000 1000>;
61 cache-line-size = <20>; // 32 bytes
62 cache-size = <40000>; // L2, 256K
63 interrupt-parent = <&mpic>;
64 interrupts = <0 2>;
65 };
66
51 i2c@3000 { 67 i2c@3000 {
52 device_type = "i2c"; 68 device_type = "i2c";
53 compatible = "fsl-i2c"; 69 compatible = "fsl-i2c";
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index b2b2200d042..ad96381033c 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -48,6 +48,22 @@
48 reg = <e0000000 00100000>; // CCSRBAR 1M 48 reg = <e0000000 00100000>; // CCSRBAR 1M
49 bus-frequency = <0>; 49 bus-frequency = <0>;
50 50
51 memory-controller@2000 {
52 compatible = "fsl,8548-memory-controller";
53 reg = <2000 1000>;
54 interrupt-parent = <&mpic>;
55 interrupts = <2 2>;
56 };
57
58 l2-cache-controller@20000 {
59 compatible = "fsl,8548-l2-cache-controller";
60 reg = <20000 1000>;
61 cache-line-size = <20>; // 32 bytes
62 cache-size = <80000>; // L2, 512K
63 interrupt-parent = <&mpic>;
64 interrupts = <0 2>;
65 };
66
51 i2c@3000 { 67 i2c@3000 {
52 device_type = "i2c"; 68 device_type = "i2c";
53 compatible = "fsl-i2c"; 69 compatible = "fsl-i2c";
diff --git a/arch/powerpc/boot/dts/mpc8555cds.dts b/arch/powerpc/boot/dts/mpc8555cds.dts
index 68a4795720d..951ed92f115 100644
--- a/arch/powerpc/boot/dts/mpc8555cds.dts
+++ b/arch/powerpc/boot/dts/mpc8555cds.dts
@@ -48,6 +48,22 @@
48 reg = <e0000000 00100000>; // CCSRBAR 1M 48 reg = <e0000000 00100000>; // CCSRBAR 1M
49 bus-frequency = <0>; 49 bus-frequency = <0>;
50 50
51 memory-controller@2000 {
52 compatible = "fsl,8555-memory-controller";
53 reg = <2000 1000>;
54 interrupt-parent = <&mpic>;
55 interrupts = <2 2>;
56 };
57
58 l2-cache-controller@20000 {
59 compatible = "fsl,8555-l2-cache-controller";
60 reg = <20000 1000>;
61 cache-line-size = <20>; // 32 bytes
62 cache-size = <40000>; // L2, 256K
63 interrupt-parent = <&mpic>;
64 interrupts = <0 2>;
65 };
66
51 i2c@3000 { 67 i2c@3000 {
52 device_type = "i2c"; 68 device_type = "i2c";
53 compatible = "fsl-i2c"; 69 compatible = "fsl-i2c";
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index 1f2afe9291d..80682152b0c 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -48,6 +48,22 @@
48 reg = <e0000000 00000200>; 48 reg = <e0000000 00000200>;
49 bus-frequency = <13ab6680>; 49 bus-frequency = <13ab6680>;
50 50
51 memory-controller@2000 {
52 compatible = "fsl,8540-memory-controller";
53 reg = <2000 1000>;
54 interrupt-parent = <&mpic>;
55 interrupts = <2 2>;
56 };
57
58 l2-cache-controller@20000 {
59 compatible = "fsl,8540-l2-cache-controller";
60 reg = <20000 1000>;
61 cache-line-size = <20>; // 32 bytes
62 cache-size = <40000>; // L2, 256K
63 interrupt-parent = <&mpic>;
64 interrupts = <0 2>;
65 };
66
51 mdio@24520 { 67 mdio@24520 {
52 device_type = "mdio"; 68 device_type = "mdio";
53 compatible = "gianfar"; 69 compatible = "gianfar";
@@ -110,7 +126,7 @@
110 #address-cells = <3>; 126 #address-cells = <3>;
111 compatible = "85xx"; 127 compatible = "85xx";
112 device_type = "pci"; 128 device_type = "pci";
113 reg = <8000 400>; 129 reg = <8000 1000>;
114 clock-frequency = <3f940aa>; 130 clock-frequency = <3f940aa>;
115 interrupt-map-mask = <f800 0 0 7>; 131 interrupt-map-mask = <f800 0 0 7>;
116 interrupt-map = < 132 interrupt-map = <
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 948a3b61bd4..a123ec9456b 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -57,6 +57,22 @@
57 reg = <e0000000 00100000>; 57 reg = <e0000000 00100000>;
58 bus-frequency = <0>; 58 bus-frequency = <0>;
59 59
60 memory-controller@2000 {
61 compatible = "fsl,8568-memory-controller";
62 reg = <2000 1000>;
63 interrupt-parent = <&mpic>;
64 interrupts = <2 2>;
65 };
66
67 l2-cache-controller@20000 {
68 compatible = "fsl,8568-l2-cache-controller";
69 reg = <20000 1000>;
70 cache-line-size = <20>; // 32 bytes
71 cache-size = <80000>; // L2, 512K
72 interrupt-parent = <&mpic>;
73 interrupts = <0 2>;
74 };
75
60 i2c@3000 { 76 i2c@3000 {
61 device_type = "i2c"; 77 device_type = "i2c";
62 compatible = "fsl-i2c"; 78 compatible = "fsl-i2c";
diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c
index d00fbd92a45..b732644788d 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -891,28 +891,27 @@ int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
891 struct ft_atom atom; 891 struct ft_atom atom;
892 void *node; 892 void *node;
893 char *p, *next; 893 char *p, *next;
894 int nextra, depth; 894 int nextra;
895 895
896 node = ft_node_ph2node(cxt, phandle); 896 node = ft_node_ph2node(cxt, phandle);
897 if (node == NULL) 897 if (node == NULL)
898 return -1; 898 return -1;
899 899
900 depth = 0; 900 next = ft_next(cxt, node, &atom);
901 p = node; 901 if (atom.tag != OF_DT_BEGIN_NODE)
902 /* phandle didn't point to a node */
903 return -1;
904 p = next;
902 905
903 while ((next = ft_next(cxt, p, &atom)) != NULL) { 906 while ((next = ft_next(cxt, p, &atom)) != NULL) {
904 switch (atom.tag) { 907 switch (atom.tag) {
905 case OF_DT_BEGIN_NODE: 908 case OF_DT_BEGIN_NODE: /* properties must go before subnodes */
906 ++depth;
907 break;
908 case OF_DT_END_NODE: 909 case OF_DT_END_NODE:
909 if (--depth > 0)
910 break;
911 /* haven't found the property, insert here */ 910 /* haven't found the property, insert here */
912 cxt->p = p; 911 cxt->p = p;
913 return ft_prop(cxt, propname, buf, buflen); 912 return ft_prop(cxt, propname, buf, buflen);
914 case OF_DT_PROP: 913 case OF_DT_PROP:
915 if ((depth != 1) || strcmp(atom.name, propname)) 914 if (strcmp(atom.name, propname))
916 break; 915 break;
917 /* found an existing property, overwrite it */ 916 /* found an existing property, overwrite it */
918 nextra = _ALIGN(buflen, 4) - _ALIGN(atom.size, 4); 917 nextra = _ALIGN(buflen, 4) - _ALIGN(atom.size, 4);
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig
index 6061e5f7696..02c428affc8 100644
--- a/arch/powerpc/configs/cell_defconfig
+++ b/arch/powerpc/configs/cell_defconfig
@@ -163,7 +163,6 @@ CONFIG_SPU_FS=m
163CONFIG_SPU_BASE=y 163CONFIG_SPU_BASE=y
164CONFIG_CBE_RAS=y 164CONFIG_CBE_RAS=y
165CONFIG_CBE_THERM=m 165CONFIG_CBE_THERM=m
166CONFIG_CBE_CPUFREQ=m
167CONFIG_PPC_NATIVE=y 166CONFIG_PPC_NATIVE=y
168CONFIG_UDBG_RTAS_CONSOLE=y 167CONFIG_UDBG_RTAS_CONSOLE=y
169CONFIG_PPC_UDBG_BEAT=y 168CONFIG_PPC_UDBG_BEAT=y
@@ -172,24 +171,12 @@ CONFIG_PPC_RTAS=y
172# CONFIG_RTAS_ERROR_LOGGING is not set 171# CONFIG_RTAS_ERROR_LOGGING is not set
173CONFIG_RTAS_PROC=y 172CONFIG_RTAS_PROC=y
174CONFIG_RTAS_FLASH=y 173CONFIG_RTAS_FLASH=y
175CONFIG_PPC_PMI=m 174# CONFIG_PPC_PMI is not set
176CONFIG_MMIO_NVRAM=y 175CONFIG_MMIO_NVRAM=y
177# CONFIG_PPC_MPC106 is not set 176# CONFIG_PPC_MPC106 is not set
178# CONFIG_PPC_970_NAP is not set 177# CONFIG_PPC_970_NAP is not set
179CONFIG_PPC_INDIRECT_IO=y 178CONFIG_PPC_INDIRECT_IO=y
180CONFIG_GENERIC_IOMAP=y 179CONFIG_GENERIC_IOMAP=y
181CONFIG_CPU_FREQ=y
182CONFIG_CPU_FREQ_TABLE=y
183CONFIG_CPU_FREQ_DEBUG=y
184CONFIG_CPU_FREQ_STAT=y
185# CONFIG_CPU_FREQ_STAT_DETAILS is not set
186CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
187# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
188CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
189CONFIG_CPU_FREQ_GOV_POWERSAVE=y
190CONFIG_CPU_FREQ_GOV_USERSPACE=y
191CONFIG_CPU_FREQ_GOV_ONDEMAND=y
192CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
193# CONFIG_CPU_FREQ_PMAC64 is not set 180# CONFIG_CPU_FREQ_PMAC64 is not set
194# CONFIG_WANT_EARLY_SERIAL is not set 181# CONFIG_WANT_EARLY_SERIAL is not set
195CONFIG_MPIC=y 182CONFIG_MPIC=y
diff --git a/arch/powerpc/configs/iseries_defconfig b/arch/powerpc/configs/iseries_defconfig
index 5fc87448704..af25118c8f2 100644
--- a/arch/powerpc/configs/iseries_defconfig
+++ b/arch/powerpc/configs/iseries_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.20-rc5 3# Linux kernel version: 2.6.22-rc1
4# Mon Jan 22 22:16:44 2007 4# Mon May 14 14:27:46 2007
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -40,6 +40,7 @@ CONFIG_PPC_FPU=y
40# CONFIG_PPC_OF_PLATFORM_PCI is not set 40# CONFIG_PPC_OF_PLATFORM_PCI is not set
41# CONFIG_ALTIVEC is not set 41# CONFIG_ALTIVEC is not set
42CONFIG_PPC_STD_MMU=y 42CONFIG_PPC_STD_MMU=y
43# CONFIG_PPC_MM_SLICES is not set
43CONFIG_VIRT_CPU_ACCOUNTING=y 44CONFIG_VIRT_CPU_ACCOUNTING=y
44CONFIG_SMP=y 45CONFIG_SMP=y
45CONFIG_NR_CPUS=32 46CONFIG_NR_CPUS=32
@@ -60,6 +61,7 @@ CONFIG_LOCALVERSION_AUTO=y
60CONFIG_SWAP=y 61CONFIG_SWAP=y
61CONFIG_SYSVIPC=y 62CONFIG_SYSVIPC=y
62# CONFIG_IPC_NS is not set 63# CONFIG_IPC_NS is not set
64CONFIG_SYSVIPC_SYSCTL=y
63CONFIG_POSIX_MQUEUE=y 65CONFIG_POSIX_MQUEUE=y
64# CONFIG_BSD_PROCESS_ACCT is not set 66# CONFIG_BSD_PROCESS_ACCT is not set
65# CONFIG_TASKSTATS is not set 67# CONFIG_TASKSTATS is not set
@@ -68,9 +70,11 @@ CONFIG_AUDIT=y
68CONFIG_AUDITSYSCALL=y 70CONFIG_AUDITSYSCALL=y
69CONFIG_IKCONFIG=y 71CONFIG_IKCONFIG=y
70CONFIG_IKCONFIG_PROC=y 72CONFIG_IKCONFIG_PROC=y
73CONFIG_LOG_BUF_SHIFT=17
71# CONFIG_CPUSETS is not set 74# CONFIG_CPUSETS is not set
72CONFIG_SYSFS_DEPRECATED=y 75CONFIG_SYSFS_DEPRECATED=y
73# CONFIG_RELAY is not set 76# CONFIG_RELAY is not set
77CONFIG_BLK_DEV_INITRD=y
74CONFIG_INITRAMFS_SOURCE="" 78CONFIG_INITRAMFS_SOURCE=""
75CONFIG_CC_OPTIMIZE_FOR_SIZE=y 79CONFIG_CC_OPTIMIZE_FOR_SIZE=y
76CONFIG_SYSCTL=y 80CONFIG_SYSCTL=y
@@ -85,14 +89,19 @@ CONFIG_BUG=y
85CONFIG_ELF_CORE=y 89CONFIG_ELF_CORE=y
86CONFIG_BASE_FULL=y 90CONFIG_BASE_FULL=y
87CONFIG_FUTEX=y 91CONFIG_FUTEX=y
92CONFIG_ANON_INODES=y
88CONFIG_EPOLL=y 93CONFIG_EPOLL=y
94CONFIG_SIGNALFD=y
95CONFIG_TIMERFD=y
96CONFIG_EVENTFD=y
89CONFIG_SHMEM=y 97CONFIG_SHMEM=y
90CONFIG_SLAB=y
91CONFIG_VM_EVENT_COUNTERS=y 98CONFIG_VM_EVENT_COUNTERS=y
99CONFIG_SLAB=y
100# CONFIG_SLUB is not set
101# CONFIG_SLOB is not set
92CONFIG_RT_MUTEXES=y 102CONFIG_RT_MUTEXES=y
93# CONFIG_TINY_SHMEM is not set 103# CONFIG_TINY_SHMEM is not set
94CONFIG_BASE_SMALL=0 104CONFIG_BASE_SMALL=0
95# CONFIG_SLOB is not set
96 105
97# 106#
98# Loadable module support 107# Loadable module support
@@ -131,15 +140,30 @@ CONFIG_PPC_MULTIPLATFORM=y
131# CONFIG_EMBEDDED6xx is not set 140# CONFIG_EMBEDDED6xx is not set
132# CONFIG_APUS is not set 141# CONFIG_APUS is not set
133# CONFIG_PPC_PSERIES is not set 142# CONFIG_PPC_PSERIES is not set
143CONFIG_LPARCFG=y
134CONFIG_PPC_ISERIES=y 144CONFIG_PPC_ISERIES=y
145
146#
147# iSeries device drivers
148#
149CONFIG_VIODASD=y
150CONFIG_VIOCD=m
151CONFIG_VIOTAPE=m
152CONFIG_VIOPATH=y
135# CONFIG_PPC_MPC52xx is not set 153# CONFIG_PPC_MPC52xx is not set
154# CONFIG_PPC_MPC5200 is not set
136# CONFIG_PPC_PMAC is not set 155# CONFIG_PPC_PMAC is not set
137# CONFIG_PPC_MAPLE is not set 156# CONFIG_PPC_MAPLE is not set
138# CONFIG_PPC_PASEMI is not set 157# CONFIG_PPC_PASEMI is not set
158# CONFIG_PPC_CELLEB is not set
159# CONFIG_PPC_PS3 is not set
139# CONFIG_PPC_CELL is not set 160# CONFIG_PPC_CELL is not set
140# CONFIG_PPC_CELL_NATIVE is not set 161# CONFIG_PPC_CELL_NATIVE is not set
141# CONFIG_PPC_IBM_CELL_BLADE is not set 162# CONFIG_PPC_IBM_CELL_BLADE is not set
142# CONFIG_PPC_PS3 is not set 163# CONFIG_PQ2ADS is not set
164# CONFIG_MPIC is not set
165# CONFIG_MPIC_WEIRD is not set
166# CONFIG_PPC_I8259 is not set
143# CONFIG_U3_DART is not set 167# CONFIG_U3_DART is not set
144# CONFIG_PPC_RTAS is not set 168# CONFIG_PPC_RTAS is not set
145# CONFIG_MMIO_NVRAM is not set 169# CONFIG_MMIO_NVRAM is not set
@@ -149,8 +173,7 @@ CONFIG_IBMVIO=y
149CONFIG_PPC_INDIRECT_IO=y 173CONFIG_PPC_INDIRECT_IO=y
150CONFIG_GENERIC_IOMAP=y 174CONFIG_GENERIC_IOMAP=y
151# CONFIG_CPU_FREQ is not set 175# CONFIG_CPU_FREQ is not set
152# CONFIG_WANT_EARLY_SERIAL is not set 176# CONFIG_CPM2 is not set
153# CONFIG_MPIC is not set
154 177
155# 178#
156# Kernel options 179# Kernel options
@@ -172,7 +195,6 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
172# CONFIG_KEXEC is not set 195# CONFIG_KEXEC is not set
173# CONFIG_CRASH_DUMP is not set 196# CONFIG_CRASH_DUMP is not set
174CONFIG_IRQ_ALL_CPUS=y 197CONFIG_IRQ_ALL_CPUS=y
175CONFIG_LPARCFG=y
176# CONFIG_NUMA is not set 198# CONFIG_NUMA is not set
177CONFIG_ARCH_SELECT_MEMORY_MODEL=y 199CONFIG_ARCH_SELECT_MEMORY_MODEL=y
178CONFIG_ARCH_FLATMEM_ENABLE=y 200CONFIG_ARCH_FLATMEM_ENABLE=y
@@ -187,34 +209,34 @@ CONFIG_FLAT_NODE_MEM_MAP=y
187# CONFIG_SPARSEMEM_STATIC is not set 209# CONFIG_SPARSEMEM_STATIC is not set
188CONFIG_SPLIT_PTLOCK_CPUS=4 210CONFIG_SPLIT_PTLOCK_CPUS=4
189CONFIG_RESOURCES_64BIT=y 211CONFIG_RESOURCES_64BIT=y
212CONFIG_ZONE_DMA_FLAG=1
213# CONFIG_PPC_HAS_HASH_64K is not set
190# CONFIG_PPC_64K_PAGES is not set 214# CONFIG_PPC_64K_PAGES is not set
191# CONFIG_SCHED_SMT is not set 215# CONFIG_SCHED_SMT is not set
192CONFIG_PROC_DEVICETREE=y 216CONFIG_PROC_DEVICETREE=y
193# CONFIG_CMDLINE_BOOL is not set 217# CONFIG_CMDLINE_BOOL is not set
194# CONFIG_PM is not set 218# CONFIG_PM is not set
195CONFIG_SECCOMP=y 219CONFIG_SECCOMP=y
220# CONFIG_WANT_DEVICE_TREE is not set
196CONFIG_ISA_DMA_API=y 221CONFIG_ISA_DMA_API=y
197 222
198# 223#
199# Bus options 224# Bus options
200# 225#
226CONFIG_ZONE_DMA=y
201CONFIG_GENERIC_ISA_DMA=y 227CONFIG_GENERIC_ISA_DMA=y
202# CONFIG_MPIC_WEIRD is not set
203# CONFIG_PPC_I8259 is not set
204# CONFIG_PPC_INDIRECT_PCI is not set 228# CONFIG_PPC_INDIRECT_PCI is not set
205CONFIG_PCI=y 229CONFIG_PCI=y
206CONFIG_PCI_DOMAINS=y 230CONFIG_PCI_DOMAINS=y
207# CONFIG_PCIEPORTBUS is not set 231# CONFIG_PCIEPORTBUS is not set
232CONFIG_ARCH_SUPPORTS_MSI=y
233# CONFIG_PCI_MSI is not set
208# CONFIG_PCI_DEBUG is not set 234# CONFIG_PCI_DEBUG is not set
209 235
210# 236#
211# PCCARD (PCMCIA/CardBus) support 237# PCCARD (PCMCIA/CardBus) support
212# 238#
213# CONFIG_PCCARD is not set 239# CONFIG_PCCARD is not set
214
215#
216# PCI Hotplug Support
217#
218# CONFIG_HOTPLUG_PCI is not set 240# CONFIG_HOTPLUG_PCI is not set
219CONFIG_KERNEL_START=0xc000000000000000 241CONFIG_KERNEL_START=0xc000000000000000
220 242
@@ -226,14 +248,15 @@ CONFIG_NET=y
226# 248#
227# Networking options 249# Networking options
228# 250#
229# CONFIG_NETDEBUG is not set
230CONFIG_PACKET=y 251CONFIG_PACKET=y
231# CONFIG_PACKET_MMAP is not set 252# CONFIG_PACKET_MMAP is not set
232CONFIG_UNIX=y 253CONFIG_UNIX=y
233CONFIG_XFRM=y 254CONFIG_XFRM=y
234CONFIG_XFRM_USER=m 255CONFIG_XFRM_USER=m
235CONFIG_XFRM_SUB_POLICY=y 256CONFIG_XFRM_SUB_POLICY=y
257# CONFIG_XFRM_MIGRATE is not set
236CONFIG_NET_KEY=m 258CONFIG_NET_KEY=m
259# CONFIG_NET_KEY_MIGRATE is not set
237CONFIG_INET=y 260CONFIG_INET=y
238CONFIG_IP_MULTICAST=y 261CONFIG_IP_MULTICAST=y
239# CONFIG_IP_ADVANCED_ROUTER is not set 262# CONFIG_IP_ADVANCED_ROUTER is not set
@@ -275,8 +298,6 @@ CONFIG_NETFILTER=y
275# 298#
276# CONFIG_NETFILTER_NETLINK is not set 299# CONFIG_NETFILTER_NETLINK is not set
277CONFIG_NF_CONNTRACK_ENABLED=m 300CONFIG_NF_CONNTRACK_ENABLED=m
278CONFIG_NF_CONNTRACK_SUPPORT=y
279# CONFIG_IP_NF_CONNTRACK_SUPPORT is not set
280CONFIG_NF_CONNTRACK=m 301CONFIG_NF_CONNTRACK=m
281# CONFIG_NF_CT_ACCT is not set 302# CONFIG_NF_CT_ACCT is not set
282CONFIG_NF_CONNTRACK_MARK=y 303CONFIG_NF_CONNTRACK_MARK=y
@@ -288,6 +309,7 @@ CONFIG_NF_CONNTRACK_FTP=m
288CONFIG_NF_CONNTRACK_IRC=m 309CONFIG_NF_CONNTRACK_IRC=m
289# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set 310# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
290# CONFIG_NF_CONNTRACK_PPTP is not set 311# CONFIG_NF_CONNTRACK_PPTP is not set
312# CONFIG_NF_CONNTRACK_SANE is not set
291# CONFIG_NF_CONNTRACK_SIP is not set 313# CONFIG_NF_CONNTRACK_SIP is not set
292CONFIG_NF_CONNTRACK_TFTP=m 314CONFIG_NF_CONNTRACK_TFTP=m
293CONFIG_NETFILTER_XTABLES=m 315CONFIG_NETFILTER_XTABLES=m
@@ -298,7 +320,9 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
298CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 320CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
299# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set 321# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
300# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set 322# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
323# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
301CONFIG_NETFILTER_XT_MATCH_COMMENT=m 324CONFIG_NETFILTER_XT_MATCH_COMMENT=m
325# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
302CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 326CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
303CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 327CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
304# CONFIG_NETFILTER_XT_MATCH_DCCP is not set 328# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
@@ -340,7 +364,6 @@ CONFIG_IP_NF_FILTER=m
340CONFIG_IP_NF_TARGET_REJECT=m 364CONFIG_IP_NF_TARGET_REJECT=m
341CONFIG_IP_NF_TARGET_LOG=m 365CONFIG_IP_NF_TARGET_LOG=m
342CONFIG_IP_NF_TARGET_ULOG=m 366CONFIG_IP_NF_TARGET_ULOG=m
343CONFIG_IP_NF_TARGET_TCPMSS=m
344CONFIG_NF_NAT=m 367CONFIG_NF_NAT=m
345CONFIG_NF_NAT_NEEDED=y 368CONFIG_NF_NAT_NEEDED=y
346CONFIG_IP_NF_TARGET_MASQUERADE=m 369CONFIG_IP_NF_TARGET_MASQUERADE=m
@@ -373,7 +396,12 @@ CONFIG_IP_NF_ARP_MANGLE=m
373# 396#
374# SCTP Configuration (EXPERIMENTAL) 397# SCTP Configuration (EXPERIMENTAL)
375# 398#
376# CONFIG_IP_SCTP is not set 399CONFIG_IP_SCTP=m
400# CONFIG_SCTP_DBG_MSG is not set
401# CONFIG_SCTP_DBG_OBJCNT is not set
402# CONFIG_SCTP_HMAC_NONE is not set
403# CONFIG_SCTP_HMAC_SHA1 is not set
404CONFIG_SCTP_HMAC_MD5=y
377 405
378# 406#
379# TIPC Configuration (EXPERIMENTAL) 407# TIPC Configuration (EXPERIMENTAL)
@@ -405,7 +433,16 @@ CONFIG_NET_CLS_ROUTE=y
405# CONFIG_HAMRADIO is not set 433# CONFIG_HAMRADIO is not set
406# CONFIG_IRDA is not set 434# CONFIG_IRDA is not set
407# CONFIG_BT is not set 435# CONFIG_BT is not set
436# CONFIG_AF_RXRPC is not set
437
438#
439# Wireless
440#
441# CONFIG_CFG80211 is not set
442# CONFIG_WIRELESS_EXT is not set
443# CONFIG_MAC80211 is not set
408# CONFIG_IEEE80211 is not set 444# CONFIG_IEEE80211 is not set
445# CONFIG_RFKILL is not set
409 446
410# 447#
411# Device Drivers 448# Device Drivers
@@ -418,16 +455,13 @@ CONFIG_STANDALONE=y
418CONFIG_PREVENT_FIRMWARE_BUILD=y 455CONFIG_PREVENT_FIRMWARE_BUILD=y
419CONFIG_FW_LOADER=m 456CONFIG_FW_LOADER=m
420# CONFIG_DEBUG_DRIVER is not set 457# CONFIG_DEBUG_DRIVER is not set
458# CONFIG_DEBUG_DEVRES is not set
421# CONFIG_SYS_HYPERVISOR is not set 459# CONFIG_SYS_HYPERVISOR is not set
422 460
423# 461#
424# Connector - unified userspace <-> kernelspace linker 462# Connector - unified userspace <-> kernelspace linker
425# 463#
426# CONFIG_CONNECTOR is not set 464# CONFIG_CONNECTOR is not set
427
428#
429# Memory Technology Devices (MTD)
430#
431# CONFIG_MTD is not set 465# CONFIG_MTD is not set
432 466
433# 467#
@@ -438,6 +472,7 @@ CONFIG_FW_LOADER=m
438# 472#
439# Plug and Play support 473# Plug and Play support
440# 474#
475# CONFIG_PNPACPI is not set
441 476
442# 477#
443# Block devices 478# Block devices
@@ -456,15 +491,16 @@ CONFIG_BLK_DEV_RAM=y
456CONFIG_BLK_DEV_RAM_COUNT=16 491CONFIG_BLK_DEV_RAM_COUNT=16
457CONFIG_BLK_DEV_RAM_SIZE=65536 492CONFIG_BLK_DEV_RAM_SIZE=65536
458CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 493CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
459CONFIG_BLK_DEV_INITRD=y
460# CONFIG_CDROM_PKTCDVD is not set 494# CONFIG_CDROM_PKTCDVD is not set
461# CONFIG_ATA_OVER_ETH is not set 495# CONFIG_ATA_OVER_ETH is not set
462 496
463# 497#
464# Misc devices 498# Misc devices
465# 499#
500# CONFIG_PHANTOM is not set
466# CONFIG_SGI_IOC4 is not set 501# CONFIG_SGI_IOC4 is not set
467# CONFIG_TIFM_CORE is not set 502# CONFIG_TIFM_CORE is not set
503# CONFIG_BLINK is not set
468 504
469# 505#
470# ATA/ATAPI/MFM/RLL support 506# ATA/ATAPI/MFM/RLL support
@@ -498,6 +534,7 @@ CONFIG_SCSI_MULTI_LUN=y
498CONFIG_SCSI_CONSTANTS=y 534CONFIG_SCSI_CONSTANTS=y
499# CONFIG_SCSI_LOGGING is not set 535# CONFIG_SCSI_LOGGING is not set
500# CONFIG_SCSI_SCAN_ASYNC is not set 536# CONFIG_SCSI_SCAN_ASYNC is not set
537CONFIG_SCSI_WAIT_SCAN=m
501 538
502# 539#
503# SCSI Transports 540# SCSI Transports
@@ -544,11 +581,8 @@ CONFIG_SCSI_IBMVSCSI=m
544# CONFIG_SCSI_DC395x is not set 581# CONFIG_SCSI_DC395x is not set
545# CONFIG_SCSI_DC390T is not set 582# CONFIG_SCSI_DC390T is not set
546# CONFIG_SCSI_DEBUG is not set 583# CONFIG_SCSI_DEBUG is not set
584# CONFIG_SCSI_ESP_CORE is not set
547# CONFIG_SCSI_SRP is not set 585# CONFIG_SCSI_SRP is not set
548
549#
550# Serial ATA (prod) and Parallel ATA (experimental) drivers
551#
552# CONFIG_ATA is not set 586# CONFIG_ATA is not set
553 587
554# 588#
@@ -570,6 +604,7 @@ CONFIG_DM_SNAPSHOT=m
570CONFIG_DM_MIRROR=m 604CONFIG_DM_MIRROR=m
571CONFIG_DM_ZERO=m 605CONFIG_DM_ZERO=m
572# CONFIG_DM_MULTIPATH is not set 606# CONFIG_DM_MULTIPATH is not set
607# CONFIG_DM_DELAY is not set
573 608
574# 609#
575# Fusion MPT device support 610# Fusion MPT device support
@@ -582,18 +617,14 @@ CONFIG_DM_ZERO=m
582# 617#
583# IEEE 1394 (FireWire) support 618# IEEE 1394 (FireWire) support
584# 619#
620# CONFIG_FIREWIRE is not set
585# CONFIG_IEEE1394 is not set 621# CONFIG_IEEE1394 is not set
586 622
587# 623#
588# I2O device support 624# I2O device support
589# 625#
590# CONFIG_I2O is not set 626# CONFIG_I2O is not set
591 627# CONFIG_MACINTOSH_DRIVERS is not set
592#
593# Macintosh device drivers
594#
595# CONFIG_MAC_EMUMOUSEBTN is not set
596# CONFIG_WINDFARM is not set
597 628
598# 629#
599# Network device support 630# Network device support
@@ -608,10 +639,6 @@ CONFIG_TUN=m
608# ARCnet devices 639# ARCnet devices
609# 640#
610# CONFIG_ARCNET is not set 641# CONFIG_ARCNET is not set
611
612#
613# PHY device support
614#
615# CONFIG_PHYLIB is not set 642# CONFIG_PHYLIB is not set
616 643
617# 644#
@@ -648,10 +675,8 @@ CONFIG_E100=y
648# CONFIG_EPIC100 is not set 675# CONFIG_EPIC100 is not set
649# CONFIG_SUNDANCE is not set 676# CONFIG_SUNDANCE is not set
650# CONFIG_VIA_RHINE is not set 677# CONFIG_VIA_RHINE is not set
651 678# CONFIG_SC92031 is not set
652# 679CONFIG_NETDEV_1000=y
653# Ethernet (1000 Mbit)
654#
655CONFIG_ACENIC=m 680CONFIG_ACENIC=m
656# CONFIG_ACENIC_OMIT_TIGON_I is not set 681# CONFIG_ACENIC_OMIT_TIGON_I is not set
657# CONFIG_DL2K is not set 682# CONFIG_DL2K is not set
@@ -670,15 +695,17 @@ CONFIG_E1000=m
670# CONFIG_TIGON3 is not set 695# CONFIG_TIGON3 is not set
671# CONFIG_BNX2 is not set 696# CONFIG_BNX2 is not set
672# CONFIG_QLA3XXX is not set 697# CONFIG_QLA3XXX is not set
673 698# CONFIG_ATL1 is not set
674# 699CONFIG_NETDEV_10000=y
675# Ethernet (10000 Mbit)
676#
677# CONFIG_CHELSIO_T1 is not set 700# CONFIG_CHELSIO_T1 is not set
701# CONFIG_CHELSIO_T3 is not set
678# CONFIG_IXGB is not set 702# CONFIG_IXGB is not set
679# CONFIG_S2IO is not set 703# CONFIG_S2IO is not set
680# CONFIG_MYRI10GE is not set 704# CONFIG_MYRI10GE is not set
681# CONFIG_NETXEN_NIC is not set 705# CONFIG_NETXEN_NIC is not set
706# CONFIG_PASEMI_MAC is not set
707# CONFIG_MLX4_CORE is not set
708CONFIG_MLX4_DEBUG=y
682 709
683# 710#
684# Token Ring devices 711# Token Ring devices
@@ -689,13 +716,10 @@ CONFIG_IBMOL=y
689# CONFIG_TMS380TR is not set 716# CONFIG_TMS380TR is not set
690 717
691# 718#
692# Wireless LAN (non-hamradio) 719# Wireless LAN
693#
694# CONFIG_NET_RADIO is not set
695
696#
697# Wan interfaces
698# 720#
721# CONFIG_WLAN_PRE80211 is not set
722# CONFIG_WLAN_80211 is not set
699# CONFIG_WAN is not set 723# CONFIG_WAN is not set
700CONFIG_ISERIES_VETH=y 724CONFIG_ISERIES_VETH=y
701# CONFIG_FDDI is not set 725# CONFIG_FDDI is not set
@@ -715,7 +739,6 @@ CONFIG_SLHC=m
715# CONFIG_SHAPER is not set 739# CONFIG_SHAPER is not set
716CONFIG_NETCONSOLE=y 740CONFIG_NETCONSOLE=y
717CONFIG_NETPOLL=y 741CONFIG_NETPOLL=y
718CONFIG_NETPOLL_RX=y
719CONFIG_NETPOLL_TRAP=y 742CONFIG_NETPOLL_TRAP=y
720CONFIG_NET_POLL_CONTROLLER=y 743CONFIG_NET_POLL_CONTROLLER=y
721 744
@@ -753,6 +776,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
753# CONFIG_INPUT_KEYBOARD is not set 776# CONFIG_INPUT_KEYBOARD is not set
754# CONFIG_INPUT_MOUSE is not set 777# CONFIG_INPUT_MOUSE is not set
755# CONFIG_INPUT_JOYSTICK is not set 778# CONFIG_INPUT_JOYSTICK is not set
779# CONFIG_INPUT_TABLET is not set
756# CONFIG_INPUT_TOUCHSCREEN is not set 780# CONFIG_INPUT_TOUCHSCREEN is not set
757# CONFIG_INPUT_MISC is not set 781# CONFIG_INPUT_MISC is not set
758 782
@@ -765,6 +789,10 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
765# 789#
766# Character devices 790# Character devices
767# 791#
792CONFIG_VT=y
793CONFIG_VT_CONSOLE=y
794CONFIG_HW_CONSOLE=y
795# CONFIG_VT_HW_CONSOLE_BINDING is not set
768# CONFIG_SERIAL_NONSTANDARD is not set 796# CONFIG_SERIAL_NONSTANDARD is not set
769 797
770# 798#
@@ -781,20 +809,17 @@ CONFIG_SERIAL_ICOM=m
781CONFIG_UNIX98_PTYS=y 809CONFIG_UNIX98_PTYS=y
782CONFIG_LEGACY_PTYS=y 810CONFIG_LEGACY_PTYS=y
783CONFIG_LEGACY_PTY_COUNT=256 811CONFIG_LEGACY_PTY_COUNT=256
812CONFIG_HVC_DRIVER=y
813CONFIG_HVC_ISERIES=y
784 814
785# 815#
786# IPMI 816# IPMI
787# 817#
788# CONFIG_IPMI_HANDLER is not set 818# CONFIG_IPMI_HANDLER is not set
789
790#
791# Watchdog Cards
792#
793# CONFIG_WATCHDOG is not set 819# CONFIG_WATCHDOG is not set
794# CONFIG_HW_RANDOM is not set 820# CONFIG_HW_RANDOM is not set
795CONFIG_GEN_RTC=y 821CONFIG_GEN_RTC=y
796# CONFIG_GEN_RTC_X is not set 822# CONFIG_GEN_RTC_X is not set
797# CONFIG_DTLK is not set
798# CONFIG_R3964 is not set 823# CONFIG_R3964 is not set
799# CONFIG_APPLICOM is not set 824# CONFIG_APPLICOM is not set
800# CONFIG_AGP is not set 825# CONFIG_AGP is not set
@@ -807,10 +832,7 @@ CONFIG_MAX_RAW_DEVS=256
807# TPM devices 832# TPM devices
808# 833#
809# CONFIG_TCG_TPM is not set 834# CONFIG_TCG_TPM is not set
810 835CONFIG_DEVPORT=y
811#
812# I2C support
813#
814# CONFIG_I2C is not set 836# CONFIG_I2C is not set
815 837
816# 838#
@@ -823,30 +845,39 @@ CONFIG_MAX_RAW_DEVS=256
823# Dallas's 1-wire bus 845# Dallas's 1-wire bus
824# 846#
825# CONFIG_W1 is not set 847# CONFIG_W1 is not set
848# CONFIG_HWMON is not set
826 849
827# 850#
828# Hardware Monitoring support 851# Multifunction device drivers
829# 852#
830# CONFIG_HWMON is not set 853# CONFIG_MFD_SM501 is not set
831# CONFIG_HWMON_VID is not set
832 854
833# 855#
834# Multimedia devices 856# Multimedia devices
835# 857#
836# CONFIG_VIDEO_DEV is not set 858# CONFIG_VIDEO_DEV is not set
859# CONFIG_DVB_CORE is not set
860# CONFIG_DAB is not set
837 861
838# 862#
839# Digital Video Broadcasting Devices 863# Graphics support
840# 864#
841# CONFIG_DVB is not set 865# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
842 866
843# 867#
844# Graphics support 868# Display device support
845# 869#
846CONFIG_FIRMWARE_EDID=y 870# CONFIG_DISPLAY_SUPPORT is not set
871# CONFIG_VGASTATE is not set
847# CONFIG_FB is not set 872# CONFIG_FB is not set
848# CONFIG_FB_IBM_GXT4500 is not set 873# CONFIG_FB_IBM_GXT4500 is not set
849# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 874
875#
876# Console display driver support
877#
878CONFIG_VGA_CONSOLE=y
879# CONFIG_VGACON_SOFT_SCROLLBACK is not set
880CONFIG_DUMMY_CONSOLE=y
850 881
851# 882#
852# Sound 883# Sound
@@ -874,10 +905,6 @@ CONFIG_USB_ARCH_HAS_EHCI=y
874# USB Gadget Support 905# USB Gadget Support
875# 906#
876# CONFIG_USB_GADGET is not set 907# CONFIG_USB_GADGET is not set
877
878#
879# MMC/SD Card support
880#
881# CONFIG_MMC is not set 908# CONFIG_MMC is not set
882 909
883# 910#
@@ -921,10 +948,6 @@ CONFIG_USB_ARCH_HAS_EHCI=y
921# 948#
922 949
923# 950#
924# Virtualization
925#
926
927#
928# File systems 951# File systems
929# 952#
930CONFIG_EXT2_FS=y 953CONFIG_EXT2_FS=y
@@ -979,7 +1002,6 @@ CONFIG_GENERIC_ACL=y
979CONFIG_ISO9660_FS=y 1002CONFIG_ISO9660_FS=y
980CONFIG_JOLIET=y 1003CONFIG_JOLIET=y
981CONFIG_ZISOFS=y 1004CONFIG_ZISOFS=y
982CONFIG_ZISOFS_FS=y
983CONFIG_UDF_FS=m 1005CONFIG_UDF_FS=m
984CONFIG_UDF_NLS=y 1006CONFIG_UDF_NLS=y
985 1007
@@ -1045,6 +1067,7 @@ CONFIG_NFS_ACL_SUPPORT=y
1045CONFIG_NFS_COMMON=y 1067CONFIG_NFS_COMMON=y
1046CONFIG_SUNRPC=y 1068CONFIG_SUNRPC=y
1047CONFIG_SUNRPC_GSS=y 1069CONFIG_SUNRPC_GSS=y
1070# CONFIG_SUNRPC_BIND34 is not set
1048CONFIG_RPCSEC_GSS_KRB5=y 1071CONFIG_RPCSEC_GSS_KRB5=y
1049CONFIG_RPCSEC_GSS_SPKM3=m 1072CONFIG_RPCSEC_GSS_SPKM3=m
1050# CONFIG_SMB_FS is not set 1073# CONFIG_SMB_FS is not set
@@ -1114,18 +1137,9 @@ CONFIG_NLS_ISO8859_1=y
1114# Distributed Lock Manager 1137# Distributed Lock Manager
1115# 1138#
1116CONFIG_DLM=m 1139CONFIG_DLM=m
1117CONFIG_DLM_TCP=y
1118# CONFIG_DLM_SCTP is not set
1119# CONFIG_DLM_DEBUG is not set 1140# CONFIG_DLM_DEBUG is not set
1120 1141# CONFIG_UCC_SLOW is not set
1121# 1142# CONFIG_UCC_FAST is not set
1122# iSeries device drivers
1123#
1124CONFIG_VIOCONS=y
1125CONFIG_VIODASD=y
1126CONFIG_VIOCD=m
1127CONFIG_VIOTAPE=m
1128CONFIG_VIOPATH=y
1129 1143
1130# 1144#
1131# Library routines 1145# Library routines
@@ -1133,6 +1147,7 @@ CONFIG_VIOPATH=y
1133CONFIG_BITREVERSE=y 1147CONFIG_BITREVERSE=y
1134CONFIG_CRC_CCITT=m 1148CONFIG_CRC_CCITT=m
1135# CONFIG_CRC16 is not set 1149# CONFIG_CRC16 is not set
1150# CONFIG_CRC_ITU_T is not set
1136CONFIG_CRC32=y 1151CONFIG_CRC32=y
1137CONFIG_LIBCRC32C=m 1152CONFIG_LIBCRC32C=m
1138CONFIG_ZLIB_INFLATE=y 1153CONFIG_ZLIB_INFLATE=y
@@ -1142,7 +1157,9 @@ CONFIG_TEXTSEARCH_KMP=m
1142CONFIG_TEXTSEARCH_BM=m 1157CONFIG_TEXTSEARCH_BM=m
1143CONFIG_TEXTSEARCH_FSM=m 1158CONFIG_TEXTSEARCH_FSM=m
1144CONFIG_PLIST=y 1159CONFIG_PLIST=y
1145CONFIG_IOMAP_COPY=y 1160CONFIG_HAS_IOMEM=y
1161CONFIG_HAS_IOPORT=y
1162CONFIG_HAS_DMA=y
1146 1163
1147# 1164#
1148# Instrumentation Support 1165# Instrumentation Support
@@ -1160,15 +1177,15 @@ CONFIG_MAGIC_SYSRQ=y
1160CONFIG_DEBUG_FS=y 1177CONFIG_DEBUG_FS=y
1161# CONFIG_HEADERS_CHECK is not set 1178# CONFIG_HEADERS_CHECK is not set
1162CONFIG_DEBUG_KERNEL=y 1179CONFIG_DEBUG_KERNEL=y
1163CONFIG_LOG_BUF_SHIFT=17 1180# CONFIG_DEBUG_SHIRQ is not set
1164CONFIG_DETECT_SOFTLOCKUP=y 1181CONFIG_DETECT_SOFTLOCKUP=y
1165# CONFIG_SCHEDSTATS is not set 1182# CONFIG_SCHEDSTATS is not set
1183# CONFIG_TIMER_STATS is not set
1166# CONFIG_DEBUG_SLAB is not set 1184# CONFIG_DEBUG_SLAB is not set
1167# CONFIG_DEBUG_RT_MUTEXES is not set 1185# CONFIG_DEBUG_RT_MUTEXES is not set
1168# CONFIG_RT_MUTEX_TESTER is not set 1186# CONFIG_RT_MUTEX_TESTER is not set
1169# CONFIG_DEBUG_SPINLOCK is not set 1187# CONFIG_DEBUG_SPINLOCK is not set
1170# CONFIG_DEBUG_MUTEXES is not set 1188# CONFIG_DEBUG_MUTEXES is not set
1171# CONFIG_DEBUG_RWSEMS is not set
1172# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1189# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1173# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1190# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1174# CONFIG_DEBUG_KOBJECT is not set 1191# CONFIG_DEBUG_KOBJECT is not set
@@ -1178,8 +1195,10 @@ CONFIG_DEBUG_BUGVERBOSE=y
1178# CONFIG_DEBUG_LIST is not set 1195# CONFIG_DEBUG_LIST is not set
1179# CONFIG_FORCED_INLINING is not set 1196# CONFIG_FORCED_INLINING is not set
1180# CONFIG_RCU_TORTURE_TEST is not set 1197# CONFIG_RCU_TORTURE_TEST is not set
1198# CONFIG_FAULT_INJECTION is not set
1181CONFIG_DEBUG_STACKOVERFLOW=y 1199CONFIG_DEBUG_STACKOVERFLOW=y
1182CONFIG_DEBUG_STACK_USAGE=y 1200CONFIG_DEBUG_STACK_USAGE=y
1201# CONFIG_DEBUG_PAGEALLOC is not set
1183# CONFIG_DEBUGGER is not set 1202# CONFIG_DEBUGGER is not set
1184CONFIG_IRQSTACKS=y 1203CONFIG_IRQSTACKS=y
1185# CONFIG_BOOTX_TEXT is not set 1204# CONFIG_BOOTX_TEXT is not set
@@ -1212,8 +1231,11 @@ CONFIG_CRYPTO_TGR192=m
1212# CONFIG_CRYPTO_GF128MUL is not set 1231# CONFIG_CRYPTO_GF128MUL is not set
1213CONFIG_CRYPTO_ECB=m 1232CONFIG_CRYPTO_ECB=m
1214CONFIG_CRYPTO_CBC=y 1233CONFIG_CRYPTO_CBC=y
1234CONFIG_CRYPTO_PCBC=m
1215# CONFIG_CRYPTO_LRW is not set 1235# CONFIG_CRYPTO_LRW is not set
1236# CONFIG_CRYPTO_CRYPTD is not set
1216CONFIG_CRYPTO_DES=y 1237CONFIG_CRYPTO_DES=y
1238# CONFIG_CRYPTO_FCRYPT is not set
1217CONFIG_CRYPTO_BLOWFISH=m 1239CONFIG_CRYPTO_BLOWFISH=m
1218CONFIG_CRYPTO_TWOFISH=m 1240CONFIG_CRYPTO_TWOFISH=m
1219CONFIG_CRYPTO_TWOFISH_COMMON=m 1241CONFIG_CRYPTO_TWOFISH_COMMON=m
@@ -1228,6 +1250,7 @@ CONFIG_CRYPTO_ANUBIS=m
1228CONFIG_CRYPTO_DEFLATE=m 1250CONFIG_CRYPTO_DEFLATE=m
1229CONFIG_CRYPTO_MICHAEL_MIC=m 1251CONFIG_CRYPTO_MICHAEL_MIC=m
1230CONFIG_CRYPTO_CRC32C=m 1252CONFIG_CRYPTO_CRC32C=m
1253# CONFIG_CRYPTO_CAMELLIA is not set
1231CONFIG_CRYPTO_TEST=m 1254CONFIG_CRYPTO_TEST=m
1232 1255
1233# 1256#
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig
index 97a57e99666..0507c8f7bfb 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_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.20-rc6 3# Linux kernel version: 2.6.21
4# Thu Feb 1 22:54:15 2007 4# Mon May 14 12:55:04 2007
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -23,7 +23,7 @@ CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
23CONFIG_ARCH_MAY_HAVE_PC_FDC=y 23CONFIG_ARCH_MAY_HAVE_PC_FDC=y
24CONFIG_PPC_OF=y 24CONFIG_PPC_OF=y
25CONFIG_PPC_UDBG_16550=y 25CONFIG_PPC_UDBG_16550=y
26CONFIG_GENERIC_TBSYNC=y 26# CONFIG_GENERIC_TBSYNC is not set
27CONFIG_AUDIT_ARCH=y 27CONFIG_AUDIT_ARCH=y
28CONFIG_GENERIC_BUG=y 28CONFIG_GENERIC_BUG=y
29# CONFIG_DEFAULT_UIMAGE is not set 29# CONFIG_DEFAULT_UIMAGE is not set
@@ -39,6 +39,7 @@ CONFIG_PPC_FPU=y
39# CONFIG_PPC_OF_PLATFORM_PCI is not set 39# CONFIG_PPC_OF_PLATFORM_PCI is not set
40CONFIG_ALTIVEC=y 40CONFIG_ALTIVEC=y
41CONFIG_PPC_STD_MMU=y 41CONFIG_PPC_STD_MMU=y
42CONFIG_PPC_MM_SLICES=y
42# CONFIG_VIRT_CPU_ACCOUNTING is not set 43# CONFIG_VIRT_CPU_ACCOUNTING is not set
43CONFIG_SMP=y 44CONFIG_SMP=y
44CONFIG_NR_CPUS=2 45CONFIG_NR_CPUS=2
@@ -59,15 +60,18 @@ CONFIG_LOCALVERSION_AUTO=y
59CONFIG_SWAP=y 60CONFIG_SWAP=y
60CONFIG_SYSVIPC=y 61CONFIG_SYSVIPC=y
61# CONFIG_IPC_NS is not set 62# CONFIG_IPC_NS is not set
63CONFIG_SYSVIPC_SYSCTL=y
62# CONFIG_POSIX_MQUEUE is not set 64# CONFIG_POSIX_MQUEUE is not set
63# CONFIG_BSD_PROCESS_ACCT is not set 65# CONFIG_BSD_PROCESS_ACCT is not set
64# CONFIG_TASKSTATS is not set 66# CONFIG_TASKSTATS is not set
65# CONFIG_UTS_NS is not set 67# CONFIG_UTS_NS is not set
66# CONFIG_AUDIT is not set 68# CONFIG_AUDIT is not set
67# CONFIG_IKCONFIG is not set 69# CONFIG_IKCONFIG is not set
70CONFIG_LOG_BUF_SHIFT=17
68# CONFIG_CPUSETS is not set 71# CONFIG_CPUSETS is not set
69CONFIG_SYSFS_DEPRECATED=y 72CONFIG_SYSFS_DEPRECATED=y
70# CONFIG_RELAY is not set 73# CONFIG_RELAY is not set
74CONFIG_BLK_DEV_INITRD=y
71CONFIG_INITRAMFS_SOURCE="" 75CONFIG_INITRAMFS_SOURCE=""
72# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 76# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
73CONFIG_SYSCTL=y 77CONFIG_SYSCTL=y
@@ -82,14 +86,19 @@ CONFIG_BUG=y
82CONFIG_ELF_CORE=y 86CONFIG_ELF_CORE=y
83CONFIG_BASE_FULL=y 87CONFIG_BASE_FULL=y
84CONFIG_FUTEX=y 88CONFIG_FUTEX=y
89CONFIG_ANON_INODES=y
85CONFIG_EPOLL=y 90CONFIG_EPOLL=y
91CONFIG_SIGNALFD=y
92CONFIG_TIMERFD=y
93CONFIG_EVENTFD=y
86CONFIG_SHMEM=y 94CONFIG_SHMEM=y
87CONFIG_SLAB=y
88CONFIG_VM_EVENT_COUNTERS=y 95CONFIG_VM_EVENT_COUNTERS=y
96CONFIG_SLAB=y
97# CONFIG_SLUB is not set
98# CONFIG_SLOB is not set
89CONFIG_RT_MUTEXES=y 99CONFIG_RT_MUTEXES=y
90# CONFIG_TINY_SHMEM is not set 100# CONFIG_TINY_SHMEM is not set
91CONFIG_BASE_SMALL=0 101CONFIG_BASE_SMALL=0
92# CONFIG_SLOB is not set
93 102
94# 103#
95# Loadable module support 104# Loadable module support
@@ -127,39 +136,38 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
127CONFIG_PPC_MULTIPLATFORM=y 136CONFIG_PPC_MULTIPLATFORM=y
128# CONFIG_EMBEDDED6xx is not set 137# CONFIG_EMBEDDED6xx is not set
129# CONFIG_APUS is not set 138# CONFIG_APUS is not set
130CONFIG_PPC_PSERIES=y 139# CONFIG_PPC_PSERIES is not set
131# CONFIG_PPC_ISERIES is not set 140# CONFIG_PPC_ISERIES is not set
132# CONFIG_PPC_MPC52xx is not set 141# CONFIG_PPC_MPC52xx is not set
142# CONFIG_PPC_MPC5200 is not set
133# CONFIG_PPC_PMAC is not set 143# CONFIG_PPC_PMAC is not set
134# CONFIG_PPC_MAPLE is not set 144# CONFIG_PPC_MAPLE is not set
135CONFIG_PPC_PASEMI=y 145CONFIG_PPC_PASEMI=y
146
147#
148# PA Semi PWRficient options
149#
150CONFIG_PPC_PASEMI_IOMMU=y
151CONFIG_PPC_PASEMI_MDIO=y
152# CONFIG_PPC_CELLEB is not set
153# CONFIG_PPC_PS3 is not set
136# CONFIG_PPC_CELL is not set 154# CONFIG_PPC_CELL is not set
137# CONFIG_PPC_CELL_NATIVE is not set 155# CONFIG_PPC_CELL_NATIVE is not set
138# CONFIG_PPC_IBM_CELL_BLADE is not set 156# CONFIG_PPC_IBM_CELL_BLADE is not set
139# CONFIG_PPC_PS3 is not set 157# CONFIG_PQ2ADS is not set
140CONFIG_PPC_NATIVE=y 158CONFIG_PPC_NATIVE=y
141# CONFIG_UDBG_RTAS_CONSOLE is not set 159CONFIG_MPIC=y
142CONFIG_XICS=y 160# CONFIG_MPIC_WEIRD is not set
161# CONFIG_PPC_I8259 is not set
143# CONFIG_U3_DART is not set 162# CONFIG_U3_DART is not set
144CONFIG_PPC_RTAS=y 163# CONFIG_PPC_RTAS is not set
145CONFIG_RTAS_ERROR_LOGGING=y
146CONFIG_RTAS_PROC=y
147# CONFIG_RTAS_FLASH is not set
148# CONFIG_MMIO_NVRAM is not set 164# CONFIG_MMIO_NVRAM is not set
149CONFIG_IBMVIO=y
150# CONFIG_IBMEBUS is not set
151# CONFIG_PPC_MPC106 is not set 165# CONFIG_PPC_MPC106 is not set
152# CONFIG_PPC_970_NAP is not set 166# CONFIG_PPC_970_NAP is not set
153# CONFIG_PPC_INDIRECT_IO is not set 167# CONFIG_PPC_INDIRECT_IO is not set
154# CONFIG_GENERIC_IOMAP is not set 168# CONFIG_GENERIC_IOMAP is not set
155# CONFIG_CPU_FREQ is not set 169# CONFIG_CPU_FREQ is not set
156# CONFIG_WANT_EARLY_SERIAL is not set 170# CONFIG_CPM2 is not set
157CONFIG_MPIC=y
158
159#
160# PA Semi PWRficient options
161#
162CONFIG_PPC_PASEMI_IOMMU=y
163 171
164# 172#
165# Kernel options 173# Kernel options
@@ -177,20 +185,14 @@ CONFIG_BINFMT_ELF=y
177# CONFIG_BINFMT_MISC is not set 185# CONFIG_BINFMT_MISC is not set
178CONFIG_FORCE_MAX_ZONEORDER=13 186CONFIG_FORCE_MAX_ZONEORDER=13
179CONFIG_IOMMU_VMERGE=y 187CONFIG_IOMMU_VMERGE=y
180# CONFIG_HOTPLUG_CPU is not set
181CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 188CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
182# CONFIG_KEXEC is not set 189# CONFIG_KEXEC is not set
183# CONFIG_CRASH_DUMP is not set 190# CONFIG_CRASH_DUMP is not set
184# CONFIG_IRQ_ALL_CPUS is not set 191# CONFIG_IRQ_ALL_CPUS is not set
185# CONFIG_PPC_SPLPAR is not set
186CONFIG_EEH=y
187# CONFIG_SCANLOG is not set
188# CONFIG_LPARCFG is not set
189# CONFIG_NUMA is not set 192# CONFIG_NUMA is not set
190CONFIG_ARCH_SELECT_MEMORY_MODEL=y 193CONFIG_ARCH_SELECT_MEMORY_MODEL=y
191CONFIG_ARCH_FLATMEM_ENABLE=y 194CONFIG_ARCH_FLATMEM_ENABLE=y
192CONFIG_ARCH_SPARSEMEM_ENABLE=y 195CONFIG_ARCH_SPARSEMEM_ENABLE=y
193CONFIG_ARCH_SPARSEMEM_DEFAULT=y
194CONFIG_ARCH_POPULATES_NODE_MAP=y 196CONFIG_ARCH_POPULATES_NODE_MAP=y
195CONFIG_SELECT_MEMORY_MODEL=y 197CONFIG_SELECT_MEMORY_MODEL=y
196CONFIG_FLATMEM_MANUAL=y 198CONFIG_FLATMEM_MANUAL=y
@@ -201,24 +203,28 @@ CONFIG_FLAT_NODE_MEM_MAP=y
201# CONFIG_SPARSEMEM_STATIC is not set 203# CONFIG_SPARSEMEM_STATIC is not set
202CONFIG_SPLIT_PTLOCK_CPUS=4 204CONFIG_SPLIT_PTLOCK_CPUS=4
203CONFIG_RESOURCES_64BIT=y 205CONFIG_RESOURCES_64BIT=y
206CONFIG_ZONE_DMA_FLAG=1
207# CONFIG_PPC_HAS_HASH_64K is not set
204# CONFIG_PPC_64K_PAGES is not set 208# CONFIG_PPC_64K_PAGES is not set
205# CONFIG_SCHED_SMT is not set 209# CONFIG_SCHED_SMT is not set
206CONFIG_PROC_DEVICETREE=y 210CONFIG_PROC_DEVICETREE=y
207# CONFIG_CMDLINE_BOOL is not set 211# CONFIG_CMDLINE_BOOL is not set
208# CONFIG_PM is not set 212# CONFIG_PM is not set
209# CONFIG_SECCOMP is not set 213# CONFIG_SECCOMP is not set
214# CONFIG_WANT_DEVICE_TREE is not set
210CONFIG_ISA_DMA_API=y 215CONFIG_ISA_DMA_API=y
211 216
212# 217#
213# Bus options 218# Bus options
214# 219#
220CONFIG_ZONE_DMA=y
215CONFIG_GENERIC_ISA_DMA=y 221CONFIG_GENERIC_ISA_DMA=y
216# CONFIG_MPIC_WEIRD is not set
217CONFIG_PPC_I8259=y
218# CONFIG_PPC_INDIRECT_PCI is not set 222# CONFIG_PPC_INDIRECT_PCI is not set
219CONFIG_PCI=y 223CONFIG_PCI=y
220CONFIG_PCI_DOMAINS=y 224CONFIG_PCI_DOMAINS=y
221# CONFIG_PCIEPORTBUS is not set 225# CONFIG_PCIEPORTBUS is not set
226CONFIG_ARCH_SUPPORTS_MSI=y
227# CONFIG_PCI_MSI is not set
222# CONFIG_PCI_DEBUG is not set 228# CONFIG_PCI_DEBUG is not set
223 229
224# 230#
@@ -237,10 +243,6 @@ CONFIG_CARDBUS=y
237# CONFIG_YENTA is not set 243# CONFIG_YENTA is not set
238# CONFIG_PD6729 is not set 244# CONFIG_PD6729 is not set
239# CONFIG_I82092 is not set 245# CONFIG_I82092 is not set
240
241#
242# PCI Hotplug Support
243#
244# CONFIG_HOTPLUG_PCI is not set 246# CONFIG_HOTPLUG_PCI is not set
245CONFIG_KERNEL_START=0xc000000000000000 247CONFIG_KERNEL_START=0xc000000000000000
246 248
@@ -252,14 +254,15 @@ CONFIG_NET=y
252# 254#
253# Networking options 255# Networking options
254# 256#
255# CONFIG_NETDEBUG is not set
256CONFIG_PACKET=y 257CONFIG_PACKET=y
257# CONFIG_PACKET_MMAP is not set 258# CONFIG_PACKET_MMAP is not set
258CONFIG_UNIX=y 259CONFIG_UNIX=y
259CONFIG_XFRM=y 260CONFIG_XFRM=y
260# CONFIG_XFRM_USER is not set 261# CONFIG_XFRM_USER is not set
261# CONFIG_XFRM_SUB_POLICY is not set 262# CONFIG_XFRM_SUB_POLICY is not set
263# CONFIG_XFRM_MIGRATE is not set
262CONFIG_NET_KEY=y 264CONFIG_NET_KEY=y
265# CONFIG_NET_KEY_MIGRATE is not set
263CONFIG_INET=y 266CONFIG_INET=y
264CONFIG_IP_MULTICAST=y 267CONFIG_IP_MULTICAST=y
265# CONFIG_IP_ADVANCED_ROUTER is not set 268# CONFIG_IP_ADVANCED_ROUTER is not set
@@ -331,7 +334,16 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
331# CONFIG_HAMRADIO is not set 334# CONFIG_HAMRADIO is not set
332# CONFIG_IRDA is not set 335# CONFIG_IRDA is not set
333# CONFIG_BT is not set 336# CONFIG_BT is not set
337# CONFIG_AF_RXRPC is not set
338
339#
340# Wireless
341#
342# CONFIG_CFG80211 is not set
343# CONFIG_WIRELESS_EXT is not set
344# CONFIG_MAC80211 is not set
334# CONFIG_IEEE80211 is not set 345# CONFIG_IEEE80211 is not set
346# CONFIG_RFKILL is not set
335 347
336# 348#
337# Device Drivers 349# Device Drivers
@@ -344,16 +356,13 @@ CONFIG_STANDALONE=y
344CONFIG_PREVENT_FIRMWARE_BUILD=y 356CONFIG_PREVENT_FIRMWARE_BUILD=y
345CONFIG_FW_LOADER=y 357CONFIG_FW_LOADER=y
346# CONFIG_DEBUG_DRIVER is not set 358# CONFIG_DEBUG_DRIVER is not set
359# CONFIG_DEBUG_DEVRES is not set
347# CONFIG_SYS_HYPERVISOR is not set 360# CONFIG_SYS_HYPERVISOR is not set
348 361
349# 362#
350# Connector - unified userspace <-> kernelspace linker 363# Connector - unified userspace <-> kernelspace linker
351# 364#
352# CONFIG_CONNECTOR is not set 365# CONFIG_CONNECTOR is not set
353
354#
355# Memory Technology Devices (MTD)
356#
357CONFIG_MTD=y 366CONFIG_MTD=y
358# CONFIG_MTD_DEBUG is not set 367# CONFIG_MTD_DEBUG is not set
359CONFIG_MTD_CONCAT=y 368CONFIG_MTD_CONCAT=y
@@ -389,7 +398,6 @@ CONFIG_MTD_CFI_I2=y
389# CONFIG_MTD_RAM is not set 398# CONFIG_MTD_RAM is not set
390# CONFIG_MTD_ROM is not set 399# CONFIG_MTD_ROM is not set
391# CONFIG_MTD_ABSENT is not set 400# CONFIG_MTD_ABSENT is not set
392# CONFIG_MTD_OBSOLETE_CHIPS is not set
393 401
394# 402#
395# Mapping drivers for chip access 403# Mapping drivers for chip access
@@ -412,17 +420,13 @@ CONFIG_MTD_PHRAM=y
412# CONFIG_MTD_DOC2000 is not set 420# CONFIG_MTD_DOC2000 is not set
413# CONFIG_MTD_DOC2001 is not set 421# CONFIG_MTD_DOC2001 is not set
414# CONFIG_MTD_DOC2001PLUS is not set 422# CONFIG_MTD_DOC2001PLUS is not set
415
416#
417# NAND Flash Device Drivers
418#
419# CONFIG_MTD_NAND is not set 423# CONFIG_MTD_NAND is not set
420# CONFIG_MTD_NAND_CAFE is not set 424# CONFIG_MTD_ONENAND is not set
421 425
422# 426#
423# OneNAND Flash Device Drivers 427# UBI - Unsorted block images
424# 428#
425# CONFIG_MTD_ONENAND is not set 429# CONFIG_MTD_UBI is not set
426 430
427# 431#
428# Parallel port support 432# Parallel port support
@@ -432,6 +436,7 @@ CONFIG_MTD_PHRAM=y
432# 436#
433# Plug and Play support 437# Plug and Play support
434# 438#
439# CONFIG_PNPACPI is not set
435 440
436# 441#
437# Block devices 442# Block devices
@@ -451,15 +456,16 @@ CONFIG_BLK_DEV_RAM=y
451CONFIG_BLK_DEV_RAM_COUNT=16 456CONFIG_BLK_DEV_RAM_COUNT=16
452CONFIG_BLK_DEV_RAM_SIZE=16384 457CONFIG_BLK_DEV_RAM_SIZE=16384
453CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 458CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
454CONFIG_BLK_DEV_INITRD=y
455# CONFIG_CDROM_PKTCDVD is not set 459# CONFIG_CDROM_PKTCDVD is not set
456# CONFIG_ATA_OVER_ETH is not set 460# CONFIG_ATA_OVER_ETH is not set
457 461
458# 462#
459# Misc devices 463# Misc devices
460# 464#
465# CONFIG_PHANTOM is not set
461# CONFIG_SGI_IOC4 is not set 466# CONFIG_SGI_IOC4 is not set
462# CONFIG_TIFM_CORE is not set 467# CONFIG_TIFM_CORE is not set
468# CONFIG_BLINK is not set
463 469
464# 470#
465# ATA/ATAPI/MFM/RLL support 471# ATA/ATAPI/MFM/RLL support
@@ -474,20 +480,22 @@ CONFIG_BLK_DEV_IDE=y
474CONFIG_BLK_DEV_IDEDISK=y 480CONFIG_BLK_DEV_IDEDISK=y
475CONFIG_IDEDISK_MULTI_MODE=y 481CONFIG_IDEDISK_MULTI_MODE=y
476# CONFIG_BLK_DEV_IDECS is not set 482# CONFIG_BLK_DEV_IDECS is not set
483# CONFIG_BLK_DEV_DELKIN is not set
477CONFIG_BLK_DEV_IDECD=y 484CONFIG_BLK_DEV_IDECD=y
478# CONFIG_BLK_DEV_IDETAPE is not set 485# CONFIG_BLK_DEV_IDETAPE is not set
479# CONFIG_BLK_DEV_IDEFLOPPY is not set 486# CONFIG_BLK_DEV_IDEFLOPPY is not set
480CONFIG_BLK_DEV_IDESCSI=y 487CONFIG_BLK_DEV_IDESCSI=y
481CONFIG_IDE_TASK_IOCTL=y 488CONFIG_IDE_TASK_IOCTL=y
489CONFIG_IDE_PROC_FS=y
482 490
483# 491#
484# IDE chipset support/bugfixes 492# IDE chipset support/bugfixes
485# 493#
486# CONFIG_IDE_GENERIC is not set 494# CONFIG_IDE_GENERIC is not set
487# CONFIG_BLK_DEV_IDEPCI is not set 495# CONFIG_BLK_DEV_IDEPCI is not set
496# CONFIG_IDEPCI_PCIBUS_ORDER is not set
488# CONFIG_IDE_ARM is not set 497# CONFIG_IDE_ARM is not set
489# CONFIG_BLK_DEV_IDEDMA is not set 498# CONFIG_BLK_DEV_IDEDMA is not set
490# CONFIG_IDEDMA_AUTO is not set
491# CONFIG_BLK_DEV_HD is not set 499# CONFIG_BLK_DEV_HD is not set
492 500
493# 501#
@@ -517,6 +525,7 @@ CONFIG_SCSI_MULTI_LUN=y
517CONFIG_SCSI_CONSTANTS=y 525CONFIG_SCSI_CONSTANTS=y
518CONFIG_SCSI_LOGGING=y 526CONFIG_SCSI_LOGGING=y
519# CONFIG_SCSI_SCAN_ASYNC is not set 527# CONFIG_SCSI_SCAN_ASYNC is not set
528CONFIG_SCSI_WAIT_SCAN=m
520 529
521# 530#
522# SCSI Transports 531# SCSI Transports
@@ -550,7 +559,6 @@ CONFIG_SCSI_3W_9XXX=y
550# CONFIG_SCSI_FUTURE_DOMAIN is not set 559# CONFIG_SCSI_FUTURE_DOMAIN is not set
551# CONFIG_SCSI_GDTH is not set 560# CONFIG_SCSI_GDTH is not set
552# CONFIG_SCSI_IPS is not set 561# CONFIG_SCSI_IPS is not set
553# CONFIG_SCSI_IBMVSCSI is not set
554# CONFIG_SCSI_INITIO is not set 562# CONFIG_SCSI_INITIO is not set
555# CONFIG_SCSI_INIA100 is not set 563# CONFIG_SCSI_INIA100 is not set
556# CONFIG_SCSI_STEX is not set 564# CONFIG_SCSI_STEX is not set
@@ -563,6 +571,7 @@ CONFIG_SCSI_3W_9XXX=y
563# CONFIG_SCSI_DC395x is not set 571# CONFIG_SCSI_DC395x is not set
564# CONFIG_SCSI_DC390T is not set 572# CONFIG_SCSI_DC390T is not set
565# CONFIG_SCSI_DEBUG is not set 573# CONFIG_SCSI_DEBUG is not set
574# CONFIG_SCSI_ESP_CORE is not set
566# CONFIG_SCSI_SRP is not set 575# CONFIG_SCSI_SRP is not set
567 576
568# 577#
@@ -578,7 +587,7 @@ CONFIG_SCSI_3W_9XXX=y
578CONFIG_ATA=y 587CONFIG_ATA=y
579# CONFIG_ATA_NONSTANDARD is not set 588# CONFIG_ATA_NONSTANDARD is not set
580# CONFIG_SATA_AHCI is not set 589# CONFIG_SATA_AHCI is not set
581CONFIG_SATA_SVW=y 590# CONFIG_SATA_SVW is not set
582# CONFIG_ATA_PIIX is not set 591# CONFIG_ATA_PIIX is not set
583CONFIG_SATA_MV=y 592CONFIG_SATA_MV=y
584# CONFIG_SATA_NV is not set 593# CONFIG_SATA_NV is not set
@@ -586,16 +595,18 @@ CONFIG_SATA_MV=y
586# CONFIG_SATA_QSTOR is not set 595# CONFIG_SATA_QSTOR is not set
587# CONFIG_SATA_PROMISE is not set 596# CONFIG_SATA_PROMISE is not set
588# CONFIG_SATA_SX4 is not set 597# CONFIG_SATA_SX4 is not set
589CONFIG_SATA_SIL=y 598# CONFIG_SATA_SIL is not set
590CONFIG_SATA_SIL24=y 599CONFIG_SATA_SIL24=y
591# CONFIG_SATA_SIS is not set 600# CONFIG_SATA_SIS is not set
592# CONFIG_SATA_ULI is not set 601# CONFIG_SATA_ULI is not set
593# CONFIG_SATA_VIA is not set 602# CONFIG_SATA_VIA is not set
594# CONFIG_SATA_VITESSE is not set 603# CONFIG_SATA_VITESSE is not set
604# CONFIG_SATA_INIC162X is not set
595# CONFIG_PATA_ALI is not set 605# CONFIG_PATA_ALI is not set
596# CONFIG_PATA_AMD is not set 606# CONFIG_PATA_AMD is not set
597# CONFIG_PATA_ARTOP is not set 607# CONFIG_PATA_ARTOP is not set
598# CONFIG_PATA_ATIIXP is not set 608# CONFIG_PATA_ATIIXP is not set
609# CONFIG_PATA_CMD640_PCI is not set
599# CONFIG_PATA_CMD64X is not set 610# CONFIG_PATA_CMD64X is not set
600# CONFIG_PATA_CS5520 is not set 611# CONFIG_PATA_CS5520 is not set
601# CONFIG_PATA_CS5530 is not set 612# CONFIG_PATA_CS5530 is not set
@@ -607,6 +618,7 @@ CONFIG_ATA_GENERIC=y
607# CONFIG_PATA_HPT3X2N is not set 618# CONFIG_PATA_HPT3X2N is not set
608# CONFIG_PATA_HPT3X3 is not set 619# CONFIG_PATA_HPT3X3 is not set
609# CONFIG_PATA_IT821X is not set 620# CONFIG_PATA_IT821X is not set
621# CONFIG_PATA_IT8213 is not set
610# CONFIG_PATA_JMICRON is not set 622# CONFIG_PATA_JMICRON is not set
611# CONFIG_PATA_TRIFLEX is not set 623# CONFIG_PATA_TRIFLEX is not set
612# CONFIG_PATA_MARVELL is not set 624# CONFIG_PATA_MARVELL is not set
@@ -644,27 +656,26 @@ CONFIG_ATA_GENERIC=y
644# 656#
645# IEEE 1394 (FireWire) support 657# IEEE 1394 (FireWire) support
646# 658#
659# CONFIG_FIREWIRE is not set
647CONFIG_IEEE1394=y 660CONFIG_IEEE1394=y
648 661
649# 662#
650# Subsystem Options 663# Subsystem Options
651# 664#
652# CONFIG_IEEE1394_VERBOSEDEBUG is not set 665# CONFIG_IEEE1394_VERBOSEDEBUG is not set
653# CONFIG_IEEE1394_OUI_DB is not set
654# CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set
655# CONFIG_IEEE1394_EXPORT_FULL_API is not set
656 666
657# 667#
658# Device Drivers 668# Controllers
659# 669#
660CONFIG_IEEE1394_PCILYNX=y 670CONFIG_IEEE1394_PCILYNX=y
661CONFIG_IEEE1394_OHCI1394=y 671CONFIG_IEEE1394_OHCI1394=y
662 672
663# 673#
664# Protocol Drivers 674# Protocols
665# 675#
666# CONFIG_IEEE1394_VIDEO1394 is not set 676# CONFIG_IEEE1394_VIDEO1394 is not set
667CONFIG_IEEE1394_SBP2=y 677CONFIG_IEEE1394_SBP2=y
678# CONFIG_IEEE1394_ETH1394_ROM_ENTRY is not set
668# CONFIG_IEEE1394_ETH1394 is not set 679# CONFIG_IEEE1394_ETH1394 is not set
669# CONFIG_IEEE1394_DV1394 is not set 680# CONFIG_IEEE1394_DV1394 is not set
670CONFIG_IEEE1394_RAWIO=y 681CONFIG_IEEE1394_RAWIO=y
@@ -673,12 +684,7 @@ CONFIG_IEEE1394_RAWIO=y
673# I2O device support 684# I2O device support
674# 685#
675# CONFIG_I2O is not set 686# CONFIG_I2O is not set
676 687# CONFIG_MACINTOSH_DRIVERS is not set
677#
678# Macintosh device drivers
679#
680# CONFIG_MAC_EMUMOUSEBTN is not set
681# CONFIG_WINDFARM is not set
682 688
683# 689#
684# Network device support 690# Network device support
@@ -697,7 +703,20 @@ CONFIG_DUMMY=y
697# 703#
698# PHY device support 704# PHY device support
699# 705#
700# CONFIG_PHYLIB is not set 706CONFIG_PHYLIB=y
707
708#
709# MII PHY device drivers
710#
711CONFIG_MARVELL_PHY=y
712# CONFIG_DAVICOM_PHY is not set
713# CONFIG_QSEMI_PHY is not set
714# CONFIG_LXT_PHY is not set
715# CONFIG_CICADA_PHY is not set
716# CONFIG_VITESSE_PHY is not set
717# CONFIG_SMSC_PHY is not set
718# CONFIG_BROADCOM_PHY is not set
719# CONFIG_FIXED_PHY is not set
701 720
702# 721#
703# Ethernet (10 or 100Mbit) 722# Ethernet (10 or 100Mbit)
@@ -714,7 +733,6 @@ CONFIG_MII=y
714# 733#
715# CONFIG_NET_TULIP is not set 734# CONFIG_NET_TULIP is not set
716# CONFIG_HP100 is not set 735# CONFIG_HP100 is not set
717CONFIG_IBMVETH=y
718CONFIG_NET_PCI=y 736CONFIG_NET_PCI=y
719# CONFIG_PCNET32 is not set 737# CONFIG_PCNET32 is not set
720# CONFIG_AMD8111_ETH is not set 738# CONFIG_AMD8111_ETH is not set
@@ -722,7 +740,7 @@ CONFIG_NET_PCI=y
722# CONFIG_B44 is not set 740# CONFIG_B44 is not set
723# CONFIG_FORCEDETH is not set 741# CONFIG_FORCEDETH is not set
724# CONFIG_DGRS is not set 742# CONFIG_DGRS is not set
725CONFIG_EEPRO100=y 743# CONFIG_EEPRO100 is not set
726# CONFIG_E100 is not set 744# CONFIG_E100 is not set
727# CONFIG_FEALNX is not set 745# CONFIG_FEALNX is not set
728# CONFIG_NATSEMI is not set 746# CONFIG_NATSEMI is not set
@@ -733,6 +751,7 @@ CONFIG_EEPRO100=y
733# CONFIG_EPIC100 is not set 751# CONFIG_EPIC100 is not set
734# CONFIG_SUNDANCE is not set 752# CONFIG_SUNDANCE is not set
735# CONFIG_VIA_RHINE is not set 753# CONFIG_VIA_RHINE is not set
754# CONFIG_SC92031 is not set
736 755
737# 756#
738# Ethernet (1000 Mbit) 757# Ethernet (1000 Mbit)
@@ -754,15 +773,20 @@ CONFIG_E1000_NAPI=y
754CONFIG_TIGON3=y 773CONFIG_TIGON3=y
755# CONFIG_BNX2 is not set 774# CONFIG_BNX2 is not set
756# CONFIG_QLA3XXX is not set 775# CONFIG_QLA3XXX is not set
776# CONFIG_ATL1 is not set
757 777
758# 778#
759# Ethernet (10000 Mbit) 779# Ethernet (10000 Mbit)
760# 780#
761# CONFIG_CHELSIO_T1 is not set 781# CONFIG_CHELSIO_T1 is not set
782# CONFIG_CHELSIO_T3 is not set
762# CONFIG_IXGB is not set 783# CONFIG_IXGB is not set
763# CONFIG_S2IO is not set 784# CONFIG_S2IO is not set
764# CONFIG_MYRI10GE is not set 785# CONFIG_MYRI10GE is not set
765# CONFIG_NETXEN_NIC is not set 786# CONFIG_NETXEN_NIC is not set
787CONFIG_PASEMI_MAC=y
788# CONFIG_MLX4_CORE is not set
789CONFIG_MLX4_DEBUG=y
766 790
767# 791#
768# Token Ring devices 792# Token Ring devices
@@ -770,9 +794,20 @@ CONFIG_TIGON3=y
770# CONFIG_TR is not set 794# CONFIG_TR is not set
771 795
772# 796#
773# Wireless LAN (non-hamradio) 797# Wireless LAN
798#
799# CONFIG_WLAN_PRE80211 is not set
800# CONFIG_WLAN_80211 is not set
801
802#
803# USB Network Adapters
774# 804#
775# CONFIG_NET_RADIO is not set 805# CONFIG_USB_CATC is not set
806# CONFIG_USB_KAWETH is not set
807# CONFIG_USB_PEGASUS is not set
808# CONFIG_USB_RTL8150 is not set
809# CONFIG_USB_USBNET_MII is not set
810# CONFIG_USB_USBNET is not set
776 811
777# 812#
778# PCMCIA network device support 813# PCMCIA network device support
@@ -834,8 +869,10 @@ CONFIG_INPUT_KEYBOARD=y
834CONFIG_INPUT_MOUSE=y 869CONFIG_INPUT_MOUSE=y
835# CONFIG_MOUSE_PS2 is not set 870# CONFIG_MOUSE_PS2 is not set
836# CONFIG_MOUSE_SERIAL is not set 871# CONFIG_MOUSE_SERIAL is not set
872# CONFIG_MOUSE_APPLETOUCH is not set
837# CONFIG_MOUSE_VSXXXAA is not set 873# CONFIG_MOUSE_VSXXXAA is not set
838# CONFIG_INPUT_JOYSTICK is not set 874# CONFIG_INPUT_JOYSTICK is not set
875# CONFIG_INPUT_TABLET is not set
839# CONFIG_INPUT_TOUCHSCREEN is not set 876# CONFIG_INPUT_TOUCHSCREEN is not set
840# CONFIG_INPUT_MISC is not set 877# CONFIG_INPUT_MISC is not set
841 878
@@ -870,29 +907,21 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
870# 907#
871CONFIG_SERIAL_CORE=y 908CONFIG_SERIAL_CORE=y
872CONFIG_SERIAL_CORE_CONSOLE=y 909CONFIG_SERIAL_CORE_CONSOLE=y
873# CONFIG_SERIAL_ICOM is not set
874# CONFIG_SERIAL_JSM is not set 910# CONFIG_SERIAL_JSM is not set
911# CONFIG_SERIAL_OF_PLATFORM is not set
875CONFIG_UNIX98_PTYS=y 912CONFIG_UNIX98_PTYS=y
876CONFIG_LEGACY_PTYS=y 913CONFIG_LEGACY_PTYS=y
877CONFIG_LEGACY_PTY_COUNT=4 914CONFIG_LEGACY_PTY_COUNT=4
878CONFIG_HVC_DRIVER=y
879CONFIG_HVC_CONSOLE=y
880CONFIG_HVC_RTAS=y
881# CONFIG_HVCS is not set
882 915
883# 916#
884# IPMI 917# IPMI
885# 918#
886# CONFIG_IPMI_HANDLER is not set 919# CONFIG_IPMI_HANDLER is not set
887
888#
889# Watchdog Cards
890#
891# CONFIG_WATCHDOG is not set 920# CONFIG_WATCHDOG is not set
892CONFIG_HW_RANDOM=y 921CONFIG_HW_RANDOM=y
922CONFIG_HW_RANDOM_PASEMI=y
893CONFIG_GEN_RTC=y 923CONFIG_GEN_RTC=y
894CONFIG_GEN_RTC_X=y 924CONFIG_GEN_RTC_X=y
895# CONFIG_DTLK is not set
896# CONFIG_R3964 is not set 925# CONFIG_R3964 is not set
897# CONFIG_APPLICOM is not set 926# CONFIG_APPLICOM is not set
898# CONFIG_AGP is not set 927# CONFIG_AGP is not set
@@ -912,11 +941,9 @@ CONFIG_MAX_RAW_DEVS=256
912# TPM devices 941# TPM devices
913# 942#
914# CONFIG_TCG_TPM is not set 943# CONFIG_TCG_TPM is not set
915 944CONFIG_DEVPORT=y
916#
917# I2C support
918#
919CONFIG_I2C=y 945CONFIG_I2C=y
946CONFIG_I2C_BOARDINFO=y
920CONFIG_I2C_CHARDEV=y 947CONFIG_I2C_CHARDEV=y
921 948
922# 949#
@@ -940,16 +967,18 @@ CONFIG_I2C_ALGOPCA=y
940# CONFIG_I2C_NFORCE2 is not set 967# CONFIG_I2C_NFORCE2 is not set
941# CONFIG_I2C_OCORES is not set 968# CONFIG_I2C_OCORES is not set
942# CONFIG_I2C_PARPORT_LIGHT is not set 969# CONFIG_I2C_PARPORT_LIGHT is not set
970CONFIG_I2C_PASEMI=y
943# CONFIG_I2C_PROSAVAGE is not set 971# CONFIG_I2C_PROSAVAGE is not set
944# CONFIG_I2C_SAVAGE4 is not set 972# CONFIG_I2C_SAVAGE4 is not set
973# CONFIG_I2C_SIMTEC is not set
945# CONFIG_I2C_SIS5595 is not set 974# CONFIG_I2C_SIS5595 is not set
946# CONFIG_I2C_SIS630 is not set 975# CONFIG_I2C_SIS630 is not set
947# CONFIG_I2C_SIS96X is not set 976# CONFIG_I2C_SIS96X is not set
948# CONFIG_I2C_STUB is not set 977# CONFIG_I2C_STUB is not set
978# CONFIG_I2C_TINY_USB is not set
949# CONFIG_I2C_VIA is not set 979# CONFIG_I2C_VIA is not set
950# CONFIG_I2C_VIAPRO is not set 980# CONFIG_I2C_VIAPRO is not set
951# CONFIG_I2C_VOODOO3 is not set 981# CONFIG_I2C_VOODOO3 is not set
952# CONFIG_I2C_PCA_ISA is not set
953 982
954# 983#
955# Miscellaneous I2C Chip support 984# Miscellaneous I2C Chip support
@@ -963,7 +992,7 @@ CONFIG_SENSORS_EEPROM=y
963# CONFIG_SENSORS_MAX6875 is not set 992# CONFIG_SENSORS_MAX6875 is not set
964# CONFIG_I2C_DEBUG_CORE is not set 993# CONFIG_I2C_DEBUG_CORE is not set
965# CONFIG_I2C_DEBUG_ALGO is not set 994# CONFIG_I2C_DEBUG_ALGO is not set
966CONFIG_I2C_DEBUG_BUS=y 995# CONFIG_I2C_DEBUG_BUS is not set
967# CONFIG_I2C_DEBUG_CHIP is not set 996# CONFIG_I2C_DEBUG_CHIP is not set
968 997
969# 998#
@@ -976,16 +1005,14 @@ CONFIG_I2C_DEBUG_BUS=y
976# Dallas's 1-wire bus 1005# Dallas's 1-wire bus
977# 1006#
978# CONFIG_W1 is not set 1007# CONFIG_W1 is not set
979
980#
981# Hardware Monitoring support
982#
983CONFIG_HWMON=y 1008CONFIG_HWMON=y
984CONFIG_HWMON_VID=y 1009CONFIG_HWMON_VID=y
985# CONFIG_SENSORS_ABITUGURU is not set 1010# CONFIG_SENSORS_ABITUGURU is not set
1011# CONFIG_SENSORS_AD7418 is not set
986# CONFIG_SENSORS_ADM1021 is not set 1012# CONFIG_SENSORS_ADM1021 is not set
987# CONFIG_SENSORS_ADM1025 is not set 1013# CONFIG_SENSORS_ADM1025 is not set
988# CONFIG_SENSORS_ADM1026 is not set 1014# CONFIG_SENSORS_ADM1026 is not set
1015# CONFIG_SENSORS_ADM1029 is not set
989# CONFIG_SENSORS_ADM1031 is not set 1016# CONFIG_SENSORS_ADM1031 is not set
990# CONFIG_SENSORS_ADM9240 is not set 1017# CONFIG_SENSORS_ADM9240 is not set
991# CONFIG_SENSORS_ASB100 is not set 1018# CONFIG_SENSORS_ASB100 is not set
@@ -1008,6 +1035,7 @@ CONFIG_SENSORS_LM85=y
1008CONFIG_SENSORS_LM90=y 1035CONFIG_SENSORS_LM90=y
1009# CONFIG_SENSORS_LM92 is not set 1036# CONFIG_SENSORS_LM92 is not set
1010# CONFIG_SENSORS_MAX1619 is not set 1037# CONFIG_SENSORS_MAX1619 is not set
1038# CONFIG_SENSORS_MAX6650 is not set
1011# CONFIG_SENSORS_PC87360 is not set 1039# CONFIG_SENSORS_PC87360 is not set
1012# CONFIG_SENSORS_PC87427 is not set 1040# CONFIG_SENSORS_PC87427 is not set
1013# CONFIG_SENSORS_SIS5595 is not set 1041# CONFIG_SENSORS_SIS5595 is not set
@@ -1027,29 +1055,50 @@ CONFIG_SENSORS_LM90=y
1027# CONFIG_HWMON_DEBUG_CHIP is not set 1055# CONFIG_HWMON_DEBUG_CHIP is not set
1028 1056
1029# 1057#
1030# Multimedia devices 1058# Multifunction device drivers
1031# 1059#
1032# CONFIG_VIDEO_DEV is not set 1060# CONFIG_MFD_SM501 is not set
1033 1061
1034# 1062#
1035# Digital Video Broadcasting Devices 1063# Multimedia devices
1036# 1064#
1037# CONFIG_DVB is not set 1065# CONFIG_VIDEO_DEV is not set
1066# CONFIG_DVB_CORE is not set
1067CONFIG_DAB=y
1038# CONFIG_USB_DABUSB is not set 1068# CONFIG_USB_DABUSB is not set
1039 1069
1040# 1070#
1041# Graphics support 1071# Graphics support
1042# 1072#
1043CONFIG_FIRMWARE_EDID=y 1073CONFIG_BACKLIGHT_LCD_SUPPORT=y
1074CONFIG_BACKLIGHT_CLASS_DEVICE=y
1075CONFIG_LCD_CLASS_DEVICE=m
1076
1077#
1078# Display device support
1079#
1080# CONFIG_DISPLAY_SUPPORT is not set
1081CONFIG_VGASTATE=y
1044CONFIG_FB=y 1082CONFIG_FB=y
1083CONFIG_FIRMWARE_EDID=y
1045CONFIG_FB_DDC=y 1084CONFIG_FB_DDC=y
1046CONFIG_FB_CFB_FILLRECT=y 1085CONFIG_FB_CFB_FILLRECT=y
1047CONFIG_FB_CFB_COPYAREA=y 1086CONFIG_FB_CFB_COPYAREA=y
1048CONFIG_FB_CFB_IMAGEBLIT=y 1087CONFIG_FB_CFB_IMAGEBLIT=y
1088# CONFIG_FB_SYS_FILLRECT is not set
1089# CONFIG_FB_SYS_COPYAREA is not set
1090# CONFIG_FB_SYS_IMAGEBLIT is not set
1091# CONFIG_FB_SYS_FOPS is not set
1092CONFIG_FB_DEFERRED_IO=y
1093# CONFIG_FB_SVGALIB is not set
1049CONFIG_FB_MACMODES=y 1094CONFIG_FB_MACMODES=y
1050# CONFIG_FB_BACKLIGHT is not set 1095CONFIG_FB_BACKLIGHT=y
1051CONFIG_FB_MODE_HELPERS=y 1096CONFIG_FB_MODE_HELPERS=y
1052CONFIG_FB_TILEBLITTING=y 1097CONFIG_FB_TILEBLITTING=y
1098
1099#
1100# Frame buffer hardware drivers
1101#
1053# CONFIG_FB_CIRRUS is not set 1102# CONFIG_FB_CIRRUS is not set
1054# CONFIG_FB_PM2 is not set 1103# CONFIG_FB_PM2 is not set
1055# CONFIG_FB_CYBER2000 is not set 1104# CONFIG_FB_CYBER2000 is not set
@@ -1060,28 +1109,27 @@ CONFIG_FB_VGA16=y
1060# CONFIG_FB_S1D13XXX is not set 1109# CONFIG_FB_S1D13XXX is not set
1061CONFIG_FB_NVIDIA=y 1110CONFIG_FB_NVIDIA=y
1062CONFIG_FB_NVIDIA_I2C=y 1111CONFIG_FB_NVIDIA_I2C=y
1063CONFIG_FB_RIVA=y 1112# CONFIG_FB_NVIDIA_DEBUG is not set
1064CONFIG_FB_RIVA_I2C=y 1113CONFIG_FB_NVIDIA_BACKLIGHT=y
1065# CONFIG_FB_RIVA_DEBUG is not set 1114# CONFIG_FB_RIVA is not set
1066CONFIG_FB_MATROX=y 1115# CONFIG_FB_MATROX is not set
1067CONFIG_FB_MATROX_MILLENIUM=y
1068CONFIG_FB_MATROX_MYSTIQUE=y
1069CONFIG_FB_MATROX_G=y
1070CONFIG_FB_MATROX_I2C=y
1071CONFIG_FB_MATROX_MAVEN=y
1072CONFIG_FB_MATROX_MULTIHEAD=y
1073CONFIG_FB_RADEON=y 1116CONFIG_FB_RADEON=y
1074CONFIG_FB_RADEON_I2C=y 1117CONFIG_FB_RADEON_I2C=y
1118CONFIG_FB_RADEON_BACKLIGHT=y
1075# CONFIG_FB_RADEON_DEBUG is not set 1119# CONFIG_FB_RADEON_DEBUG is not set
1076# CONFIG_FB_ATY128 is not set 1120# CONFIG_FB_ATY128 is not set
1077# CONFIG_FB_ATY is not set 1121# CONFIG_FB_ATY is not set
1122# CONFIG_FB_S3 is not set
1078# CONFIG_FB_SAVAGE is not set 1123# CONFIG_FB_SAVAGE is not set
1079# CONFIG_FB_SIS is not set 1124# CONFIG_FB_SIS is not set
1080# CONFIG_FB_NEOMAGIC is not set 1125# CONFIG_FB_NEOMAGIC is not set
1081# CONFIG_FB_KYRO is not set 1126# CONFIG_FB_KYRO is not set
1082# CONFIG_FB_3DFX is not set 1127# CONFIG_FB_3DFX is not set
1083# CONFIG_FB_VOODOO1 is not set 1128# CONFIG_FB_VOODOO1 is not set
1129# CONFIG_FB_VT8623 is not set
1084# CONFIG_FB_TRIDENT is not set 1130# CONFIG_FB_TRIDENT is not set
1131# CONFIG_FB_ARK is not set
1132# CONFIG_FB_PM3 is not set
1085# CONFIG_FB_IBM_GXT4500 is not set 1133# CONFIG_FB_IBM_GXT4500 is not set
1086# CONFIG_FB_VIRTUAL is not set 1134# CONFIG_FB_VIRTUAL is not set
1087 1135
@@ -1097,15 +1145,10 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
1097# CONFIG_FONTS is not set 1145# CONFIG_FONTS is not set
1098CONFIG_FONT_8x8=y 1146CONFIG_FONT_8x8=y
1099CONFIG_FONT_8x16=y 1147CONFIG_FONT_8x16=y
1100
1101#
1102# Logo configuration
1103#
1104CONFIG_LOGO=y 1148CONFIG_LOGO=y
1105CONFIG_LOGO_LINUX_MONO=y 1149CONFIG_LOGO_LINUX_MONO=y
1106CONFIG_LOGO_LINUX_VGA16=y 1150CONFIG_LOGO_LINUX_VGA16=y
1107CONFIG_LOGO_LINUX_CLUT224=y 1151CONFIG_LOGO_LINUX_CLUT224=y
1108# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1109 1152
1110# 1153#
1111# Sound 1154# Sound
@@ -1211,6 +1254,7 @@ CONFIG_SND_VERBOSE_PROCFS=y
1211# 1254#
1212CONFIG_SND_USB_AUDIO=y 1255CONFIG_SND_USB_AUDIO=y
1213CONFIG_SND_USB_USX2Y=y 1256CONFIG_SND_USB_USX2Y=y
1257# CONFIG_SND_USB_CAIAQ is not set
1214 1258
1215# 1259#
1216# PCMCIA devices 1260# PCMCIA devices
@@ -1219,6 +1263,11 @@ CONFIG_SND_USB_USX2Y=y
1219# CONFIG_SND_PDAUDIOCF is not set 1263# CONFIG_SND_PDAUDIOCF is not set
1220 1264
1221# 1265#
1266# System on Chip audio support
1267#
1268# CONFIG_SND_SOC is not set
1269
1270#
1222# Open Sound System 1271# Open Sound System
1223# 1272#
1224# CONFIG_SOUND_PRIME is not set 1273# CONFIG_SOUND_PRIME is not set
@@ -1227,6 +1276,15 @@ CONFIG_SND_USB_USX2Y=y
1227# HID Devices 1276# HID Devices
1228# 1277#
1229CONFIG_HID=y 1278CONFIG_HID=y
1279# CONFIG_HID_DEBUG is not set
1280
1281#
1282# USB Input Devices
1283#
1284CONFIG_USB_HID=y
1285# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1286# CONFIG_HID_FF is not set
1287# CONFIG_USB_HIDDEV is not set
1230 1288
1231# 1289#
1232# USB support 1290# USB support
@@ -1241,7 +1299,7 @@ CONFIG_USB=y
1241# Miscellaneous USB options 1299# Miscellaneous USB options
1242# 1300#
1243CONFIG_USB_DEVICEFS=y 1301CONFIG_USB_DEVICEFS=y
1244# CONFIG_USB_BANDWIDTH is not set 1302# CONFIG_USB_DEVICE_CLASS is not set
1245# CONFIG_USB_DYNAMIC_MINORS is not set 1303# CONFIG_USB_DYNAMIC_MINORS is not set
1246# CONFIG_USB_OTG is not set 1304# CONFIG_USB_OTG is not set
1247 1305
@@ -1252,9 +1310,15 @@ CONFIG_USB_EHCI_HCD=y
1252# CONFIG_USB_EHCI_SPLIT_ISO is not set 1310# CONFIG_USB_EHCI_SPLIT_ISO is not set
1253# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1311# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1254# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1312# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1313# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set
1255# CONFIG_USB_ISP116X_HCD is not set 1314# CONFIG_USB_ISP116X_HCD is not set
1256CONFIG_USB_OHCI_HCD=y 1315CONFIG_USB_OHCI_HCD=y
1257# CONFIG_USB_OHCI_BIG_ENDIAN is not set 1316CONFIG_USB_OHCI_HCD_PPC_OF=y
1317CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1318# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1319CONFIG_USB_OHCI_HCD_PCI=y
1320CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1321CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
1258CONFIG_USB_OHCI_LITTLE_ENDIAN=y 1322CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1259CONFIG_USB_UHCI_HCD=y 1323CONFIG_USB_UHCI_HCD=y
1260CONFIG_USB_SL811_HCD=y 1324CONFIG_USB_SL811_HCD=y
@@ -1289,41 +1353,11 @@ CONFIG_USB_STORAGE=y
1289CONFIG_USB_LIBUSUAL=y 1353CONFIG_USB_LIBUSUAL=y
1290 1354
1291# 1355#
1292# USB Input Devices
1293#
1294CONFIG_USB_HID=y
1295# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1296# CONFIG_HID_FF is not set
1297# CONFIG_USB_HIDDEV is not set
1298# CONFIG_USB_AIPTEK is not set
1299# CONFIG_USB_WACOM is not set
1300# CONFIG_USB_ACECAD is not set
1301# CONFIG_USB_KBTAB is not set
1302# CONFIG_USB_POWERMATE is not set
1303# CONFIG_USB_TOUCHSCREEN is not set
1304# CONFIG_USB_YEALINK is not set
1305# CONFIG_USB_XPAD is not set
1306# CONFIG_USB_ATI_REMOTE is not set
1307# CONFIG_USB_ATI_REMOTE2 is not set
1308# CONFIG_USB_KEYSPAN_REMOTE is not set
1309# CONFIG_USB_APPLETOUCH is not set
1310
1311#
1312# USB Imaging devices 1356# USB Imaging devices
1313# 1357#
1314# CONFIG_USB_MDC800 is not set 1358# CONFIG_USB_MDC800 is not set
1315# CONFIG_USB_MICROTEK is not set 1359# CONFIG_USB_MICROTEK is not set
1316 1360# CONFIG_USB_MON is not set
1317#
1318# USB Network Adapters
1319#
1320# CONFIG_USB_CATC is not set
1321# CONFIG_USB_KAWETH is not set
1322# CONFIG_USB_PEGASUS is not set
1323# CONFIG_USB_RTL8150 is not set
1324# CONFIG_USB_USBNET_MII is not set
1325# CONFIG_USB_USBNET is not set
1326CONFIG_USB_MON=y
1327 1361
1328# 1362#
1329# USB port drivers 1363# USB port drivers
@@ -1344,6 +1378,7 @@ CONFIG_USB_MON=y
1344# CONFIG_USB_RIO500 is not set 1378# CONFIG_USB_RIO500 is not set
1345# CONFIG_USB_LEGOTOWER is not set 1379# CONFIG_USB_LEGOTOWER is not set
1346# CONFIG_USB_LCD is not set 1380# CONFIG_USB_LCD is not set
1381# CONFIG_USB_BERRY_CHARGE is not set
1347# CONFIG_USB_LED is not set 1382# CONFIG_USB_LED is not set
1348# CONFIG_USB_CYPRESS_CY7C63 is not set 1383# CONFIG_USB_CYPRESS_CY7C63 is not set
1349# CONFIG_USB_CYTHERM is not set 1384# CONFIG_USB_CYTHERM is not set
@@ -1354,6 +1389,7 @@ CONFIG_USB_MON=y
1354# CONFIG_USB_SISUSBVGA is not set 1389# CONFIG_USB_SISUSBVGA is not set
1355# CONFIG_USB_LD is not set 1390# CONFIG_USB_LD is not set
1356# CONFIG_USB_TRANCEVIBRATOR is not set 1391# CONFIG_USB_TRANCEVIBRATOR is not set
1392# CONFIG_USB_IOWARRIOR is not set
1357# CONFIG_USB_TEST is not set 1393# CONFIG_USB_TEST is not set
1358 1394
1359# 1395#
@@ -1364,10 +1400,6 @@ CONFIG_USB_MON=y
1364# USB Gadget Support 1400# USB Gadget Support
1365# 1401#
1366# CONFIG_USB_GADGET is not set 1402# CONFIG_USB_GADGET is not set
1367
1368#
1369# MMC/SD Card support
1370#
1371# CONFIG_MMC is not set 1403# CONFIG_MMC is not set
1372 1404
1373# 1405#
@@ -1408,24 +1440,37 @@ CONFIG_RTC_INTF_SYSFS=y
1408CONFIG_RTC_INTF_PROC=y 1440CONFIG_RTC_INTF_PROC=y
1409CONFIG_RTC_INTF_DEV=y 1441CONFIG_RTC_INTF_DEV=y
1410# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set 1442# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1443# CONFIG_RTC_DRV_TEST is not set
1411 1444
1412# 1445#
1413# RTC drivers 1446# I2C RTC drivers
1414# 1447#
1415# CONFIG_RTC_DRV_X1205 is not set
1416CONFIG_RTC_DRV_DS1307=y 1448CONFIG_RTC_DRV_DS1307=y
1417# CONFIG_RTC_DRV_DS1553 is not set
1418# CONFIG_RTC_DRV_ISL1208 is not set
1419# CONFIG_RTC_DRV_DS1672 is not set 1449# CONFIG_RTC_DRV_DS1672 is not set
1420# CONFIG_RTC_DRV_DS1742 is not set 1450# CONFIG_RTC_DRV_MAX6900 is not set
1451# CONFIG_RTC_DRV_RS5C372 is not set
1452# CONFIG_RTC_DRV_ISL1208 is not set
1453# CONFIG_RTC_DRV_X1205 is not set
1421# CONFIG_RTC_DRV_PCF8563 is not set 1454# CONFIG_RTC_DRV_PCF8563 is not set
1422# CONFIG_RTC_DRV_PCF8583 is not set 1455# CONFIG_RTC_DRV_PCF8583 is not set
1423# CONFIG_RTC_DRV_RS5C372 is not set 1456
1457#
1458# SPI RTC drivers
1459#
1460
1461#
1462# Platform RTC drivers
1463#
1464# CONFIG_RTC_DRV_DS1553 is not set
1465# CONFIG_RTC_DRV_DS1742 is not set
1424# CONFIG_RTC_DRV_M48T86 is not set 1466# CONFIG_RTC_DRV_M48T86 is not set
1425# CONFIG_RTC_DRV_TEST is not set
1426# CONFIG_RTC_DRV_V3020 is not set 1467# CONFIG_RTC_DRV_V3020 is not set
1427 1468
1428# 1469#
1470# on-CPU RTC drivers
1471#
1472
1473#
1429# DMA Engine support 1474# DMA Engine support
1430# 1475#
1431# CONFIG_DMA_ENGINE is not set 1476# CONFIG_DMA_ENGINE is not set
@@ -1439,10 +1484,6 @@ CONFIG_RTC_DRV_DS1307=y
1439# 1484#
1440 1485
1441# 1486#
1442# Virtualization
1443#
1444
1445#
1446# File systems 1487# File systems
1447# 1488#
1448CONFIG_EXT2_FS=y 1489CONFIG_EXT2_FS=y
@@ -1466,7 +1507,8 @@ CONFIG_FS_POSIX_ACL=y
1466# CONFIG_OCFS2_FS is not set 1507# CONFIG_OCFS2_FS is not set
1467# CONFIG_MINIX_FS is not set 1508# CONFIG_MINIX_FS is not set
1468# CONFIG_ROMFS_FS is not set 1509# CONFIG_ROMFS_FS is not set
1469# CONFIG_INOTIFY is not set 1510CONFIG_INOTIFY=y
1511CONFIG_INOTIFY_USER=y
1470# CONFIG_QUOTA is not set 1512# CONFIG_QUOTA is not set
1471CONFIG_DNOTIFY=y 1513CONFIG_DNOTIFY=y
1472CONFIG_AUTOFS_FS=y 1514CONFIG_AUTOFS_FS=y
@@ -1538,6 +1580,7 @@ CONFIG_LOCKD=y
1538CONFIG_LOCKD_V4=y 1580CONFIG_LOCKD_V4=y
1539CONFIG_NFS_COMMON=y 1581CONFIG_NFS_COMMON=y
1540CONFIG_SUNRPC=y 1582CONFIG_SUNRPC=y
1583# CONFIG_SUNRPC_BIND34 is not set
1541# CONFIG_RPCSEC_GSS_KRB5 is not set 1584# CONFIG_RPCSEC_GSS_KRB5 is not set
1542# CONFIG_RPCSEC_GSS_SPKM3 is not set 1585# CONFIG_RPCSEC_GSS_SPKM3 is not set
1543# CONFIG_SMB_FS is not set 1586# CONFIG_SMB_FS is not set
@@ -1567,6 +1610,7 @@ CONFIG_MSDOS_PARTITION=y
1567# CONFIG_SUN_PARTITION is not set 1610# CONFIG_SUN_PARTITION is not set
1568# CONFIG_KARMA_PARTITION is not set 1611# CONFIG_KARMA_PARTITION is not set
1569# CONFIG_EFI_PARTITION is not set 1612# CONFIG_EFI_PARTITION is not set
1613# CONFIG_SYSV68_PARTITION is not set
1570 1614
1571# 1615#
1572# Native Language Support 1616# Native Language Support
@@ -1616,6 +1660,8 @@ CONFIG_NLS_ISO8859_1=y
1616# Distributed Lock Manager 1660# Distributed Lock Manager
1617# 1661#
1618# CONFIG_DLM is not set 1662# CONFIG_DLM is not set
1663# CONFIG_UCC_SLOW is not set
1664# CONFIG_UCC_FAST is not set
1619 1665
1620# 1666#
1621# Library routines 1667# Library routines
@@ -1623,10 +1669,13 @@ CONFIG_NLS_ISO8859_1=y
1623CONFIG_BITREVERSE=y 1669CONFIG_BITREVERSE=y
1624CONFIG_CRC_CCITT=y 1670CONFIG_CRC_CCITT=y
1625# CONFIG_CRC16 is not set 1671# CONFIG_CRC16 is not set
1672# CONFIG_CRC_ITU_T is not set
1626CONFIG_CRC32=y 1673CONFIG_CRC32=y
1627# CONFIG_LIBCRC32C is not set 1674# CONFIG_LIBCRC32C is not set
1628CONFIG_PLIST=y 1675CONFIG_PLIST=y
1629CONFIG_IOMAP_COPY=y 1676CONFIG_HAS_IOMEM=y
1677CONFIG_HAS_IOPORT=y
1678CONFIG_HAS_DMA=y
1630 1679
1631# 1680#
1632# Instrumentation Support 1681# Instrumentation Support
@@ -1645,32 +1694,34 @@ CONFIG_MAGIC_SYSRQ=y
1645# CONFIG_DEBUG_FS is not set 1694# CONFIG_DEBUG_FS is not set
1646# CONFIG_HEADERS_CHECK is not set 1695# CONFIG_HEADERS_CHECK is not set
1647CONFIG_DEBUG_KERNEL=y 1696CONFIG_DEBUG_KERNEL=y
1648CONFIG_LOG_BUF_SHIFT=17 1697# CONFIG_DEBUG_SHIRQ is not set
1649CONFIG_DETECT_SOFTLOCKUP=y 1698CONFIG_DETECT_SOFTLOCKUP=y
1650# CONFIG_SCHEDSTATS is not set 1699# CONFIG_SCHEDSTATS is not set
1700# CONFIG_TIMER_STATS is not set
1651# CONFIG_DEBUG_SLAB is not set 1701# CONFIG_DEBUG_SLAB is not set
1652# CONFIG_DEBUG_RT_MUTEXES is not set 1702# CONFIG_DEBUG_RT_MUTEXES is not set
1653# CONFIG_RT_MUTEX_TESTER is not set 1703# CONFIG_RT_MUTEX_TESTER is not set
1654# CONFIG_DEBUG_SPINLOCK is not set 1704# CONFIG_DEBUG_SPINLOCK is not set
1655# CONFIG_DEBUG_MUTEXES is not set 1705# CONFIG_DEBUG_MUTEXES is not set
1656# CONFIG_DEBUG_RWSEMS is not set
1657# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1706# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1658# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1707# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1659# CONFIG_DEBUG_KOBJECT is not set 1708# CONFIG_DEBUG_KOBJECT is not set
1660CONFIG_DEBUG_BUGVERBOSE=y 1709CONFIG_DEBUG_BUGVERBOSE=y
1661CONFIG_DEBUG_INFO=y 1710# CONFIG_DEBUG_INFO is not set
1662# CONFIG_DEBUG_VM is not set 1711# CONFIG_DEBUG_VM is not set
1663# CONFIG_DEBUG_LIST is not set 1712# CONFIG_DEBUG_LIST is not set
1664CONFIG_FORCED_INLINING=y 1713# CONFIG_FORCED_INLINING is not set
1665# CONFIG_RCU_TORTURE_TEST is not set 1714# CONFIG_RCU_TORTURE_TEST is not set
1715# CONFIG_FAULT_INJECTION is not set
1666# CONFIG_DEBUG_STACKOVERFLOW is not set 1716# CONFIG_DEBUG_STACKOVERFLOW is not set
1667# CONFIG_DEBUG_STACK_USAGE is not set 1717# CONFIG_DEBUG_STACK_USAGE is not set
1718# CONFIG_DEBUG_PAGEALLOC is not set
1668CONFIG_DEBUGGER=y 1719CONFIG_DEBUGGER=y
1669CONFIG_XMON=y 1720CONFIG_XMON=y
1670CONFIG_XMON_DEFAULT=y 1721CONFIG_XMON_DEFAULT=y
1671CONFIG_XMON_DISASSEMBLY=y 1722CONFIG_XMON_DISASSEMBLY=y
1672# CONFIG_IRQSTACKS is not set 1723# CONFIG_IRQSTACKS is not set
1673CONFIG_BOOTX_TEXT=y 1724# CONFIG_BOOTX_TEXT is not set
1674# CONFIG_PPC_EARLY_DEBUG is not set 1725# CONFIG_PPC_EARLY_DEBUG is not set
1675 1726
1676# 1727#
@@ -1700,8 +1751,11 @@ CONFIG_CRYPTO_SHA1=y
1700# CONFIG_CRYPTO_GF128MUL is not set 1751# CONFIG_CRYPTO_GF128MUL is not set
1701CONFIG_CRYPTO_ECB=m 1752CONFIG_CRYPTO_ECB=m
1702CONFIG_CRYPTO_CBC=y 1753CONFIG_CRYPTO_CBC=y
1754CONFIG_CRYPTO_PCBC=m
1703# CONFIG_CRYPTO_LRW is not set 1755# CONFIG_CRYPTO_LRW is not set
1756# CONFIG_CRYPTO_CRYPTD is not set
1704CONFIG_CRYPTO_DES=y 1757CONFIG_CRYPTO_DES=y
1758# CONFIG_CRYPTO_FCRYPT is not set
1705# CONFIG_CRYPTO_BLOWFISH is not set 1759# CONFIG_CRYPTO_BLOWFISH is not set
1706# CONFIG_CRYPTO_TWOFISH is not set 1760# CONFIG_CRYPTO_TWOFISH is not set
1707# CONFIG_CRYPTO_SERPENT is not set 1761# CONFIG_CRYPTO_SERPENT is not set
@@ -1715,6 +1769,7 @@ CONFIG_CRYPTO_DES=y
1715# CONFIG_CRYPTO_DEFLATE is not set 1769# CONFIG_CRYPTO_DEFLATE is not set
1716# CONFIG_CRYPTO_MICHAEL_MIC is not set 1770# CONFIG_CRYPTO_MICHAEL_MIC is not set
1717# CONFIG_CRYPTO_CRC32C is not set 1771# CONFIG_CRYPTO_CRC32C is not set
1772# CONFIG_CRYPTO_CAMELLIA is not set
1718# CONFIG_CRYPTO_TEST is not set 1773# CONFIG_CRYPTO_TEST is not set
1719 1774
1720# 1775#
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 9cb24d20f0f..b2b5d664d32 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,
@@ -836,7 +840,7 @@ static struct cpu_spec cpu_specs[] = {
836 .pvr_mask = 0xffff0000, 840 .pvr_mask = 0xffff0000,
837 .pvr_value = 0x80040000, 841 .pvr_value = 0x80040000,
838 .cpu_name = "7448", 842 .cpu_name = "7448",
839 .cpu_features = CPU_FTRS_7447A, 843 .cpu_features = CPU_FTRS_7448,
840 .cpu_user_features = COMMON_USER | 844 .cpu_user_features = COMMON_USER |
841 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE, 845 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
842 .icache_bsize = 32, 846 .icache_bsize = 32,
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index c29d1652a42..4074c0b3145 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.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,7 +934,11 @@ 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
930 942
931/* 943/*
932 * PROM code for specific machines follows. Put it 944 * PROM code for specific machines follows. Put it
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index 84c34d979a8..d501c23e515 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -427,11 +427,13 @@ static int __devinit of_pci_phb_probe(struct of_device *dev,
427 /* Process "ranges" property */ 427 /* Process "ranges" property */
428 pci_process_bridge_OF_ranges(phb, dev->node, 0); 428 pci_process_bridge_OF_ranges(phb, dev->node, 0);
429 429
430 /* Setup IO space. 430 /* Setup IO space. We use the non-dynamic version of that code here,
431 * This will not work properly for ISA IOs, something needs to be done 431 * which doesn't quite support unplugging. Next kernel release will
432 * about it if we ever generalize that way of probing PCI brigdes 432 * have a better fix for this.
433 * Note also that we don't do ISA, this will also be fixed with a
434 * more massive rework.
433 */ 435 */
434 pci_setup_phb_io_dynamic(phb, 0); 436 pci_setup_phb_io(phb, 0);
435 437
436 /* Init pci_dn data structures */ 438 /* Init pci_dn data structures */
437 pci_devs_phb_init_dynamic(phb); 439 pci_devs_phb_init_dynamic(phb);
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index b0409e19b1c..249cca27a9b 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -41,6 +41,7 @@
41 41
42unsigned long pci_probe_only = 1; 42unsigned long pci_probe_only = 1;
43int pci_assign_all_buses = 0; 43int pci_assign_all_buses = 0;
44static int pci_initial_scan_done;
44 45
45static void fixup_resource(struct resource *res, struct pci_dev *dev); 46static void fixup_resource(struct resource *res, struct pci_dev *dev);
46static void do_bus_setup(struct pci_bus *bus); 47static void do_bus_setup(struct pci_bus *bus);
@@ -604,6 +605,8 @@ static int __init pcibios_init(void)
604 /* map in PCI I/O space */ 605 /* map in PCI I/O space */
605 phbs_remap_io(); 606 phbs_remap_io();
606 607
608 pci_initial_scan_done = 1;
609
607 printk(KERN_DEBUG "PCI: Probing PCI hardware done\n"); 610 printk(KERN_DEBUG "PCI: Probing PCI hardware done\n");
608 611
609 return 0; 612 return 0;
@@ -1042,13 +1045,16 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
1042 } 1045 }
1043} 1046}
1044 1047
1045void __init pci_setup_phb_io(struct pci_controller *hose, int primary) 1048void __devinit pci_setup_phb_io(struct pci_controller *hose, int primary)
1046{ 1049{
1047 unsigned long size = hose->pci_io_size; 1050 unsigned long size = hose->pci_io_size;
1048 unsigned long io_virt_offset; 1051 unsigned long io_virt_offset;
1049 struct resource *res; 1052 struct resource *res;
1050 struct device_node *isa_dn; 1053 struct device_node *isa_dn;
1051 1054
1055 if (size == 0)
1056 return;
1057
1052 hose->io_base_virt = reserve_phb_iospace(size); 1058 hose->io_base_virt = reserve_phb_iospace(size);
1053 DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n", 1059 DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n",
1054 hose->global_number, hose->io_base_phys, 1060 hose->global_number, hose->io_base_phys,
@@ -1069,6 +1075,15 @@ void __init pci_setup_phb_io(struct pci_controller *hose, int primary)
1069 res = &hose->io_resource; 1075 res = &hose->io_resource;
1070 res->start += io_virt_offset; 1076 res->start += io_virt_offset;
1071 res->end += io_virt_offset; 1077 res->end += io_virt_offset;
1078
1079 /* If this is called after the initial PCI scan, then we need to
1080 * proceed to IO mappings now
1081 */
1082 if (pci_initial_scan_done)
1083 __ioremap_explicit(hose->io_base_phys,
1084 (unsigned long)hose->io_base_virt,
1085 hose->pci_io_size,
1086 _PAGE_NO_CACHE | _PAGE_GUARDED);
1072} 1087}
1073 1088
1074void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose, 1089void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose,
@@ -1078,6 +1093,9 @@ void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose,
1078 unsigned long io_virt_offset; 1093 unsigned long io_virt_offset;
1079 struct resource *res; 1094 struct resource *res;
1080 1095
1096 if (size == 0)
1097 return;
1098
1081 hose->io_base_virt = __ioremap(hose->io_base_phys, size, 1099 hose->io_base_virt = __ioremap(hose->io_base_phys, size,
1082 _PAGE_NO_CACHE | _PAGE_GUARDED); 1100 _PAGE_NO_CACHE | _PAGE_GUARDED);
1083 DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n", 1101 DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n",
@@ -1106,6 +1124,9 @@ static int get_bus_io_range(struct pci_bus *bus, unsigned long *start_phys,
1106 /* Root Bus */ 1124 /* Root Bus */
1107 res = &hose->io_resource; 1125 res = &hose->io_resource;
1108 1126
1127 if (res->end == 0 && res->start == 0)
1128 return 1;
1129
1109 *start_virt = pci_io_base + res->start; 1130 *start_virt = pci_io_base + res->start;
1110 *start_phys = *start_virt + hose->io_base_phys 1131 *start_phys = *start_virt + hose->io_base_phys
1111 - (unsigned long) hose->io_base_virt; 1132 - (unsigned long) hose->io_base_virt;
diff --git a/arch/powerpc/kernel/pmc.c b/arch/powerpc/kernel/pmc.c
index 24d7b7c99bb..ea04e0ab3f2 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 c065b555036..066a6a7a25b 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1472,6 +1472,11 @@ static int of_finish_dynamic_node(struct device_node *node)
1472 node->name = of_get_property(node, "name", NULL); 1472 node->name = of_get_property(node, "name", NULL);
1473 node->type = of_get_property(node, "device_type", NULL); 1473 node->type = of_get_property(node, "device_type", NULL);
1474 1474
1475 if (!node->name)
1476 node->name = "<NULL>";
1477 if (!node->type)
1478 node->type = "<NULL>";
1479
1475 if (!parent) { 1480 if (!parent) {
1476 err = -ENODEV; 1481 err = -ENODEV;
1477 goto out; 1482 goto out;
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 190b7ed1dbf..f2e3bc714d7 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -379,7 +379,7 @@ static ssize_t ppc_rtas_progress_write(struct file *file,
379/* ****************************************************************** */ 379/* ****************************************************************** */
380static int ppc_rtas_progress_show(struct seq_file *m, void *v) 380static int ppc_rtas_progress_show(struct seq_file *m, void *v)
381{ 381{
382 if (progress_led) 382 if (progress_led[0])
383 seq_printf(m, "%s\n", progress_led); 383 seq_printf(m, "%s\n", progress_led);
384 return 0; 384 return 0;
385} 385}
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 22f1ef1b310..d577b71db37 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 13206731314..21c39ff2dc3 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/lib/rheap.c b/arch/powerpc/lib/rheap.c
index b2f6dcc5960..180ee2933ab 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/arch/powerpc/lib/rheap.c
@@ -468,25 +468,19 @@ unsigned long rh_alloc_align(rh_info_t * info, int size, int alignment, const ch
468 if (blk->size == size) { 468 if (blk->size == size) {
469 /* Move from free list to taken list */ 469 /* Move from free list to taken list */
470 list_del(&blk->list); 470 list_del(&blk->list);
471 blk->owner = owner; 471 newblk = blk;
472 start = blk->start; 472 } else {
473 473 newblk = get_slot(info);
474 attach_taken_block(info, blk); 474 newblk->start = blk->start;
475 newblk->size = size;
475 476
476 return start; 477 /* blk still in free list, with updated start, size */
478 blk->start += size;
479 blk->size -= size;
477 } 480 }
478 481
479 newblk = get_slot(info);
480 newblk->start = blk->start;
481 newblk->size = size;
482 newblk->owner = owner; 482 newblk->owner = owner;
483
484 /* blk still in free list, with updated start, size */
485 blk->start += size;
486 blk->size -= size;
487
488 start = newblk->start; 483 start = newblk->start;
489
490 attach_taken_block(info, newblk); 484 attach_taken_block(info, newblk);
491 485
492 /* for larger alignment return fixed up pointer */ 486 /* for larger alignment return fixed up pointer */
diff --git a/arch/powerpc/mm/hash_low_32.S b/arch/powerpc/mm/hash_low_32.S
index ddceefc06ec..7f830a4888d 100644
--- a/arch/powerpc/mm/hash_low_32.S
+++ b/arch/powerpc/mm/hash_low_32.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/*
@@ -455,9 +459,15 @@ found_slot:
455 sync /* make sure pte updates get to memory */ 459 sync /* make sure pte updates get to memory */
456 blr 460 blr
457 461
458 .comm next_slot,4 462 .section .bss
459 .comm primary_pteg_full,4 463 .align 2
460 .comm htab_hash_searches,4 464next_slot:
465 .space 4
466primary_pteg_full:
467 .space 4
468htab_hash_searches:
469 .space 4
470 .previous
461 471
462/* 472/*
463 * Flush the entry for a particular page from the hash table. 473 * Flush the entry for a particular page from the hash table.
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 028ba4ed03d..4f2f4534a9d 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -430,7 +430,7 @@ static void __init htab_finish_init(void)
430 make_bl(ht64_call_hpte_insert2, ppc_md.hpte_insert); 430 make_bl(ht64_call_hpte_insert2, ppc_md.hpte_insert);
431 make_bl(ht64_call_hpte_remove, ppc_md.hpte_remove); 431 make_bl(ht64_call_hpte_remove, ppc_md.hpte_remove);
432 make_bl(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp); 432 make_bl(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp);
433#endif /* CONFIG_PPC_64K_PAGES */ 433#endif /* CONFIG_PPC_HAS_HASH_64K */
434 434
435 make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert); 435 make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert);
436 make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert); 436 make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert);
@@ -837,7 +837,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
837 if (mm->context.user_psize == MMU_PAGE_64K) 837 if (mm->context.user_psize == MMU_PAGE_64K)
838 __hash_page_64K(ea, access, vsid, ptep, trap, local); 838 __hash_page_64K(ea, access, vsid, ptep, trap, local);
839 else 839 else
840#endif /* CONFIG_PPC_64K_PAGES */ 840#endif /* CONFIG_PPC_HAS_HASH_64K */
841 __hash_page_4K(ea, access, vsid, ptep, trap, local); 841 __hash_page_4K(ea, access, vsid, ptep, trap, local);
842 842
843 local_irq_restore(flags); 843 local_irq_restore(flags);
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 246eeea40ec..0266a94d83b 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 972a8e884b9..86010fc7d3b 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 d8232b7a08f..f6ae1a57d65 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/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 1d443407423..ad6e135bf21 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -322,6 +322,8 @@ EXPORT_SYMBOL(__ioremap);
322EXPORT_SYMBOL(iounmap); 322EXPORT_SYMBOL(iounmap);
323EXPORT_SYMBOL(__iounmap); 323EXPORT_SYMBOL(__iounmap);
324 324
325static DEFINE_SPINLOCK(phb_io_lock);
326
325void __iomem * reserve_phb_iospace(unsigned long size) 327void __iomem * reserve_phb_iospace(unsigned long size)
326{ 328{
327 void __iomem *virt_addr; 329 void __iomem *virt_addr;
@@ -329,8 +331,10 @@ void __iomem * reserve_phb_iospace(unsigned long size)
329 if (phbs_io_bot >= IMALLOC_BASE) 331 if (phbs_io_bot >= IMALLOC_BASE)
330 panic("reserve_phb_iospace(): phb io space overflow\n"); 332 panic("reserve_phb_iospace(): phb io space overflow\n");
331 333
334 spin_lock(&phb_io_lock);
332 virt_addr = (void __iomem *) phbs_io_bot; 335 virt_addr = (void __iomem *) phbs_io_bot;
333 phbs_io_bot += size; 336 phbs_io_bot += size;
337 spin_unlock(&phb_io_lock);
334 338
335 return virt_addr; 339 return virt_addr;
336} 340}
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 8e66949e7c6..1b3e008fd14 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -38,7 +38,8 @@ config 440EP
38 38
39config 440GP 39config 440GP
40 bool 40 bool
41 select IBM_NEW_EMAC_ZMII 41# Disabled until the new EMAC Driver is merged.
42# select IBM_NEW_EMAC_ZMII
42 43
43config 440GX 44config 440GX
44 bool 45 bool
diff --git a/arch/powerpc/platforms/44x/ebony.c b/arch/powerpc/platforms/44x/ebony.c
index ad526eafc90..5a7fec8d10d 100644
--- a/arch/powerpc/platforms/44x/ebony.c
+++ b/arch/powerpc/platforms/44x/ebony.c
@@ -27,9 +27,9 @@
27#include "44x.h" 27#include "44x.h"
28 28
29static struct of_device_id ebony_of_bus[] = { 29static struct of_device_id ebony_of_bus[] = {
30 { .type = "ibm,plb", }, 30 { .compatible = "ibm,plb4", },
31 { .type = "ibm,opb", }, 31 { .compatible = "ibm,opb", },
32 { .type = "ibm,ebc", }, 32 { .compatible = "ibm,ebc", },
33 {}, 33 {},
34}; 34};
35 35
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index a93f328a731..7150730e2ff 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -71,9 +71,7 @@ spufs_init_once(void *p, struct kmem_cache * cachep, unsigned long flags)
71{ 71{
72 struct spufs_inode_info *ei = p; 72 struct spufs_inode_info *ei = p;
73 73
74 if (flags & SLAB_CTOR_CONSTRUCTOR) { 74 inode_init_once(&ei->vfs_inode);
75 inode_init_once(&ei->vfs_inode);
76 }
77} 75}
78 76
79static struct inode * 77static struct inode *
diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
index 71045677559..5bcc58d9a4d 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/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 354b8dd2a2c..6a0060a5f2e 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -37,6 +37,7 @@
37#include <linux/wait.h> 37#include <linux/wait.h>
38#include <linux/seq_file.h> 38#include <linux/seq_file.h>
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/completion.h>
40 41
41#include <asm/system.h> 42#include <asm/system.h>
42#include <asm/uaccess.h> 43#include <asm/uaccess.h>
@@ -81,7 +82,7 @@ static void handleMonitorEvent(struct HvLpEvent *event);
81 * if system_state is not SYSTEM_RUNNING, then wait_atomic is used ... 82 * if system_state is not SYSTEM_RUNNING, then wait_atomic is used ...
82 */ 83 */
83struct alloc_parms { 84struct alloc_parms {
84 struct semaphore sem; 85 struct completion done;
85 int number; 86 int number;
86 atomic_t wait_atomic; 87 atomic_t wait_atomic;
87 int used_wait_atomic; 88 int used_wait_atomic;
@@ -115,7 +116,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
115 u16 vlanMap; 116 u16 vlanMap;
116 dma_addr_t handle; 117 dma_addr_t handle;
117 HvLpEvent_Rc hvrc; 118 HvLpEvent_Rc hvrc;
118 DECLARE_MUTEX_LOCKED(Semaphore); 119 DECLARE_COMPLETION(done);
119 struct device_node *node; 120 struct device_node *node;
120 const char *sysid; 121 const char *sysid;
121 122
@@ -132,13 +133,13 @@ static int proc_viopath_show(struct seq_file *m, void *v)
132 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck, 133 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
133 viopath_sourceinst(viopath_hostLp), 134 viopath_sourceinst(viopath_hostLp),
134 viopath_targetinst(viopath_hostLp), 135 viopath_targetinst(viopath_hostLp),
135 (u64)(unsigned long)&Semaphore, VIOVERSION << 16, 136 (u64)(unsigned long)&done, VIOVERSION << 16,
136 ((u64)handle) << 32, HW_PAGE_SIZE, 0, 0); 137 ((u64)handle) << 32, HW_PAGE_SIZE, 0, 0);
137 138
138 if (hvrc != HvLpEvent_Rc_Good) 139 if (hvrc != HvLpEvent_Rc_Good)
139 printk(VIOPATH_KERN_WARN "hv error on op %d\n", (int)hvrc); 140 printk(VIOPATH_KERN_WARN "hv error on op %d\n", (int)hvrc);
140 141
141 down(&Semaphore); 142 wait_for_completion(&done);
142 143
143 vlanMap = HvLpConfig_getVirtualLanIndexMap(); 144 vlanMap = HvLpConfig_getVirtualLanIndexMap();
144 145
@@ -353,7 +354,7 @@ static void handleConfig(struct HvLpEvent *event)
353 return; 354 return;
354 } 355 }
355 356
356 up((struct semaphore *)event->xCorrelationToken); 357 complete((struct completion *)event->xCorrelationToken);
357} 358}
358 359
359/* 360/*
@@ -464,7 +465,7 @@ static void viopath_donealloc(void *parm, int number)
464 if (parmsp->used_wait_atomic) 465 if (parmsp->used_wait_atomic)
465 atomic_set(&parmsp->wait_atomic, 0); 466 atomic_set(&parmsp->wait_atomic, 0);
466 else 467 else
467 up(&parmsp->sem); 468 complete(&parmsp->done);
468} 469}
469 470
470static int allocateEvents(HvLpIndex remoteLp, int numEvents) 471static int allocateEvents(HvLpIndex remoteLp, int numEvents)
@@ -476,7 +477,7 @@ static int allocateEvents(HvLpIndex remoteLp, int numEvents)
476 atomic_set(&parms.wait_atomic, 1); 477 atomic_set(&parms.wait_atomic, 1);
477 } else { 478 } else {
478 parms.used_wait_atomic = 0; 479 parms.used_wait_atomic = 0;
479 init_MUTEX_LOCKED(&parms.sem); 480 init_completion(&parms.done);
480 } 481 }
481 mf_allocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo, 250, /* It would be nice to put a real number here! */ 482 mf_allocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo, 250, /* It would be nice to put a real number here! */
482 numEvents, &viopath_donealloc, &parms); 483 numEvents, &viopath_donealloc, &parms);
@@ -484,7 +485,7 @@ static int allocateEvents(HvLpIndex remoteLp, int numEvents)
484 while (atomic_read(&parms.wait_atomic)) 485 while (atomic_read(&parms.wait_atomic))
485 mb(); 486 mb();
486 } else 487 } else
487 down(&parms.sem); 488 wait_for_completion(&parms.done);
488 return parms.number; 489 return parms.number;
489} 490}
490 491
@@ -585,10 +586,10 @@ int viopath_close(HvLpIndex remoteLp, int subtype, int numReq)
585 spin_unlock_irqrestore(&statuslock, flags); 586 spin_unlock_irqrestore(&statuslock, flags);
586 587
587 parms.used_wait_atomic = 0; 588 parms.used_wait_atomic = 0;
588 init_MUTEX_LOCKED(&parms.sem); 589 init_completion(&parms.done);
589 mf_deallocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo, 590 mf_deallocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo,
590 numReq, &viopath_donealloc, &parms); 591 numReq, &viopath_donealloc, &parms);
591 down(&parms.sem); 592 wait_for_completion(&parms.done);
592 593
593 spin_lock_irqsave(&statuslock, flags); 594 spin_lock_irqsave(&statuslock, flags);
594 for (i = 0, numOpen = 0; i < VIO_MAX_SUBTYPES; i++) 595 for (i = 0, numOpen = 0; i < VIO_MAX_SUBTYPES; i++)
diff --git a/arch/powerpc/platforms/pasemi/Kconfig b/arch/powerpc/platforms/pasemi/Kconfig
index eb4dbc705b0..7c5076e38ea 100644
--- a/arch/powerpc/platforms/pasemi/Kconfig
+++ b/arch/powerpc/platforms/pasemi/Kconfig
@@ -4,7 +4,6 @@ config PPC_PASEMI
4 default n 4 default n
5 select MPIC 5 select MPIC
6 select PPC_UDBG_16550 6 select PPC_UDBG_16550
7 select GENERIC_TBSYNC
8 select PPC_NATIVE 7 select PPC_NATIVE
9 help 8 help
10 This option enables support for PA Semi's PWRficient line 9 This option enables support for PA Semi's PWRficient line
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index a410bc76a8a..07b1c4ec428 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/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 22bc0198974..2729d559fd9 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -21,8 +21,8 @@ extern int pSeries_machine_check_exception(struct pt_regs *regs);
21extern void smp_init_pseries_mpic(void); 21extern void smp_init_pseries_mpic(void);
22extern void smp_init_pseries_xics(void); 22extern void smp_init_pseries_xics(void);
23#else 23#else
24static inline smp_init_pseries_mpic(void) { }; 24static inline void smp_init_pseries_mpic(void) { };
25static inline smp_init_pseries_xics(void) { }; 25static inline void smp_init_pseries_xics(void) { };
26#endif 26#endif
27 27
28#ifdef CONFIG_KEXEC 28#ifdef CONFIG_KEXEC
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 4fd2bec8991..75aad38179f 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1424,7 +1424,7 @@ unsigned int mpic_get_irq(void)
1424void mpic_request_ipis(void) 1424void mpic_request_ipis(void)
1425{ 1425{
1426 struct mpic *mpic = mpic_primary; 1426 struct mpic *mpic = mpic_primary;
1427 int i; 1427 int i, err;
1428 static char *ipi_names[] = { 1428 static char *ipi_names[] = {
1429 "IPI0 (call function)", 1429 "IPI0 (call function)",
1430 "IPI1 (reschedule)", 1430 "IPI1 (reschedule)",
@@ -1442,8 +1442,14 @@ void mpic_request_ipis(void)
1442 printk(KERN_ERR "Failed to map IPI %d\n", i); 1442 printk(KERN_ERR "Failed to map IPI %d\n", i);
1443 break; 1443 break;
1444 } 1444 }
1445 request_irq(vipi, mpic_ipi_action, IRQF_DISABLED|IRQF_PERCPU, 1445 err = request_irq(vipi, mpic_ipi_action,
1446 ipi_names[i], mpic); 1446 IRQF_DISABLED|IRQF_PERCPU,
1447 ipi_names[i], mpic);
1448 if (err) {
1449 printk(KERN_ERR "Request of irq %d for IPI %d failed\n",
1450 vipi, i);
1451 break;
1452 }
1447 } 1453 }
1448} 1454}
1449 1455
diff --git a/arch/powerpc/sysdev/qe_lib/Kconfig b/arch/powerpc/sysdev/qe_lib/Kconfig
index 887739f3bad..f611d344a12 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 ab64256110b..fba7ca17a67 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 4ad499605d0..a4165209ac7 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 44cd128fb71..19db8746ff1 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 e756942e65c..5f364dc5015 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 c023b729880..35ebb6395ae 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/pq2_sys.c b/arch/ppc/syslib/pq2_sys.c
index f52600c0db2..9c85300846c 100644
--- a/arch/ppc/syslib/pq2_sys.c
+++ b/arch/ppc/syslib/pq2_sys.c
@@ -26,7 +26,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
26 { 26 {
27 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3, 27 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
28 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, 28 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
29 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, 29 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC2, MPC82xx_CPM_SMC1,
30 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 30 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
31 } 31 }
32 }, 32 },
@@ -39,7 +39,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
39 { 39 {
40 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1, 40 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
41 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4, 41 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
42 MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, 42 MPC82xx_CPM_MCC2, MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2,
43 MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 43 MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
44 } 44 }
45 }, 45 },
@@ -47,52 +47,56 @@ struct ppc_sys_spec ppc_sys_specs[] = {
47 .ppc_sys_name = "8260", 47 .ppc_sys_name = "8260",
48 .mask = 0x0000ff00, 48 .mask = 0x0000ff00,
49 .value = 0x00000000, 49 .value = 0x00000000,
50 .num_devices = 12, 50 .num_devices = 13,
51 .device_list = (enum ppc_sys_devices[]) 51 .device_list = (enum ppc_sys_devices[])
52 { 52 {
53 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3, 53 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
54 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, 54 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
55 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, 55 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
56 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 56 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
57 MPC82xx_CPM_I2C,
57 } 58 }
58 }, 59 },
59 { 60 {
60 .ppc_sys_name = "8264", 61 .ppc_sys_name = "8264",
61 .mask = 0x0000ff00, 62 .mask = 0x0000ff00,
62 .value = 0x00000000, 63 .value = 0x00000000,
63 .num_devices = 12, 64 .num_devices = 13,
64 .device_list = (enum ppc_sys_devices[]) 65 .device_list = (enum ppc_sys_devices[])
65 { 66 {
66 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3, 67 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
67 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, 68 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
68 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, 69 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
69 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 70 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
71 MPC82xx_CPM_I2C,
70 } 72 }
71 }, 73 },
72 { 74 {
73 .ppc_sys_name = "8265", 75 .ppc_sys_name = "8265",
74 .mask = 0x0000ff00, 76 .mask = 0x0000ff00,
75 .value = 0x00000000, 77 .value = 0x00000000,
76 .num_devices = 12, 78 .num_devices = 13,
77 .device_list = (enum ppc_sys_devices[]) 79 .device_list = (enum ppc_sys_devices[])
78 { 80 {
79 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3, 81 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
80 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, 82 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
81 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, 83 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
82 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 84 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
85 MPC82xx_CPM_I2C,
83 } 86 }
84 }, 87 },
85 { 88 {
86 .ppc_sys_name = "8266", 89 .ppc_sys_name = "8266",
87 .mask = 0x0000ff00, 90 .mask = 0x0000ff00,
88 .value = 0x00000000, 91 .value = 0x00000000,
89 .num_devices = 12, 92 .num_devices = 13,
90 .device_list = (enum ppc_sys_devices[]) 93 .device_list = (enum ppc_sys_devices[])
91 { 94 {
92 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3, 95 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
93 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, 96 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
94 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, 97 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
95 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 98 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
99 MPC82xx_CPM_I2C,
96 } 100 }
97 }, 101 },
98 /* below is a list of the 8272 family of processors */ 102 /* below is a list of the 8272 family of processors */
@@ -159,7 +163,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
159 { 163 {
160 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3, 164 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
161 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, 165 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
162 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, 166 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC2, MPC82xx_CPM_SMC1,
163 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 167 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
164 }, 168 },
165 }, 169 },
@@ -172,7 +176,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
172 { 176 {
173 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3, 177 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
174 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, 178 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
175 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, 179 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC2, MPC82xx_CPM_SMC1,
176 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 180 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
177 }, 181 },
178 }, 182 },
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 32a69a18a79..acc415457b4 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/kprobes.c b/arch/s390/kernel/kprobes.c
index e39333ae0fc..358d2bbbc48 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/syscalls.S b/arch/s390/kernel/syscalls.S
index cd8d321cd0c..738feb4a0aa 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 e9d3432aba6..7158a804a5e 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 916b72a8cde..9098531a267 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/boards/landisk/gio.c b/arch/sh/boards/landisk/gio.c
index 50d38be62f0..a37643d002b 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 4058b4f50d4..f953c742776 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 609e5d50dde..b1d20afb4eb 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 1659fdd6695..edb3dd936cb 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 83419bf4c83..b704e20d7e4 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 8c64baa3036..cc1cb04fa61 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 031c814e6e7..6396cea1c89 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 1c941370a2e..bee4612de59 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 e062067edd2..8057a27a1bc 100644
--- a/arch/sh/drivers/dma/dma-api.c
+++ b/arch/sh/drivers/dma/dma-api.c
@@ -115,7 +115,7 @@ static int search_cap(const char **haystack, const char *needle)
115/** 115/**
116 * request_dma_bycap - Allocate a DMA channel based on its capabilities 116 * request_dma_bycap - Allocate a DMA channel based on its capabilities
117 * @dmac: List of DMA controllers to search 117 * @dmac: List of DMA controllers to search
118 * @caps: List of capabilites 118 * @caps: List of capabilities
119 * 119 *
120 * Search all channels of all DMA controllers to find a channel which 120 * Search all channels of all DMA controllers to find a channel which
121 * matches the requested capabilities. The result is the channel 121 * 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 05a74ffdb68..5fb044b791c 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 9d0a29370f2..5e22689c2fc 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 381306cf542..e1284fc6936 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 d67656a44b1..543417ff831 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 d729e0c2d5f..cf0d35bd135 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 a55c98a9052..3b14bf860db 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 0758d48147a..849a9e19139 100644
--- a/arch/sh/kernel/cf-enabler.c
+++ b/arch/sh/kernel/cf-enabler.c
@@ -31,7 +31,7 @@
31 */ 31 */
32#if defined(CONFIG_CPU_SH4) 32#if defined(CONFIG_CPU_SH4)
33/* SH4 can't access PCMCIA interface through P2 area. 33/* SH4 can't access PCMCIA interface through P2 area.
34 * we must remap it with appropreate attribute bit of the page set. 34 * 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 */ 35 * this part is based on Greg Banks' hd64465_ss.c implementation - Masahiro Abe */
36 36
37#if defined(CONFIG_CF_AREA6) 37#if defined(CONFIG_CF_AREA6)
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 014f318f5a0..63251549e9a 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 492db31b3ca..978992e367a 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/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c
index d61dd599169..c5a4fc77fa0 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/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
index 6f8f458912c..03b14cf78dd 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 29090035bc5..51b386d454d 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 a5323364cbc..edd1ec214e6 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 6b4f5748d0b..a11e2aa73cb 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/syscalls.S b/arch/sh/kernel/syscalls.S
index 4357d1a6358..7db1c2dc599 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/traps.c b/arch/sh/kernel/traps.c
index 3a197649cd8..5b75cb6f8f9 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 d83143cc5ca..4c5b57e9c3c 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/math-emu/math.c b/arch/sh/math-emu/math.c
index 1efbac15ff4..a38e1eed9e7 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 397c94c9731..ae039f2da16 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 9207da67ff8..c878faa4ae4 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 8fe223a890e..e0e644ff320 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 02aae06527d..b6a5a338145 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 554f801db67..fb40f188aff 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 4f9616f3983..02aea86c590 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 bd992c0048f..fbcc00c6c06 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 f1401b57ccc..7b4612da74a 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 f0bb6e60e62..f75a1b82278 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 559335f4917..617d29832e1 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(addr), flags);
128 if ((prev = *ptr) == old)
129 *ptr = new;
130 spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
131
132 return (unsigned long)prev;
133}
134EXPORT_SYMBOL(__cmpxchg_u32);
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 831781cab27..bd00f89eed1 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 6bf6fb65bc2..d8d19093d12 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 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 0e03c8e218c..00000000000
--- 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 c15a3edcb82..8f10dda0f5c 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,3 +1892,609 @@ 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
1926
1927 /* %o0: API group number
1928 * %o1: pointer to unsigned long major number storage
1929 * %o2: pointer to unsigned long minor number storage
1930 *
1931 * returns %o0: status
1932 */
1933 .globl sun4v_get_version
1934 .type sun4v_get_version,#function
1935sun4v_get_version:
1936 mov HV_CORE_GET_VER, %o5
1937 mov %o1, %o3
1938 mov %o2, %o4
1939 ta HV_CORE_TRAP
1940 stx %o1, [%o3]
1941 retl
1942 stx %o2, [%o4]
1943 .size sun4v_get_version, .-sun4v_get_version
1944
1945 /* %o0: API group number
1946 * %o1: desired major number
1947 * %o2: desired minor number
1948 * %o3: pointer to unsigned long actual minor number storage
1949 *
1950 * returns %o0: status
1951 */
1952 .globl sun4v_set_version
1953 .type sun4v_set_version,#function
1954sun4v_set_version:
1955 mov HV_CORE_SET_VER, %o5
1956 mov %o3, %o4
1957 ta HV_CORE_TRAP
1958 retl
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
1989
1990 /* %o0: pointer to unsigned long status
1991 *
1992 * returns %o0: signed character
1993 */
1994 .globl sun4v_con_getchar
1995 .type sun4v_con_getchar,#function
1996sun4v_con_getchar:
1997 mov %o0, %o4
1998 mov HV_FAST_CONS_GETCHAR, %o5
1999 clr %o0
2000 clr %o1
2001 ta HV_FAST_TRAP
2002 stx %o0, [%o4]
2003 retl
2004 sra %o1, 0, %o0
2005 .size sun4v_con_getchar, .-sun4v_con_getchar
2006
2007 /* %o0: signed long character
2008 *
2009 * returns %o0: status
2010 */
2011 .globl sun4v_con_putchar
2012 .type sun4v_con_putchar,#function
2013sun4v_con_putchar:
2014 mov HV_FAST_CONS_PUTCHAR, %o5
2015 ta HV_FAST_TRAP
2016 retl
2017 sra %o0, 0, %o0
2018 .size sun4v_con_putchar, .-sun4v_con_putchar
2019
2020 /* %o0: buffer real address
2021 * %o1: buffer size
2022 * %o2: pointer to unsigned long bytes_read
2023 *
2024 * returns %o0: status
2025 */
2026 .globl sun4v_con_read
2027 .type sun4v_con_read,#function
2028sun4v_con_read:
2029 mov %o2, %o4
2030 mov HV_FAST_CONS_READ, %o5
2031 ta HV_FAST_TRAP
2032 brnz %o0, 1f
2033 cmp %o1, -1 /* break */
2034 be,a,pn %icc, 1f
2035 mov %o1, %o0
2036 cmp %o1, -2 /* hup */
2037 be,a,pn %icc, 1f
2038 mov %o1, %o0
2039 stx %o1, [%o4]
20401: retl
2041 nop
2042 .size sun4v_con_read, .-sun4v_con_read
2043
2044 /* %o0: buffer real address
2045 * %o1: buffer size
2046 * %o2: pointer to unsigned long bytes_written
2047 *
2048 * returns %o0: status
2049 */
2050 .globl sun4v_con_write
2051 .type sun4v_con_write,#function
2052sun4v_con_write:
2053 mov %o2, %o4
2054 mov HV_FAST_CONS_WRITE, %o5
2055 ta HV_FAST_TRAP
2056 stx %o1, [%o4]
2057 retl
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
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
index baea10a9819..77259526cb1 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
new file mode 100644
index 00000000000..f34f5d6181e
--- /dev/null
+++ b/arch/sparc64/kernel/hvapi.c
@@ -0,0 +1,192 @@
1/* hvapi.c: Hypervisor API management.
2 *
3 * Copyright (C) 2007 David S. Miller <davem@davemloft.net>
4 */
5#include <linux/kernel.h>
6#include <linux/module.h>
7#include <linux/init.h>
8#include <linux/slab.h>
9
10#include <asm/hypervisor.h>
11#include <asm/oplib.h>
12#include <asm/sstate.h>
13
14/* If the hypervisor indicates that the API setting
15 * calls are unsupported, by returning HV_EBADTRAP or
16 * HV_ENOTSUPPORTED, we assume that API groups with the
17 * PRE_API flag set are major 1 minor 0.
18 */
19struct api_info {
20 unsigned long group;
21 unsigned long major;
22 unsigned long minor;
23 unsigned int refcnt;
24 unsigned int flags;
25#define FLAG_PRE_API 0x00000001
26};
27
28static struct api_info api_table[] = {
29 { .group = HV_GRP_SUN4V, .flags = FLAG_PRE_API },
30 { .group = HV_GRP_CORE, .flags = FLAG_PRE_API },
31 { .group = HV_GRP_INTR, },
32 { .group = HV_GRP_SOFT_STATE, },
33 { .group = HV_GRP_PCI, .flags = FLAG_PRE_API },
34 { .group = HV_GRP_LDOM, },
35 { .group = HV_GRP_SVC_CHAN, .flags = FLAG_PRE_API },
36 { .group = HV_GRP_NCS, .flags = FLAG_PRE_API },
37 { .group = HV_GRP_NIAG_PERF, .flags = FLAG_PRE_API },
38 { .group = HV_GRP_FIRE_PERF, },
39 { .group = HV_GRP_DIAG, .flags = FLAG_PRE_API },
40};
41
42static DEFINE_SPINLOCK(hvapi_lock);
43
44static struct api_info *__get_info(unsigned long group)
45{
46 int i;
47
48 for (i = 0; i < ARRAY_SIZE(api_table); i++) {
49 if (api_table[i].group == group)
50 return &api_table[i];
51 }
52 return NULL;
53}
54
55static void __get_ref(struct api_info *p)
56{
57 p->refcnt++;
58}
59
60static void __put_ref(struct api_info *p)
61{
62 if (--p->refcnt == 0) {
63 unsigned long ignore;
64
65 sun4v_set_version(p->group, 0, 0, &ignore);
66 p->major = p->minor = 0;
67 }
68}
69
70/* Register a hypervisor API specification. It indicates the
71 * API group and desired major+minor.
72 *
73 * If an existing API registration exists '0' (success) will
74 * be returned if it is compatible with the one being registered.
75 * Otherwise a negative error code will be returned.
76 *
77 * Otherwise an attempt will be made to negotiate the requested
78 * API group/major/minor with the hypervisor, and errors returned
79 * if that does not succeed.
80 */
81int sun4v_hvapi_register(unsigned long group, unsigned long major,
82 unsigned long *minor)
83{
84 struct api_info *p;
85 unsigned long flags;
86 int ret;
87
88 spin_lock_irqsave(&hvapi_lock, flags);
89 p = __get_info(group);
90 ret = -EINVAL;
91 if (p) {
92 if (p->refcnt) {
93 ret = -EINVAL;
94 if (p->major == major) {
95 *minor = p->minor;
96 ret = 0;
97 }
98 } else {
99 unsigned long actual_minor;
100 unsigned long hv_ret;
101
102 hv_ret = sun4v_set_version(group, major, *minor,
103 &actual_minor);
104 ret = -EINVAL;
105 if (hv_ret == HV_EOK) {
106 *minor = actual_minor;
107 p->major = major;
108 p->minor = actual_minor;
109 ret = 0;
110 } else if (hv_ret == HV_EBADTRAP ||
111 hv_ret == HV_ENOTSUPPORTED) {
112 if (p->flags & FLAG_PRE_API) {
113 if (major == 1) {
114 p->major = 1;
115 p->minor = 0;
116 *minor = 0;
117 ret = 0;
118 }
119 }
120 }
121 }
122
123 if (ret == 0)
124 __get_ref(p);
125 }
126 spin_unlock_irqrestore(&hvapi_lock, flags);
127
128 return ret;
129}
130EXPORT_SYMBOL(sun4v_hvapi_register);
131
132void sun4v_hvapi_unregister(unsigned long group)
133{
134 struct api_info *p;
135 unsigned long flags;
136
137 spin_lock_irqsave(&hvapi_lock, flags);
138 p = __get_info(group);
139 if (p)
140 __put_ref(p);
141 spin_unlock_irqrestore(&hvapi_lock, flags);
142}
143EXPORT_SYMBOL(sun4v_hvapi_unregister);
144
145int sun4v_hvapi_get(unsigned long group,
146 unsigned long *major,
147 unsigned long *minor)
148{
149 struct api_info *p;
150 unsigned long flags;
151 int ret;
152
153 spin_lock_irqsave(&hvapi_lock, flags);
154 ret = -EINVAL;
155 p = __get_info(group);
156 if (p && p->refcnt) {
157 *major = p->major;
158 *minor = p->minor;
159 ret = 0;
160 }
161 spin_unlock_irqrestore(&hvapi_lock, flags);
162
163 return ret;
164}
165EXPORT_SYMBOL(sun4v_hvapi_get);
166
167void __init sun4v_hvapi_init(void)
168{
169 unsigned long group, major, minor;
170
171 group = HV_GRP_SUN4V;
172 major = 1;
173 minor = 0;
174 if (sun4v_hvapi_register(group, major, &minor))
175 goto bad;
176
177 group = HV_GRP_CORE;
178 major = 1;
179 minor = 1;
180 if (sun4v_hvapi_register(group, major, &minor))
181 goto bad;
182
183 sun4v_sstate_init();
184
185 return;
186
187bad:
188 prom_printf("HVAPI: Cannot register API group "
189 "%lx with major(%u) minor(%u)\n",
190 group, major, minor);
191 prom_halt();
192}
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 3edc18e1b81..a36f8dd0c02 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 ad46e2024f4..5a8377b5495 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 00000000000..9246c2cf957
--- /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 d4c077dc5e8..38a32bc95d2 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 e2377796de8..323d6c27851 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 044e8ec4c0f..6b3fe2c1d65 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 699b24b890d..5d6adea3967 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 952762bfb4c..f5f97e2c669 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 02830e4671f..dad4b3ba705 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 451028341c7..de9b4c13f1c 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 */
@@ -269,6 +275,7 @@ void __init per_cpu_patch(void)
269 275
270void __init sun4v_patch(void) 276void __init sun4v_patch(void)
271{ 277{
278 extern void sun4v_hvapi_init(void);
272 struct sun4v_1insn_patch_entry *p1; 279 struct sun4v_1insn_patch_entry *p1;
273 struct sun4v_2insn_patch_entry *p2; 280 struct sun4v_2insn_patch_entry *p2;
274 281
@@ -300,6 +307,8 @@ void __init sun4v_patch(void)
300 307
301 p2++; 308 p2++;
302 } 309 }
310
311 sun4v_hvapi_init();
303} 312}
304 313
305#ifdef CONFIG_SMP 314#ifdef CONFIG_SMP
@@ -367,8 +376,6 @@ void __init setup_arch(char **cmdline_p)
367 init_cur_cpu_trap(current_thread_info()); 376 init_cur_cpu_trap(current_thread_info());
368 377
369 paging_init(); 378 paging_init();
370
371 smp_setup_cpu_possible_map();
372} 379}
373 380
374static int __init set_preferred_console(void) 381static int __init set_preferred_console(void)
@@ -421,7 +428,7 @@ extern void mmu_info(struct seq_file *);
421unsigned int dcache_parity_tl1_occurred; 428unsigned int dcache_parity_tl1_occurred;
422unsigned int icache_parity_tl1_occurred; 429unsigned int icache_parity_tl1_occurred;
423 430
424static int ncpus_probed; 431int ncpus_probed;
425 432
426static int show_cpuinfo(struct seq_file *m, void *__unused) 433static int show_cpuinfo(struct seq_file *m, void *__unused)
427{ 434{
@@ -513,14 +520,6 @@ static int __init topology_init(void)
513 520
514 err = -ENOMEM; 521 err = -ENOMEM;
515 522
516 /* Count the number of physically present processors in
517 * the machine, even on uniprocessor, so that /proc/cpuinfo
518 * output is consistent with 2.4.x
519 */
520 ncpus_probed = 0;
521 while (!cpu_find_by_instance(ncpus_probed, NULL, NULL))
522 ncpus_probed++;
523
524 for_each_possible_cpu(i) { 523 for_each_possible_cpu(i) {
525 struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL); 524 struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
526 if (p) { 525 if (p) {
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 24fdf1d0adc..c550bba3490 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 00000000000..5b6e75b7f05
--- /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 405855dd886..574bc248bca 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 6b9a06e4254..a31a0439244 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();
@@ -1030,7 +1013,7 @@ void __devinit setup_sparc64_timer(void)
1030 clockevents_register_device(sevt); 1013 clockevents_register_device(sevt);
1031} 1014}
1032 1015
1033#define SPARC64_NSEC_PER_CYC_SHIFT 32UL 1016#define SPARC64_NSEC_PER_CYC_SHIFT 10UL
1034 1017
1035static struct clocksource clocksource_tick = { 1018static struct clocksource clocksource_tick = {
1036 .rating = 100, 1019 .rating = 100,
@@ -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 d0fde36395b..00a9e3286c8 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 13fa2a2e451..fb648de18a8 100644
--- a/arch/sparc64/kernel/vmlinux.lds.S
+++ b/arch/sparc64/kernel/vmlinux.lds.S
@@ -14,7 +14,7 @@ SECTIONS
14 .text 0x0000000000404000 : 14 .text 0x0000000000404000 :
15 { 15 {
16 _text = .; 16 _text = .;
17 *(.text) 17 TEXT_TEXT
18 SCHED_TEXT 18 SCHED_TEXT
19 LOCK_TEXT 19 LOCK_TEXT
20 KPROBES_TEXT 20 KPROBES_TEXT
@@ -27,7 +27,7 @@ SECTIONS
27 27
28 .data : 28 .data :
29 { 29 {
30 *(.data) 30 DATA_DATA
31 CONSTRUCTORS 31 CONSTRUCTORS
32 } 32 }
33 .data1 : { *(.data1) } 33 .data1 : { *(.data1) }
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 6e5b01d779d..3010227fe24 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 0b4213720d4..f3e0c14e9ee 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 87a4e4427d8..24547741b20 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 bc59f97e34d..307b9373676 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 79471f85eb8..3fc13fa8729 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/Kconfig b/arch/v850/Kconfig
index 5f54c1236c1..ace479ab273 100644
--- a/arch/v850/Kconfig
+++ b/arch/v850/Kconfig
@@ -240,14 +240,6 @@ menu "Processor type and features"
240 config RESET_GUARD 240 config RESET_GUARD
241 bool "Reset Guard" 241 bool "Reset Guard"
242 242
243 config LARGE_ALLOCS
244 bool "Allow allocating large blocks (> 1MB) of memory"
245 help
246 Allow the slab memory allocator to keep chains for very large
247 memory sizes - upto 32MB. You may need this if your system has
248 a lot of RAM, and you need to able to allocate very large
249 contiguous chunks. If unsure, say N.
250
251source "mm/Kconfig" 243source "mm/Kconfig"
252 244
253endmenu 245endmenu
diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
index 35630822125..6172599b4ce 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 145bb824b2a..5ce94430c01 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 941a7e3aa5f..40178e5c310 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 079f4132575..e4b84b4a417 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 56eaa259782..296d2b0c5d8 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 bc11b32e8b4..7377ccb2133 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 c116b54d422..7503068e788 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 88cfa50b424..dbccfda8364 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 51d4c6fa88c..57660d58d50 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/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index 4fbd66a52a8..4b7b4ff7997 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 93a2cf65459..863a8c0623e 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 55af8bb0f05..33734fd9198 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/tcrypt.c b/crypto/tcrypt.c
index f0aed0106ad..11f93595381 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -691,7 +691,7 @@ static int test_hash_cycles(struct hash_desc *desc, char *p, int blen,
691 if (ret) 691 if (ret)
692 goto out; 692 goto out;
693 } 693 }
694 crypto_hash_final(desc, out); 694 ret = crypto_hash_final(desc, out);
695 if (ret) 695 if (ret)
696 goto out; 696 goto out;
697 } 697 }
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 8fcd6a15517..a2efae8a4c4 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -40,19 +40,19 @@ static nodemask_t nodes_found_map = NODE_MASK_NONE;
40#define NID_INVAL -1 40#define NID_INVAL -1
41 41
42/* maps to convert between proximity domain and logical node ID */ 42/* maps to convert between proximity domain and logical node ID */
43int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS] 43static int pxm_to_node_map[MAX_PXM_DOMAINS]
44 = { [0 ... MAX_PXM_DOMAINS - 1] = NID_INVAL }; 44 = { [0 ... MAX_PXM_DOMAINS - 1] = NID_INVAL };
45int __cpuinitdata node_to_pxm_map[MAX_NUMNODES] 45static int node_to_pxm_map[MAX_NUMNODES]
46 = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; 46 = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL };
47 47
48int __cpuinit pxm_to_node(int pxm) 48int pxm_to_node(int pxm)
49{ 49{
50 if (pxm < 0) 50 if (pxm < 0)
51 return NID_INVAL; 51 return NID_INVAL;
52 return pxm_to_node_map[pxm]; 52 return pxm_to_node_map[pxm];
53} 53}
54 54
55int __cpuinit node_to_pxm(int node) 55int node_to_pxm(int node)
56{ 56{
57 if (node < 0) 57 if (node < 0)
58 return PXM_INVAL; 58 return PXM_INVAL;
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index ad1f59c1b3f..b4a8d6030e4 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 1ae443d7ab9..7baeaffefe7 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,10 +170,12 @@ 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 |
176 ATA_FLAG_SKIP_D2H_BSY, 177 ATA_FLAG_SKIP_D2H_BSY |
178 ATA_FLAG_ACPI_SATA,
177}; 179};
178 180
179struct ahci_cmd_hdr { 181struct ahci_cmd_hdr {
@@ -353,7 +355,8 @@ static const struct ata_port_info ahci_port_info[] = {
353 /* board_ahci_sb600 */ 355 /* board_ahci_sb600 */
354 { 356 {
355 .flags = AHCI_FLAG_COMMON | 357 .flags = AHCI_FLAG_COMMON |
356 AHCI_FLAG_IGN_SERR_INTERNAL, 358 AHCI_FLAG_IGN_SERR_INTERNAL |
359 AHCI_FLAG_32BIT_ONLY,
357 .pio_mask = 0x1f, /* pio0-4 */ 360 .pio_mask = 0x1f, /* pio0-4 */
358 .udma_mask = 0x7f, /* udma0-6 ; FIXME */ 361 .udma_mask = 0x7f, /* udma0-6 ; FIXME */
359 .port_ops = &ahci_ops, 362 .port_ops = &ahci_ops,
@@ -491,6 +494,13 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
491 hpriv->saved_cap = cap = readl(mmio + HOST_CAP); 494 hpriv->saved_cap = cap = readl(mmio + HOST_CAP);
492 hpriv->saved_port_map = port_map = readl(mmio + HOST_PORTS_IMPL); 495 hpriv->saved_port_map = port_map = readl(mmio + HOST_PORTS_IMPL);
493 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
494 /* fixup zero port_map */ 504 /* fixup zero port_map */
495 if (!port_map) { 505 if (!port_map) {
496 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 c3d753296bc..7565f022bd6 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 13b6b1df2ac..9c07b88631b 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-acpi.c b/drivers/ata/libata-acpi.c
index ed4138e24b0..02236739b40 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -321,7 +321,7 @@ static int do_drive_get_GTF(struct ata_device *dev, unsigned int *gtf_length,
321 321
322 /* Don't continue if device has no _ADR method. 322 /* Don't continue if device has no _ADR method.
323 * _GTF is intended for known motherboard devices. */ 323 * _GTF is intended for known motherboard devices. */
324 if (!(ap->cbl == ATA_CBL_SATA)) { 324 if (!(ap->flags & ATA_FLAG_ACPI_SATA)) {
325 err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn); 325 err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn);
326 if (err < 0) { 326 if (err < 0) {
327 if (ata_msg_probe(ap)) 327 if (ata_msg_probe(ap))
@@ -343,7 +343,7 @@ static int do_drive_get_GTF(struct ata_device *dev, unsigned int *gtf_length,
343 343
344 /* Get this drive's _ADR info. if not already known. */ 344 /* Get this drive's _ADR info. if not already known. */
345 if (!dev->obj_handle) { 345 if (!dev->obj_handle) {
346 if (!(ap->cbl == ATA_CBL_SATA)) { 346 if (!(ap->flags & ATA_FLAG_ACPI_SATA)) {
347 /* get child objects of dev_handle == channel objects, 347 /* get child objects of dev_handle == channel objects,
348 * + _their_ children == drive objects */ 348 * + _their_ children == drive objects */
349 /* channel is ap->port_no */ 349 /* channel is ap->port_no */
@@ -528,7 +528,7 @@ static int do_drive_set_taskfiles(struct ata_device *dev,
528 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", 528 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n",
529 __FUNCTION__, ap->port_no); 529 __FUNCTION__, ap->port_no);
530 530
531 if (libata_noacpi || !(ap->cbl == ATA_CBL_SATA)) 531 if (libata_noacpi || !(ap->flags & ATA_FLAG_ACPI_SATA))
532 return 0; 532 return 0;
533 533
534 if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED)) 534 if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED))
@@ -578,7 +578,7 @@ int ata_acpi_exec_tfs(struct ata_port *ap)
578 * we should not run GTF on PATA devices since some 578 * we should not run GTF on PATA devices since some
579 * PATA require execution of GTM/STM before GTF. 579 * PATA require execution of GTM/STM before GTF.
580 */ 580 */
581 if (!(ap->cbl == ATA_CBL_SATA)) 581 if (!(ap->flags & ATA_FLAG_ACPI_SATA))
582 return 0; 582 return 0;
583 583
584 for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { 584 for (ix = 0; ix < ATA_MAX_DEVICES; ix++) {
@@ -641,7 +641,7 @@ int ata_acpi_push_id(struct ata_device *dev)
641 __FUNCTION__, dev->devno, ap->port_no); 641 __FUNCTION__, dev->devno, ap->port_no);
642 642
643 /* Don't continue if not a SATA device. */ 643 /* Don't continue if not a SATA device. */
644 if (!(ap->cbl == ATA_CBL_SATA)) { 644 if (!(ap->flags & ATA_FLAG_ACPI_SATA)) {
645 if (ata_msg_probe(ap)) 645 if (ata_msg_probe(ap))
646 ata_dev_printk(dev, KERN_DEBUG, 646 ata_dev_printk(dev, KERN_DEBUG,
647 "%s: Not a SATA device\n", __FUNCTION__); 647 "%s: Not a SATA device\n", __FUNCTION__);
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4166407eb47..3ca9c610c11 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 } */
@@ -101,12 +101,6 @@ int libata_noacpi = 1;
101module_param_named(noacpi, libata_noacpi, int, 0444); 101module_param_named(noacpi, libata_noacpi, int, 0444);
102MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set"); 102MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set");
103 103
104int ata_spindown_compat = 1;
105module_param_named(spindown_compat, ata_spindown_compat, int, 0644);
106MODULE_PARM_DESC(spindown_compat, "Enable backward compatible spindown "
107 "behavior. Will be removed. More info can be found in "
108 "Documentation/feature-removal-schedule.txt\n");
109
110MODULE_AUTHOR("Jeff Garzik"); 104MODULE_AUTHOR("Jeff Garzik");
111MODULE_DESCRIPTION("Library module for ATA devices"); 105MODULE_DESCRIPTION("Library module for ATA devices");
112MODULE_LICENSE("GPL"); 106MODULE_LICENSE("GPL");
@@ -983,7 +977,7 @@ static u64 ata_hpa_resize(struct ata_device *dev)
983{ 977{
984 u64 sectors = dev->n_sectors; 978 u64 sectors = dev->n_sectors;
985 u64 hpa_sectors; 979 u64 hpa_sectors;
986 980
987 if (ata_id_has_lba48(dev->id)) 981 if (ata_id_has_lba48(dev->id))
988 hpa_sectors = ata_read_native_max_address_ext(dev); 982 hpa_sectors = ata_read_native_max_address_ext(dev);
989 else 983 else
@@ -1594,7 +1588,7 @@ unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd)
1594 * Check if the current speed of the device requires IORDY. Used 1588 * Check if the current speed of the device requires IORDY. Used
1595 * by various controllers for chip configuration. 1589 * by various controllers for chip configuration.
1596 */ 1590 */
1597 1591
1598unsigned int ata_pio_need_iordy(const struct ata_device *adev) 1592unsigned int ata_pio_need_iordy(const struct ata_device *adev)
1599{ 1593{
1600 /* Controller doesn't support IORDY. Probably a pointless check 1594 /* Controller doesn't support IORDY. Probably a pointless check
@@ -1617,7 +1611,7 @@ unsigned int ata_pio_need_iordy(const struct ata_device *adev)
1617 * 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
1618 * -1 if no iordy mode is available. 1612 * -1 if no iordy mode is available.
1619 */ 1613 */
1620 1614
1621static u32 ata_pio_mask_no_iordy(const struct ata_device *adev) 1615static u32 ata_pio_mask_no_iordy(const struct ata_device *adev)
1622{ 1616{
1623 /* 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 */
@@ -1919,7 +1913,6 @@ int ata_dev_configure(struct ata_device *dev)
1919 snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id)); 1913 snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id));
1920 1914
1921 dev->n_sectors = ata_id_n_sectors(id); 1915 dev->n_sectors = ata_id_n_sectors(id);
1922 dev->n_sectors_boot = dev->n_sectors;
1923 1916
1924 /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */ 1917 /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */
1925 ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV, 1918 ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV,
@@ -2670,7 +2663,7 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed,
2670 t->active += (t->cycle - (t->active + t->recover)) / 2; 2663 t->active += (t->cycle - (t->active + t->recover)) / 2;
2671 t->recover = t->cycle - t->active; 2664 t->recover = t->cycle - t->active;
2672 } 2665 }
2673 2666
2674 /* In a few cases quantisation may produce enough errors to 2667 /* In a few cases quantisation may produce enough errors to
2675 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
2676 if so we must correct this */ 2669 if so we must correct this */
@@ -2900,9 +2893,6 @@ int ata_do_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
2900 if (used_dma && (ap->host->flags & ATA_HOST_SIMPLEX)) 2893 if (used_dma && (ap->host->flags & ATA_HOST_SIMPLEX))
2901 ap->host->simplex_claimed = ap; 2894 ap->host->simplex_claimed = ap;
2902 2895
2903 /* step5: chip specific finalisation */
2904 if (ap->ops->post_set_mode)
2905 ap->ops->post_set_mode(ap);
2906 out: 2896 out:
2907 if (rc) 2897 if (rc)
2908 *r_failed_dev = dev; 2898 *r_failed_dev = dev;
@@ -3032,7 +3022,7 @@ int ata_wait_ready(struct ata_port *ap, unsigned long deadline)
3032 3022
3033 if (!(status & ATA_BUSY)) 3023 if (!(status & ATA_BUSY))
3034 return 0; 3024 return 0;
3035 if (status == 0xff) 3025 if (!ata_port_online(ap) && status == 0xff)
3036 return -ENODEV; 3026 return -ENODEV;
3037 if (time_after(now, deadline)) 3027 if (time_after(now, deadline))
3038 return -EBUSY; 3028 return -EBUSY;
@@ -3378,7 +3368,7 @@ int ata_std_prereset(struct ata_port *ap, unsigned long deadline)
3378 */ 3368 */
3379 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)) {
3380 rc = ata_wait_ready(ap, deadline); 3370 rc = ata_wait_ready(ap, deadline);
3381 if (rc) { 3371 if (rc && rc != -ENODEV) {
3382 ata_port_printk(ap, KERN_WARNING, "device not ready " 3372 ata_port_printk(ap, KERN_WARNING, "device not ready "
3383 "(errno=%d), forcing hardreset\n", rc); 3373 "(errno=%d), forcing hardreset\n", rc);
3384 ehc->i.action |= ATA_EH_HARDRESET; 3374 ehc->i.action |= ATA_EH_HARDRESET;
@@ -3632,7 +3622,6 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
3632 const u16 *old_id = dev->id; 3622 const u16 *old_id = dev->id;
3633 unsigned char model[2][ATA_ID_PROD_LEN + 1]; 3623 unsigned char model[2][ATA_ID_PROD_LEN + 1];
3634 unsigned char serial[2][ATA_ID_SERNO_LEN + 1]; 3624 unsigned char serial[2][ATA_ID_SERNO_LEN + 1];
3635 u64 new_n_sectors;
3636 3625
3637 if (dev->class != new_class) { 3626 if (dev->class != new_class) {
3638 ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n", 3627 ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n",
@@ -3644,7 +3633,6 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
3644 ata_id_c_string(new_id, model[1], ATA_ID_PROD, sizeof(model[1])); 3633 ata_id_c_string(new_id, model[1], ATA_ID_PROD, sizeof(model[1]));
3645 ata_id_c_string(old_id, serial[0], ATA_ID_SERNO, sizeof(serial[0])); 3634 ata_id_c_string(old_id, serial[0], ATA_ID_SERNO, sizeof(serial[0]));
3646 ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1])); 3635 ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1]));
3647 new_n_sectors = ata_id_n_sectors(new_id);
3648 3636
3649 if (strcmp(model[0], model[1])) { 3637 if (strcmp(model[0], model[1])) {
3650 ata_dev_printk(dev, KERN_INFO, "model number mismatch " 3638 ata_dev_printk(dev, KERN_INFO, "model number mismatch "
@@ -3658,25 +3646,12 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
3658 return 0; 3646 return 0;
3659 } 3647 }
3660 3648
3661 if (dev->class == ATA_DEV_ATA && dev->n_sectors != new_n_sectors) {
3662 ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch "
3663 "%llu != %llu\n",
3664 (unsigned long long)dev->n_sectors,
3665 (unsigned long long)new_n_sectors);
3666 /* Are we the boot time size - if so we appear to be the
3667 same disk at this point and our HPA got reapplied */
3668 if (ata_ignore_hpa && dev->n_sectors_boot == new_n_sectors
3669 && ata_id_hpa_enabled(new_id))
3670 return 1;
3671 return 0;
3672 }
3673
3674 return 1; 3649 return 1;
3675} 3650}
3676 3651
3677/** 3652/**
3678 * ata_dev_revalidate - Revalidate ATA device 3653 * ata_dev_reread_id - Re-read IDENTIFY data
3679 * @dev: device to revalidate 3654 * @adev: target ATA device
3680 * @readid_flags: read ID flags 3655 * @readid_flags: read ID flags
3681 * 3656 *
3682 * Re-read IDENTIFY page and make sure @dev is still attached to 3657 * Re-read IDENTIFY page and make sure @dev is still attached to
@@ -3688,34 +3663,68 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
3688 * RETURNS: 3663 * RETURNS:
3689 * 0 on success, negative errno otherwise 3664 * 0 on success, negative errno otherwise
3690 */ 3665 */
3691int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags) 3666int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags)
3692{ 3667{
3693 unsigned int class = dev->class; 3668 unsigned int class = dev->class;
3694 u16 *id = (void *)dev->ap->sector_buf; 3669 u16 *id = (void *)dev->ap->sector_buf;
3695 int rc; 3670 int rc;
3696 3671
3697 if (!ata_dev_enabled(dev)) {
3698 rc = -ENODEV;
3699 goto fail;
3700 }
3701
3702 /* read ID data */ 3672 /* read ID data */
3703 rc = ata_dev_read_id(dev, &class, readid_flags, id); 3673 rc = ata_dev_read_id(dev, &class, readid_flags, id);
3704 if (rc) 3674 if (rc)
3705 goto fail; 3675 return rc;
3706 3676
3707 /* is the device still there? */ 3677 /* is the device still there? */
3708 if (!ata_dev_same_device(dev, class, id)) { 3678 if (!ata_dev_same_device(dev, class, id))
3709 rc = -ENODEV; 3679 return -ENODEV;
3710 goto fail;
3711 }
3712 3680
3713 memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS); 3681 memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS);
3682 return 0;
3683}
3684
3685/**
3686 * ata_dev_revalidate - Revalidate ATA device
3687 * @dev: device to revalidate
3688 * @readid_flags: read ID flags
3689 *
3690 * Re-read IDENTIFY page, make sure @dev is still attached to the
3691 * port and reconfigure it according to the new IDENTIFY page.
3692 *
3693 * LOCKING:
3694 * Kernel thread context (may sleep)
3695 *
3696 * RETURNS:
3697 * 0 on success, negative errno otherwise
3698 */
3699int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags)
3700{
3701 u64 n_sectors = dev->n_sectors;
3702 int rc;
3703
3704 if (!ata_dev_enabled(dev))
3705 return -ENODEV;
3706
3707 /* re-read ID */
3708 rc = ata_dev_reread_id(dev, readid_flags);
3709 if (rc)
3710 goto fail;
3714 3711
3715 /* configure device according to the new ID */ 3712 /* configure device according to the new ID */
3716 rc = ata_dev_configure(dev); 3713 rc = ata_dev_configure(dev);
3717 if (rc == 0) 3714 if (rc)
3718 return 0; 3715 goto fail;
3716
3717 /* verify n_sectors hasn't changed */
3718 if (dev->class == ATA_DEV_ATA && dev->n_sectors != n_sectors) {
3719 ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch "
3720 "%llu != %llu\n",
3721 (unsigned long long)n_sectors,
3722 (unsigned long long)dev->n_sectors);
3723 rc = -ENODEV;
3724 goto fail;
3725 }
3726
3727 return 0;
3719 3728
3720 fail: 3729 fail:
3721 ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc); 3730 ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc);
@@ -3759,6 +3768,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
3759 { "ATAPI CD-ROM DRIVE 40X MAXIMUM",NULL,ATA_HORKAGE_NODMA }, 3768 { "ATAPI CD-ROM DRIVE 40X MAXIMUM",NULL,ATA_HORKAGE_NODMA },
3760 { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA }, 3769 { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA },
3761 { "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 },
3762 3772
3763 /* Weird ATAPI devices */ 3773 /* Weird ATAPI devices */
3764 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 | 3774 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 5309c312f51..d8070989a39 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 dd81fa78cdc..b3900cfbd88 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -893,6 +893,23 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth)
893 return queue_depth; 893 return queue_depth;
894} 894}
895 895
896/* XXX: for spindown warning */
897static void ata_delayed_done_timerfn(unsigned long arg)
898{
899 struct scsi_cmnd *scmd = (void *)arg;
900
901 scmd->scsi_done(scmd);
902}
903
904/* XXX: for spindown warning */
905static void ata_delayed_done(struct scsi_cmnd *scmd)
906{
907 static struct timer_list timer;
908
909 setup_timer(&timer, ata_delayed_done_timerfn, (unsigned long)scmd);
910 mod_timer(&timer, jiffies + 5 * HZ);
911}
912
896/** 913/**
897 * ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command 914 * ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command
898 * @qc: Storage for translated ATA taskfile 915 * @qc: Storage for translated ATA taskfile
@@ -949,22 +966,24 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
949 * removed. Read Documentation/feature-removal-schedule.txt 966 * removed. Read Documentation/feature-removal-schedule.txt
950 * for more info. 967 * for more info.
951 */ 968 */
952 if (ata_spindown_compat && 969 if ((qc->dev->flags & ATA_DFLAG_SPUNDOWN) &&
953 (system_state == SYSTEM_HALT || 970 (system_state == SYSTEM_HALT ||
954 system_state == SYSTEM_POWER_OFF)) { 971 system_state == SYSTEM_POWER_OFF)) {
955 static int warned = 0; 972 static unsigned long warned = 0;
956 973
957 if (!warned) { 974 if (!test_and_set_bit(0, &warned)) {
958 spin_unlock_irq(qc->ap->lock);
959 ata_dev_printk(qc->dev, KERN_WARNING, 975 ata_dev_printk(qc->dev, KERN_WARNING,
960 "DISK MIGHT NOT BE SPUN DOWN PROPERLY. " 976 "DISK MIGHT NOT BE SPUN DOWN PROPERLY. "
961 "UPDATE SHUTDOWN UTILITY\n"); 977 "UPDATE SHUTDOWN UTILITY\n");
962 ata_dev_printk(qc->dev, KERN_WARNING, 978 ata_dev_printk(qc->dev, KERN_WARNING,
963 "For more info, visit " 979 "For more info, visit "
964 "http://linux-ata.org/shutdown.html\n"); 980 "http://linux-ata.org/shutdown.html\n");
965 warned = 1; 981
966 ssleep(5); 982 /* ->scsi_done is not used, use it for
967 spin_lock_irq(qc->ap->lock); 983 * delayed completion.
984 */
985 scmd->scsi_done = qc->scsidone;
986 qc->scsidone = ata_delayed_done;
968 } 987 }
969 scmd->result = SAM_STAT_GOOD; 988 scmd->result = SAM_STAT_GOOD;
970 return 1; 989 return 1;
@@ -1031,14 +1050,15 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc)
1031static 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)
1032{ 1051{
1033 u64 lba = 0; 1052 u64 lba = 0;
1034 u32 len = 0; 1053 u32 len;
1035 1054
1036 VPRINTK("six-byte command\n"); 1055 VPRINTK("six-byte command\n");
1037 1056
1057 lba |= ((u64)(cdb[1] & 0x1f)) << 16;
1038 lba |= ((u64)cdb[2]) << 8; 1058 lba |= ((u64)cdb[2]) << 8;
1039 lba |= ((u64)cdb[3]); 1059 lba |= ((u64)cdb[3]);
1040 1060
1041 len |= ((u32)cdb[4]); 1061 len = cdb[4];
1042 1062
1043 *plba = lba; 1063 *plba = lba;
1044 *plen = len; 1064 *plen = len;
@@ -1375,6 +1395,14 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
1375 } 1395 }
1376 } 1396 }
1377 1397
1398 /* XXX: track spindown state for spindown skipping and warning */
1399 if (unlikely(qc->tf.command == ATA_CMD_STANDBY ||
1400 qc->tf.command == ATA_CMD_STANDBYNOW1))
1401 qc->dev->flags |= ATA_DFLAG_SPUNDOWN;
1402 else if (likely(system_state != SYSTEM_HALT &&
1403 system_state != SYSTEM_POWER_OFF))
1404 qc->dev->flags &= ~ATA_DFLAG_SPUNDOWN;
1405
1378 if (need_sense && !ap->ops->error_handler) 1406 if (need_sense && !ap->ops->error_handler)
1379 ata_dump_status(ap->print_id, &qc->result_tf); 1407 ata_dump_status(ap->print_id, &qc->result_tf);
1380 1408
@@ -1488,14 +1516,14 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd,
1488 1516
1489early_finish: 1517early_finish:
1490 ata_qc_free(qc); 1518 ata_qc_free(qc);
1491 done(cmd); 1519 qc->scsidone(cmd);
1492 DPRINTK("EXIT - early finish (good or error)\n"); 1520 DPRINTK("EXIT - early finish (good or error)\n");
1493 return 0; 1521 return 0;
1494 1522
1495err_did: 1523err_did:
1496 ata_qc_free(qc); 1524 ata_qc_free(qc);
1497 cmd->result = (DID_ERROR << 16); 1525 cmd->result = (DID_ERROR << 16);
1498 done(cmd); 1526 qc->scsidone(cmd);
1499err_mem: 1527err_mem:
1500 DPRINTK("EXIT - internal\n"); 1528 DPRINTK("EXIT - internal\n");
1501 return 0; 1529 return 0;
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 8b71b73a199..5e246665842 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -58,7 +58,6 @@ extern int atapi_enabled;
58extern int atapi_dmadir; 58extern int atapi_dmadir;
59extern int libata_fua; 59extern int libata_fua;
60extern int libata_noacpi; 60extern int libata_noacpi;
61extern int ata_spindown_compat;
62extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); 61extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev);
63extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, 62extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
64 u64 block, u32 n_block, unsigned int tf_flags, 63 u64 block, u32 n_block, unsigned int tf_flags,
@@ -76,7 +75,8 @@ extern unsigned ata_exec_internal_sg(struct ata_device *dev,
76extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd); 75extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd);
77extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, 76extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
78 unsigned int flags, u16 *id); 77 unsigned int flags, u16 *id);
79extern int ata_dev_revalidate(struct ata_device *dev, unsigned int flags); 78extern int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags);
79extern int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags);
80extern int ata_dev_configure(struct ata_device *dev); 80extern int ata_dev_configure(struct ata_device *dev);
81extern int sata_down_spd_limit(struct ata_port *ap); 81extern int sata_down_spd_limit(struct ata_port *ap);
82extern int sata_set_spd_needed(struct ata_port *ap); 82extern int sata_set_spd_needed(struct ata_port *ap);
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 9861059dd67..03b6ddd2abd 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 ed00fa9d53b..31cbf8daa29 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 2a79b335cfc..320a5b10aa9 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 83bcc5b3259..1aabe15ad9d 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 1b67923d7a4..848f0309bf0 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 f37d4cd812a..aa3256fb9f7 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 27b9f29c01e..d41a7691dd8 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 c6c8a8bb06d..0c9cb609071 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 5a0a410654e..6446735a46e 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 f25154aed75..e947433cb37 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 bbabe7902fb..8ce5e23a5f7 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 d042efdfbac..1f647b64820 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 a769952646e..95b0bb61788 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 ff9a6fd3665..b3456d7a592 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 b994351fbcd..8d2bc1e9e87 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 8d799e87f75..2af7ff8256c 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 707099291e0..edffc25d2d3 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 1f6384895a4..cbb7866940d 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 fb8c9e14b8d..1998c19e874 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 2bfd7ef42af..a3488b41ad2 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 225013ecf4b..1233063ab9a 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 cca3aa225ef..61502bc7bf1 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,12 +871,13 @@ 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) 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); 880 return ata_std_prereset(ap, deadline);
871} 881}
872 882
873/** 883/**
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index dee6e211949..1e8f421963c 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 f2231267e01..ec3ae937501 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 f48491ad5f3..e5aaec43694 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 e4c71f76bd5..a8462f1e890 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 cc4ad271afb..83abfeca405 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 52b69530ab2..f12c2b6ac08 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 bda5e7747c2..2d80c9d95e9 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 cb9b9ac12b4..c957e6e54ba 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 4cea3ef7522..adfa693db53 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
@@ -229,7 +229,6 @@ struct nv_host_priv {
229#define NV_ADMA_CHECK_INTR(GCTL, PORT) ((GCTL) & ( 1 << (19 + (12 * (PORT))))) 229#define NV_ADMA_CHECK_INTR(GCTL, PORT) ((GCTL) & ( 1 << (19 + (12 * (PORT)))))
230 230
231static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); 231static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
232static void nv_remove_one (struct pci_dev *pdev);
233#ifdef CONFIG_PM 232#ifdef CONFIG_PM
234static int nv_pci_device_resume(struct pci_dev *pdev); 233static int nv_pci_device_resume(struct pci_dev *pdev);
235#endif 234#endif
@@ -288,12 +287,6 @@ static const struct pci_device_id nv_pci_tbl[] = {
288 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC }, 287 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC },
289 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC }, 288 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC },
290 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC }, 289 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC },
291 { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
292 PCI_ANY_ID, PCI_ANY_ID,
293 PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC },
294 { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
295 PCI_ANY_ID, PCI_ANY_ID,
296 PCI_CLASS_STORAGE_RAID<<8, 0xffff00, GENERIC },
297 290
298 { } /* terminate list */ 291 { } /* terminate list */
299}; 292};
@@ -306,7 +299,7 @@ static struct pci_driver nv_pci_driver = {
306 .suspend = ata_pci_device_suspend, 299 .suspend = ata_pci_device_suspend,
307 .resume = nv_pci_device_resume, 300 .resume = nv_pci_device_resume,
308#endif 301#endif
309 .remove = nv_remove_one, 302 .remove = ata_pci_remove_one,
310}; 303};
311 304
312static struct scsi_host_template nv_sht = { 305static struct scsi_host_template nv_sht = {
@@ -809,7 +802,7 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance)
809 u16 status; 802 u16 status;
810 u32 gen_ctl; 803 u32 gen_ctl;
811 u32 notifier, notifier_error; 804 u32 notifier, notifier_error;
812 805
813 /* if ADMA is disabled, use standard ata interrupt handler */ 806 /* if ADMA is disabled, use standard ata interrupt handler */
814 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) { 807 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) {
815 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)
@@ -970,7 +963,7 @@ static void nv_adma_irq_clear(struct ata_port *ap)
970 963
971 /* clear ADMA status */ 964 /* clear ADMA status */
972 writew(0xffff, mmio + NV_ADMA_STAT); 965 writew(0xffff, mmio + NV_ADMA_STAT);
973 966
974 /* clear notifiers - note both ports need to be written with 967 /* clear notifiers - note both ports need to be written with
975 something even though we are only clearing on one */ 968 something even though we are only clearing on one */
976 if (ap->port_no == 0) { 969 if (ap->port_no == 0) {
@@ -1613,15 +1606,6 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1613 IRQF_SHARED, ppi[0]->sht); 1606 IRQF_SHARED, ppi[0]->sht);
1614} 1607}
1615 1608
1616static void nv_remove_one (struct pci_dev *pdev)
1617{
1618 struct ata_host *host = dev_get_drvdata(&pdev->dev);
1619 struct nv_host_priv *hpriv = host->private_data;
1620
1621 ata_pci_remove_one(pdev);
1622 kfree(hpriv);
1623}
1624
1625#ifdef CONFIG_PM 1609#ifdef CONFIG_PM
1626static int nv_pci_device_resume(struct pci_dev *pdev) 1610static int nv_pci_device_resume(struct pci_dev *pdev)
1627{ 1611{
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 3a7d9b5332a..2b924a69b36 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 f5a05de0093..6688ccb6632 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 e8483aadd11..a3b339bcf3c 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 a69d78cd8e9..0ddfae9911c 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
@@ -237,7 +237,8 @@ enum {
237 /* host flags */ 237 /* host flags */
238 SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 238 SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
239 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 239 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
240 ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY, 240 ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY |
241 ATA_FLAG_ACPI_SATA,
241 SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ 242 SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */
242 243
243 IRQ_STAT_4PORTS = 0xf, 244 IRQ_STAT_4PORTS = 0xf,
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index ee66c5fa7ac..221099d1d08 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 17246734fe7..bcb2cd8b063 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 3a4f44559d0..2d14f3d56d9 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 006f5e35265..6815de7cca7 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 d105d2c189d..e8b90e7b42d 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};
@@ -441,7 +444,7 @@ static int vt6421_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
441 return -ENOMEM; 444 return -ENOMEM;
442 } 445 }
443 446
444 rc = pcim_iomap_regions(pdev, 0x1f, DRV_NAME); 447 rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME);
445 if (rc) { 448 if (rc) {
446 dev_printk(KERN_ERR, &pdev->dev, "failed to request/iomap " 449 dev_printk(KERN_ERR, &pdev->dev, "failed to request/iomap "
447 "PCI BARs (errno=%d)\n", rc); 450 "PCI BARs (errno=%d)\n", rc);
diff --git a/drivers/ata/sata_vsc.c b/drivers/ata/sata_vsc.c
index 80126f835d3..81330175fc8 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 057efbc55d3..3800bc0cb2e 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 544b3973829..6f2b4a5875f 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/base/dmapool.c b/drivers/base/dmapool.c
index 9406259754a..91970e9bb05 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/cciss.c b/drivers/block/cciss.c
index 370dfe1c422..5acc6c44aea 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -3469,13 +3469,39 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
3469 return -1; 3469 return -1;
3470} 3470}
3471 3471
3472static void cciss_remove_one(struct pci_dev *pdev) 3472static void cciss_shutdown(struct pci_dev *pdev)
3473{ 3473{
3474 ctlr_info_t *tmp_ptr; 3474 ctlr_info_t *tmp_ptr;
3475 int i, j; 3475 int i;
3476 char flush_buf[4]; 3476 char flush_buf[4];
3477 int return_code; 3477 int return_code;
3478 3478
3479 tmp_ptr = pci_get_drvdata(pdev);
3480 if (tmp_ptr == NULL)
3481 return;
3482 i = tmp_ptr->ctlr;
3483 if (hba[i] == NULL)
3484 return;
3485
3486 /* Turn board interrupts off and send the flush cache command */
3487 /* sendcmd will turn off interrupt, and send the flush...
3488 * To write all data in the battery backed cache to disks */
3489 memset(flush_buf, 0, 4);
3490 return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL,
3491 TYPE_CMD);
3492 if (return_code == IO_OK) {
3493 printk(KERN_INFO "Completed flushing cache on controller %d\n", i);
3494 } else {
3495 printk(KERN_WARNING "Error flushing cache on controller %d\n", i);
3496 }
3497 free_irq(hba[i]->intr[2], hba[i]);
3498}
3499
3500static void __devexit cciss_remove_one(struct pci_dev *pdev)
3501{
3502 ctlr_info_t *tmp_ptr;
3503 int i, j;
3504
3479 if (pci_get_drvdata(pdev) == NULL) { 3505 if (pci_get_drvdata(pdev) == NULL) {
3480 printk(KERN_ERR "cciss: Unable to remove device \n"); 3506 printk(KERN_ERR "cciss: Unable to remove device \n");
3481 return; 3507 return;
@@ -3506,18 +3532,7 @@ static void cciss_remove_one(struct pci_dev *pdev)
3506 3532
3507 cciss_unregister_scsi(i); /* unhook from SCSI subsystem */ 3533 cciss_unregister_scsi(i); /* unhook from SCSI subsystem */
3508 3534
3509 /* Turn board interrupts off and send the flush cache command */ 3535 cciss_shutdown(pdev);
3510 /* sendcmd will turn off interrupt, and send the flush...
3511 * To write all data in the battery backed cache to disks */
3512 memset(flush_buf, 0, 4);
3513 return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL,
3514 TYPE_CMD);
3515 if (return_code == IO_OK) {
3516 printk(KERN_INFO "Completed flushing cache on controller %d\n", i);
3517 } else {
3518 printk(KERN_WARNING "Error flushing cache on controller %d\n", i);
3519 }
3520 free_irq(hba[i]->intr[2], hba[i]);
3521 3536
3522#ifdef CONFIG_PCI_MSI 3537#ifdef CONFIG_PCI_MSI
3523 if (hba[i]->msix_vector) 3538 if (hba[i]->msix_vector)
@@ -3550,7 +3565,7 @@ static struct pci_driver cciss_pci_driver = {
3550 .probe = cciss_init_one, 3565 .probe = cciss_init_one,
3551 .remove = __devexit_p(cciss_remove_one), 3566 .remove = __devexit_p(cciss_remove_one),
3552 .id_table = cciss_pci_device_id, /* id_table */ 3567 .id_table = cciss_pci_device_id, /* id_table */
3553 .shutdown = cciss_remove_one, 3568 .shutdown = cciss_shutdown,
3554}; 3569};
3555 3570
3556/* 3571/*
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 3587cb43437..fe088045dd0 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 b0238b46dde..7e04dd69f60 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 abcafac6473..ef683ebd367 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 679d7f97243..c7ed617aa7f 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 45aeb917ec6..d535c406b31 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 c72ee97d389..ca376b92162 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 ef833a1c27e..0b7ffa5191c 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/hangcheck-timer.c b/drivers/char/hangcheck-timer.c
index f0e7263dfcd..0e8ceea5ea7 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/random.c b/drivers/char/random.c
index 46c1b97748b..0474cac4a84 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/watchdog/booke_wdt.c b/drivers/char/watchdog/booke_wdt.c
index 0e23f29f71a..0f5c77ddd39 100644
--- a/drivers/char/watchdog/booke_wdt.c
+++ b/drivers/char/watchdog/booke_wdt.c
@@ -24,7 +24,7 @@
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include <asm/system.h> 25#include <asm/system.h>
26 26
27/* If the kernel parameter wdt_enable=1, the watchdog will be enabled at boot. 27/* If the kernel parameter wdt=1, the watchdog will be enabled at boot.
28 * Also, the wdt_period sets the watchdog timer period timeout. 28 * Also, the wdt_period sets the watchdog timer period timeout.
29 * For E500 cpus the wdt_period sets which bit changing from 0->1 will 29 * For E500 cpus the wdt_period sets which bit changing from 0->1 will
30 * trigger a watchog timeout. This watchdog timeout will occur 3 times, the 30 * trigger a watchog timeout. This watchdog timeout will occur 3 times, the
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index e678a33ea67..bb90cbd7ca5 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -1,10 +1,10 @@
1menu "Hardware crypto devices" 1menu "Hardware crypto devices"
2 2
3config CRYPTO_DEV_PADLOCK 3config CRYPTO_DEV_PADLOCK
4 bool "Support for VIA PadLock ACE" 4 tristate "Support for VIA PadLock ACE"
5 depends on X86_32 5 depends on X86_32
6 select CRYPTO_ALGAPI 6 select CRYPTO_ALGAPI
7 default y 7 default m
8 help 8 help
9 Some VIA processors come with an integrated crypto engine 9 Some VIA processors come with an integrated crypto engine
10 (so called VIA PadLock ACE, Advanced Cryptography Engine) 10 (so called VIA PadLock ACE, Advanced Cryptography Engine)
diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index 6d3840e629d..6a86958b577 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 8003a36f3a8..f47968671ae 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 5932c72f9e4..396dade731f 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 fc7d59d4bce..a7c31e9039c 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-cdev.c b/drivers/firewire/fw-cdev.c
index 0fa5bd54c6a..3ab3585d360 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;
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index c17342d3e6f..2e4cfa57126 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,7 +417,8 @@ 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 reg_write(ctx->ohci, COMMAND_PTR(ctx->regs),
421 le32_to_cpu(ab.descriptor.branch_address));
421 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN); 422 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN);
422 flush_writes(ctx->ohci); 423 flush_writes(ctx->ohci);
423 424
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 4d1cb5b855d..13eea47dceb 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 0c160675b3a..fd1281f4220 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 75e3911810a..0328382df8f 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 c849c0c6ee9..d5ac422d73b 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 5aab23b93e2..f17e771e42f 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 a5b774b07cb..12cb40a975d 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 8a0a99b9364..28e7b91a455 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 e68a96f589f..e4540fcf647 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 907999049d5..cb9abe7565a 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 64f8e56d300..435925eba43 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 b77b7d138c4..ead141e2db9 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 d50bd996ff2..ea94c9aa122 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 0e52ad722a7..8ab33faf6f7 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 6234f806c6b..47bcd91c9b5 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 2296d43a241..5f026b5d785 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 a3439ee7cb4..4f3e2dd46f0 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/raw1394.c b/drivers/ieee1394/raw1394.c
index d382500f421..f1d05eeb9f5 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 d0db6f8b520..ce86ff226a2 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>
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 558c9a0fc8b..e85f7013de5 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 eff591deeb4..40c004a2697 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 592c90aa318..3ada17c0f23 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 f32ca5fbb26..b4aec5103c9 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 84c5bb49856..add79bd44e3 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 7f0beec74f7..5766ae3a202 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 085e28b939e..dd691cfa507 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 5cd70690845..dc137dec230 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 42ab4a801d6..12fac1c8989 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 5b8eddc9fa8..88c72d56368 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 27caf3b0648..4b111a852ff 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 71314460b11..38102520ffb 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 ca224d018af..be6e1e03bda 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 773145e2994..aa563e61de6 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 48f7c65e9ae..e61f3e62698 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 72fabb822f1..eef415b12b2 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 61974b0296c..b8f05a52667 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 87310eeb6df..285c143115c 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 eec833b81e9..076a0bbb63d 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 68d72c6f7ff..8404f05b2b6 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 0a428f2b05c..894b1dcdf3e 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 54fbead4de0..aae367057a5 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 5c3c6a43a52..982eb88e27e 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 fb129c479a6..682244b1c04 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 21c4e13d3a5..3154ccd7400 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 750099d8e3c..1457b73850e 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 1b2b9c9c5d8..b773d4c756a 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 cf3e4664e72..2c5f11a4f6b 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 9df74b72e6c..0c5660d28ca 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 559508795af..d31ece8f68e 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 4f091800bfe..e5cca9bd040 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 693e3b2a65a..1c9069cd3ba 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 61c15024c2a..1a15475aedf 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 6582816a047..f0cbcdb008e 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/hardware/eicon/capifunc.c b/drivers/isdn/hardware/eicon/capifunc.c
index ff284aeb8fb..82edc1c1db7 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/message.c b/drivers/isdn/hardware/eicon/message.c
index 784232a144c..ccd35d047ec 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 da4196f21e0..8d53a7fd267 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 1f18f199338..b1a26e02df0 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 9e088fce8c3..7993e01f9fc 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 bb3a28a53ff..13751237bfc 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 ff159512204..4ada66b8b67 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/icn/icn.c b/drivers/isdn/icn/icn.c
index 1e699bcaba0..82d957bde29 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 c5a307e3c49..0b4c4f15abd 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 41634fde8e1..1c040d80c64 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 0d892600ff0..da985b31b17 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 9c15f32eea1..fa17d6d4f0c 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 724db0027f0..e6e4d240b2a 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
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index 58926da0ae1..f44c94abd88 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -113,7 +113,6 @@ 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
119 118
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index b77ef5187d6..b46817f699f 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/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c
index 192b26e9777..11ced17f438 100644
--- a/drivers/macintosh/windfarm_core.c
+++ b/drivers/macintosh/windfarm_core.c
@@ -216,7 +216,10 @@ int wf_register_control(struct wf_control *new_ct)
216 new_ct->attr.attr.mode = 0644; 216 new_ct->attr.attr.mode = 0644;
217 new_ct->attr.show = wf_show_control; 217 new_ct->attr.show = wf_show_control;
218 new_ct->attr.store = wf_store_control; 218 new_ct->attr.store = wf_store_control;
219 device_create_file(&wf_platform_device.dev, &new_ct->attr); 219 if (device_create_file(&wf_platform_device.dev, &new_ct->attr))
220 printk(KERN_WARNING "windfarm: device_create_file failed"
221 " for %s\n", new_ct->name);
222 /* the subsystem still does useful work without the file */
220 223
221 DBG("wf: Registered control %s\n", new_ct->name); 224 DBG("wf: Registered control %s\n", new_ct->name);
222 225
@@ -326,7 +329,10 @@ int wf_register_sensor(struct wf_sensor *new_sr)
326 new_sr->attr.attr.mode = 0444; 329 new_sr->attr.attr.mode = 0444;
327 new_sr->attr.show = wf_show_sensor; 330 new_sr->attr.show = wf_show_sensor;
328 new_sr->attr.store = NULL; 331 new_sr->attr.store = NULL;
329 device_create_file(&wf_platform_device.dev, &new_sr->attr); 332 if (device_create_file(&wf_platform_device.dev, &new_sr->attr))
333 printk(KERN_WARNING "windfarm: device_create_file failed"
334 " for %s\n", new_sr->name);
335 /* the subsystem still does useful work without the file */
330 336
331 DBG("wf: Registered sensor %s\n", new_sr->name); 337 DBG("wf: Registered sensor %s\n", new_sr->name);
332 338
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 5a4a74c1097..9620d452d03 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 d5ecd2d5304..19274108319 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 c10ce91b64e..1c54f3c1cca 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 dfe32149ad3..2c404f73a37 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 0393a3d1992..e908e3cf1e5 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 e23d8a0ea1d..a9fa3337dd8 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 b2c22a0d664..8e2a87cdc79 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 96254dbaf62..c08f650df42 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 2c450bd05af..5b6a4037160 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 0cc98a0e249..1aaeaa02f15 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 9a412d6c6d0..552f04511ea 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 794a6a02f82..1989ec1cb97 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 03bc369a9e4..3ceb8a6249d 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 1b9b0742f75..c40b92ce1fa 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 d25d3be8fcd..165f81d16d0 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 561074a04b0..bc740a6dd93 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -2423,11 +2423,11 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
2423 ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE; 2423 ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE;
2424 ioc->events[idx].eventContext = ioc->eventContext; 2424 ioc->events[idx].eventContext = ioc->eventContext;
2425 2425
2426 ioc->events[idx].data[0] = (pReq->LUN[1] << 24) || 2426 ioc->events[idx].data[0] = (pReq->LUN[1] << 24) |
2427 (MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) || 2427 (MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) |
2428 (sc->device->channel << 8) || sc->device->id; 2428 (sc->device->channel << 8) | sc->device->id;
2429 2429
2430 ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12]; 2430 ioc->events[idx].data[1] = (sense_data[13] << 8) | sense_data[12];
2431 2431
2432 ioc->eventContext++; 2432 ioc->eventContext++;
2433 if (hd->ioc->pcidev->vendor == 2433 if (hd->ioc->pcidev->vendor ==
diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c
index d3235f213c8..e0d474b1743 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 cb8c264eaff..7772bd1d92b 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 35b139b0e5f..5108b7c576d 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/mmc/card/block.c b/drivers/mmc/card/block.c
index a7562f7fc0b..540ff4bea54 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 2e77963db33..dd97bc79840 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 c9f139e764f..1590b3f3f1f 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/ubi/eba.c b/drivers/mtd/ubi/eba.c
index 3dba5733ed1..74002945b71 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -940,9 +940,6 @@ static void ltree_entry_ctor(void *obj, struct kmem_cache *cache,
940{ 940{
941 struct ltree_entry *le = obj; 941 struct ltree_entry *le = obj;
942 942
943 if (flags & SLAB_CTOR_CONSTRUCTOR)
944 return;
945
946 le->users = 0; 943 le->users = 0;
947 init_rwsem(&le->mutex); 944 init_rwsem(&le->mutex);
948} 945}
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index c5baa197bc0..1798a9f9fb2 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,6 @@ 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
2284 help 2283 help
2285 This driver supports the Gigabit Ethernet mode of the QUICC Engine, 2284 This driver supports the Gigabit Ethernet mode of the QUICC Engine,
2286 which is available on some Freescale SOCs. 2285 which is available on some Freescale SOCs.
diff --git a/drivers/net/arcnet/Kconfig b/drivers/net/arcnet/Kconfig
index 7284ccad0b9..4030274fe78 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 4aec747d9e4..9fe3a38883e 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 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 269d097dd92..d0f87d82566 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 95d854e2295..b2577f40124 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 571d82f8008..7df23dc2819 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.h b/drivers/net/e1000/e1000.h
index a9ea67e75c1..16a6edfeba4 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -333,11 +333,9 @@ struct e1000_adapter {
333 struct e1000_tx_ring test_tx_ring; 333 struct e1000_tx_ring test_tx_ring;
334 struct e1000_rx_ring test_rx_ring; 334 struct e1000_rx_ring test_rx_ring;
335 335
336
337 int msg_enable; 336 int msg_enable;
338#ifdef CONFIG_PCI_MSI
339 boolean_t have_msi; 337 boolean_t have_msi;
340#endif 338
341 /* to not mess up cache alignment, always add to the bottom */ 339 /* to not mess up cache alignment, always add to the bottom */
342 boolean_t tso_force; 340 boolean_t tso_force;
343 boolean_t smart_power_down; /* phy smart power down */ 341 boolean_t smart_power_down; /* phy smart power down */
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 637ae8f6879..9ec35b7a820 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -158,9 +158,7 @@ static struct net_device_stats * e1000_get_stats(struct net_device *netdev);
158static int e1000_change_mtu(struct net_device *netdev, int new_mtu); 158static int e1000_change_mtu(struct net_device *netdev, int new_mtu);
159static int e1000_set_mac(struct net_device *netdev, void *p); 159static int e1000_set_mac(struct net_device *netdev, void *p);
160static irqreturn_t e1000_intr(int irq, void *data); 160static irqreturn_t e1000_intr(int irq, void *data);
161#ifdef CONFIG_PCI_MSI
162static irqreturn_t e1000_intr_msi(int irq, void *data); 161static irqreturn_t e1000_intr_msi(int irq, void *data);
163#endif
164static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter, 162static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter,
165 struct e1000_tx_ring *tx_ring); 163 struct e1000_tx_ring *tx_ring);
166#ifdef CONFIG_E1000_NAPI 164#ifdef CONFIG_E1000_NAPI
@@ -300,31 +298,26 @@ module_exit(e1000_exit_module);
300static int e1000_request_irq(struct e1000_adapter *adapter) 298static int e1000_request_irq(struct e1000_adapter *adapter)
301{ 299{
302 struct net_device *netdev = adapter->netdev; 300 struct net_device *netdev = adapter->netdev;
303 int flags, err = 0; 301 void (*handler) = &e1000_intr;
302 int irq_flags = IRQF_SHARED;
303 int err;
304 304
305 flags = IRQF_SHARED;
306#ifdef CONFIG_PCI_MSI
307 if (adapter->hw.mac_type >= e1000_82571) { 305 if (adapter->hw.mac_type >= e1000_82571) {
308 adapter->have_msi = TRUE; 306 adapter->have_msi = !pci_enable_msi(adapter->pdev);
309 if ((err = pci_enable_msi(adapter->pdev))) { 307 if (adapter->have_msi) {
310 DPRINTK(PROBE, ERR, 308 handler = &e1000_intr_msi;
311 "Unable to allocate MSI interrupt Error: %d\n", err); 309 irq_flags = 0;
312 adapter->have_msi = FALSE;
313 } 310 }
314 } 311 }
315 if (adapter->have_msi) { 312
316 flags &= ~IRQF_SHARED; 313 err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
317 err = request_irq(adapter->pdev->irq, &e1000_intr_msi, flags, 314 netdev);
318 netdev->name, netdev); 315 if (err) {
319 if (err) 316 if (adapter->have_msi)
320 DPRINTK(PROBE, ERR, 317 pci_disable_msi(adapter->pdev);
321 "Unable to allocate interrupt Error: %d\n", err);
322 } else
323#endif
324 if ((err = request_irq(adapter->pdev->irq, &e1000_intr, flags,
325 netdev->name, netdev)))
326 DPRINTK(PROBE, ERR, 318 DPRINTK(PROBE, ERR,
327 "Unable to allocate interrupt Error: %d\n", err); 319 "Unable to allocate interrupt Error: %d\n", err);
320 }
328 321
329 return err; 322 return err;
330} 323}
@@ -335,10 +328,8 @@ static void e1000_free_irq(struct e1000_adapter *adapter)
335 328
336 free_irq(adapter->pdev->irq, netdev); 329 free_irq(adapter->pdev->irq, netdev);
337 330
338#ifdef CONFIG_PCI_MSI
339 if (adapter->have_msi) 331 if (adapter->have_msi)
340 pci_disable_msi(adapter->pdev); 332 pci_disable_msi(adapter->pdev);
341#endif
342} 333}
343 334
344/** 335/**
@@ -1334,7 +1325,10 @@ e1000_sw_init(struct e1000_adapter *adapter)
1334 spin_lock_init(&adapter->tx_queue_lock); 1325 spin_lock_init(&adapter->tx_queue_lock);
1335#endif 1326#endif
1336 1327
1337 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
1338 spin_lock_init(&adapter->stats_lock); 1332 spin_lock_init(&adapter->stats_lock);
1339 1333
1340 set_bit(__E1000_DOWN, &adapter->flags); 1334 set_bit(__E1000_DOWN, &adapter->flags);
@@ -3744,7 +3738,6 @@ e1000_update_stats(struct e1000_adapter *adapter)
3744 3738
3745 spin_unlock_irqrestore(&adapter->stats_lock, flags); 3739 spin_unlock_irqrestore(&adapter->stats_lock, flags);
3746} 3740}
3747#ifdef CONFIG_PCI_MSI
3748 3741
3749/** 3742/**
3750 * e1000_intr_msi - Interrupt Handler 3743 * e1000_intr_msi - Interrupt Handler
@@ -3810,7 +3803,6 @@ e1000_intr_msi(int irq, void *data)
3810 3803
3811 return IRQ_HANDLED; 3804 return IRQ_HANDLED;
3812} 3805}
3813#endif
3814 3806
3815/** 3807/**
3816 * e1000_intr - Interrupt Handler 3808 * e1000_intr - Interrupt Handler
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 602872dbe15..e85a933a476 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 f6e0cb1ada1..152bb2016a2 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/forcedeth.c b/drivers/net/forcedeth.c
index 7a018027fcc..4154fd00074 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/gianfar.c b/drivers/net/gianfar.c
index b666a0cc064..f5b3cba23fc 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1025,6 +1025,15 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
1025 1025
1026 dev->trans_start = jiffies; 1026 dev->trans_start = jiffies;
1027 1027
1028 /* The powerpc-specific eieio() is used, as wmb() has too strong
1029 * semantics (it requires synchronization between cacheable and
1030 * uncacheable mappings, which eieio doesn't provide and which we
1031 * don't need), thus requiring a more expensive sync instruction. At
1032 * some point, the set of architecture-independent barrier functions
1033 * should be expanded to include weaker barriers.
1034 */
1035
1036 eieio();
1028 txbdp->status = status; 1037 txbdp->status = status;
1029 1038
1030 /* If this was the last BD in the ring, the next one */ 1039 /* If this was the last BD in the ring, the next one */
@@ -1301,6 +1310,7 @@ struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp)
1301 bdp->length = 0; 1310 bdp->length = 0;
1302 1311
1303 /* Mark the buffer empty */ 1312 /* Mark the buffer empty */
1313 eieio();
1304 bdp->status |= (RXBD_EMPTY | RXBD_INTERRUPT); 1314 bdp->status |= (RXBD_EMPTY | RXBD_INTERRUPT);
1305 1315
1306 return skb; 1316 return skb;
@@ -1484,6 +1494,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
1484 bdp = priv->cur_rx; 1494 bdp = priv->cur_rx;
1485 1495
1486 while (!((bdp->status & RXBD_EMPTY) || (--rx_work_limit < 0))) { 1496 while (!((bdp->status & RXBD_EMPTY) || (--rx_work_limit < 0))) {
1497 rmb();
1487 skb = priv->rx_skbuff[priv->skb_currx]; 1498 skb = priv->rx_skbuff[priv->skb_currx];
1488 1499
1489 if (!(bdp->status & 1500 if (!(bdp->status &
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index 50035ebd4f5..f752e5fc65b 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -926,7 +926,7 @@ static int emac_link_differs(struct ocp_enet_private *dev)
926 int duplex = r & EMAC_MR1_FDE ? DUPLEX_FULL : DUPLEX_HALF; 926 int duplex = r & EMAC_MR1_FDE ? DUPLEX_FULL : DUPLEX_HALF;
927 int speed, pause, asym_pause; 927 int speed, pause, asym_pause;
928 928
929 if (r & (EMAC_MR1_MF_1000 | EMAC_MR1_MF_1000GPCS)) 929 if (r & EMAC_MR1_MF_1000)
930 speed = SPEED_1000; 930 speed = SPEED_1000;
931 else if (r & EMAC_MR1_MF_100) 931 else if (r & EMAC_MR1_MF_100)
932 speed = SPEED_100; 932 speed = SPEED_100;
diff --git a/drivers/net/ibm_emac/ibm_emac_mal.c b/drivers/net/ibm_emac/ibm_emac_mal.c
index 6c0f071e405..cabd9846a5e 100644
--- a/drivers/net/ibm_emac/ibm_emac_mal.c
+++ b/drivers/net/ibm_emac/ibm_emac_mal.c
@@ -59,8 +59,7 @@ int __init mal_register_commac(struct ibm_ocp_mal *mal,
59 return 0; 59 return 0;
60} 60}
61 61
62void __exit mal_unregister_commac(struct ibm_ocp_mal *mal, 62void mal_unregister_commac(struct ibm_ocp_mal *mal, struct mal_commac *commac)
63 struct mal_commac *commac)
64{ 63{
65 unsigned long flags; 64 unsigned long flags;
66 local_irq_save(flags); 65 local_irq_save(flags);
diff --git a/drivers/net/ibm_emac/ibm_emac_mal.h b/drivers/net/ibm_emac/ibm_emac_mal.h
index 407d2acbf7c..64bc338acc6 100644
--- a/drivers/net/ibm_emac/ibm_emac_mal.h
+++ b/drivers/net/ibm_emac/ibm_emac_mal.h
@@ -223,8 +223,7 @@ void mal_exit(void) __exit;
223 223
224int mal_register_commac(struct ibm_ocp_mal *mal, 224int mal_register_commac(struct ibm_ocp_mal *mal,
225 struct mal_commac *commac) __init; 225 struct mal_commac *commac) __init;
226void mal_unregister_commac(struct ibm_ocp_mal *mal, 226void mal_unregister_commac(struct ibm_ocp_mal *mal, struct mal_commac *commac);
227 struct mal_commac *commac) __exit;
228int mal_set_rcbs(struct ibm_ocp_mal *mal, int channel, unsigned long size); 227int mal_set_rcbs(struct ibm_ocp_mal *mal, int channel, unsigned long size);
229 228
230/* Returns BD ring offset for a particular channel 229/* Returns BD ring offset for a particular channel
diff --git a/drivers/net/ibm_emac/ibm_emac_phy.c b/drivers/net/ibm_emac/ibm_emac_phy.c
index 9074f76ee2b..e57862b34ca 100644
--- a/drivers/net/ibm_emac/ibm_emac_phy.c
+++ b/drivers/net/ibm_emac/ibm_emac_phy.c
@@ -22,6 +22,7 @@
22 22
23#include <asm/ocp.h> 23#include <asm/ocp.h>
24 24
25#include "ibm_emac_core.h"
25#include "ibm_emac_phy.h" 26#include "ibm_emac_phy.h"
26 27
27static inline int phy_read(struct mii_phy *phy, int reg) 28static inline int phy_read(struct mii_phy *phy, int reg)
@@ -34,11 +35,39 @@ static inline void phy_write(struct mii_phy *phy, int reg, int val)
34 phy->mdio_write(phy->dev, phy->address, reg, val); 35 phy->mdio_write(phy->dev, phy->address, reg, val);
35} 36}
36 37
37int mii_reset_phy(struct mii_phy *phy) 38/*
39 * polls MII_BMCR until BMCR_RESET bit clears or operation times out.
40 *
41 * returns:
42 * >= 0 => success, value in BMCR returned to caller
43 * -EBUSY => failure, RESET bit never cleared
44 * otherwise => failure, lower level PHY read failed
45 */
46static int mii_spin_reset_complete(struct mii_phy *phy)
38{ 47{
39 int val; 48 int val;
40 int limit = 10000; 49 int limit = 10000;
41 50
51 while (limit--) {
52 val = phy_read(phy, MII_BMCR);
53 if (val >= 0 && !(val & BMCR_RESET))
54 return val; /* success */
55 udelay(10);
56 }
57 if (val & BMCR_RESET)
58 val = -EBUSY;
59
60 if (net_ratelimit())
61 printk(KERN_ERR "emac%d: PHY reset timeout (%d)\n",
62 ((struct ocp_enet_private *)phy->dev->priv)->def->index,
63 val);
64 return val;
65}
66
67int mii_reset_phy(struct mii_phy *phy)
68{
69 int val;
70
42 val = phy_read(phy, MII_BMCR); 71 val = phy_read(phy, MII_BMCR);
43 val &= ~BMCR_ISOLATE; 72 val &= ~BMCR_ISOLATE;
44 val |= BMCR_RESET; 73 val |= BMCR_RESET;
@@ -46,16 +75,11 @@ int mii_reset_phy(struct mii_phy *phy)
46 75
47 udelay(300); 76 udelay(300);
48 77
49 while (limit--) { 78 val = mii_spin_reset_complete(phy);
50 val = phy_read(phy, MII_BMCR); 79 if (val >= 0 && (val & BMCR_ISOLATE))
51 if (val >= 0 && (val & BMCR_RESET) == 0)
52 break;
53 udelay(10);
54 }
55 if ((val & BMCR_ISOLATE) && limit > 0)
56 phy_write(phy, MII_BMCR, val & ~BMCR_ISOLATE); 80 phy_write(phy, MII_BMCR, val & ~BMCR_ISOLATE);
57 81
58 return limit <= 0; 82 return val < 0;
59} 83}
60 84
61static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise) 85static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise)
@@ -102,8 +126,14 @@ static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise)
102 } 126 }
103 127
104 /* Start/Restart aneg */ 128 /* Start/Restart aneg */
105 ctl = phy_read(phy, MII_BMCR); 129 /* on some PHYs (e.g. National DP83843) a write to MII_ADVERTISE
106 ctl |= (BMCR_ANENABLE | BMCR_ANRESTART); 130 * causes BMCR_RESET to be set on the next read of MII_BMCR, which
131 * if not checked for causes the PHY to be reset below */
132 ctl = mii_spin_reset_complete(phy);
133 if (ctl < 0)
134 return ctl;
135
136 ctl |= BMCR_ANENABLE | BMCR_ANRESTART;
107 phy_write(phy, MII_BMCR, ctl); 137 phy_write(phy, MII_BMCR, ctl);
108 138
109 return 0; 139 return 0;
@@ -118,13 +148,13 @@ static int genmii_setup_forced(struct mii_phy *phy, int speed, int fd)
118 phy->duplex = fd; 148 phy->duplex = fd;
119 phy->pause = phy->asym_pause = 0; 149 phy->pause = phy->asym_pause = 0;
120 150
151 /* First reset the PHY */
152 mii_reset_phy(phy);
153
121 ctl = phy_read(phy, MII_BMCR); 154 ctl = phy_read(phy, MII_BMCR);
122 if (ctl < 0) 155 if (ctl < 0)
123 return ctl; 156 return ctl;
124 ctl &= ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_ANENABLE); 157 ctl &= ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_ANENABLE | BMCR_SPEED1000);
125
126 /* First reset the PHY */
127 phy_write(phy, MII_BMCR, ctl | BMCR_RESET);
128 158
129 /* Select speed & duplex */ 159 /* Select speed & duplex */
130 switch (speed) { 160 switch (speed) {
diff --git a/drivers/net/ibm_emac/ibm_emac_rgmii.c b/drivers/net/ibm_emac/ibm_emac_rgmii.c
index 53d281cb9a1..9dbb5e5936c 100644
--- a/drivers/net/ibm_emac/ibm_emac_rgmii.c
+++ b/drivers/net/ibm_emac/ibm_emac_rgmii.c
@@ -162,7 +162,7 @@ void rgmii_set_speed(struct ocp_device *ocpdev, int input, int speed)
162 out_be32(&dev->base->ssr, ssr); 162 out_be32(&dev->base->ssr, ssr);
163} 163}
164 164
165void __exit __rgmii_fini(struct ocp_device *ocpdev, int input) 165void __rgmii_fini(struct ocp_device *ocpdev, int input)
166{ 166{
167 struct ibm_ocp_rgmii *dev = ocp_get_drvdata(ocpdev); 167 struct ibm_ocp_rgmii *dev = ocp_get_drvdata(ocpdev);
168 BUG_ON(!dev || dev->users == 0); 168 BUG_ON(!dev || dev->users == 0);
diff --git a/drivers/net/ibm_emac/ibm_emac_rgmii.h b/drivers/net/ibm_emac/ibm_emac_rgmii.h
index 117ea486c2c..971e45815c6 100644
--- a/drivers/net/ibm_emac/ibm_emac_rgmii.h
+++ b/drivers/net/ibm_emac/ibm_emac_rgmii.h
@@ -37,7 +37,7 @@ struct ibm_ocp_rgmii {
37#ifdef CONFIG_IBM_EMAC_RGMII 37#ifdef CONFIG_IBM_EMAC_RGMII
38int rgmii_attach(void *emac) __init; 38int rgmii_attach(void *emac) __init;
39 39
40void __rgmii_fini(struct ocp_device *ocpdev, int input) __exit; 40void __rgmii_fini(struct ocp_device *ocpdev, int input);
41static inline void rgmii_fini(struct ocp_device *ocpdev, int input) 41static inline void rgmii_fini(struct ocp_device *ocpdev, int input)
42{ 42{
43 if (ocpdev) 43 if (ocpdev)
diff --git a/drivers/net/ibm_emac/ibm_emac_tah.c b/drivers/net/ibm_emac/ibm_emac_tah.c
index e287b451bb4..3c2d5ba522a 100644
--- a/drivers/net/ibm_emac/ibm_emac_tah.c
+++ b/drivers/net/ibm_emac/ibm_emac_tah.c
@@ -63,7 +63,7 @@ int __init tah_attach(void *emac)
63 return 0; 63 return 0;
64} 64}
65 65
66void __exit __tah_fini(struct ocp_device *ocpdev) 66void __tah_fini(struct ocp_device *ocpdev)
67{ 67{
68 struct tah_regs *p = ocp_get_drvdata(ocpdev); 68 struct tah_regs *p = ocp_get_drvdata(ocpdev);
69 BUG_ON(!p); 69 BUG_ON(!p);
diff --git a/drivers/net/ibm_emac/ibm_emac_tah.h b/drivers/net/ibm_emac/ibm_emac_tah.h
index 38153945a24..ccf64915e1e 100644
--- a/drivers/net/ibm_emac/ibm_emac_tah.h
+++ b/drivers/net/ibm_emac/ibm_emac_tah.h
@@ -55,7 +55,7 @@ struct tah_regs {
55#ifdef CONFIG_IBM_EMAC_TAH 55#ifdef CONFIG_IBM_EMAC_TAH
56int tah_attach(void *emac) __init; 56int tah_attach(void *emac) __init;
57 57
58void __tah_fini(struct ocp_device *ocpdev) __exit; 58void __tah_fini(struct ocp_device *ocpdev);
59static inline void tah_fini(struct ocp_device *ocpdev) 59static inline void tah_fini(struct ocp_device *ocpdev)
60{ 60{
61 if (ocpdev) 61 if (ocpdev)
diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.c b/drivers/net/ibm_emac/ibm_emac_zmii.c
index 37dc8f34286..2c0fdb0cabf 100644
--- a/drivers/net/ibm_emac/ibm_emac_zmii.c
+++ b/drivers/net/ibm_emac/ibm_emac_zmii.c
@@ -215,7 +215,7 @@ void __zmii_set_speed(struct ocp_device *ocpdev, int input, int speed)
215 out_be32(&dev->base->ssr, ssr); 215 out_be32(&dev->base->ssr, ssr);
216} 216}
217 217
218void __exit __zmii_fini(struct ocp_device *ocpdev, int input) 218void __zmii_fini(struct ocp_device *ocpdev, int input)
219{ 219{
220 struct ibm_ocp_zmii *dev = ocp_get_drvdata(ocpdev); 220 struct ibm_ocp_zmii *dev = ocp_get_drvdata(ocpdev);
221 BUG_ON(!dev || dev->users == 0); 221 BUG_ON(!dev || dev->users == 0);
diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.h b/drivers/net/ibm_emac/ibm_emac_zmii.h
index 972e3a44a09..fad6d8bf983 100644
--- a/drivers/net/ibm_emac/ibm_emac_zmii.h
+++ b/drivers/net/ibm_emac/ibm_emac_zmii.h
@@ -40,7 +40,7 @@ struct ibm_ocp_zmii {
40#ifdef CONFIG_IBM_EMAC_ZMII 40#ifdef CONFIG_IBM_EMAC_ZMII
41int zmii_attach(void *emac) __init; 41int zmii_attach(void *emac) __init;
42 42
43void __zmii_fini(struct ocp_device *ocpdev, int input) __exit; 43void __zmii_fini(struct ocp_device *ocpdev, int input);
44static inline void zmii_fini(struct ocp_device *ocpdev, int input) 44static inline void zmii_fini(struct ocp_device *ocpdev, int input)
45{ 45{
46 if (ocpdev) 46 if (ocpdev)
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index c8e90861f86..3569d5b0338 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -193,8 +193,6 @@ struct ixgb_adapter {
193 u16 msg_enable; 193 u16 msg_enable;
194 struct ixgb_hw_stats stats; 194 struct ixgb_hw_stats stats;
195 uint32_t alloc_rx_buff_failed; 195 uint32_t alloc_rx_buff_failed;
196#ifdef CONFIG_PCI_MSI
197 boolean_t have_msi; 196 boolean_t have_msi;
198#endif
199}; 197};
200#endif /* _IXGB_H_ */ 198#endif /* _IXGB_H_ */
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 6d2b059371f..991c8833e23 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -227,7 +227,7 @@ int
227ixgb_up(struct ixgb_adapter *adapter) 227ixgb_up(struct ixgb_adapter *adapter)
228{ 228{
229 struct net_device *netdev = adapter->netdev; 229 struct net_device *netdev = adapter->netdev;
230 int err; 230 int err, irq_flags = IRQF_SHARED;
231 int max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; 231 int max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
232 struct ixgb_hw *hw = &adapter->hw; 232 struct ixgb_hw *hw = &adapter->hw;
233 233
@@ -246,26 +246,21 @@ ixgb_up(struct ixgb_adapter *adapter)
246 /* disable interrupts and get the hardware into a known state */ 246 /* disable interrupts and get the hardware into a known state */
247 IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff); 247 IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff);
248 248
249#ifdef CONFIG_PCI_MSI 249 /* only enable MSI if bus is in PCI-X mode */
250 { 250 if (IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_PCIX_MODE) {
251 boolean_t pcix = (IXGB_READ_REG(&adapter->hw, STATUS) & 251 err = pci_enable_msi(adapter->pdev);
252 IXGB_STATUS_PCIX_MODE) ? TRUE : FALSE; 252 if (!err) {
253 adapter->have_msi = TRUE; 253 adapter->have_msi = 1;
254 254 irq_flags = 0;
255 if (!pcix) 255 }
256 adapter->have_msi = FALSE;
257 else if((err = pci_enable_msi(adapter->pdev))) {
258 DPRINTK(PROBE, ERR,
259 "Unable to allocate MSI interrupt Error: %d\n", err);
260 adapter->have_msi = FALSE;
261 /* proceed to try to request regular interrupt */ 256 /* proceed to try to request regular interrupt */
262 } 257 }
263 }
264 258
265#endif 259 err = request_irq(adapter->pdev->irq, &ixgb_intr, irq_flags,
266 if((err = request_irq(adapter->pdev->irq, &ixgb_intr, 260 netdev->name, netdev);
267 IRQF_SHARED | IRQF_SAMPLE_RANDOM, 261 if (err) {
268 netdev->name, netdev))) { 262 if (adapter->have_msi)
263 pci_disable_msi(adapter->pdev);
269 DPRINTK(PROBE, ERR, 264 DPRINTK(PROBE, ERR,
270 "Unable to allocate interrupt Error: %d\n", err); 265 "Unable to allocate interrupt Error: %d\n", err);
271 return err; 266 return err;
@@ -307,11 +302,10 @@ ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog)
307 302
308 ixgb_irq_disable(adapter); 303 ixgb_irq_disable(adapter);
309 free_irq(adapter->pdev->irq, netdev); 304 free_irq(adapter->pdev->irq, netdev);
310#ifdef CONFIG_PCI_MSI 305
311 if(adapter->have_msi == TRUE) 306 if (adapter->have_msi)
312 pci_disable_msi(adapter->pdev); 307 pci_disable_msi(adapter->pdev);
313 308
314#endif
315 if(kill_watchdog) 309 if(kill_watchdog)
316 del_timer_sync(&adapter->watchdog_timer); 310 del_timer_sync(&adapter->watchdog_timer);
317#ifdef CONFIG_IXGB_NAPI 311#ifdef CONFIG_IXGB_NAPI
diff --git a/drivers/net/meth.c b/drivers/net/meth.c
index 0343ea12b29..92b403bf38b 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 dfbd5809d74..f8d63d39f59 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 c4271731366..cfa5cc07233 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/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index cf0e96adfe4..a3689245776 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -1216,7 +1216,7 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max)
1216 /* Window = 1 */ 1216 /* Window = 1 */
1217 writel(consumer, 1217 writel(consumer,
1218 NETXEN_CRB_NORMALIZE(adapter, 1218 NETXEN_CRB_NORMALIZE(adapter,
1219 recv_crb_registers[ctxid]. 1219 recv_crb_registers[adapter->portnum].
1220 crb_rcv_status_consumer)); 1220 crb_rcv_status_consumer));
1221 } 1221 }
1222 1222
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 68c99b4c525..bb966911a13 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/sky2.c b/drivers/net/sky2.c
index 104e20456e6..adfbe81693a 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -40,7 +40,6 @@
40#include <linux/if_vlan.h> 40#include <linux/if_vlan.h>
41#include <linux/prefetch.h> 41#include <linux/prefetch.h>
42#include <linux/mii.h> 42#include <linux/mii.h>
43#include <linux/dmi.h>
44 43
45#include <asm/irq.h> 44#include <asm/irq.h>
46 45
@@ -151,8 +150,6 @@ static const char *yukon2_name[] = {
151 "FE", /* 0xb7 */ 150 "FE", /* 0xb7 */
152}; 151};
153 152
154static int dmi_blacklisted;
155
156/* Access to external PHY */ 153/* Access to external PHY */
157static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) 154static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val)
158{ 155{
@@ -307,10 +304,13 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
307 PHY_M_EC_MAC_S_MSK); 304 PHY_M_EC_MAC_S_MSK);
308 ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ); 305 ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ);
309 306
307 /* on PHY 88E1040 Rev.D0 (and newer) downshift control changed */
310 if (hw->chip_id == CHIP_ID_YUKON_EC) 308 if (hw->chip_id == CHIP_ID_YUKON_EC)
309 /* set downshift counter to 3x and enable downshift */
311 ectrl |= PHY_M_EC_DSC_2(2) | PHY_M_EC_DOWN_S_ENA; 310 ectrl |= PHY_M_EC_DSC_2(2) | PHY_M_EC_DOWN_S_ENA;
312 else 311 else
313 ectrl |= PHY_M_EC_M_DSC(2) | PHY_M_EC_S_DSC(3); 312 /* set master & slave downshift counter to 1x */
313 ectrl |= PHY_M_EC_M_DSC(0) | PHY_M_EC_S_DSC(1);
314 314
315 gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl); 315 gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl);
316 } 316 }
@@ -327,10 +327,12 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
327 /* enable automatic crossover */ 327 /* enable automatic crossover */
328 ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO); 328 ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO);
329 329
330 /* downshift on PHY 88E1112 and 88E1149 is changed */
330 if (sky2->autoneg == AUTONEG_ENABLE 331 if (sky2->autoneg == AUTONEG_ENABLE
331 && (hw->chip_id == CHIP_ID_YUKON_XL 332 && (hw->chip_id == CHIP_ID_YUKON_XL
332 || hw->chip_id == CHIP_ID_YUKON_EC_U 333 || hw->chip_id == CHIP_ID_YUKON_EC_U
333 || hw->chip_id == CHIP_ID_YUKON_EX)) { 334 || hw->chip_id == CHIP_ID_YUKON_EX)) {
335 /* set downshift counter to 3x and enable downshift */
334 ctrl &= ~PHY_M_PC_DSC_MSK; 336 ctrl &= ~PHY_M_PC_DSC_MSK;
335 ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA; 337 ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA;
336 } 338 }
@@ -362,7 +364,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
362 /* for SFP-module set SIGDET polarity to low */ 364 /* for SFP-module set SIGDET polarity to low */
363 ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL); 365 ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
364 ctrl |= PHY_M_FIB_SIGD_POL; 366 ctrl |= PHY_M_FIB_SIGD_POL;
365 gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); 367 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ctrl);
366 } 368 }
367 369
368 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); 370 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
@@ -656,7 +658,7 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
656 const u8 *addr = hw->dev[port]->dev_addr; 658 const u8 *addr = hw->dev[port]->dev_addr;
657 659
658 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); 660 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET);
659 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);
660 662
661 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR); 663 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR);
662 664
@@ -842,10 +844,12 @@ static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2,
842/* Update chip's next pointer */ 844/* Update chip's next pointer */
843static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q, u16 idx) 845static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q, u16 idx)
844{ 846{
845 q = Y2_QADDR(q, PREF_UNIT_PUT_IDX); 847 /* Make sure write' to descriptors are complete before we tell hardware */
846 wmb(); 848 wmb();
847 sky2_write16(hw, q, idx); 849 sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), idx);
848 sky2_read16(hw, q); 850
851 /* Synchronize I/O on since next processor may write to tail */
852 mmiowb();
849} 853}
850 854
851 855
@@ -977,6 +981,7 @@ stopped:
977 981
978 /* reset the Rx prefetch unit */ 982 /* reset the Rx prefetch unit */
979 sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); 983 sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET);
984 mmiowb();
980} 985}
981 986
982/* Clean out receive buffer area, assumes receiver hardware stopped */ 987/* Clean out receive buffer area, assumes receiver hardware stopped */
@@ -1196,7 +1201,7 @@ static int sky2_rx_start(struct sky2_port *sky2)
1196 } 1201 }
1197 1202
1198 /* Tell chip about available buffers */ 1203 /* Tell chip about available buffers */
1199 sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); 1204 sky2_put_idx(hw, rxq, sky2->rx_put);
1200 return 0; 1205 return 0;
1201nomem: 1206nomem:
1202 sky2_rx_clean(sky2); 1207 sky2_rx_clean(sky2);
@@ -1427,7 +1432,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1427 tcpsum = offset << 16; /* sum start */ 1432 tcpsum = offset << 16; /* sum start */
1428 tcpsum |= offset + skb->csum_offset; /* sum write */ 1433 tcpsum |= offset + skb->csum_offset; /* sum write */
1429 1434
1430 ctrl = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM; 1435 ctrl |= CALSUM | WR_SUM | INIT_SUM | LOCK_SUM;
1431 if (ip_hdr(skb)->protocol == IPPROTO_UDP) 1436 if (ip_hdr(skb)->protocol == IPPROTO_UDP)
1432 ctrl |= UDPTCP; 1437 ctrl |= UDPTCP;
1433 1438
@@ -1538,6 +1543,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
1538 } 1543 }
1539 1544
1540 sky2->tx_cons = idx; 1545 sky2->tx_cons = idx;
1546 smp_mb();
1547
1541 if (tx_avail(sky2) > MAX_SKB_TX_LE + 4) 1548 if (tx_avail(sky2) > MAX_SKB_TX_LE + 4)
1542 netif_wake_queue(dev); 1549 netif_wake_queue(dev);
1543} 1550}
@@ -1577,13 +1584,6 @@ static int sky2_down(struct net_device *dev)
1577 imask &= ~portirq_msk[port]; 1584 imask &= ~portirq_msk[port];
1578 sky2_write32(hw, B0_IMSK, imask); 1585 sky2_write32(hw, B0_IMSK, imask);
1579 1586
1580 /*
1581 * Both ports share the NAPI poll on port 0, so if necessary undo the
1582 * the disable that is done in dev_close.
1583 */
1584 if (sky2->port == 0 && hw->ports > 1)
1585 netif_poll_enable(dev);
1586
1587 sky2_gmac_reset(hw, port); 1587 sky2_gmac_reset(hw, port);
1588 1588
1589 /* Stop transmitter */ 1589 /* Stop transmitter */
@@ -2139,8 +2139,10 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
2139 switch (le->opcode & ~HW_OWNER) { 2139 switch (le->opcode & ~HW_OWNER) {
2140 case OP_RXSTAT: 2140 case OP_RXSTAT:
2141 skb = sky2_receive(dev, length, status); 2141 skb = sky2_receive(dev, length, status);
2142 if (!skb) 2142 if (unlikely(!skb)) {
2143 sky2->net_stats.rx_dropped++;
2143 goto force_update; 2144 goto force_update;
2145 }
2144 2146
2145 skb->protocol = eth_type_trans(skb, dev); 2147 skb->protocol = eth_type_trans(skb, dev);
2146 sky2->net_stats.rx_packets++; 2148 sky2->net_stats.rx_packets++;
@@ -2221,6 +2223,7 @@ force_update:
2221 2223
2222 /* Fully processed status ring so clear irq */ 2224 /* Fully processed status ring so clear irq */
2223 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); 2225 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
2226 mmiowb();
2224 2227
2225exit_loop: 2228exit_loop:
2226 if (buf_write[0]) { 2229 if (buf_write[0]) {
@@ -2341,6 +2344,12 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port)
2341 printk(KERN_INFO PFX "%s: mac interrupt status 0x%x\n", 2344 printk(KERN_INFO PFX "%s: mac interrupt status 0x%x\n",
2342 dev->name, status); 2345 dev->name, status);
2343 2346
2347 if (status & GM_IS_RX_CO_OV)
2348 gma_read16(hw, port, GM_RX_IRQ_SRC);
2349
2350 if (status & GM_IS_TX_CO_OV)
2351 gma_read16(hw, port, GM_TX_IRQ_SRC);
2352
2344 if (status & GM_IS_RX_FF_OR) { 2353 if (status & GM_IS_RX_FF_OR) {
2345 ++sky2->net_stats.rx_fifo_errors; 2354 ++sky2->net_stats.rx_fifo_errors;
2346 sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO); 2355 sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO);
@@ -2439,6 +2448,7 @@ static int sky2_poll(struct net_device *dev0, int *budget)
2439 if (work_done < work_limit) { 2448 if (work_done < work_limit) {
2440 netif_rx_complete(dev0); 2449 netif_rx_complete(dev0);
2441 2450
2451 /* end of interrupt, re-enables also acts as I/O synchronization */
2442 sky2_read32(hw, B0_Y2_SP_LISR); 2452 sky2_read32(hw, B0_Y2_SP_LISR);
2443 return 0; 2453 return 0;
2444 } else { 2454 } else {
@@ -2534,17 +2544,6 @@ static int __devinit sky2_init(struct sky2_hw *hw)
2534 return -EOPNOTSUPP; 2544 return -EOPNOTSUPP;
2535 } 2545 }
2536 2546
2537
2538 /* Some Gigabyte motherboards have 88e8056 but cause problems
2539 * There is some unresolved hardware related problem that causes
2540 * descriptor errors and receive data corruption.
2541 */
2542 if (hw->chip_id == CHIP_ID_YUKON_EC_U && dmi_blacklisted) {
2543 dev_err(&hw->pdev->dev,
2544 "88E8056 on this motherboard not supported\n");
2545 return -EOPNOTSUPP;
2546 }
2547
2548 hw->pmd_type = sky2_read8(hw, B2_PMD_TYP); 2547 hw->pmd_type = sky2_read8(hw, B2_PMD_TYP);
2549 hw->ports = 1; 2548 hw->ports = 1;
2550 t8 = sky2_read8(hw, B2_Y2_HW_RES); 2549 t8 = sky2_read8(hw, B2_Y2_HW_RES);
@@ -3910,24 +3909,8 @@ static struct pci_driver sky2_driver = {
3910 .shutdown = sky2_shutdown, 3909 .shutdown = sky2_shutdown,
3911}; 3910};
3912 3911
3913static struct dmi_system_id __initdata broken_dmi_table[] = {
3914 {
3915 .ident = "Gigabyte 965P-S3",
3916 .matches = {
3917 DMI_MATCH(DMI_SYS_VENDOR, "Gigabyte Technology Co., Ltd."),
3918 DMI_MATCH(DMI_PRODUCT_NAME, "965P-S3"),
3919
3920 },
3921 },
3922 { }
3923};
3924
3925static int __init sky2_init_module(void) 3912static int __init sky2_init_module(void)
3926{ 3913{
3927 /* Look for sick motherboards */
3928 if (dmi_check_system(broken_dmi_table))
3929 dmi_blacklisted = 1;
3930
3931 return pci_register_driver(&sky2_driver); 3914 return pci_register_driver(&sky2_driver);
3932} 3915}
3933 3916
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 5efb5afc45b..b8c4a3b5ead 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 108adbf5b5e..ef84d7c757a 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -430,7 +430,8 @@ spider_net_prepare_rx_descr(struct spider_net_card *card,
430 /* and we need to have it 128 byte aligned, therefore we allocate a 430 /* and we need to have it 128 byte aligned, therefore we allocate a
431 * bit more */ 431 * bit more */
432 /* allocate an skb */ 432 /* allocate an skb */
433 descr->skb = dev_alloc_skb(bufsize + SPIDER_NET_RXBUF_ALIGN - 1); 433 descr->skb = netdev_alloc_skb(card->netdev,
434 bufsize + SPIDER_NET_RXBUF_ALIGN - 1);
434 if (!descr->skb) { 435 if (!descr->skb) {
435 if (netif_msg_rx_err(card) && net_ratelimit()) 436 if (netif_msg_rx_err(card) && net_ratelimit())
436 pr_err("Not enough memory to allocate rx buffer\n"); 437 pr_err("Not enough memory to allocate rx buffer\n");
@@ -1013,12 +1014,12 @@ spider_net_pass_skb_up(struct spider_net_descr *descr,
1013 */ 1014 */
1014 } 1015 }
1015 1016
1016 /* pass skb up to stack */
1017 netif_receive_skb(skb);
1018
1019 /* update netdevice statistics */ 1017 /* update netdevice statistics */
1020 card->netdev_stats.rx_packets++; 1018 card->netdev_stats.rx_packets++;
1021 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);
1022} 1023}
1023 1024
1024#ifdef DEBUG 1025#ifdef DEBUG
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
index 99c4c1922f1..e6b2e06493e 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 c2ccbd098f5..18b731bb4da 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 f96966d4bcc..7bcb82f50cf 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 d5ef97bc4d0..6d95cacd528 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 5a21f06bf8a..675ac99a79c 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 980e4aaa97a..cd991a0f75b 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 f9cd42d058b..5b16d9a1269 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 82db5a8e528..a3f8b9e7bc0 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 246fac0e800..3df3c60263d 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 606bdd002be..dfe27642322 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 441123c85e6..5c63c9b1659 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 d17924f764e..96619a32951 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 dd070cccf32..f49eb068c7d 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 78c2e6e4b42..edd6de99572 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/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 02c0d52c9f7..7bfbad57879 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -51,6 +51,7 @@
51#include <linux/ioport.h> 51#include <linux/ioport.h>
52#include <linux/kernel.h> 52#include <linux/kernel.h>
53#include <linux/slab.h> 53#include <linux/slab.h>
54#include <linux/dma-mapping.h>
54#include <linux/pci.h> 55#include <linux/pci.h>
55#include <linux/pnp.h> 56#include <linux/pnp.h>
56#include <linux/platform_device.h> 57#include <linux/platform_device.h>
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c
index 46abaa8c41f..d06ccb69e41 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/pcie/aer/aerdrv.h b/drivers/pci/pcie/aer/aerdrv.h
index bf655dbaf8e..5cca394d599 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/rtc/Kconfig b/drivers/rtc/Kconfig
index 95ce8f49e38..4e4c10a7fd3 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -59,7 +59,7 @@ comment "RTC interfaces"
59 depends on RTC_CLASS 59 depends on RTC_CLASS
60 60
61config RTC_INTF_SYSFS 61config RTC_INTF_SYSFS
62 boolean "sysfs" 62 boolean "/sys/class/rtc/rtcN (sysfs)"
63 depends on RTC_CLASS && SYSFS 63 depends on RTC_CLASS && SYSFS
64 default RTC_CLASS 64 default RTC_CLASS
65 help 65 help
@@ -70,7 +70,7 @@ config RTC_INTF_SYSFS
70 will be called rtc-sysfs. 70 will be called rtc-sysfs.
71 71
72config RTC_INTF_PROC 72config RTC_INTF_PROC
73 boolean "proc" 73 boolean "/proc/driver/rtc (procfs for rtc0)"
74 depends on RTC_CLASS && PROC_FS 74 depends on RTC_CLASS && PROC_FS
75 default RTC_CLASS 75 default RTC_CLASS
76 help 76 help
@@ -82,7 +82,7 @@ config RTC_INTF_PROC
82 will be called rtc-proc. 82 will be called rtc-proc.
83 83
84config RTC_INTF_DEV 84config RTC_INTF_DEV
85 boolean "dev" 85 boolean "/dev/rtcN (character devices)"
86 depends on RTC_CLASS 86 depends on RTC_CLASS
87 default RTC_CLASS 87 default RTC_CLASS
88 help 88 help
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 60a8a4bb8bd..a2f84f16958 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -371,7 +371,7 @@ static int __devinit omap_rtc_probe(struct platform_device *pdev)
371 goto fail; 371 goto fail;
372 } 372 }
373 platform_set_drvdata(pdev, rtc); 373 platform_set_drvdata(pdev, rtc);
374 dev_set_devdata(&rtc->dev, mem); 374 dev_set_drvdata(&rtc->dev, mem);
375 375
376 /* clear pending irqs, and set 1/second periodic, 376 /* clear pending irqs, and set 1/second periodic,
377 * which we'll use instead of update irqs 377 * which we'll use instead of update irqs
@@ -453,7 +453,7 @@ static int __devexit omap_rtc_remove(struct platform_device *pdev)
453 free_irq(omap_rtc_timer, rtc); 453 free_irq(omap_rtc_timer, rtc);
454 free_irq(omap_rtc_alarm, rtc); 454 free_irq(omap_rtc_alarm, rtc);
455 455
456 release_resource(dev_get_devdata(&rtc->dev)); 456 release_resource(dev_get_drvdata(&rtc->dev));
457 rtc_device_unregister(rtc); 457 rtc_device_unregister(rtc);
458 return 0; 458 return 0;
459} 459}
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index ddff40c4212..821cde65e36 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 81680efa172..1c8f71a5985 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 a8b02542ac2..0eb31e162b1 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 16e2d64658a..0acf6db0a08 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/scsi/Kconfig b/drivers/scsi/Kconfig
index d6510ef0303..aac9cd9a172 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 51cba91cd22..cba39679f94 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -103,8 +103,7 @@ obj-$(CONFIG_MEGARAID_LEGACY) += megaraid.o
103obj-$(CONFIG_MEGARAID_NEWGEN) += megaraid/ 103obj-$(CONFIG_MEGARAID_NEWGEN) += megaraid/
104obj-$(CONFIG_MEGARAID_SAS) += megaraid/ 104obj-$(CONFIG_MEGARAID_SAS) += megaraid/
105obj-$(CONFIG_SCSI_ACARD) += atp870u.o 105obj-$(CONFIG_SCSI_ACARD) += atp870u.o
106obj-$(CONFIG_SCSI_ESP_CORE) += esp_scsi.o 106obj-$(CONFIG_SCSI_SUNESP) += esp_scsi.o sun_esp.o
107obj-$(CONFIG_SCSI_SUNESP) += sun_esp.o
108obj-$(CONFIG_SCSI_GDTH) += gdth.o 107obj-$(CONFIG_SCSI_GDTH) += gdth.o
109obj-$(CONFIG_SCSI_INITIO) += initio.o 108obj-$(CONFIG_SCSI_INITIO) += initio.o
110obj-$(CONFIG_SCSI_INIA100) += a100u2w.o 109obj-$(CONFIG_SCSI_INIA100) += a100u2w.o
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index a333e62fc48..47014beef96 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 a3138ee9105..fdbedb17d03 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1826,9 +1826,12 @@ int aac_send_shutdown(struct aac_dev *dev);
1826int aac_probe_container(struct aac_dev *dev, int cid); 1826int aac_probe_container(struct aac_dev *dev, int cid);
1827int _aac_rx_init(struct aac_dev *dev); 1827int _aac_rx_init(struct aac_dev *dev);
1828int aac_rx_select_comm(struct aac_dev *dev, int comm); 1828int aac_rx_select_comm(struct aac_dev *dev, int comm);
1829int aac_rx_deliver_producer(struct fib * fib);
1829extern int numacb; 1830extern int numacb;
1830extern int acbsize; 1831extern int acbsize;
1831extern char aac_driver_version[]; 1832extern char aac_driver_version[];
1832extern int startup_timeout; 1833extern int startup_timeout;
1833extern int aif_timeout; 1834extern int aif_timeout;
1834extern int expose_physicals; 1835extern int expose_physicals;
1836extern int aac_reset_devices;
1837extern int aac_commit;
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index 291cd14f4e9..ae978a373c5 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 f4b5e9742ab..85b91bc578c 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/aicasm/aicasm_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
index c328596def3..6066998ed56 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 439f760b34b..ff46aa6801b 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 9a14a6d9727..c0d0b7d7a8c 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 6411c458d33..072f5771565 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3928,6 +3928,13 @@ static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
3928 spin_unlock_irq(scsi_cmd->device->host->host_lock); 3928 spin_unlock_irq(scsi_cmd->device->host->host_lock);
3929 ata_do_eh(ap, NULL, NULL, ipr_sata_reset, NULL); 3929 ata_do_eh(ap, NULL, NULL, ipr_sata_reset, NULL);
3930 spin_lock_irq(scsi_cmd->device->host->host_lock); 3930 spin_lock_irq(scsi_cmd->device->host->host_lock);
3931
3932 list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) {
3933 if (ipr_cmd->ioarcb.res_handle == res->cfgte.res_handle) {
3934 rc = -EIO;
3935 break;
3936 }
3937 }
3931 } else 3938 } else
3932 rc = ipr_device_reset(ioa_cfg, res); 3939 rc = ipr_device_reset(ioa_cfg, res);
3933 res->resetting_device = 0; 3940 res->resetting_device = 0;
diff --git a/drivers/scsi/libsrp.c b/drivers/scsi/libsrp.c
index 5631c199a8e..732446e6396 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 e075a52ac10..84d9c27133d 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 7a812677ff8..e2cf12ef368 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 e862992ee37..4dffc918a41 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 3b2e1a53e6e..d953d43fe2e 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 ce63044b1ec..18dd5cc4d7c 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 f071b9edaf3..448d316f12d 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 baf516d09d7..adda296b594 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,
@@ -561,7 +558,7 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
561 u16 tag; 558 u16 tag;
562 host = cmd->device->host; 559 host = cmd->device->host;
563 id = cmd->device->id; 560 id = cmd->device->id;
564 lun = cmd->device->channel; /* firmware lun issue work around */ 561 lun = cmd->device->lun;
565 hba = (struct st_hba *) &host->hostdata[0]; 562 hba = (struct st_hba *) &host->hostdata[0];
566 563
567 switch (cmd->cmnd[0]) { 564 switch (cmd->cmnd[0]) {
@@ -580,8 +577,26 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
580 stex_invalid_field(cmd, done); 577 stex_invalid_field(cmd, done);
581 return 0; 578 return 0;
582 } 579 }
580 case REPORT_LUNS:
581 /*
582 * The shasta firmware does not report actual luns in the
583 * target, so fail the command to force sequential lun scan.
584 * Also, the console device does not support this command.
585 */
586 if (hba->cardtype == st_shasta || id == host->max_id - 1) {
587 stex_invalid_field(cmd, done);
588 return 0;
589 }
590 break;
591 case TEST_UNIT_READY:
592 if (id == host->max_id - 1) {
593 cmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
594 done(cmd);
595 return 0;
596 }
597 break;
583 case INQUIRY: 598 case INQUIRY:
584 if (id != ST_MAX_ARRAY_SUPPORTED) 599 if (id != host->max_id - 1)
585 break; 600 break;
586 if (lun == 0 && (cmd->cmnd[1] & INQUIRY_EVPD) == 0) { 601 if (lun == 0 && (cmd->cmnd[1] & INQUIRY_EVPD) == 0) {
587 stex_direct_copy(cmd, console_inq_page, 602 stex_direct_copy(cmd, console_inq_page,
@@ -599,7 +614,7 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
599 ver.oem = ST_OEM; 614 ver.oem = ST_OEM;
600 ver.build = ST_BUILD_VER; 615 ver.build = ST_BUILD_VER;
601 ver.signature[0] = PASSTHRU_SIGNATURE; 616 ver.signature[0] = PASSTHRU_SIGNATURE;
602 ver.console_id = ST_MAX_ARRAY_SUPPORTED; 617 ver.console_id = host->max_id - 1;
603 ver.host_no = hba->host->host_no; 618 ver.host_no = hba->host->host_no;
604 cmd->result = stex_direct_copy(cmd, &ver, sizeof(ver)) ? 619 cmd->result = stex_direct_copy(cmd, &ver, sizeof(ver)) ?
605 DID_OK << 16 | COMMAND_COMPLETE << 8 : 620 DID_OK << 16 | COMMAND_COMPLETE << 8 :
@@ -620,13 +635,8 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
620 635
621 req = stex_alloc_req(hba); 636 req = stex_alloc_req(hba);
622 637
623 if (hba->cardtype == st_yosemite) { 638 req->lun = lun;
624 req->lun = lun * (ST_MAX_TARGET_NUM - 1) + id; 639 req->target = id;
625 req->target = 0;
626 } else {
627 req->lun = lun;
628 req->target = id;
629 }
630 640
631 /* cdb */ 641 /* cdb */
632 memcpy(req->cdb, cmd->cmnd, STEX_CDB_LENGTH); 642 memcpy(req->cdb, cmd->cmnd, STEX_CDB_LENGTH);
@@ -730,18 +740,6 @@ static void stex_ys_commands(struct st_hba *hba,
730 ccb->srb_status = SRB_STATUS_SELECTION_TIMEOUT; 740 ccb->srb_status = SRB_STATUS_SELECTION_TIMEOUT;
731 else 741 else
732 ccb->srb_status = SRB_STATUS_SUCCESS; 742 ccb->srb_status = SRB_STATUS_SUCCESS;
733 } else if (ccb->cmd->cmnd[0] == REPORT_LUNS) {
734 u8 *report_lun_data = (u8 *)hba->copy_buffer;
735
736 count = STEX_EXTRA_SIZE;
737 stex_internal_copy(ccb->cmd, report_lun_data,
738 &count, ccb->sg_count, ST_FROM_CMD);
739 if (report_lun_data[2] || report_lun_data[3]) {
740 report_lun_data[2] = 0x00;
741 report_lun_data[3] = 0x08;
742 stex_internal_copy(ccb->cmd, report_lun_data,
743 &count, ccb->sg_count, ST_TO_CMD);
744 }
745 } 743 }
746} 744}
747 745
@@ -958,6 +956,11 @@ static int stex_abort(struct scsi_cmnd *cmd)
958 u32 data; 956 u32 data;
959 int result = SUCCESS; 957 int result = SUCCESS;
960 unsigned long flags; 958 unsigned long flags;
959
960 printk(KERN_INFO DRV_NAME
961 "(%s): aborting command\n", pci_name(hba->pdev));
962 scsi_print_command(cmd);
963
961 base = hba->mmio_base; 964 base = hba->mmio_base;
962 spin_lock_irqsave(host->host_lock, flags); 965 spin_lock_irqsave(host->host_lock, flags);
963 if (tag < host->can_queue && hba->ccb[tag].cmd == cmd) 966 if (tag < host->can_queue && hba->ccb[tag].cmd == cmd)
@@ -1014,7 +1017,12 @@ static void stex_hard_reset(struct st_hba *hba)
1014 pci_read_config_byte(bus->self, PCI_BRIDGE_CONTROL, &pci_bctl); 1017 pci_read_config_byte(bus->self, PCI_BRIDGE_CONTROL, &pci_bctl);
1015 pci_bctl |= PCI_BRIDGE_CTL_BUS_RESET; 1018 pci_bctl |= PCI_BRIDGE_CTL_BUS_RESET;
1016 pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl); 1019 pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl);
1017 msleep(1); 1020
1021 /*
1022 * 1 ms may be enough for 8-port controllers. But 16-port controllers
1023 * require more time to finish bus reset. Use 100 ms here for safety
1024 */
1025 msleep(100);
1018 pci_bctl &= ~PCI_BRIDGE_CTL_BUS_RESET; 1026 pci_bctl &= ~PCI_BRIDGE_CTL_BUS_RESET;
1019 pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl); 1027 pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl);
1020 1028
@@ -1038,6 +1046,10 @@ static int stex_reset(struct scsi_cmnd *cmd)
1038 unsigned long before; 1046 unsigned long before;
1039 hba = (struct st_hba *) &cmd->device->host->hostdata[0]; 1047 hba = (struct st_hba *) &cmd->device->host->hostdata[0];
1040 1048
1049 printk(KERN_INFO DRV_NAME
1050 "(%s): resetting host\n", pci_name(hba->pdev));
1051 scsi_print_command(cmd);
1052
1041 hba->mu_status = MU_STATE_RESETTING; 1053 hba->mu_status = MU_STATE_RESETTING;
1042 1054
1043 if (hba->cardtype == st_shasta) 1055 if (hba->cardtype == st_shasta)
@@ -1157,7 +1169,7 @@ stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1157 goto out_scsi_host_put; 1169 goto out_scsi_host_put;
1158 } 1170 }
1159 1171
1160 hba->mmio_base = ioremap(pci_resource_start(pdev, 0), 1172 hba->mmio_base = ioremap_nocache(pci_resource_start(pdev, 0),
1161 pci_resource_len(pdev, 0)); 1173 pci_resource_len(pdev, 0));
1162 if ( !hba->mmio_base) { 1174 if ( !hba->mmio_base) {
1163 printk(KERN_ERR DRV_NAME "(%s): memory map failed\n", 1175 printk(KERN_ERR DRV_NAME "(%s): memory map failed\n",
@@ -1192,12 +1204,18 @@ stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1192 hba->copy_buffer = hba->dma_mem + MU_BUFFER_SIZE; 1204 hba->copy_buffer = hba->dma_mem + MU_BUFFER_SIZE;
1193 hba->mu_status = MU_STATE_STARTING; 1205 hba->mu_status = MU_STATE_STARTING;
1194 1206
1195 /* firmware uses id/lun pair for a logical drive, but lun would be 1207 if (hba->cardtype == st_shasta) {
1196 always 0 if CONFIG_SCSI_MULTI_LUN not configured, so we use 1208 host->max_lun = 8;
1197 channel to map lun here */ 1209 host->max_id = 16 + 1;
1198 host->max_channel = ST_MAX_LUN_PER_TARGET - 1; 1210 } else if (hba->cardtype == st_yosemite) {
1199 host->max_id = ST_MAX_TARGET_NUM; 1211 host->max_lun = 128;
1200 host->max_lun = 1; 1212 host->max_id = 1 + 1;
1213 } else {
1214 /* st_vsc and st_vsc1 */
1215 host->max_lun = 1;
1216 host->max_id = 128 + 1;
1217 }
1218 host->max_channel = 0;
1201 host->unique_id = host->host_no; 1219 host->unique_id = host->host_no;
1202 host->max_cmd_len = STEX_CDB_LENGTH; 1220 host->max_cmd_len = STEX_CDB_LENGTH;
1203 1221
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 48e259a0167..c84dab083a8 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -894,7 +894,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
894 quot = serial_dl_read(up); 894 quot = serial_dl_read(up);
895 quot <<= 3; 895 quot <<= 3;
896 896
897 status1 = serial_in(up, 0x04); /* EXCR1 */ 897 status1 = serial_in(up, 0x04); /* EXCR2 */
898 status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ 898 status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */
899 status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ 899 status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */
900 serial_outp(up, 0x04, status1); 900 serial_outp(up, 0x04, status1);
@@ -2617,7 +2617,22 @@ void serial8250_suspend_port(int line)
2617 */ 2617 */
2618void serial8250_resume_port(int line) 2618void serial8250_resume_port(int line)
2619{ 2619{
2620 uart_resume_port(&serial8250_reg, &serial8250_ports[line].port); 2620 struct uart_8250_port *up = &serial8250_ports[line];
2621
2622 if (up->capabilities & UART_NATSEMI) {
2623 unsigned char tmp;
2624
2625 /* Ensure it's still in high speed mode */
2626 serial_outp(up, UART_LCR, 0xE0);
2627
2628 tmp = serial_in(up, 0x04); /* EXCR2 */
2629 tmp &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */
2630 tmp |= 0x10; /* 1.625 divisor for baud_base --> 921600 */
2631 serial_outp(up, 0x04, tmp);
2632
2633 serial_outp(up, UART_LCR, 0);
2634 }
2635 uart_resume_port(&serial8250_reg, &up->port);
2621} 2636}
2622 2637
2623/* 2638/*
@@ -2694,7 +2709,7 @@ static int serial8250_resume(struct platform_device *dev)
2694 struct uart_8250_port *up = &serial8250_ports[i]; 2709 struct uart_8250_port *up = &serial8250_ports[i];
2695 2710
2696 if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) 2711 if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev)
2697 uart_resume_port(&serial8250_reg, &up->port); 2712 serial8250_resume_port(i);
2698 } 2713 }
2699 2714
2700 return 0; 2715 return 0;
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index 1a9a24b8263..00d1255e4c1 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 44639e71372..954073c6ce3 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 408390f93db..787dc7168f3 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/icom.c b/drivers/serial/icom.c
index 6202995e821..9d3105b64a7 100644
--- a/drivers/serial/icom.c
+++ b/drivers/serial/icom.c
@@ -69,33 +69,40 @@
69 69
70static const struct pci_device_id icom_pci_table[] = { 70static const struct pci_device_id icom_pci_table[] = {
71 { 71 {
72 .vendor = PCI_VENDOR_ID_IBM, 72 .vendor = PCI_VENDOR_ID_IBM,
73 .device = PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1, 73 .device = PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1,
74 .subvendor = PCI_ANY_ID, 74 .subvendor = PCI_ANY_ID,
75 .subdevice = PCI_ANY_ID, 75 .subdevice = PCI_ANY_ID,
76 .driver_data = ADAPTER_V1, 76 .driver_data = ADAPTER_V1,
77 }, 77 },
78 { 78 {
79 .vendor = PCI_VENDOR_ID_IBM, 79 .vendor = PCI_VENDOR_ID_IBM,
80 .device = PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2, 80 .device = PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2,
81 .subvendor = PCI_VENDOR_ID_IBM, 81 .subvendor = PCI_VENDOR_ID_IBM,
82 .subdevice = PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX, 82 .subdevice = PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX,
83 .driver_data = ADAPTER_V2, 83 .driver_data = ADAPTER_V2,
84 }, 84 },
85 { 85 {
86 .vendor = PCI_VENDOR_ID_IBM, 86 .vendor = PCI_VENDOR_ID_IBM,
87 .device = PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2, 87 .device = PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2,
88 .subvendor = PCI_VENDOR_ID_IBM, 88 .subvendor = PCI_VENDOR_ID_IBM,
89 .subdevice = PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM, 89 .subdevice = PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM,
90 .driver_data = ADAPTER_V2, 90 .driver_data = ADAPTER_V2,
91 }, 91 },
92 { 92 {
93 .vendor = PCI_VENDOR_ID_IBM, 93 .vendor = PCI_VENDOR_ID_IBM,
94 .device = PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2, 94 .device = PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2,
95 .subvendor = PCI_VENDOR_ID_IBM, 95 .subvendor = PCI_VENDOR_ID_IBM,
96 .subdevice = PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL, 96 .subdevice = PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL,
97 .driver_data = ADAPTER_V2, 97 .driver_data = ADAPTER_V2,
98 }, 98 },
99 {
100 .vendor = PCI_VENDOR_ID_IBM,
101 .device = PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2,
102 .subvendor = PCI_VENDOR_ID_IBM,
103 .subdevice = PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE,
104 .driver_data = ADAPTER_V2,
105 },
99 {} 106 {}
100}; 107};
101 108
diff --git a/drivers/serial/serial_ks8695.c b/drivers/serial/serial_ks8695.c
index c5346d67731..8721afe1ae4 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 e35d9ab359f..b45ba5392dd 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/sunhv.c b/drivers/serial/sunhv.c
index c3a6bd2e795..96557e6dba6 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -1,6 +1,6 @@
1/* sunhv.c: Serial driver for SUN4V hypervisor console. 1/* sunhv.c: Serial driver for SUN4V hypervisor console.
2 * 2 *
3 * Copyright (C) 2006 David S. Miller (davem@davemloft.net) 3 * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net)
4 */ 4 */
5 5
6#include <linux/module.h> 6#include <linux/module.h>
@@ -35,57 +35,51 @@
35#define CON_BREAK ((long)-1) 35#define CON_BREAK ((long)-1)
36#define CON_HUP ((long)-2) 36#define CON_HUP ((long)-2)
37 37
38static inline long hypervisor_con_getchar(long *status) 38#define IGNORE_BREAK 0x1
39{ 39#define IGNORE_ALL 0x2
40 register unsigned long func asm("%o5");
41 register unsigned long arg0 asm("%o0");
42 register unsigned long arg1 asm("%o1");
43
44 func = HV_FAST_CONS_GETCHAR;
45 arg0 = 0;
46 arg1 = 0;
47 __asm__ __volatile__("ta %6"
48 : "=&r" (func), "=&r" (arg0), "=&r" (arg1)
49 : "0" (func), "1" (arg0), "2" (arg1),
50 "i" (HV_FAST_TRAP));
51 40
52 *status = arg0; 41static char *con_write_page;
42static char *con_read_page;
53 43
54 return (long) arg1; 44static int hung_up = 0;
55}
56 45
57static inline long hypervisor_con_putchar(long ch) 46static void transmit_chars_putchar(struct uart_port *port, struct circ_buf *xmit)
58{ 47{
59 register unsigned long func asm("%o5"); 48 while (!uart_circ_empty(xmit)) {
60 register unsigned long arg0 asm("%o0"); 49 long status = sun4v_con_putchar(xmit->buf[xmit->tail]);
61 50
62 func = HV_FAST_CONS_PUTCHAR; 51 if (status != HV_EOK)
63 arg0 = ch; 52 break;
64 __asm__ __volatile__("ta %4"
65 : "=&r" (func), "=&r" (arg0)
66 : "0" (func), "1" (arg0), "i" (HV_FAST_TRAP));
67 53
68 return (long) arg0; 54 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
55 port->icount.tx++;
56 }
69} 57}
70 58
71#define IGNORE_BREAK 0x1 59static void transmit_chars_write(struct uart_port *port, struct circ_buf *xmit)
72#define IGNORE_ALL 0x2 60{
61 while (!uart_circ_empty(xmit)) {
62 unsigned long ra = __pa(xmit->buf + xmit->tail);
63 unsigned long len, status, sent;
73 64
74static int hung_up = 0; 65 len = CIRC_CNT_TO_END(xmit->head, xmit->tail,
66 UART_XMIT_SIZE);
67 status = sun4v_con_write(ra, len, &sent);
68 if (status != HV_EOK)
69 break;
70 xmit->tail = (xmit->tail + sent) & (UART_XMIT_SIZE - 1);
71 port->icount.tx += sent;
72 }
73}
75 74
76static struct tty_struct *receive_chars(struct uart_port *port) 75static int receive_chars_getchar(struct uart_port *port, struct tty_struct *tty)
77{ 76{
78 struct tty_struct *tty = NULL;
79 int saw_console_brk = 0; 77 int saw_console_brk = 0;
80 int limit = 10000; 78 int limit = 10000;
81 79
82 if (port->info != NULL) /* Unopened serial console */
83 tty = port->info->tty;
84
85 while (limit-- > 0) { 80 while (limit-- > 0) {
86 long status; 81 long status;
87 long c = hypervisor_con_getchar(&status); 82 long c = sun4v_con_getchar(&status);
88 unsigned char flag;
89 83
90 if (status == HV_EWOULDBLOCK) 84 if (status == HV_EWOULDBLOCK)
91 break; 85 break;
@@ -110,27 +104,90 @@ static struct tty_struct *receive_chars(struct uart_port *port)
110 continue; 104 continue;
111 } 105 }
112 106
113 flag = TTY_NORMAL;
114 port->icount.rx++; 107 port->icount.rx++;
115 if (c == CON_BREAK) {
116 port->icount.brk++;
117 if (uart_handle_break(port))
118 continue;
119 flag = TTY_BREAK;
120 }
121 108
122 if (uart_handle_sysrq_char(port, c)) 109 if (uart_handle_sysrq_char(port, c))
123 continue; 110 continue;
124 111
125 if ((port->ignore_status_mask & IGNORE_ALL) || 112 tty_insert_flip_char(tty, c, TTY_NORMAL);
126 ((port->ignore_status_mask & IGNORE_BREAK) && 113 }
127 (c == CON_BREAK))) 114
115 return saw_console_brk;
116}
117
118static int receive_chars_read(struct uart_port *port, struct tty_struct *tty)
119{
120 int saw_console_brk = 0;
121 int limit = 10000;
122
123 while (limit-- > 0) {
124 unsigned long ra = __pa(con_read_page);
125 unsigned long bytes_read, i;
126 long stat = sun4v_con_read(ra, PAGE_SIZE, &bytes_read);
127
128 if (stat != HV_EOK) {
129 bytes_read = 0;
130
131 if (stat == CON_BREAK) {
132 if (uart_handle_break(port))
133 continue;
134 saw_console_brk = 1;
135 *con_read_page = 0;
136 bytes_read = 1;
137 } else if (stat == CON_HUP) {
138 hung_up = 1;
139 uart_handle_dcd_change(port, 0);
140 continue;
141 } else {
142 /* HV_EWOULDBLOCK, etc. */
143 break;
144 }
145 }
146
147 if (hung_up) {
148 hung_up = 0;
149 uart_handle_dcd_change(port, 1);
150 }
151
152 for (i = 0; i < bytes_read; i++)
153 uart_handle_sysrq_char(port, con_read_page[i]);
154
155 if (tty == NULL)
128 continue; 156 continue;
129 157
130 tty_insert_flip_char(tty, c, flag); 158 port->icount.rx += bytes_read;
159
160 tty_insert_flip_string(tty, con_read_page, bytes_read);
131 } 161 }
132 162
133 if (saw_console_brk) 163 return saw_console_brk;
164}
165
166struct sunhv_ops {
167 void (*transmit_chars)(struct uart_port *port, struct circ_buf *xmit);
168 int (*receive_chars)(struct uart_port *port, struct tty_struct *tty);
169};
170
171static struct sunhv_ops bychar_ops = {
172 .transmit_chars = transmit_chars_putchar,
173 .receive_chars = receive_chars_getchar,
174};
175
176static struct sunhv_ops bywrite_ops = {
177 .transmit_chars = transmit_chars_write,
178 .receive_chars = receive_chars_read,
179};
180
181static struct sunhv_ops *sunhv_ops = &bychar_ops;
182
183static struct tty_struct *receive_chars(struct uart_port *port)
184{
185 struct tty_struct *tty = NULL;
186
187 if (port->info != NULL) /* Unopened serial console */
188 tty = port->info->tty;
189
190 if (sunhv_ops->receive_chars(port, tty))
134 sun_do_break(); 191 sun_do_break();
135 192
136 return tty; 193 return tty;
@@ -147,15 +204,7 @@ static void transmit_chars(struct uart_port *port)
147 if (uart_circ_empty(xmit) || uart_tx_stopped(port)) 204 if (uart_circ_empty(xmit) || uart_tx_stopped(port))
148 return; 205 return;
149 206
150 while (!uart_circ_empty(xmit)) { 207 sunhv_ops->transmit_chars(port, xmit);
151 long status = hypervisor_con_putchar(xmit->buf[xmit->tail]);
152
153 if (status != HV_EOK)
154 break;
155
156 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
157 port->icount.tx++;
158 }
159 208
160 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) 209 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
161 uart_write_wakeup(port); 210 uart_write_wakeup(port);
@@ -212,7 +261,7 @@ static void sunhv_start_tx(struct uart_port *port)
212 struct circ_buf *xmit = &port->info->xmit; 261 struct circ_buf *xmit = &port->info->xmit;
213 262
214 while (!uart_circ_empty(xmit)) { 263 while (!uart_circ_empty(xmit)) {
215 long status = hypervisor_con_putchar(xmit->buf[xmit->tail]); 264 long status = sun4v_con_putchar(xmit->buf[xmit->tail]);
216 265
217 if (status != HV_EOK) 266 if (status != HV_EOK)
218 break; 267 break;
@@ -231,9 +280,10 @@ static void sunhv_send_xchar(struct uart_port *port, char ch)
231 spin_lock_irqsave(&port->lock, flags); 280 spin_lock_irqsave(&port->lock, flags);
232 281
233 while (limit-- > 0) { 282 while (limit-- > 0) {
234 long status = hypervisor_con_putchar(ch); 283 long status = sun4v_con_putchar(ch);
235 if (status == HV_EOK) 284 if (status == HV_EOK)
236 break; 285 break;
286 udelay(1);
237 } 287 }
238 288
239 spin_unlock_irqrestore(&port->lock, flags); 289 spin_unlock_irqrestore(&port->lock, flags);
@@ -254,15 +304,15 @@ static void sunhv_break_ctl(struct uart_port *port, int break_state)
254{ 304{
255 if (break_state) { 305 if (break_state) {
256 unsigned long flags; 306 unsigned long flags;
257 int limit = 1000000; 307 int limit = 10000;
258 308
259 spin_lock_irqsave(&port->lock, flags); 309 spin_lock_irqsave(&port->lock, flags);
260 310
261 while (limit-- > 0) { 311 while (limit-- > 0) {
262 long status = hypervisor_con_putchar(CON_BREAK); 312 long status = sun4v_con_putchar(CON_BREAK);
263 if (status == HV_EOK) 313 if (status == HV_EOK)
264 break; 314 break;
265 udelay(2); 315 udelay(1);
266 } 316 }
267 317
268 spin_unlock_irqrestore(&port->lock, flags); 318 spin_unlock_irqrestore(&port->lock, flags);
@@ -359,38 +409,99 @@ static struct uart_driver sunhv_reg = {
359 409
360static struct uart_port *sunhv_port; 410static struct uart_port *sunhv_port;
361 411
362static inline void sunhv_console_putchar(struct uart_port *port, char c) 412/* Copy 's' into the con_write_page, decoding "\n" into
413 * "\r\n" along the way. We have to return two lengths
414 * because the caller needs to know how much to advance
415 * 's' and also how many bytes to output via con_write_page.
416 */
417static int fill_con_write_page(const char *s, unsigned int n,
418 unsigned long *page_bytes)
419{
420 const char *orig_s = s;
421 char *p = con_write_page;
422 int left = PAGE_SIZE;
423
424 while (n--) {
425 if (*s == '\n') {
426 if (left < 2)
427 break;
428 *p++ = '\r';
429 left--;
430 } else if (left < 1)
431 break;
432 *p++ = *s++;
433 left--;
434 }
435 *page_bytes = p - con_write_page;
436 return s - orig_s;
437}
438
439static void sunhv_console_write_paged(struct console *con, const char *s, unsigned n)
363{ 440{
441 struct uart_port *port = sunhv_port;
364 unsigned long flags; 442 unsigned long flags;
365 int limit = 1000000;
366 443
367 spin_lock_irqsave(&port->lock, flags); 444 spin_lock_irqsave(&port->lock, flags);
445 while (n > 0) {
446 unsigned long ra = __pa(con_write_page);
447 unsigned long page_bytes;
448 unsigned int cpy = fill_con_write_page(s, n,
449 &page_bytes);
450
451 n -= cpy;
452 s += cpy;
453 while (page_bytes > 0) {
454 unsigned long written;
455 int limit = 1000000;
456
457 while (limit--) {
458 unsigned long stat;
459
460 stat = sun4v_con_write(ra, page_bytes,
461 &written);
462 if (stat == HV_EOK)
463 break;
464 udelay(1);
465 }
466 if (limit <= 0)
467 break;
468 page_bytes -= written;
469 ra += written;
470 }
471 }
472 spin_unlock_irqrestore(&port->lock, flags);
473}
474
475static inline void sunhv_console_putchar(struct uart_port *port, char c)
476{
477 int limit = 1000000;
368 478
369 while (limit-- > 0) { 479 while (limit-- > 0) {
370 long status = hypervisor_con_putchar(c); 480 long status = sun4v_con_putchar(c);
371 if (status == HV_EOK) 481 if (status == HV_EOK)
372 break; 482 break;
373 udelay(2); 483 udelay(1);
374 } 484 }
375
376 spin_unlock_irqrestore(&port->lock, flags);
377} 485}
378 486
379static void sunhv_console_write(struct console *con, const char *s, unsigned n) 487static void sunhv_console_write_bychar(struct console *con, const char *s, unsigned n)
380{ 488{
381 struct uart_port *port = sunhv_port; 489 struct uart_port *port = sunhv_port;
490 unsigned long flags;
382 int i; 491 int i;
383 492
493 spin_lock_irqsave(&port->lock, flags);
384 for (i = 0; i < n; i++) { 494 for (i = 0; i < n; i++) {
385 if (*s == '\n') 495 if (*s == '\n')
386 sunhv_console_putchar(port, '\r'); 496 sunhv_console_putchar(port, '\r');
387 sunhv_console_putchar(port, *s++); 497 sunhv_console_putchar(port, *s++);
388 } 498 }
499 spin_unlock_irqrestore(&port->lock, flags);
389} 500}
390 501
391static struct console sunhv_console = { 502static struct console sunhv_console = {
392 .name = "ttyHV", 503 .name = "ttyHV",
393 .write = sunhv_console_write, 504 .write = sunhv_console_write_bychar,
394 .device = uart_console_device, 505 .device = uart_console_device,
395 .flags = CON_PRINTBUFFER, 506 .flags = CON_PRINTBUFFER,
396 .index = -1, 507 .index = -1,
@@ -410,6 +521,7 @@ static inline struct console *SUNHV_CONSOLE(void)
410static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match) 521static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match)
411{ 522{
412 struct uart_port *port; 523 struct uart_port *port;
524 unsigned long minor;
413 int err; 525 int err;
414 526
415 if (op->irqs[0] == 0xffffffff) 527 if (op->irqs[0] == 0xffffffff)
@@ -419,6 +531,22 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
419 if (unlikely(!port)) 531 if (unlikely(!port))
420 return -ENOMEM; 532 return -ENOMEM;
421 533
534 minor = 1;
535 if (sun4v_hvapi_register(HV_GRP_CORE, 1, &minor) == 0 &&
536 minor >= 1) {
537 err = -ENOMEM;
538 con_write_page = kzalloc(PAGE_SIZE, GFP_KERNEL);
539 if (!con_write_page)
540 goto out_free_port;
541
542 con_read_page = kzalloc(PAGE_SIZE, GFP_KERNEL);
543 if (!con_read_page)
544 goto out_free_con_write_page;
545
546 sunhv_console.write = sunhv_console_write_paged;
547 sunhv_ops = &bywrite_ops;
548 }
549
422 sunhv_port = port; 550 sunhv_port = port;
423 551
424 port->line = 0; 552 port->line = 0;
@@ -437,7 +565,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
437 565
438 err = uart_register_driver(&sunhv_reg); 566 err = uart_register_driver(&sunhv_reg);
439 if (err) 567 if (err)
440 goto out_free_port; 568 goto out_free_con_read_page;
441 569
442 sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64; 570 sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64;
443 sunserial_current_minor += 1; 571 sunserial_current_minor += 1;
@@ -463,6 +591,12 @@ out_unregister_driver:
463 sunserial_current_minor -= 1; 591 sunserial_current_minor -= 1;
464 uart_unregister_driver(&sunhv_reg); 592 uart_unregister_driver(&sunhv_reg);
465 593
594out_free_con_read_page:
595 kfree(con_read_page);
596
597out_free_con_write_page:
598 kfree(con_write_page);
599
466out_free_port: 600out_free_port:
467 kfree(port); 601 kfree(port);
468 sunhv_port = NULL; 602 sunhv_port = NULL;
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 0985193dc57..15b6e1cb040 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/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index 052359fc41e..11f36bef305 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 96f62b2df30..95183e1df52 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 ce3c0ce2316..7d2d9ec6cac 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/spidev.c b/drivers/spi/spidev.c
index c0a6dce800a..d04242aee40 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 }
@@ -484,7 +485,7 @@ static int spidev_probe(struct spi_device *spi)
484 * Reusing minors is fine so long as udev or mdev is working. 485 * Reusing minors is fine so long as udev or mdev is working.
485 */ 486 */
486 mutex_lock(&device_list_lock); 487 mutex_lock(&device_list_lock);
487 minor = find_first_zero_bit(minors, ARRAY_SIZE(minors)); 488 minor = find_first_zero_bit(minors, N_SPI_MINORS);
488 if (minor < N_SPI_MINORS) { 489 if (minor < N_SPI_MINORS) {
489 spidev->dev.parent = &spi->dev; 490 spidev->dev.parent = &spi->dev;
490 spidev->dev.class = &spidev_class; 491 spidev->dev.class = &spidev_class;
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 15e740e3a5c..7b1edfe46b2 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 bfb3731d42d..2d4fd530e5e 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 b9f7f90aef8..2619986e530 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 40cf882293e..8969e42434b 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 f6b74a678de..24f10a19dbd 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 b7434787db5..f9fed34bf7d 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 e7c98237748..be37c863fdf 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 18ddc5e67e3..4a6299bd004 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 157054ea397..3ca2b3159f0 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 a52480505f7..c7a7c590426 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 f28736a917e..b5e59db5334 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 79705609fd0..ca62cb58322 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 20861650905..c225159ca3d 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 ff0dba01f1c..e98df2ee990 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 88fb56d5db8..cac1500cba6 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 e2172e5cf15..e0f122e131d 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 11555bde655..7bad4940476 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 ea2175bb227..fe437125f14 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 95a1805b064..2353679f601 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 77ad0a09b38..33aee904724 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 2366e7b63ec..36620c65107 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 4adfab988e8..00afc1712c3 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 8c3f55b080b..89f067d9507 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 644607de4c1..ac1829c6e8f 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 6d3dad3d1da..d35369392fe 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 8b3145ab775..d230ee72f9c 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 4d7485fa553..6e1f1ea21b3 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/console/vgacon.c b/drivers/video/console/vgacon.c
index 2460b82a1d9..f46fe95f69f 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -368,9 +368,14 @@ static const char *vgacon_startup(void)
368#endif 368#endif
369 } 369 }
370 370
371 /* SCREEN_INFO initialized? */
372 if ((ORIG_VIDEO_MODE == 0) &&
373 (ORIG_VIDEO_LINES == 0) &&
374 (ORIG_VIDEO_COLS == 0))
375 goto no_vga;
376
371 /* VGA16 modes are not handled by VGACON */ 377 /* VGA16 modes are not handled by VGACON */
372 if ((ORIG_VIDEO_MODE == 0x00) || /* SCREEN_INFO not initialized */ 378 if ((ORIG_VIDEO_MODE == 0x0D) || /* 320x200/4 */
373 (ORIG_VIDEO_MODE == 0x0D) || /* 320x200/4 */
374 (ORIG_VIDEO_MODE == 0x0E) || /* 640x200/4 */ 379 (ORIG_VIDEO_MODE == 0x0E) || /* 640x200/4 */
375 (ORIG_VIDEO_MODE == 0x10) || /* 640x350/4 */ 380 (ORIG_VIDEO_MODE == 0x10) || /* 640x350/4 */
376 (ORIG_VIDEO_MODE == 0x12) || /* 640x480/4 */ 381 (ORIG_VIDEO_MODE == 0x12) || /* 640x480/4 */
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 267c1ff9ebd..a1258989859 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/pm2fb.c b/drivers/video/pm2fb.c
index ab5e66890e4..0a04483aa3e 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 c77a1a1fd46..616a0c08e30 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
@@ -530,12 +504,10 @@ static int pm3fb_set_par(struct fb_info *info)
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 9756a728b74..9cf92ba5d6e 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/w100fb.c b/drivers/video/w100fb.c
index 5fc86ea2069..003c49a490e 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 3128aa948a4..9ac4ffe9ac7 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 775e26e82cb..d93960429c0 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 7624821729a..c76cd8fa3f6 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 8eb9263a67b..7bdf8b32684 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 74c64409ddb..d4fc6095466 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/adfs/super.c b/fs/adfs/super.c
index 30c29650849..de2ed5ca335 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -232,8 +232,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
232{ 232{
233 struct adfs_inode_info *ei = (struct adfs_inode_info *) foo; 233 struct adfs_inode_info *ei = (struct adfs_inode_info *) foo;
234 234
235 if (flags & SLAB_CTOR_CONSTRUCTOR) 235 inode_init_once(&ei->vfs_inode);
236 inode_init_once(&ei->vfs_inode);
237} 236}
238 237
239static int init_inodecache(void) 238static int init_inodecache(void)
diff --git a/fs/affs/inode.c b/fs/affs/inode.c
index c5b9d73c084..4609a6c13fe 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 beff7d21e6e..6d0ebc32153 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;
@@ -87,11 +88,9 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
87{ 88{
88 struct affs_inode_info *ei = (struct affs_inode_info *) foo; 89 struct affs_inode_info *ei = (struct affs_inode_info *) foo;
89 90
90 if (flags & SLAB_CTOR_CONSTRUCTOR) { 91 init_MUTEX(&ei->i_link_lock);
91 init_MUTEX(&ei->i_link_lock); 92 init_MUTEX(&ei->i_ext_lock);
92 init_MUTEX(&ei->i_ext_lock); 93 inode_init_once(&ei->vfs_inode);
93 inode_init_once(&ei->vfs_inode);
94 }
95} 94}
96 95
97static int init_inodecache(void) 96static int init_inodecache(void)
diff --git a/fs/afs/callback.c b/fs/afs/callback.c
index f64e40fefc0..bacf518c6fa 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 9b1311a1df5..175a567db78 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 719af4fb15d..546c59522eb 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 47f5fed7195..d196840127c 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 4953ba5a6f4..2dac3ad2c44 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -16,6 +16,7 @@
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>
19#include "afs.h" 20#include "afs.h"
20#include "afs_vl.h" 21#include "afs_vl.h"
21 22
diff --git a/fs/afs/main.c b/fs/afs/main.c
index f1f71ff7d5c..cd21195bbb2 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 d5601f617cd..13df512aea9 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 e0ea88b63eb..566fe712c68 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 579af632c8e..2e8496ba120 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' */
@@ -47,7 +48,6 @@ struct file_system_type afs_fs_type = {
47static const struct super_operations afs_super_ops = { 48static const struct super_operations afs_super_ops = {
48 .statfs = afs_statfs, 49 .statfs = afs_statfs,
49 .alloc_inode = afs_alloc_inode, 50 .alloc_inode = afs_alloc_inode,
50 .drop_inode = generic_delete_inode,
51 .write_inode = afs_write_inode, 51 .write_inode = afs_write_inode,
52 .destroy_inode = afs_destroy_inode, 52 .destroy_inode = afs_destroy_inode,
53 .clear_inode = afs_clear_inode, 53 .clear_inode = afs_clear_inode,
@@ -452,17 +452,15 @@ static void afs_i_init_once(void *_vnode, struct kmem_cache *cachep,
452{ 452{
453 struct afs_vnode *vnode = _vnode; 453 struct afs_vnode *vnode = _vnode;
454 454
455 if (flags & SLAB_CTOR_CONSTRUCTOR) { 455 memset(vnode, 0, sizeof(*vnode));
456 memset(vnode, 0, sizeof(*vnode)); 456 inode_init_once(&vnode->vfs_inode);
457 inode_init_once(&vnode->vfs_inode); 457 init_waitqueue_head(&vnode->update_waitq);
458 init_waitqueue_head(&vnode->update_waitq); 458 mutex_init(&vnode->permits_lock);
459 mutex_init(&vnode->permits_lock); 459 mutex_init(&vnode->validate_lock);
460 mutex_init(&vnode->validate_lock); 460 spin_lock_init(&vnode->writeback_lock);
461 spin_lock_init(&vnode->writeback_lock); 461 spin_lock_init(&vnode->lock);
462 spin_lock_init(&vnode->lock); 462 INIT_LIST_HEAD(&vnode->writebacks);
463 INIT_LIST_HEAD(&vnode->writebacks); 463 INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work);
464 INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work);
465 }
466} 464}
467 465
468/* 466/*
diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c
index 3370cdb7256..09e3ad0fc7c 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 c36c98ce2c3..232c55dc245 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 dd160cada45..8bab0e3437f 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/afs/write.c b/fs/afs/write.c
index 28f37516c12..a03b92a0fe1 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -206,7 +206,6 @@ int afs_prepare_write(struct file *file, struct page *page,
206 _leave(" = %d [prep]", ret); 206 _leave(" = %d [prep]", ret);
207 return ret; 207 return ret;
208 } 208 }
209 SetPageUptodate(page);
210 } 209 }
211 210
212try_again: 211try_again:
@@ -311,8 +310,8 @@ int afs_commit_write(struct file *file, struct page *page,
311 spin_unlock(&vnode->writeback_lock); 310 spin_unlock(&vnode->writeback_lock);
312 } 311 }
313 312
313 SetPageUptodate(page);
314 set_page_dirty(page); 314 set_page_dirty(page);
315
316 if (PageDirty(page)) 315 if (PageDirty(page))
317 _debug("dirtied"); 316 _debug("dirtied");
318 317
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index fe96108a788..a5c5171c282 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -292,10 +292,8 @@ befs_destroy_inode(struct inode *inode)
292static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags) 292static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
293{ 293{
294 struct befs_inode_info *bi = (struct befs_inode_info *) foo; 294 struct befs_inode_info *bi = (struct befs_inode_info *) foo;
295 295
296 if (flags & SLAB_CTOR_CONSTRUCTOR) { 296 inode_init_once(&bi->vfs_inode);
297 inode_init_once(&bi->vfs_inode);
298 }
299} 297}
300 298
301static void 299static void
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
index edc08d89aab..58c7bd9f530 100644
--- a/fs/bfs/inode.c
+++ b/fs/bfs/inode.c
@@ -248,8 +248,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
248{ 248{
249 struct bfs_inode_info *bi = foo; 249 struct bfs_inode_info *bi = foo;
250 250
251 if (flags & SLAB_CTOR_CONSTRUCTOR) 251 inode_init_once(&bi->vfs_inode);
252 inode_init_once(&bi->vfs_inode);
253} 252}
254 253
255static int init_inodecache(void) 254static int init_inodecache(void)
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 72d0b412c37..330fd3fe854 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/block_dev.c b/fs/block_dev.c
index 74289924087..ea1480a16f5 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -458,17 +458,15 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
458 struct bdev_inode *ei = (struct bdev_inode *) foo; 458 struct bdev_inode *ei = (struct bdev_inode *) foo;
459 struct block_device *bdev = &ei->bdev; 459 struct block_device *bdev = &ei->bdev;
460 460
461 if (flags & SLAB_CTOR_CONSTRUCTOR) { 461 memset(bdev, 0, sizeof(*bdev));
462 memset(bdev, 0, sizeof(*bdev)); 462 mutex_init(&bdev->bd_mutex);
463 mutex_init(&bdev->bd_mutex); 463 sema_init(&bdev->bd_mount_sem, 1);
464 sema_init(&bdev->bd_mount_sem, 1); 464 INIT_LIST_HEAD(&bdev->bd_inodes);
465 INIT_LIST_HEAD(&bdev->bd_inodes); 465 INIT_LIST_HEAD(&bdev->bd_list);
466 INIT_LIST_HEAD(&bdev->bd_list);
467#ifdef CONFIG_SYSFS 466#ifdef CONFIG_SYSFS
468 INIT_LIST_HEAD(&bdev->bd_holder_list); 467 INIT_LIST_HEAD(&bdev->bd_holder_list);
469#endif 468#endif
470 inode_init_once(&ei->vfs_inode); 469 inode_init_once(&ei->vfs_inode);
471 }
472} 470}
473 471
474static inline void __bd_forget(struct inode *inode) 472static inline void __bd_forget(struct inode *inode)
diff --git a/fs/buffer.c b/fs/buffer.c
index aecd057cd0e..aa68206bd51 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -981,7 +981,8 @@ grow_dev_page(struct block_device *bdev, sector_t block,
981 struct page *page; 981 struct page *page;
982 struct buffer_head *bh; 982 struct buffer_head *bh;
983 983
984 page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); 984 page = find_or_create_page(inode->i_mapping, index,
985 mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
985 if (!page) 986 if (!page)
986 return NULL; 987 return NULL;
987 988
@@ -2100,7 +2101,7 @@ int cont_prepare_write(struct page *page, unsigned offset,
2100 PAGE_CACHE_SIZE, get_block); 2101 PAGE_CACHE_SIZE, get_block);
2101 if (status) 2102 if (status)
2102 goto out_unmap; 2103 goto out_unmap;
2103 zero_user_page(page, zerofrom, PAGE_CACHE_SIZE - zerofrom, 2104 zero_user_page(new_page, zerofrom, PAGE_CACHE_SIZE - zerofrom,
2104 KM_USER0); 2105 KM_USER0);
2105 generic_commit_write(NULL, new_page, zerofrom, PAGE_CACHE_SIZE); 2106 generic_commit_write(NULL, new_page, zerofrom, PAGE_CACHE_SIZE);
2106 unlock_page(new_page); 2107 unlock_page(new_page);
@@ -2898,8 +2899,9 @@ static void recalc_bh_state(void)
2898 2899
2899struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) 2900struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
2900{ 2901{
2901 struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); 2902 struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags);
2902 if (ret) { 2903 if (ret) {
2904 INIT_LIST_HEAD(&ret->b_assoc_buffers);
2903 get_cpu_var(bh_accounting).nr++; 2905 get_cpu_var(bh_accounting).nr++;
2904 recalc_bh_state(); 2906 recalc_bh_state();
2905 put_cpu_var(bh_accounting); 2907 put_cpu_var(bh_accounting);
@@ -2918,17 +2920,6 @@ void free_buffer_head(struct buffer_head *bh)
2918} 2920}
2919EXPORT_SYMBOL(free_buffer_head); 2921EXPORT_SYMBOL(free_buffer_head);
2920 2922
2921static void
2922init_buffer_head(void *data, struct kmem_cache *cachep, unsigned long flags)
2923{
2924 if (flags & SLAB_CTOR_CONSTRUCTOR) {
2925 struct buffer_head * bh = (struct buffer_head *)data;
2926
2927 memset(bh, 0, sizeof(*bh));
2928 INIT_LIST_HEAD(&bh->b_assoc_buffers);
2929 }
2930}
2931
2932static void buffer_exit_cpu(int cpu) 2923static void buffer_exit_cpu(int cpu)
2933{ 2924{
2934 int i; 2925 int i;
@@ -2955,12 +2946,8 @@ void __init buffer_init(void)
2955{ 2946{
2956 int nrpages; 2947 int nrpages;
2957 2948
2958 bh_cachep = kmem_cache_create("buffer_head", 2949 bh_cachep = KMEM_CACHE(buffer_head,
2959 sizeof(struct buffer_head), 0, 2950 SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
2960 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
2961 SLAB_MEM_SPREAD),
2962 init_buffer_head,
2963 NULL);
2964 2951
2965 /* 2952 /*
2966 * Limit the bh occupancy to 10% of ZONE_NORMAL 2953 * Limit the bh occupancy to 10% of ZONE_NORMAL
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 8568e100953..d38c69b591c 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -701,10 +701,8 @@ cifs_init_once(void *inode, struct kmem_cache * cachep, unsigned long flags)
701{ 701{
702 struct cifsInodeInfo *cifsi = inode; 702 struct cifsInodeInfo *cifsi = inode;
703 703
704 if (flags & SLAB_CTOR_CONSTRUCTOR) { 704 inode_init_once(&cifsi->vfs_inode);
705 inode_init_once(&cifsi->vfs_inode); 705 INIT_LIST_HEAD(&cifsi->lockList);
706 INIT_LIST_HEAD(&cifsi->lockList);
707 }
708} 706}
709 707
710static int 708static int
diff --git a/fs/coda/cache.c b/fs/coda/cache.c
index 5d052713326..fcb88fa8d2f 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/inode.c b/fs/coda/inode.c
index 0aaff3651d1..dbff1bd4fb9 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -62,8 +62,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
62{ 62{
63 struct coda_inode_info *ei = (struct coda_inode_info *) foo; 63 struct coda_inode_info *ei = (struct coda_inode_info *) foo;
64 64
65 if (flags & SLAB_CTOR_CONSTRUCTOR) 65 inode_init_once(&ei->vfs_inode);
66 inode_init_once(&ei->vfs_inode);
67} 66}
68 67
69int coda_init_inodecache(void) 68int coda_init_inodecache(void)
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index a5b5e631ba6..5faacdb1a47 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 7b21b0a8259..4db6216e526 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}
@@ -2230,21 +2235,16 @@ asmlinkage long compat_sys_signalfd(int ufd,
2230asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags, 2235asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags,
2231 const struct compat_itimerspec __user *utmr) 2236 const struct compat_itimerspec __user *utmr)
2232{ 2237{
2233 long res;
2234 struct itimerspec t; 2238 struct itimerspec t;
2235 struct itimerspec __user *ut; 2239 struct itimerspec __user *ut;
2236 2240
2237 res = -EFAULT;
2238 if (get_compat_itimerspec(&t, utmr)) 2241 if (get_compat_itimerspec(&t, utmr))
2239 goto err_exit; 2242 return -EFAULT;
2240 ut = compat_alloc_user_space(sizeof(*ut)); 2243 ut = compat_alloc_user_space(sizeof(*ut));
2241 if (copy_to_user(ut, &t, sizeof(t)) ) 2244 if (copy_to_user(ut, &t, sizeof(t)))
2242 goto err_exit; 2245 return -EFAULT;
2243 2246
2244 res = sys_timerfd(ufd, clockid, flags, ut); 2247 return sys_timerfd(ufd, clockid, flags, ut);
2245err_exit:
2246 return res;
2247} 2248}
2248 2249
2249#endif /* CONFIG_TIMERFD */ 2250#endif /* CONFIG_TIMERFD */
2250
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 65643def318..6b44cdc96fa 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 2ec9beac17c..ddc003a9d21 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/dquot.c b/fs/dquot.c
index 3a995841de9..8819d281500 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -1421,7 +1421,7 @@ int vfs_quota_off(struct super_block *sb, int type)
1421 /* If quota was reenabled in the meantime, we have 1421 /* If quota was reenabled in the meantime, we have
1422 * nothing to do */ 1422 * nothing to do */
1423 if (!sb_has_quota_enabled(sb, cnt)) { 1423 if (!sb_has_quota_enabled(sb, cnt)) {
1424 mutex_lock(&toputinode[cnt]->i_mutex); 1424 mutex_lock_nested(&toputinode[cnt]->i_mutex, I_MUTEX_QUOTA);
1425 toputinode[cnt]->i_flags &= ~(S_IMMUTABLE | 1425 toputinode[cnt]->i_flags &= ~(S_IMMUTABLE |
1426 S_NOATIME | S_NOQUOTA); 1426 S_NOATIME | S_NOQUOTA);
1427 truncate_inode_pages(&toputinode[cnt]->i_data, 0); 1427 truncate_inode_pages(&toputinode[cnt]->i_data, 0);
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 9881b5c5de5..59288d81707 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/main.c b/fs/ecryptfs/main.c
index 8cbf3f69ebe..606128f5c92 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -583,8 +583,7 @@ inode_info_init_once(void *vptr, struct kmem_cache *cachep, unsigned long flags)
583{ 583{
584 struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr; 584 struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr;
585 585
586 if (flags & SLAB_CTOR_CONSTRUCTOR) 586 inode_init_once(&ei->vfs_inode);
587 inode_init_once(&ei->vfs_inode);
588} 587}
589 588
590static struct ecryptfs_cache_info { 589static struct ecryptfs_cache_info {
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c
index 3baf253be95..a9d87c47f72 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 0770c4b66f5..55cec98a84e 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -364,25 +364,43 @@ static int fill_zeros_to_end_of_page(struct page *page, unsigned int to)
364{ 364{
365 struct inode *inode = page->mapping->host; 365 struct inode *inode = page->mapping->host;
366 int end_byte_in_page; 366 int end_byte_in_page;
367 char *page_virt;
368 367
369 if ((i_size_read(inode) / PAGE_CACHE_SIZE) != page->index) 368 if ((i_size_read(inode) / PAGE_CACHE_SIZE) != page->index)
370 goto out; 369 goto out;
371 end_byte_in_page = i_size_read(inode) % PAGE_CACHE_SIZE; 370 end_byte_in_page = i_size_read(inode) % PAGE_CACHE_SIZE;
372 if (to > end_byte_in_page) 371 if (to > end_byte_in_page)
373 end_byte_in_page = to; 372 end_byte_in_page = to;
374 page_virt = kmap_atomic(page, KM_USER0); 373 zero_user_page(page, end_byte_in_page,
375 memset((page_virt + end_byte_in_page), 0, 374 PAGE_CACHE_SIZE - end_byte_in_page, KM_USER0);
376 (PAGE_CACHE_SIZE - end_byte_in_page));
377 kunmap_atomic(page_virt, KM_USER0);
378 flush_dcache_page(page);
379out: 375out:
380 return 0; 376 return 0;
381} 377}
382 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
383static int ecryptfs_prepare_write(struct file *file, struct page *page, 400static int ecryptfs_prepare_write(struct file *file, struct page *page,
384 unsigned from, unsigned to) 401 unsigned from, unsigned to)
385{ 402{
403 loff_t pos;
386 int rc = 0; 404 int rc = 0;
387 405
388 if (from == 0 && to == PAGE_CACHE_SIZE) 406 if (from == 0 && to == PAGE_CACHE_SIZE)
@@ -390,6 +408,16 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page,
390 up to date. */ 408 up to date. */
391 if (!PageUptodate(page)) 409 if (!PageUptodate(page))
392 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 }
393out: 421out:
394 return rc; 422 return rc;
395} 423}
@@ -740,7 +768,6 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros)
740{ 768{
741 int rc = 0; 769 int rc = 0;
742 struct page *tmp_page; 770 struct page *tmp_page;
743 char *tmp_page_virt;
744 771
745 tmp_page = ecryptfs_get1page(file, index); 772 tmp_page = ecryptfs_get1page(file, index);
746 if (IS_ERR(tmp_page)) { 773 if (IS_ERR(tmp_page)) {
@@ -749,18 +776,15 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros)
749 rc = PTR_ERR(tmp_page); 776 rc = PTR_ERR(tmp_page);
750 goto out; 777 goto out;
751 } 778 }
752 rc = ecryptfs_prepare_write(file, tmp_page, start, start + num_zeros); 779 if ((rc = ecryptfs_prepare_write_no_truncate(file, tmp_page, start,
753 if (rc) { 780 (start + num_zeros)))) {
754 ecryptfs_printk(KERN_ERR, "Error preparing to write zero's " 781 ecryptfs_printk(KERN_ERR, "Error preparing to write zero's "
755 "to remainder of page at index [0x%.16x]\n", 782 "to page at index [0x%.16x]\n",
756 index); 783 index);
757 page_cache_release(tmp_page); 784 page_cache_release(tmp_page);
758 goto out; 785 goto out;
759 } 786 }
760 tmp_page_virt = kmap_atomic(tmp_page, KM_USER0); 787 zero_user_page(tmp_page, start, num_zeros, KM_USER0);
761 memset(((char *)tmp_page_virt + start), 0, num_zeros);
762 kunmap_atomic(tmp_page_virt, KM_USER0);
763 flush_dcache_page(tmp_page);
764 rc = ecryptfs_commit_write(file, tmp_page, start, start + num_zeros); 788 rc = ecryptfs_commit_write(file, tmp_page, start, start + num_zeros);
765 if (rc < 0) { 789 if (rc < 0) {
766 ecryptfs_printk(KERN_ERR, "Error attempting to write zero's " 790 ecryptfs_printk(KERN_ERR, "Error attempting to write zero's "
diff --git a/fs/efs/super.c b/fs/efs/super.c
index ba7a8b9da0c..e0a6839e68a 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -72,8 +72,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
72{ 72{
73 struct efs_inode_info *ei = (struct efs_inode_info *) foo; 73 struct efs_inode_info *ei = (struct efs_inode_info *) foo;
74 74
75 if (flags & SLAB_CTOR_CONSTRUCTOR) 75 inode_init_once(&ei->vfs_inode);
76 inode_init_once(&ei->vfs_inode);
77} 76}
78 77
79static int init_inodecache(void) 78static int init_inodecache(void)
diff --git a/fs/eventfd.c b/fs/eventfd.c
index 480e2b3c416..2ce19c000d2 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -17,7 +17,6 @@
17#include <linux/eventfd.h> 17#include <linux/eventfd.h>
18 18
19struct eventfd_ctx { 19struct eventfd_ctx {
20 spinlock_t lock;
21 wait_queue_head_t wqh; 20 wait_queue_head_t wqh;
22 /* 21 /*
23 * Every time that a write(2) is performed on an eventfd, the 22 * Every time that a write(2) is performed on an eventfd, the
@@ -45,13 +44,13 @@ int eventfd_signal(struct file *file, int n)
45 44
46 if (n < 0) 45 if (n < 0)
47 return -EINVAL; 46 return -EINVAL;
48 spin_lock_irqsave(&ctx->lock, flags); 47 spin_lock_irqsave(&ctx->wqh.lock, flags);
49 if (ULLONG_MAX - ctx->count < n) 48 if (ULLONG_MAX - ctx->count < n)
50 n = (int) (ULLONG_MAX - ctx->count); 49 n = (int) (ULLONG_MAX - ctx->count);
51 ctx->count += n; 50 ctx->count += n;
52 if (waitqueue_active(&ctx->wqh)) 51 if (waitqueue_active(&ctx->wqh))
53 wake_up_locked(&ctx->wqh); 52 wake_up_locked(&ctx->wqh);
54 spin_unlock_irqrestore(&ctx->lock, flags); 53 spin_unlock_irqrestore(&ctx->wqh.lock, flags);
55 54
56 return n; 55 return n;
57} 56}
@@ -70,14 +69,14 @@ static unsigned int eventfd_poll(struct file *file, poll_table *wait)
70 69
71 poll_wait(file, &ctx->wqh, wait); 70 poll_wait(file, &ctx->wqh, wait);
72 71
73 spin_lock_irqsave(&ctx->lock, flags); 72 spin_lock_irqsave(&ctx->wqh.lock, flags);
74 if (ctx->count > 0) 73 if (ctx->count > 0)
75 events |= POLLIN; 74 events |= POLLIN;
76 if (ctx->count == ULLONG_MAX) 75 if (ctx->count == ULLONG_MAX)
77 events |= POLLERR; 76 events |= POLLERR;
78 if (ULLONG_MAX - 1 > ctx->count) 77 if (ULLONG_MAX - 1 > ctx->count)
79 events |= POLLOUT; 78 events |= POLLOUT;
80 spin_unlock_irqrestore(&ctx->lock, flags); 79 spin_unlock_irqrestore(&ctx->wqh.lock, flags);
81 80
82 return events; 81 return events;
83} 82}
@@ -92,7 +91,7 @@ static ssize_t eventfd_read(struct file *file, char __user *buf, size_t count,
92 91
93 if (count < sizeof(ucnt)) 92 if (count < sizeof(ucnt))
94 return -EINVAL; 93 return -EINVAL;
95 spin_lock_irq(&ctx->lock); 94 spin_lock_irq(&ctx->wqh.lock);
96 res = -EAGAIN; 95 res = -EAGAIN;
97 ucnt = ctx->count; 96 ucnt = ctx->count;
98 if (ucnt > 0) 97 if (ucnt > 0)
@@ -110,9 +109,9 @@ static ssize_t eventfd_read(struct file *file, char __user *buf, size_t count,
110 res = -ERESTARTSYS; 109 res = -ERESTARTSYS;
111 break; 110 break;
112 } 111 }
113 spin_unlock_irq(&ctx->lock); 112 spin_unlock_irq(&ctx->wqh.lock);
114 schedule(); 113 schedule();
115 spin_lock_irq(&ctx->lock); 114 spin_lock_irq(&ctx->wqh.lock);
116 } 115 }
117 __remove_wait_queue(&ctx->wqh, &wait); 116 __remove_wait_queue(&ctx->wqh, &wait);
118 __set_current_state(TASK_RUNNING); 117 __set_current_state(TASK_RUNNING);
@@ -122,7 +121,7 @@ static ssize_t eventfd_read(struct file *file, char __user *buf, size_t count,
122 if (waitqueue_active(&ctx->wqh)) 121 if (waitqueue_active(&ctx->wqh))
123 wake_up_locked(&ctx->wqh); 122 wake_up_locked(&ctx->wqh);
124 } 123 }
125 spin_unlock_irq(&ctx->lock); 124 spin_unlock_irq(&ctx->wqh.lock);
126 if (res > 0 && put_user(ucnt, (__u64 __user *) buf)) 125 if (res > 0 && put_user(ucnt, (__u64 __user *) buf))
127 return -EFAULT; 126 return -EFAULT;
128 127
@@ -143,7 +142,7 @@ static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t c
143 return -EFAULT; 142 return -EFAULT;
144 if (ucnt == ULLONG_MAX) 143 if (ucnt == ULLONG_MAX)
145 return -EINVAL; 144 return -EINVAL;
146 spin_lock_irq(&ctx->lock); 145 spin_lock_irq(&ctx->wqh.lock);
147 res = -EAGAIN; 146 res = -EAGAIN;
148 if (ULLONG_MAX - ctx->count > ucnt) 147 if (ULLONG_MAX - ctx->count > ucnt)
149 res = sizeof(ucnt); 148 res = sizeof(ucnt);
@@ -159,9 +158,9 @@ static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t c
159 res = -ERESTARTSYS; 158 res = -ERESTARTSYS;
160 break; 159 break;
161 } 160 }
162 spin_unlock_irq(&ctx->lock); 161 spin_unlock_irq(&ctx->wqh.lock);
163 schedule(); 162 schedule();
164 spin_lock_irq(&ctx->lock); 163 spin_lock_irq(&ctx->wqh.lock);
165 } 164 }
166 __remove_wait_queue(&ctx->wqh, &wait); 165 __remove_wait_queue(&ctx->wqh, &wait);
167 __set_current_state(TASK_RUNNING); 166 __set_current_state(TASK_RUNNING);
@@ -171,7 +170,7 @@ static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t c
171 if (waitqueue_active(&ctx->wqh)) 170 if (waitqueue_active(&ctx->wqh))
172 wake_up_locked(&ctx->wqh); 171 wake_up_locked(&ctx->wqh);
173 } 172 }
174 spin_unlock_irq(&ctx->lock); 173 spin_unlock_irq(&ctx->wqh.lock);
175 174
176 return res; 175 return res;
177} 176}
@@ -210,7 +209,6 @@ asmlinkage long sys_eventfd(unsigned int count)
210 return -ENOMEM; 209 return -ENOMEM;
211 210
212 init_waitqueue_head(&ctx->wqh); 211 init_waitqueue_head(&ctx->wqh);
213 spin_lock_init(&ctx->lock);
214 ctx->count = count; 212 ctx->count = count;
215 213
216 /* 214 /*
diff --git a/fs/exec.c b/fs/exec.c
index 70fa36554c1..f20561ff452 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -60,7 +60,7 @@
60#endif 60#endif
61 61
62int core_uses_pid; 62int core_uses_pid;
63char core_pattern[128] = "core"; 63char core_pattern[CORENAME_MAX_SIZE] = "core";
64int suid_dumpable = 0; 64int suid_dumpable = 0;
65 65
66EXPORT_SYMBOL(suid_dumpable); 66EXPORT_SYMBOL(suid_dumpable);
@@ -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;
@@ -1264,8 +1267,6 @@ int set_binfmt(struct linux_binfmt *new)
1264 1267
1265EXPORT_SYMBOL(set_binfmt); 1268EXPORT_SYMBOL(set_binfmt);
1266 1269
1267#define CORENAME_MAX_SIZE 64
1268
1269/* format_corename will inspect the pattern parameter, and output a 1270/* format_corename will inspect the pattern parameter, and output a
1270 * name into corename, which must have space for at least 1271 * name into corename, which must have space for at least
1271 * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator. 1272 * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 685a1c28717..16337bff027 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -160,13 +160,11 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
160{ 160{
161 struct ext2_inode_info *ei = (struct ext2_inode_info *) foo; 161 struct ext2_inode_info *ei = (struct ext2_inode_info *) foo;
162 162
163 if (flags & SLAB_CTOR_CONSTRUCTOR) { 163 rwlock_init(&ei->i_meta_lock);
164 rwlock_init(&ei->i_meta_lock);
165#ifdef CONFIG_EXT2_FS_XATTR 164#ifdef CONFIG_EXT2_FS_XATTR
166 init_rwsem(&ei->xattr_sem); 165 init_rwsem(&ei->xattr_sem);
167#endif 166#endif
168 inode_init_once(&ei->vfs_inode); 167 inode_init_once(&ei->vfs_inode);
169 }
170} 168}
171 169
172static int init_inodecache(void) 170static int init_inodecache(void)
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 54d3c904125..6e3062913a9 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -466,14 +466,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
466{ 466{
467 struct ext3_inode_info *ei = (struct ext3_inode_info *) foo; 467 struct ext3_inode_info *ei = (struct ext3_inode_info *) foo;
468 468
469 if (flags & SLAB_CTOR_CONSTRUCTOR) { 469 INIT_LIST_HEAD(&ei->i_orphan);
470 INIT_LIST_HEAD(&ei->i_orphan);
471#ifdef CONFIG_EXT3_FS_XATTR 470#ifdef CONFIG_EXT3_FS_XATTR
472 init_rwsem(&ei->xattr_sem); 471 init_rwsem(&ei->xattr_sem);
473#endif 472#endif
474 mutex_init(&ei->truncate_mutex); 473 mutex_init(&ei->truncate_mutex);
475 inode_init_once(&ei->vfs_inode); 474 inode_init_once(&ei->vfs_inode);
476 }
477} 475}
478 476
479static int init_inodecache(void) 477static int init_inodecache(void)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 71912693235..cb9afdd0e26 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -517,14 +517,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
517{ 517{
518 struct ext4_inode_info *ei = (struct ext4_inode_info *) foo; 518 struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
519 519
520 if (flags & SLAB_CTOR_CONSTRUCTOR) { 520 INIT_LIST_HEAD(&ei->i_orphan);
521 INIT_LIST_HEAD(&ei->i_orphan);
522#ifdef CONFIG_EXT4DEV_FS_XATTR 521#ifdef CONFIG_EXT4DEV_FS_XATTR
523 init_rwsem(&ei->xattr_sem); 522 init_rwsem(&ei->xattr_sem);
524#endif 523#endif
525 mutex_init(&ei->truncate_mutex); 524 mutex_init(&ei->truncate_mutex);
526 inode_init_once(&ei->vfs_inode); 525 inode_init_once(&ei->vfs_inode);
527 }
528} 526}
529 527
530static int init_inodecache(void) 528static int init_inodecache(void)
diff --git a/fs/fat/cache.c b/fs/fat/cache.c
index 1959143c1d2..3c9c8a15ec7 100644
--- a/fs/fat/cache.c
+++ b/fs/fat/cache.c
@@ -40,8 +40,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
40{ 40{
41 struct fat_cache *cache = (struct fat_cache *)foo; 41 struct fat_cache *cache = (struct fat_cache *)foo;
42 42
43 if (flags & SLAB_CTOR_CONSTRUCTOR) 43 INIT_LIST_HEAD(&cache->cache_list);
44 INIT_LIST_HEAD(&cache->cache_list);
45} 44}
46 45
47int __init fat_cache_init(void) 46int __init fat_cache_init(void)
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 2c55e8dce79..479722d8966 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -500,14 +500,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
500{ 500{
501 struct msdos_inode_info *ei = (struct msdos_inode_info *)foo; 501 struct msdos_inode_info *ei = (struct msdos_inode_info *)foo;
502 502
503 if (flags & SLAB_CTOR_CONSTRUCTOR) { 503 spin_lock_init(&ei->cache_lru_lock);
504 spin_lock_init(&ei->cache_lru_lock); 504 ei->nr_caches = 0;
505 ei->nr_caches = 0; 505 ei->cache_valid_id = FAT_CACHE_VALID + 1;
506 ei->cache_valid_id = FAT_CACHE_VALID + 1; 506 INIT_LIST_HEAD(&ei->cache_lru);
507 INIT_LIST_HEAD(&ei->cache_lru); 507 INIT_HLIST_NODE(&ei->i_fat_hash);
508 INIT_HLIST_NODE(&ei->i_fat_hash); 508 inode_init_once(&ei->vfs_inode);
509 inode_init_once(&ei->vfs_inode);
510 }
511} 509}
512 510
513static int __init fat_init_inodecache(void) 511static int __init fat_init_inodecache(void)
diff --git a/fs/fifo.c b/fs/fifo.c
index 6e7df725678..9785e36f81e 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 8890eba1db5..bd5a772d8cc 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 acfad65a6e8..adf7995232b 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 1397018ff47..9804c0cdcb4 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,
@@ -687,8 +689,7 @@ static void fuse_inode_init_once(void *foo, struct kmem_cache *cachep,
687{ 689{
688 struct inode * inode = foo; 690 struct inode * inode = foo;
689 691
690 if (flags & SLAB_CTOR_CONSTRUCTOR) 692 inode_init_once(inode);
691 inode_init_once(inode);
692} 693}
693 694
694static int __init fuse_fs_init(void) 695static int __init fuse_fs_init(void)
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index 11477ca3a3c..b3e152db70c 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/gfs2/main.c b/fs/gfs2/main.c
index e460487c055..787a0edef10 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -27,29 +27,27 @@
27static void gfs2_init_inode_once(void *foo, struct kmem_cache *cachep, unsigned long flags) 27static void gfs2_init_inode_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
28{ 28{
29 struct gfs2_inode *ip = foo; 29 struct gfs2_inode *ip = foo;
30 if (flags & SLAB_CTOR_CONSTRUCTOR) { 30
31 inode_init_once(&ip->i_inode); 31 inode_init_once(&ip->i_inode);
32 spin_lock_init(&ip->i_spin); 32 spin_lock_init(&ip->i_spin);
33 init_rwsem(&ip->i_rw_mutex); 33 init_rwsem(&ip->i_rw_mutex);
34 memset(ip->i_cache, 0, sizeof(ip->i_cache)); 34 memset(ip->i_cache, 0, sizeof(ip->i_cache));
35 }
36} 35}
37 36
38static void gfs2_init_glock_once(void *foo, struct kmem_cache *cachep, unsigned long flags) 37static void gfs2_init_glock_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
39{ 38{
40 struct gfs2_glock *gl = foo; 39 struct gfs2_glock *gl = foo;
41 if (flags & SLAB_CTOR_CONSTRUCTOR) { 40
42 INIT_HLIST_NODE(&gl->gl_list); 41 INIT_HLIST_NODE(&gl->gl_list);
43 spin_lock_init(&gl->gl_spin); 42 spin_lock_init(&gl->gl_spin);
44 INIT_LIST_HEAD(&gl->gl_holders); 43 INIT_LIST_HEAD(&gl->gl_holders);
45 INIT_LIST_HEAD(&gl->gl_waiters1); 44 INIT_LIST_HEAD(&gl->gl_waiters1);
46 INIT_LIST_HEAD(&gl->gl_waiters3); 45 INIT_LIST_HEAD(&gl->gl_waiters3);
47 gl->gl_lvb = NULL; 46 gl->gl_lvb = NULL;
48 atomic_set(&gl->gl_lvb_count, 0); 47 atomic_set(&gl->gl_lvb_count, 0);
49 INIT_LIST_HEAD(&gl->gl_reclaim); 48 INIT_LIST_HEAD(&gl->gl_reclaim);
50 INIT_LIST_HEAD(&gl->gl_ail_list); 49 INIT_LIST_HEAD(&gl->gl_ail_list);
51 atomic_set(&gl->gl_ail_count, 0); 50 atomic_set(&gl->gl_ail_count, 0);
52 }
53} 51}
54 52
55/** 53/**
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index fafcba59387..9a934db0bd8 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/hfs/super.c b/fs/hfs/super.c
index 4f1888f16cf..92cf8751e42 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -434,8 +434,7 @@ static void hfs_init_once(void *p, struct kmem_cache *cachep, unsigned long flag
434{ 434{
435 struct hfs_inode_info *i = p; 435 struct hfs_inode_info *i = p;
436 436
437 if (flags & SLAB_CTOR_CONSTRUCTOR) 437 inode_init_once(&i->vfs_inode);
438 inode_init_once(&i->vfs_inode);
439} 438}
440 439
441static int __init init_hfs_fs(void) 440static int __init init_hfs_fs(void)
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 642012ac337..45dab5d6cc1 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/hfsplus/super.c b/fs/hfsplus/super.c
index 37afbec8a76..ebd1b380cbb 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -470,8 +470,7 @@ static void hfsplus_init_once(void *p, struct kmem_cache *cachep, unsigned long
470{ 470{
471 struct hfsplus_inode_info *i = p; 471 struct hfsplus_inode_info *i = p;
472 472
473 if (flags & SLAB_CTOR_CONSTRUCTOR) 473 inode_init_once(&i->vfs_inode);
474 inode_init_once(&i->vfs_inode);
475} 474}
476 475
477static int __init init_hfsplus_fs(void) 476static int __init init_hfsplus_fs(void)
diff --git a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c
index b52b7381d10..b6fca543544 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 9953cf9a2f1..d256559b410 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 1b95f39fbc3..29cc34abb2e 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
@@ -176,11 +177,9 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
176{ 177{
177 struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo; 178 struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo;
178 179
179 if (flags & SLAB_CTOR_CONSTRUCTOR) { 180 mutex_init(&ei->i_mutex);
180 mutex_init(&ei->i_mutex); 181 mutex_init(&ei->i_parent_mutex);
181 mutex_init(&ei->i_parent_mutex); 182 inode_init_once(&ei->vfs_inode);
182 inode_init_once(&ei->vfs_inode);
183 }
184} 183}
185 184
186static int init_inodecache(void) 185static int init_inodecache(void)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 98959b87cdf..aa083dd34e9 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -556,8 +556,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
556{ 556{
557 struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo; 557 struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo;
558 558
559 if (flags & SLAB_CTOR_CONSTRUCTOR) 559 inode_init_once(&ei->vfs_inode);
560 inode_init_once(&ei->vfs_inode);
561} 560}
562 561
563const struct file_operations hugetlbfs_file_operations = { 562const struct file_operations hugetlbfs_file_operations = {
diff --git a/fs/inode.c b/fs/inode.c
index df2ef15d03d..9a012cc5b6c 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -213,8 +213,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
213{ 213{
214 struct inode * inode = (struct inode *) foo; 214 struct inode * inode = (struct inode *) foo;
215 215
216 if (flags & SLAB_CTOR_CONSTRUCTOR) 216 inode_init_once(inode);
217 inode_init_once(inode);
218} 217}
219 218
220/* 219/*
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index e99f7ff4ecb..5c3eecf7542 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -77,8 +77,7 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
77{ 77{
78 struct iso_inode_info *ei = foo; 78 struct iso_inode_info *ei = foo;
79 79
80 if (flags & SLAB_CTOR_CONSTRUCTOR) 80 inode_init_once(&ei->vfs_inode);
81 inode_init_once(&ei->vfs_inode);
82} 81}
83 82
84static int init_inodecache(void) 83static int init_inodecache(void)
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 45368f8bbe7..6488af43bc9 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -47,10 +47,8 @@ static void jffs2_i_init_once(void * foo, struct kmem_cache * cachep, unsigned l
47{ 47{
48 struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo; 48 struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo;
49 49
50 if (flags & SLAB_CTOR_CONSTRUCTOR) { 50 init_MUTEX(&ei->sem);
51 init_MUTEX(&ei->sem); 51 inode_init_once(&ei->vfs_inode);
52 inode_init_once(&ei->vfs_inode);
53 }
54} 52}
55 53
56static int jffs2_sync_fs(struct super_block *sb, int wait) 54static int jffs2_sync_fs(struct super_block *sb, int wait)
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 6b3acb0b578..43d4f69afbe 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -184,16 +184,14 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
184{ 184{
185 struct metapage *mp = (struct metapage *)foo; 185 struct metapage *mp = (struct metapage *)foo;
186 186
187 if (flags & SLAB_CTOR_CONSTRUCTOR) { 187 mp->lid = 0;
188 mp->lid = 0; 188 mp->lsn = 0;
189 mp->lsn = 0; 189 mp->flag = 0;
190 mp->flag = 0; 190 mp->data = NULL;
191 mp->data = NULL; 191 mp->clsn = 0;
192 mp->clsn = 0; 192 mp->log = NULL;
193 mp->log = NULL; 193 set_bit(META_free, &mp->flag);
194 set_bit(META_free, &mp->flag); 194 init_waitqueue_head(&mp->wait);
195 init_waitqueue_head(&mp->wait);
196 }
197} 195}
198 196
199static inline struct metapage *alloc_metapage(gfp_t gfp_mask) 197static inline struct metapage *alloc_metapage(gfp_t gfp_mask)
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index ea9dc3e65dc..20e4ac1c79a 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -752,20 +752,18 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
752{ 752{
753 struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo; 753 struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo;
754 754
755 if (flags & SLAB_CTOR_CONSTRUCTOR) { 755 memset(jfs_ip, 0, sizeof(struct jfs_inode_info));
756 memset(jfs_ip, 0, sizeof(struct jfs_inode_info)); 756 INIT_LIST_HEAD(&jfs_ip->anon_inode_list);
757 INIT_LIST_HEAD(&jfs_ip->anon_inode_list); 757 init_rwsem(&jfs_ip->rdwrlock);
758 init_rwsem(&jfs_ip->rdwrlock); 758 mutex_init(&jfs_ip->commit_mutex);
759 mutex_init(&jfs_ip->commit_mutex); 759 init_rwsem(&jfs_ip->xattr_sem);
760 init_rwsem(&jfs_ip->xattr_sem); 760 spin_lock_init(&jfs_ip->ag_lock);
761 spin_lock_init(&jfs_ip->ag_lock); 761 jfs_ip->active_ag = -1;
762 jfs_ip->active_ag = -1;
763#ifdef CONFIG_JFS_POSIX_ACL 762#ifdef CONFIG_JFS_POSIX_ACL
764 jfs_ip->i_acl = JFS_ACL_NOT_CACHED; 763 jfs_ip->i_acl = JFS_ACL_NOT_CACHED;
765 jfs_ip->i_default_acl = JFS_ACL_NOT_CACHED; 764 jfs_ip->i_default_acl = JFS_ACL_NOT_CACHED;
766#endif 765#endif
767 inode_init_once(&jfs_ip->vfs_inode); 766 inode_init_once(&jfs_ip->vfs_inode);
768 }
769} 767}
770 768
771static int __init init_jfs_fs(void) 769static int __init init_jfs_fs(void)
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index f4d45d4d835..d070b18e539 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -153,7 +153,7 @@ nlmclnt_recovery(struct nlm_host *host)
153 if (!host->h_reclaiming++) { 153 if (!host->h_reclaiming++) {
154 nlm_get_host(host); 154 nlm_get_host(host);
155 __module_get(THIS_MODULE); 155 __module_get(THIS_MODULE);
156 if (kernel_thread(reclaimer, host, CLONE_KERNEL) < 0) 156 if (kernel_thread(reclaimer, host, CLONE_FS | CLONE_FILES) < 0)
157 module_put(THIS_MODULE); 157 module_put(THIS_MODULE);
158 } 158 }
159} 159}
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index ad21c0713ef..96070bff93f 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -221,7 +221,7 @@ nlm_bind_host(struct nlm_host *host)
221 host->h_nextrebind - jiffies); 221 host->h_nextrebind - jiffies);
222 } 222 }
223 } else { 223 } else {
224 unsigned long increment = nlmsvc_timeout * HZ; 224 unsigned long increment = nlmsvc_timeout;
225 struct rpc_timeout timeparms = { 225 struct rpc_timeout timeparms = {
226 .to_initval = increment, 226 .to_initval = increment,
227 .to_increment = increment, 227 .to_increment = increment,
diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c
index 9702956d206..5316e307a49 100644
--- a/fs/lockd/xdr.c
+++ b/fs/lockd/xdr.c
@@ -586,10 +586,6 @@ static struct rpc_version nlm_version3 = {
586 .procs = nlm_procedures, 586 .procs = nlm_procedures,
587}; 587};
588 588
589#ifdef CONFIG_LOCKD_V4
590extern struct rpc_version nlm_version4;
591#endif
592
593static struct rpc_version * nlm_versions[] = { 589static struct rpc_version * nlm_versions[] = {
594 [1] = &nlm_version1, 590 [1] = &nlm_version1,
595 [3] = &nlm_version3, 591 [3] = &nlm_version3,
diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c
index ce1efdbe1b3..846fc1d639d 100644
--- a/fs/lockd/xdr4.c
+++ b/fs/lockd/xdr4.c
@@ -123,7 +123,8 @@ static __be32 *
123nlm4_decode_lock(__be32 *p, struct nlm_lock *lock) 123nlm4_decode_lock(__be32 *p, struct nlm_lock *lock)
124{ 124{
125 struct file_lock *fl = &lock->fl; 125 struct file_lock *fl = &lock->fl;
126 __s64 len, start, end; 126 __u64 len, start;
127 __s64 end;
127 128
128 if (!(p = xdr_decode_string_inplace(p, &lock->caller, 129 if (!(p = xdr_decode_string_inplace(p, &lock->caller,
129 &lock->len, NLM_MAXSTRLEN)) 130 &lock->len, NLM_MAXSTRLEN))
@@ -417,7 +418,8 @@ nlm4clt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
417 if (resp->status == nlm_lck_denied) { 418 if (resp->status == nlm_lck_denied) {
418 struct file_lock *fl = &resp->lock.fl; 419 struct file_lock *fl = &resp->lock.fl;
419 u32 excl; 420 u32 excl;
420 s64 start, end, len; 421 __u64 start, len;
422 __s64 end;
421 423
422 memset(&resp->lock, 0, sizeof(resp->lock)); 424 memset(&resp->lock, 0, sizeof(resp->lock));
423 locks_init_lock(fl); 425 locks_init_lock(fl);
diff --git a/fs/locks.c b/fs/locks.c
index 8ec16ab5ef7..431a8b871fc 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -203,9 +203,6 @@ static void init_once(void *foo, struct kmem_cache *cache, unsigned long flags)
203{ 203{
204 struct file_lock *lock = (struct file_lock *) foo; 204 struct file_lock *lock = (struct file_lock *) foo;
205 205
206 if (!(flags & SLAB_CTOR_CONSTRUCTOR))
207 return;
208
209 locks_init_lock(lock); 206 locks_init_lock(lock);
210} 207}
211 208
diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c
index c4a554df7b7..99a12f12776 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/minix/inode.c b/fs/minix/inode.c
index 2f4d43a2a31..be4044614ac 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -73,8 +73,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
73{ 73{
74 struct minix_inode_info *ei = (struct minix_inode_info *) foo; 74 struct minix_inode_info *ei = (struct minix_inode_info *) foo;
75 75
76 if (flags & SLAB_CTOR_CONSTRUCTOR) 76 inode_init_once(&ei->vfs_inode);
77 inode_init_once(&ei->vfs_inode);
78} 77}
79 78
80static int init_inodecache(void) 79static int init_inodecache(void)
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c
index addfd3147ea..d3152f8d95c 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/inode.c b/fs/ncpfs/inode.c
index c29f00ad495..cf06eb9f050 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -60,10 +60,8 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
60{ 60{
61 struct ncp_inode_info *ei = (struct ncp_inode_info *) foo; 61 struct ncp_inode_info *ei = (struct ncp_inode_info *) foo;
62 62
63 if (flags & SLAB_CTOR_CONSTRUCTOR) { 63 mutex_init(&ei->open_mutex);
64 mutex_init(&ei->open_mutex); 64 inode_init_once(&ei->vfs_inode);
65 inode_init_once(&ei->vfs_inode);
66 }
67} 65}
68 66
69static int init_inodecache(void) 67static int init_inodecache(void)
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c
index 8843a83d4ef..c67b4bdcf71 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/callback.h b/fs/nfs/callback.h
index db3d7919c60..c2bb14e053e 100644
--- a/fs/nfs/callback.h
+++ b/fs/nfs/callback.h
@@ -24,7 +24,7 @@ enum nfs4_callback_opnum {
24}; 24};
25 25
26struct cb_compound_hdr_arg { 26struct cb_compound_hdr_arg {
27 int taglen; 27 unsigned int taglen;
28 const char *tag; 28 const char *tag;
29 unsigned int callback_ident; 29 unsigned int callback_ident;
30 unsigned nops; 30 unsigned nops;
@@ -32,7 +32,7 @@ struct cb_compound_hdr_arg {
32 32
33struct cb_compound_hdr_res { 33struct cb_compound_hdr_res {
34 __be32 *status; 34 __be32 *status;
35 int taglen; 35 unsigned int taglen;
36 const char *tag; 36 const char *tag;
37 __be32 *nops; 37 __be32 *nops;
38}; 38};
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 50c6821bad2..881fa490092 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/delegation.c b/fs/nfs/delegation.c
index 841c99a9b11..7f37d1bea83 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -226,7 +226,7 @@ restart:
226 spin_unlock(&clp->cl_lock); 226 spin_unlock(&clp->cl_lock);
227} 227}
228 228
229int nfs_do_expire_all_delegations(void *ptr) 229static int nfs_do_expire_all_delegations(void *ptr)
230{ 230{
231 struct nfs_client *clp = ptr; 231 struct nfs_client *clp = ptr;
232 struct nfs_delegation *delegation; 232 struct nfs_delegation *delegation;
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 3df42881655..c27258b5d3e 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"
@@ -607,7 +608,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
607 return res; 608 return res;
608} 609}
609 610
610loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin) 611static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
611{ 612{
612 mutex_lock(&filp->f_path.dentry->d_inode->i_mutex); 613 mutex_lock(&filp->f_path.dentry->d_inode->i_mutex);
613 switch (origin) { 614 switch (origin) {
@@ -633,7 +634,7 @@ out:
633 * All directory operations under NFS are synchronous, so fsync() 634 * All directory operations under NFS are synchronous, so fsync()
634 * is a dummy operation. 635 * is a dummy operation.
635 */ 636 */
636int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync) 637static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
637{ 638{
638 dfprintk(VFS, "NFS: fsync_dir(%s/%s) datasync %d\n", 639 dfprintk(VFS, "NFS: fsync_dir(%s/%s) datasync %d\n",
639 dentry->d_parent->d_name.name, dentry->d_name.name, 640 dentry->d_parent->d_name.name, dentry->d_name.name,
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 345aa5c0f38..00eee87510f 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 5eaee6dd040..9eb8eb4e4a0 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 2a3fd957320..bd9f5a83659 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>
@@ -1164,21 +1164,19 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
1164{ 1164{
1165 struct nfs_inode *nfsi = (struct nfs_inode *) foo; 1165 struct nfs_inode *nfsi = (struct nfs_inode *) foo;
1166 1166
1167 if (flags & SLAB_CTOR_CONSTRUCTOR) { 1167 inode_init_once(&nfsi->vfs_inode);
1168 inode_init_once(&nfsi->vfs_inode); 1168 spin_lock_init(&nfsi->req_lock);
1169 spin_lock_init(&nfsi->req_lock); 1169 INIT_LIST_HEAD(&nfsi->dirty);
1170 INIT_LIST_HEAD(&nfsi->dirty); 1170 INIT_LIST_HEAD(&nfsi->commit);
1171 INIT_LIST_HEAD(&nfsi->commit); 1171 INIT_LIST_HEAD(&nfsi->open_files);
1172 INIT_LIST_HEAD(&nfsi->open_files); 1172 INIT_LIST_HEAD(&nfsi->access_cache_entry_lru);
1173 INIT_LIST_HEAD(&nfsi->access_cache_entry_lru); 1173 INIT_LIST_HEAD(&nfsi->access_cache_inode_lru);
1174 INIT_LIST_HEAD(&nfsi->access_cache_inode_lru); 1174 INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC);
1175 INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC); 1175 atomic_set(&nfsi->data_updates, 0);
1176 atomic_set(&nfsi->data_updates, 0); 1176 nfsi->ndirty = 0;
1177 nfsi->ndirty = 0; 1177 nfsi->ncommit = 0;
1178 nfsi->ncommit = 0; 1178 nfsi->npages = 0;
1179 nfsi->npages = 0; 1179 nfs4_init_once(nfsi);
1180 nfs4_init_once(nfsi);
1181 }
1182} 1180}
1183 1181
1184static int __init nfs_init_inodecache(void) 1182static int __init nfs_init_inodecache(void)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d6a30e96578..648e0ac0f90 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -790,7 +790,7 @@ out:
790 return -EACCES; 790 return -EACCES;
791} 791}
792 792
793int nfs4_recover_expired_lease(struct nfs_server *server) 793static int nfs4_recover_expired_lease(struct nfs_server *server)
794{ 794{
795 struct nfs_client *clp = server->nfs_client; 795 struct nfs_client *clp = server->nfs_client;
796 int ret; 796 int ret;
@@ -2748,7 +2748,7 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)
2748/* This is the error handling routine for processes that are allowed 2748/* This is the error handling routine for processes that are allowed
2749 * to sleep. 2749 * to sleep.
2750 */ 2750 */
2751int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception) 2751static int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception)
2752{ 2752{
2753 struct nfs_client *clp = server->nfs_client; 2753 struct nfs_client *clp = server->nfs_client;
2754 int ret = errorcode; 2754 int ret = errorcode;
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 5fffbdfa971..8ed79d5c54f 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -104,7 +104,7 @@ struct rpc_cred *nfs4_get_renew_cred(struct nfs_client *clp)
104 return cred; 104 return cred;
105} 105}
106 106
107struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp) 107static struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp)
108{ 108{
109 struct nfs4_state_owner *sp; 109 struct nfs4_state_owner *sp;
110 110
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 938f3716678..8003c91ccb9 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -646,10 +646,10 @@ static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg)
646{ 646{
647 __be32 *p; 647 __be32 *p;
648 648
649 RESERVE_SPACE(8+sizeof(arg->stateid->data)); 649 RESERVE_SPACE(8+NFS4_STATEID_SIZE);
650 WRITE32(OP_CLOSE); 650 WRITE32(OP_CLOSE);
651 WRITE32(arg->seqid->sequence->counter); 651 WRITE32(arg->seqid->sequence->counter);
652 WRITEMEM(arg->stateid->data, sizeof(arg->stateid->data)); 652 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE);
653 653
654 return 0; 654 return 0;
655} 655}
@@ -793,17 +793,17 @@ static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args)
793 WRITE64(nfs4_lock_length(args->fl)); 793 WRITE64(nfs4_lock_length(args->fl));
794 WRITE32(args->new_lock_owner); 794 WRITE32(args->new_lock_owner);
795 if (args->new_lock_owner){ 795 if (args->new_lock_owner){
796 RESERVE_SPACE(40); 796 RESERVE_SPACE(4+NFS4_STATEID_SIZE+20);
797 WRITE32(args->open_seqid->sequence->counter); 797 WRITE32(args->open_seqid->sequence->counter);
798 WRITEMEM(args->open_stateid->data, sizeof(args->open_stateid->data)); 798 WRITEMEM(args->open_stateid->data, NFS4_STATEID_SIZE);
799 WRITE32(args->lock_seqid->sequence->counter); 799 WRITE32(args->lock_seqid->sequence->counter);
800 WRITE64(args->lock_owner.clientid); 800 WRITE64(args->lock_owner.clientid);
801 WRITE32(4); 801 WRITE32(4);
802 WRITE32(args->lock_owner.id); 802 WRITE32(args->lock_owner.id);
803 } 803 }
804 else { 804 else {
805 RESERVE_SPACE(20); 805 RESERVE_SPACE(NFS4_STATEID_SIZE+4);
806 WRITEMEM(args->lock_stateid->data, sizeof(args->lock_stateid->data)); 806 WRITEMEM(args->lock_stateid->data, NFS4_STATEID_SIZE);
807 WRITE32(args->lock_seqid->sequence->counter); 807 WRITE32(args->lock_seqid->sequence->counter);
808 } 808 }
809 809
@@ -830,11 +830,11 @@ static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *arg
830{ 830{
831 __be32 *p; 831 __be32 *p;
832 832
833 RESERVE_SPACE(44); 833 RESERVE_SPACE(12+NFS4_STATEID_SIZE+16);
834 WRITE32(OP_LOCKU); 834 WRITE32(OP_LOCKU);
835 WRITE32(nfs4_lock_type(args->fl, 0)); 835 WRITE32(nfs4_lock_type(args->fl, 0));
836 WRITE32(args->seqid->sequence->counter); 836 WRITE32(args->seqid->sequence->counter);
837 WRITEMEM(args->stateid->data, sizeof(args->stateid->data)); 837 WRITEMEM(args->stateid->data, NFS4_STATEID_SIZE);
838 WRITE64(args->fl->fl_start); 838 WRITE64(args->fl->fl_start);
839 WRITE64(nfs4_lock_length(args->fl)); 839 WRITE64(nfs4_lock_length(args->fl));
840 840
@@ -966,9 +966,9 @@ static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struc
966{ 966{
967 __be32 *p; 967 __be32 *p;
968 968
969 RESERVE_SPACE(4+sizeof(stateid->data)); 969 RESERVE_SPACE(4+NFS4_STATEID_SIZE);
970 WRITE32(NFS4_OPEN_CLAIM_DELEGATE_CUR); 970 WRITE32(NFS4_OPEN_CLAIM_DELEGATE_CUR);
971 WRITEMEM(stateid->data, sizeof(stateid->data)); 971 WRITEMEM(stateid->data, NFS4_STATEID_SIZE);
972 encode_string(xdr, name->len, name->name); 972 encode_string(xdr, name->len, name->name);
973} 973}
974 974
@@ -996,9 +996,9 @@ static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_con
996{ 996{
997 __be32 *p; 997 __be32 *p;
998 998
999 RESERVE_SPACE(8+sizeof(arg->stateid->data)); 999 RESERVE_SPACE(4+NFS4_STATEID_SIZE+4);
1000 WRITE32(OP_OPEN_CONFIRM); 1000 WRITE32(OP_OPEN_CONFIRM);
1001 WRITEMEM(arg->stateid->data, sizeof(arg->stateid->data)); 1001 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE);
1002 WRITE32(arg->seqid->sequence->counter); 1002 WRITE32(arg->seqid->sequence->counter);
1003 1003
1004 return 0; 1004 return 0;
@@ -1008,9 +1008,9 @@ static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closea
1008{ 1008{
1009 __be32 *p; 1009 __be32 *p;
1010 1010
1011 RESERVE_SPACE(8+sizeof(arg->stateid->data)); 1011 RESERVE_SPACE(4+NFS4_STATEID_SIZE+4);
1012 WRITE32(OP_OPEN_DOWNGRADE); 1012 WRITE32(OP_OPEN_DOWNGRADE);
1013 WRITEMEM(arg->stateid->data, sizeof(arg->stateid->data)); 1013 WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE);
1014 WRITE32(arg->seqid->sequence->counter); 1014 WRITE32(arg->seqid->sequence->counter);
1015 encode_share_access(xdr, arg->open_flags); 1015 encode_share_access(xdr, arg->open_flags);
1016 return 0; 1016 return 0;
@@ -1045,12 +1045,12 @@ static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context
1045 nfs4_stateid stateid; 1045 nfs4_stateid stateid;
1046 __be32 *p; 1046 __be32 *p;
1047 1047
1048 RESERVE_SPACE(16); 1048 RESERVE_SPACE(NFS4_STATEID_SIZE);
1049 if (ctx->state != NULL) { 1049 if (ctx->state != NULL) {
1050 nfs4_copy_stateid(&stateid, ctx->state, ctx->lockowner); 1050 nfs4_copy_stateid(&stateid, ctx->state, ctx->lockowner);
1051 WRITEMEM(stateid.data, sizeof(stateid.data)); 1051 WRITEMEM(stateid.data, NFS4_STATEID_SIZE);
1052 } else 1052 } else
1053 WRITEMEM(zero_stateid.data, sizeof(zero_stateid.data)); 1053 WRITEMEM(zero_stateid.data, NFS4_STATEID_SIZE);
1054} 1054}
1055 1055
1056static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args) 1056static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args)
@@ -1079,10 +1079,10 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
1079 int replen; 1079 int replen;
1080 __be32 *p; 1080 __be32 *p;
1081 1081
1082 RESERVE_SPACE(32+sizeof(nfs4_verifier)); 1082 RESERVE_SPACE(12+NFS4_VERIFIER_SIZE+20);
1083 WRITE32(OP_READDIR); 1083 WRITE32(OP_READDIR);
1084 WRITE64(readdir->cookie); 1084 WRITE64(readdir->cookie);
1085 WRITEMEM(readdir->verifier.data, sizeof(readdir->verifier.data)); 1085 WRITEMEM(readdir->verifier.data, NFS4_VERIFIER_SIZE);
1086 WRITE32(readdir->count >> 1); /* We're not doing readdirplus */ 1086 WRITE32(readdir->count >> 1); /* We're not doing readdirplus */
1087 WRITE32(readdir->count); 1087 WRITE32(readdir->count);
1088 WRITE32(2); 1088 WRITE32(2);
@@ -1190,9 +1190,9 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg)
1190{ 1190{
1191 __be32 *p; 1191 __be32 *p;
1192 1192
1193 RESERVE_SPACE(4+sizeof(zero_stateid.data)); 1193 RESERVE_SPACE(4+NFS4_STATEID_SIZE);
1194 WRITE32(OP_SETATTR); 1194 WRITE32(OP_SETATTR);
1195 WRITEMEM(zero_stateid.data, sizeof(zero_stateid.data)); 1195 WRITEMEM(zero_stateid.data, NFS4_STATEID_SIZE);
1196 RESERVE_SPACE(2*4); 1196 RESERVE_SPACE(2*4);
1197 WRITE32(1); 1197 WRITE32(1);
1198 WRITE32(FATTR4_WORD0_ACL); 1198 WRITE32(FATTR4_WORD0_ACL);
@@ -1220,9 +1220,9 @@ static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *
1220 int status; 1220 int status;
1221 __be32 *p; 1221 __be32 *p;
1222 1222
1223 RESERVE_SPACE(4+sizeof(arg->stateid.data)); 1223 RESERVE_SPACE(4+NFS4_STATEID_SIZE);
1224 WRITE32(OP_SETATTR); 1224 WRITE32(OP_SETATTR);
1225 WRITEMEM(arg->stateid.data, sizeof(arg->stateid.data)); 1225 WRITEMEM(arg->stateid.data, NFS4_STATEID_SIZE);
1226 1226
1227 if ((status = encode_attrs(xdr, arg->iap, server))) 1227 if ((status = encode_attrs(xdr, arg->iap, server)))
1228 return status; 1228 return status;
@@ -1234,9 +1234,9 @@ static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclien
1234{ 1234{
1235 __be32 *p; 1235 __be32 *p;
1236 1236
1237 RESERVE_SPACE(4 + sizeof(setclientid->sc_verifier->data)); 1237 RESERVE_SPACE(4 + NFS4_VERIFIER_SIZE);
1238 WRITE32(OP_SETCLIENTID); 1238 WRITE32(OP_SETCLIENTID);
1239 WRITEMEM(setclientid->sc_verifier->data, sizeof(setclientid->sc_verifier->data)); 1239 WRITEMEM(setclientid->sc_verifier->data, NFS4_VERIFIER_SIZE);
1240 1240
1241 encode_string(xdr, setclientid->sc_name_len, setclientid->sc_name); 1241 encode_string(xdr, setclientid->sc_name_len, setclientid->sc_name);
1242 RESERVE_SPACE(4); 1242 RESERVE_SPACE(4);
@@ -1253,10 +1253,10 @@ static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_c
1253{ 1253{
1254 __be32 *p; 1254 __be32 *p;
1255 1255
1256 RESERVE_SPACE(12 + sizeof(client_state->cl_confirm.data)); 1256 RESERVE_SPACE(12 + NFS4_VERIFIER_SIZE);
1257 WRITE32(OP_SETCLIENTID_CONFIRM); 1257 WRITE32(OP_SETCLIENTID_CONFIRM);
1258 WRITE64(client_state->cl_clientid); 1258 WRITE64(client_state->cl_clientid);
1259 WRITEMEM(client_state->cl_confirm.data, sizeof(client_state->cl_confirm.data)); 1259 WRITEMEM(client_state->cl_confirm.data, NFS4_VERIFIER_SIZE);
1260 1260
1261 return 0; 1261 return 0;
1262} 1262}
@@ -1284,10 +1284,10 @@ static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *statei
1284{ 1284{
1285 __be32 *p; 1285 __be32 *p;
1286 1286
1287 RESERVE_SPACE(20); 1287 RESERVE_SPACE(4+NFS4_STATEID_SIZE);
1288 1288
1289 WRITE32(OP_DELEGRETURN); 1289 WRITE32(OP_DELEGRETURN);
1290 WRITEMEM(stateid->data, sizeof(stateid->data)); 1290 WRITEMEM(stateid->data, NFS4_STATEID_SIZE);
1291 return 0; 1291 return 0;
1292 1292
1293} 1293}
@@ -2494,7 +2494,7 @@ static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, st
2494 int i; 2494 int i;
2495 dprintk("%s: using first %d of %d servers returned for location %d\n", __FUNCTION__, NFS4_FS_LOCATION_MAXSERVERS, m, res->nlocations); 2495 dprintk("%s: using first %d of %d servers returned for location %d\n", __FUNCTION__, NFS4_FS_LOCATION_MAXSERVERS, m, res->nlocations);
2496 for (i = loc->nservers; i < m; i++) { 2496 for (i = loc->nservers; i < m; i++) {
2497 int len; 2497 unsigned int len;
2498 char *data; 2498 char *data;
2499 status = decode_opaque_inline(xdr, &len, &data); 2499 status = decode_opaque_inline(xdr, &len, &data);
2500 if (unlikely(status != 0)) 2500 if (unlikely(status != 0))
@@ -2642,7 +2642,7 @@ static int decode_attr_nlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t
2642 return 0; 2642 return 0;
2643} 2643}
2644 2644
2645static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, int32_t *uid) 2645static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, uint32_t *uid)
2646{ 2646{
2647 uint32_t len; 2647 uint32_t len;
2648 __be32 *p; 2648 __be32 *p;
@@ -2667,7 +2667,7 @@ static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nf
2667 return 0; 2667 return 0;
2668} 2668}
2669 2669
2670static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, int32_t *gid) 2670static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, uint32_t *gid)
2671{ 2671{
2672 uint32_t len; 2672 uint32_t len;
2673 __be32 *p; 2673 __be32 *p;
@@ -2897,8 +2897,8 @@ static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res)
2897 status = decode_op_hdr(xdr, OP_CLOSE); 2897 status = decode_op_hdr(xdr, OP_CLOSE);
2898 if (status) 2898 if (status)
2899 return status; 2899 return status;
2900 READ_BUF(sizeof(res->stateid.data)); 2900 READ_BUF(NFS4_STATEID_SIZE);
2901 COPYMEM(res->stateid.data, sizeof(res->stateid.data)); 2901 COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
2902 return 0; 2902 return 0;
2903} 2903}
2904 2904
@@ -3186,8 +3186,8 @@ static int decode_lock(struct xdr_stream *xdr, struct nfs_lock_res *res)
3186 3186
3187 status = decode_op_hdr(xdr, OP_LOCK); 3187 status = decode_op_hdr(xdr, OP_LOCK);
3188 if (status == 0) { 3188 if (status == 0) {
3189 READ_BUF(sizeof(res->stateid.data)); 3189 READ_BUF(NFS4_STATEID_SIZE);
3190 COPYMEM(res->stateid.data, sizeof(res->stateid.data)); 3190 COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
3191 } else if (status == -NFS4ERR_DENIED) 3191 } else if (status == -NFS4ERR_DENIED)
3192 return decode_lock_denied(xdr, NULL); 3192 return decode_lock_denied(xdr, NULL);
3193 return status; 3193 return status;
@@ -3209,8 +3209,8 @@ static int decode_locku(struct xdr_stream *xdr, struct nfs_locku_res *res)
3209 3209
3210 status = decode_op_hdr(xdr, OP_LOCKU); 3210 status = decode_op_hdr(xdr, OP_LOCKU);
3211 if (status == 0) { 3211 if (status == 0) {
3212 READ_BUF(sizeof(res->stateid.data)); 3212 READ_BUF(NFS4_STATEID_SIZE);
3213 COPYMEM(res->stateid.data, sizeof(res->stateid.data)); 3213 COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
3214 } 3214 }
3215 return status; 3215 return status;
3216} 3216}
@@ -3251,8 +3251,8 @@ static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res)
3251 res->delegation_type = 0; 3251 res->delegation_type = 0;
3252 return 0; 3252 return 0;
3253 } 3253 }
3254 READ_BUF(20); 3254 READ_BUF(NFS4_STATEID_SIZE+4);
3255 COPYMEM(res->delegation.data, sizeof(res->delegation.data)); 3255 COPYMEM(res->delegation.data, NFS4_STATEID_SIZE);
3256 READ32(res->do_recall); 3256 READ32(res->do_recall);
3257 switch (delegation_type) { 3257 switch (delegation_type) {
3258 case NFS4_OPEN_DELEGATE_READ: 3258 case NFS4_OPEN_DELEGATE_READ:
@@ -3275,8 +3275,8 @@ static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
3275 status = decode_op_hdr(xdr, OP_OPEN); 3275 status = decode_op_hdr(xdr, OP_OPEN);
3276 if (status) 3276 if (status)
3277 return status; 3277 return status;
3278 READ_BUF(sizeof(res->stateid.data)); 3278 READ_BUF(NFS4_STATEID_SIZE);
3279 COPYMEM(res->stateid.data, sizeof(res->stateid.data)); 3279 COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
3280 3280
3281 decode_change_info(xdr, &res->cinfo); 3281 decode_change_info(xdr, &res->cinfo);
3282 3282
@@ -3302,8 +3302,8 @@ static int decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmre
3302 status = decode_op_hdr(xdr, OP_OPEN_CONFIRM); 3302 status = decode_op_hdr(xdr, OP_OPEN_CONFIRM);
3303 if (status) 3303 if (status)
3304 return status; 3304 return status;
3305 READ_BUF(sizeof(res->stateid.data)); 3305 READ_BUF(NFS4_STATEID_SIZE);
3306 COPYMEM(res->stateid.data, sizeof(res->stateid.data)); 3306 COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
3307 return 0; 3307 return 0;
3308} 3308}
3309 3309
@@ -3315,8 +3315,8 @@ static int decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *re
3315 status = decode_op_hdr(xdr, OP_OPEN_DOWNGRADE); 3315 status = decode_op_hdr(xdr, OP_OPEN_DOWNGRADE);
3316 if (status) 3316 if (status)
3317 return status; 3317 return status;
3318 READ_BUF(sizeof(res->stateid.data)); 3318 READ_BUF(NFS4_STATEID_SIZE);
3319 COPYMEM(res->stateid.data, sizeof(res->stateid.data)); 3319 COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
3320 return 0; 3320 return 0;
3321} 3321}
3322 3322
@@ -3590,9 +3590,9 @@ static int decode_setclientid(struct xdr_stream *xdr, struct nfs_client *clp)
3590 } 3590 }
3591 READ32(nfserr); 3591 READ32(nfserr);
3592 if (nfserr == NFS_OK) { 3592 if (nfserr == NFS_OK) {
3593 READ_BUF(8 + sizeof(clp->cl_confirm.data)); 3593 READ_BUF(8 + NFS4_VERIFIER_SIZE);
3594 READ64(clp->cl_clientid); 3594 READ64(clp->cl_clientid);
3595 COPYMEM(clp->cl_confirm.data, sizeof(clp->cl_confirm.data)); 3595 COPYMEM(clp->cl_confirm.data, NFS4_VERIFIER_SIZE);
3596 } else if (nfserr == NFSERR_CLID_INUSE) { 3596 } else if (nfserr == NFSERR_CLID_INUSE) {
3597 uint32_t len; 3597 uint32_t len;
3598 3598
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index e12054c86d0..c5bb51a29e8 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/read.c b/fs/nfs/read.c
index 9a55807b2a7..7bd7cb95c03 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -79,7 +79,7 @@ void nfs_readdata_release(void *data)
79static 79static
80int nfs_return_empty_page(struct page *page) 80int nfs_return_empty_page(struct page *page)
81{ 81{
82 memclear_highpage_flush(page, 0, PAGE_CACHE_SIZE); 82 zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
83 SetPageUptodate(page); 83 SetPageUptodate(page);
84 unlock_page(page); 84 unlock_page(page);
85 return 0; 85 return 0;
@@ -103,10 +103,10 @@ static void nfs_readpage_truncate_uninitialised_page(struct nfs_read_data *data)
103 pglen = PAGE_CACHE_SIZE - base; 103 pglen = PAGE_CACHE_SIZE - base;
104 for (;;) { 104 for (;;) {
105 if (remainder <= pglen) { 105 if (remainder <= pglen) {
106 memclear_highpage_flush(*pages, base, remainder); 106 zero_user_page(*pages, base, remainder, KM_USER0);
107 break; 107 break;
108 } 108 }
109 memclear_highpage_flush(*pages, base, pglen); 109 zero_user_page(*pages, base, pglen, KM_USER0);
110 pages++; 110 pages++;
111 remainder -= pglen; 111 remainder -= pglen;
112 pglen = PAGE_CACHE_SIZE; 112 pglen = PAGE_CACHE_SIZE;
@@ -130,7 +130,7 @@ static int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode,
130 return PTR_ERR(new); 130 return PTR_ERR(new);
131 } 131 }
132 if (len < PAGE_CACHE_SIZE) 132 if (len < PAGE_CACHE_SIZE)
133 memclear_highpage_flush(page, len, PAGE_CACHE_SIZE - len); 133 zero_user_page(page, len, PAGE_CACHE_SIZE - len, KM_USER0);
134 134
135 nfs_list_add_request(new, &one_request); 135 nfs_list_add_request(new, &one_request);
136 if (NFS_SERVER(inode)->rsize < PAGE_CACHE_SIZE) 136 if (NFS_SERVER(inode)->rsize < PAGE_CACHE_SIZE)
@@ -532,7 +532,7 @@ readpage_async_filler(void *data, struct page *page)
532 return PTR_ERR(new); 532 return PTR_ERR(new);
533 } 533 }
534 if (len < PAGE_CACHE_SIZE) 534 if (len < PAGE_CACHE_SIZE)
535 memclear_highpage_flush(page, len, PAGE_CACHE_SIZE - len); 535 zero_user_page(page, len, PAGE_CACHE_SIZE - len, KM_USER0);
536 nfs_pageio_add_request(desc->pgio, new); 536 nfs_pageio_add_request(desc->pgio, new);
537 return 0; 537 return 0;
538} 538}
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index de92b9509d9..af344a158e0 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -58,7 +58,7 @@ struct nfs_write_data *nfs_commit_alloc(void)
58 return p; 58 return p;
59} 59}
60 60
61void nfs_commit_rcu_free(struct rcu_head *head) 61static void nfs_commit_rcu_free(struct rcu_head *head)
62{ 62{
63 struct nfs_write_data *p = container_of(head, struct nfs_write_data, task.u.tk_rcu); 63 struct nfs_write_data *p = container_of(head, struct nfs_write_data, task.u.tk_rcu);
64 if (p && (p->pagevec != &p->page_array[0])) 64 if (p && (p->pagevec != &p->page_array[0]))
@@ -168,7 +168,7 @@ static void nfs_mark_uptodate(struct page *page, unsigned int base, unsigned int
168 if (count != nfs_page_length(page)) 168 if (count != nfs_page_length(page))
169 return; 169 return;
170 if (count != PAGE_CACHE_SIZE) 170 if (count != PAGE_CACHE_SIZE)
171 memclear_highpage_flush(page, count, PAGE_CACHE_SIZE - count); 171 zero_user_page(page, count, PAGE_CACHE_SIZE - count, KM_USER0);
172 SetPageUptodate(page); 172 SetPageUptodate(page);
173} 173}
174 174
@@ -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;
@@ -922,7 +924,7 @@ static int nfs_flush_one(struct inode *inode, struct list_head *head, unsigned i
922 return 0; 924 return 0;
923 out_bad: 925 out_bad:
924 while (!list_empty(head)) { 926 while (!list_empty(head)) {
925 struct nfs_page *req = nfs_list_entry(head->next); 927 req = nfs_list_entry(head->next);
926 nfs_list_remove_request(req); 928 nfs_list_remove_request(req);
927 nfs_redirty_request(req); 929 nfs_redirty_request(req);
928 nfs_end_page_writeback(req->wb_page); 930 nfs_end_page_writeback(req->wb_page);
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 32ffea033c7..864090edc28 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 c7774e3a946..ebd03cc0747 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 d7759ce6ed9..ff55950efb4 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 39a1669506b..7ed56390b58 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/super.c b/fs/ntfs/super.c
index 21d834e5ed7..4566b918255 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -3085,8 +3085,7 @@ static void ntfs_big_inode_init_once(void *foo, struct kmem_cache *cachep,
3085{ 3085{
3086 ntfs_inode *ni = (ntfs_inode *)foo; 3086 ntfs_inode *ni = (ntfs_inode *)foo;
3087 3087
3088 if (flags & SLAB_CTOR_CONSTRUCTOR) 3088 inode_init_once(VFS_I(ni));
3089 inode_init_once(VFS_I(ni));
3090} 3089}
3091 3090
3092/* 3091/*
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 8e7cafb5fc6..0023b31e48a 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/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c
index 5671cf9d638..fd8cb1badc9 100644
--- a/fs/ocfs2/dlm/dlmfs.c
+++ b/fs/ocfs2/dlm/dlmfs.c
@@ -262,12 +262,10 @@ static void dlmfs_init_once(void *foo,
262 struct dlmfs_inode_private *ip = 262 struct dlmfs_inode_private *ip =
263 (struct dlmfs_inode_private *) foo; 263 (struct dlmfs_inode_private *) foo;
264 264
265 if (flags & SLAB_CTOR_CONSTRUCTOR) { 265 ip->ip_dlm = NULL;
266 ip->ip_dlm = NULL; 266 ip->ip_parent = NULL;
267 ip->ip_parent = NULL;
268 267
269 inode_init_once(&ip->ip_vfs_inode); 268 inode_init_once(&ip->ip_vfs_inode);
270 }
271} 269}
272 270
273static struct inode *dlmfs_alloc_inode(struct super_block *sb) 271static struct inode *dlmfs_alloc_inode(struct super_block *sb)
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 9395b4fa547..ac6c96431bb 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 4dedd978910..545f7892cdf 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/ocfs2/super.c b/fs/ocfs2/super.c
index 7c5e3f5d663..86b559c7dce 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -937,31 +937,29 @@ static void ocfs2_inode_init_once(void *data,
937{ 937{
938 struct ocfs2_inode_info *oi = data; 938 struct ocfs2_inode_info *oi = data;
939 939
940 if (flags & SLAB_CTOR_CONSTRUCTOR) { 940 oi->ip_flags = 0;
941 oi->ip_flags = 0; 941 oi->ip_open_count = 0;
942 oi->ip_open_count = 0; 942 spin_lock_init(&oi->ip_lock);
943 spin_lock_init(&oi->ip_lock); 943 ocfs2_extent_map_init(&oi->vfs_inode);
944 ocfs2_extent_map_init(&oi->vfs_inode); 944 INIT_LIST_HEAD(&oi->ip_io_markers);
945 INIT_LIST_HEAD(&oi->ip_io_markers); 945 oi->ip_created_trans = 0;
946 oi->ip_created_trans = 0; 946 oi->ip_last_trans = 0;
947 oi->ip_last_trans = 0; 947 oi->ip_dir_start_lookup = 0;
948 oi->ip_dir_start_lookup = 0;
949 948
950 init_rwsem(&oi->ip_alloc_sem); 949 init_rwsem(&oi->ip_alloc_sem);
951 mutex_init(&oi->ip_io_mutex); 950 mutex_init(&oi->ip_io_mutex);
952 951
953 oi->ip_blkno = 0ULL; 952 oi->ip_blkno = 0ULL;
954 oi->ip_clusters = 0; 953 oi->ip_clusters = 0;
955 954
956 ocfs2_lock_res_init_once(&oi->ip_rw_lockres); 955 ocfs2_lock_res_init_once(&oi->ip_rw_lockres);
957 ocfs2_lock_res_init_once(&oi->ip_meta_lockres); 956 ocfs2_lock_res_init_once(&oi->ip_meta_lockres);
958 ocfs2_lock_res_init_once(&oi->ip_data_lockres); 957 ocfs2_lock_res_init_once(&oi->ip_data_lockres);
959 ocfs2_lock_res_init_once(&oi->ip_open_lockres); 958 ocfs2_lock_res_init_once(&oi->ip_open_lockres);
960 959
961 ocfs2_metadata_cache_init(&oi->vfs_inode); 960 ocfs2_metadata_cache_init(&oi->vfs_inode);
962 961
963 inode_init_once(&oi->vfs_inode); 962 inode_init_once(&oi->vfs_inode);
964 }
965} 963}
966 964
967static int ocfs2_initialize_mem_caches(void) 965static int ocfs2_initialize_mem_caches(void)
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
index 731a90e9f0c..e62397341c3 100644
--- a/fs/openpromfs/inode.c
+++ b/fs/openpromfs/inode.c
@@ -419,8 +419,7 @@ static void op_inode_init_once(void *data, struct kmem_cache * cachep, unsigned
419{ 419{
420 struct op_inode_info *oi = (struct op_inode_info *) data; 420 struct op_inode_info *oi = (struct op_inode_info *) data;
421 421
422 if (flags & SLAB_CTOR_CONSTRUCTOR) 422 inode_init_once(&oi->vfs_inode);
423 inode_init_once(&oi->vfs_inode);
424} 423}
425 424
426static int __init init_openprom_fs(void) 425static int __init init_openprom_fs(void)
diff --git a/fs/partitions/Kconfig b/fs/partitions/Kconfig
index 7638a1c42a7..a99acd8de35 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 1a60926a4cc..99873a2b4cb 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 6e8d7952b8b..d2e6a304693 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/proc/inode.c b/fs/proc/inode.c
index b8171907c83..d5ce65c68d7 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -109,8 +109,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
109{ 109{
110 struct proc_inode *ei = (struct proc_inode *) foo; 110 struct proc_inode *ei = (struct proc_inode *) foo;
111 111
112 if (flags & SLAB_CTOR_CONSTRUCTOR) 112 inode_init_once(&ei->vfs_inode);
113 inode_init_once(&ei->vfs_inode);
114} 113}
115 114
116int __init proc_init_inodecache(void) 115int __init proc_init_inodecache(void)
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index 75fc8498f2e..8d256eb1181 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -536,8 +536,7 @@ static void init_once(void *foo, struct kmem_cache * cachep,
536{ 536{
537 struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo; 537 struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo;
538 538
539 if (flags & SLAB_CTOR_CONSTRUCTOR) 539 inode_init_once(&ei->vfs_inode);
540 inode_init_once(&ei->vfs_inode);
541} 540}
542 541
543static int init_inodecache(void) 542static int init_inodecache(void)
diff --git a/fs/quota.c b/fs/quota.c
index e9d88fd0eca..9f237d6182c 100644
--- a/fs/quota.c
+++ b/fs/quota.c
@@ -157,7 +157,6 @@ static int check_quotactl_valid(struct super_block *sb, int type, int cmd, qid_t
157static void quota_sync_sb(struct super_block *sb, int type) 157static void quota_sync_sb(struct super_block *sb, int type)
158{ 158{
159 int cnt; 159 int cnt;
160 struct inode *discard[MAXQUOTAS];
161 160
162 sb->s_qcop->quota_sync(sb, type); 161 sb->s_qcop->quota_sync(sb, type);
163 /* This is not very clever (and fast) but currently I don't know about 162 /* This is not very clever (and fast) but currently I don't know about
@@ -167,29 +166,21 @@ static void quota_sync_sb(struct super_block *sb, int type)
167 sb->s_op->sync_fs(sb, 1); 166 sb->s_op->sync_fs(sb, 1);
168 sync_blockdev(sb->s_bdev); 167 sync_blockdev(sb->s_bdev);
169 168
170 /* Now when everything is written we can discard the pagecache so 169 /*
171 * that userspace sees the changes. We need i_mutex and so we could 170 * Now when everything is written we can discard the pagecache so
172 * not do it inside dqonoff_mutex. Moreover we need to be carefull 171 * that userspace sees the changes.
173 * about races with quotaoff() (that is the reason why we have own 172 */
174 * reference to inode). */
175 mutex_lock(&sb_dqopt(sb)->dqonoff_mutex); 173 mutex_lock(&sb_dqopt(sb)->dqonoff_mutex);
176 for (cnt = 0; cnt < MAXQUOTAS; cnt++) { 174 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
177 discard[cnt] = NULL;
178 if (type != -1 && cnt != type) 175 if (type != -1 && cnt != type)
179 continue; 176 continue;
180 if (!sb_has_quota_enabled(sb, cnt)) 177 if (!sb_has_quota_enabled(sb, cnt))
181 continue; 178 continue;
182 discard[cnt] = igrab(sb_dqopt(sb)->files[cnt]); 179 mutex_lock_nested(&sb_dqopt(sb)->files[cnt]->i_mutex, I_MUTEX_QUOTA);
180 truncate_inode_pages(&sb_dqopt(sb)->files[cnt]->i_data, 0);
181 mutex_unlock(&sb_dqopt(sb)->files[cnt]->i_mutex);
183 } 182 }
184 mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); 183 mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex);
185 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
186 if (discard[cnt]) {
187 mutex_lock(&discard[cnt]->i_mutex);
188 truncate_inode_pages(&discard[cnt]->i_data, 0);
189 mutex_unlock(&discard[cnt]->i_mutex);
190 iput(discard[cnt]);
191 }
192 }
193} 184}
194 185
195void sync_dquots(struct super_block *sb, int type) 186void sync_dquots(struct super_block *sb, int type)
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index 3b481d557ed..9345a46ffb3 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 4ace5d72eae..d40d22b347b 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 9c23fee3bae..ffbfc2caaf2 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/reiserfs/super.c b/fs/reiserfs/super.c
index c7762140c42..b4ac9119200 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -511,14 +511,12 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
511{ 511{
512 struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo; 512 struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo;
513 513
514 if (flags & SLAB_CTOR_CONSTRUCTOR) { 514 INIT_LIST_HEAD(&ei->i_prealloc_list);
515 INIT_LIST_HEAD(&ei->i_prealloc_list); 515 inode_init_once(&ei->vfs_inode);
516 inode_init_once(&ei->vfs_inode);
517#ifdef CONFIG_REISERFS_FS_POSIX_ACL 516#ifdef CONFIG_REISERFS_FS_POSIX_ACL
518 ei->i_acl_access = NULL; 517 ei->i_acl_access = NULL;
519 ei->i_acl_default = NULL; 518 ei->i_acl_default = NULL;
520#endif 519#endif
521 }
522} 520}
523 521
524static int init_inodecache(void) 522static int init_inodecache(void)
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c
index 80428519027..2284e03342c 100644
--- a/fs/romfs/inode.c
+++ b/fs/romfs/inode.c
@@ -566,12 +566,11 @@ static void romfs_destroy_inode(struct inode *inode)
566 kmem_cache_free(romfs_inode_cachep, ROMFS_I(inode)); 566 kmem_cache_free(romfs_inode_cachep, ROMFS_I(inode));
567} 567}
568 568
569static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags) 569static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
570{ 570{
571 struct romfs_inode_info *ei = (struct romfs_inode_info *) foo; 571 struct romfs_inode_info *ei = foo;
572 572
573 if (flags & SLAB_CTOR_CONSTRUCTOR) 573 inode_init_once(&ei->vfs_inode);
574 inode_init_once(&ei->vfs_inode);
575} 574}
576 575
577static int init_inodecache(void) 576static int init_inodecache(void)
diff --git a/fs/signalfd.c b/fs/signalfd.c
index 7cfeab412b4..f1da89203a9 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 50136b1a3ec..48da4fa6b7d 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 f161797160c..aea3f8aa54c 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 424a3ddf86d..6724a6cf01f 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>
@@ -70,8 +71,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
70{ 71{
71 struct smb_inode_info *ei = (struct smb_inode_info *) foo; 72 struct smb_inode_info *ei = (struct smb_inode_info *) foo;
72 73
73 if (flags & SLAB_CTOR_CONSTRUCTOR) 74 inode_init_once(&ei->vfs_inode);
74 inode_init_once(&ei->vfs_inode);
75} 75}
76 76
77static int init_inodecache(void) 77static int init_inodecache(void)
diff --git a/fs/smbfs/request.c b/fs/smbfs/request.c
index c288fbe7953..3f54a0f80fa 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 4de5c6b8991..bdd30e74de6 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/sysv/inode.c b/fs/sysv/inode.c
index 3152d741560..56441169339 100644
--- a/fs/sysv/inode.c
+++ b/fs/sysv/inode.c
@@ -322,8 +322,7 @@ static void init_once(void *p, struct kmem_cache *cachep, unsigned long flags)
322{ 322{
323 struct sysv_inode_info *si = (struct sysv_inode_info *)p; 323 struct sysv_inode_info *si = (struct sysv_inode_info *)p;
324 324
325 if (flags & SLAB_CTOR_CONSTRUCTOR) 325 inode_init_once(&si->vfs_inode);
326 inode_init_once(&si->vfs_inode);
327} 326}
328 327
329const struct super_operations sysv_sops = { 328const struct super_operations sysv_sops = {
diff --git a/fs/timerfd.c b/fs/timerfd.c
index e329e37f15a..af9eca5c023 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -24,7 +24,6 @@
24struct timerfd_ctx { 24struct timerfd_ctx {
25 struct hrtimer tmr; 25 struct hrtimer tmr;
26 ktime_t tintv; 26 ktime_t tintv;
27 spinlock_t lock;
28 wait_queue_head_t wqh; 27 wait_queue_head_t wqh;
29 int expired; 28 int expired;
30}; 29};
@@ -39,10 +38,10 @@ static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr)
39 struct timerfd_ctx *ctx = container_of(htmr, struct timerfd_ctx, tmr); 38 struct timerfd_ctx *ctx = container_of(htmr, struct timerfd_ctx, tmr);
40 unsigned long flags; 39 unsigned long flags;
41 40
42 spin_lock_irqsave(&ctx->lock, flags); 41 spin_lock_irqsave(&ctx->wqh.lock, flags);
43 ctx->expired = 1; 42 ctx->expired = 1;
44 wake_up_locked(&ctx->wqh); 43 wake_up_locked(&ctx->wqh);
45 spin_unlock_irqrestore(&ctx->lock, flags); 44 spin_unlock_irqrestore(&ctx->wqh.lock, flags);
46 45
47 return HRTIMER_NORESTART; 46 return HRTIMER_NORESTART;
48} 47}
@@ -83,10 +82,10 @@ static unsigned int timerfd_poll(struct file *file, poll_table *wait)
83 82
84 poll_wait(file, &ctx->wqh, wait); 83 poll_wait(file, &ctx->wqh, wait);
85 84
86 spin_lock_irqsave(&ctx->lock, flags); 85 spin_lock_irqsave(&ctx->wqh.lock, flags);
87 if (ctx->expired) 86 if (ctx->expired)
88 events |= POLLIN; 87 events |= POLLIN;
89 spin_unlock_irqrestore(&ctx->lock, flags); 88 spin_unlock_irqrestore(&ctx->wqh.lock, flags);
90 89
91 return events; 90 return events;
92} 91}
@@ -101,7 +100,7 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
101 100
102 if (count < sizeof(ticks)) 101 if (count < sizeof(ticks))
103 return -EINVAL; 102 return -EINVAL;
104 spin_lock_irq(&ctx->lock); 103 spin_lock_irq(&ctx->wqh.lock);
105 res = -EAGAIN; 104 res = -EAGAIN;
106 if (!ctx->expired && !(file->f_flags & O_NONBLOCK)) { 105 if (!ctx->expired && !(file->f_flags & O_NONBLOCK)) {
107 __add_wait_queue(&ctx->wqh, &wait); 106 __add_wait_queue(&ctx->wqh, &wait);
@@ -115,9 +114,9 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
115 res = -ERESTARTSYS; 114 res = -ERESTARTSYS;
116 break; 115 break;
117 } 116 }
118 spin_unlock_irq(&ctx->lock); 117 spin_unlock_irq(&ctx->wqh.lock);
119 schedule(); 118 schedule();
120 spin_lock_irq(&ctx->lock); 119 spin_lock_irq(&ctx->wqh.lock);
121 } 120 }
122 __remove_wait_queue(&ctx->wqh, &wait); 121 __remove_wait_queue(&ctx->wqh, &wait);
123 __set_current_state(TASK_RUNNING); 122 __set_current_state(TASK_RUNNING);
@@ -139,7 +138,7 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
139 } else 138 } else
140 ticks = 1; 139 ticks = 1;
141 } 140 }
142 spin_unlock_irq(&ctx->lock); 141 spin_unlock_irq(&ctx->wqh.lock);
143 if (ticks) 142 if (ticks)
144 res = put_user(ticks, buf) ? -EFAULT: sizeof(ticks); 143 res = put_user(ticks, buf) ? -EFAULT: sizeof(ticks);
145 return res; 144 return res;
@@ -176,7 +175,6 @@ asmlinkage long sys_timerfd(int ufd, int clockid, int flags,
176 return -ENOMEM; 175 return -ENOMEM;
177 176
178 init_waitqueue_head(&ctx->wqh); 177 init_waitqueue_head(&ctx->wqh);
179 spin_lock_init(&ctx->lock);
180 178
181 timerfd_setup(ctx, clockid, flags, &ktmr); 179 timerfd_setup(ctx, clockid, flags, &ktmr);
182 180
@@ -202,10 +200,10 @@ asmlinkage long sys_timerfd(int ufd, int clockid, int flags,
202 * it to the new values. 200 * it to the new values.
203 */ 201 */
204 for (;;) { 202 for (;;) {
205 spin_lock_irq(&ctx->lock); 203 spin_lock_irq(&ctx->wqh.lock);
206 if (hrtimer_try_to_cancel(&ctx->tmr) >= 0) 204 if (hrtimer_try_to_cancel(&ctx->tmr) >= 0)
207 break; 205 break;
208 spin_unlock_irq(&ctx->lock); 206 spin_unlock_irq(&ctx->wqh.lock);
209 cpu_relax(); 207 cpu_relax();
210 } 208 }
211 /* 209 /*
@@ -213,7 +211,7 @@ asmlinkage long sys_timerfd(int ufd, int clockid, int flags,
213 */ 211 */
214 timerfd_setup(ctx, clockid, flags, &ktmr); 212 timerfd_setup(ctx, clockid, flags, &ktmr);
215 213
216 spin_unlock_irq(&ctx->lock); 214 spin_unlock_irq(&ctx->wqh.lock);
217 fput(file); 215 fput(file);
218 } 216 }
219 217
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 40d5047defe..51b5764685e 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/namei.c b/fs/udf/namei.c
index 91df4928651..51fe307dc0e 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 9b8644a06e5..3a743d854c1 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -134,10 +134,8 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
134{ 134{
135 struct udf_inode_info *ei = (struct udf_inode_info *) foo; 135 struct udf_inode_info *ei = (struct udf_inode_info *) foo;
136 136
137 if (flags & SLAB_CTOR_CONSTRUCTOR) { 137 ei->i_ext.i_data = NULL;
138 ei->i_ext.i_data = NULL; 138 inode_init_once(&ei->vfs_inode);
139 inode_init_once(&ei->vfs_inode);
140 }
141} 139}
142 140
143static int init_inodecache(void) 141static int init_inodecache(void)
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index be7c48c5f20..22ff6ed55ce 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1237,8 +1237,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
1237{ 1237{
1238 struct ufs_inode_info *ei = (struct ufs_inode_info *) foo; 1238 struct ufs_inode_info *ei = (struct ufs_inode_info *) foo;
1239 1239
1240 if (flags & SLAB_CTOR_CONSTRUCTOR) 1240 inode_init_once(&ei->vfs_inode);
1241 inode_init_once(&ei->vfs_inode);
1242} 1241}
1243 1242
1244static int init_inodecache(void) 1243static int init_inodecache(void)
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 4475588e973..7361861e3aa 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/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 14e2cbe5a8d..bf9a9d5909b 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -360,8 +360,7 @@ xfs_fs_inode_init_once(
360 kmem_zone_t *zonep, 360 kmem_zone_t *zonep,
361 unsigned long flags) 361 unsigned long flags)
362{ 362{
363 if (flags & SLAB_CTOR_CONSTRUCTOR) 363 inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
364 inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
365} 364}
366 365
367STATIC int 366STATIC int
diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h
index f9d2bde9a7b..b62cd36ff32 100644
--- a/include/acpi/acpi_numa.h
+++ b/include/acpi/acpi_numa.h
@@ -11,11 +11,8 @@
11#define MAX_PXM_DOMAINS (256) /* Old pxm spec is defined 8 bit */ 11#define MAX_PXM_DOMAINS (256) /* Old pxm spec is defined 8 bit */
12#endif 12#endif
13 13
14extern int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS]; 14extern int pxm_to_node(int);
15extern int __cpuinitdata node_to_pxm_map[MAX_NUMNODES]; 15extern int node_to_pxm(int);
16
17extern int __cpuinit pxm_to_node(int);
18extern int __cpuinit node_to_pxm(int);
19extern int __cpuinit acpi_map_pxm_to_node(int); 16extern int __cpuinit acpi_map_pxm_to_node(int);
20extern void __cpuinit acpi_unmap_pxm_to_node(int); 17extern void __cpuinit acpi_unmap_pxm_to_node(int);
21 18
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
index 4b6ef7f21b9..3a0cbeb03fa 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/thread_info.h b/include/asm-alpha/thread_info.h
index f4defc2bd3f..48a22e3e6f3 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 e58a427012d..29bf2fdc91c 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-arm/arch-at91/at91_adc.h b/include/asm-arm/arch-at91/at91_adc.h
index 1ed66eaaf83..6d71ea2637b 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 ab2c79bb950..00000000000
--- 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 84467a5190d..131e0a1d0df 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 6b437f7c995..850fdc5b45d 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 ab194e5f665..2a44d3d6798 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 c79cb181991..3b49cd1c345 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 4505aefbad1..19e77f03804 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 02131a5a1d3..0362332faaf 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 00000000000..8ca6a3bc855
--- /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 3552280d1e8..4a499a13825 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 8261ff9e795..1d3caa42a38 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 bb9a7aa10c1..a91d8a1523c 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 fd2f9bf4dcc..c59fad18e73 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 fe2a23b5627..53099d4ee42 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 4981ad41919..6913d02ca5d 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 dddf485fc06..f9d6f0317bc 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 e5407392afc..7bbf105463f 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 a3f4fe1742d..f784d11f40b 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 329c324c404..293e3f1bc3f 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 08c6991dc9c..71be4fded7e 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 c025ab47e4b..250d7f145ac 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 10fd07c7666..e8256230647 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-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h
index 1a7b07d436f..9fd2e32f84b 100644
--- a/include/asm-avr32/arch-at32ap/board.h
+++ b/include/asm-avr32/arch-at32ap/board.h
@@ -30,11 +30,9 @@ struct spi_board_info;
30struct platform_device * 30struct platform_device *
31at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n); 31at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n);
32 32
33struct lcdc_platform_data { 33struct atmel_lcdfb_info;
34 unsigned long fbmem_start;
35 unsigned long fbmem_size;
36};
37struct platform_device * 34struct platform_device *
38at32_add_device_lcdc(unsigned int id, struct lcdc_platform_data *data); 35at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
36 unsigned long fbmem_start, unsigned long fbmem_len);
39 37
40#endif /* __ASM_ARCH_BOARD_H */ 38#endif /* __ASM_ARCH_BOARD_H */
diff --git a/include/asm-avr32/kdebug.h b/include/asm-avr32/kdebug.h
index de419278fc3..7f54e2b15d1 100644
--- a/include/asm-avr32/kdebug.h
+++ b/include/asm-avr32/kdebug.h
@@ -5,13 +5,22 @@
5 5
6/* Grossly misnamed. */ 6/* Grossly misnamed. */
7enum die_val { 7enum die_val {
8 DIE_FAULT,
9 DIE_BREAKPOINT, 8 DIE_BREAKPOINT,
10 DIE_SSTEP, 9 DIE_SSTEP,
11 DIE_PAGE_FAULT,
12}; 10};
13 11
14int register_page_fault_notifier(struct notifier_block *nb); 12/*
15int unregister_page_fault_notifier(struct notifier_block *nb); 13 * These are only here because kprobes.c wants them to implement a
14 * blatant layering violation. Will hopefully go away soon once all
15 * architectures are updated.
16 */
17static inline int register_page_fault_notifier(struct notifier_block *nb)
18{
19 return 0;
20}
21static inline int unregister_page_fault_notifier(struct notifier_block *nb)
22{
23 return 0;
24}
16 25
17#endif /* __ASM_AVR32_KDEBUG_H */ 26#endif /* __ASM_AVR32_KDEBUG_H */
diff --git a/include/asm-avr32/kprobes.h b/include/asm-avr32/kprobes.h
index 09a5cbe2f89..190a6377c80 100644
--- a/include/asm-avr32/kprobes.h
+++ b/include/asm-avr32/kprobes.h
@@ -26,6 +26,7 @@ struct arch_specific_insn {
26 kprobe_opcode_t insn[MAX_INSN_SIZE]; 26 kprobe_opcode_t insn[MAX_INSN_SIZE];
27}; 27};
28 28
29extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
29extern int kprobe_exceptions_notify(struct notifier_block *self, 30extern int kprobe_exceptions_notify(struct notifier_block *self,
30 unsigned long val, void *data); 31 unsigned long val, void *data);
31 32
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h
index 2418cce624c..3b4e35b55c8 100644
--- a/include/asm-avr32/unistd.h
+++ b/include/asm-avr32/unistd.h
@@ -296,9 +296,12 @@
296#define __NR_shmctl 277 296#define __NR_shmctl 277
297 297
298#define __NR_utimensat 278 298#define __NR_utimensat 278
299#define __NR_signalfd 279
300#define __NR_timerfd 280
301#define __NR_eventfd 281
299 302
300#ifdef __KERNEL__ 303#ifdef __KERNEL__
301#define NR_syscalls 279 304#define NR_syscalls 282
302 305
303 306
304#define __ARCH_WANT_IPC_PARSE_VERSION 307#define __ARCH_WANT_IPC_PARSE_VERSION
diff --git a/include/asm-blackfin/bfin-global.h b/include/asm-blackfin/bfin-global.h
index e37f81609fc..57f37ccdcdf 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 d16fe3cd613..aa0d5503e23 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 7e6995e80d9..eac8bcaf64c 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 00000000000..52c06494b88
--- /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 00000000000..2cc67e4b4d8
--- /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 00000000000..5bd1a860174
--- /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 00000000000..5f801a0ef79
--- /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 00000000000..9671d8f2c5e
--- /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 00000000000..6a375a084ac
--- /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 00000000000..2be3293f9e2
--- /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 00000000000..0b2fb5036ed
--- /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 1d7c494ceb6..74f967b235e 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 b240a082aa0..6a3cf93f8b5 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 7b658c175f8..84e58fa73dc 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 932a1b6b5d1..b8fc949a991 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 e605e970900..1859f2fee5a 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 26f9c02eb73..3f455909c41 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 00000000000..308b33ab531
--- /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 00000000000..7a2d177c8dc
--- /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 00000000000..674be0216bf
--- /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 00000000000..2ab5b7c0082
--- /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 00000000000..6bbcefeb362
--- /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 00000000000..ac968fca5cc
--- /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 00000000000..8fc77ea12aa
--- /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 00000000000..d9e3062a911
--- /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 00000000000..b1cc1c073b4
--- /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 00000000000..a1b200fe6a1
--- /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 5dc0ed83544..b14f872e570 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 a6de4c69ba5..89150ecb909 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 22aa5e63799..d39c396f850 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 0336ff132c1..aba2b30a8ed 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 bfcb6794c67..2233f8f9314 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 14fae1fa87d..7f30cce5285 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 f3806a74c47..8307b1bb337 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -9,6 +9,11 @@
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/* .data section */
13#define DATA_DATA \
14 *(.data) \
15 *(.data.init.refok)
16
12#define RODATA \ 17#define RODATA \
13 . = ALIGN(4096); \ 18 . = ALIGN(4096); \
14 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ 19 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
@@ -139,6 +144,13 @@
139 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 144 VMLINUX_SYMBOL(__security_initcall_end) = .; \
140 } 145 }
141 146
147/* .text section. Map to function alignment to avoid address changes
148 * during second ld run in second ld pass when generating System.map */
149#define TEXT_TEXT \
150 ALIGN_FUNCTION(); \
151 *(.text) \
152 *(.text.init.refok)
153
142/* sched.text is aling to function alignment to secure we have same 154/* sched.text is aling to function alignment to secure we have same
143 * address even at second ld pass when generating System.map */ 155 * address even at second ld pass when generating System.map */
144#define SCHED_TEXT \ 156#define SCHED_TEXT \
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index 0baa2f89463..437aac80171 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 e13d3e98823..6e85975b9ed 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 db7f77eacfa..fc525c5cd5a 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 5d03792d4f6..5b526357d17 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/kdebug.h b/include/asm-ia64/kdebug.h
index ba211e011a1..320cd8e754e 100644
--- a/include/asm-ia64/kdebug.h
+++ b/include/asm-ia64/kdebug.h
@@ -28,14 +28,24 @@
28 */ 28 */
29#include <linux/notifier.h> 29#include <linux/notifier.h>
30 30
31extern int register_page_fault_notifier(struct notifier_block *); 31/*
32extern int unregister_page_fault_notifier(struct notifier_block *); 32 * These are only here because kprobes.c wants them to implement a
33 * blatant layering violation. Will hopefully go away soon once all
34 * architectures are updated.
35 */
36static inline int register_page_fault_notifier(struct notifier_block *nb)
37{
38 return 0;
39}
40static inline int unregister_page_fault_notifier(struct notifier_block *nb)
41{
42 return 0;
43}
33 44
34enum die_val { 45enum die_val {
35 DIE_BREAK = 1, 46 DIE_BREAK = 1,
36 DIE_FAULT, 47 DIE_FAULT,
37 DIE_OOPS, 48 DIE_OOPS,
38 DIE_PAGE_FAULT,
39 DIE_MACHINE_HALT, 49 DIE_MACHINE_HALT,
40 DIE_MACHINE_RESTART, 50 DIE_MACHINE_RESTART,
41 DIE_MCA_MONARCH_ENTER, 51 DIE_MCA_MONARCH_ENTER,
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 2abc98b336f..6382e52ec22 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -120,6 +120,7 @@ struct arch_specific_insn {
120 unsigned short slot; 120 unsigned short slot;
121}; 121};
122 122
123extern int kprobes_fault_handler(struct pt_regs *regs, int trapnr);
123extern int kprobe_exceptions_notify(struct notifier_block *self, 124extern int kprobe_exceptions_notify(struct notifier_block *self,
124 unsigned long val, void *data); 125 unsigned long val, void *data);
125 126
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index f049bc40ca7..441c9e00177 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -296,11 +296,27 @@
296#define __NR_getcpu 1304 296#define __NR_getcpu 1304
297#define __NR_epoll_pwait 1305 297#define __NR_epoll_pwait 1305
298#define __NR_utimensat 1306 298#define __NR_utimensat 1306
299#define __NR_signalfd 1307
300#define __NR_timerfd 1308
301#define __NR_eventfd 1309
299 302
300#ifdef __KERNEL__ 303#ifdef __KERNEL__
301 304
302 305
303#define NR_syscalls 283 /* length of syscall table */ 306#define NR_syscalls 286 /* length of syscall table */
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() */
304 320
305#define __ARCH_WANT_SYS_RT_SIGACTION 321#define __ARCH_WANT_SYS_RT_SIGACTION
306#define __ARCH_WANT_SYS_RT_SIGSUSPEND 322#define __ARCH_WANT_SYS_RT_SIGSUSPEND
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
index 5685d4fc788..9fb57c03521 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 bad690298f0..85856c74ad1 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 3313da9ea00..270cf309772 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/cputable.h b/include/asm-powerpc/cputable.h
index 434524931ef..82d595a5210 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -302,6 +302,12 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
302 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 302 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
303 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ 303 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
304 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) 304 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
305#define CPU_FTRS_7448 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
306 CPU_FTR_USE_TB | \
307 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
308 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
309 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
310 CPU_FTR_PPC_LE)
305#define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 311#define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
306 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB) 312 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB)
307#define CPU_FTRS_G2_LE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ 313#define CPU_FTRS_G2_LE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \
diff --git a/include/asm-powerpc/mmu-44x.h b/include/asm-powerpc/mmu-44x.h
index d5ce7a8dfe9..62772ae839c 100644
--- a/include/asm-powerpc/mmu-44x.h
+++ b/include/asm-powerpc/mmu-44x.h
@@ -55,8 +55,6 @@
55 55
56typedef unsigned long long phys_addr_t; 56typedef unsigned long long phys_addr_t;
57 57
58extern phys_addr_t fixup_bigphys_addr(phys_addr_t, phys_addr_t);
59
60typedef struct { 58typedef struct {
61 unsigned long id; 59 unsigned long id;
62 unsigned long vdso_base; 60 unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu_context.h b/include/asm-powerpc/mmu_context.h
index c0d7795e3d2..40c9e5a13ff 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/mpc8260.h b/include/asm-powerpc/mpc8260.h
index f1b83b09ab2..e0d480790e1 100644
--- a/include/asm-powerpc/mpc8260.h
+++ b/include/asm-powerpc/mpc8260.h
@@ -5,8 +5,8 @@
5 * this one and the configuration switching is done here. 5 * this one and the configuration switching is done here.
6 */ 6 */
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#ifndef __ASM_PPC_MPC8260_H__ 8#ifndef __ASM_POWERPC_MPC8260_H__
9#define __ASM_PPC_MPC8260_H__ 9#define __ASM_POWERPC_MPC8260_H__
10 10
11 11
12#ifdef CONFIG_8260 12#ifdef CONFIG_8260
@@ -20,5 +20,5 @@
20#endif 20#endif
21 21
22#endif /* CONFIG_8260 */ 22#endif /* CONFIG_8260 */
23#endif /* !__ASM_PPC_MPC8260_H__ */ 23#endif /* !__ASM_POWERPC_MPC8260_H__ */
24#endif /* __KERNEL__ */ 24#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h
index 09662a24f22..c863bdb2889 100644
--- a/include/asm-powerpc/pgtable-ppc32.h
+++ b/include/asm-powerpc/pgtable-ppc32.h
@@ -782,23 +782,8 @@ extern void kernel_set_cachemode (unsigned long address, unsigned long size,
782/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ 782/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
783#define kern_addr_valid(addr) (1) 783#define kern_addr_valid(addr) (1)
784 784
785#ifdef CONFIG_PHYS_64BIT
786extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
787 unsigned long paddr, unsigned long size, pgprot_t prot);
788
789static inline int io_remap_pfn_range(struct vm_area_struct *vma,
790 unsigned long vaddr,
791 unsigned long pfn,
792 unsigned long size,
793 pgprot_t prot)
794{
795 phys_addr_t paddr64 = fixup_bigphys_addr(pfn << PAGE_SHIFT, size);
796 return remap_pfn_range(vma, vaddr, paddr64 >> PAGE_SHIFT, size, prot);
797}
798#else
799#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 785#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
800 remap_pfn_range(vma, vaddr, pfn, size, prot) 786 remap_pfn_range(vma, vaddr, pfn, size, prot)
801#endif
802 787
803/* 788/*
804 * No page table caches to initialise 789 * No page table caches to initialise
diff --git a/include/asm-powerpc/pmac_feature.h b/include/asm-powerpc/pmac_feature.h
index d43d91beba9..26bcb0aa164 100644
--- a/include/asm-powerpc/pmac_feature.h
+++ b/include/asm-powerpc/pmac_feature.h
@@ -28,8 +28,8 @@
28 */ 28 */
29 29
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31#ifndef __PPC_ASM_PMAC_FEATURE_H 31#ifndef __ASM_POWERPC_PMAC_FEATURE_H
32#define __PPC_ASM_PMAC_FEATURE_H 32#define __ASM_POWERPC_PMAC_FEATURE_H
33 33
34#include <asm/macio.h> 34#include <asm/macio.h>
35#include <asm/machdep.h> 35#include <asm/machdep.h>
@@ -393,5 +393,5 @@ extern u32 __iomem *uninorth_base;
393#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v))) 393#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v)))
394 394
395 395
396#endif /* __PPC_ASM_PMAC_FEATURE_H */ 396#endif /* __ASM_POWERPC_PMAC_FEATURE_H */
397#endif /* __KERNEL__ */ 397#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index 3d44446fb74..700ca592874 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -308,3 +308,6 @@ COMPAT_SYS_SPU(move_pages)
308SYSCALL_SPU(getcpu) 308SYSCALL_SPU(getcpu)
309COMPAT_SYS(epoll_pwait) 309COMPAT_SYS(epoll_pwait)
310COMPAT_SYS_SPU(utimensat) 310COMPAT_SYS_SPU(utimensat)
311COMPAT_SYS_SPU(signalfd)
312COMPAT_SYS_SPU(timerfd)
313SYSCALL_SPU(eventfd)
diff --git a/include/asm-powerpc/tsi108_irq.h b/include/asm-powerpc/tsi108_irq.h
index 3e4d04effa5..6ed93979fbe 100644
--- a/include/asm-powerpc/tsi108_irq.h
+++ b/include/asm-powerpc/tsi108_irq.h
@@ -26,8 +26,8 @@
26 * demultiplexing on TSI108EMU/SVB boards. 26 * demultiplexing on TSI108EMU/SVB boards.
27 */ 27 */
28 28
29#ifndef _ASM_PPC_TSI108_IRQ_H 29#ifndef _ASM_POWERPC_TSI108_IRQ_H
30#define _ASM_PPC_TSI108_IRQ_H 30#define _ASM_POWERPC_TSI108_IRQ_H
31 31
32/* 32/*
33 * Tsi108 interrupts 33 * Tsi108 interrupts
@@ -121,4 +121,4 @@ typedef enum {
121 TSI108_IRQ_DIRECTED, 121 TSI108_IRQ_DIRECTED,
122 TSI108_IRQ_DISTRIBUTED, 122 TSI108_IRQ_DISTRIBUTED,
123} TSI108_IRQ_MODE; 123} TSI108_IRQ_MODE;
124#endif /* _ASM_PPC_TSI108_IRQ_H */ 124#endif /* _ASM_POWERPC_TSI108_IRQ_H */
diff --git a/include/asm-powerpc/tsi108_pci.h b/include/asm-powerpc/tsi108_pci.h
index a9f92f73232..5653d7cc3e2 100644
--- a/include/asm-powerpc/tsi108_pci.h
+++ b/include/asm-powerpc/tsi108_pci.h
@@ -18,8 +18,8 @@
18 * MA 02111-1307 USA 18 * MA 02111-1307 USA
19 */ 19 */
20 20
21#ifndef _ASM_PPC_TSI108_PCI_H 21#ifndef _ASM_POWERPC_TSI108_PCI_H
22#define _ASM_PPC_TSI108_PCI_H 22#define _ASM_POWERPC_TSI108_PCI_H
23 23
24#include <asm/tsi108.h> 24#include <asm/tsi108.h>
25 25
@@ -42,4 +42,4 @@ extern void tsi108_pci_int_init(struct device_node *node);
42extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc); 42extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc);
43extern void tsi108_clear_pci_cfg_error(void); 43extern void tsi108_clear_pci_cfg_error(void);
44 44
45#endif /* _ASM_PPC_TSI108_PCI_H */ 45#endif /* _ASM_POWERPC_TSI108_PCI_H */
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index 21f004aef50..e3c28dc31ab 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_PPC_UNISTD_H_ 1#ifndef _ASM_POWERPC_UNISTD_H_
2#define _ASM_PPC_UNISTD_H_ 2#define _ASM_POWERPC_UNISTD_H_
3 3
4/* 4/*
5 * This file contains the system call numbers. 5 * This file contains the system call numbers.
@@ -327,10 +327,13 @@
327#define __NR_getcpu 302 327#define __NR_getcpu 302
328#define __NR_epoll_pwait 303 328#define __NR_epoll_pwait 303
329#define __NR_utimensat 304 329#define __NR_utimensat 304
330#define __NR_signalfd 305
331#define __NR_timerfd 306
332#define __NR_eventfd 307
330 333
331#ifdef __KERNEL__ 334#ifdef __KERNEL__
332 335
333#define __NR_syscalls 305 336#define __NR_syscalls 308
334 337
335#define __NR__exit __NR_exit 338#define __NR__exit __NR_exit
336#define NR_syscalls __NR_syscalls 339#define NR_syscalls __NR_syscalls
@@ -381,4 +384,4 @@
381#endif /* __ASSEMBLY__ */ 384#endif /* __ASSEMBLY__ */
382#endif /* __KERNEL__ */ 385#endif /* __KERNEL__ */
383 386
384#endif /* _ASM_PPC_UNISTD_H_ */ 387#endif /* _ASM_POWERPC_UNISTD_H_ */
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 5c6f00d62df..790c1c55741 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/dreamcast/sysasic.h b/include/asm-sh/dreamcast/sysasic.h
index 7874e3dac73..f33426608a8 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/kdebug.h b/include/asm-sh/kdebug.h
index 16578b7c9da..382cfc7deb7 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 3fce4c451a4..35d7368b718 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 c74d3c73f37..6fb04ab38b9 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/unistd.h b/include/asm-sh/unistd.h
index af71e379a5e..77bcb09d6ac 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 731fa56e0c3..bdca5416d8b 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 120422fdb02..bf39d86c0c9 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 e89922d6718..03c385de761 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 612bf319753..5cdb1ff0483 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()
@@ -940,6 +996,107 @@ struct hv_fault_status {
940 */ 996 */
941#define HV_FAST_CONS_PUTCHAR 0x61 997#define HV_FAST_CONS_PUTCHAR 0x61
942 998
999/* con_read()
1000 * TRAP: HV_FAST_TRAP
1001 * FUNCTION: HV_FAST_CONS_READ
1002 * ARG0: buffer real address
1003 * ARG1: buffer size in bytes
1004 * RET0: status
1005 * RET1: bytes read or BREAK or HUP
1006 * ERRORS: EWOULDBLOCK No character available.
1007 *
1008 * Reads characters into a buffer from the console device. If no
1009 * character is available then an EWOULDBLOCK error is returned.
1010 * If a character is available, then the returned status is EOK
1011 * and the number of bytes read into the given buffer is provided
1012 * in RET1.
1013 *
1014 * A virtual BREAK is represented by the 64-bit RET1 value -1.
1015 *
1016 * A virtual HUP signal is represented by the 64-bit RET1 value -2.
1017 *
1018 * If BREAK or HUP are indicated, no bytes were read into buffer.
1019 */
1020#define HV_FAST_CONS_READ 0x62
1021
1022/* con_write()
1023 * TRAP: HV_FAST_TRAP
1024 * FUNCTION: HV_FAST_CONS_WRITE
1025 * ARG0: buffer real address
1026 * ARG1: buffer size in bytes
1027 * RET0: status
1028 * RET1: bytes written
1029 * ERRORS: EWOULDBLOCK Output buffer currently full, would block
1030 *
1031 * Send a characters in buffer to the console device. Breaks must be
1032 * sent using con_putchar().
1033 */
1034#define HV_FAST_CONS_WRITE 0x63
1035
1036#ifndef __ASSEMBLY__
1037extern long sun4v_con_getchar(long *status);
1038extern long sun4v_con_putchar(long c);
1039extern long sun4v_con_read(unsigned long buffer,
1040 unsigned long size,
1041 unsigned long *bytes_read);
1042extern unsigned long sun4v_con_write(unsigned long buffer,
1043 unsigned long size,
1044 unsigned long *bytes_written);
1045#endif
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
943/* Trap trace services. 1100/* Trap trace services.
944 * 1101 *
945 * The hypervisor provides a trap tracing capability for privileged 1102 * The hypervisor provides a trap tracing capability for privileged
@@ -1331,6 +1488,113 @@ extern unsigned long sun4v_intr_gettarget(unsigned long sysino);
1331extern unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid); 1488extern unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid);
1332#endif 1489#endif
1333 1490
1491/* vintr_get_cookie()
1492 * TRAP: HV_FAST_TRAP
1493 * FUNCTION: HV_FAST_VINTR_GET_COOKIE
1494 * ARG0: device handle
1495 * ARG1: device ino
1496 * RET0: status
1497 * RET1: cookie
1498 */
1499#define HV_FAST_VINTR_GET_COOKIE 0xa7
1500
1501/* vintr_set_cookie()
1502 * TRAP: HV_FAST_TRAP
1503 * FUNCTION: HV_FAST_VINTR_SET_COOKIE
1504 * ARG0: device handle
1505 * ARG1: device ino
1506 * ARG2: cookie
1507 * RET0: status
1508 */
1509#define HV_FAST_VINTR_SET_COOKIE 0xa8
1510
1511/* vintr_get_valid()
1512 * TRAP: HV_FAST_TRAP
1513 * FUNCTION: HV_FAST_VINTR_GET_VALID
1514 * ARG0: device handle
1515 * ARG1: device ino
1516 * RET0: status
1517 * RET1: valid state
1518 */
1519#define HV_FAST_VINTR_GET_VALID 0xa9
1520
1521/* vintr_set_valid()
1522 * TRAP: HV_FAST_TRAP
1523 * FUNCTION: HV_FAST_VINTR_SET_VALID
1524 * ARG0: device handle
1525 * ARG1: device ino
1526 * ARG2: valid state
1527 * RET0: status
1528 */
1529#define HV_FAST_VINTR_SET_VALID 0xaa
1530
1531/* vintr_get_state()
1532 * TRAP: HV_FAST_TRAP
1533 * FUNCTION: HV_FAST_VINTR_GET_STATE
1534 * ARG0: device handle
1535 * ARG1: device ino
1536 * RET0: status
1537 * RET1: state
1538 */
1539#define HV_FAST_VINTR_GET_STATE 0xab
1540
1541/* vintr_set_state()
1542 * TRAP: HV_FAST_TRAP
1543 * FUNCTION: HV_FAST_VINTR_SET_STATE
1544 * ARG0: device handle
1545 * ARG1: device ino
1546 * ARG2: state
1547 * RET0: status
1548 */
1549#define HV_FAST_VINTR_SET_STATE 0xac
1550
1551/* vintr_get_target()
1552 * TRAP: HV_FAST_TRAP
1553 * FUNCTION: HV_FAST_VINTR_GET_TARGET
1554 * ARG0: device handle
1555 * ARG1: device ino
1556 * RET0: status
1557 * RET1: cpuid
1558 */
1559#define HV_FAST_VINTR_GET_TARGET 0xad
1560
1561/* vintr_set_target()
1562 * TRAP: HV_FAST_TRAP
1563 * FUNCTION: HV_FAST_VINTR_SET_TARGET
1564 * ARG0: device handle
1565 * ARG1: device ino
1566 * ARG2: cpuid
1567 * RET0: status
1568 */
1569#define HV_FAST_VINTR_SET_TARGET 0xae
1570
1571#ifndef __ASSEMBLY__
1572extern unsigned long sun4v_vintr_get_cookie(unsigned long dev_handle,
1573 unsigned long dev_ino,
1574 unsigned long *cookie);
1575extern unsigned long sun4v_vintr_set_cookie(unsigned long dev_handle,
1576 unsigned long dev_ino,
1577 unsigned long cookie);
1578extern unsigned long sun4v_vintr_get_valid(unsigned long dev_handle,
1579 unsigned long dev_ino,
1580 unsigned long *valid);
1581extern unsigned long sun4v_vintr_set_valid(unsigned long dev_handle,
1582 unsigned long dev_ino,
1583 unsigned long valid);
1584extern unsigned long sun4v_vintr_get_state(unsigned long dev_handle,
1585 unsigned long dev_ino,
1586 unsigned long *state);
1587extern unsigned long sun4v_vintr_set_state(unsigned long dev_handle,
1588 unsigned long dev_ino,
1589 unsigned long state);
1590extern unsigned long sun4v_vintr_get_target(unsigned long dev_handle,
1591 unsigned long dev_ino,
1592 unsigned long *cpuid);
1593extern unsigned long sun4v_vintr_set_target(unsigned long dev_handle,
1594 unsigned long dev_ino,
1595 unsigned long cpuid);
1596#endif
1597
1334/* PCI IO services. 1598/* PCI IO services.
1335 * 1599 *
1336 * See the terminology descriptions in the device interrupt services 1600 * See the terminology descriptions in the device interrupt services
@@ -1989,6 +2253,346 @@ extern unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cp
1989 */ 2253 */
1990#define HV_FAST_PCI_MSG_SETVALID 0xd3 2254#define HV_FAST_PCI_MSG_SETVALID 0xd3
1991 2255
2256/* Logical Domain Channel services. */
2257
2258#define LDC_CHANNEL_DOWN 0
2259#define LDC_CHANNEL_UP 1
2260#define LDC_CHANNEL_RESETTING 2
2261
2262/* ldc_tx_qconf()
2263 * TRAP: HV_FAST_TRAP
2264 * FUNCTION: HV_FAST_LDC_TX_QCONF
2265 * ARG0: channel ID
2266 * ARG1: real address base of queue
2267 * ARG2: num entries in queue
2268 * RET0: status
2269 *
2270 * Configure transmit queue for the LDC endpoint specified by the
2271 * given channel ID, to be placed at the given real address, and
2272 * be of the given num entries. Num entries must be a power of two.
2273 * The real address base of the queue must be aligned on the queue
2274 * size. Each queue entry is 64-bytes, so for example, a 32 entry
2275 * queue must be aligned on a 2048 byte real address boundary.
2276 *
2277 * Upon configuration of a valid transmit queue the head and tail
2278 * pointers are set to a hypervisor specific identical value indicating
2279 * that the queue initially is empty.
2280 *
2281 * The endpoint's transmit queue is un-configured if num entries is zero.
2282 *
2283 * The maximum number of entries for each queue for a specific cpu may be
2284 * determined from the machine description. A transmit queue may be
2285 * specified even in the event that the LDC is down (peer endpoint has no
2286 * receive queue specified). Transmission will begin as soon as the peer
2287 * endpoint defines a receive queue.
2288 *
2289 * It is recommended that a guest wait for a transmit queue to empty prior
2290 * to reconfiguring it, or un-configuring it. Re or un-configuring of a
2291 * non-empty transmit queue behaves exactly as defined above, however it
2292 * is undefined as to how many of the pending entries in the original queue
2293 * will be delivered prior to the re-configuration taking effect.
2294 * Furthermore, as the queue configuration causes a reset of the head and
2295 * tail pointers there is no way for a guest to determine how many entries
2296 * have been sent after the configuration operation.
2297 */
2298#define HV_FAST_LDC_TX_QCONF 0xe0
2299
2300/* ldc_tx_qinfo()
2301 * TRAP: HV_FAST_TRAP
2302 * FUNCTION: HV_FAST_LDC_TX_QINFO
2303 * ARG0: channel ID
2304 * RET0: status
2305 * RET1: real address base of queue
2306 * RET2: num entries in queue
2307 *
2308 * Return the configuration info for the transmit queue of LDC endpoint
2309 * defined by the given channel ID. The real address is the currently
2310 * defined real address base of the defined queue, and num entries is the
2311 * size of the queue in terms of number of entries.
2312 *
2313 * If the specified channel ID is a valid endpoint number, but no transmit
2314 * queue has been defined this service will return success, but with num
2315 * entries set to zero and the real address will have an undefined value.
2316 */
2317#define HV_FAST_LDC_TX_QINFO 0xe1
2318
2319/* ldc_tx_get_state()
2320 * TRAP: HV_FAST_TRAP
2321 * FUNCTION: HV_FAST_LDC_TX_GET_STATE
2322 * ARG0: channel ID
2323 * RET0: status
2324 * RET1: head offset
2325 * RET2: tail offset
2326 * RET3: channel state
2327 *
2328 * Return the transmit state, and the head and tail queue pointers, for
2329 * the transmit queue of the LDC endpoint defined by the given channel ID.
2330 * The head and tail values are the byte offset of the head and tail
2331 * positions of the transmit queue for the specified endpoint.
2332 */
2333#define HV_FAST_LDC_TX_GET_STATE 0xe2
2334
2335/* ldc_tx_set_qtail()
2336 * TRAP: HV_FAST_TRAP
2337 * FUNCTION: HV_FAST_LDC_TX_SET_QTAIL
2338 * ARG0: channel ID
2339 * ARG1: tail offset
2340 * RET0: status
2341 *
2342 * Update the tail pointer for the transmit queue associated with the LDC
2343 * endpoint defined by the given channel ID. The tail offset specified
2344 * must be aligned on a 64 byte boundary, and calculated so as to increase
2345 * the number of pending entries on the transmit queue. Any attempt to
2346 * decrease the number of pending transmit queue entires is considered
2347 * an invalid tail offset and will result in an EINVAL error.
2348 *
2349 * Since the tail of the transmit queue may not be moved backwards, the
2350 * transmit queue may be flushed by configuring a new transmit queue,
2351 * whereupon the hypervisor will configure the initial transmit head and
2352 * tail pointers to be equal.
2353 */
2354#define HV_FAST_LDC_TX_SET_QTAIL 0xe3
2355
2356/* ldc_rx_qconf()
2357 * TRAP: HV_FAST_TRAP
2358 * FUNCTION: HV_FAST_LDC_RX_QCONF
2359 * ARG0: channel ID
2360 * ARG1: real address base of queue
2361 * ARG2: num entries in queue
2362 * RET0: status
2363 *
2364 * Configure receive queue for the LDC endpoint specified by the
2365 * given channel ID, to be placed at the given real address, and
2366 * be of the given num entries. Num entries must be a power of two.
2367 * The real address base of the queue must be aligned on the queue
2368 * size. Each queue entry is 64-bytes, so for example, a 32 entry
2369 * queue must be aligned on a 2048 byte real address boundary.
2370 *
2371 * The endpoint's transmit queue is un-configured if num entries is zero.
2372 *
2373 * If a valid receive queue is specified for a local endpoint the LDC is
2374 * in the up state for the purpose of transmission to this endpoint.
2375 *
2376 * The maximum number of entries for each queue for a specific cpu may be
2377 * determined from the machine description.
2378 *
2379 * As receive queue configuration causes a reset of the queue's head and
2380 * tail pointers there is no way for a gues to determine how many entries
2381 * have been received between a preceeding ldc_get_rx_state() API call
2382 * and the completion of the configuration operation. It should be noted
2383 * that datagram delivery is not guarenteed via domain channels anyway,
2384 * and therefore any higher protocol should be resilient to datagram
2385 * loss if necessary. However, to overcome this specific race potential
2386 * it is recommended, for example, that a higher level protocol be employed
2387 * to ensure either retransmission, or ensure that no datagrams are pending
2388 * on the peer endpoint's transmit queue prior to the configuration process.
2389 */
2390#define HV_FAST_LDC_RX_QCONF 0xe4
2391
2392/* ldc_rx_qinfo()
2393 * TRAP: HV_FAST_TRAP
2394 * FUNCTION: HV_FAST_LDC_RX_QINFO
2395 * ARG0: channel ID
2396 * RET0: status
2397 * RET1: real address base of queue
2398 * RET2: num entries in queue
2399 *
2400 * Return the configuration info for the receive queue of LDC endpoint
2401 * defined by the given channel ID. The real address is the currently
2402 * defined real address base of the defined queue, and num entries is the
2403 * size of the queue in terms of number of entries.
2404 *
2405 * If the specified channel ID is a valid endpoint number, but no receive
2406 * queue has been defined this service will return success, but with num
2407 * entries set to zero and the real address will have an undefined value.
2408 */
2409#define HV_FAST_LDC_RX_QINFO 0xe5
2410
2411/* ldc_rx_get_state()
2412 * TRAP: HV_FAST_TRAP
2413 * FUNCTION: HV_FAST_LDC_RX_GET_STATE
2414 * ARG0: channel ID
2415 * RET0: status
2416 * RET1: head offset
2417 * RET2: tail offset
2418 * RET3: channel state
2419 *
2420 * Return the receive state, and the head and tail queue pointers, for
2421 * the receive queue of the LDC endpoint defined by the given channel ID.
2422 * The head and tail values are the byte offset of the head and tail
2423 * positions of the receive queue for the specified endpoint.
2424 */
2425#define HV_FAST_LDC_RX_GET_STATE 0xe6
2426
2427/* ldc_rx_set_qhead()
2428 * TRAP: HV_FAST_TRAP
2429 * FUNCTION: HV_FAST_LDC_RX_SET_QHEAD
2430 * ARG0: channel ID
2431 * ARG1: head offset
2432 * RET0: status
2433 *
2434 * Update the head pointer for the receive queue associated with the LDC
2435 * endpoint defined by the given channel ID. The head offset specified
2436 * must be aligned on a 64 byte boundary, and calculated so as to decrease
2437 * the number of pending entries on the receive queue. Any attempt to
2438 * increase the number of pending receive queue entires is considered
2439 * an invalid head offset and will result in an EINVAL error.
2440 *
2441 * The receive queue may be flushed by setting the head offset equal
2442 * to the current tail offset.
2443 */
2444#define HV_FAST_LDC_RX_SET_QHEAD 0xe7
2445
2446/* LDC Map Table Entry. Each slot is defined by a translation table
2447 * entry, as specified by the LDC_MTE_* bits below, and a 64-bit
2448 * hypervisor invalidation cookie.
2449 */
2450#define LDC_MTE_PADDR 0x0fffffffffffe000 /* pa[55:13] */
2451#define LDC_MTE_COPY_W 0x0000000000000400 /* copy write access */
2452#define LDC_MTE_COPY_R 0x0000000000000200 /* copy read access */
2453#define LDC_MTE_IOMMU_W 0x0000000000000100 /* IOMMU write access */
2454#define LDC_MTE_IOMMU_R 0x0000000000000080 /* IOMMU read access */
2455#define LDC_MTE_EXEC 0x0000000000000040 /* execute */
2456#define LDC_MTE_WRITE 0x0000000000000020 /* read */
2457#define LDC_MTE_READ 0x0000000000000010 /* write */
2458#define LDC_MTE_SZALL 0x000000000000000f /* page size bits */
2459#define LDC_MTE_SZ16GB 0x0000000000000007 /* 16GB page */
2460#define LDC_MTE_SZ2GB 0x0000000000000006 /* 2GB page */
2461#define LDC_MTE_SZ256MB 0x0000000000000005 /* 256MB page */
2462#define LDC_MTE_SZ32MB 0x0000000000000004 /* 32MB page */
2463#define LDC_MTE_SZ4MB 0x0000000000000003 /* 4MB page */
2464#define LDC_MTE_SZ512K 0x0000000000000002 /* 512K page */
2465#define LDC_MTE_SZ64K 0x0000000000000001 /* 64K page */
2466#define LDC_MTE_SZ8K 0x0000000000000000 /* 8K page */
2467
2468#ifndef __ASSEMBLY__
2469struct ldc_mtable_entry {
2470 unsigned long mte;
2471 unsigned long cookie;
2472};
2473#endif
2474
2475/* ldc_set_map_table()
2476 * TRAP: HV_FAST_TRAP
2477 * FUNCTION: HV_FAST_LDC_SET_MAP_TABLE
2478 * ARG0: channel ID
2479 * ARG1: table real address
2480 * ARG2: num entries
2481 * RET0: status
2482 *
2483 * Register the MTE table at the given table real address, with the
2484 * specified num entries, for the LDC indicated by the given channel
2485 * ID.
2486 */
2487#define HV_FAST_LDC_SET_MAP_TABLE 0xea
2488
2489/* ldc_get_map_table()
2490 * TRAP: HV_FAST_TRAP
2491 * FUNCTION: HV_FAST_LDC_GET_MAP_TABLE
2492 * ARG0: channel ID
2493 * RET0: status
2494 * RET1: table real address
2495 * RET2: num entries
2496 *
2497 * Return the configuration of the current mapping table registered
2498 * for the given channel ID.
2499 */
2500#define HV_FAST_LDC_GET_MAP_TABLE 0xeb
2501
2502#define LDC_COPY_IN 0
2503#define LDC_COPY_OUT 1
2504
2505/* ldc_copy()
2506 * TRAP: HV_FAST_TRAP
2507 * FUNCTION: HV_FAST_LDC_COPY
2508 * ARG0: channel ID
2509 * ARG1: LDC_COPY_* direction code
2510 * ARG2: target real address
2511 * ARG3: local real address
2512 * ARG4: length in bytes
2513 * RET0: status
2514 * RET1: actual length in bytes
2515 */
2516#define HV_FAST_LDC_COPY 0xec
2517
2518#define LDC_MEM_READ 1
2519#define LDC_MEM_WRITE 2
2520#define LDC_MEM_EXEC 4
2521
2522/* ldc_mapin()
2523 * TRAP: HV_FAST_TRAP
2524 * FUNCTION: HV_FAST_LDC_MAPIN
2525 * ARG0: channel ID
2526 * ARG1: cookie
2527 * RET0: status
2528 * RET1: real address
2529 * RET2: LDC_MEM_* permissions
2530 */
2531#define HV_FAST_LDC_MAPIN 0xed
2532
2533/* ldc_unmap()
2534 * TRAP: HV_FAST_TRAP
2535 * FUNCTION: HV_FAST_LDC_UNMAP
2536 * ARG0: real address
2537 * RET0: status
2538 */
2539#define HV_FAST_LDC_UNMAP 0xee
2540
2541/* ldc_revoke()
2542 * TRAP: HV_FAST_TRAP
2543 * FUNCTION: HV_FAST_LDC_REVOKE
2544 * ARG0: cookie
2545 * ARG1: ldc_mtable_entry cookie
2546 * RET0: status
2547 */
2548#define HV_FAST_LDC_REVOKE 0xef
2549
2550#ifndef __ASSEMBLY__
2551extern unsigned long sun4v_ldc_tx_qconf(unsigned long channel,
2552 unsigned long ra,
2553 unsigned long num_entries);
2554extern unsigned long sun4v_ldc_tx_qinfo(unsigned long channel,
2555 unsigned long *ra,
2556 unsigned long *num_entries);
2557extern unsigned long sun4v_ldc_tx_get_state(unsigned long channel,
2558 unsigned long *head_off,
2559 unsigned long *tail_off,
2560 unsigned long *chan_state);
2561extern unsigned long sun4v_ldc_tx_set_qtail(unsigned long channel,
2562 unsigned long tail_off);
2563extern unsigned long sun4v_ldc_rx_qconf(unsigned long channel,
2564 unsigned long ra,
2565 unsigned long num_entries);
2566extern unsigned long sun4v_ldc_rx_qinfo(unsigned long channel,
2567 unsigned long *ra,
2568 unsigned long *num_entries);
2569extern unsigned long sun4v_ldc_rx_get_state(unsigned long channel,
2570 unsigned long *head_off,
2571 unsigned long *tail_off,
2572 unsigned long *chan_state);
2573extern unsigned long sun4v_ldc_rx_set_qhead(unsigned long channel,
2574 unsigned long head_off);
2575extern unsigned long sun4v_ldc_set_map_table(unsigned long channel,
2576 unsigned long ra,
2577 unsigned long num_entries);
2578extern unsigned long sun4v_ldc_get_map_table(unsigned long channel,
2579 unsigned long *ra,
2580 unsigned long *num_entries);
2581extern unsigned long sun4v_ldc_copy(unsigned long channel,
2582 unsigned long dir_code,
2583 unsigned long tgt_raddr,
2584 unsigned long lcl_raddr,
2585 unsigned long len,
2586 unsigned long *actual_len);
2587extern unsigned long sun4v_ldc_mapin(unsigned long channel,
2588 unsigned long cookie,
2589 unsigned long *ra,
2590 unsigned long *perm);
2591extern unsigned long sun4v_ldc_unmap(unsigned long ra);
2592extern unsigned long sun4v_ldc_revoke(unsigned long cookie,
2593 unsigned long mte_cookie);
2594#endif
2595
1992/* Performance counter services. */ 2596/* Performance counter services. */
1993 2597
1994#define HV_PERF_JBUS_PERF_CTRL_REG 0x00 2598#define HV_PERF_JBUS_PERF_CTRL_REG 0x00
@@ -2121,8 +2725,42 @@ struct hv_mmu_statistics {
2121#define HV_FAST_MMUSTAT_INFO 0x103 2725#define HV_FAST_MMUSTAT_INFO 0x103
2122 2726
2123/* Function numbers for HV_CORE_TRAP. */ 2727/* Function numbers for HV_CORE_TRAP. */
2124#define HV_CORE_VER 0x00 2728#define HV_CORE_SET_VER 0x00
2125#define HV_CORE_PUTCHAR 0x01 2729#define HV_CORE_PUTCHAR 0x01
2126#define HV_CORE_EXIT 0x02 2730#define HV_CORE_EXIT 0x02
2731#define HV_CORE_GET_VER 0x03
2732
2733/* Hypervisor API groups for use with HV_CORE_SET_VER and
2734 * HV_CORE_GET_VER.
2735 */
2736#define HV_GRP_SUN4V 0x0000
2737#define HV_GRP_CORE 0x0001
2738#define HV_GRP_INTR 0x0002
2739#define HV_GRP_SOFT_STATE 0x0003
2740#define HV_GRP_PCI 0x0100
2741#define HV_GRP_LDOM 0x0101
2742#define HV_GRP_SVC_CHAN 0x0102
2743#define HV_GRP_NCS 0x0103
2744#define HV_GRP_NIAG_PERF 0x0200
2745#define HV_GRP_FIRE_PERF 0x0201
2746#define HV_GRP_DIAG 0x0300
2747
2748#ifndef __ASSEMBLY__
2749extern unsigned long sun4v_get_version(unsigned long group,
2750 unsigned long *major,
2751 unsigned long *minor);
2752extern unsigned long sun4v_set_version(unsigned long group,
2753 unsigned long major,
2754 unsigned long minor,
2755 unsigned long *actual_minor);
2756
2757extern int sun4v_hvapi_register(unsigned long group, unsigned long major,
2758 unsigned long *minor);
2759extern void sun4v_hvapi_unregister(unsigned long group);
2760extern int sun4v_hvapi_get(unsigned long group,
2761 unsigned long *major,
2762 unsigned long *minor);
2763extern void sun4v_hvapi_init(void);
2764#endif
2127 2765
2128#endif /* !(_SPARC64_HYPERVISOR_H) */ 2766#endif /* !(_SPARC64_HYPERVISOR_H) */
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h
index 627e3396a5f..9974c7b0aeb 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 00000000000..124eb8ca237
--- /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 6a0da3b1695..992f9f7a476 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 ced8cbde046..88db872ce2f 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 ddad5f99ac7..b4df3042add 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 869d16fb907..f76e1492add 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 00000000000..a7c35dbcb28
--- /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 2ebf7f27bf9..98252cd44dd 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 98a6c613589..e0d450d600e 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 ab55ffcb7bf..76e4299dd9b 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 7ee90064571..4d5747a0923 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 512401b8725..8516225a838 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 bcd01f269f6..e1013156c25 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -239,6 +239,7 @@ unifdef-y += ipc.h
239unifdef-y += ipmi.h 239unifdef-y += ipmi.h
240unifdef-y += ipv6.h 240unifdef-y += ipv6.h
241unifdef-y += ipv6_route.h 241unifdef-y += ipv6_route.h
242unifdef-y += ip6_tunnel.h
242unifdef-y += isdn.h 243unifdef-y += isdn.h
243unifdef-y += isdnif.h 244unifdef-y += isdnif.h
244unifdef-y += isdn_divertif.h 245unifdef-y += isdn_divertif.h
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 2d956cd566a..e1a708337be 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -17,6 +17,8 @@ struct pt_regs;
17 17
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19 19
20#define CORENAME_MAX_SIZE 128
21
20/* 22/*
21 * This structure is used to hold the arguments that are used when loading binaries. 23 * This structure is used to hold the arguments that are used when loading binaries.
22 */ 24 */
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 6548b35ab9f..bbf8df7de28 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 498c3592076..8287a72bb6a 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/freezer.h b/include/linux/freezer.h
index 5e75e26d478..4631086f506 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 4c03ee353e7..9756fc102a8 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 1db774cf9dc..3213f6f4aa5 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 e007ae4dc41..56ec4c62eee 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/kmalloc_sizes.h b/include/linux/kmalloc_sizes.h
index bda23e00ed7..e576b848ce1 100644
--- a/include/linux/kmalloc_sizes.h
+++ b/include/linux/kmalloc_sizes.h
@@ -19,17 +19,27 @@
19 CACHE(32768) 19 CACHE(32768)
20 CACHE(65536) 20 CACHE(65536)
21 CACHE(131072) 21 CACHE(131072)
22#if (NR_CPUS > 512) || (MAX_NUMNODES > 256) || !defined(CONFIG_MMU) 22#if KMALLOC_MAX_SIZE >= 262144
23 CACHE(262144) 23 CACHE(262144)
24#endif 24#endif
25#ifndef CONFIG_MMU 25#if KMALLOC_MAX_SIZE >= 524288
26 CACHE(524288) 26 CACHE(524288)
27#endif
28#if KMALLOC_MAX_SIZE >= 1048576
27 CACHE(1048576) 29 CACHE(1048576)
28#ifdef CONFIG_LARGE_ALLOCS 30#endif
31#if KMALLOC_MAX_SIZE >= 2097152
29 CACHE(2097152) 32 CACHE(2097152)
33#endif
34#if KMALLOC_MAX_SIZE >= 4194304
30 CACHE(4194304) 35 CACHE(4194304)
36#endif
37#if KMALLOC_MAX_SIZE >= 8388608
31 CACHE(8388608) 38 CACHE(8388608)
39#endif
40#if KMALLOC_MAX_SIZE >= 16777216
32 CACHE(16777216) 41 CACHE(16777216)
42#endif
43#if KMALLOC_MAX_SIZE >= 33554432
33 CACHE(33554432) 44 CACHE(33554432)
34#endif /* CONFIG_LARGE_ALLOCS */ 45#endif
35#endif /* CONFIG_MMU */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 27d93627957..85f7b1bd148 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -140,6 +140,7 @@ enum {
140 140
141 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ 141 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */
142 ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ 142 ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */
143 ATA_DFLAG_SPUNDOWN = (1 << 10), /* XXX: for spindown_compat */
143 ATA_DFLAG_INIT_MASK = (1 << 16) - 1, 144 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,
144 145
145 ATA_DFLAG_DETACH = (1 << 16), 146 ATA_DFLAG_DETACH = (1 << 16),
@@ -173,6 +174,7 @@ enum {
173 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ 174 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */
174 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ 175 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */
175 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ 176 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */
177 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */
176 178
177 /* The following flag belongs to ap->pflags but is kept in 179 /* The following flag belongs to ap->pflags but is kept in
178 * ap->flags because it's referenced in many LLDs and will be 180 * ap->flags because it's referenced in many LLDs and will be
@@ -431,7 +433,6 @@ struct ata_device {
431 struct scsi_device *sdev; /* attached SCSI device */ 433 struct scsi_device *sdev; /* attached SCSI device */
432 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ 434 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
433 u64 n_sectors; /* size of device, if ATA */ 435 u64 n_sectors; /* size of device, if ATA */
434 u64 n_sectors_boot; /* size of ATA device at startup */
435 unsigned int class; /* ATA_DEV_xxx */ 436 unsigned int class; /* ATA_DEV_xxx */
436 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ 437 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
437 u8 pio_mode; 438 u8 pio_mode;
@@ -573,8 +574,6 @@ struct ata_port_operations {
573 void (*phy_reset) (struct ata_port *ap); /* obsolete */ 574 void (*phy_reset) (struct ata_port *ap); /* obsolete */
574 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);
575 576
576 void (*post_set_mode) (struct ata_port *ap);
577
578 int (*cable_detect) (struct ata_port *ap); 577 int (*cable_detect) (struct ata_port *ap);
579 578
580 int (*check_atapi_dma) (struct ata_queued_cmd *qc); 579 int (*check_atapi_dma) (struct ata_queued_cmd *qc);
diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h
index dd12b4c9e61..12bfe09de2b 100644
--- a/include/linux/lockd/xdr4.h
+++ b/include/linux/lockd/xdr4.h
@@ -42,5 +42,6 @@ int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
42int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); 42int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *);
43int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); 43int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
44 */ 44 */
45extern struct rpc_version nlm_version4;
45 46
46#endif /* LOCKD_XDR4_H */ 47#endif /* LOCKD_XDR4_H */
diff --git a/include/linux/log2.h b/include/linux/log2.h
index 57e641e19a8..1b8a2c1cb0e 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -159,7 +159,7 @@ unsigned long __roundup_pow_of_two(unsigned long n)
159#define roundup_pow_of_two(n) \ 159#define roundup_pow_of_two(n) \
160( \ 160( \
161 __builtin_constant_p(n) ? ( \ 161 __builtin_constant_p(n) ? ( \
162 (n == 1) ? 0 : \ 162 (n == 1) ? 1 : \
163 (1UL << (ilog2((n) - 1) + 1)) \ 163 (1UL << (ilog2((n) - 1) + 1)) \
164 ) : \ 164 ) : \
165 __roundup_pow_of_two(n) \ 165 __roundup_pow_of_two(n) \
diff --git a/include/linux/mii.h b/include/linux/mii.h
index beddc6d3b0f..151b7e0182c 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -56,8 +56,8 @@
56#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */ 56#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
57#define BMSR_RESV 0x00c0 /* Unused... */ 57#define BMSR_RESV 0x00c0 /* Unused... */
58#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */ 58#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
59#define BMSR_100FULL2 0x0200 /* Can do 100BASE-T2 HDX */ 59#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */
60#define BMSR_100HALF2 0x0400 /* Can do 100BASE-T2 FDX */ 60#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */
61#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */ 61#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
62#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */ 62#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
63#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */ 63#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 4670ebd1f62..e4183c6c7de 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/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h
index 81453ea7e4c..b7c360ffd0d 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 38d74d5c970..f35b6b4801e 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/nfs4.h b/include/linux/nfs4.h
index 1be5be88deb..7e7f33a38fc 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -16,6 +16,7 @@
16#include <linux/types.h> 16#include <linux/types.h>
17 17
18#define NFS4_VERIFIER_SIZE 8 18#define NFS4_VERIFIER_SIZE 8
19#define NFS4_STATEID_SIZE 16
19#define NFS4_FHSIZE 128 20#define NFS4_FHSIZE 128
20#define NFS4_MAXPATHLEN PATH_MAX 21#define NFS4_MAXPATHLEN PATH_MAX
21#define NFS4_MAXNAMLEN NAME_MAX 22#define NFS4_MAXNAMLEN NAME_MAX
@@ -113,7 +114,7 @@ struct nfs4_acl {
113}; 114};
114 115
115typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; 116typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
116typedef struct { char data[16]; } nfs4_stateid; 117typedef struct { char data[NFS4_STATEID_SIZE]; } nfs4_stateid;
117 118
118enum nfs_opnum4 { 119enum nfs_opnum4 {
119 OP_ACCESS = 3, 120 OP_ACCESS = 3,
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 41afab6b5f0..bd193af8016 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 3b1fbf49fa7..4712e269d8d 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
@@ -471,6 +472,7 @@
471#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219 472#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219
472#define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A 473#define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A
473#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251 474#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251
475#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361
474#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 476#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252
475 477
476#define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */ 478#define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 6db9a4c1535..dd5a05d03d4 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/rmap.h b/include/linux/rmap.h
index bdd277223af..97347f22fc2 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -74,17 +74,14 @@ void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned lon
74void page_add_file_rmap(struct page *); 74void page_add_file_rmap(struct page *);
75void page_remove_rmap(struct page *, struct vm_area_struct *); 75void page_remove_rmap(struct page *, struct vm_area_struct *);
76 76
77/** 77#ifdef CONFIG_DEBUG_VM
78 * page_dup_rmap - duplicate pte mapping to a page 78void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address);
79 * @page: the page to add the mapping to 79#else
80 * 80static inline void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address)
81 * For copy_page_range only: minimal extract from page_add_rmap,
82 * avoiding unnecessary tests (already checked) so it's quicker.
83 */
84static inline void page_dup_rmap(struct page *page)
85{ 81{
86 atomic_inc(&page->_mapcount); 82 atomic_inc(&page->_mapcount);
87} 83}
84#endif
88 85
89/* 86/*
90 * Called from mm/vmscan.c to handle paging out 87 * Called from mm/vmscan.c to handle paging out
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a81897e2a24..d58e74b9836 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/slab.h b/include/linux/slab.h
index 71829efc40b..a015236cc57 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -32,9 +32,6 @@ typedef struct kmem_cache kmem_cache_t __deprecated;
32#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ 32#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */
33#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ 33#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */
34 34
35/* Flags passed to a constructor functions */
36#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */
37
38/* 35/*
39 * struct kmem_cache related prototypes 36 * struct kmem_cache related prototypes
40 */ 37 */
@@ -77,6 +74,21 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
77#endif 74#endif
78 75
79/* 76/*
77 * The largest kmalloc size supported by the slab allocators is
78 * 32 megabyte (2^25) or the maximum allocatable page order if that is
79 * less than 32 MB.
80 *
81 * WARNING: Its not easy to increase this value since the allocators have
82 * to do various tricks to work around compiler limitations in order to
83 * ensure proper constant folding.
84 */
85#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) <= 25 ? \
86 (MAX_ORDER + PAGE_SHIFT) : 25)
87
88#define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH)
89#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT)
90
91/*
80 * Common kmalloc functions provided by all allocators 92 * Common kmalloc functions provided by all allocators
81 */ 93 */
82void *__kmalloc(size_t, gfp_t); 94void *__kmalloc(size_t, gfp_t);
@@ -233,9 +245,6 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *);
233 245
234#endif /* DEBUG_SLAB */ 246#endif /* DEBUG_SLAB */
235 247
236extern const struct seq_operations slabinfo_op;
237ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *);
238
239#endif /* __KERNEL__ */ 248#endif /* __KERNEL__ */
240#endif /* _LINUX_SLAB_H */ 249#endif /* _LINUX_SLAB_H */
241 250
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 5e4364644ed..8d81a60518e 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -109,4 +109,7 @@ found:
109 109
110#endif /* CONFIG_NUMA */ 110#endif /* CONFIG_NUMA */
111 111
112extern const struct seq_operations slabinfo_op;
113ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *);
114
112#endif /* _LINUX_SLAB_DEF_H */ 115#endif /* _LINUX_SLAB_DEF_H */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index fd6627e2d11..0764c829d96 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -40,7 +40,6 @@ struct kmem_cache {
40 int objects; /* Number of objects in slab */ 40 int objects; /* Number of objects in slab */
41 int refcount; /* Refcount for slab cache destroy */ 41 int refcount; /* Refcount for slab cache destroy */
42 void (*ctor)(void *, struct kmem_cache *, unsigned long); 42 void (*ctor)(void *, struct kmem_cache *, unsigned long);
43 void (*dtor)(void *, struct kmem_cache *, unsigned long);
44 int inuse; /* Offset to metadata */ 43 int inuse; /* Offset to metadata */
45 int align; /* Alignment */ 44 int align; /* Alignment */
46 const char *name; /* Name (only for display!) */ 45 const char *name; /* Name (only for display!) */
@@ -59,17 +58,6 @@ struct kmem_cache {
59 */ 58 */
60#define KMALLOC_SHIFT_LOW 3 59#define KMALLOC_SHIFT_LOW 3
61 60
62#ifdef CONFIG_LARGE_ALLOCS
63#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) =< 25 ? \
64 (MAX_ORDER + PAGE_SHIFT - 1) : 25)
65#else
66#if !defined(CONFIG_MMU) || NR_CPUS > 512 || MAX_NUMNODES > 256
67#define KMALLOC_SHIFT_HIGH 20
68#else
69#define KMALLOC_SHIFT_HIGH 18
70#endif
71#endif
72
73/* 61/*
74 * We keep the general caches in an array of slab caches that are used for 62 * We keep the general caches in an array of slab caches that are used for
75 * 2^x bytes of allocations. 63 * 2^x bytes of allocations.
@@ -80,7 +68,7 @@ extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
80 * Sorry that the following has to be that ugly but some versions of GCC 68 * Sorry that the following has to be that ugly but some versions of GCC
81 * have trouble with constant propagation and loops. 69 * have trouble with constant propagation and loops.
82 */ 70 */
83static inline int kmalloc_index(int size) 71static inline int kmalloc_index(size_t size)
84{ 72{
85 /* 73 /*
86 * We should return 0 if size == 0 but we use the smallest object 74 * We should return 0 if size == 0 but we use the smallest object
@@ -88,7 +76,7 @@ static inline int kmalloc_index(int size)
88 */ 76 */
89 WARN_ON_ONCE(size == 0); 77 WARN_ON_ONCE(size == 0);
90 78
91 if (size >= (1 << KMALLOC_SHIFT_HIGH)) 79 if (size > KMALLOC_MAX_SIZE)
92 return -1; 80 return -1;
93 81
94 if (size > 64 && size <= 96) 82 if (size > 64 && size <= 96)
@@ -111,17 +99,13 @@ static inline int kmalloc_index(int size)
111 if (size <= 64 * 1024) return 16; 99 if (size <= 64 * 1024) return 16;
112 if (size <= 128 * 1024) return 17; 100 if (size <= 128 * 1024) return 17;
113 if (size <= 256 * 1024) return 18; 101 if (size <= 256 * 1024) return 18;
114#if KMALLOC_SHIFT_HIGH > 18
115 if (size <= 512 * 1024) return 19; 102 if (size <= 512 * 1024) return 19;
116 if (size <= 1024 * 1024) return 20; 103 if (size <= 1024 * 1024) return 20;
117#endif
118#if KMALLOC_SHIFT_HIGH > 20
119 if (size <= 2 * 1024 * 1024) return 21; 104 if (size <= 2 * 1024 * 1024) return 21;
120 if (size <= 4 * 1024 * 1024) return 22; 105 if (size <= 4 * 1024 * 1024) return 22;
121 if (size <= 8 * 1024 * 1024) return 23; 106 if (size <= 8 * 1024 * 1024) return 23;
122 if (size <= 16 * 1024 * 1024) return 24; 107 if (size <= 16 * 1024 * 1024) return 24;
123 if (size <= 32 * 1024 * 1024) return 25; 108 if (size <= 32 * 1024 * 1024) return 25;
124#endif
125 return -1; 109 return -1;
126 110
127/* 111/*
@@ -146,7 +130,12 @@ static inline struct kmem_cache *kmalloc_slab(size_t size)
146 if (index == 0) 130 if (index == 0)
147 return NULL; 131 return NULL;
148 132
149 if (index < 0) { 133 /*
134 * This function only gets expanded if __builtin_constant_p(size), so
135 * testing it here shouldn't be needed. But some versions of gcc need
136 * help.
137 */
138 if (__builtin_constant_p(size) && index < 0) {
150 /* 139 /*
151 * Generate a link failure. Would be great if we could 140 * Generate a link failure. Would be great if we could
152 * do something to stop the compile here. 141 * do something to stop the compile here.
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
index 13b3af54786..2c5cd55f44f 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/smp.h b/include/linux/smp.h
index 3f70149eabb..96ac21f8dd7 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -6,6 +6,7 @@
6 * Alan Cox. <alan@redhat.com> 6 * Alan Cox. <alan@redhat.com>
7 */ 7 */
8 8
9#include <linux/errno.h>
9 10
10extern void cpu_idle(void); 11extern void cpu_idle(void);
11 12
@@ -99,11 +100,9 @@ static inline void smp_send_reschedule(int cpu) { }
99#define num_booting_cpus() 1 100#define num_booting_cpus() 1
100#define smp_prepare_boot_cpu() do {} while (0) 101#define smp_prepare_boot_cpu() do {} while (0)
101static inline int smp_call_function_single(int cpuid, void (*func) (void *info), 102static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
102 void *info, int retry, int wait) 103 void *info, int retry, int wait)
103{ 104{
104 /* Disable interrupts here? */ 105 return -EBUSY;
105 func(info);
106 return 0;
107} 106}
108 107
109#endif /* !SMP */ 108#endif /* !SMP */
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index 4a68125b6de..ad293760f6e 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -47,6 +47,8 @@ extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, struct r
47extern int rpc_unlink(struct dentry *); 47extern int rpc_unlink(struct dentry *);
48extern struct vfsmount *rpc_get_mount(void); 48extern struct vfsmount *rpc_get_mount(void);
49extern void rpc_put_mount(void); 49extern void rpc_put_mount(void);
50extern int register_rpc_pipefs(void);
51extern void unregister_rpc_pipefs(void);
50 52
51#endif 53#endif
52#endif 54#endif
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index fa89ce6ce07..34f7590506f 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -244,6 +244,8 @@ void xprt_disconnect(struct rpc_xprt *xprt);
244 */ 244 */
245struct rpc_xprt * xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); 245struct rpc_xprt * xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to);
246struct rpc_xprt * xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); 246struct rpc_xprt * xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to);
247int init_socket_xprt(void);
248void cleanup_socket_xprt(void);
247 249
248/* 250/*
249 * Reserved bit positions in xprt->state 251 * Reserved bit positions in xprt->state
diff --git a/include/linux/task_io_accounting_ops.h b/include/linux/task_io_accounting_ops.h
index 1218733ec6b..ff46c6fad79 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 e0c5c16c992..c661710d362 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 a25c2afa67e..e7560389079 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/workqueue.h b/include/linux/workqueue.h
index d555f31c074..ce0719a2cfe 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -122,7 +122,7 @@ extern struct workqueue_struct *__create_workqueue(const char *name,
122 int singlethread, 122 int singlethread,
123 int freezeable); 123 int freezeable);
124#define create_workqueue(name) __create_workqueue((name), 0, 0) 124#define create_workqueue(name) __create_workqueue((name), 0, 0)
125#define create_freezeable_workqueue(name) __create_workqueue((name), 0, 1) 125#define create_freezeable_workqueue(name) __create_workqueue((name), 1, 1)
126#define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0) 126#define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0)
127 127
128extern void destroy_workqueue(struct workqueue_struct *wq); 128extern void destroy_workqueue(struct workqueue_struct *wq);
@@ -160,7 +160,7 @@ static inline int cancel_delayed_work(struct delayed_work *work)
160{ 160{
161 int ret; 161 int ret;
162 162
163 ret = del_timer(&work->timer); 163 ret = del_timer_sync(&work->timer);
164 if (ret) 164 if (ret)
165 work_clear_pending(&work->work); 165 work_clear_pending(&work->work);
166 return ret; 166 return ret;
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 050915b5957..4ef4d22e5e4 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 8242a0ee1f5..87df4e87622 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 e12a8ce0b9b..82270f9332d 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 4fa5dfe886c..78a0d06d98d 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/rdma/ib_umem.h b/include/rdma/ib_umem.h
index b3a36f7d79e..c533d6c7903 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 47cefca59c8..0627a6aa282 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/soc.h b/include/sound/soc.h
index b1dc364b8f7..db6edba8ef0 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -22,7 +22,7 @@
22#include <sound/control.h> 22#include <sound/control.h>
23#include <sound/ac97_codec.h> 23#include <sound/ac97_codec.h>
24 24
25#define SND_SOC_VERSION "0.13.0" 25#define SND_SOC_VERSION "0.13.1"
26 26
27/* 27/*
28 * Convenience kcontrol builders 28 * Convenience kcontrol builders
@@ -83,6 +83,7 @@
83#define SND_SOC_DAI_AC97 0x1 83#define SND_SOC_DAI_AC97 0x1
84#define SND_SOC_DAI_I2S 0x2 84#define SND_SOC_DAI_I2S 0x2
85#define SND_SOC_DAI_PCM 0x4 85#define SND_SOC_DAI_PCM 0x4
86#define SND_SOC_DAI_AC97_BUS 0x8 /* for custom i.e. non ac97_codec.c */
86 87
87/* 88/*
88 * DAI hardware audio formats 89 * DAI hardware audio formats
@@ -278,6 +279,7 @@ struct snd_soc_cpu_ops {
278struct snd_soc_codec_dai { 279struct snd_soc_codec_dai {
279 char *name; 280 char *name;
280 int id; 281 int id;
282 unsigned char type;
281 283
282 /* DAI capabilities */ 284 /* DAI capabilities */
283 struct snd_soc_pcm_stream playback; 285 struct snd_soc_pcm_stream playback;
diff --git a/include/sound/version.h b/include/sound/version.h
index e820f0e7bdd..50ee4fd420f 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.14rc4"
3#define CONFIG_SND_DATE " (Wed May 09 09:51:39 2007 UTC)" 3#define CONFIG_SND_DATE " (Wed May 16 09:45:46 2007 UTC)"
diff --git a/init/Kconfig b/init/Kconfig
index 4e009fde4b6..a9e99f8328f 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -567,7 +567,6 @@ config SLAB
567 a slab allocator. 567 a slab allocator.
568 568
569config SLUB 569config SLUB
570 depends on EXPERIMENTAL && !ARCH_USES_SLAB_PAGE_STRUCT
571 bool "SLUB (Unqueued Allocator)" 570 bool "SLUB (Unqueued Allocator)"
572 help 571 help
573 SLUB is a slab allocator that minimizes cache line usage 572 SLUB is a slab allocator that minimizes cache line usage
@@ -577,14 +576,11 @@ config SLUB
577 and has enhanced diagnostics. 576 and has enhanced diagnostics.
578 577
579config SLOB 578config SLOB
580# 579 depends on EMBEDDED && !SPARSEMEM
581# SLOB does not support SMP because SLAB_DESTROY_BY_RCU is unsupported
582#
583 depends on EMBEDDED && !SMP && !SPARSEMEM
584 bool "SLOB (Simple Allocator)" 580 bool "SLOB (Simple Allocator)"
585 help 581 help
586 SLOB replaces the SLAB allocator with a drastically simpler 582 SLOB replaces the SLAB allocator with a drastically simpler
587 allocator. SLOB is more space efficient that SLAB but does not 583 allocator. SLOB is more space efficient than SLAB but does not
588 scale well (single lock for all operations) and is also highly 584 scale well (single lock for all operations) and is also highly
589 susceptible to fragmentation. SLUB can accomplish a higher object 585 susceptible to fragmentation. SLUB can accomplish a higher object
590 density. It is usually better to use SLUB instead of SLOB. 586 density. It is usually better to use SLUB instead of SLOB.
diff --git a/init/main.c b/init/main.c
index 1940fa75e82..eb8bdbae4fc 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/ipc/mqueue.c b/ipc/mqueue.c
index fab5707cb5f..a242c83d89d 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -215,8 +215,7 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
215{ 215{
216 struct mqueue_inode_info *p = (struct mqueue_inode_info *) foo; 216 struct mqueue_inode_info *p = (struct mqueue_inode_info *) foo;
217 217
218 if (flags & SLAB_CTOR_CONSTRUCTOR) 218 inode_init_once(&p->vfs_inode);
219 inode_init_once(&p->vfs_inode);
220} 219}
221 220
222static struct inode *mqueue_alloc_inode(struct super_block *sb) 221static struct inode *mqueue_alloc_inode(struct super_block *sb)
diff --git a/kernel/exit.c b/kernel/exit.c
index c6d14b8008d..5b888c24e43 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 49530e40ea8..73ad5cda1bc 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);
@@ -1427,10 +1430,8 @@ static void sighand_ctor(void *data, struct kmem_cache *cachep,
1427{ 1430{
1428 struct sighand_struct *sighand = data; 1431 struct sighand_struct *sighand = data;
1429 1432
1430 if (flags & SLAB_CTOR_CONSTRUCTOR) { 1433 spin_lock_init(&sighand->siglock);
1431 spin_lock_init(&sighand->siglock); 1434 INIT_LIST_HEAD(&sighand->signalfd_list);
1432 INIT_LIST_HEAD(&sighand->signalfd_list);
1433 }
1434} 1435}
1435 1436
1436void __init proc_caches_init(void) 1437void __init proc_caches_init(void)
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index b0d81aae472..bd9e272d55e 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 f1bda23140b..fed54418626 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 df8a8e8f6ca..bbd51b81a3e 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/disk.c b/kernel/power/disk.c
index b5f0543ed84..f445b9cd60f 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -416,7 +416,8 @@ static ssize_t disk_store(struct kset *kset, const char *buf, size_t n)
416 416
417 mutex_lock(&pm_mutex); 417 mutex_lock(&pm_mutex);
418 for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) { 418 for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) {
419 if (!strncmp(buf, hibernation_modes[i], len)) { 419 if (len == strlen(hibernation_modes[i])
420 && !strncmp(buf, hibernation_modes[i], len)) {
420 mode = i; 421 mode = i;
421 break; 422 break;
422 } 423 }
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 40d56a31245..8812985f302 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -97,25 +97,26 @@ static int suspend_prepare(suspend_state_t state)
97 } 97 }
98 } 98 }
99 99
100 if (pm_ops->prepare) {
101 if ((error = pm_ops->prepare(state)))
102 goto Thaw;
103 }
104
105 suspend_console(); 100 suspend_console();
106 error = device_suspend(PMSG_SUSPEND); 101 error = device_suspend(PMSG_SUSPEND);
107 if (error) { 102 if (error) {
108 printk(KERN_ERR "Some devices failed to suspend\n"); 103 printk(KERN_ERR "Some devices failed to suspend\n");
109 goto Resume_devices; 104 goto Resume_console;
110 } 105 }
106 if (pm_ops->prepare) {
107 if ((error = pm_ops->prepare(state)))
108 goto Resume_devices;
109 }
110
111 error = disable_nonboot_cpus(); 111 error = disable_nonboot_cpus();
112 if (!error) 112 if (!error)
113 return 0; 113 return 0;
114 114
115 enable_nonboot_cpus(); 115 enable_nonboot_cpus();
116 Resume_devices:
117 pm_finish(state); 116 pm_finish(state);
117 Resume_devices:
118 device_resume(); 118 device_resume();
119 Resume_console:
119 resume_console(); 120 resume_console();
120 Thaw: 121 Thaw:
121 thaw_processes(); 122 thaw_processes();
@@ -289,13 +290,13 @@ static ssize_t state_store(struct kset *kset, const char *buf, size_t n)
289 len = p ? p - buf : n; 290 len = p ? p - buf : n;
290 291
291 /* First, check if we are requested to hibernate */ 292 /* First, check if we are requested to hibernate */
292 if (!strncmp(buf, "disk", len)) { 293 if (len == 4 && !strncmp(buf, "disk", len)) {
293 error = hibernate(); 294 error = hibernate();
294 return error ? error : n; 295 return error ? error : n;
295 } 296 }
296 297
297 for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) { 298 for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) {
298 if (*s && !strncmp(buf, *s, len)) 299 if (*s && len == strlen(*s) && !strncmp(buf, *s, len))
299 break; 300 break;
300 } 301 }
301 if (state < PM_SUSPEND_MAX && *s) 302 if (state < PM_SUSPEND_MAX && *s)
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 08841938738..e0233d8422b 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 b8b235cc19d..8b1a1b83714 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 cc91b9bf759..5b20fe977be 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 799d23b4e35..13cdab3b4c4 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 364fc95bf97..acdfc0549c6 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/sysctl.c b/kernel/sysctl.c
index 4073353abd4..30ee462ee79 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -227,7 +227,7 @@ static ctl_table kern_table[] = {
227 .ctl_name = KERN_CORE_PATTERN, 227 .ctl_name = KERN_CORE_PATTERN,
228 .procname = "core_pattern", 228 .procname = "core_pattern",
229 .data = core_pattern, 229 .data = core_pattern,
230 .maxlen = 128, 230 .maxlen = CORENAME_MAX_SIZE,
231 .mode = 0644, 231 .mode = 0644,
232 .proc_handler = &proc_dostring, 232 .proc_handler = &proc_dostring,
233 .strategy = &sysctl_string, 233 .strategy = &sysctl_string,
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index cb25649c6f5..87aa5ff931e 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 eadfce2fff7..8001d37071f 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 3483e6cb954..52db9e3c526 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/timer.c b/kernel/timer.c
index 5ec5490f8d8..1a69705c2fb 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 fb56fedd5c0..3bebf73be97 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 fbc5c622acb..1ba77ca7d16 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -378,14 +378,13 @@ config FORCED_INLINING
378config RCU_TORTURE_TEST 378config RCU_TORTURE_TEST
379 tristate "torture tests for RCU" 379 tristate "torture tests for RCU"
380 depends on DEBUG_KERNEL 380 depends on DEBUG_KERNEL
381 depends on m
381 default n 382 default n
382 help 383 help
383 This option provides a kernel module that runs torture tests 384 This option provides a kernel module that runs torture tests
384 on the RCU infrastructure. The kernel module may be built 385 on the RCU infrastructure. The kernel module may be built
385 after the fact on the running kernel to be tested, if desired. 386 after the fact on the running kernel to be tested, if desired.
386 387
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. 388 Say M if you want the RCU torture tests to build as a module.
390 Say N if you are unsure. 389 Say N if you are unsure.
391 390
diff --git a/lib/ioremap.c b/lib/ioremap.c
index a9e4415b02d..760521417b6 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.c b/mm/filemap.c
index 7b48b2ad00e..edb1b0b5cc8 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -670,7 +670,8 @@ repeat:
670 page = find_lock_page(mapping, index); 670 page = find_lock_page(mapping, index);
671 if (!page) { 671 if (!page) {
672 if (!cached_page) { 672 if (!cached_page) {
673 cached_page = alloc_page(gfp_mask); 673 cached_page =
674 __page_cache_alloc(gfp_mask);
674 if (!cached_page) 675 if (!cached_page)
675 return NULL; 676 return NULL;
676 } 677 }
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c
index 1b49dab9b25..fa360e566d8 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 e75096b5a6d..60542d006ec 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.c b/mm/memory.c
index 1d647ab0ee7..cb94488ab96 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -481,7 +481,7 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
481 page = vm_normal_page(vma, addr, pte); 481 page = vm_normal_page(vma, addr, pte);
482 if (page) { 482 if (page) {
483 get_page(page); 483 get_page(page);
484 page_dup_rmap(page); 484 page_dup_rmap(page, vma, addr);
485 rss[!!PageAnon(page)]++; 485 rss[!!PageAnon(page)]++;
486 } 486 }
487 487
diff --git a/mm/mlock.c b/mm/mlock.c
index 3446b7ef731..4d3fea267e0 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 358d73cf7b7..144a7570535 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 ae96dd84443..d8970623c56 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)
@@ -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/rmap.c b/mm/rmap.c
index 304f51985c7..850165d32b7 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -162,12 +162,10 @@ void anon_vma_unlink(struct vm_area_struct *vma)
162static void anon_vma_ctor(void *data, struct kmem_cache *cachep, 162static void anon_vma_ctor(void *data, struct kmem_cache *cachep,
163 unsigned long flags) 163 unsigned long flags)
164{ 164{
165 if (flags & SLAB_CTOR_CONSTRUCTOR) { 165 struct anon_vma *anon_vma = data;
166 struct anon_vma *anon_vma = data;
167 166
168 spin_lock_init(&anon_vma->lock); 167 spin_lock_init(&anon_vma->lock);
169 INIT_LIST_HEAD(&anon_vma->head); 168 INIT_LIST_HEAD(&anon_vma->head);
170 }
171} 169}
172 170
173void __init anon_vma_init(void) 171void __init anon_vma_init(void)
@@ -532,19 +530,51 @@ static void __page_set_anon_rmap(struct page *page,
532} 530}
533 531
534/** 532/**
533 * page_set_anon_rmap - sanity check anonymous rmap addition
534 * @page: the page to add the mapping to
535 * @vma: the vm area in which the mapping is added
536 * @address: the user virtual address mapped
537 */
538static void __page_check_anon_rmap(struct page *page,
539 struct vm_area_struct *vma, unsigned long address)
540{
541#ifdef CONFIG_DEBUG_VM
542 /*
543 * The page's anon-rmap details (mapping and index) are guaranteed to
544 * be set up correctly at this point.
545 *
546 * We have exclusion against page_add_anon_rmap because the caller
547 * always holds the page locked, except if called from page_dup_rmap,
548 * in which case the page is already known to be setup.
549 *
550 * We have exclusion against page_add_new_anon_rmap because those pages
551 * are initially only visible via the pagetables, and the pte is locked
552 * over the call to page_add_new_anon_rmap.
553 */
554 struct anon_vma *anon_vma = vma->anon_vma;
555 anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON;
556 BUG_ON(page->mapping != (struct address_space *)anon_vma);
557 BUG_ON(page->index != linear_page_index(vma, address));
558#endif
559}
560
561/**
535 * page_add_anon_rmap - add pte mapping to an anonymous page 562 * page_add_anon_rmap - add pte mapping to an anonymous page
536 * @page: the page to add the mapping to 563 * @page: the page to add the mapping to
537 * @vma: the vm area in which the mapping is added 564 * @vma: the vm area in which the mapping is added
538 * @address: the user virtual address mapped 565 * @address: the user virtual address mapped
539 * 566 *
540 * The caller needs to hold the pte lock. 567 * The caller needs to hold the pte lock and the page must be locked.
541 */ 568 */
542void page_add_anon_rmap(struct page *page, 569void page_add_anon_rmap(struct page *page,
543 struct vm_area_struct *vma, unsigned long address) 570 struct vm_area_struct *vma, unsigned long address)
544{ 571{
572 VM_BUG_ON(!PageLocked(page));
573 VM_BUG_ON(address < vma->vm_start || address >= vma->vm_end);
545 if (atomic_inc_and_test(&page->_mapcount)) 574 if (atomic_inc_and_test(&page->_mapcount))
546 __page_set_anon_rmap(page, vma, address); 575 __page_set_anon_rmap(page, vma, address);
547 /* else checking page index and mapping is racy */ 576 else
577 __page_check_anon_rmap(page, vma, address);
548} 578}
549 579
550/* 580/*
@@ -555,10 +585,12 @@ void page_add_anon_rmap(struct page *page,
555 * 585 *
556 * Same as page_add_anon_rmap but must only be called on *new* pages. 586 * Same as page_add_anon_rmap but must only be called on *new* pages.
557 * This means the inc-and-test can be bypassed. 587 * This means the inc-and-test can be bypassed.
588 * Page does not have to be locked.
558 */ 589 */
559void page_add_new_anon_rmap(struct page *page, 590void page_add_new_anon_rmap(struct page *page,
560 struct vm_area_struct *vma, unsigned long address) 591 struct vm_area_struct *vma, unsigned long address)
561{ 592{
593 BUG_ON(address < vma->vm_start || address >= vma->vm_end);
562 atomic_set(&page->_mapcount, 0); /* elevate count by 1 (starts at -1) */ 594 atomic_set(&page->_mapcount, 0); /* elevate count by 1 (starts at -1) */
563 __page_set_anon_rmap(page, vma, address); 595 __page_set_anon_rmap(page, vma, address);
564} 596}
@@ -575,6 +607,26 @@ void page_add_file_rmap(struct page *page)
575 __inc_zone_page_state(page, NR_FILE_MAPPED); 607 __inc_zone_page_state(page, NR_FILE_MAPPED);
576} 608}
577 609
610#ifdef CONFIG_DEBUG_VM
611/**
612 * page_dup_rmap - duplicate pte mapping to a page
613 * @page: the page to add the mapping to
614 *
615 * For copy_page_range only: minimal extract from page_add_file_rmap /
616 * page_add_anon_rmap, avoiding unnecessary tests (already checked) so it's
617 * quicker.
618 *
619 * The caller needs to hold the pte lock.
620 */
621void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address)
622{
623 BUG_ON(page_mapcount(page) == 0);
624 if (PageAnon(page))
625 __page_check_anon_rmap(page, vma, address);
626 atomic_inc(&page->_mapcount);
627}
628#endif
629
578/** 630/**
579 * page_remove_rmap - take down pte mapping from a page 631 * page_remove_rmap - take down pte mapping from a page
580 * @page: page to remove mapping from 632 * @page: page to remove mapping from
diff --git a/mm/shmem.c b/mm/shmem.c
index f01e8deed64..e537317bec4 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2358,13 +2358,11 @@ static void init_once(void *foo, struct kmem_cache *cachep,
2358{ 2358{
2359 struct shmem_inode_info *p = (struct shmem_inode_info *) foo; 2359 struct shmem_inode_info *p = (struct shmem_inode_info *) foo;
2360 2360
2361 if (flags & SLAB_CTOR_CONSTRUCTOR) { 2361 inode_init_once(&p->vfs_inode);
2362 inode_init_once(&p->vfs_inode);
2363#ifdef CONFIG_TMPFS_POSIX_ACL 2362#ifdef CONFIG_TMPFS_POSIX_ACL
2364 p->i_acl = NULL; 2363 p->i_acl = NULL;
2365 p->i_default_acl = NULL; 2364 p->i_default_acl = NULL;
2366#endif 2365#endif
2367 }
2368} 2366}
2369 2367
2370static int init_inodecache(void) 2368static int init_inodecache(void)
diff --git a/mm/slab.c b/mm/slab.c
index 944b20581f8..2e71a328aa0 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -409,9 +409,6 @@ struct kmem_cache {
409 /* constructor func */ 409 /* constructor func */
410 void (*ctor) (void *, struct kmem_cache *, unsigned long); 410 void (*ctor) (void *, struct kmem_cache *, unsigned long);
411 411
412 /* de-constructor func */
413 void (*dtor) (void *, struct kmem_cache *, unsigned long);
414
415/* 5) cache creation/removal */ 412/* 5) cache creation/removal */
416 const char *name; 413 const char *name;
417 struct list_head next; 414 struct list_head next;
@@ -572,21 +569,6 @@ static void **dbg_userword(struct kmem_cache *cachep, void *objp)
572#endif 569#endif
573 570
574/* 571/*
575 * Maximum size of an obj (in 2^order pages) and absolute limit for the gfp
576 * order.
577 */
578#if defined(CONFIG_LARGE_ALLOCS)
579#define MAX_OBJ_ORDER 13 /* up to 32Mb */
580#define MAX_GFP_ORDER 13 /* up to 32Mb */
581#elif defined(CONFIG_MMU)
582#define MAX_OBJ_ORDER 5 /* 32 pages */
583#define MAX_GFP_ORDER 5 /* 32 pages */
584#else
585#define MAX_OBJ_ORDER 8 /* up to 1Mb */
586#define MAX_GFP_ORDER 8 /* up to 1Mb */
587#endif
588
589/*
590 * Do not go above this order unless 0 objects fit into the slab. 572 * Do not go above this order unless 0 objects fit into the slab.
591 */ 573 */
592#define BREAK_GFP_ORDER_HI 1 574#define BREAK_GFP_ORDER_HI 1
@@ -792,6 +774,7 @@ static inline struct kmem_cache *__find_general_cachep(size_t size,
792 */ 774 */
793 BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL); 775 BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL);
794#endif 776#endif
777 WARN_ON_ONCE(size == 0);
795 while (size > csizep->cs_size) 778 while (size > csizep->cs_size)
796 csizep++; 779 csizep++;
797 780
@@ -1911,20 +1894,11 @@ static void slab_destroy_objs(struct kmem_cache *cachep, struct slab *slabp)
1911 slab_error(cachep, "end of a freed object " 1894 slab_error(cachep, "end of a freed object "
1912 "was overwritten"); 1895 "was overwritten");
1913 } 1896 }
1914 if (cachep->dtor && !(cachep->flags & SLAB_POISON))
1915 (cachep->dtor) (objp + obj_offset(cachep), cachep, 0);
1916 } 1897 }
1917} 1898}
1918#else 1899#else
1919static void slab_destroy_objs(struct kmem_cache *cachep, struct slab *slabp) 1900static void slab_destroy_objs(struct kmem_cache *cachep, struct slab *slabp)
1920{ 1901{
1921 if (cachep->dtor) {
1922 int i;
1923 for (i = 0; i < cachep->num; i++) {
1924 void *objp = index_to_obj(cachep, slabp, i);
1925 (cachep->dtor) (objp, cachep, 0);
1926 }
1927 }
1928} 1902}
1929#endif 1903#endif
1930 1904
@@ -2013,7 +1987,7 @@ static size_t calculate_slab_order(struct kmem_cache *cachep,
2013 size_t left_over = 0; 1987 size_t left_over = 0;
2014 int gfporder; 1988 int gfporder;
2015 1989
2016 for (gfporder = 0; gfporder <= MAX_GFP_ORDER; gfporder++) { 1990 for (gfporder = 0; gfporder <= KMALLOC_MAX_ORDER; gfporder++) {
2017 unsigned int num; 1991 unsigned int num;
2018 size_t remainder; 1992 size_t remainder;
2019 1993
@@ -2063,7 +2037,7 @@ static size_t calculate_slab_order(struct kmem_cache *cachep,
2063 return left_over; 2037 return left_over;
2064} 2038}
2065 2039
2066static int setup_cpu_cache(struct kmem_cache *cachep) 2040static int __init_refok setup_cpu_cache(struct kmem_cache *cachep)
2067{ 2041{
2068 if (g_cpucache_up == FULL) 2042 if (g_cpucache_up == FULL)
2069 return enable_cpucache(cachep); 2043 return enable_cpucache(cachep);
@@ -2124,7 +2098,7 @@ static int setup_cpu_cache(struct kmem_cache *cachep)
2124 * @align: The required alignment for the objects. 2098 * @align: The required alignment for the objects.
2125 * @flags: SLAB flags 2099 * @flags: SLAB flags
2126 * @ctor: A constructor for the objects. 2100 * @ctor: A constructor for the objects.
2127 * @dtor: A destructor for the objects. 2101 * @dtor: A destructor for the objects (not implemented anymore).
2128 * 2102 *
2129 * Returns a ptr to the cache on success, NULL on failure. 2103 * Returns a ptr to the cache on success, NULL on failure.
2130 * Cannot be called within a int, but can be interrupted. 2104 * Cannot be called within a int, but can be interrupted.
@@ -2159,7 +2133,7 @@ kmem_cache_create (const char *name, size_t size, size_t align,
2159 * Sanity checks... these are all serious usage bugs. 2133 * Sanity checks... these are all serious usage bugs.
2160 */ 2134 */
2161 if (!name || in_interrupt() || (size < BYTES_PER_WORD) || 2135 if (!name || in_interrupt() || (size < BYTES_PER_WORD) ||
2162 (size > (1 << MAX_OBJ_ORDER) * PAGE_SIZE) || (dtor && !ctor)) { 2136 size > KMALLOC_MAX_SIZE || dtor) {
2163 printk(KERN_ERR "%s: Early error in slab %s\n", __FUNCTION__, 2137 printk(KERN_ERR "%s: Early error in slab %s\n", __FUNCTION__,
2164 name); 2138 name);
2165 BUG(); 2139 BUG();
@@ -2213,9 +2187,6 @@ kmem_cache_create (const char *name, size_t size, size_t align,
2213 if (flags & SLAB_DESTROY_BY_RCU) 2187 if (flags & SLAB_DESTROY_BY_RCU)
2214 BUG_ON(flags & SLAB_POISON); 2188 BUG_ON(flags & SLAB_POISON);
2215#endif 2189#endif
2216 if (flags & SLAB_DESTROY_BY_RCU)
2217 BUG_ON(dtor);
2218
2219 /* 2190 /*
2220 * Always checks flags, a caller might be expecting debug support which 2191 * Always checks flags, a caller might be expecting debug support which
2221 * isn't available. 2192 * isn't available.
@@ -2370,7 +2341,6 @@ kmem_cache_create (const char *name, size_t size, size_t align,
2370 BUG_ON(!cachep->slabp_cache); 2341 BUG_ON(!cachep->slabp_cache);
2371 } 2342 }
2372 cachep->ctor = ctor; 2343 cachep->ctor = ctor;
2373 cachep->dtor = dtor;
2374 cachep->name = name; 2344 cachep->name = name;
2375 2345
2376 if (setup_cpu_cache(cachep)) { 2346 if (setup_cpu_cache(cachep)) {
@@ -2625,7 +2595,7 @@ static inline kmem_bufctl_t *slab_bufctl(struct slab *slabp)
2625} 2595}
2626 2596
2627static void cache_init_objs(struct kmem_cache *cachep, 2597static void cache_init_objs(struct kmem_cache *cachep,
2628 struct slab *slabp, unsigned long ctor_flags) 2598 struct slab *slabp)
2629{ 2599{
2630 int i; 2600 int i;
2631 2601
@@ -2649,7 +2619,7 @@ static void cache_init_objs(struct kmem_cache *cachep,
2649 */ 2619 */
2650 if (cachep->ctor && !(cachep->flags & SLAB_POISON)) 2620 if (cachep->ctor && !(cachep->flags & SLAB_POISON))
2651 cachep->ctor(objp + obj_offset(cachep), cachep, 2621 cachep->ctor(objp + obj_offset(cachep), cachep,
2652 ctor_flags); 2622 0);
2653 2623
2654 if (cachep->flags & SLAB_RED_ZONE) { 2624 if (cachep->flags & SLAB_RED_ZONE) {
2655 if (*dbg_redzone2(cachep, objp) != RED_INACTIVE) 2625 if (*dbg_redzone2(cachep, objp) != RED_INACTIVE)
@@ -2665,7 +2635,7 @@ static void cache_init_objs(struct kmem_cache *cachep,
2665 cachep->buffer_size / PAGE_SIZE, 0); 2635 cachep->buffer_size / PAGE_SIZE, 0);
2666#else 2636#else
2667 if (cachep->ctor) 2637 if (cachep->ctor)
2668 cachep->ctor(objp, cachep, ctor_flags); 2638 cachep->ctor(objp, cachep, 0);
2669#endif 2639#endif
2670 slab_bufctl(slabp)[i] = i + 1; 2640 slab_bufctl(slabp)[i] = i + 1;
2671 } 2641 }
@@ -2754,7 +2724,6 @@ static int cache_grow(struct kmem_cache *cachep,
2754 struct slab *slabp; 2724 struct slab *slabp;
2755 size_t offset; 2725 size_t offset;
2756 gfp_t local_flags; 2726 gfp_t local_flags;
2757 unsigned long ctor_flags;
2758 struct kmem_list3 *l3; 2727 struct kmem_list3 *l3;
2759 2728
2760 /* 2729 /*
@@ -2763,7 +2732,6 @@ static int cache_grow(struct kmem_cache *cachep,
2763 */ 2732 */
2764 BUG_ON(flags & ~(GFP_DMA | GFP_LEVEL_MASK)); 2733 BUG_ON(flags & ~(GFP_DMA | GFP_LEVEL_MASK));
2765 2734
2766 ctor_flags = SLAB_CTOR_CONSTRUCTOR;
2767 local_flags = (flags & GFP_LEVEL_MASK); 2735 local_flags = (flags & GFP_LEVEL_MASK);
2768 /* Take the l3 list lock to change the colour_next on this node */ 2736 /* Take the l3 list lock to change the colour_next on this node */
2769 check_irq_off(); 2737 check_irq_off();
@@ -2808,7 +2776,7 @@ static int cache_grow(struct kmem_cache *cachep,
2808 slabp->nodeid = nodeid; 2776 slabp->nodeid = nodeid;
2809 slab_map_pages(cachep, slabp, objp); 2777 slab_map_pages(cachep, slabp, objp);
2810 2778
2811 cache_init_objs(cachep, slabp, ctor_flags); 2779 cache_init_objs(cachep, slabp);
2812 2780
2813 if (local_flags & __GFP_WAIT) 2781 if (local_flags & __GFP_WAIT)
2814 local_irq_disable(); 2782 local_irq_disable();
@@ -2835,7 +2803,6 @@ failed:
2835 * Perform extra freeing checks: 2803 * Perform extra freeing checks:
2836 * - detect bad pointers. 2804 * - detect bad pointers.
2837 * - POISON/RED_ZONE checking 2805 * - POISON/RED_ZONE checking
2838 * - destructor calls, for caches with POISON+dtor
2839 */ 2806 */
2840static void kfree_debugcheck(const void *objp) 2807static void kfree_debugcheck(const void *objp)
2841{ 2808{
@@ -2894,12 +2861,6 @@ static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp,
2894 BUG_ON(objnr >= cachep->num); 2861 BUG_ON(objnr >= cachep->num);
2895 BUG_ON(objp != index_to_obj(cachep, slabp, objnr)); 2862 BUG_ON(objp != index_to_obj(cachep, slabp, objnr));
2896 2863
2897 if (cachep->flags & SLAB_POISON && cachep->dtor) {
2898 /* we want to cache poison the object,
2899 * call the destruction callback
2900 */
2901 cachep->dtor(objp + obj_offset(cachep), cachep, 0);
2902 }
2903#ifdef CONFIG_DEBUG_SLAB_LEAK 2864#ifdef CONFIG_DEBUG_SLAB_LEAK
2904 slab_bufctl(slabp)[objnr] = BUFCTL_FREE; 2865 slab_bufctl(slabp)[objnr] = BUFCTL_FREE;
2905#endif 2866#endif
@@ -3099,7 +3060,7 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,
3099#endif 3060#endif
3100 objp += obj_offset(cachep); 3061 objp += obj_offset(cachep);
3101 if (cachep->ctor && cachep->flags & SLAB_POISON) 3062 if (cachep->ctor && cachep->flags & SLAB_POISON)
3102 cachep->ctor(objp, cachep, SLAB_CTOR_CONSTRUCTOR); 3063 cachep->ctor(objp, cachep, 0);
3103#if ARCH_SLAB_MINALIGN 3064#if ARCH_SLAB_MINALIGN
3104 if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) { 3065 if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) {
3105 printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n", 3066 printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n",
diff --git a/mm/slob.c b/mm/slob.c
index c6933bc19bc..71976c5d40d 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -35,6 +35,7 @@
35#include <linux/init.h> 35#include <linux/init.h>
36#include <linux/module.h> 36#include <linux/module.h>
37#include <linux/timer.h> 37#include <linux/timer.h>
38#include <linux/rcupdate.h>
38 39
39struct slob_block { 40struct slob_block {
40 int units; 41 int units;
@@ -53,6 +54,16 @@ struct bigblock {
53}; 54};
54typedef struct bigblock bigblock_t; 55typedef struct bigblock bigblock_t;
55 56
57/*
58 * struct slob_rcu is inserted at the tail of allocated slob blocks, which
59 * were created with a SLAB_DESTROY_BY_RCU slab. slob_rcu is used to free
60 * the block using call_rcu.
61 */
62struct slob_rcu {
63 struct rcu_head head;
64 int size;
65};
66
56static slob_t arena = { .next = &arena, .units = 1 }; 67static slob_t arena = { .next = &arena, .units = 1 };
57static slob_t *slobfree = &arena; 68static slob_t *slobfree = &arena;
58static bigblock_t *bigblocks; 69static bigblock_t *bigblocks;
@@ -266,9 +277,9 @@ size_t ksize(const void *block)
266 277
267struct kmem_cache { 278struct kmem_cache {
268 unsigned int size, align; 279 unsigned int size, align;
280 unsigned long flags;
269 const char *name; 281 const char *name;
270 void (*ctor)(void *, struct kmem_cache *, unsigned long); 282 void (*ctor)(void *, struct kmem_cache *, unsigned long);
271 void (*dtor)(void *, struct kmem_cache *, unsigned long);
272}; 283};
273 284
274struct kmem_cache *kmem_cache_create(const char *name, size_t size, 285struct kmem_cache *kmem_cache_create(const char *name, size_t size,
@@ -283,8 +294,12 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
283 if (c) { 294 if (c) {
284 c->name = name; 295 c->name = name;
285 c->size = size; 296 c->size = size;
297 if (flags & SLAB_DESTROY_BY_RCU) {
298 /* leave room for rcu footer at the end of object */
299 c->size += sizeof(struct slob_rcu);
300 }
301 c->flags = flags;
286 c->ctor = ctor; 302 c->ctor = ctor;
287 c->dtor = dtor;
288 /* ignore alignment unless it's forced */ 303 /* ignore alignment unless it's forced */
289 c->align = (flags & SLAB_HWCACHE_ALIGN) ? SLOB_ALIGN : 0; 304 c->align = (flags & SLAB_HWCACHE_ALIGN) ? SLOB_ALIGN : 0;
290 if (c->align < align) 305 if (c->align < align)
@@ -312,7 +327,7 @@ void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags)
312 b = (void *)__get_free_pages(flags, get_order(c->size)); 327 b = (void *)__get_free_pages(flags, get_order(c->size));
313 328
314 if (c->ctor) 329 if (c->ctor)
315 c->ctor(b, c, SLAB_CTOR_CONSTRUCTOR); 330 c->ctor(b, c, 0);
316 331
317 return b; 332 return b;
318} 333}
@@ -328,15 +343,33 @@ void *kmem_cache_zalloc(struct kmem_cache *c, gfp_t flags)
328} 343}
329EXPORT_SYMBOL(kmem_cache_zalloc); 344EXPORT_SYMBOL(kmem_cache_zalloc);
330 345
331void kmem_cache_free(struct kmem_cache *c, void *b) 346static void __kmem_cache_free(void *b, int size)
332{ 347{
333 if (c->dtor) 348 if (size < PAGE_SIZE)
334 c->dtor(b, c, 0); 349 slob_free(b, size);
335
336 if (c->size < PAGE_SIZE)
337 slob_free(b, c->size);
338 else 350 else
339 free_pages((unsigned long)b, get_order(c->size)); 351 free_pages((unsigned long)b, get_order(size));
352}
353
354static void kmem_rcu_free(struct rcu_head *head)
355{
356 struct slob_rcu *slob_rcu = (struct slob_rcu *)head;
357 void *b = (void *)slob_rcu - (slob_rcu->size - sizeof(struct slob_rcu));
358
359 __kmem_cache_free(b, slob_rcu->size);
360}
361
362void kmem_cache_free(struct kmem_cache *c, void *b)
363{
364 if (unlikely(c->flags & SLAB_DESTROY_BY_RCU)) {
365 struct slob_rcu *slob_rcu;
366 slob_rcu = b + (c->size - sizeof(struct slob_rcu));
367 INIT_RCU_HEAD(&slob_rcu->head);
368 slob_rcu->size = c->size;
369 call_rcu(&slob_rcu->head, kmem_rcu_free);
370 } else {
371 __kmem_cache_free(b, c->size);
372 }
340} 373}
341EXPORT_SYMBOL(kmem_cache_free); 374EXPORT_SYMBOL(kmem_cache_free);
342 375
diff --git a/mm/slub.c b/mm/slub.c
index b39c8a69a4f..3e5aefcb407 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -78,10 +78,18 @@
78 * 78 *
79 * Overloading of page flags that are otherwise used for LRU management. 79 * Overloading of page flags that are otherwise used for LRU management.
80 * 80 *
81 * PageActive The slab is used as a cpu cache. Allocations 81 * PageActive The slab is frozen and exempt from list processing.
82 * may be performed from the slab. The slab is not 82 * This means that the slab is dedicated to a purpose
83 * on any slab list and cannot be moved onto one. 83 * such as satisfying allocations for a specific
84 * The cpu slab may be equipped with an additioanl 84 * processor. Objects may be freed in the slab while
85 * it is frozen but slab_free will then skip the usual
86 * list operations. It is up to the processor holding
87 * the slab to integrate the slab into the slab lists
88 * when the slab is no longer needed.
89 *
90 * One use of this flag is to mark slabs that are
91 * used for allocations. Then such a slab becomes a cpu
92 * slab. The cpu slab may be equipped with an additional
85 * lockless_freelist that allows lockless access to 93 * lockless_freelist that allows lockless access to
86 * free objects in addition to the regular freelist 94 * free objects in addition to the regular freelist
87 * that requires the slab lock. 95 * that requires the slab lock.
@@ -91,27 +99,42 @@
91 * the fast path and disables lockless freelists. 99 * the fast path and disables lockless freelists.
92 */ 100 */
93 101
94static inline int SlabDebug(struct page *page) 102#define FROZEN (1 << PG_active)
95{ 103
96#ifdef CONFIG_SLUB_DEBUG 104#ifdef CONFIG_SLUB_DEBUG
97 return PageError(page); 105#define SLABDEBUG (1 << PG_error)
98#else 106#else
99 return 0; 107#define SLABDEBUG 0
100#endif 108#endif
109
110static inline int SlabFrozen(struct page *page)
111{
112 return page->flags & FROZEN;
113}
114
115static inline void SetSlabFrozen(struct page *page)
116{
117 page->flags |= FROZEN;
118}
119
120static inline void ClearSlabFrozen(struct page *page)
121{
122 page->flags &= ~FROZEN;
123}
124
125static inline int SlabDebug(struct page *page)
126{
127 return page->flags & SLABDEBUG;
101} 128}
102 129
103static inline void SetSlabDebug(struct page *page) 130static inline void SetSlabDebug(struct page *page)
104{ 131{
105#ifdef CONFIG_SLUB_DEBUG 132 page->flags |= SLABDEBUG;
106 SetPageError(page);
107#endif
108} 133}
109 134
110static inline void ClearSlabDebug(struct page *page) 135static inline void ClearSlabDebug(struct page *page)
111{ 136{
112#ifdef CONFIG_SLUB_DEBUG 137 page->flags &= ~SLABDEBUG;
113 ClearPageError(page);
114#endif
115} 138}
116 139
117/* 140/*
@@ -719,6 +742,22 @@ static int on_freelist(struct kmem_cache *s, struct page *page, void *search)
719 return search == NULL; 742 return search == NULL;
720} 743}
721 744
745static void trace(struct kmem_cache *s, struct page *page, void *object, int alloc)
746{
747 if (s->flags & SLAB_TRACE) {
748 printk(KERN_INFO "TRACE %s %s 0x%p inuse=%d fp=0x%p\n",
749 s->name,
750 alloc ? "alloc" : "free",
751 object, page->inuse,
752 page->freelist);
753
754 if (!alloc)
755 print_section("Object", (void *)object, s->objsize);
756
757 dump_stack();
758 }
759}
760
722/* 761/*
723 * Tracking of fully allocated slabs for debugging purposes. 762 * Tracking of fully allocated slabs for debugging purposes.
724 */ 763 */
@@ -743,8 +782,18 @@ static void remove_full(struct kmem_cache *s, struct page *page)
743 spin_unlock(&n->list_lock); 782 spin_unlock(&n->list_lock);
744} 783}
745 784
746static int alloc_object_checks(struct kmem_cache *s, struct page *page, 785static void setup_object_debug(struct kmem_cache *s, struct page *page,
747 void *object) 786 void *object)
787{
788 if (!(s->flags & (SLAB_STORE_USER|SLAB_RED_ZONE|__OBJECT_POISON)))
789 return;
790
791 init_object(s, object, 0);
792 init_tracking(s, object);
793}
794
795static int alloc_debug_processing(struct kmem_cache *s, struct page *page,
796 void *object, void *addr)
748{ 797{
749 if (!check_slab(s, page)) 798 if (!check_slab(s, page))
750 goto bad; 799 goto bad;
@@ -759,13 +808,16 @@ static int alloc_object_checks(struct kmem_cache *s, struct page *page,
759 goto bad; 808 goto bad;
760 } 809 }
761 810
762 if (!object) 811 if (object && !check_object(s, page, object, 0))
763 return 1;
764
765 if (!check_object(s, page, object, 0))
766 goto bad; 812 goto bad;
767 813
814 /* Success perform special debug activities for allocs */
815 if (s->flags & SLAB_STORE_USER)
816 set_track(s, object, TRACK_ALLOC, addr);
817 trace(s, page, object, 1);
818 init_object(s, object, 1);
768 return 1; 819 return 1;
820
769bad: 821bad:
770 if (PageSlab(page)) { 822 if (PageSlab(page)) {
771 /* 823 /*
@@ -783,8 +835,8 @@ bad:
783 return 0; 835 return 0;
784} 836}
785 837
786static int free_object_checks(struct kmem_cache *s, struct page *page, 838static int free_debug_processing(struct kmem_cache *s, struct page *page,
787 void *object) 839 void *object, void *addr)
788{ 840{
789 if (!check_slab(s, page)) 841 if (!check_slab(s, page))
790 goto fail; 842 goto fail;
@@ -818,29 +870,22 @@ static int free_object_checks(struct kmem_cache *s, struct page *page,
818 "to slab %s", object, page->slab->name); 870 "to slab %s", object, page->slab->name);
819 goto fail; 871 goto fail;
820 } 872 }
873
874 /* Special debug activities for freeing objects */
875 if (!SlabFrozen(page) && !page->freelist)
876 remove_full(s, page);
877 if (s->flags & SLAB_STORE_USER)
878 set_track(s, object, TRACK_FREE, addr);
879 trace(s, page, object, 0);
880 init_object(s, object, 0);
821 return 1; 881 return 1;
882
822fail: 883fail:
823 printk(KERN_ERR "@@@ SLUB: %s slab 0x%p object at 0x%p not freed.\n", 884 printk(KERN_ERR "@@@ SLUB: %s slab 0x%p object at 0x%p not freed.\n",
824 s->name, page, object); 885 s->name, page, object);
825 return 0; 886 return 0;
826} 887}
827 888
828static void trace(struct kmem_cache *s, struct page *page, void *object, int alloc)
829{
830 if (s->flags & SLAB_TRACE) {
831 printk(KERN_INFO "TRACE %s %s 0x%p inuse=%d fp=0x%p\n",
832 s->name,
833 alloc ? "alloc" : "free",
834 object, page->inuse,
835 page->freelist);
836
837 if (!alloc)
838 print_section("Object", (void *)object, s->objsize);
839
840 dump_stack();
841 }
842}
843
844static int __init setup_slub_debug(char *str) 889static int __init setup_slub_debug(char *str)
845{ 890{
846 if (!str || *str != '=') 891 if (!str || *str != '=')
@@ -891,13 +936,13 @@ static void kmem_cache_open_debug_check(struct kmem_cache *s)
891 * On 32 bit platforms the limit is 256k. On 64bit platforms 936 * On 32 bit platforms the limit is 256k. On 64bit platforms
892 * the limit is 512k. 937 * the limit is 512k.
893 * 938 *
894 * Debugging or ctor/dtors may create a need to move the free 939 * Debugging or ctor may create a need to move the free
895 * pointer. Fail if this happens. 940 * pointer. Fail if this happens.
896 */ 941 */
897 if (s->size >= 65535 * sizeof(void *)) { 942 if (s->objsize >= 65535 * sizeof(void *)) {
898 BUG_ON(s->flags & (SLAB_RED_ZONE | SLAB_POISON | 943 BUG_ON(s->flags & (SLAB_RED_ZONE | SLAB_POISON |
899 SLAB_STORE_USER | SLAB_DESTROY_BY_RCU)); 944 SLAB_STORE_USER | SLAB_DESTROY_BY_RCU));
900 BUG_ON(s->ctor || s->dtor); 945 BUG_ON(s->ctor);
901 } 946 }
902 else 947 else
903 /* 948 /*
@@ -909,26 +954,20 @@ static void kmem_cache_open_debug_check(struct kmem_cache *s)
909 s->flags |= slub_debug; 954 s->flags |= slub_debug;
910} 955}
911#else 956#else
957static inline void setup_object_debug(struct kmem_cache *s,
958 struct page *page, void *object) {}
912 959
913static inline int alloc_object_checks(struct kmem_cache *s, 960static inline int alloc_debug_processing(struct kmem_cache *s,
914 struct page *page, void *object) { return 0; } 961 struct page *page, void *object, void *addr) { return 0; }
915 962
916static inline int free_object_checks(struct kmem_cache *s, 963static inline int free_debug_processing(struct kmem_cache *s,
917 struct page *page, void *object) { return 0; } 964 struct page *page, void *object, void *addr) { return 0; }
918 965
919static inline void add_full(struct kmem_cache_node *n, struct page *page) {}
920static inline void remove_full(struct kmem_cache *s, struct page *page) {}
921static inline void trace(struct kmem_cache *s, struct page *page,
922 void *object, int alloc) {}
923static inline void init_object(struct kmem_cache *s,
924 void *object, int active) {}
925static inline void init_tracking(struct kmem_cache *s, void *object) {}
926static inline int slab_pad_check(struct kmem_cache *s, struct page *page) 966static inline int slab_pad_check(struct kmem_cache *s, struct page *page)
927 { return 1; } 967 { return 1; }
928static inline int check_object(struct kmem_cache *s, struct page *page, 968static inline int check_object(struct kmem_cache *s, struct page *page,
929 void *object, int active) { return 1; } 969 void *object, int active) { return 1; }
930static inline void set_track(struct kmem_cache *s, void *object, 970static inline void add_full(struct kmem_cache_node *n, struct page *page) {}
931 enum track_item alloc, void *addr) {}
932static inline void kmem_cache_open_debug_check(struct kmem_cache *s) {} 971static inline void kmem_cache_open_debug_check(struct kmem_cache *s) {}
933#define slub_debug 0 972#define slub_debug 0
934#endif 973#endif
@@ -965,13 +1004,9 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
965static void setup_object(struct kmem_cache *s, struct page *page, 1004static void setup_object(struct kmem_cache *s, struct page *page,
966 void *object) 1005 void *object)
967{ 1006{
968 if (SlabDebug(page)) { 1007 setup_object_debug(s, page, object);
969 init_object(s, object, 0);
970 init_tracking(s, object);
971 }
972
973 if (unlikely(s->ctor)) 1008 if (unlikely(s->ctor))
974 s->ctor(object, s, SLAB_CTOR_CONSTRUCTOR); 1009 s->ctor(object, s, 0);
975} 1010}
976 1011
977static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) 1012static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
@@ -1030,15 +1065,12 @@ static void __free_slab(struct kmem_cache *s, struct page *page)
1030{ 1065{
1031 int pages = 1 << s->order; 1066 int pages = 1 << s->order;
1032 1067
1033 if (unlikely(SlabDebug(page) || s->dtor)) { 1068 if (unlikely(SlabDebug(page))) {
1034 void *p; 1069 void *p;
1035 1070
1036 slab_pad_check(s, page); 1071 slab_pad_check(s, page);
1037 for_each_object(p, s, page_address(page)) { 1072 for_each_object(p, s, page_address(page))
1038 if (s->dtor)
1039 s->dtor(p, s, 0);
1040 check_object(s, page, p, 0); 1073 check_object(s, page, p, 0);
1041 }
1042 } 1074 }
1043 1075
1044 mod_zone_page_state(page_zone(page), 1076 mod_zone_page_state(page_zone(page),
@@ -1138,11 +1170,12 @@ static void remove_partial(struct kmem_cache *s,
1138 * 1170 *
1139 * Must hold list_lock. 1171 * Must hold list_lock.
1140 */ 1172 */
1141static int lock_and_del_slab(struct kmem_cache_node *n, struct page *page) 1173static inline int lock_and_freeze_slab(struct kmem_cache_node *n, struct page *page)
1142{ 1174{
1143 if (slab_trylock(page)) { 1175 if (slab_trylock(page)) {
1144 list_del(&page->lru); 1176 list_del(&page->lru);
1145 n->nr_partial--; 1177 n->nr_partial--;
1178 SetSlabFrozen(page);
1146 return 1; 1179 return 1;
1147 } 1180 }
1148 return 0; 1181 return 0;
@@ -1166,7 +1199,7 @@ static struct page *get_partial_node(struct kmem_cache_node *n)
1166 1199
1167 spin_lock(&n->list_lock); 1200 spin_lock(&n->list_lock);
1168 list_for_each_entry(page, &n->partial, lru) 1201 list_for_each_entry(page, &n->partial, lru)
1169 if (lock_and_del_slab(n, page)) 1202 if (lock_and_freeze_slab(n, page))
1170 goto out; 1203 goto out;
1171 page = NULL; 1204 page = NULL;
1172out: 1205out:
@@ -1245,10 +1278,11 @@ static struct page *get_partial(struct kmem_cache *s, gfp_t flags, int node)
1245 * 1278 *
1246 * On exit the slab lock will have been dropped. 1279 * On exit the slab lock will have been dropped.
1247 */ 1280 */
1248static void putback_slab(struct kmem_cache *s, struct page *page) 1281static void unfreeze_slab(struct kmem_cache *s, struct page *page)
1249{ 1282{
1250 struct kmem_cache_node *n = get_node(s, page_to_nid(page)); 1283 struct kmem_cache_node *n = get_node(s, page_to_nid(page));
1251 1284
1285 ClearSlabFrozen(page);
1252 if (page->inuse) { 1286 if (page->inuse) {
1253 1287
1254 if (page->freelist) 1288 if (page->freelist)
@@ -1299,9 +1333,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, int cpu)
1299 page->inuse--; 1333 page->inuse--;
1300 } 1334 }
1301 s->cpu_slab[cpu] = NULL; 1335 s->cpu_slab[cpu] = NULL;
1302 ClearPageActive(page); 1336 unfreeze_slab(s, page);
1303
1304 putback_slab(s, page);
1305} 1337}
1306 1338
1307static void flush_slab(struct kmem_cache *s, struct page *page, int cpu) 1339static void flush_slab(struct kmem_cache *s, struct page *page, int cpu)
@@ -1392,9 +1424,7 @@ another_slab:
1392new_slab: 1424new_slab:
1393 page = get_partial(s, gfpflags, node); 1425 page = get_partial(s, gfpflags, node);
1394 if (page) { 1426 if (page) {
1395have_slab:
1396 s->cpu_slab[cpu] = page; 1427 s->cpu_slab[cpu] = page;
1397 SetPageActive(page);
1398 goto load_freelist; 1428 goto load_freelist;
1399 } 1429 }
1400 1430
@@ -1424,17 +1454,15 @@ have_slab:
1424 flush_slab(s, s->cpu_slab[cpu], cpu); 1454 flush_slab(s, s->cpu_slab[cpu], cpu);
1425 } 1455 }
1426 slab_lock(page); 1456 slab_lock(page);
1427 goto have_slab; 1457 SetSlabFrozen(page);
1458 s->cpu_slab[cpu] = page;
1459 goto load_freelist;
1428 } 1460 }
1429 return NULL; 1461 return NULL;
1430debug: 1462debug:
1431 object = page->freelist; 1463 object = page->freelist;
1432 if (!alloc_object_checks(s, page, object)) 1464 if (!alloc_debug_processing(s, page, object, addr))
1433 goto another_slab; 1465 goto another_slab;
1434 if (s->flags & SLAB_STORE_USER)
1435 set_track(s, object, TRACK_ALLOC, addr);
1436 trace(s, page, object, 1);
1437 init_object(s, object, 1);
1438 1466
1439 page->inuse++; 1467 page->inuse++;
1440 page->freelist = object[page->offset]; 1468 page->freelist = object[page->offset];
@@ -1511,11 +1539,7 @@ checks_ok:
1511 page->freelist = object; 1539 page->freelist = object;
1512 page->inuse--; 1540 page->inuse--;
1513 1541
1514 if (unlikely(PageActive(page))) 1542 if (unlikely(SlabFrozen(page)))
1515 /*
1516 * Cpu slabs are never on partial lists and are
1517 * never freed.
1518 */
1519 goto out_unlock; 1543 goto out_unlock;
1520 1544
1521 if (unlikely(!page->inuse)) 1545 if (unlikely(!page->inuse))
@@ -1545,14 +1569,8 @@ slab_empty:
1545 return; 1569 return;
1546 1570
1547debug: 1571debug:
1548 if (!free_object_checks(s, page, x)) 1572 if (!free_debug_processing(s, page, x, addr))
1549 goto out_unlock; 1573 goto out_unlock;
1550 if (!PageActive(page) && !page->freelist)
1551 remove_full(s, page);
1552 if (s->flags & SLAB_STORE_USER)
1553 set_track(s, x, TRACK_FREE, addr);
1554 trace(s, page, object, 0);
1555 init_object(s, object, 0);
1556 goto checks_ok; 1574 goto checks_ok;
1557} 1575}
1558 1576
@@ -1789,7 +1807,7 @@ static struct kmem_cache_node * __init early_kmem_cache_node_alloc(gfp_t gfpflag
1789 page->freelist = get_freepointer(kmalloc_caches, n); 1807 page->freelist = get_freepointer(kmalloc_caches, n);
1790 page->inuse++; 1808 page->inuse++;
1791 kmalloc_caches->node[node] = n; 1809 kmalloc_caches->node[node] = n;
1792 init_object(kmalloc_caches, n, 1); 1810 setup_object_debug(kmalloc_caches, page, n);
1793 init_kmem_cache_node(n); 1811 init_kmem_cache_node(n);
1794 atomic_long_inc(&n->nr_slabs); 1812 atomic_long_inc(&n->nr_slabs);
1795 add_partial(n, page); 1813 add_partial(n, page);
@@ -1871,7 +1889,7 @@ static int calculate_sizes(struct kmem_cache *s)
1871 * then we should never poison the object itself. 1889 * then we should never poison the object itself.
1872 */ 1890 */
1873 if ((flags & SLAB_POISON) && !(flags & SLAB_DESTROY_BY_RCU) && 1891 if ((flags & SLAB_POISON) && !(flags & SLAB_DESTROY_BY_RCU) &&
1874 !s->ctor && !s->dtor) 1892 !s->ctor)
1875 s->flags |= __OBJECT_POISON; 1893 s->flags |= __OBJECT_POISON;
1876 else 1894 else
1877 s->flags &= ~__OBJECT_POISON; 1895 s->flags &= ~__OBJECT_POISON;
@@ -1899,9 +1917,8 @@ static int calculate_sizes(struct kmem_cache *s)
1899 */ 1917 */
1900 s->inuse = size; 1918 s->inuse = size;
1901 1919
1902#ifdef CONFIG_SLUB_DEBUG
1903 if (((flags & (SLAB_DESTROY_BY_RCU | SLAB_POISON)) || 1920 if (((flags & (SLAB_DESTROY_BY_RCU | SLAB_POISON)) ||
1904 s->ctor || s->dtor)) { 1921 s->ctor)) {
1905 /* 1922 /*
1906 * Relocate free pointer after the object if it is not 1923 * Relocate free pointer after the object if it is not
1907 * permitted to overwrite the first word of the object on 1924 * permitted to overwrite the first word of the object on
@@ -1914,6 +1931,7 @@ static int calculate_sizes(struct kmem_cache *s)
1914 size += sizeof(void *); 1931 size += sizeof(void *);
1915 } 1932 }
1916 1933
1934#ifdef CONFIG_SLUB_DEBUG
1917 if (flags & SLAB_STORE_USER) 1935 if (flags & SLAB_STORE_USER)
1918 /* 1936 /*
1919 * Need to store information about allocs and frees after 1937 * Need to store information about allocs and frees after
@@ -1970,13 +1988,11 @@ static int calculate_sizes(struct kmem_cache *s)
1970static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags, 1988static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags,
1971 const char *name, size_t size, 1989 const char *name, size_t size,
1972 size_t align, unsigned long flags, 1990 size_t align, unsigned long flags,
1973 void (*ctor)(void *, struct kmem_cache *, unsigned long), 1991 void (*ctor)(void *, struct kmem_cache *, unsigned long))
1974 void (*dtor)(void *, struct kmem_cache *, unsigned long))
1975{ 1992{
1976 memset(s, 0, kmem_size); 1993 memset(s, 0, kmem_size);
1977 s->name = name; 1994 s->name = name;
1978 s->ctor = ctor; 1995 s->ctor = ctor;
1979 s->dtor = dtor;
1980 s->objsize = size; 1996 s->objsize = size;
1981 s->flags = flags; 1997 s->flags = flags;
1982 s->align = align; 1998 s->align = align;
@@ -2161,7 +2177,7 @@ static struct kmem_cache *create_kmalloc_cache(struct kmem_cache *s,
2161 2177
2162 down_write(&slub_lock); 2178 down_write(&slub_lock);
2163 if (!kmem_cache_open(s, gfp_flags, name, size, ARCH_KMALLOC_MINALIGN, 2179 if (!kmem_cache_open(s, gfp_flags, name, size, ARCH_KMALLOC_MINALIGN,
2164 flags, NULL, NULL)) 2180 flags, NULL))
2165 goto panic; 2181 goto panic;
2166 2182
2167 list_add(&s->list, &slab_caches); 2183 list_add(&s->list, &slab_caches);
@@ -2463,7 +2479,7 @@ static int slab_unmergeable(struct kmem_cache *s)
2463 if (slub_nomerge || (s->flags & SLUB_NEVER_MERGE)) 2479 if (slub_nomerge || (s->flags & SLUB_NEVER_MERGE))
2464 return 1; 2480 return 1;
2465 2481
2466 if (s->ctor || s->dtor) 2482 if (s->ctor)
2467 return 1; 2483 return 1;
2468 2484
2469 return 0; 2485 return 0;
@@ -2471,15 +2487,14 @@ static int slab_unmergeable(struct kmem_cache *s)
2471 2487
2472static struct kmem_cache *find_mergeable(size_t size, 2488static struct kmem_cache *find_mergeable(size_t size,
2473 size_t align, unsigned long flags, 2489 size_t align, unsigned long flags,
2474 void (*ctor)(void *, struct kmem_cache *, unsigned long), 2490 void (*ctor)(void *, struct kmem_cache *, unsigned long))
2475 void (*dtor)(void *, struct kmem_cache *, unsigned long))
2476{ 2491{
2477 struct list_head *h; 2492 struct list_head *h;
2478 2493
2479 if (slub_nomerge || (flags & SLUB_NEVER_MERGE)) 2494 if (slub_nomerge || (flags & SLUB_NEVER_MERGE))
2480 return NULL; 2495 return NULL;
2481 2496
2482 if (ctor || dtor) 2497 if (ctor)
2483 return NULL; 2498 return NULL;
2484 2499
2485 size = ALIGN(size, sizeof(void *)); 2500 size = ALIGN(size, sizeof(void *));
@@ -2521,8 +2536,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
2521{ 2536{
2522 struct kmem_cache *s; 2537 struct kmem_cache *s;
2523 2538
2539 BUG_ON(dtor);
2524 down_write(&slub_lock); 2540 down_write(&slub_lock);
2525 s = find_mergeable(size, align, flags, dtor, ctor); 2541 s = find_mergeable(size, align, flags, ctor);
2526 if (s) { 2542 if (s) {
2527 s->refcount++; 2543 s->refcount++;
2528 /* 2544 /*
@@ -2536,7 +2552,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
2536 } else { 2552 } else {
2537 s = kmalloc(kmem_size, GFP_KERNEL); 2553 s = kmalloc(kmem_size, GFP_KERNEL);
2538 if (s && kmem_cache_open(s, GFP_KERNEL, name, 2554 if (s && kmem_cache_open(s, GFP_KERNEL, name,
2539 size, align, flags, ctor, dtor)) { 2555 size, align, flags, ctor)) {
2540 if (sysfs_slab_add(s)) { 2556 if (sysfs_slab_add(s)) {
2541 kfree(s); 2557 kfree(s);
2542 goto err; 2558 goto err;
@@ -3177,17 +3193,6 @@ static ssize_t ctor_show(struct kmem_cache *s, char *buf)
3177} 3193}
3178SLAB_ATTR_RO(ctor); 3194SLAB_ATTR_RO(ctor);
3179 3195
3180static ssize_t dtor_show(struct kmem_cache *s, char *buf)
3181{
3182 if (s->dtor) {
3183 int n = sprint_symbol(buf, (unsigned long)s->dtor);
3184
3185 return n + sprintf(buf + n, "\n");
3186 }
3187 return 0;
3188}
3189SLAB_ATTR_RO(dtor);
3190
3191static ssize_t aliases_show(struct kmem_cache *s, char *buf) 3196static ssize_t aliases_show(struct kmem_cache *s, char *buf)
3192{ 3197{
3193 return sprintf(buf, "%d\n", s->refcount - 1); 3198 return sprintf(buf, "%d\n", s->refcount - 1);
@@ -3419,7 +3424,6 @@ static struct attribute * slab_attrs[] = {
3419 &partial_attr.attr, 3424 &partial_attr.attr,
3420 &cpu_slabs_attr.attr, 3425 &cpu_slabs_attr.attr,
3421 &ctor_attr.attr, 3426 &ctor_attr.attr,
3422 &dtor_attr.attr,
3423 &aliases_attr.attr, 3427 &aliases_attr.attr,
3424 &align_attr.attr, 3428 &align_attr.attr,
3425 &sanity_checks_attr.attr, 3429 &sanity_checks_attr.attr,
diff --git a/mm/sparse.c b/mm/sparse.c
index 6f3fff907bc..1302f8348d5 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 *
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index faa2a521dea..d3a9c536825 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -311,7 +311,7 @@ struct vm_struct *remove_vm_area(void *addr)
311 return v; 311 return v;
312} 312}
313 313
314void __vunmap(void *addr, int deallocate_pages) 314static void __vunmap(void *addr, int deallocate_pages)
315{ 315{
316 struct vm_struct *area; 316 struct vm_struct *area;
317 317
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 8faf27e5aa9..38254297a49 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/hci_sock.c b/net/bluetooth/hci_sock.c
index bfc9a35bad3..1dae3dfc66a 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -665,7 +665,8 @@ static int hci_sock_dev_event(struct notifier_block *this, unsigned long event,
665 /* Detach sockets from device */ 665 /* Detach sockets from device */
666 read_lock(&hci_sk_list.lock); 666 read_lock(&hci_sk_list.lock);
667 sk_for_each(sk, node, &hci_sk_list.head) { 667 sk_for_each(sk, node, &hci_sk_list.head) {
668 lock_sock(sk); 668 local_bh_disable();
669 bh_lock_sock_nested(sk);
669 if (hci_pi(sk)->hdev == hdev) { 670 if (hci_pi(sk)->hdev == hdev) {
670 hci_pi(sk)->hdev = NULL; 671 hci_pi(sk)->hdev = NULL;
671 sk->sk_err = EPIPE; 672 sk->sk_err = EPIPE;
@@ -674,7 +675,8 @@ static int hci_sock_dev_event(struct notifier_block *this, unsigned long event,
674 675
675 hci_dev_put(hdev); 676 hci_dev_put(hdev);
676 } 677 }
677 release_sock(sk); 678 bh_unlock_sock(sk);
679 local_bh_enable();
678 } 680 }
679 read_unlock(&hci_sk_list.lock); 681 read_unlock(&hci_sk_list.lock);
680 } 682 }
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index a59b1fb63b7..670ff95ca64 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/core/dev.c b/net/core/dev.c
index 8301e2ac747..5a7f20f7857 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -116,6 +116,7 @@
116#include <linux/dmaengine.h> 116#include <linux/dmaengine.h>
117#include <linux/err.h> 117#include <linux/err.h>
118#include <linux/ctype.h> 118#include <linux/ctype.h>
119#include <linux/if_arp.h>
119 120
120/* 121/*
121 * The list of packet types we will receive (as opposed to discard) 122 * The list of packet types we will receive (as opposed to discard)
@@ -217,6 +218,73 @@ extern void netdev_unregister_sysfs(struct net_device *);
217#define netdev_unregister_sysfs(dev) do { } while(0) 218#define netdev_unregister_sysfs(dev) do { } while(0)
218#endif 219#endif
219 220
221#ifdef CONFIG_DEBUG_LOCK_ALLOC
222/*
223 * register_netdevice() inits dev->_xmit_lock and sets lockdep class
224 * according to dev->type
225 */
226static const unsigned short netdev_lock_type[] =
227 {ARPHRD_NETROM, ARPHRD_ETHER, ARPHRD_EETHER, ARPHRD_AX25,
228 ARPHRD_PRONET, ARPHRD_CHAOS, ARPHRD_IEEE802, ARPHRD_ARCNET,
229 ARPHRD_APPLETLK, ARPHRD_DLCI, ARPHRD_ATM, ARPHRD_METRICOM,
230 ARPHRD_IEEE1394, ARPHRD_EUI64, ARPHRD_INFINIBAND, ARPHRD_SLIP,
231 ARPHRD_CSLIP, ARPHRD_SLIP6, ARPHRD_CSLIP6, ARPHRD_RSRVD,
232 ARPHRD_ADAPT, ARPHRD_ROSE, ARPHRD_X25, ARPHRD_HWX25,
233 ARPHRD_PPP, ARPHRD_CISCO, ARPHRD_LAPB, ARPHRD_DDCMP,
234 ARPHRD_RAWHDLC, ARPHRD_TUNNEL, ARPHRD_TUNNEL6, ARPHRD_FRAD,
235 ARPHRD_SKIP, ARPHRD_LOOPBACK, ARPHRD_LOCALTLK, ARPHRD_FDDI,
236 ARPHRD_BIF, ARPHRD_SIT, ARPHRD_IPDDP, ARPHRD_IPGRE,
237 ARPHRD_PIMREG, ARPHRD_HIPPI, ARPHRD_ASH, ARPHRD_ECONET,
238 ARPHRD_IRDA, ARPHRD_FCPP, ARPHRD_FCAL, ARPHRD_FCPL,
239 ARPHRD_FCFABRIC, ARPHRD_IEEE802_TR, ARPHRD_IEEE80211,
240 ARPHRD_IEEE80211_PRISM, ARPHRD_IEEE80211_RADIOTAP, ARPHRD_VOID,
241 ARPHRD_NONE};
242
243static const char *netdev_lock_name[] =
244 {"_xmit_NETROM", "_xmit_ETHER", "_xmit_EETHER", "_xmit_AX25",
245 "_xmit_PRONET", "_xmit_CHAOS", "_xmit_IEEE802", "_xmit_ARCNET",
246 "_xmit_APPLETLK", "_xmit_DLCI", "_xmit_ATM", "_xmit_METRICOM",
247 "_xmit_IEEE1394", "_xmit_EUI64", "_xmit_INFINIBAND", "_xmit_SLIP",
248 "_xmit_CSLIP", "_xmit_SLIP6", "_xmit_CSLIP6", "_xmit_RSRVD",
249 "_xmit_ADAPT", "_xmit_ROSE", "_xmit_X25", "_xmit_HWX25",
250 "_xmit_PPP", "_xmit_CISCO", "_xmit_LAPB", "_xmit_DDCMP",
251 "_xmit_RAWHDLC", "_xmit_TUNNEL", "_xmit_TUNNEL6", "_xmit_FRAD",
252 "_xmit_SKIP", "_xmit_LOOPBACK", "_xmit_LOCALTLK", "_xmit_FDDI",
253 "_xmit_BIF", "_xmit_SIT", "_xmit_IPDDP", "_xmit_IPGRE",
254 "_xmit_PIMREG", "_xmit_HIPPI", "_xmit_ASH", "_xmit_ECONET",
255 "_xmit_IRDA", "_xmit_FCPP", "_xmit_FCAL", "_xmit_FCPL",
256 "_xmit_FCFABRIC", "_xmit_IEEE802_TR", "_xmit_IEEE80211",
257 "_xmit_IEEE80211_PRISM", "_xmit_IEEE80211_RADIOTAP", "_xmit_VOID",
258 "_xmit_NONE"};
259
260static struct lock_class_key netdev_xmit_lock_key[ARRAY_SIZE(netdev_lock_type)];
261
262static inline unsigned short netdev_lock_pos(unsigned short dev_type)
263{
264 int i;
265
266 for (i = 0; i < ARRAY_SIZE(netdev_lock_type); i++)
267 if (netdev_lock_type[i] == dev_type)
268 return i;
269 /* the last key is used by default */
270 return ARRAY_SIZE(netdev_lock_type) - 1;
271}
272
273static inline void netdev_set_lockdep_class(spinlock_t *lock,
274 unsigned short dev_type)
275{
276 int i;
277
278 i = netdev_lock_pos(dev_type);
279 lockdep_set_class_and_name(lock, &netdev_xmit_lock_key[i],
280 netdev_lock_name[i]);
281}
282#else
283static inline void netdev_set_lockdep_class(spinlock_t *lock,
284 unsigned short dev_type)
285{
286}
287#endif
220 288
221/******************************************************************************* 289/*******************************************************************************
222 290
@@ -3001,6 +3069,7 @@ int register_netdevice(struct net_device *dev)
3001 3069
3002 spin_lock_init(&dev->queue_lock); 3070 spin_lock_init(&dev->queue_lock);
3003 spin_lock_init(&dev->_xmit_lock); 3071 spin_lock_init(&dev->_xmit_lock);
3072 netdev_set_lockdep_class(&dev->_xmit_lock, dev->type);
3004 dev->xmit_lock_owner = -1; 3073 dev->xmit_lock_owner = -1;
3005 spin_lock_init(&dev->ingress_lock); 3074 spin_lock_init(&dev->ingress_lock);
3006 3075
@@ -3245,7 +3314,6 @@ void netdev_run_todo(void)
3245 continue; 3314 continue;
3246 } 3315 }
3247 3316
3248 netdev_unregister_sysfs(dev);
3249 dev->reg_state = NETREG_UNREGISTERED; 3317 dev->reg_state = NETREG_UNREGISTERED;
3250 3318
3251 netdev_wait_allrefs(dev); 3319 netdev_wait_allrefs(dev);
@@ -3256,11 +3324,11 @@ void netdev_run_todo(void)
3256 BUG_TRAP(!dev->ip6_ptr); 3324 BUG_TRAP(!dev->ip6_ptr);
3257 BUG_TRAP(!dev->dn_ptr); 3325 BUG_TRAP(!dev->dn_ptr);
3258 3326
3259 /* It must be the very last action,
3260 * after this 'dev' may point to freed up memory.
3261 */
3262 if (dev->destructor) 3327 if (dev->destructor)
3263 dev->destructor(dev); 3328 dev->destructor(dev);
3329
3330 /* Free network device */
3331 kobject_put(&dev->dev.kobj);
3264 } 3332 }
3265 3333
3266out: 3334out:
@@ -3411,6 +3479,9 @@ void unregister_netdevice(struct net_device *dev)
3411 /* Notifier chain MUST detach us from master device. */ 3479 /* Notifier chain MUST detach us from master device. */
3412 BUG_TRAP(!dev->master); 3480 BUG_TRAP(!dev->master);
3413 3481
3482 /* Remove entries from sysfs */
3483 netdev_unregister_sysfs(dev);
3484
3414 /* Finish processing unregister after unlock */ 3485 /* Finish processing unregister after unlock */
3415 net_set_todo(dev); 3486 net_set_todo(dev);
3416 3487
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index b21307b15b8..5c19b0646d7 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 8c971a2efe2..27da9cdec6a 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 142257307fa..7c6a34e21ee 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 22183c2ef28..7e51d3a5e4f 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 b29712033dd..f34aca041a2 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -24,6 +24,7 @@ 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;
27#endif 28#endif
28 29
29ctl_table core_table[] = { 30ctl_table core_table[] = {
@@ -118,6 +119,14 @@ ctl_table core_table[] = {
118 .mode = 0644, 119 .mode = 0644,
119 .proc_handler = &proc_dointvec 120 .proc_handler = &proc_dointvec
120 }, 121 },
122 {
123 .ctl_name = CTL_UNNUMBERED,
124 .procname = "xfrm_larval_drop",
125 .data = &sysctl_xfrm_larval_drop,
126 .maxlen = sizeof(int),
127 .mode = 0644,
128 .proc_handler = &proc_dointvec
129 },
121#endif /* CONFIG_XFRM */ 130#endif /* CONFIG_XFRM */
122#endif /* CONFIG_NET */ 131#endif /* CONFIG_NET */
123 { 132 {
diff --git a/net/dccp/Kconfig b/net/dccp/Kconfig
index b8a68dd4100..0549e4719b1 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 d7d9ce73724..ec7fa4d67f0 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 64eac2515aa..31737cdf156 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 7ec6610841b..17ad278696e 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 e9cdc6615dd..c308756c2f9 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/Kconfig b/net/ipv4/Kconfig
index c68196cc56a..010fbb2d45e 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -43,11 +43,11 @@ config IP_ADVANCED_ROUTER
43 asymmetric routing (packets from you to a host take a different path 43 asymmetric routing (packets from you to a host take a different path
44 than packets from that host to you) or if you operate a non-routing 44 than packets from that host to you) or if you operate a non-routing
45 host which has several IP addresses on different interfaces. To turn 45 host which has several IP addresses on different interfaces. To turn
46 rp_filter off use: 46 rp_filter on use:
47 47
48 echo 0 > /proc/sys/net/ipv4/conf/<device>/rp_filter 48 echo 1 > /proc/sys/net/ipv4/conf/<device>/rp_filter
49 or 49 or
50 echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter 50 echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter
51 51
52 If unsure, say N here. 52 If unsure, say N here.
53 53
@@ -577,6 +577,7 @@ config TCP_CONG_VENO
577config TCP_CONG_YEAH 577config TCP_CONG_YEAH
578 tristate "YeAH TCP" 578 tristate "YeAH TCP"
579 depends on EXPERIMENTAL 579 depends on EXPERIMENTAL
580 select TCP_CONG_VEGAS
580 default n 581 default n
581 ---help--- 582 ---help---
582 YeAH-TCP is a sender-side high-speed enabled TCP congestion control 583 YeAH-TCP is a sender-side high-speed enabled TCP congestion control
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 9cfecf1215c..07e843a47dd 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 0e8b70bad4e..eef9eec17e0 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 406ea7050ae..bb94550d95c 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 9be7da7c3a8..30e332ade61 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 d38cbba92a4..e238b17f554 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 891b9355cf9..09d0c3f3566 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 0654eaae70c..fd62a41d69c 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 751b5980175..e6bc8e5a72f 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 fcebc968d37..c5d2a2d690b 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 cb76e3c725a..8603cfb271f 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2396,7 +2396,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
2396 2396
2397 /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */ 2397 /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
2398 dev_out = ip_dev_find(oldflp->fl4_src); 2398 dev_out = ip_dev_find(oldflp->fl4_src);
2399 if ((dev_out == NULL) && !(sysctl_ip_nonlocal_bind)) 2399 if (dev_out == NULL)
2400 goto out; 2400 goto out;
2401 2401
2402 /* I removed check for oif == dev_out->oif here. 2402 /* I removed check for oif == dev_out->oif here.
@@ -2407,7 +2407,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
2407 of another iface. --ANK 2407 of another iface. --ANK
2408 */ 2408 */
2409 2409
2410 if (dev_out && oldflp->oif == 0 2410 if (oldflp->oif == 0
2411 && (MULTICAST(oldflp->fl4_dst) || oldflp->fl4_dst == htonl(0xFFFFFFFF))) { 2411 && (MULTICAST(oldflp->fl4_dst) || oldflp->fl4_dst == htonl(0xFFFFFFFF))) {
2412 /* Special hack: user can direct multicasts 2412 /* Special hack: user can direct multicasts
2413 and limited broadcast via necessary interface 2413 and limited broadcast via necessary interface
@@ -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_cong.c b/net/ipv4/tcp_cong.c
index 86b26539e54..1260e52ad77 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -276,30 +276,34 @@ int tcp_set_congestion_control(struct sock *sk, const char *name)
276 276
277 277
278/* 278/*
279 * Slow start (exponential increase) with 279 * Slow start is used when congestion window is less than slow start
280 * RFC3742 Limited Slow Start (fast linear increase) support. 280 * threshold. This version implements the basic RFC2581 version
281 * and optionally supports:
282 * RFC3742 Limited Slow Start - growth limited to max_ssthresh
283 * RFC3465 Appropriate Byte Counting - growth limited by bytes acknowledged
281 */ 284 */
282void tcp_slow_start(struct tcp_sock *tp) 285void tcp_slow_start(struct tcp_sock *tp)
283{ 286{
284 int cnt = 0; 287 int cnt; /* increase in packets */
285 288
286 if (sysctl_tcp_abc) { 289 /* RFC3465: ABC Slow start
287 /* RFC3465: Slow Start 290 * Increase only after a full MSS of bytes is acked
288 * TCP sender SHOULD increase cwnd by the number of 291 *
289 * previously unacknowledged bytes ACKed by each incoming 292 * TCP sender SHOULD increase cwnd by the number of
290 * acknowledgment, provided the increase is not more than L 293 * previously unacknowledged bytes ACKed by each incoming
291 */ 294 * acknowledgment, provided the increase is not more than L
292 if (tp->bytes_acked < tp->mss_cache) 295 */
293 return; 296 if (sysctl_tcp_abc && tp->bytes_acked < tp->mss_cache)
294 } 297 return;
295 298
296 if (sysctl_tcp_max_ssthresh > 0 && 299 if (sysctl_tcp_max_ssthresh > 0 && tp->snd_cwnd > sysctl_tcp_max_ssthresh)
297 tp->snd_cwnd > sysctl_tcp_max_ssthresh) 300 cnt = sysctl_tcp_max_ssthresh >> 1; /* limited slow start */
298 cnt += sysctl_tcp_max_ssthresh>>1;
299 else 301 else
300 cnt += tp->snd_cwnd; 302 cnt = tp->snd_cwnd; /* exponential increase */
301 303
302 /* RFC3465: We MAY increase by 2 if discovered delayed ack */ 304 /* RFC3465: ABC
305 * We MAY increase by 2 if discovered delayed ack
306 */
303 if (sysctl_tcp_abc > 1 && tp->bytes_acked >= 2*tp->mss_cache) 307 if (sysctl_tcp_abc > 1 && tp->bytes_acked >= 2*tp->mss_cache)
304 cnt <<= 1; 308 cnt <<= 1;
305 tp->bytes_acked = 0; 309 tp->bytes_acked = 0;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 7641b2761a1..38cb25b48bf 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/ipv6/addrconf.c b/net/ipv6/addrconf.c
index c7ea248fae2..329de679ac3 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/datagram.c b/net/ipv6/datagram.c
index 403eee66b9c..b1fe7ac5dc9 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/raw.c b/net/ipv6/raw.c
index 009a1047fc3..a58459a7668 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 b46ad53044b..1324b06796c 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 e2f25ea43b6..4f06a51ad4f 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 a7ae59c954d..d1fbddd172e 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/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 15419dd682f..8400525177a 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -87,7 +87,7 @@ extern int ipxrtr_add_route(__be32 network, struct ipx_interface *intrfc,
87 unsigned char *node); 87 unsigned char *node);
88extern void ipxrtr_del_routes(struct ipx_interface *intrfc); 88extern void ipxrtr_del_routes(struct ipx_interface *intrfc);
89extern int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx, 89extern int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
90 struct iovec *iov, int len, int noblock); 90 struct iovec *iov, size_t len, int noblock);
91extern int ipxrtr_route_skb(struct sk_buff *skb); 91extern int ipxrtr_route_skb(struct sk_buff *skb);
92extern struct ipx_route *ipxrtr_lookup(__be32 net); 92extern struct ipx_route *ipxrtr_lookup(__be32 net);
93extern int ipxrtr_ioctl(unsigned int cmd, void __user *arg); 93extern int ipxrtr_ioctl(unsigned int cmd, void __user *arg);
diff --git a/net/key/af_key.c b/net/key/af_key.c
index a99444142dc..d302ddae580 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/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index e8b5c2d7db6..483e927a9ca 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 a186799f654..82db2aa53bf 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 b284db73ca7..a1b95acad29 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 4c6f8b3b120..3a21fdf1a26 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/rfkill/rfkill.c b/net/rfkill/rfkill.c
index a973603e388..f3986d498b4 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 91b3d52f6f1..e662f1d0766 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 4d92d88ff1f..3c04b00dab7 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 58f4b4e5cec..1c0be0e77b1 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 f28bb2dc58d..cbefe225581 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 99bcec8dd04..035788c5b7f 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 9cba49e2ad4..8210f549c49 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/socket.c b/net/socket.c
index 98a8f67abbf..f4530196a70 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -261,8 +261,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
261{ 261{
262 struct socket_alloc *ei = (struct socket_alloc *)foo; 262 struct socket_alloc *ei = (struct socket_alloc *)foo;
263 263
264 if (flags & SLAB_CTOR_CONSTRUCTOR) 264 inode_init_once(&ei->vfs_inode);
265 inode_init_once(&ei->vfs_inode);
266} 265}
267 266
268static int init_inodecache(void) 267static int init_inodecache(void)
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index a2f1893bde5..5887457dc93 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -828,19 +828,17 @@ init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
828{ 828{
829 struct rpc_inode *rpci = (struct rpc_inode *) foo; 829 struct rpc_inode *rpci = (struct rpc_inode *) foo;
830 830
831 if (flags & SLAB_CTOR_CONSTRUCTOR) { 831 inode_init_once(&rpci->vfs_inode);
832 inode_init_once(&rpci->vfs_inode); 832 rpci->private = NULL;
833 rpci->private = NULL; 833 rpci->nreaders = 0;
834 rpci->nreaders = 0; 834 rpci->nwriters = 0;
835 rpci->nwriters = 0; 835 INIT_LIST_HEAD(&rpci->in_upcall);
836 INIT_LIST_HEAD(&rpci->in_upcall); 836 INIT_LIST_HEAD(&rpci->pipe);
837 INIT_LIST_HEAD(&rpci->pipe); 837 rpci->pipelen = 0;
838 rpci->pipelen = 0; 838 init_waitqueue_head(&rpci->waitq);
839 init_waitqueue_head(&rpci->waitq); 839 INIT_DELAYED_WORK(&rpci->queue_timeout,
840 INIT_DELAYED_WORK(&rpci->queue_timeout, 840 rpc_timeout_upcall_queue);
841 rpc_timeout_upcall_queue); 841 rpci->ops = NULL;
842 rpci->ops = NULL;
843 }
844} 842}
845 843
846int register_rpc_pipefs(void) 844int register_rpc_pipefs(void)
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index b011eb625e4..944d75396fb 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -989,8 +989,6 @@ void rpc_killall_tasks(struct rpc_clnt *clnt)
989 spin_unlock(&rpc_sched_lock); 989 spin_unlock(&rpc_sched_lock);
990} 990}
991 991
992static DECLARE_MUTEX_LOCKED(rpciod_running);
993
994static void rpciod_killall(void) 992static void rpciod_killall(void)
995{ 993{
996 unsigned long flags; 994 unsigned long flags;
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
index 0d35bc796d0..73075dec83c 100644
--- a/net/sunrpc/sunrpc_syms.c
+++ b/net/sunrpc/sunrpc_syms.c
@@ -134,11 +134,7 @@ EXPORT_SYMBOL(nfsd_debug);
134EXPORT_SYMBOL(nlm_debug); 134EXPORT_SYMBOL(nlm_debug);
135#endif 135#endif
136 136
137extern int register_rpc_pipefs(void);
138extern void unregister_rpc_pipefs(void);
139extern struct cache_detail ip_map_cache, unix_gid_cache; 137extern struct cache_detail ip_map_cache, unix_gid_cache;
140extern int init_socket_xprt(void);
141extern void cleanup_socket_xprt(void);
142 138
143static int __init 139static int __init
144init_sunrpc(void) 140init_sunrpc(void)
diff --git a/net/tipc/Kconfig b/net/tipc/Kconfig
index f9e367d946e..3b30d1130b6 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 0ee6ded18f3..77d2d9ce896 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 6249a9405bb..5ced62c19c6 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 d0882e53b6f..b8bab89616a 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -29,6 +29,8 @@
29 29
30#include "xfrm_hash.h" 30#include "xfrm_hash.h"
31 31
32int sysctl_xfrm_larval_drop;
33
32DEFINE_MUTEX(xfrm_cfg_mutex); 34DEFINE_MUTEX(xfrm_cfg_mutex);
33EXPORT_SYMBOL(xfrm_cfg_mutex); 35EXPORT_SYMBOL(xfrm_cfg_mutex);
34 36
@@ -1390,8 +1392,8 @@ static int stale_bundle(struct dst_entry *dst);
1390 * At the moment we eat a raw IP route. Mostly to speed up lookups 1392 * At the moment we eat a raw IP route. Mostly to speed up lookups
1391 * on interfaces with disabled IPsec. 1393 * on interfaces with disabled IPsec.
1392 */ 1394 */
1393int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, 1395int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
1394 struct sock *sk, int flags) 1396 struct sock *sk, int flags)
1395{ 1397{
1396 struct xfrm_policy *policy; 1398 struct xfrm_policy *policy;
1397 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; 1399 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
@@ -1509,6 +1511,13 @@ restart:
1509 1511
1510 if (unlikely(nx<0)) { 1512 if (unlikely(nx<0)) {
1511 err = nx; 1513 err = nx;
1514 if (err == -EAGAIN && sysctl_xfrm_larval_drop) {
1515 /* EREMOTE tells the caller to generate
1516 * a one-shot blackhole route.
1517 */
1518 xfrm_pol_put(policy);
1519 return -EREMOTE;
1520 }
1512 if (err == -EAGAIN && flags) { 1521 if (err == -EAGAIN && flags) {
1513 DECLARE_WAITQUEUE(wait, current); 1522 DECLARE_WAITQUEUE(wait, current);
1514 1523
@@ -1598,6 +1607,21 @@ error:
1598 *dst_p = NULL; 1607 *dst_p = NULL;
1599 return err; 1608 return err;
1600} 1609}
1610EXPORT_SYMBOL(__xfrm_lookup);
1611
1612int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
1613 struct sock *sk, int flags)
1614{
1615 int err = __xfrm_lookup(dst_p, fl, sk, flags);
1616
1617 if (err == -EREMOTE) {
1618 dst_release(*dst_p);
1619 *dst_p = NULL;
1620 err = -EAGAIN;
1621 }
1622
1623 return err;
1624}
1601EXPORT_SYMBOL(xfrm_lookup); 1625EXPORT_SYMBOL(xfrm_lookup);
1602 1626
1603static inline int 1627static inline int
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index f7b6705fd6a..8cd63014a0d 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/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 120d624e672..cdca7388e0f 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 ed1244dd58d..f646381dc01 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 113dc77b9f6..8e5610d428c 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 6873d5af80d..d9cc6901d68 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 88b5281ac41..aa0ccdbd1f4 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/isa/cmi8330.c b/sound/isa/cmi8330.c
index 214d65d94c4..f471f8ad688 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -109,6 +109,7 @@ module_param_array(wssdma, int, NULL, 0444);
109MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); 109MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver.");
110 110
111#ifdef CONFIG_PNP 111#ifdef CONFIG_PNP
112static int isa_registered;
112static int pnp_registered; 113static int pnp_registered;
113#endif 114#endif
114 115
@@ -686,14 +687,18 @@ static int __init alsa_card_cmi8330_init(void)
686 int err; 687 int err;
687 688
688 err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS); 689 err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS);
689 if (err < 0)
690 return err;
691#ifdef CONFIG_PNP 690#ifdef CONFIG_PNP
691 if (!err)
692 isa_registered = 1;
693
692 err = pnp_register_card_driver(&cmi8330_pnpc_driver); 694 err = pnp_register_card_driver(&cmi8330_pnpc_driver);
693 if (!err) 695 if (!err)
694 pnp_registered = 1; 696 pnp_registered = 1;
697
698 if (isa_registered)
699 err = 0;
695#endif 700#endif
696 return 0; 701 return err;
697} 702}
698 703
699static void __exit alsa_card_cmi8330_exit(void) 704static void __exit alsa_card_cmi8330_exit(void)
@@ -701,8 +706,10 @@ static void __exit alsa_card_cmi8330_exit(void)
701#ifdef CONFIG_PNP 706#ifdef CONFIG_PNP
702 if (pnp_registered) 707 if (pnp_registered)
703 pnp_unregister_card_driver(&cmi8330_pnpc_driver); 708 pnp_unregister_card_driver(&cmi8330_pnpc_driver);
709
710 if (isa_registered)
704#endif 711#endif
705 isa_unregister_driver(&snd_cmi8330_driver); 712 isa_unregister_driver(&snd_cmi8330_driver);
706} 713}
707 714
708module_init(alsa_card_cmi8330_init) 715module_init(alsa_card_cmi8330_init)
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index 87f1392a2fa..1a14f33b6ab 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -127,6 +127,7 @@ module_param_array(dma2, int, NULL, 0444);
127MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); 127MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver.");
128 128
129#ifdef CONFIG_PNP 129#ifdef CONFIG_PNP
130static int isa_registered;
130static int pnpc_registered; 131static int pnpc_registered;
131#ifdef CS4232 132#ifdef CS4232
132static int pnp_registered; 133static int pnp_registered;
@@ -770,9 +771,9 @@ static int __init alsa_card_cs423x_init(void)
770 int err; 771 int err;
771 772
772 err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS); 773 err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS);
773 if (err < 0)
774 return err;
775#ifdef CONFIG_PNP 774#ifdef CONFIG_PNP
775 if (!err)
776 isa_registered = 1;
776#ifdef CS4232 777#ifdef CS4232
777 err = pnp_register_driver(&cs4232_pnp_driver); 778 err = pnp_register_driver(&cs4232_pnp_driver);
778 if (!err) 779 if (!err)
@@ -781,8 +782,14 @@ static int __init alsa_card_cs423x_init(void)
781 err = pnp_register_card_driver(&cs423x_pnpc_driver); 782 err = pnp_register_card_driver(&cs423x_pnpc_driver);
782 if (!err) 783 if (!err)
783 pnpc_registered = 1; 784 pnpc_registered = 1;
784#endif /* CONFIG_PNP */ 785#ifdef CS4232
785 return 0; 786 if (pnp_registered)
787 err = 0;
788#endif
789 if (isa_registered)
790 err = 0;
791#endif
792 return err;
786} 793}
787 794
788static void __exit alsa_card_cs423x_exit(void) 795static void __exit alsa_card_cs423x_exit(void)
@@ -794,8 +801,9 @@ static void __exit alsa_card_cs423x_exit(void)
794 if (pnp_registered) 801 if (pnp_registered)
795 pnp_unregister_driver(&cs4232_pnp_driver); 802 pnp_unregister_driver(&cs4232_pnp_driver);
796#endif 803#endif
797#endif /* CONFIG_PNP */ 804 if (isa_registered)
798 isa_unregister_driver(&cs423x_isa_driver); 805#endif
806 isa_unregister_driver(&cs423x_isa_driver);
799} 807}
800 808
801module_init(alsa_card_cs423x_init) 809module_init(alsa_card_cs423x_init)
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index d2a9c7df0ce..f7732bf90be 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -2036,7 +2036,9 @@ module_param_array(dma2, int, NULL, 0444);
2036MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver."); 2036MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver.");
2037 2037
2038#ifdef CONFIG_PNP 2038#ifdef CONFIG_PNP
2039static int pnp_registered, pnpc_registered; 2039static int isa_registered;
2040static int pnp_registered;
2041static int pnpc_registered;
2040 2042
2041static struct pnp_device_id snd_audiodrive_pnpbiosids[] = { 2043static struct pnp_device_id snd_audiodrive_pnpbiosids[] = {
2042 { .id = "ESS1869" }, 2044 { .id = "ESS1869" },
@@ -2466,18 +2468,22 @@ static int __init alsa_card_es18xx_init(void)
2466 int err; 2468 int err;
2467 2469
2468 err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS); 2470 err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS);
2469 if (err < 0)
2470 return err;
2471
2472#ifdef CONFIG_PNP 2471#ifdef CONFIG_PNP
2472 if (!err)
2473 isa_registered = 1;
2474
2473 err = pnp_register_driver(&es18xx_pnp_driver); 2475 err = pnp_register_driver(&es18xx_pnp_driver);
2474 if (!err) 2476 if (!err)
2475 pnp_registered = 1; 2477 pnp_registered = 1;
2478
2476 err = pnp_register_card_driver(&es18xx_pnpc_driver); 2479 err = pnp_register_card_driver(&es18xx_pnpc_driver);
2477 if (!err) 2480 if (!err)
2478 pnpc_registered = 1; 2481 pnpc_registered = 1;
2482
2483 if (isa_registered || pnp_registered)
2484 err = 0;
2479#endif 2485#endif
2480 return 0; 2486 return err;
2481} 2487}
2482 2488
2483static void __exit alsa_card_es18xx_exit(void) 2489static void __exit alsa_card_es18xx_exit(void)
@@ -2487,8 +2493,9 @@ static void __exit alsa_card_es18xx_exit(void)
2487 pnp_unregister_card_driver(&es18xx_pnpc_driver); 2493 pnp_unregister_card_driver(&es18xx_pnpc_driver);
2488 if (pnp_registered) 2494 if (pnp_registered)
2489 pnp_unregister_driver(&es18xx_pnp_driver); 2495 pnp_unregister_driver(&es18xx_pnp_driver);
2496 if (isa_registered)
2490#endif 2497#endif
2491 isa_unregister_driver(&snd_es18xx_isa_driver); 2498 isa_unregister_driver(&snd_es18xx_isa_driver);
2492} 2499}
2493 2500
2494module_init(alsa_card_es18xx_init) 2501module_init(alsa_card_es18xx_init)
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 3e465725553..0220cdbe1a2 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -135,6 +135,7 @@ struct snd_interwave {
135 135
136 136
137#ifdef CONFIG_PNP 137#ifdef CONFIG_PNP
138static int isa_registered;
138static int pnp_registered; 139static int pnp_registered;
139 140
140static struct pnp_card_device_id snd_interwave_pnpids[] = { 141static struct pnp_card_device_id snd_interwave_pnpids[] = {
@@ -934,15 +935,18 @@ static int __init alsa_card_interwave_init(void)
934 int err; 935 int err;
935 936
936 err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS); 937 err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS);
937 if (err < 0)
938 return err;
939#ifdef CONFIG_PNP 938#ifdef CONFIG_PNP
940 /* ISA PnP cards */ 939 if (!err)
940 isa_registered = 1;
941
941 err = pnp_register_card_driver(&interwave_pnpc_driver); 942 err = pnp_register_card_driver(&interwave_pnpc_driver);
942 if (!err) 943 if (!err)
943 pnp_registered = 1; 944 pnp_registered = 1;
945
946 if (isa_registered)
947 err = 0;
944#endif 948#endif
945 return 0; 949 return err;
946} 950}
947 951
948static void __exit alsa_card_interwave_exit(void) 952static void __exit alsa_card_interwave_exit(void)
@@ -950,8 +954,9 @@ static void __exit alsa_card_interwave_exit(void)
950#ifdef CONFIG_PNP 954#ifdef CONFIG_PNP
951 if (pnp_registered) 955 if (pnp_registered)
952 pnp_unregister_card_driver(&interwave_pnpc_driver); 956 pnp_unregister_card_driver(&interwave_pnpc_driver);
957 if (isa_registered)
953#endif 958#endif
954 isa_unregister_driver(&snd_interwave_driver); 959 isa_unregister_driver(&snd_interwave_driver);
955} 960}
956 961
957module_init(alsa_card_interwave_init) 962module_init(alsa_card_interwave_init)
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 48743eb85fb..61a323cc0e4 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -92,6 +92,7 @@ module_param_array(opl3sa3_ymode, int, NULL, 0444);
92MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); 92MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi.");
93 93
94#ifdef CONFIG_PNP 94#ifdef CONFIG_PNP
95static int isa_registered;
95static int pnp_registered; 96static int pnp_registered;
96static int pnpc_registered; 97static int pnpc_registered;
97#endif 98#endif
@@ -967,17 +968,22 @@ static int __init alsa_card_opl3sa2_init(void)
967 int err; 968 int err;
968 969
969 err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS); 970 err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS);
970 if (err < 0)
971 return err;
972#ifdef CONFIG_PNP 971#ifdef CONFIG_PNP
972 if (!err)
973 isa_registered = 1;
974
973 err = pnp_register_driver(&opl3sa2_pnp_driver); 975 err = pnp_register_driver(&opl3sa2_pnp_driver);
974 if (!err) 976 if (!err)
975 pnp_registered = 1; 977 pnp_registered = 1;
978
976 err = pnp_register_card_driver(&opl3sa2_pnpc_driver); 979 err = pnp_register_card_driver(&opl3sa2_pnpc_driver);
977 if (!err) 980 if (!err)
978 pnpc_registered = 1; 981 pnpc_registered = 1;
982
983 if (isa_registered || pnp_registered)
984 err = 0;
979#endif 985#endif
980 return 0; 986 return err;
981} 987}
982 988
983static void __exit alsa_card_opl3sa2_exit(void) 989static void __exit alsa_card_opl3sa2_exit(void)
@@ -987,8 +993,9 @@ static void __exit alsa_card_opl3sa2_exit(void)
987 pnp_unregister_card_driver(&opl3sa2_pnpc_driver); 993 pnp_unregister_card_driver(&opl3sa2_pnpc_driver);
988 if (pnp_registered) 994 if (pnp_registered)
989 pnp_unregister_driver(&opl3sa2_pnp_driver); 995 pnp_unregister_driver(&opl3sa2_pnp_driver);
996 if (isa_registered)
990#endif 997#endif
991 isa_unregister_driver(&snd_opl3sa2_isa_driver); 998 isa_unregister_driver(&snd_opl3sa2_isa_driver);
992} 999}
993 1000
994module_init(alsa_card_opl3sa2_init) 1001module_init(alsa_card_opl3sa2_init)
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c
index 2a19b0a39ed..c4ba24bfd27 100644
--- a/sound/isa/sb/sb16.c
+++ b/sound/isa/sb/sb16.c
@@ -129,6 +129,7 @@ MODULE_PARM_DESC(seq_ports, "Number of sequencer ports for WaveTable synth.");
129#endif 129#endif
130 130
131#ifdef CONFIG_PNP 131#ifdef CONFIG_PNP
132static int isa_registered;
132static int pnp_registered; 133static int pnp_registered;
133#endif 134#endif
134 135
@@ -702,15 +703,18 @@ static int __init alsa_card_sb16_init(void)
702 int err; 703 int err;
703 704
704 err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS); 705 err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS);
705 if (err < 0)
706 return err;
707#ifdef CONFIG_PNP 706#ifdef CONFIG_PNP
708 /* PnP cards at last */ 707 if (!err)
708 isa_registered = 1;
709
709 err = pnp_register_card_driver(&sb16_pnpc_driver); 710 err = pnp_register_card_driver(&sb16_pnpc_driver);
710 if (!err) 711 if (!err)
711 pnp_registered = 1; 712 pnp_registered = 1;
713
714 if (isa_registered)
715 err = 0;
712#endif 716#endif
713 return 0; 717 return err;
714} 718}
715 719
716static void __exit alsa_card_sb16_exit(void) 720static void __exit alsa_card_sb16_exit(void)
@@ -718,8 +722,9 @@ static void __exit alsa_card_sb16_exit(void)
718#ifdef CONFIG_PNP 722#ifdef CONFIG_PNP
719 if (pnp_registered) 723 if (pnp_registered)
720 pnp_unregister_card_driver(&sb16_pnpc_driver); 724 pnp_unregister_card_driver(&sb16_pnpc_driver);
725 if (isa_registered)
721#endif 726#endif
722 isa_unregister_driver(&snd_sb16_isa_driver); 727 isa_unregister_driver(&snd_sb16_isa_driver);
723} 728}
724 729
725module_init(alsa_card_sb16_init) 730module_init(alsa_card_sb16_init)
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index 08c14978558..9ea417bcf3e 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -69,7 +69,9 @@ module_param_array(dma, int, NULL, 0444);
69MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); 69MODULE_PARM_DESC(dma, "DMA # for SoundScape driver.");
70 70
71#ifdef CONFIG_PNP 71#ifdef CONFIG_PNP
72static int isa_registered;
72static int pnp_registered; 73static int pnp_registered;
74
73static struct pnp_card_device_id sscape_pnpids[] = { 75static struct pnp_card_device_id sscape_pnpids[] = {
74 { .id = "ENS3081", .devs = { { "ENS0000" } } }, 76 { .id = "ENS3081", .devs = { { "ENS0000" } } },
75 { .id = "" } /* end */ 77 { .id = "" } /* end */
@@ -1405,22 +1407,21 @@ static struct pnp_card_driver sscape_pnpc_driver = {
1405 1407
1406static int __init sscape_init(void) 1408static int __init sscape_init(void)
1407{ 1409{
1408 int ret; 1410 int err;
1409 1411
1410 /* 1412 err = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS);
1411 * First check whether we were passed any parameters.
1412 * These MUST take precedence over ANY automatic way
1413 * of allocating cards, because the operator is
1414 * S-P-E-L-L-I-N-G it out for us...
1415 */
1416 ret = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS);
1417 if (ret < 0)
1418 return ret;
1419#ifdef CONFIG_PNP 1413#ifdef CONFIG_PNP
1420 if (pnp_register_card_driver(&sscape_pnpc_driver) == 0) 1414 if (!err)
1415 isa_registered = 1;
1416
1417 err = pnp_register_card_driver(&sscape_pnpc_driver);
1418 if (!err)
1421 pnp_registered = 1; 1419 pnp_registered = 1;
1420
1421 if (isa_registered)
1422 err = 0;
1422#endif 1423#endif
1423 return 0; 1424 return err;
1424} 1425}
1425 1426
1426static void __exit sscape_exit(void) 1427static void __exit sscape_exit(void)
@@ -1428,8 +1429,9 @@ static void __exit sscape_exit(void)
1428#ifdef CONFIG_PNP 1429#ifdef CONFIG_PNP
1429 if (pnp_registered) 1430 if (pnp_registered)
1430 pnp_unregister_card_driver(&sscape_pnpc_driver); 1431 pnp_unregister_card_driver(&sscape_pnpc_driver);
1432 if (isa_registered)
1431#endif 1433#endif
1432 isa_unregister_driver(&snd_sscape_driver); 1434 isa_unregister_driver(&snd_sscape_driver);
1433} 1435}
1434 1436
1435module_init(sscape_init); 1437module_init(sscape_init);
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index 75673f72385..83c2fc4cfc6 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -86,6 +86,7 @@ module_param_array(use_cs4232_midi, bool, NULL, 0444);
86MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)"); 86MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)");
87 87
88#ifdef CONFIG_PNP 88#ifdef CONFIG_PNP
89static int isa_registered;
89static int pnp_registered; 90static int pnp_registered;
90 91
91static struct pnp_card_device_id snd_wavefront_pnpids[] = { 92static struct pnp_card_device_id snd_wavefront_pnpids[] = {
@@ -706,14 +707,18 @@ static int __init alsa_card_wavefront_init(void)
706 int err; 707 int err;
707 708
708 err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS); 709 err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS);
709 if (err < 0)
710 return err;
711#ifdef CONFIG_PNP 710#ifdef CONFIG_PNP
711 if (!err)
712 isa_registered = 1;
713
712 err = pnp_register_card_driver(&wavefront_pnpc_driver); 714 err = pnp_register_card_driver(&wavefront_pnpc_driver);
713 if (!err) 715 if (!err)
714 pnp_registered = 1; 716 pnp_registered = 1;
717
718 if (isa_registered)
719 err = 0;
715#endif 720#endif
716 return 0; 721 return err;
717} 722}
718 723
719static void __exit alsa_card_wavefront_exit(void) 724static void __exit alsa_card_wavefront_exit(void)
@@ -721,8 +726,9 @@ static void __exit alsa_card_wavefront_exit(void)
721#ifdef CONFIG_PNP 726#ifdef CONFIG_PNP
722 if (pnp_registered) 727 if (pnp_registered)
723 pnp_unregister_card_driver(&wavefront_pnpc_driver); 728 pnp_unregister_card_driver(&wavefront_pnpc_driver);
729 if (isa_registered)
724#endif 730#endif
725 isa_unregister_driver(&snd_wavefront_driver); 731 isa_unregister_driver(&snd_wavefront_driver);
726} 732}
727 733
728module_init(alsa_card_wavefront_init) 734module_init(alsa_card_wavefront_init)
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 3eac0f86266..581ebba4d1a 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -1782,6 +1782,11 @@ static unsigned int ad1981_jacks_blacklist[] = {
1782 0x10140534, /* Thinkpad X31 */ 1782 0x10140534, /* Thinkpad X31 */
1783 0x10140537, /* Thinkpad T41p */ 1783 0x10140537, /* Thinkpad T41p */
1784 0x10140554, /* Thinkpad T42p/R50p */ 1784 0x10140554, /* Thinkpad T42p/R50p */
1785 0x10140567, /* Thinkpad T43p 2668-G7U */
1786 0x10140581, /* Thinkpad X41-2527 */
1787 0x104380b0, /* Asus A7V8X-MX */
1788 0x11790241, /* Toshiba Satellite A-15 S127 */
1789 0x144dc01a, /* Samsung NP-X20C004/SEG */
1785 0 /* end */ 1790 0 /* end */
1786}; 1791};
1787 1792
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 14649d54b49..8e89d56b640 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -707,7 +707,8 @@ static u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction)
707 direction == HDA_OUTPUT ? 707 direction == HDA_OUTPUT ?
708 AC_PAR_AMP_OUT_CAP : 708 AC_PAR_AMP_OUT_CAP :
709 AC_PAR_AMP_IN_CAP); 709 AC_PAR_AMP_IN_CAP);
710 info->status |= INFO_AMP_CAPS; 710 if (info->amp_caps)
711 info->status |= INFO_AMP_CAPS;
711 } 712 }
712 return info->amp_caps; 713 return info->amp_caps;
713} 714}
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index a4ede27af02..34ac6346953 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -93,6 +93,7 @@ enum {
93 ALC262_HP_BPC_D7000_WL, 93 ALC262_HP_BPC_D7000_WL,
94 ALC262_HP_BPC_D7000_WF, 94 ALC262_HP_BPC_D7000_WF,
95 ALC262_BENQ_ED8, 95 ALC262_BENQ_ED8,
96 ALC262_SONY_ASSAMD,
96 ALC262_AUTO, 97 ALC262_AUTO,
97 ALC262_MODEL_LAST /* last tag */ 98 ALC262_MODEL_LAST /* last tag */
98}; 99};
@@ -118,6 +119,7 @@ enum {
118 ALC861VD_3ST_DIG, 119 ALC861VD_3ST_DIG,
119 ALC861VD_6ST_DIG, 120 ALC861VD_6ST_DIG,
120 ALC861VD_LENOVO, 121 ALC861VD_LENOVO,
122 ALC861VD_DALLAS,
121 ALC861VD_AUTO, 123 ALC861VD_AUTO,
122 ALC861VD_MODEL_LAST, 124 ALC861VD_MODEL_LAST,
123}; 125};
@@ -139,8 +141,10 @@ enum {
139 ALC882_6ST_DIG, 141 ALC882_6ST_DIG,
140 ALC882_ARIMA, 142 ALC882_ARIMA,
141 ALC882_W2JC, 143 ALC882_W2JC,
142 ALC882_AUTO, 144 ALC882_TARGA,
145 ALC882_ASUS_A7J,
143 ALC885_MACPRO, 146 ALC885_MACPRO,
147 ALC882_AUTO,
144 ALC882_MODEL_LAST, 148 ALC882_MODEL_LAST,
145}; 149};
146 150
@@ -152,11 +156,13 @@ enum {
152 ALC883_6ST_DIG, 156 ALC883_6ST_DIG,
153 ALC883_TARGA_DIG, 157 ALC883_TARGA_DIG,
154 ALC883_TARGA_2ch_DIG, 158 ALC883_TARGA_2ch_DIG,
155 ALC888_DEMO_BOARD,
156 ALC883_ACER, 159 ALC883_ACER,
157 ALC883_MEDION, 160 ALC883_MEDION,
161 ALC883_MEDION_MD2,
158 ALC883_LAPTOP_EAPD, 162 ALC883_LAPTOP_EAPD,
159 ALC883_LENOVO_101E_2ch, 163 ALC883_LENOVO_101E_2ch,
164 ALC883_LENOVO_NB0763,
165 ALC888_LENOVO_MS7195_DIG,
160 ALC883_AUTO, 166 ALC883_AUTO,
161 ALC883_MODEL_LAST, 167 ALC883_MODEL_LAST,
162}; 168};
@@ -4753,6 +4759,35 @@ static int alc882_mux_enum_put(struct snd_kcontrol *kcontrol,
4753} 4759}
4754 4760
4755/* 4761/*
4762 * 2ch mode
4763 */
4764static struct hda_verb alc882_3ST_ch2_init[] = {
4765 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
4766 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
4767 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
4768 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
4769 { } /* end */
4770};
4771
4772/*
4773 * 6ch mode
4774 */
4775static struct hda_verb alc882_3ST_ch6_init[] = {
4776 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
4777 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
4778 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
4779 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
4780 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
4781 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
4782 { } /* end */
4783};
4784
4785static struct hda_channel_mode alc882_3ST_6ch_modes[2] = {
4786 { 2, alc882_3ST_ch2_init },
4787 { 6, alc882_3ST_ch6_init },
4788};
4789
4790/*
4756 * 6ch mode 4791 * 6ch mode
4757 */ 4792 */
4758static struct hda_verb alc882_sixstack_ch6_init[] = { 4793static struct hda_verb alc882_sixstack_ch6_init[] = {
@@ -4824,6 +4859,40 @@ static struct snd_kcontrol_new alc882_w2jc_mixer[] = {
4824 { } /* end */ 4859 { } /* end */
4825}; 4860};
4826 4861
4862static struct snd_kcontrol_new alc882_targa_mixer[] = {
4863 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
4864 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
4865 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
4866 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
4867 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
4868 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
4869 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
4870 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
4871 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
4872 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
4873 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
4874 { } /* end */
4875};
4876
4877/* Pin assignment: Front=0x14, HP = 0x15, Front = 0x16, ???
4878 * Front Mic=0x18, Line In = 0x1a, Line In = 0x1b, CD = 0x1c
4879 */
4880static struct snd_kcontrol_new alc882_asus_a7j_mixer[] = {
4881 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
4882 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
4883 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
4884 HDA_CODEC_MUTE("Mobile Front Playback Switch", 0x16, 0x0, HDA_OUTPUT),
4885 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
4886 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
4887 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
4888 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
4889 HDA_CODEC_VOLUME("Mobile Line Playback Volume", 0x0b, 0x03, HDA_INPUT),
4890 HDA_CODEC_MUTE("Mobile Line Playback Switch", 0x0b, 0x03, HDA_INPUT),
4891 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
4892 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
4893 { } /* end */
4894};
4895
4827static struct snd_kcontrol_new alc882_chmode_mixer[] = { 4896static struct snd_kcontrol_new alc882_chmode_mixer[] = {
4828 { 4897 {
4829 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 4898 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -4985,6 +5054,66 @@ static struct hda_verb alc882_macpro_init_verbs[] = {
4985 { } 5054 { }
4986}; 5055};
4987 5056
5057static struct hda_verb alc882_targa_verbs[] = {
5058 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
5059 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
5060
5061 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
5062 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
5063
5064 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
5065 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */
5066 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
5067
5068 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
5069 {0x01, AC_VERB_SET_GPIO_MASK, 0x03},
5070 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03},
5071 {0x01, AC_VERB_SET_GPIO_DATA, 0x03},
5072 { } /* end */
5073};
5074
5075/* toggle speaker-output according to the hp-jack state */
5076static void alc882_targa_automute(struct hda_codec *codec)
5077{
5078 unsigned int present;
5079
5080 present = snd_hda_codec_read(codec, 0x14, 0,
5081 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
5082 snd_hda_codec_amp_update(codec, 0x1b, 0, HDA_OUTPUT, 0,
5083 0x80, present ? 0x80 : 0);
5084 snd_hda_codec_amp_update(codec, 0x1b, 1, HDA_OUTPUT, 0,
5085 0x80, present ? 0x80 : 0);
5086 snd_hda_codec_write(codec, 1, 0, AC_VERB_SET_GPIO_DATA, present ? 1 : 3);
5087}
5088
5089static void alc882_targa_unsol_event(struct hda_codec *codec, unsigned int res)
5090{
5091 /* Looks like the unsol event is incompatible with the standard
5092 * definition. 4bit tag is placed at 26 bit!
5093 */
5094 if (((res >> 26) == ALC880_HP_EVENT)) {
5095 alc882_targa_automute(codec);
5096 }
5097}
5098
5099static struct hda_verb alc882_asus_a7j_verbs[] = {
5100 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
5101 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
5102
5103 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
5104 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
5105 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
5106
5107 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */
5108 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
5109 {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */
5110
5111 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
5112 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */
5113 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
5114 { } /* end */
5115};
5116
4988static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) 5117static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted)
4989{ 5118{
4990 unsigned int gpiostate, gpiomask, gpiodir; 5119 unsigned int gpiostate, gpiomask, gpiodir;
@@ -5152,7 +5281,9 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
5152 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG), 5281 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG),
5153 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG), 5282 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG),
5154 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), 5283 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
5284 SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */
5155 SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), 5285 SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA),
5286 SND_PCI_QUIRK(0x1043, 0x060d, "Asus A7J", ALC882_ASUS_A7J),
5156 SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), 5287 SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG),
5157 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC), 5288 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC),
5158 {} 5289 {}
@@ -5214,6 +5345,36 @@ static struct alc_config_preset alc882_presets[] = {
5214 .channel_mode = alc882_ch_modes, 5345 .channel_mode = alc882_ch_modes,
5215 .input_mux = &alc882_capture_source, 5346 .input_mux = &alc882_capture_source,
5216 }, 5347 },
5348 [ALC882_TARGA] = {
5349 .mixers = { alc882_targa_mixer, alc882_chmode_mixer,
5350 alc882_capture_mixer },
5351 .init_verbs = { alc882_init_verbs, alc882_targa_verbs},
5352 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
5353 .dac_nids = alc882_dac_nids,
5354 .dig_out_nid = ALC882_DIGOUT_NID,
5355 .num_adc_nids = ARRAY_SIZE(alc882_adc_nids),
5356 .adc_nids = alc882_adc_nids,
5357 .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes),
5358 .channel_mode = alc882_3ST_6ch_modes,
5359 .need_dac_fix = 1,
5360 .input_mux = &alc882_capture_source,
5361 .unsol_event = alc882_targa_unsol_event,
5362 .init_hook = alc882_targa_automute,
5363 },
5364 [ALC882_ASUS_A7J] = {
5365 .mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer,
5366 alc882_capture_mixer },
5367 .init_verbs = { alc882_init_verbs, alc882_asus_a7j_verbs},
5368 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
5369 .dac_nids = alc882_dac_nids,
5370 .dig_out_nid = ALC882_DIGOUT_NID,
5371 .num_adc_nids = ARRAY_SIZE(alc882_adc_nids),
5372 .adc_nids = alc882_adc_nids,
5373 .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes),
5374 .channel_mode = alc882_3ST_6ch_modes,
5375 .need_dac_fix = 1,
5376 .input_mux = &alc882_capture_source,
5377 },
5217}; 5378};
5218 5379
5219 5380
@@ -5441,6 +5602,16 @@ static struct hda_input_mux alc883_lenovo_101e_capture_source = {
5441 }, 5602 },
5442}; 5603};
5443 5604
5605static struct hda_input_mux alc883_lenovo_nb0763_capture_source = {
5606 .num_items = 4,
5607 .items = {
5608 { "Mic", 0x0 },
5609 { "iMic", 0x1 },
5610 { "Line", 0x2 },
5611 { "CD", 0x4 },
5612 },
5613};
5614
5444#define alc883_mux_enum_info alc_mux_enum_info 5615#define alc883_mux_enum_info alc_mux_enum_info
5445#define alc883_mux_enum_get alc_mux_enum_get 5616#define alc883_mux_enum_get alc_mux_enum_get
5446 5617
@@ -5772,6 +5943,58 @@ static struct snd_kcontrol_new alc883_lenovo_101e_2ch_mixer[] = {
5772 { } /* end */ 5943 { } /* end */
5773}; 5944};
5774 5945
5946static struct snd_kcontrol_new alc883_lenovo_nb0763_mixer[] = {
5947 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
5948 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT),
5949 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
5950 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
5951 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
5952 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
5953 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
5954 HDA_CODEC_VOLUME("iMic Playback Volume", 0x0b, 0x1, HDA_INPUT),
5955 HDA_CODEC_MUTE("iMic Playback Switch", 0x0b, 0x1, HDA_INPUT),
5956 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
5957 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
5958 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
5959 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
5960 {
5961 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
5962 /* .name = "Capture Source", */
5963 .name = "Input Source",
5964 .count = 2,
5965 .info = alc883_mux_enum_info,
5966 .get = alc883_mux_enum_get,
5967 .put = alc883_mux_enum_put,
5968 },
5969 { } /* end */
5970};
5971
5972static struct snd_kcontrol_new alc883_medion_md2_mixer[] = {
5973 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
5974 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
5975 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT),
5976 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
5977 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
5978 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
5979 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
5980 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
5981 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
5982 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
5983 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
5984 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
5985 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
5986 {
5987 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
5988 /* .name = "Capture Source", */
5989 .name = "Input Source",
5990 .count = 2,
5991 .info = alc883_mux_enum_info,
5992 .get = alc883_mux_enum_get,
5993 .put = alc883_mux_enum_put,
5994 },
5995 { } /* end */
5996};
5997
5775static struct snd_kcontrol_new alc883_chmode_mixer[] = { 5998static struct snd_kcontrol_new alc883_chmode_mixer[] = {
5776 { 5999 {
5777 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 6000 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -5886,6 +6109,93 @@ static struct hda_verb alc883_lenovo_101e_verbs[] = {
5886 { } /* end */ 6109 { } /* end */
5887}; 6110};
5888 6111
6112static struct hda_verb alc883_lenovo_nb0763_verbs[] = {
6113 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
6114 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
6115 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
6116 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
6117 { } /* end */
6118};
6119
6120static struct hda_verb alc888_lenovo_ms7195_verbs[] = {
6121 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6122 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
6123 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
6124 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_FRONT_EVENT | AC_USRSP_EN},
6125 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
6126 { } /* end */
6127};
6128
6129/* toggle front-jack and RCA according to the hp-jack state */
6130static void alc888_lenovo_ms7195_front_automute(struct hda_codec *codec)
6131{
6132 unsigned int present;
6133
6134 present = snd_hda_codec_read(codec, 0x1b, 0,
6135 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
6136 snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0,
6137 0x80, present ? 0x80 : 0);
6138 snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0,
6139 0x80, present ? 0x80 : 0);
6140 snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0,
6141 0x80, present ? 0x80 : 0);
6142 snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0,
6143 0x80, present ? 0x80 : 0);
6144
6145}
6146
6147/* toggle RCA according to the front-jack state */
6148static void alc888_lenovo_ms7195_rca_automute(struct hda_codec *codec)
6149{
6150 unsigned int present;
6151
6152 present = snd_hda_codec_read(codec, 0x14, 0,
6153 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
6154 snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0,
6155 0x80, present ? 0x80 : 0);
6156 snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0,
6157 0x80, present ? 0x80 : 0);
6158
6159}
6160static void alc883_lenovo_ms7195_unsol_event(struct hda_codec *codec,
6161 unsigned int res)
6162{
6163 if ((res >> 26) == ALC880_HP_EVENT)
6164 alc888_lenovo_ms7195_front_automute(codec);
6165 if ((res >> 26) == ALC880_FRONT_EVENT)
6166 alc888_lenovo_ms7195_rca_automute(codec);
6167}
6168
6169static struct hda_verb alc883_medion_md2_verbs[] = {
6170 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6171 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
6172
6173 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
6174
6175 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
6176 { } /* end */
6177};
6178
6179/* toggle speaker-output according to the hp-jack state */
6180static void alc883_medion_md2_automute(struct hda_codec *codec)
6181{
6182 unsigned int present;
6183
6184 present = snd_hda_codec_read(codec, 0x14, 0,
6185 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
6186 snd_hda_codec_amp_update(codec, 0x15, 0, HDA_OUTPUT, 0,
6187 0x80, present ? 0x80 : 0);
6188 snd_hda_codec_amp_update(codec, 0x15, 1, HDA_OUTPUT, 0,
6189 0x80, present ? 0x80 : 0);
6190}
6191
6192static void alc883_medion_md2_unsol_event(struct hda_codec *codec,
6193 unsigned int res)
6194{
6195 if ((res >> 26) == ALC880_HP_EVENT)
6196 alc883_medion_md2_automute(codec);
6197}
6198
5889/* toggle speaker-output according to the hp-jack state */ 6199/* toggle speaker-output according to the hp-jack state */
5890static void alc883_tagra_automute(struct hda_codec *codec) 6200static void alc883_tagra_automute(struct hda_codec *codec)
5891{ 6201{
@@ -6051,11 +6361,13 @@ static const char *alc883_models[ALC883_MODEL_LAST] = {
6051 [ALC883_6ST_DIG] = "6stack-dig", 6361 [ALC883_6ST_DIG] = "6stack-dig",
6052 [ALC883_TARGA_DIG] = "targa-dig", 6362 [ALC883_TARGA_DIG] = "targa-dig",
6053 [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig", 6363 [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig",
6054 [ALC888_DEMO_BOARD] = "6stack-dig-demo",
6055 [ALC883_ACER] = "acer", 6364 [ALC883_ACER] = "acer",
6056 [ALC883_MEDION] = "medion", 6365 [ALC883_MEDION] = "medion",
6366 [ALC883_MEDION_MD2] = "medion-md2",
6057 [ALC883_LAPTOP_EAPD] = "laptop-eapd", 6367 [ALC883_LAPTOP_EAPD] = "laptop-eapd",
6058 [ALC883_LENOVO_101E_2ch] = "lenovo-101e", 6368 [ALC883_LENOVO_101E_2ch] = "lenovo-101e",
6369 [ALC883_LENOVO_NB0763] = "lenovo-nb0763",
6370 [ALC888_LENOVO_MS7195_DIG] = "lenovo-ms7195-dig",
6059 [ALC883_AUTO] = "auto", 6371 [ALC883_AUTO] = "auto",
6060}; 6372};
6061 6373
@@ -6082,7 +6394,10 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
6082 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), 6394 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
6083 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), 6395 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
6084 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), 6396 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch),
6085 SND_PCI_QUIRK(0x17aa, 0x101e, "lenovo 101e", ALC883_LENOVO_101E_2ch), 6397 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch),
6398 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763),
6399 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763),
6400 SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2),
6086 {} 6401 {}
6087}; 6402};
6088 6403
@@ -6168,19 +6483,6 @@ static struct alc_config_preset alc883_presets[] = {
6168 .unsol_event = alc883_tagra_unsol_event, 6483 .unsol_event = alc883_tagra_unsol_event,
6169 .init_hook = alc883_tagra_automute, 6484 .init_hook = alc883_tagra_automute,
6170 }, 6485 },
6171 [ALC888_DEMO_BOARD] = {
6172 .mixers = { alc883_base_mixer, alc883_chmode_mixer },
6173 .init_verbs = { alc883_init_verbs },
6174 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
6175 .dac_nids = alc883_dac_nids,
6176 .dig_out_nid = ALC883_DIGOUT_NID,
6177 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
6178 .adc_nids = alc883_adc_nids,
6179 .dig_in_nid = ALC883_DIGIN_NID,
6180 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
6181 .channel_mode = alc883_sixstack_modes,
6182 .input_mux = &alc883_capture_source,
6183 },
6184 [ALC883_ACER] = { 6486 [ALC883_ACER] = {
6185 .mixers = { alc883_base_mixer, 6487 .mixers = { alc883_base_mixer,
6186 alc883_chmode_mixer }, 6488 alc883_chmode_mixer },
@@ -6211,6 +6513,20 @@ static struct alc_config_preset alc883_presets[] = {
6211 .channel_mode = alc883_sixstack_modes, 6513 .channel_mode = alc883_sixstack_modes,
6212 .input_mux = &alc883_capture_source, 6514 .input_mux = &alc883_capture_source,
6213 }, 6515 },
6516 [ALC883_MEDION_MD2] = {
6517 .mixers = { alc883_medion_md2_mixer},
6518 .init_verbs = { alc883_init_verbs, alc883_medion_md2_verbs},
6519 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
6520 .dac_nids = alc883_dac_nids,
6521 .dig_out_nid = ALC883_DIGOUT_NID,
6522 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
6523 .adc_nids = alc883_adc_nids,
6524 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
6525 .channel_mode = alc883_3ST_2ch_modes,
6526 .input_mux = &alc883_capture_source,
6527 .unsol_event = alc883_medion_md2_unsol_event,
6528 .init_hook = alc883_medion_md2_automute,
6529 },
6214 [ALC883_LAPTOP_EAPD] = { 6530 [ALC883_LAPTOP_EAPD] = {
6215 .mixers = { alc883_base_mixer, 6531 .mixers = { alc883_base_mixer,
6216 alc883_chmode_mixer }, 6532 alc883_chmode_mixer },
@@ -6236,6 +6552,35 @@ static struct alc_config_preset alc883_presets[] = {
6236 .unsol_event = alc883_lenovo_101e_unsol_event, 6552 .unsol_event = alc883_lenovo_101e_unsol_event,
6237 .init_hook = alc883_lenovo_101e_all_automute, 6553 .init_hook = alc883_lenovo_101e_all_automute,
6238 }, 6554 },
6555 [ALC883_LENOVO_NB0763] = {
6556 .mixers = { alc883_lenovo_nb0763_mixer },
6557 .init_verbs = { alc883_init_verbs, alc883_lenovo_nb0763_verbs},
6558 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
6559 .dac_nids = alc883_dac_nids,
6560 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
6561 .adc_nids = alc883_adc_nids,
6562 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
6563 .channel_mode = alc883_3ST_2ch_modes,
6564 .need_dac_fix = 1,
6565 .input_mux = &alc883_lenovo_nb0763_capture_source,
6566 .unsol_event = alc883_medion_md2_unsol_event,
6567 .init_hook = alc883_medion_md2_automute,
6568 },
6569 [ALC888_LENOVO_MS7195_DIG] = {
6570 .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
6571 .init_verbs = { alc883_init_verbs, alc888_lenovo_ms7195_verbs},
6572 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
6573 .dac_nids = alc883_dac_nids,
6574 .dig_out_nid = ALC883_DIGOUT_NID,
6575 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
6576 .adc_nids = alc883_adc_nids,
6577 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
6578 .channel_mode = alc883_3ST_6ch_modes,
6579 .need_dac_fix = 1,
6580 .input_mux = &alc883_capture_source,
6581 .unsol_event = alc883_lenovo_ms7195_unsol_event,
6582 .init_hook = alc888_lenovo_ms7195_front_automute,
6583 },
6239}; 6584};
6240 6585
6241 6586
@@ -6499,6 +6844,18 @@ static struct snd_kcontrol_new alc262_HP_BPC_WildWest_option_mixer[] = {
6499 { } /* end */ 6844 { } /* end */
6500}; 6845};
6501 6846
6847static struct snd_kcontrol_new alc262_sony_mixer[] = {
6848 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
6849 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT),
6850 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
6851 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
6852 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
6853 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
6854 { } /* end */
6855};
6856
6857
6858
6502#define alc262_capture_mixer alc882_capture_mixer 6859#define alc262_capture_mixer alc882_capture_mixer
6503#define alc262_capture_alt_mixer alc882_capture_alt_mixer 6860#define alc262_capture_alt_mixer alc882_capture_alt_mixer
6504 6861
@@ -6597,6 +6954,15 @@ static struct hda_verb alc262_hippo1_unsol_verbs[] = {
6597 {} 6954 {}
6598}; 6955};
6599 6956
6957static struct hda_verb alc262_sony_unsol_verbs[] = {
6958 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
6959 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
6960 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, // Front Mic
6961
6962 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
6963 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
6964};
6965
6600/* mute/unmute internal speaker according to the hp jack and mute state */ 6966/* mute/unmute internal speaker according to the hp jack and mute state */
6601static void alc262_hippo_automute(struct hda_codec *codec, int force) 6967static void alc262_hippo_automute(struct hda_codec *codec, int force)
6602{ 6968{
@@ -7215,6 +7581,7 @@ static const char *alc262_models[ALC262_MODEL_LAST] = {
7215 [ALC262_HP_BPC] = "hp-bpc", 7581 [ALC262_HP_BPC] = "hp-bpc",
7216 [ALC262_HP_BPC_D7000_WL]= "hp-bpc-d7000", 7582 [ALC262_HP_BPC_D7000_WL]= "hp-bpc-d7000",
7217 [ALC262_BENQ_ED8] = "benq", 7583 [ALC262_BENQ_ED8] = "benq",
7584 [ALC262_BENQ_ED8] = "sony-assamd",
7218 [ALC262_AUTO] = "auto", 7585 [ALC262_AUTO] = "auto",
7219}; 7586};
7220 7587
@@ -7236,6 +7603,9 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
7236 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), 7603 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU),
7237 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1), 7604 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1),
7238 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), 7605 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8),
7606 SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD),
7607 SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD),
7608 SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD),
7239 {} 7609 {}
7240}; 7610};
7241 7611
@@ -7327,6 +7697,17 @@ static struct alc_config_preset alc262_presets[] = {
7327 .channel_mode = alc262_modes, 7697 .channel_mode = alc262_modes,
7328 .input_mux = &alc262_capture_source, 7698 .input_mux = &alc262_capture_source,
7329 }, 7699 },
7700 [ALC262_SONY_ASSAMD] = {
7701 .mixers = { alc262_sony_mixer },
7702 .init_verbs = { alc262_init_verbs, alc262_sony_unsol_verbs},
7703 .num_dacs = ARRAY_SIZE(alc262_dac_nids),
7704 .dac_nids = alc262_dac_nids,
7705 .hp_nid = 0x02,
7706 .num_channel_mode = ARRAY_SIZE(alc262_modes),
7707 .channel_mode = alc262_modes,
7708 .input_mux = &alc262_capture_source,
7709 .unsol_event = alc262_hippo_unsol_event,
7710 },
7330}; 7711};
7331 7712
7332static int patch_alc262(struct hda_codec *codec) 7713static int patch_alc262(struct hda_codec *codec)
@@ -8599,6 +8980,15 @@ static struct hda_input_mux alc861vd_capture_source = {
8599 }, 8980 },
8600}; 8981};
8601 8982
8983static struct hda_input_mux alc861vd_dallas_capture_source = {
8984 .num_items = 3,
8985 .items = {
8986 { "Front Mic", 0x0 },
8987 { "ATAPI Mic", 0x1 },
8988 { "Line In", 0x5 },
8989 },
8990};
8991
8602#define alc861vd_mux_enum_info alc_mux_enum_info 8992#define alc861vd_mux_enum_info alc_mux_enum_info
8603#define alc861vd_mux_enum_get alc_mux_enum_get 8993#define alc861vd_mux_enum_get alc_mux_enum_get
8604 8994
@@ -8782,6 +9172,34 @@ static struct snd_kcontrol_new alc861vd_lenovo_mixer[] = {
8782 { } /* end */ 9172 { } /* end */
8783}; 9173};
8784 9174
9175/* Pin assignment: Front=0x14, HP = 0x15,
9176 * Front Mic=0x18, ATAPI Mic = 0x19, Line In = 0x1d
9177 */
9178static struct snd_kcontrol_new alc861vd_dallas_mixer[] = {
9179 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
9180 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
9181 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
9182 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT),
9183 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
9184 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
9185 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
9186 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
9187 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x05, HDA_INPUT),
9188 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x05, HDA_INPUT),
9189 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
9190 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
9191 {
9192 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
9193 /* .name = "Capture Source", */
9194 .name = "Input Source",
9195 .count = 1,
9196 .info = alc882_mux_enum_info,
9197 .get = alc882_mux_enum_get,
9198 .put = alc882_mux_enum_put,
9199 },
9200 { } /* end */
9201};
9202
8785/* 9203/*
8786 * generic initialization of ADC, input mixers and output mixers 9204 * generic initialization of ADC, input mixers and output mixers
8787 */ 9205 */
@@ -8969,6 +9387,70 @@ static void alc861vd_lenovo_unsol_event(struct hda_codec *codec,
8969 } 9387 }
8970} 9388}
8971 9389
9390static struct hda_verb alc861vd_dallas_verbs[] = {
9391 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
9392 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
9393 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
9394 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
9395
9396 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
9397 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
9398 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
9399 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
9400 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
9401 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
9402 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
9403 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
9404
9405 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
9406 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
9407 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
9408 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
9409 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
9410 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
9411 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
9412 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
9413
9414 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
9415 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
9416 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
9417 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
9418 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
9419 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
9420 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
9421 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
9422
9423 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
9424 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
9425 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
9426 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
9427
9428 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
9429 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
9430 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
9431
9432 { } /* end */
9433};
9434
9435/* toggle speaker-output according to the hp-jack state */
9436static void alc861vd_dallas_automute(struct hda_codec *codec)
9437{
9438 unsigned int present;
9439
9440 present = snd_hda_codec_read(codec, 0x15, 0,
9441 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
9442 snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0,
9443 0x80, present ? 0x80 : 0);
9444 snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0,
9445 0x80, present ? 0x80 : 0);
9446}
9447
9448static void alc861vd_dallas_unsol_event(struct hda_codec *codec, unsigned int res)
9449{
9450 if ((res >> 26) == ALC880_HP_EVENT)
9451 alc861vd_dallas_automute(codec);
9452}
9453
8972/* pcm configuration: identiacal with ALC880 */ 9454/* pcm configuration: identiacal with ALC880 */
8973#define alc861vd_pcm_analog_playback alc880_pcm_analog_playback 9455#define alc861vd_pcm_analog_playback alc880_pcm_analog_playback
8974#define alc861vd_pcm_analog_capture alc880_pcm_analog_capture 9456#define alc861vd_pcm_analog_capture alc880_pcm_analog_capture
@@ -8984,6 +9466,7 @@ static const char *alc861vd_models[ALC861VD_MODEL_LAST] = {
8984 [ALC861VD_3ST_DIG] = "3stack-digout", 9466 [ALC861VD_3ST_DIG] = "3stack-digout",
8985 [ALC861VD_6ST_DIG] = "6stack-digout", 9467 [ALC861VD_6ST_DIG] = "6stack-digout",
8986 [ALC861VD_LENOVO] = "lenovo", 9468 [ALC861VD_LENOVO] = "lenovo",
9469 [ALC861VD_DALLAS] = "dallas",
8987 [ALC861VD_AUTO] = "auto", 9470 [ALC861VD_AUTO] = "auto",
8988}; 9471};
8989 9472
@@ -8993,6 +9476,8 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = {
8993 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), 9476 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST),
8994 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), 9477 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST),
8995 9478
9479 SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),
9480 SND_PCI_QUIRK(0x1179, 0xff01, "DALLAS", ALC861VD_DALLAS),
8996 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo 3000 C200", ALC861VD_LENOVO), 9481 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo 3000 C200", ALC861VD_LENOVO),
8997 SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO), 9482 SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO),
8998 {} 9483 {}
@@ -9059,6 +9544,19 @@ static struct alc_config_preset alc861vd_presets[] = {
9059 .unsol_event = alc861vd_lenovo_unsol_event, 9544 .unsol_event = alc861vd_lenovo_unsol_event,
9060 .init_hook = alc861vd_lenovo_automute, 9545 .init_hook = alc861vd_lenovo_automute,
9061 }, 9546 },
9547 [ALC861VD_DALLAS] = {
9548 .mixers = { alc861vd_dallas_mixer },
9549 .init_verbs = { alc861vd_dallas_verbs },
9550 .num_dacs = ARRAY_SIZE(alc861vd_dac_nids),
9551 .dac_nids = alc861vd_dac_nids,
9552 .num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids),
9553 .adc_nids = alc861vd_adc_nids,
9554 .num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
9555 .channel_mode = alc861vd_3stack_2ch_modes,
9556 .input_mux = &alc861vd_dallas_capture_source,
9557 .unsol_event = alc861vd_dallas_unsol_event,
9558 .init_hook = alc861vd_dallas_automute,
9559 },
9062}; 9560};
9063 9561
9064/* 9562/*
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 93ae9c25076..a6a0a80edc3 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -467,6 +467,8 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = {
467 "Dell XPS M1710", STAC_REF), 467 "Dell XPS M1710", STAC_REF),
468 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cf, 468 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cf,
469 "Dell Precision M90", STAC_REF), 469 "Dell Precision M90", STAC_REF),
470 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d6,
471 "unknown Dell", STAC_REF),
470 {} /* terminator */ 472 {} /* terminator */
471}; 473};
472 474
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 202f720b34b..da9734073db 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -1799,6 +1799,18 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1799 }, 1799 },
1800 { 1800 {
1801 .subvendor = 0x1028, 1801 .subvendor = 0x1028,
1802 .subdevice = 0x0186,
1803 .name = "Dell Latitude D810", /* cf. Malone #41015 */
1804 .type = AC97_TUNE_HP_MUTE_LED
1805 },
1806 {
1807 .subvendor = 0x1028,
1808 .subdevice = 0x0188,
1809 .name = "Dell Inspiron 6000",
1810 .type = AC97_TUNE_HP_MUTE_LED /* cf. Malone #41015 */
1811 },
1812 {
1813 .subvendor = 0x1028,
1802 .subdevice = 0x0191, 1814 .subdevice = 0x0191,
1803 .name = "Dell Inspiron 8600", 1815 .name = "Dell Inspiron 8600",
1804 .type = AC97_TUNE_HP_ONLY 1816 .type = AC97_TUNE_HP_ONLY
@@ -1819,7 +1831,7 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1819 .subvendor = 0x103c, 1831 .subvendor = 0x103c,
1820 .subdevice = 0x088c, 1832 .subdevice = 0x088c,
1821 .name = "HP nc8000", 1833 .name = "HP nc8000",
1822 .type = AC97_TUNE_MUTE_LED 1834 .type = AC97_TUNE_HP_MUTE_LED
1823 }, 1835 },
1824 { 1836 {
1825 .subvendor = 0x103c, 1837 .subvendor = 0x103c,
@@ -1913,6 +1925,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1913 }, 1925 },
1914 { 1926 {
1915 .subvendor = 0x10cf, 1927 .subvendor = 0x10cf,
1928 .subdevice = 0x127e,
1929 .name = "Fujitsu Lifebook C1211D",
1930 .type = AC97_TUNE_HP_ONLY
1931 },
1932 {
1933 .subvendor = 0x10cf,
1916 .subdevice = 0x12ec, 1934 .subdevice = 0x12ec,
1917 .name = "Fujitsu-Siemens 4010", 1935 .name = "Fujitsu-Siemens 4010",
1918 .type = AC97_TUNE_HP_ONLY 1936 .type = AC97_TUNE_HP_ONLY
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index 0cdef971cbd..0b8a6f8b366 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -43,8 +43,9 @@ static int ac97_prepare(struct snd_pcm_substream *substream)
43#define STD_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ 43#define STD_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
44 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) 44 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
45 45
46static struct snd_soc_codec_dai ac97_dai = { 46struct snd_soc_codec_dai ac97_dai = {
47 .name = "AC97 HiFi", 47 .name = "AC97 HiFi",
48 .type = SND_SOC_DAI_AC97,
48 .playback = { 49 .playback = {
49 .stream_name = "AC97 Playback", 50 .stream_name = "AC97 Playback",
50 .channels_min = 1, 51 .channels_min = 1,
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 264413a00ca..986b5d59cef 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -544,6 +544,7 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream)
544struct snd_soc_codec_dai wm9712_dai[] = { 544struct snd_soc_codec_dai wm9712_dai[] = {
545{ 545{
546 .name = "AC97 HiFi", 546 .name = "AC97 HiFi",
547 .type = SND_SOC_DAI_AC97_BUS,
547 .playback = { 548 .playback = {
548 .stream_name = "HiFi Playback", 549 .stream_name = "HiFi Playback",
549 .channels_min = 1, 550 .channels_min = 1,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 36519aef55d..92d5d917b73 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -116,6 +116,7 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec)
116static inline const char* get_dai_name(int type) 116static inline const char* get_dai_name(int type)
117{ 117{
118 switch(type) { 118 switch(type) {
119 case SND_SOC_DAI_AC97_BUS:
119 case SND_SOC_DAI_AC97: 120 case SND_SOC_DAI_AC97:
120 return "AC97"; 121 return "AC97";
121 case SND_SOC_DAI_I2S: 122 case SND_SOC_DAI_I2S:
@@ -1099,7 +1100,8 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
1099 continue; 1100 continue;
1100 } 1101 }
1101 } 1102 }
1102 if (socdev->machine->dai_link[i].cpu_dai->type == SND_SOC_DAI_AC97) 1103 if (socdev->machine->dai_link[i].codec_dai->type ==
1104 SND_SOC_DAI_AC97_BUS)
1103 ac97 = 1; 1105 ac97 = 1;
1104 } 1106 }
1105 snprintf(codec->card->shortname, sizeof(codec->card->shortname), 1107 snprintf(codec->card->shortname, sizeof(codec->card->shortname),
@@ -1148,11 +1150,21 @@ EXPORT_SYMBOL_GPL(snd_soc_register_card);
1148void snd_soc_free_pcms(struct snd_soc_device *socdev) 1150void snd_soc_free_pcms(struct snd_soc_device *socdev)
1149{ 1151{
1150 struct snd_soc_codec *codec = socdev->codec; 1152 struct snd_soc_codec *codec = socdev->codec;
1153#ifdef CONFIG_SND_SOC_AC97_BUS
1154 struct snd_soc_codec_dai *codec_dai;
1155 int i;
1156#endif
1151 1157
1152 mutex_lock(&codec->mutex); 1158 mutex_lock(&codec->mutex);
1153#ifdef CONFIG_SND_SOC_AC97_BUS 1159#ifdef CONFIG_SND_SOC_AC97_BUS
1154 if (codec->ac97) 1160 for(i = 0; i < codec->num_dai; i++) {
1155 soc_ac97_dev_unregister(codec); 1161 codec_dai = &codec->dai[i];
1162 if (codec_dai->type == SND_SOC_DAI_AC97_BUS && codec->ac97) {
1163 soc_ac97_dev_unregister(codec);
1164 goto free_card;
1165 }
1166 }
1167free_card:
1156#endif 1168#endif
1157 1169
1158 if (codec->card) 1170 if (codec->card)
diff --git a/sound/sound_firmware.c b/sound/sound_firmware.c
index 3304344713a..96deaefaa89 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
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 7b3bf3545a3..325d4b6b54a 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -360,7 +360,7 @@ static int get_ctl_value(struct usb_mixer_elem_info *cval, int request, int vali
360 request, 360 request,
361 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, 361 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,
362 validx, cval->mixer->ctrlif | (cval->id << 8), 362 validx, cval->mixer->ctrlif | (cval->id << 8),
363 buf, val_len, 100) >= 0) { 363 buf, val_len, 100) >= val_len) {
364 *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len)); 364 *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len));
365 return 0; 365 return 0;
366 } 366 }
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 8fcbe93b258..374fbf657a2 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -48,6 +48,15 @@
48 USB_DEVICE_ID_MATCH_INT_CLASS | 48 USB_DEVICE_ID_MATCH_INT_CLASS |
49 USB_DEVICE_ID_MATCH_INT_SUBCLASS, 49 USB_DEVICE_ID_MATCH_INT_SUBCLASS,
50 .idVendor = 0x046d, 50 .idVendor = 0x046d,
51 .idProduct = 0x0850,
52 .bInterfaceClass = USB_CLASS_AUDIO,
53 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL
54},
55{
56 .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
57 USB_DEVICE_ID_MATCH_INT_CLASS |
58 USB_DEVICE_ID_MATCH_INT_SUBCLASS,
59 .idVendor = 0x046d,
51 .idProduct = 0x08f0, 60 .idProduct = 0x08f0,
52 .bInterfaceClass = USB_CLASS_AUDIO, 61 .bInterfaceClass = USB_CLASS_AUDIO,
53 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL 62 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL