Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
authorLinus Torvalds <torvalds@g5.osdl.org>
Wed, 12 Apr 2006 23:07:54 +0000 (16:07 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 12 Apr 2006 23:07:54 +0000 (16:07 -0700)
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband:
  IB/mthca: Fix max_srq_sge returned by ib_query_device for Tavor devices
  IB/cache: Use correct pointer to calculate size
  IPoIB: Use spin_lock_irq() instead of spin_lock_irqsave()
  IPoIB: Close race in ipoib_flush_paths()
  IB/mthca: Disable tuning PCI read burst size
  IPoIB: Make send and receive queue sizes tunable
  IPoIB: Wait for join to finish before freeing mcast struct
  IB: simplify static rate encoding
  IPoIB: Consolidate private neighbour data handling
  IB/srp: Fix memory leak in options parsing
  IB/mthca: Always build debugging code unless CONFIG_EMBEDDED=y
  IPoIB: Always build debugging code unless CONFIG_EMBEDDED=y
  IB/mad: fix oops in cancel_mads

708 files changed:
CREDITS
Documentation/DMA-mapping.txt
Documentation/DocBook/libata.tmpl
Documentation/feature-removal-schedule.txt
Documentation/filesystems/vfs.txt
Documentation/isdn/README.gigaset [new file with mode: 0644]
Documentation/kbuild/modules.txt
Documentation/laptop-mode.txt
Documentation/memory-barriers.txt
Documentation/mtrr.txt
Documentation/scsi/scsi_eh.txt
Documentation/scsi/scsi_mid_low_api.txt
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
Documentation/vm/hugetlbpage.txt
Documentation/x86_64/boot-options.txt
Kbuild
MAINTAINERS
Makefile
arch/alpha/Kconfig
arch/alpha/kernel/alpha_ksyms.c
arch/alpha/kernel/setup.c
arch/alpha/kernel/smp.c
arch/arm/Kconfig
arch/arm/boot/compressed/vmlinux.lds.in
arch/arm/configs/at91rm9200dk_defconfig
arch/arm/configs/at91rm9200ek_defconfig
arch/arm/kernel/armksyms.c
arch/arm/kernel/setup.c
arch/arm/mach-at91rm9200/Makefile
arch/arm/mach-at91rm9200/board-csb337.c
arch/arm/mach-at91rm9200/board-csb637.c
arch/arm/mach-at91rm9200/board-dk.c
arch/arm/mach-at91rm9200/board-ek.c
arch/arm/mach-at91rm9200/devices.c
arch/arm/mach-at91rm9200/leds.c [new file with mode: 0644]
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/ts72xx.c
arch/arm/mach-imx/dma.c
arch/arm/mach-imx/generic.c
arch/arm/mach-imx/mx1ads.c
arch/arm/mach-ixp23xx/espresso.c
arch/arm/mach-ixp23xx/pci.c
arch/arm/mach-omap1/Kconfig
arch/arm/mach-omap1/Makefile
arch/arm/mach-omap1/board-ams-delta.c [new file with mode: 0644]
arch/arm/mach-omap1/board-generic.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-netstar.c [deleted file]
arch/arm/mach-omap1/board-nokia770.c [new file with mode: 0644]
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-perseus2.c
arch/arm/mach-omap1/board-voiceblue.c
arch/arm/mach-omap1/clock.c
arch/arm/mach-omap1/clock.h
arch/arm/mach-omap1/devices.c
arch/arm/mach-omap1/io.c
arch/arm/mach-omap1/irq.c
arch/arm/mach-omap1/mux.c
arch/arm/mach-omap1/pm.c [new file with mode: 0644]
arch/arm/mach-omap1/serial.c
arch/arm/mach-omap1/sleep.S [moved from arch/arm/plat-omap/sleep.S with 93% similarity]
arch/arm/mach-omap1/time.c
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-apollon.c [new file with mode: 0644]
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/clock.c
arch/arm/mach-omap2/clock.h
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/memory.c [new file with mode: 0644]
arch/arm/mach-omap2/memory.h [new file with mode: 0644]
arch/arm/mach-omap2/mux.c
arch/arm/mach-omap2/pm.c [new file with mode: 0644]
arch/arm/mach-omap2/prcm-regs.h [moved from arch/arm/mach-omap2/prcm.h with 70% similarity]
arch/arm/mach-omap2/prcm.c [new file with mode: 0644]
arch/arm/mach-omap2/sleep.S [new file with mode: 0644]
arch/arm/mach-omap2/sram-fn.S
arch/arm/mach-pxa/poodle.c
arch/arm/mach-s3c2410/Kconfig
arch/arm/mach-s3c2410/Makefile
arch/arm/mach-s3c2410/clock.c
arch/arm/mach-s3c2410/common-smdk.c [new file with mode: 0644]
arch/arm/mach-s3c2410/common-smdk.h [new file with mode: 0644]
arch/arm/mach-s3c2410/mach-anubis.c
arch/arm/mach-s3c2410/mach-rx3715.c
arch/arm/mach-s3c2410/mach-smdk2410.c
arch/arm/mach-s3c2410/mach-smdk2440.c
arch/arm/mach-sa1100/collie.c
arch/arm/mm/cache-v4wb.S
arch/arm/mm/consistent.c
arch/arm/mm/init.c
arch/arm/mm/mm-armv.c
arch/arm/mm/proc-sa110.S
arch/arm/mm/proc-sa1100.S
arch/arm/mm/proc-xsc3.S
arch/arm/plat-omap/Kconfig
arch/arm/plat-omap/Makefile
arch/arm/plat-omap/clock.c
arch/arm/plat-omap/devices.c
arch/arm/plat-omap/dma.c
arch/arm/plat-omap/dmtimer.c
arch/arm/plat-omap/fb.c [new file with mode: 0644]
arch/arm/plat-omap/gpio.c
arch/arm/plat-omap/mcbsp.c
arch/arm/plat-omap/ocpi.c
arch/arm/plat-omap/pm.c
arch/arm/plat-omap/sram.c
arch/arm/plat-omap/timer32k.c [new file with mode: 0644]
arch/arm/vfp/vfpdouble.c
arch/arm/vfp/vfphw.S
arch/arm/vfp/vfpsingle.c
arch/arm26/kernel/armksyms.c
arch/cris/kernel/crisksyms.c
arch/frv/kernel/entry.S
arch/frv/kernel/frv_ksyms.c
arch/h8300/kernel/h8300_ksyms.c
arch/i386/Kconfig
arch/i386/Kconfig.cpu
arch/i386/boot/video.S
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/apic.c
arch/i386/kernel/cpu/amd.c
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
arch/i386/kernel/i386_ksyms.c
arch/i386/kernel/mpparse.c
arch/i386/kernel/reboot_fixups.c
arch/i386/kernel/setup.c
arch/i386/kernel/traps.c
arch/i386/mach-voyager/voyager_cat.c
arch/i386/mm/init.c
arch/i386/pci/direct.c
arch/i386/pci/mmconfig.c
arch/ia64/Kconfig
arch/ia64/kernel/acpi-ext.c
arch/ia64/kernel/entry.S
arch/ia64/kernel/mca.c
arch/ia64/kernel/mca_asm.S
arch/ia64/kernel/module.c
arch/ia64/mm/fault.c
arch/ia64/sn/kernel/xpc_channel.c
arch/m32r/Kconfig
arch/m32r/kernel/m32r_ksyms.c
arch/m32r/kernel/setup.c
arch/m32r/kernel/smpboot.c
arch/m32r/lib/Makefile
arch/m32r/lib/getuser.S [deleted file]
arch/m32r/lib/putuser.S [deleted file]
arch/m68k/kernel/m68k_ksyms.c
arch/m68knommu/kernel/m68k_ksyms.c
arch/mips/Kconfig
arch/mips/kernel/mips_ksyms.c
arch/parisc/Kconfig
arch/parisc/kernel/parisc_ksyms.c
arch/powerpc/Kconfig
arch/ppc/boot/lib/Makefile
arch/s390/Makefile
arch/s390/defconfig
arch/sh/Kconfig
arch/sh/kernel/sh_ksyms.c
arch/sh64/kernel/sh_ksyms.c
arch/sparc/kernel/smp.c
arch/sparc/kernel/sparc_ksyms.c
arch/sparc/math-emu/Makefile
arch/sparc64/Kconfig
arch/sparc64/defconfig
arch/sparc64/kernel/pci_sun4v.c
arch/sparc64/kernel/ptrace.c
arch/sparc64/kernel/setup.c
arch/sparc64/kernel/smp.c
arch/sparc64/kernel/sparc64_ksyms.c
arch/sparc64/kernel/traps.c
arch/um/Makefile
arch/um/drivers/cow.h
arch/um/drivers/cow_sys.h
arch/um/drivers/cow_user.c
arch/um/drivers/mconsole_kern.c
arch/um/drivers/net_user.c
arch/um/drivers/slirp_user.c
arch/um/include/kern_util.h
arch/um/include/tt/tt.h
arch/um/include/user.h
arch/um/include/user_util.h
arch/um/kernel/ksyms.c
arch/um/os-Linux/drivers/ethertap_user.c
arch/um/os-Linux/helper.c
arch/um/os-Linux/mem.c
arch/um/os-Linux/sigio.c
arch/um/os-Linux/skas/mem.c
arch/um/os-Linux/skas/process.c
arch/um/os-Linux/sys-i386/tls.c
arch/um/os-Linux/umid.c
arch/um/os-Linux/user_syms.c
arch/um/scripts/Makefile.rules
arch/um/sys-i386/ksyms.c
arch/um/sys-i386/ptrace_user.c
arch/um/sys-i386/signal.c
arch/um/sys-i386/tls.c
arch/um/sys-x86_64/signal.c
arch/v850/kernel/v850_ksyms.c
arch/x86_64/Kconfig
arch/x86_64/Makefile
arch/x86_64/boot/video.S
arch/x86_64/defconfig
arch/x86_64/ia32/ia32entry.S
arch/x86_64/kernel/aperture.c
arch/x86_64/kernel/e820.c
arch/x86_64/kernel/entry.S
arch/x86_64/kernel/mce.c
arch/x86_64/kernel/nmi.c
arch/x86_64/kernel/pci-dma.c
arch/x86_64/kernel/process.c
arch/x86_64/kernel/ptrace.c
arch/x86_64/kernel/setup.c
arch/x86_64/kernel/time.c
arch/x86_64/kernel/vmlinux.lds.S
arch/x86_64/kernel/x8664_ksyms.c
arch/x86_64/mm/init.c
arch/x86_64/mm/numa.c
arch/x86_64/mm/srat.c
arch/x86_64/pci/mmconfig.c
arch/xtensa/kernel/xtensa_ksyms.c
drivers/acpi/Kconfig
drivers/base/node.c
drivers/cdrom/aztcd.c
drivers/char/Kconfig
drivers/char/Makefile
drivers/char/applicom.c
drivers/char/dtlk.c
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/random.c
drivers/char/tlclk.c
drivers/char/tty_io.c
drivers/hwmon/hdaps.c
drivers/isdn/gigaset/Kconfig
drivers/isdn/gigaset/asyncdata.c
drivers/isdn/gigaset/bas-gigaset.c
drivers/isdn/gigaset/common.c
drivers/isdn/gigaset/ev-layer.c
drivers/isdn/gigaset/gigaset.h
drivers/isdn/gigaset/i4l.c
drivers/isdn/gigaset/interface.c
drivers/isdn/gigaset/isocdata.c
drivers/isdn/gigaset/proc.c
drivers/isdn/gigaset/usb-gigaset.c
drivers/isdn/i4l/isdn_ppp.c
drivers/leds/Kconfig
drivers/leds/Makefile
drivers/leds/leds-s3c24xx.c [new file with mode: 0644]
drivers/md/Kconfig
drivers/media/video/Makefile
drivers/media/video/bt8xx/Makefile
drivers/media/video/cx25840/Makefile
drivers/media/video/cx88/Makefile
drivers/media/video/em28xx/Makefile
drivers/media/video/saa7134/Makefile
drivers/media/video/saa7134/saa7134-core.c
drivers/mmc/Kconfig
drivers/mmc/Makefile
drivers/mmc/at91_mci.c [new file with mode: 0644]
drivers/mmc/imxmmc.c [new file with mode: 0644]
drivers/mmc/imxmmc.h [new file with mode: 0644]
drivers/mtd/devices/Kconfig
drivers/mtd/devices/Makefile
drivers/mtd/devices/blkmtd.c [deleted file]
drivers/net/b44.c
drivers/net/bnx2.c
drivers/net/chelsio/Makefile
drivers/net/hydra.h [deleted file]
drivers/net/irda/irda-usb.c
drivers/net/irda/irda-usb.h
drivers/net/irda/smsc-ircc2.c
drivers/net/ixgb/ixgb_main.c
drivers/net/mv643xx_eth.c
drivers/net/natsemi.c
drivers/net/netconsole.c
drivers/net/pcmcia/axnet_cs.c
drivers/net/skge.c
drivers/net/sky2.c
drivers/net/sky2.h
drivers/net/starfire.c
drivers/net/tg3.c
drivers/net/tg3.h
drivers/net/typhoon.c
drivers/net/via-rhine.c
drivers/net/wan/Kconfig
drivers/net/wan/Makefile
drivers/net/wan/sdla_chdlc.c [deleted file]
drivers/net/wan/sdla_fr.c [deleted file]
drivers/net/wan/sdla_ft1.c [deleted file]
drivers/net/wan/sdla_ppp.c [deleted file]
drivers/net/wan/sdla_x25.c [deleted file]
drivers/net/wan/sdladrv.c [deleted file]
drivers/net/wan/sdlamain.c [deleted file]
drivers/net/wan/wanpipe_multppp.c [deleted file]
drivers/parport/parport_serial.c
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/class.c
drivers/rtc/rtc-ds1672.c
drivers/rtc/rtc-ep93xx.c
drivers/rtc/rtc-m48t86.c
drivers/rtc/rtc-pcf8563.c
drivers/rtc/rtc-proc.c
drivers/rtc/rtc-rs5c372.c
drivers/rtc/rtc-sa1100.c
drivers/rtc/rtc-test.c
drivers/rtc/rtc-vr41xx.c [moved from drivers/char/vr41xx_rtc.c with 57% similarity]
drivers/rtc/rtc-x1205.c
drivers/s390/block/dasd.c
drivers/s390/block/dasd_proc.c
drivers/s390/char/keyboard.c
drivers/s390/char/tape_block.c
drivers/s390/char/tape_core.c
drivers/s390/cio/blacklist.c
drivers/s390/cio/cio.c
drivers/s390/cio/cio_debug.h
drivers/scsi/3w-xxxx.c
drivers/scsi/ahci.c
drivers/scsi/ata_piix.c
drivers/scsi/hosts.c
drivers/scsi/libata-core.c
drivers/scsi/libata-scsi.c
drivers/scsi/libata.h
drivers/scsi/pdc_adma.c
drivers/scsi/sata_mv.c
drivers/scsi/sata_nv.c
drivers/scsi/sata_promise.c
drivers/scsi/sata_qstor.c
drivers/scsi/sata_sil.c
drivers/scsi/sata_sil24.c
drivers/scsi/sata_sis.c
drivers/scsi/sata_svw.c
drivers/scsi/sata_sx4.c
drivers/scsi/sata_uli.c
drivers/scsi/sata_via.c
drivers/scsi/sata_vsc.c
drivers/scsi/scsi_error.c
drivers/sn/ioc3.c
drivers/usb/serial/option.c
drivers/video/Kconfig
drivers/video/aty/atyfb_base.c
drivers/video/fbmem.c
drivers/video/vesafb.c
fs/9p/vfs_super.c
fs/Kconfig
fs/configfs/dir.c
fs/eventpoll.c
fs/exec.c
fs/ext3/resize.c
fs/fifo.c
fs/fuse/dev.c
fs/fuse/dir.c
fs/fuse/file.c
fs/fuse/fuse_i.h
fs/fuse/inode.c
fs/inotify.c
fs/namespace.c
fs/nfsd/auth.c
fs/nfsd/export.c
fs/nfsd/nfs3proc.c
fs/nfsd/nfs4acl.c
fs/nfsd/nfs4callback.c
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4state.c
fs/nfsd/nfs4xdr.c
fs/nfsd/nfsproc.c
fs/nfsd/vfs.c
fs/ocfs2/cluster/heartbeat.c
fs/ocfs2/dlm/userdlm.c
fs/ocfs2/file.c
fs/pipe.c
fs/proc/vmcore.c
fs/read_write.c
fs/select.c
fs/splice.c
fs/sync.c
fs/xfs/linux-2.6/xfs_aops.c
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/linux-2.6/xfs_file.c
fs/xfs/linux-2.6/xfs_iops.c
fs/xfs/linux-2.6/xfs_linux.h
fs/xfs/linux-2.6/xfs_lrw.c
fs/xfs/linux-2.6/xfs_lrw.h
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/linux-2.6/xfs_vnode.h
fs/xfs/quota/xfs_qm.c
fs/xfs/quota/xfs_trans_dquot.c
fs/xfs/xfs_bmap.c
fs/xfs/xfs_bmap.h
fs/xfs/xfs_clnt.h
fs/xfs/xfs_error.h
fs/xfs/xfs_ialloc.c
fs/xfs/xfs_iget.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_mount.c
fs/xfs/xfs_mount.h
fs/xfs/xfs_quota.h
fs/xfs/xfs_vfsops.c
fs/xfs/xfs_vnodeops.c
include/asm-alpha/numnodes.h [deleted file]
include/asm-arm/arch-at91rm9200/at91rm9200_mci.h [new file with mode: 0644]
include/asm-arm/arch-at91rm9200/board.h
include/asm-arm/arch-cl7500/hardware.h
include/asm-arm/arch-cl7500/memory.h
include/asm-arm/arch-ebsa110/debug-macro.S
include/asm-arm/arch-ebsa110/hardware.h
include/asm-arm/arch-ebsa110/memory.h
include/asm-arm/arch-ebsa110/uncompress.h
include/asm-arm/arch-ebsa285/hardware.h
include/asm-arm/arch-ebsa285/memory.h
include/asm-arm/arch-ep93xx/ts72xx.h
include/asm-arm/arch-imx/dma.h
include/asm-arm/arch-imx/imx-dma.h [new file with mode: 0644]
include/asm-arm/arch-imx/mmc.h [new file with mode: 0644]
include/asm-arm/arch-ixp23xx/debug-macro.S
include/asm-arm/arch-ixp23xx/memory.h
include/asm-arm/arch-ixp23xx/platform.h
include/asm-arm/arch-l7200/hardware.h
include/asm-arm/arch-l7200/memory.h
include/asm-arm/arch-lh7a40x/memory.h
include/asm-arm/arch-omap/aic23.h
include/asm-arm/arch-omap/board-ams-delta.h [new file with mode: 0644]
include/asm-arm/arch-omap/board-apollon.h [new file with mode: 0644]
include/asm-arm/arch-omap/board-h2.h
include/asm-arm/arch-omap/board-h3.h
include/asm-arm/arch-omap/board-h4.h
include/asm-arm/arch-omap/board-netstar.h [deleted file]
include/asm-arm/arch-omap/board-nokia.h [new file with mode: 0644]
include/asm-arm/arch-omap/board-perseus2.h
include/asm-arm/arch-omap/board.h
include/asm-arm/arch-omap/clock.h
include/asm-arm/arch-omap/dma.h
include/asm-arm/arch-omap/dmtimer.h
include/asm-arm/arch-omap/dsp.h
include/asm-arm/arch-omap/dsp_common.h
include/asm-arm/arch-omap/gpioexpander.h [new file with mode: 0644]
include/asm-arm/arch-omap/hardware.h
include/asm-arm/arch-omap/irda.h [new file with mode: 0644]
include/asm-arm/arch-omap/irqs.h
include/asm-arm/arch-omap/keypad.h [new file with mode: 0644]
include/asm-arm/arch-omap/lcd_lph8923.h [new file with mode: 0644]
include/asm-arm/arch-omap/mcbsp.h
include/asm-arm/arch-omap/mcspi.h [new file with mode: 0644]
include/asm-arm/arch-omap/menelaus.h
include/asm-arm/arch-omap/mux.h
include/asm-arm/arch-omap/omap-alsa.h [new file with mode: 0644]
include/asm-arm/arch-omap/omapfb.h
include/asm-arm/arch-omap/param.h [new file with mode: 0644]
include/asm-arm/arch-omap/pm.h
include/asm-arm/arch-omap/prcm.h
include/asm-arm/arch-omap/sram.h
include/asm-arm/arch-omap/system.h
include/asm-arm/arch-rpc/hardware.h
include/asm-arm/arch-rpc/memory.h
include/asm-arm/arch-s3c2410/entry-macro.S
include/asm-arm/arch-s3c2410/leds-gpio.h [new file with mode: 0644]
include/asm-arm/arch-sa1100/hardware.h
include/asm-arm/arch-sa1100/memory.h
include/asm-arm/arch-shark/hardware.h
include/asm-arm/arch-shark/memory.h
include/asm-arm/dma-mapping.h
include/asm-arm/fpstate.h
include/asm-arm/memory.h
include/asm-arm/numnodes.h [deleted file]
include/asm-arm/pgtable-hwdef.h
include/asm-arm/pgtable.h
include/asm-arm/vfpmacros.h
include/asm-cris/system.h
include/asm-cris/unistd.h
include/asm-frv/system.h
include/asm-frv/unistd.h
include/asm-h8300/system.h
include/asm-h8300/unistd.h
include/asm-i386/apic.h
include/asm-i386/e820.h
include/asm-i386/hpet.h
include/asm-i386/mpspec.h
include/asm-i386/numnodes.h [deleted file]
include/asm-i386/unistd.h
include/asm-ia64/acpi-ext.h
include/asm-ia64/kdebug.h
include/asm-ia64/mca.h
include/asm-ia64/mutex.h
include/asm-ia64/numnodes.h [deleted file]
include/asm-ia64/unistd.h
include/asm-ia64/vga.h
include/asm-m32r/numnodes.h [deleted file]
include/asm-m32r/smp.h
include/asm-m32r/system.h
include/asm-m32r/uaccess.h
include/asm-m32r/unistd.h
include/asm-mips/numnodes.h [deleted file]
include/asm-parisc/numnodes.h [deleted file]
include/asm-powerpc/numnodes.h [deleted file]
include/asm-s390/atomic.h
include/asm-s390/ebcdic.h
include/asm-sh/numnodes.h [deleted file]
include/asm-sh/unistd.h
include/asm-sh64/unistd.h
include/asm-sparc/vga.h [new file with mode: 0644]
include/asm-sparc64/percpu.h
include/asm-um/ptrace-i386.h
include/asm-v850/system.h
include/asm-x86_64/e820.h
include/asm-x86_64/hpet.h
include/asm-x86_64/ia32_unistd.h
include/asm-x86_64/io.h
include/asm-x86_64/mce.h
include/asm-x86_64/numa.h
include/asm-x86_64/numnodes.h [deleted file]
include/asm-x86_64/timex.h
include/asm-xtensa/system.h
include/linux/bootmem.h
include/linux/dma-mapping.h
include/linux/fs.h
include/linux/gfp.h
include/linux/init.h
include/linux/jiffies.h
include/linux/kernel.h
include/linux/leds.h
include/linux/libata.h
include/linux/memory_hotplug.h
include/linux/mm.h
include/linux/netfilter.h
include/linux/netfilter_ipv4.h
include/linux/netfilter_ipv4/ip_conntrack_h323.h
include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h [moved from net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.h with 100% similarity]
include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h [moved from net/ipv4/netfilter/ip_conntrack_helper_h323_types.h with 100% similarity]
include/linux/netfilter_ipv6.h
include/linux/numa.h
include/linux/page-flags.h
include/linux/pipe_fs_i.h
include/linux/proc_fs.h
include/linux/raid/md_p.h
include/linux/sched.h
include/linux/screen_info.h
include/linux/sdla_asy.h [deleted file]
include/linux/sdla_chdlc.h [deleted file]
include/linux/sdla_ppp.h [deleted file]
include/linux/sdla_x25.h [deleted file]
include/linux/sdladrv.h [deleted file]
include/linux/sdlapci.h [deleted file]
include/linux/sdlasfm.h [deleted file]
include/linux/seqlock.h
include/linux/string.h
include/linux/sunrpc/svc.h
include/linux/swap.h
include/linux/syscalls.h
include/linux/tty_flip.h
include/linux/vermagic.h
include/linux/wanpipe.h [deleted file]
include/net/inet6_hashtables.h
include/net/ip.h
include/net/x25device.h
include/scsi/scsi_host.h
include/scsi/scsi_transport.h
include/sound/core.h
include/sound/pcm.h
init/Kconfig
kernel/exit.c
kernel/hrtimer.c
kernel/irq/Makefile
kernel/irq/migration.c
kernel/panic.c
kernel/sched.c
kernel/signal.c
kernel/sys_ni.c
kernel/timer.c
lib/string.c
mm/bootmem.c
mm/migrate.c
mm/mmap.c
mm/nommu.c
mm/page-writeback.c
mm/page_alloc.c
mm/slab.c
net/bluetooth/sco.c
net/bridge/br_input.c
net/bridge/br_netfilter.c
net/bridge/netfilter/ebtables.c
net/core/dev.c
net/core/dv.c
net/core/flow.c
net/core/gen_estimator.c
net/core/neighbour.c
net/core/net-sysfs.c
net/core/request_sock.c
net/core/utils.c
net/dccp/ipv4.c
net/ipv4/fib_trie.c
net/ipv4/icmp.c
net/ipv4/ip_fragment.c
net/ipv4/ip_gre.c
net/ipv4/ip_output.c
net/ipv4/ipcomp.c
net/ipv4/ipip.c
net/ipv4/netfilter.c
net/ipv4/netfilter/Kconfig
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/arptable_filter.c
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_conntrack_helper_h323.c
net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c
net/ipv4/netfilter/ip_conntrack_proto_icmp.c
net/ipv4/netfilter/ip_conntrack_proto_tcp.c
net/ipv4/netfilter/ip_conntrack_proto_udp.c
net/ipv4/netfilter/ip_conntrack_standalone.c
net/ipv4/netfilter/ip_nat_helper_h323.c
net/ipv4/netfilter/ip_nat_rule.c
net/ipv4/netfilter/ip_nat_standalone.c
net/ipv4/netfilter/ip_queue.c
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/ipt_REJECT.c
net/ipv4/netfilter/iptable_filter.c
net/ipv4/netfilter/iptable_mangle.c
net/ipv4/netfilter/iptable_raw.c
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
net/ipv4/netfilter/nf_conntrack_proto_icmp.c
net/ipv4/proc.c
net/ipv4/route.c
net/ipv4/tunnel4.c
net/ipv4/xfrm4_input.c
net/ipv6/icmp.c
net/ipv6/inet6_hashtables.c
net/ipv6/ip6_tunnel.c
net/ipv6/ipcomp6.c
net/ipv6/netfilter.c
net/ipv6/netfilter/ip6_queue.c
net/ipv6/netfilter/ip6_tables.c
net/ipv6/netfilter/ip6table_filter.c
net/ipv6/netfilter/ip6table_mangle.c
net/ipv6/netfilter/ip6table_raw.c
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
net/ipv6/proc.c
net/ipv6/reassembly.c
net/ipv6/sit.c
net/ipv6/tunnel6.c
net/netfilter/core.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/nf_conntrack_proto_udp.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nf_queue.c
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_queue.c
net/netfilter/x_tables.c
net/sched/act_police.c
net/sctp/proc.c
net/socket.c
net/sunrpc/auth_gss/svcauth_gss.c
net/wanrouter/af_wanpipe.c
scripts/Kbuild.include
scripts/Makefile.lib
scripts/bloat-o-meter [changed mode: 0644->0755]
scripts/checkstack.pl [changed mode: 0644->0755]
scripts/gen_initramfs_list.sh
scripts/kconfig/conf.c
scripts/kconfig/confdata.c
scripts/kconfig/lxdialog/menubox.c
scripts/mod/modpost.c
scripts/namespace.pl [changed mode: 0644->0755]
scripts/show_delta [changed mode: 0644->0755]
scripts/ver_linux
security/keys/key.c
security/keys/keyring.c
security/keys/process_keys.c
security/selinux/xfrm.c
sound/core/oss/pcm_oss.c
sound/core/pcm.c
sound/core/pcm_native.c
sound/isa/ad1848/ad1848.c
sound/isa/adlib.c
sound/isa/cmi8330.c
sound/isa/cs423x/cs4231.c
sound/isa/cs423x/cs4236.c
sound/isa/es1688/es1688.c
sound/isa/es18xx.c
sound/isa/gus/gusclassic.c
sound/isa/gus/gusextreme.c
sound/isa/gus/gusmax.c
sound/isa/gus/interwave.c
sound/isa/opl3sa2.c
sound/isa/opti9xx/miro.c
sound/isa/opti9xx/opti92x-ad1848.c
sound/isa/sb/sb16.c
sound/isa/sb/sb8.c
sound/isa/sgalaxy.c
sound/isa/sscape.c
sound/isa/wavefront/wavefront.c
sound/oss/emu10k1/main.c
sound/pci/ac97/ac97_codec.c
sound/pci/als300.c
sound/pci/au88x0/au88x0.h
sound/pci/au88x0/au88x0_core.c
sound/pci/au88x0/au88x0_eq.c
sound/pci/au88x0/au88x0_pcm.c
sound/pci/emu10k1/emu10k1_main.c
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_sigmatel.c
sound/pci/via82xx.c
usr/Makefile

diff --git a/CREDITS b/CREDITS
index 0bf31eac6dc221add4980576b5e55f6fce384d70..787564bc248b1d6125fc42f3932966b60aa2f7f4 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -3382,7 +3382,7 @@ S: Germany
 
 N: Geert Uytterhoeven
 E: geert@linux-m68k.org
-W: http://home.tvd.be/cr26864/
+W: http://users.telenet.be/geertu/
 P: 1024/862678A6 C51D 361C 0BD1 4C90 B275  C553 6EEA 11BA 8626 78A6
 D: m68k/Amiga and PPC/CHRP Longtrail coordinator
 D: Frame buffer device and XF68_FBDev maintainer
@@ -3392,8 +3392,8 @@ D: Amiga Buddha and Catweasel chipset IDE
 D: Atari Falcon chipset IDE
 D: Amiga Gayle chipset IDE
 D: mipsel NEC DDB Vrc-5074
-S: Emiel Vlieberghlaan 2A/21
-S: B-3010 Kessel-Lo
+S: Haterbeekstraat 55B
+S: B-3200 Aarschot
 S: Belgium
 
 N: Chris Vance
index ee4bb73683cd40e3550484b2b2248ef75088910f..10bf4deb96aab3d64060800c256b13d690110214 100644 (file)
@@ -194,7 +194,7 @@ document for how to handle this case.
 Finally, if your device can only drive the low 24-bits of
 address during PCI bus mastering you might do something like:
 
-       if (pci_set_dma_mask(pdev, 0x00ffffff)) {
+       if (pci_set_dma_mask(pdev, DMA_24BIT_MASK)) {
                printk(KERN_WARNING
                       "mydev: 24-bit DMA addressing not available.\n");
                goto ignore_this_device;
@@ -212,7 +212,7 @@ functions (for example a sound card provides playback and record
 functions) and the various different functions have _different_
 DMA addressing limitations, you may wish to probe each mask and
 only provide the functionality which the machine can handle.  It
-is important that the last call to pci_set_dma_mask() be for the 
+is important that the last call to pci_set_dma_mask() be for the
 most specific mask.
 
 Here is pseudo-code showing how this might be done:
index 5bcbb6ee3bc03cf1632bd345a7b28bc2a610e033..f869b03929db44fa6a5c391bf9d1fd09a4e7ea0d 100644 (file)
@@ -705,7 +705,7 @@ and other resources, etc.
 
        <sect1><title>ata_scsi_error()</title>
        <para>
-       ata_scsi_error() is the current hostt->eh_strategy_handler()
+       ata_scsi_error() is the current transportt->eh_strategy_handler()
        for libata.  As discussed above, this will be entered in two
        cases - timeout and ATAPI error completion.  This function
        calls low level libata driver's eng_timeout() callback, the
index 59d0c74c79c955d4859e0c7cb3de222c14a23a1a..293fed113dff3fe08dbffb4db235ca62612ea7fc 100644 (file)
@@ -71,14 +71,6 @@ Who: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
 
 ---------------------------
 
-What:  remove EXPORT_SYMBOL(panic_timeout)
-When:  April 2006
-Files: kernel/panic.c
-Why:   No modular usage in the kernel.
-Who:   Adrian Bunk <bunk@stusta.de>
-
----------------------------
-
 What:  remove EXPORT_SYMBOL(insert_resource)
 When:  April 2006
 Files: kernel/resource.c
index adaa899e5c903763a4f0938efedd1bd3bbdce4a0..3a2e5520c1e3af38ea2ff91dc13a15d17f24aac0 100644 (file)
@@ -694,7 +694,7 @@ struct file_operations
 ----------------------
 
 This describes how the VFS can manipulate an open file. As of kernel
-2.6.13, the following members are defined:
+2.6.17, the following members are defined:
 
 struct file_operations {
        loff_t (*llseek) (struct file *, loff_t, int);
@@ -723,6 +723,10 @@ struct file_operations {
        int (*check_flags)(int);
        int (*dir_notify)(struct file *filp, unsigned long arg);
        int (*flock) (struct file *, int, struct file_lock *);
+       ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned 
+int);
+       ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned  
+int);
 };
 
 Again, all methods are called without any locks being held, unless
@@ -790,6 +794,12 @@ otherwise noted.
 
   flock: called by the flock(2) system call
 
+  splice_write: called by the VFS to splice data from a pipe to a file. This
+               method is used by the splice(2) system call
+
+  splice_read: called by the VFS to splice data from file to a pipe. This
+              method is used by the splice(2) system call
+
 Note that the file operations are implemented by the specific
 filesystem in which the inode resides. When opening a device node
 (character or block special) most filesystems will call special
diff --git a/Documentation/isdn/README.gigaset b/Documentation/isdn/README.gigaset
new file mode 100644 (file)
index 0000000..85a64de
--- /dev/null
@@ -0,0 +1,286 @@
+GigaSet 307x Device Driver
+==========================
+
+1.   Requirements
+     ------------
+1.1. Hardware
+     --------
+     This release supports the connection of the Gigaset 307x/417x family of
+     ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB
+     connection. The following devices are reported to be compatible:
+     307x/417x:
+        Gigaset SX255isdn
+        Gigaset SX353isdn
+        Sinus 45 [AB] isdn (Deutsche Telekom)
+        Sinus 721X/XA
+        Vox Chicago 390 ISDN (KPN Telecom)
+     M101:
+        Sinus 45 Data 1 (Telekom)
+     M105:
+        Gigaset USB Adapter DECT
+        Sinus 45 Data 2 (Telekom)
+        Sinus 721 data
+        Chicago 390 USB (KPN)
+     See also http://www.erbze.info/sinus_gigaset.htm and
+              http://gigaset307x.sourceforge.net/
+
+     We had also reports from users of Gigaset M105 who could use the drivers
+     with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.4.)
+     If you have another device that works with our driver, please let us know.
+     For example, Gigaset SX205isdn/Sinus 721 X SE and Gigaset SX303isdn bases
+     are just versions without answering machine of models known to work, so
+     they should work just as well; but so far we are lacking positive reports
+     on these.
+
+     Chances of getting an USB device to work are good if the output of
+        lsusb
+     at the command line contains one of the following:
+        ID 0681:0001
+        ID 0681:0002
+        ID 0681:0009
+        ID 0681:0021
+        ID 0681:0022
+
+1.2. Software
+     --------
+     The driver works with ISDN4linux and so can be used with any software
+     which is able to use ISDN4linux for ISDN connections (voice or data).
+     CAPI4Linux support is planned but not yet available.
+
+     There are some user space tools available at
+     http://sourceforge.net/projects/gigaset307x/
+     which provide access to additional device specific functions like SMS,
+     phonebook or call journal.
+
+
+2.   How to use the driver
+     ---------------------
+2.1. Modules
+     -------
+     To get the device working, you have to load the proper kernel module. You
+     can do this using
+         modprobe modulename
+     where modulename is usb_gigaset (M105) or bas_gigaset (direct USB
+     connection to the base).
+
+2.2. Device nodes for user space programs
+     ------------------------------------
+     The device can be accessed from user space (eg. by the user space tools
+     mentioned in 1.2.) through the device nodes:
+
+     - /dev/ttyGU0 for M105 (USB data boxes)
+     - /dev/ttyGB0 for the base driver (direct USB connection)
+
+     You can also select a "default device" which is used by the frontends when
+     no device node is given as parameter, by creating a symlink /dev/ttyG to
+     one of them, eg.:
+
+        ln -s /dev/ttyGB0 /dev/ttyG
+
+2.3. ISDN4linux
+     ----------
+     This is the "normal" mode of operation. After loading the module you can
+     set up the ISDN system just as you'd do with any ISDN card.
+     Your distribution should provide some configuration utility.
+     If not, you can use some HOWTOs like
+         http://www.linuxhaven.de/dlhp/HOWTO/DE-ISDN-HOWTO-5.html
+     If this doesn't work, because you have some recent device like SX100 where
+     debug output (see section 3.2.) shows something like this when dialing
+         CMD Received: ERROR
+         Available Params: 0
+         Connection State: 0, Response: -1
+         gigaset_process_response: resp_code -1 in ConState 0 !
+         Timeout occurred
+     you might need to use unimodem mode:
+
+2.4. Unimodem mode
+     -------------
+     This is needed for some devices [e.g. SX100] as they have problems with
+     the "normal" commands.
+
+     If you have installed the command line tool gigacontr, you can enter
+     unimodem mode using
+         gigacontr --mode unimodem
+     You can switch back using
+         gigacontr --mode isdn
+
+     You can also load the driver using e.g.
+         modprobe usb_gigaset startmode=0
+     to prevent the driver from starting in "isdn4linux mode".
+
+     In this mode the device works like a modem connected to a serial port
+     (the /dev/ttyGU0, ... mentioned above) which understands the commands
+         ATZ                 init, reset
+             => OK or ERROR
+         ATD
+         ATDT                dial
+             => OK, CONNECT,
+                BUSY,
+                NO DIAL TONE,
+                NO CARRIER,
+                NO ANSWER
+         <pause>+++<pause>   change to command mode when connected
+         ATH                 hangup
+
+     You can use some configuration tool of your distribution to configure this
+     "modem" or configure pppd/wvdial manually. There are some example ppp
+     configuration files and chat scripts in the gigaset-VERSION/ppp directory.
+     Please note that the USB drivers are not able to change the state of the
+     control lines (the M105 driver can be configured to use some undocumented
+     control requests, if you really need the control lines, though). This means
+     you must use "Stupid Mode" if you are using wvdial or you should use the
+     nocrtscts option of pppd.
+     You must also assure that the ppp_async module is loaded with the parameter
+     flag_time=0. You can do this e.g. by adding a line like
+
+        options ppp_async flag_time=0
+
+     to /etc/modprobe.conf. If your distribution has some local module
+     configuration file like /etc/modprobe.conf.local,
+     using that should be preferred.
+
+2.5. Call-ID (CID) mode
+     ------------------
+     Call-IDs are numbers used to tag commands to, and responses from, the
+     Gigaset base in order to support the simultaneous handling of multiple
+     ISDN calls. Their use can be enabled ("CID mode") or disabled ("Unimodem
+     mode"). Without Call-IDs (in Unimodem mode), only a very limited set of
+     functions is available. It allows outgoing data connections only, but
+     does not signal incoming calls or other base events.
+
+     DECT cordless data devices (M10x) permanently occupy the cordless
+     connection to the base while Call-IDs are activated. As the Gigaset
+     bases only support one DECT data connection at a time, this prevents
+     other DECT cordless data devices from accessing the base.
+
+     During active operation, the driver switches to the necessary mode
+     automatically. However, for the reasons above, the mode chosen when
+     the device is not in use (idle) can be selected by the user.
+     - If you want to receive incoming calls, you can use the default
+       settings (CID mode).
+     - If you have several DECT data devices (M10x) which you want to use
+       in turn, select Unimodem mode by passing the parameter "cidmode=0" to
+       the driver ("modprobe usb_gigaset cidmode=0" or modprobe.conf).
+
+     If you want both of these at once, you are out of luck.
+
+     You can also use /sys/module/<name>/parameters/cidmode for changing
+     the CID mode setting (<name> is usb_gigaset or bas_gigaset).
+
+
+3.   Troubleshooting
+     ---------------
+3.1. Solutions to frequently reported problems
+     -----------------------------------------
+     Problem:
+        You have a slow provider and isdn4linux gives up dialing too early.
+     Solution:
+        Load the isdn module using the dialtimeout option. You can do this e.g.
+        by adding a line like
+
+           options isdn dialtimeout=15
+
+        to /etc/modprobe.conf. If your distribution has some local module
+        configuration file like /etc/modprobe.conf.local,
+        using that should be preferred.
+
+     Problem:
+        Your isdn script aborts with a message about isdnlog.
+     Solution:
+        Try deactivating (or commenting out) isdnlog. This driver does not
+        support it.
+
+     Problem:
+        You have two or more DECT data adapters (M101/M105) and only the
+        first one you turn on works.
+     Solution:
+        Select Unimodem mode for all DECT data adapters. (see section 2.4.)
+
+3.2. Telling the driver to provide more information
+     ----------------------------------------------
+     Building the driver with the "Gigaset debugging" kernel configuration
+     option (CONFIG_GIGASET_DEBUG) gives it the ability to produce additional
+     information useful for debugging.
+
+     You can control the amount of debugging information the driver produces by
+     writing an appropriate value to /sys/module/gigaset/parameters/debug, e.g.
+        echo 0 > /sys/module/gigaset/parameters/debug
+     switches off debugging output completely,
+        echo 0x10a020 > /sys/module/gigaset/parameters/debug
+     enables the standard set of debugging output messages. These values are
+     bit patterns where every bit controls a certain type of debugging output.
+     See the constants DEBUG_* in the source file gigaset.h for details.
+
+     The initial value can be set using the debug parameter when loading the
+     module "gigaset", e.g. by adding a line
+        options gigaset debug=0
+     to /etc/modprobe.conf, ...
+
+     Generated debugging information can be found
+     - as output of the command
+         dmesg
+     - in system log files written by your syslog daemon, usually
+       in /var/log/, e.g. /var/log/messages.
+
+3.3. Reporting problems and bugs
+     ---------------------------
+     If you can't solve problems with the driver on your own, feel free to
+     use one of the forums, bug trackers, or mailing lists on
+         http://sourceforge.net/projects/gigaset307x
+     or write an electronic mail to the maintainers.
+
+     Try to provide as much information as possible, such as
+     - distribution
+     - kernel version (uname -r)
+     - gcc version (gcc --version)
+     - hardware architecture (uname -m, ...)
+     - type and firmware version of your device (base and wireless module,
+       if any)
+     - output of "lsusb -v" (if using an USB device)
+     - error messages
+     - relevant system log messages (it would help if you activate debug
+       output as described in 3.2.)
+
+     For help with general configuration problems not specific to our driver,
+     such as isdn4linux and network configuration issues, please refer to the
+     appropriate forums and newsgroups.
+
+3.4. Reporting problem solutions
+     ---------------------------
+     If you solved a problem with our drivers, wrote startup scripts for your
+     distribution, ... feel free to contact us (using one of the places
+     mentioned in 3.3.). We'd like to add scripts, hints, documentation
+     to the driver and/or the project web page.
+
+
+4.   Links, other software
+     ---------------------
+     - Sourceforge project developing this driver and associated tools
+         http://sourceforge.net/projects/gigaset307x
+     - Yahoo! Group on the Siemens Gigaset family of devices
+         http://de.groups.yahoo.com/group/Siemens-Gigaset
+     - Siemens Gigaset/T-Sinus compatibility table
+         http://www.erbze.info/sinus_gigaset.htm
+
+
+5.   Credits
+     -------
+     Thanks to
+
+     Karsten Keil
+        for his help with isdn4linux
+     Deti Fliegl
+        for his base driver code
+     Dennis Dietrich
+        for his kernel 2.6 patches
+     Andreas Rummel
+        for his work and logs to get unimodem mode working
+     Andreas Degert
+        for his logs and patches to get cx 100 working
+     Dietrich Feist
+        for his generous donation of one M105 and two M101 cordless adapters
+     Christoph Schweers
+        for his generous donation of a M34 device
+
+     and all the other people who sent logs and other information.
+
index fcccf2432f98ff48d8d87b040c92e9ab5a8ef01a..61fc079eb9661a7bd5eff33bc11e05e437734cc9 100644 (file)
@@ -44,7 +44,7 @@ What is covered within this file is mainly information to authors
 of modules. The author of an external modules should supply
 a makefile that hides most of the complexity so one only has to type
 'make' to build the module. A complete example will be present in
-chapter ยค. Creating a kbuild file for an external module".
+chapter 4, "Creating a kbuild file for an external module".
 
 
 === 2. How to build external modules
index b18e216759060ef792f3b62f4e0865f86dd60b06..5696e879449bca5c7353804d5fca069cd9926f46 100644 (file)
@@ -919,11 +919,11 @@ int main(int argc, char **argv)
     int settle_time = 60;
 
     /* Parse the simple command-line */
-    if (ac == 2)
-       disk = av[1];
-    else if (ac == 4) {
-       settle_time = atoi(av[2]);
-       disk = av[3];
+    if (argc == 2)
+       disk = argv[1];
+    else if (argc == 4) {
+       settle_time = atoi(argv[2]);
+       disk = argv[3];
     } else
        usage();
 
index f8550310a6d5d6481ac15417dac04fcfaf0e910a..92f0056d928c1f5ff485e250a93a843bb60058bc 100644 (file)
@@ -610,6 +610,7 @@ loads.  Consider the following sequence of events:
 
        CPU 1                   CPU 2
        ======================= =======================
+               { B = 7; X = 9; Y = 8; C = &Y }
        STORE A = 1
        STORE B = 2
        <write barrier>
@@ -651,7 +652,20 @@ In the above example, CPU 2 perceives that B is 7, despite the load of *C
 (which would be B) coming after the the LOAD of C.
 
 If, however, a data dependency barrier were to be placed between the load of C
-and the load of *C (ie: B) on CPU 2, then the following will occur:
+and the load of *C (ie: B) on CPU 2:
+
+       CPU 1                   CPU 2
+       ======================= =======================
+               { B = 7; X = 9; Y = 8; C = &Y }
+       STORE A = 1
+       STORE B = 2
+       <write barrier>
+       STORE C = &B            LOAD X
+       STORE D = 4             LOAD C (gets &B)
+                               <data dependency barrier>
+                               LOAD *C (reads B)
+
+then the following will occur:
 
        +-------+       :      :                :       :
        |       |       +------+                +-------+
@@ -829,8 +843,8 @@ There are some more advanced barrier functions:
  (*) smp_mb__after_atomic_inc();
 
      These are for use with atomic add, subtract, increment and decrement
-     functions, especially when used for reference counting.  These functions
-     do not imply memory barriers.
+     functions that don't return a value, especially when used for reference
+     counting.  These functions do not imply memory barriers.
 
      As an example, consider a piece of code that marks an object as being dead
      and then decrements the object's reference count:
@@ -1263,15 +1277,17 @@ else.
 ATOMIC OPERATIONS
 -----------------
 
-Though they are technically interprocessor interaction considerations, atomic
-operations are noted specially as they do _not_ generally imply memory
-barriers.  The possible offenders include:
+Whilst they are technically interprocessor interaction considerations, atomic
+operations are noted specially as some of them imply full memory barriers and
+some don't, but they're very heavily relied on as a group throughout the
+kernel.
+
+Any atomic operation that modifies some state in memory and returns information
+about the state (old or new) implies an SMP-conditional general memory barrier
+(smp_mb()) on each side of the actual operation.  These include:
 
        xchg();
        cmpxchg();
-       test_and_set_bit();
-       test_and_clear_bit();
-       test_and_change_bit();
        atomic_cmpxchg();
        atomic_inc_return();
        atomic_dec_return();
@@ -1282,21 +1298,31 @@ barriers.  The possible offenders include:
        atomic_sub_and_test();
        atomic_add_negative();
        atomic_add_unless();
+       test_and_set_bit();
+       test_and_clear_bit();
+       test_and_change_bit();
 
-These may be used for such things as implementing LOCK operations or controlling
-the lifetime of objects by decreasing their reference counts.  In such cases
-they need preceding memory barriers.
+These are used for such things as implementing LOCK-class and UNLOCK-class
+operations and adjusting reference counters towards object destruction, and as
+such the implicit memory barrier effects are necessary.
 
-The following may also be possible offenders as they may be used as UNLOCK
-operations.
 
+The following operation are potential problems as they do _not_ imply memory
+barriers, but might be used for implementing such things as UNLOCK-class
+operations:
+
+       atomic_set();
        set_bit();
        clear_bit();
        change_bit();
-       atomic_set();
 
+With these the appropriate explicit memory barrier should be used if necessary
+(smp_mb__before_clear_bit() for instance).
 
-The following are a little tricky:
+
+The following also do _not_ imply memory barriers, and so may require explicit
+memory barriers under some circumstances (smp_mb__before_atomic_dec() for
+instance)):
 
        atomic_add();
        atomic_sub();
@@ -1317,10 +1343,12 @@ specific order.
 
 
 Basically, each usage case has to be carefully considered as to whether memory
-barriers are needed or not.  The simplest rule is probably: if the atomic
-operation is protected by a lock, then it does not require a barrier unless
-there's another operation within the critical section with respect to which an
-ordering must be maintained.
+barriers are needed or not.
+
+[!] Note that special memory barrier primitives are available for these
+situations because on some CPUs the atomic instructions used imply full memory
+barriers, and so barrier instructions are superfluous in conjunction with them,
+and in such cases the special barrier primitives will be no-ops.
 
 See Documentation/atomic_ops.txt for more information.
 
index b78af1c329967adcd5da3c7a9098d351b034645d..c39ac395970ecfa7ee58dada23478c886952a415 100644 (file)
@@ -138,19 +138,29 @@ Reading MTRRs from a C program using ioctl()'s:
 
 */
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <errno.h>
-#define MTRR_NEED_STRINGS
 #include <asm/mtrr.h>
 
 #define TRUE 1
 #define FALSE 0
 #define ERRSTRING strerror (errno)
 
+static char *mtrr_strings[MTRR_NUM_TYPES] =
+{
+    "uncachable",               /* 0 */
+    "write-combining",          /* 1 */
+    "?",                        /* 2 */
+    "?",                        /* 3 */
+    "write-through",            /* 4 */
+    "write-protect",            /* 5 */
+    "write-back",               /* 6 */
+};
 
 int main ()
 {
@@ -232,13 +242,22 @@ Creating MTRRs from a C programme using ioctl()'s:
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <errno.h>
-#define MTRR_NEED_STRINGS
 #include <asm/mtrr.h>
 
 #define TRUE 1
 #define FALSE 0
 #define ERRSTRING strerror (errno)
 
+static char *mtrr_strings[MTRR_NUM_TYPES] =
+{
+    "uncachable",               /* 0 */
+    "write-combining",          /* 1 */
+    "?",                        /* 2 */
+    "?",                        /* 3 */
+    "write-through",            /* 4 */
+    "write-protect",            /* 5 */
+    "write-back",               /* 6 */
+};
 
 int main (int argc, char **argv)
 {
index 331afd791cbb474f774d10a008493459cce77886..ce767b90bb0dd288118fbee62df7176fcc9260fd 100644 (file)
@@ -19,9 +19,9 @@ TABLE OF CONTENTS
        [2-1-1] Overview
        [2-1-2] Flow of scmds through EH
        [2-1-3] Flow of control
-    [2-2] EH through hostt->eh_strategy_handler()
-       [2-2-1] Pre hostt->eh_strategy_handler() SCSI midlayer conditions
-       [2-2-2] Post hostt->eh_strategy_handler() SCSI midlayer conditions
+    [2-2] EH through transportt->eh_strategy_handler()
+       [2-2-1] Pre transportt->eh_strategy_handler() SCSI midlayer conditions
+       [2-2-2] Post transportt->eh_strategy_handler() SCSI midlayer conditions
        [2-2-3] Things to consider
 
 
@@ -413,9 +413,9 @@ scmd->allowed.
            layer of failure of the scmds.
 
 
-[2-2] EH through hostt->eh_strategy_handler()
+[2-2] EH through transportt->eh_strategy_handler()
 
hostt->eh_strategy_handler() is invoked in the place of
transportt->eh_strategy_handler() is invoked in the place of
 scsi_unjam_host() and it is responsible for whole recovery process.
 On completion, the handler should have made lower layers forget about
 all failed scmds and either ready for new commands or offline.  Also,
@@ -424,7 +424,7 @@ SCSI midlayer.  IOW, of the steps described in [2-1-2], all steps
 except for #1 must be implemented by eh_strategy_handler().
 
 
-[2-2-1] Pre hostt->eh_strategy_handler() SCSI midlayer conditions
+[2-2-1] Pre transportt->eh_strategy_handler() SCSI midlayer conditions
 
  The following conditions are true on entry to the handler.
 
@@ -437,7 +437,7 @@ except for #1 must be implemented by eh_strategy_handler().
  - shost->host_failed == shost->host_busy
 
 
-[2-2-2] Post hostt->eh_strategy_handler() SCSI midlayer conditions
+[2-2-2] Post transportt->eh_strategy_handler() SCSI midlayer conditions
 
  The following conditions must be true on exit from the handler.
 
index 8bbae3e1abdfa1c1a35f9c00f4b118cae9afdbf2..75a535a975c361986b40aa881cda3a49997455ae 100644 (file)
@@ -804,7 +804,6 @@ Summary:
    eh_bus_reset_handler - issue SCSI bus reset
    eh_device_reset_handler - issue SCSI device reset
    eh_host_reset_handler - reset host (host bus adapter)
-   eh_strategy_handler - driver supplied alternate to scsi_unjam_host()
    info - supply information about given host
    ioctl - driver can respond to ioctls
    proc_info - supports /proc/scsi/{driver_name}/{host_no}
@@ -969,24 +968,6 @@ Details:
      int eh_host_reset_handler(struct scsi_cmnd * scp)
 
 
-/**
- *      eh_strategy_handler - driver supplied alternate to scsi_unjam_host()
- *      @shp: host on which error has occurred
- *
- *      Returns TRUE if host unjammed, else FALSE.
- *
- *      Locks: none
- *
- *      Calling context: kernel thread
- *
- *      Notes: Invoked from scsi_eh thread. LLD supplied alternate to 
- *      scsi_unjam_host() found in scsi_error.c
- *
- *      Optionally defined in: LLD
- **/
-     int eh_strategy_handler(struct Scsi_Host * shp)
-
-
 /**
  *      info - supply information about given host: driver name plus data
  *             to distinguish given host
index 6feef9e82b63f832a26272d4909a575fcdc3cd03..68eeebc17ff43508a8fbae95f2432258eb6ebfc7 100644 (file)
           if ((err = pci_enable_device(pci)) < 0)
                   return err;
           /* check PCI availability (28bit DMA) */
-          if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
-              pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
+          if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 ||
+              pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) {
                   printk(KERN_ERR "error to set 28bit mask DMA\n");
                   pci_disable_device(pci);
                   return -ENXIO;
         The allocation of PCI resources is done in the
       <function>probe()</function> function, and usually an extra
       <function>xxx_create()</function> function is written for this
-      purpose. 
+      purpose.
       </para>
 
       <para>
       allocating resources. Also, you need to set the proper PCI DMA
       mask to limit the accessed i/o range. In some cases, you might
       need to call <function>pci_set_master()</function> function,
-      too. 
+      too.
       </para>
 
       <para>
 <![CDATA[
   if ((err = pci_enable_device(pci)) < 0)
           return err;
-  if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
-      pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
+  if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 ||
+      pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) {
           printk(KERN_ERR "error to set 28bit mask DMA\n");
           pci_disable_device(pci);
           return -ENXIO;
       functions. Unlike ALSA ver.0.5.x., there are no helpers for
       that. And these resources must be released in the destructor
       function (see below). Also, on ALSA 0.9.x, you don't need to
-      allocate (pseudo-)DMA for PCI like ALSA 0.5.x. 
+      allocate (pseudo-)DMA for PCI like ALSA 0.5.x.
       </para>
 
       <para>
         Now assume that this PCI device has an I/O port with 8 bytes
         and an interrupt. Then struct <structname>mychip</structname> will have the
-        following fields: 
+        following fields:
 
         <informalexample>
           <programlisting>
index 1ad9af1ca4d0b1f2c58b49009c139a69c6124f2d..2803f63c1a27622a3e3f3680d6c2a6398c993c7e 100644 (file)
@@ -27,7 +27,7 @@ number of free hugetlb pages at any time.  It also displays information about
 the configured hugepage size - this is needed for generating the proper
 alignment and size of the arguments to the above system calls.
 
-The output of "cat /proc/meminfo" will have output like:
+The output of "cat /proc/meminfo" will have lines like:
 
 .....
 HugePages_Total: xxx
@@ -42,11 +42,11 @@ pages in the kernel.  Super user can dynamically request more (or free some
 pre-configured) hugepages.
 The allocation (or deallocation) of hugetlb pages is possible only if there are
 enough physically contiguous free pages in system (freeing of hugepages is
-possible only if there are enough hugetlb pages free that can be transfered
+possible only if there are enough hugetlb pages free that can be transferred
 back to regular memory pool).
 
-Pages that are used as hugetlb pages are reserved inside the kernel and can
-not be used for other purposes.
+Pages that are used as hugetlb pages are reserved inside the kernel and cannot
+be used for other purposes.
 
 Once the kernel with Hugetlb page support is built and running, a user can
 use either the mmap system call or shared memory system calls to start using
@@ -60,7 +60,7 @@ Use the following command to dynamically allocate/deallocate hugepages:
 This command will try to configure 20 hugepages in the system.  The success
 or failure of allocation depends on the amount of physically contiguous
 memory that is preset in system at this time.  System administrators may want
-to put this command in one of the local rc init file.  This will enable the
+to put this command in one of the local rc init files.  This will enable the
 kernel to request huge pages early in the boot process (when the possibility
 of getting physical contiguous pages is still very high).
 
@@ -78,8 +78,8 @@ the uid and gid of the current process are taken.  The mode option sets the
 mode of root of file system to value & 0777.  This value is given in octal.
 By default the value 0755 is picked. The size option sets the maximum value of
 memory (huge pages) allowed for that filesystem (/mnt/huge). The size is
-rounded down to HPAGE_SIZE.  The option nr_inode sets the maximum number of
-inodes that /mnt/huge can use.  If the size or nr_inode options are not
+rounded down to HPAGE_SIZE.  The option nr_inodes sets the maximum number of
+inodes that /mnt/huge can use.  If the size or nr_inodes options are not
 provided on command line then no limits are set.  For size and nr_inodes
 options, you can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For
 example, size=2K has the same meaning as size=2048. An example is given at
@@ -88,7 +88,7 @@ the end of this document.
 read and write system calls are not supported on files that reside on hugetlb
 file systems.
 
-A regular chown, chgrp and chmod commands (with right permissions) could be
+Regular chown, chgrp, and chmod commands (with right permissions) could be
 used to change the file attributes on hugetlbfs.
 
 Also, it is important to note that no such mount command is required if the
@@ -96,8 +96,8 @@ applications are going to use only shmat/shmget system calls.  Users who
 wish to use hugetlb page via shared memory segment should be a member of
 a supplementary group and system admin needs to configure that gid into
 /proc/sys/vm/hugetlb_shm_group.  It is possible for same or different
-applications to use any combination of mmaps and shm* calls.  Though the
-mount of filesystem will be required for using mmaps.
+applications to use any combination of mmaps and shm* calls, though the
+mount of filesystem will be required for using mmap calls.
 
 *******************************************************************
 
index 1921353259aeeca2ab07f4ced32a8cd0f3edc559..f2cd6ef53ff33e92f6545a43a7f2498c0582b107 100644 (file)
@@ -151,6 +151,11 @@ NUMA
 
   numa=fake=X   Fake X nodes and ignore NUMA setup of the actual machine.
 
+  numa=hotadd=percent
+               Only allow hotadd memory to preallocate page structures upto
+               percent of already available memory.
+               numa=hotadd=0 will disable hotadd memory.
+
 ACPI
 
   acpi=off     Don't enable ACPI
diff --git a/Kbuild b/Kbuild
index 95d6a00bace08c0ac50b80356847d5f19f6dc55a..2d4f95e4b89f7f81da6cb94b07e8449b3689ba37 100644 (file)
--- a/Kbuild
+++ b/Kbuild
@@ -18,7 +18,7 @@ define sed-y
        "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
 endef
 # Override default regexp for specific architectures
-sed-$(CONFIG_MIPS) := "/^@@@/s///p"
+sed-$(CONFIG_MIPS) := "/^@@@/{s/^@@@//; s/ \#.*\$$//; p;}"
 
 quiet_cmd_offsets = GEN     $@
 define cmd_offsets
index f97657b7e2c712e54ab7d67f0ab671e6118b706d..6d3c401ccdb6cb14e8b5c5248b7a99f1743cd109 100644 (file)
@@ -1556,9 +1556,7 @@ S:        Maintained
 
 KEXEC
 P:     Eric Biederman
-P:     Randy Dunlap
 M:     ebiederm@xmission.com
-M:     rdunlap@xenotime.net
 W:     http://www.xmission.com/~ebiederm/files/kexec/
 L:     linux-kernel@vger.kernel.org
 L:     fastboot@osdl.org
@@ -3060,13 +3058,6 @@ M:       khali@linux-fr.org
 L:     lm-sensors@lm-sensors.org
 S:     Odd Fixes
 
-WAN ROUTER & SANGOMA WANPIPE DRIVERS & API (X.25, FRAME RELAY, PPP, CISCO HDLC)
-P:     Nenad Corbic
-M:     ncorbic@sangoma.com
-M:     dm@sangoma.com
-W:     http://www.sangoma.com
-S:     Supported
-
 WATCHDOG DEVICE DRIVERS
 P:     Wim Van Sebroeck
 M:     wim@iguana.be
index af6210d488368074f07ec28db54cecc3433df7d3..fc8e08c419f09e81252f3aa41cb7f47524c0af60 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
-SUBLEVEL = 16
-EXTRAVERSION =
+SUBLEVEL = 17
+EXTRAVERSION =-rc1
 NAME=Sliding Snow Leopard
 
 # *DOCUMENTATION*
@@ -1112,7 +1112,6 @@ modules_install: _emodinst_ _emodinst_post
 install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra)
 PHONY += _emodinst_
 _emodinst_:
-       $(Q)rm -rf $(MODLIB)/$(install-dir)
        $(Q)mkdir -p $(MODLIB)/$(install-dir)
        $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
 
@@ -1275,40 +1274,43 @@ kernelversion:
 
 # Single targets
 # ---------------------------------------------------------------------------
-# The directory part is taken from first prerequisite, so this
-# works even with external modules
+# Single targets are compatible with:
+# - build whith mixed source and output
+# - build with separate output dir 'make O=...'
+# - external modules
+#
+#  target-dir => where to store outputfile
+#  build-dir  => directory in kernel source tree to use
+
+ifeq ($(KBUILD_EXTMOD),)
+        build-dir  = $(patsubst %/,%,$(dir $@))
+        target-dir = $(dir $@)
+else
+        zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
+        build-dir  = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
+        target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
+endif
+
 %.s: %.c prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.i: %.c prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.o: %.c prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.lst: %.c prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.s: %.S prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.o: %.S prepare scripts FORCE
-       $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
-
-# For external modules we shall include any directory of the target,
-# but usual case there is no directory part.
-# make M=`pwd` module.o     => $(dir $@)=./
-# make M=`pwd` foo/module.o => $(dir $@)=foo/
-# make M=`pwd` /            => $(dir $@)=/
-ifeq ($(KBUILD_EXTMOD),)
-        target-dir = $(@D)
-else
-        zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
-        target-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
-endif
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 
-/ %/:      scripts prepare FORCE
+# Modules
+/ %/: prepare scripts FORCE
        $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
-       $(build)=$(target-dir)
-%.ko: scripts FORCE
+       $(build)=$(build-dir)
+%.ko: prepare scripts FORCE
        $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
-       $(build)=$(target-dir) $(@:.ko=.o)
+       $(build)=$(build-dir) $(@:.ko=.o)
        $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
 
 # FIXME Should go into a make.lib or something 
index 9bef61b303674e3be48a0fbb403ee7d85c126e30..8290b69da20214a7e19fedd0fc047d33d5d82ba7 100644 (file)
@@ -549,6 +549,11 @@ config NUMA
          Access).  This option is for configuring high-end multiprocessor
          server machines.  If in doubt, say N.
 
+config NODES_SHIFT
+       int
+       default "7"
+       depends on NEED_MULTIPLE_NODES
+
 # LARGE_VMALLOC is racy, if you *really* need it then fix it first
 config ALPHA_LARGE_VMALLOC
        bool
index 9d6186d50245c24624229ebd5ccb753ede91f8b3..c645c5e14786fdd17efddf40bb3ae2b40524ffd8 100644 (file)
@@ -76,7 +76,6 @@ EXPORT_SYMBOL(strncpy);
 EXPORT_SYMBOL(strnlen);
 EXPORT_SYMBOL(strncat);
 EXPORT_SYMBOL(strstr);
-EXPORT_SYMBOL(strpbrk);
 EXPORT_SYMBOL(strchr);
 EXPORT_SYMBOL(strrchr);
 EXPORT_SYMBOL(memcmp);
index a15e18a00258ee69d65329945c174e0ec0e3f66c..558b83368559396f4d50f793d37d8e7dd83c26d1 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/config.h>      /* CONFIG_ALPHA_LCA etc */
 #include <linux/mc146818rtc.h>
 #include <linux/console.h>
+#include <linux/cpu.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/string.h>
@@ -471,6 +472,22 @@ page_is_ram(unsigned long pfn)
        return 0;
 }
 
+static int __init
+register_cpus(void)
+{
+       int i;
+
+       for_each_possible_cpu(i) {
+               struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
+               if (!p)
+                       return -ENOMEM;
+               register_cpu(p, i, NULL);
+       }
+       return 0;
+}
+
+arch_initcall(register_cpus);
+
 void __init
 setup_arch(char **cmdline_p)
 {
index 02c2db08114ad66e42876d5e1f2b80c402ec9a84..185255416e8538c22384ae89491720834aa6fcc1 100644 (file)
@@ -439,7 +439,7 @@ setup_smp(void)
                        if ((cpu->flags & 0x1cc) == 0x1cc) {
                                smp_num_probed++;
                                /* Assume here that "whami" == index */
-                               cpu_set(i, cpu_possible_map);
+                               cpu_set(i, cpu_present_mask);
                                cpu->pal_revision = boot_cpu_palrev;
                        }
 
@@ -450,9 +450,8 @@ setup_smp(void)
                }
        } else {
                smp_num_probed = 1;
-               cpu_set(boot_cpuid, cpu_possible_map);
+               cpu_set(boot_cpuid, cpu_present_mask);
        }
-       cpu_present_mask = cpumask_of_cpu(boot_cpuid);
 
        printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n",
               smp_num_probed, cpu_possible_map.bits[0]);
@@ -488,9 +487,8 @@ void __devinit
 smp_prepare_boot_cpu(void)
 {
        /*
-        * Mark the boot cpu (current cpu) as both present and online
+        * Mark the boot cpu (current cpu) as online
         */ 
-       cpu_set(smp_processor_id(), cpu_present_mask);
        cpu_set(smp_processor_id(), cpu_online_map);
 }
 
index dc5a9332c91597f7cbc82d06db7be40138f7d551..1dbf6ddb300d2b5a9cfafd9e064dffee468dec52 100644 (file)
@@ -512,6 +512,12 @@ config ARCH_DISCONTIGMEM_ENABLE
          or have huge holes in the physical address space for other reasons.
          See <file:Documentation/vm/numa> for more.
 
+config NODES_SHIFT
+       int
+       default "4" if ARCH_LH7A40X
+       default "2"
+       depends on NEED_MULTIPLE_NODES
+
 source "mm/Kconfig"
 
 config LEDS
index eed616113e473f76dbf99deb3a6ebd7cdab123b8..153a07e7222bd4a4d8ede7d5b9bc7b0a9f31566d 100644 (file)
@@ -18,6 +18,7 @@ SECTIONS
     _start = .;
     *(.start)
     *(.text)
+    *(.text.*)
     *(.fixup)
     *(.gnu.warning)
     *(.rodata)
index 1fe73d1988880354336a84f641aaaf66126a97ac..9e1c1cceb735cf458898bdf277e134f7e7b2a9bf 100644 (file)
@@ -379,7 +379,7 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 # CONFIG_MTD_DOC2001 is not set
 # CONFIG_MTD_DOC2001PLUS is not set
 CONFIG_MTD_AT91_DATAFLASH=y
-CONFIG_MTD_AT91_DATAFLASH_CARD=y
+# CONFIG_MTD_AT91_DATAFLASH_CARD is not set
 
 #
 # NAND Flash Device Drivers
index b7d934cdb1b735a1b28847afef231268f7b98bff..6e0805a971d78b39f500306a9e1049e46e13b8a1 100644 (file)
@@ -370,7 +370,7 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 # CONFIG_MTD_DOC2001 is not set
 # CONFIG_MTD_DOC2001PLUS is not set
 CONFIG_MTD_AT91_DATAFLASH=y
-CONFIG_MTD_AT91_DATAFLASH_CARD=y
+# CONFIG_MTD_AT91_DATAFLASH_CARD is not set
 
 #
 # NAND Flash Device Drivers
index 1574941ebfe187f75f46df9de64fe905739b6747..c49b5d4d7fca2a77217c15732c0fbeeefdf90f6f 100644 (file)
@@ -100,23 +100,11 @@ EXPORT_SYMBOL(__raw_writesl);
 #endif
 
        /* string / mem functions */
-EXPORT_SYMBOL(strcpy);
-EXPORT_SYMBOL(strncpy);
-EXPORT_SYMBOL(strcat);
-EXPORT_SYMBOL(strncat);
-EXPORT_SYMBOL(strcmp);
-EXPORT_SYMBOL(strncmp);
 EXPORT_SYMBOL(strchr);
-EXPORT_SYMBOL(strlen);
-EXPORT_SYMBOL(strnlen);
-EXPORT_SYMBOL(strpbrk);
 EXPORT_SYMBOL(strrchr);
-EXPORT_SYMBOL(strstr);
 EXPORT_SYMBOL(memset);
 EXPORT_SYMBOL(memcpy);
 EXPORT_SYMBOL(memmove);
-EXPORT_SYMBOL(memcmp);
-EXPORT_SYMBOL(memscan);
 EXPORT_SYMBOL(memchr);
 EXPORT_SYMBOL(__memzero);
 
@@ -190,8 +178,6 @@ EXPORT_SYMBOL(_find_next_bit_be);
 
        /* syscalls */
 EXPORT_SYMBOL(sys_write);
-EXPORT_SYMBOL(sys_read);
 EXPORT_SYMBOL(sys_lseek);
-EXPORT_SYMBOL(sys_open);
 EXPORT_SYMBOL(sys_exit);
 EXPORT_SYMBOL(sys_wait4);
index b7cd280bfd638585f6caec72c30d829774546d75..8cff73e668b38be7d93d448c44d5f731e3452eac 100644 (file)
@@ -252,6 +252,9 @@ static void __init dump_cpu_info(int cpu)
                        dump_cache("cache", cpu, CACHE_ISIZE(info));
                }
        }
+
+       if (arch_is_coherent())
+               printk("Cache coherency enabled\n");
 }
 
 int cpu_architecture(void)
@@ -319,6 +322,12 @@ static void __init setup_processor(void)
        sprintf(system_utsname.machine, "%s%c", list->arch_name, ENDIANNESS);
        sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS);
        elf_hwcap = list->elf_hwcap;
+#ifndef CONFIG_ARM_THUMB
+       elf_hwcap &= ~HWCAP_THUMB;
+#endif
+#ifndef CONFIG_VFP
+       elf_hwcap &= ~HWCAP_VFP;
+#endif
 
        cpu_proc_init();
 }
index 75e6ee318dedc2d735a195445cde96179fdc232a..ef88c4128edc33ade67f23836c2124d96662a57a 100644 (file)
@@ -16,11 +16,12 @@ obj-$(CONFIG_MACH_CSB637)   += board-csb637.o
 #obj-$(CONFIG_MACH_KB9200)     += board-kb9202.o
 
 # LEDs support
-#led-$(CONFIG_ARCH_AT91RM9200DK)       += leds.o
-#led-$(CONFIG_MACH_AT91RM9200EK)       += leds.o
-#led-$(CONFIG_MACH_CSB337)     += leds.o
-#led-$(CONFIG_MACH_CSB637)     += leds.o
+led-$(CONFIG_ARCH_AT91RM9200DK)        += leds.o
+led-$(CONFIG_MACH_AT91RM9200EK)        += leds.o
+led-$(CONFIG_MACH_CSB337)      += leds.o
+led-$(CONFIG_MACH_CSB637)      += leds.o
 #led-$(CONFIG_MACH_KB9200)     += leds.o
+#led-$(CONFIG_MACH_KAFA)       += leds.o
 obj-$(CONFIG_LEDS) += $(led-y)
 
 # VGA support
index 54022e58d50dc263d15b29aa51f181f72b48e821..f45104ceea8fc5b20dc63fe5534c70777e7fea1b 100644 (file)
@@ -67,6 +67,9 @@ static void __init csb337_map_io(void)
        /* Initialize clocks: 3.6864 MHz crystal */
        at91_clock_init(3686400);
 
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
+
 #ifdef CONFIG_SERIAL_AT91
        at91_console_port = CSB337_SERIAL_CONSOLE;
        memcpy(at91_serial_map, serial, sizeof(serial));
index 8195f9d919ea56691aa62a1b2b339cddfbb730c1..f2c2d6e79bc6ee87bc83c9a8040cce21ec05a992 100644 (file)
@@ -67,6 +67,9 @@ static void __init csb637_map_io(void)
        /* Initialize clocks: 3.6864 MHz crystal */
        at91_clock_init(3686400);
 
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
+
 #ifdef CONFIG_SERIAL_AT91
        at91_console_port = CSB637_SERIAL_CONSOLE;
        memcpy(at91_serial_map, serial, sizeof(serial));
index 8a783368366ed16ccbe15eb0dfcd341d7c3c05a5..2d7200ed66ed72855c25537f65ac89a7022a5fe4 100644 (file)
@@ -70,6 +70,9 @@ static void __init dk_map_io(void)
        /* Initialize clocks: 18.432 MHz crystal */
        at91_clock_init(18432000);
 
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
+
 #ifdef CONFIG_SERIAL_AT91
        at91_console_port = DK_SERIAL_CONSOLE;
        memcpy(at91_serial_map, serial, sizeof(serial));
@@ -118,9 +121,14 @@ static void __init dk_board_init(void)
        at91_add_device_udc(&dk_udc_data);
        /* Compact Flash */
        at91_add_device_cf(&dk_cf_data);
+#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
+       /* DataFlash card */
+       at91_set_gpio_output(AT91_PIN_PB7, 0);
+#else
        /* MMC */
-       at91_set_gpio_output(AT91_PIN_PB7, 1);  /* this MMC card slot can optionally use SPI signaling (CS3). default: MMC */
+       at91_set_gpio_output(AT91_PIN_PB7, 1);  /* this MMC card slot can optionally use SPI signaling (CS3). */
        at91_add_device_mmc(&dk_mmc_data);
+#endif
        /* VGA */
 //     dk_add_device_video();
 }
index fd0752eba897ea771c5b11279ae1a560a44f4fde..80d90f5135a13cd0db47e4eaea6735fe14c8b15a 100644 (file)
@@ -70,6 +70,9 @@ static void __init ek_map_io(void)
        /* Initialize clocks: 18.432 MHz crystal */
        at91_clock_init(18432000);
 
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
+
 #ifdef CONFIG_SERIAL_AT91
        at91_console_port = EK_SERIAL_CONSOLE;
        memcpy(at91_serial_map, serial, sizeof(serial));
@@ -111,9 +114,14 @@ static void __init ek_board_init(void)
        at91_add_device_usbh(&ek_usbh_data);
        /* USB Device */
        at91_add_device_udc(&ek_udc_data);
+#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
+       /* DataFlash card */
+       at91_set_gpio_output(AT91_PIN_PB22, 0);
+#else
        /* MMC */
-       at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). default: MMC */
+       at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
        at91_add_device_mmc(&ek_mmc_data);
+#endif
        /* VGA */
 //     ek_add_device_video();
 }
index 57eedd5beaf6412c1b152843babf7536ee4c8486..1781b8f342c4d1b43e53d7f1c5009c987c1d2cfb 100644 (file)
 static u64 ohci_dmamask = 0xffffffffUL;
 static struct at91_usbh_data usbh_data;
 
-static struct resource at91rm9200_usbh_resource[] = {
+static struct resource at91_usbh_resource[] = {
        [0] = {
                .start  = AT91_UHP_BASE,
-               .end    = AT91_UHP_BASE + SZ_1M -1,
+               .end    = AT91_UHP_BASE + SZ_1M - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
@@ -49,8 +49,8 @@ static struct platform_device at91rm9200_usbh_device = {
                                .coherent_dma_mask      = 0xffffffff,
                                .platform_data          = &usbh_data,
        },
-       .resource       = at91rm9200_usbh_resource,
-       .num_resources  = ARRAY_SIZE(at91rm9200_usbh_resource),
+       .resource       = at91_usbh_resource,
+       .num_resources  = ARRAY_SIZE(at91_usbh_resource),
 };
 
 void __init at91_add_device_usbh(struct at91_usbh_data *data)
@@ -121,6 +121,19 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
 static u64 eth_dmamask = 0xffffffffUL;
 static struct at91_eth_data eth_data;
 
+static struct resource at91_eth_resources[] = {
+       [0] = {
+               .start  = AT91_BASE_EMAC,
+               .end    = AT91_BASE_EMAC + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_ID_EMAC,
+               .end    = AT91_ID_EMAC,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
 static struct platform_device at91rm9200_eth_device = {
        .name           = "at91_ether",
        .id             = -1,
@@ -129,7 +142,8 @@ static struct platform_device at91rm9200_eth_device = {
                                .coherent_dma_mask      = 0xffffffff,
                                .platform_data          = &eth_data,
        },
-       .num_resources  = 0,
+       .resource       = at91_eth_resources,
+       .num_resources  = ARRAY_SIZE(at91_eth_resources),
 };
 
 void __init at91_add_device_eth(struct at91_eth_data *data)
@@ -224,15 +238,20 @@ static u64 mmc_dmamask = 0xffffffffUL;
 static struct at91_mmc_data mmc_data;
 
 static struct resource at91_mmc_resources[] = {
-       {
+       [0] = {
                .start  = AT91_BASE_MCI,
                .end    = AT91_BASE_MCI + SZ_16K - 1,
                .flags  = IORESOURCE_MEM,
-       }
+       },
+       [1] = {
+               .start  = AT91_ID_MCI,
+               .end    = AT91_ID_MCI,
+               .flags  = IORESOURCE_IRQ,
+       },
 };
 
 static struct platform_device at91rm9200_mmc_device = {
-       .name           = "at91rm9200_mci",
+       .name           = "at91_mci",
        .id             = -1,
        .dev            = {
                                .dma_mask               = &mmc_dmamask,
@@ -290,4 +309,123 @@ void __init at91_add_device_mmc(struct at91_mmc_data *data)
 void __init at91_add_device_mmc(struct at91_mmc_data *data) {}
 #endif
 
+/* --------------------------------------------------------------------
+ *  NAND / SmartMedia
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
+static struct at91_nand_data nand_data;
+
+static struct resource at91_nand_resources[] = {
+       {
+               .start  = AT91_SMARTMEDIA_BASE,
+               .end    = AT91_SMARTMEDIA_BASE + SZ_8M - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device at91_nand_device = {
+       .name           = "at91_nand",
+       .id             = -1,
+       .dev            = {
+                               .platform_data  = &nand_data,
+       },
+       .resource       = at91_nand_resources,
+       .num_resources  = ARRAY_SIZE(at91_nand_resources),
+};
+
+void __init at91_add_device_nand(struct at91_nand_data *data)
+{
+       if (!data)
+               return;
+
+       /* enable pin */
+       if (data->enable_pin)
+               at91_set_gpio_output(data->enable_pin, 1);
+
+       /* ready/busy pin */
+       if (data->rdy_pin)
+               at91_set_gpio_input(data->rdy_pin, 1);
+
+       /* card detect pin */
+       if (data->det_pin)
+               at91_set_gpio_input(data->det_pin, 1);
+
+       at91_set_A_periph(AT91_PIN_PC1, 0);             /* SMOE */
+       at91_set_A_periph(AT91_PIN_PC3, 0);             /* SMWE */
+
+       nand_data = *data;
+       platform_device_register(&at91_nand_device);
+}
+#else
+void __init at91_add_device_nand(struct at91_nand_data *data) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  TWI (i2c)
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
+static struct platform_device at91rm9200_twi_device = {
+       .name           = "at91_i2c",
+       .id             = -1,
+       .num_resources  = 0,
+};
+
+void __init at91_add_device_i2c(void)
+{
+       /* pins used for TWI interface */
+       at91_set_A_periph(AT91_PIN_PA25, 0);            /* TWD */
+       at91_set_multi_drive(AT91_PIN_PA25, 1);
+
+       at91_set_A_periph(AT91_PIN_PA26, 0);            /* TWCK */
+       at91_set_multi_drive(AT91_PIN_PA26, 1);
+
+       platform_device_register(&at91rm9200_twi_device);
+}
+#else
+void __init at91_add_device_i2c(void) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  RTC
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_AT91_RTC) || defined(CONFIG_AT91_RTC_MODULE)
+static struct platform_device at91rm9200_rtc_device = {
+       .name           = "at91_rtc",
+       .id             = -1,
+       .num_resources  = 0,
+};
+
+void __init at91_add_device_rtc(void)
+{
+       platform_device_register(&at91rm9200_rtc_device);
+}
+#else
+void __init at91_add_device_rtc(void) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  LEDs
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_LEDS)
+u8 at91_leds_cpu;
+u8 at91_leds_timer;
+
+void __init at91_init_leds(u8 cpu_led, u8 timer_led)
+{
+       at91_leds_cpu   = cpu_led;
+       at91_leds_timer = timer_led;
+}
+
+#else
+void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
+#endif
+
+
 /* -------------------------------------------------------------------- */
diff --git a/arch/arm/mach-at91rm9200/leds.c b/arch/arm/mach-at91rm9200/leds.c
new file mode 100644 (file)
index 0000000..28150e8
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * LED driver for Atmel AT91-based boards.
+ *
+ *  Copyright (C) SAN People (Pty) Ltd
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+*/
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+
+#include <asm/mach-types.h>
+#include <asm/leds.h>
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+
+static inline void at91_led_on(unsigned int led)
+{
+       at91_set_gpio_value(led, 0);
+}
+
+static inline void at91_led_off(unsigned int led)
+{
+       at91_set_gpio_value(led, 1);
+}
+
+static inline void at91_led_toggle(unsigned int led)
+{
+       unsigned long is_off = at91_get_gpio_value(led);
+       if (is_off)
+               at91_led_on(led);
+       else
+               at91_led_off(led);
+}
+
+
+/*
+ * Handle LED events.
+ */
+static void at91_leds_event(led_event_t evt)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+
+       switch(evt) {
+       case led_start:         /* System startup */
+               at91_led_on(at91_leds_cpu);
+               break;
+
+       case led_stop:          /* System stop / suspend */
+               at91_led_off(at91_leds_cpu);
+               break;
+
+#ifdef CONFIG_LEDS_TIMER
+       case led_timer:         /* Every 50 timer ticks */
+               at91_led_toggle(at91_leds_timer);
+               break;
+#endif
+
+#ifdef CONFIG_LEDS_CPU
+       case led_idle_start:    /* Entering idle state */
+               at91_led_off(at91_leds_cpu);
+               break;
+
+       case led_idle_end:      /* Exit idle state */
+               at91_led_on(at91_leds_cpu);
+               break;
+#endif
+
+       default:
+               break;
+       }
+
+       local_irq_restore(flags);
+}
+
+
+static int __init leds_init(void)
+{
+       if (!at91_leds_timer || !at91_leds_cpu)
+               return -ENODEV;
+
+       /* Enable PIO to access the LEDs */
+       at91_set_gpio_output(at91_leds_timer, 1);
+       at91_set_gpio_output(at91_leds_cpu, 1);
+
+       leds_event = at91_leds_event;
+
+       leds_event(led_start);
+       return 0;
+}
+
+__initcall(leds_init);
index 2d892e4daa071e0d8b52e4b260b520e6276ffd43..dcd41762538943d90234642daf4a7a59ac7fcdeb 100644 (file)
@@ -424,6 +424,14 @@ static struct amba_device uart3_device = {
        .periphid       = 0x00041010,
 };
 
+
+static struct platform_device ep93xx_rtc_device = {
+       .name           = "ep93xx-rtc",
+       .id             = -1,
+       .num_resources  = 0,
+};
+
+
 void __init ep93xx_init_devices(void)
 {
        unsigned int v;
@@ -439,4 +447,6 @@ void __init ep93xx_init_devices(void)
        amba_device_register(&uart1_device, &iomem_resource);
        amba_device_register(&uart2_device, &iomem_resource);
        amba_device_register(&uart3_device, &iomem_resource);
+
+       platform_device_register(&ep93xx_rtc_device);
 }
index 777e75daa8a546dc2da62902d2a7f852ca10821d..9be01b0c3f4876f19a0a23c8b093321598658978 100644 (file)
@@ -17,6 +17,8 @@
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/mtd/physmap.h>
+#include <linux/platform_device.h>
+#include <linux/m48t86.h>
 #include <asm/io.h>
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
@@ -39,6 +41,16 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
                .pfn            = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE),
                .length         = TS72XX_OPTIONS2_SIZE,
                .type           = MT_DEVICE,
+       }, {
+               .virtual        = TS72XX_RTC_INDEX_VIRT_BASE,
+               .pfn            = __phys_to_pfn(TS72XX_RTC_INDEX_PHYS_BASE),
+               .length         = TS72XX_RTC_INDEX_SIZE,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = TS72XX_RTC_DATA_VIRT_BASE,
+               .pfn            = __phys_to_pfn(TS72XX_RTC_DATA_PHYS_BASE),
+               .length         = TS72XX_RTC_DATA_SIZE,
+               .type           = MT_DEVICE,
        }
 };
 
@@ -99,11 +111,38 @@ static void __init ts72xx_map_io(void)
        }
 }
 
+static unsigned char ts72xx_rtc_readb(unsigned long addr)
+{
+       __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE);
+       return __raw_readb(TS72XX_RTC_DATA_VIRT_BASE);
+}
+
+static void ts72xx_rtc_writeb(unsigned char value, unsigned long addr)
+{
+       __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE);
+       __raw_writeb(value, TS72XX_RTC_DATA_VIRT_BASE);
+}
+
+static struct m48t86_ops ts72xx_rtc_ops = {
+       .readb                  = ts72xx_rtc_readb,
+       .writeb                 = ts72xx_rtc_writeb,
+};
+
+static struct platform_device ts72xx_rtc_device = {
+       .name                   = "rtc-m48t86",
+       .id                     = -1,
+       .dev                    = {
+               .platform_data          = &ts72xx_rtc_ops,
+       },
+       .num_resources          = 0,
+};
+
 static void __init ts72xx_init_machine(void)
 {
        ep93xx_init_devices();
        if (board_is_ts7200())
                physmap_configure(TS72XX_NOR_PHYS_BASE, 0x01000000, 1, NULL);
+       platform_device_register(&ts72xx_rtc_device);
 }
 
 MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
index 71a59e196166cc00c4d9d31821f1f1aa3a16f44c..4ca51dcf13ac6966dbfc4357ad4dc10d1bfcf657 100644 (file)
@@ -7,11 +7,18 @@
  *  it under the terms of the GNU General Public License version 2 as
  *  published by the Free Software Foundation.
  *
- *  03/03/2004 Sascha Hauer <sascha@saschahauer.de>
+ *  2004-03-03 Sascha Hauer <sascha@saschahauer.de>
  *             initial version heavily inspired by
  *             linux/arch/arm/mach-pxa/dma.c
+ *
+ *  2005-04-17 Pavel Pisa <pisa@cmp.felk.cvut.cz>
+ *             Changed to support scatter gather DMA
+ *             by taking Russell's code from RiscPC
+ *
  */
 
+#undef DEBUG
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <asm/irq.h>
 #include <asm/hardware.h>
 #include <asm/dma.h>
+#include <asm/arch/imx-dma.h>
+
+struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
+
+/*
+ * imx_dma_sg_next - prepare next chunk for scatter-gather DMA emulation
+ * @dma_ch: i.MX DMA channel number
+ * @lastcount: number of bytes transferred during last transfer
+ *
+ * Functions prepares DMA controller for next sg data chunk transfer.
+ * The @lastcount argument informs function about number of bytes transferred
+ * during last block. Zero value can be used for @lastcount to setup DMA
+ * for the first chunk.
+ */
+static inline int imx_dma_sg_next(imx_dmach_t dma_ch, unsigned int lastcount)
+{
+       struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+       unsigned int nextcount;
+       unsigned int nextaddr;
+
+       if (!imxdma->name) {
+               printk(KERN_CRIT "%s: called for  not allocated channel %d\n",
+                      __FUNCTION__, dma_ch);
+               return 0;
+       }
+
+       imxdma->resbytes -= lastcount;
+
+       if (!imxdma->sg) {
+               pr_debug("imxdma%d: no sg data\n", dma_ch);
+               return 0;
+       }
+
+       imxdma->sgbc += lastcount;
+       if ((imxdma->sgbc >= imxdma->sg->length) || !imxdma->resbytes) {
+               if ((imxdma->sgcount <= 1) || !imxdma->resbytes) {
+                       pr_debug("imxdma%d: sg transfer limit reached\n",
+                                dma_ch);
+                       imxdma->sgcount=0;
+                       imxdma->sg = NULL;
+                       return 0;
+               } else {
+                       imxdma->sgcount--;
+                       imxdma->sg++;
+                       imxdma->sgbc = 0;
+               }
+       }
+       nextcount = imxdma->sg->length - imxdma->sgbc;
+       nextaddr = imxdma->sg->dma_address + imxdma->sgbc;
 
-static struct dma_channel {
-       char *name;
-       void (*irq_handler) (int, void *, struct pt_regs *);
-       void (*err_handler) (int, void *, struct pt_regs *);
-       void *data;
-} dma_channels[11];
+       if(imxdma->resbytes < nextcount)
+               nextcount = imxdma->resbytes;
 
-/* set err_handler to NULL to have the standard info-only error handler */
+       if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ)
+               DAR(dma_ch) = nextaddr;
+       else
+               SAR(dma_ch) = nextaddr;
+
+       CNTR(dma_ch) = nextcount;
+       pr_debug("imxdma%d: next sg chunk dst 0x%08x, src 0x%08x, size 0x%08x\n",
+                dma_ch, DAR(dma_ch), SAR(dma_ch), CNTR(dma_ch));
+
+       return nextcount;
+}
+
+/*
+ * imx_dma_setup_sg_base - scatter-gather DMA emulation
+ * @dma_ch: i.MX DMA channel number
+ * @sg: pointer to the scatter-gather list/vector
+ * @sgcount: scatter-gather list hungs count
+ *
+ * Functions sets up i.MX DMA state for emulated scatter-gather transfer
+ * and sets up channel registers to be ready for the first chunk
+ */
+static int
+imx_dma_setup_sg_base(imx_dmach_t dma_ch,
+                     struct scatterlist *sg, unsigned int sgcount)
+{
+       struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+
+       imxdma->sg = sg;
+       imxdma->sgcount = sgcount;
+       imxdma->sgbc = 0;
+       return imx_dma_sg_next(dma_ch, 0);
+}
+
+/**
+ * imx_dma_setup_single - setup i.MX DMA channel for linear memory to/from device transfer
+ * @dma_ch: i.MX DMA channel number
+ * @dma_address: the DMA/physical memory address of the linear data block
+ *             to transfer
+ * @dma_length: length of the data block in bytes
+ * @dev_addr: physical device port address
+ * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory
+ *           or %DMA_MODE_WRITE from memory to the device
+ *
+ * The function setups DMA channel source and destination addresses for transfer
+ * specified by provided parameters. The scatter-gather emulation is disabled,
+ * because linear data block
+ * form the physical address range is transfered.
+ * Return value: if incorrect parameters are provided -%EINVAL.
+ *             Zero indicates success.
+ */
 int
-imx_request_dma(char *name, imx_dma_prio prio,
-               void (*irq_handler) (int, void *, struct pt_regs *),
-               void (*err_handler) (int, void *, struct pt_regs *), void *data)
+imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
+                    unsigned int dma_length, unsigned int dev_addr,
+                    dmamode_t dmamode)
 {
-       unsigned long flags;
-       int i, found = 0;
+       struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
 
-       /* basic sanity checks */
-       if (!name || !irq_handler)
+       imxdma->sg = NULL;
+       imxdma->sgcount = 0;
+       imxdma->dma_mode = dmamode;
+       imxdma->resbytes = dma_length;
+
+       if (!dma_address) {
+               printk(KERN_ERR "imxdma%d: imx_dma_setup_single null address\n",
+                      dma_ch);
                return -EINVAL;
+       }
 
-       local_irq_save(flags);
+       if (!dma_length) {
+               printk(KERN_ERR "imxdma%d: imx_dma_setup_single zero length\n",
+                      dma_ch);
+               return -EINVAL;
+       }
 
-       /* try grabbing a DMA channel with the requested priority */
-       for (i = prio; i < prio + (prio == DMA_PRIO_LOW) ? 8 : 4; i++) {
-               if (!dma_channels[i].name) {
-                       found = 1;
-                       break;
-               }
+       if ((dmamode & DMA_MODE_MASK) == DMA_MODE_READ) {
+               pr_debug("imxdma%d: mx_dma_setup_single2dev dma_addressg=0x%08x dma_length=%d dev_addr=0x%08x for read\n",
+                       dma_ch, (unsigned int)dma_address, dma_length,
+                       dev_addr);
+               SAR(dma_ch) = dev_addr;
+               DAR(dma_ch) = (unsigned int)dma_address;
+       } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) {
+               pr_debug("imxdma%d: mx_dma_setup_single2dev dma_addressg=0x%08x dma_length=%d dev_addr=0x%08x for write\n",
+                       dma_ch, (unsigned int)dma_address, dma_length,
+                       dev_addr);
+               SAR(dma_ch) = (unsigned int)dma_address;
+               DAR(dma_ch) = dev_addr;
+       } else {
+               printk(KERN_ERR "imxdma%d: imx_dma_setup_single bad dmamode\n",
+                      dma_ch);
+               return -EINVAL;
        }
 
-       if (!found) {
-               /* requested prio group is full, try hier priorities */
-               for (i = prio - 1; i >= 0; i--) {
-                       if (!dma_channels[i].name) {
-                               found = 1;
-                               break;
-                       }
-               }
+       CNTR(dma_ch) = dma_length;
+
+       return 0;
+}
+
+/**
+ * imx_dma_setup_sg - setup i.MX DMA channel SG list to/from device transfer
+ * @dma_ch: i.MX DMA channel number
+ * @sg: pointer to the scatter-gather list/vector
+ * @sgcount: scatter-gather list hungs count
+ * @dma_length: total length of the transfer request in bytes
+ * @dev_addr: physical device port address
+ * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory
+ *           or %DMA_MODE_WRITE from memory to the device
+ *
+ * The function setups DMA channel state and registers to be ready for transfer
+ * specified by provided parameters. The scatter-gather emulation is set up
+ * according to the parameters.
+ *
+ * The full preparation of the transfer requires setup of more register
+ * by the caller before imx_dma_enable() can be called.
+ *
+ * %BLR(dma_ch) holds transfer burst length in bytes, 0 means 64 bytes
+ *
+ * %RSSR(dma_ch) has to be set to the DMA request line source %DMA_REQ_xxx
+ *
+ * %CCR(dma_ch) has to specify transfer parameters, the next settings is typical
+ * for linear or simple scatter-gather transfers if %DMA_MODE_READ is specified
+ *
+ * %CCR_DMOD_LINEAR | %CCR_DSIZ_32 | %CCR_SMOD_FIFO | %CCR_SSIZ_x
+ *
+ * The typical setup for %DMA_MODE_WRITE is specified by next options combination
+ *
+ * %CCR_SMOD_LINEAR | %CCR_SSIZ_32 | %CCR_DMOD_FIFO | %CCR_DSIZ_x
+ *
+ * Be carefull there and do not mistakenly mix source and target device
+ * port sizes constants, they are really different:
+ * %CCR_SSIZ_8, %CCR_SSIZ_16, %CCR_SSIZ_32,
+ * %CCR_DSIZ_8, %CCR_DSIZ_16, %CCR_DSIZ_32
+ *
+ * Return value: if incorrect parameters are provided -%EINVAL.
+ * Zero indicates success.
+ */
+int
+imx_dma_setup_sg(imx_dmach_t dma_ch,
+                struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length,
+                unsigned int dev_addr, dmamode_t dmamode)
+{
+       int res;
+       struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+
+       imxdma->sg = NULL;
+       imxdma->sgcount = 0;
+       imxdma->dma_mode = dmamode;
+       imxdma->resbytes = dma_length;
+
+       if (!sg || !sgcount) {
+               printk(KERN_ERR "imxdma%d: imx_dma_setup_sg epty sg list\n",
+                      dma_ch);
+               return -EINVAL;
+       }
+
+       if (!sg->length) {
+               printk(KERN_ERR "imxdma%d: imx_dma_setup_sg zero length\n",
+                      dma_ch);
+               return -EINVAL;
        }
 
-       if (found) {
-               DIMR &= ~(1 << i);
-               dma_channels[i].name = name;
-               dma_channels[i].irq_handler = irq_handler;
-               dma_channels[i].err_handler = err_handler;
-               dma_channels[i].data = data;
+       if ((dmamode & DMA_MODE_MASK) == DMA_MODE_READ) {
+               pr_debug("imxdma%d: mx_dma_setup_sg2dev sg=%p sgcount=%d total length=%d dev_addr=0x%08x for read\n",
+                       dma_ch, sg, sgcount, dma_length, dev_addr);
+               SAR(dma_ch) = dev_addr;
+       } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) {
+               pr_debug("imxdma%d: mx_dma_setup_sg2dev sg=%p sgcount=%d total length=%d dev_addr=0x%08x for write\n",
+                       dma_ch, sg, sgcount, dma_length, dev_addr);
+               DAR(dma_ch) = dev_addr;
        } else {
-               printk(KERN_WARNING "No more available DMA channels for %s\n",
-                      name);
-               i = -ENODEV;
+               printk(KERN_ERR "imxdma%d: imx_dma_setup_sg bad dmamode\n",
+                      dma_ch);
+               return -EINVAL;
+       }
+
+       res = imx_dma_setup_sg_base(dma_ch, sg, sgcount);
+       if (res <= 0) {
+               printk(KERN_ERR "imxdma%d: no sg chunk ready\n", dma_ch);
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+/**
+ * imx_dma_setup_handlers - setup i.MX DMA channel end and error notification handlers
+ * @dma_ch: i.MX DMA channel number
+ * @irq_handler: the pointer to the function called if the transfer
+ *             ends successfully
+ * @err_handler: the pointer to the function called if the premature
+ *             end caused by error occurs
+ * @data: user specified value to be passed to the handlers
+ */
+int
+imx_dma_setup_handlers(imx_dmach_t dma_ch,
+                      void (*irq_handler) (int, void *, struct pt_regs *),
+                      void (*err_handler) (int, void *, struct pt_regs *),
+                      void *data)
+{
+       struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+       unsigned long flags;
+
+       if (!imxdma->name) {
+               printk(KERN_CRIT "%s: called for  not allocated channel %d\n",
+                      __FUNCTION__, dma_ch);
+               return -ENODEV;
+       }
+
+       local_irq_save(flags);
+       DISR = (1 << dma_ch);
+       imxdma->irq_handler = irq_handler;
+       imxdma->err_handler = err_handler;
+       imxdma->data = data;
+       local_irq_restore(flags);
+       return 0;
+}
+
+/**
+ * imx_dma_enable - function to start i.MX DMA channel operation
+ * @dma_ch: i.MX DMA channel number
+ *
+ * The channel has to be allocated by driver through imx_dma_request()
+ * or imx_dma_request_by_prio() function.
+ * The transfer parameters has to be set to the channel registers through
+ * call of the imx_dma_setup_single() or imx_dma_setup_sg() function
+ * and registers %BLR(dma_ch), %RSSR(dma_ch) and %CCR(dma_ch) has to
+ * be set prior this function call by the channel user.
+ */
+void imx_dma_enable(imx_dmach_t dma_ch)
+{
+       struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+       unsigned long flags;
+
+       pr_debug("imxdma%d: imx_dma_enable\n", dma_ch);
+
+       if (!imxdma->name) {
+               printk(KERN_CRIT "%s: called for  not allocated channel %d\n",
+                      __FUNCTION__, dma_ch);
+               return;
+       }
+
+       local_irq_save(flags);
+       DISR = (1 << dma_ch);
+       DIMR &= ~(1 << dma_ch);
+       CCR(dma_ch) |= CCR_CEN;
+       local_irq_restore(flags);
+}
+
+/**
+ * imx_dma_disable - stop, finish i.MX DMA channel operatin
+ * @dma_ch: i.MX DMA channel number
+ */
+void imx_dma_disable(imx_dmach_t dma_ch)
+{
+       unsigned long flags;
+
+       pr_debug("imxdma%d: imx_dma_disable\n", dma_ch);
+
+       local_irq_save(flags);
+       DIMR |= (1 << dma_ch);
+       CCR(dma_ch) &= ~CCR_CEN;
+       DISR = (1 << dma_ch);
+       local_irq_restore(flags);
+}
+
+/**
+ * imx_dma_request - request/allocate specified channel number
+ * @dma_ch: i.MX DMA channel number
+ * @name: the driver/caller own non-%NULL identification
+ */
+int imx_dma_request(imx_dmach_t dma_ch, const char *name)
+{
+       struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+       unsigned long flags;
+
+       /* basic sanity checks */
+       if (!name)
+               return -EINVAL;
+
+       if (dma_ch >= IMX_DMA_CHANNELS) {
+               printk(KERN_CRIT "%s: called for  non-existed channel %d\n",
+                      __FUNCTION__, dma_ch);
+               return -EINVAL;
        }
 
+       local_irq_save(flags);
+       if (imxdma->name) {
+               local_irq_restore(flags);
+               return -ENODEV;
+       }
+
+       imxdma->name = name;
+       imxdma->irq_handler = NULL;
+       imxdma->err_handler = NULL;
+       imxdma->data = NULL;
+       imxdma->sg = NULL;
        local_irq_restore(flags);
-       return i;
+       return 0;
 }
 
-void
-imx_free_dma(int dma_ch)
+/**
+ * imx_dma_free - release previously acquired channel
+ * @dma_ch: i.MX DMA channel number
+ */
+void imx_dma_free(imx_dmach_t dma_ch)
 {
        unsigned long flags;
+       struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
 
-       if (!dma_channels[dma_ch].name) {
+       if (!imxdma->name) {
                printk(KERN_CRIT
                       "%s: trying to free channel %d which is already freed\n",
                       __FUNCTION__, dma_ch);
@@ -92,27 +398,84 @@ imx_free_dma(int dma_ch)
        }
 
        local_irq_save(flags);
-       DIMR &= ~(1 << dma_ch);
-       dma_channels[dma_ch].name = NULL;
+       /* Disable interrupts */
+       DIMR |= (1 << dma_ch);
+       CCR(dma_ch) &= ~CCR_CEN;
+       imxdma->name = NULL;
        local_irq_restore(flags);
 }
 
-static irqreturn_t
-dma_err_handler(int irq, void *dev_id, struct pt_regs *regs)
+/**
+ * imx_dma_request_by_prio - find and request some of free channels best suiting requested priority
+ * @dma_ch: i.MX DMA channel number
+ * @name: the driver/caller own non-%NULL identification
+ * @prio: one of the hardware distinguished priority level:
+ *        %DMA_PRIO_HIGH, %DMA_PRIO_MEDIUM, %DMA_PRIO_LOW
+ *
+ * This function tries to find free channel in the specified priority group
+ * if the priority cannot be achieved it tries to look for free channel
+ * in the higher and then even lower priority groups.
+ *
+ * Return value: If there is no free channel to allocate, -%ENODEV is returned.
+ *               Zero value indicates successful channel allocation.
+ */
+int
+imx_dma_request_by_prio(imx_dmach_t * pdma_ch, const char *name,
+                       imx_dma_prio prio)
+{
+       int i;
+       int best;
+
+       switch (prio) {
+       case (DMA_PRIO_HIGH):
+               best = 8;
+               break;
+       case (DMA_PRIO_MEDIUM):
+               best = 4;
+               break;
+       case (DMA_PRIO_LOW):
+       default:
+               best = 0;
+               break;
+       }
+
+       for (i = best; i < IMX_DMA_CHANNELS; i++) {
+               if (!imx_dma_request(i, name)) {
+                       *pdma_ch = i;
+                       return 0;
+               }
+       }
+
+       for (i = best - 1; i >= 0; i--) {
+               if (!imx_dma_request(i, name)) {
+                       *pdma_ch = i;
+                       return 0;
+               }
+       }
+
+       printk(KERN_ERR "%s: no free DMA channel found\n", __FUNCTION__);
+
+       return -ENODEV;
+}
+
+static irqreturn_t dma_err_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
        int i, disr = DISR;
-       struct dma_channel *channel;
+       struct imx_dma_channel *channel;
        unsigned int err_mask = DBTOSR | DRTOSR | DSESR | DBOSR;
 
        DISR = disr;
-       for (i = 0; i < 11; i++) {
-               channel = &dma_channels[i];
+       for (i = 0; i < IMX_DMA_CHANNELS; i++) {
+               channel = &imx_dma_channels[i];
 
-               if ( (err_mask & 1<<i) && channel->name && channel->err_handler) {
+               if ((err_mask & 1 << i) && channel->name
+                   && channel->err_handler) {
                        channel->err_handler(i, channel->data, regs);
                        continue;
                }
 
+               imx_dma_channels[i].sg = NULL;
+
                if (DBTOSR & (1 << i)) {
                        printk(KERN_WARNING
                               "Burst timeout on channel %d (%s)\n",
@@ -141,17 +504,27 @@ dma_err_handler(int irq, void *dev_id, struct pt_regs *regs)
        return IRQ_HANDLED;
 }
 
-static irqreturn_t
-dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
        int i, disr = DISR;
 
+       pr_debug("imxdma: dma_irq_handler called, disr=0x%08x\n",
+                    disr);
+
        DISR = disr;
-       for (i = 0; i < 11; i++) {
+       for (i = 0; i < IMX_DMA_CHANNELS; i++) {
                if (disr & (1 << i)) {
-                       struct dma_channel *channel = &dma_channels[i];
-                       if (channel->name && channel->irq_handler) {
-                               channel->irq_handler(i, channel->data, regs);
+                       struct imx_dma_channel *channel = &imx_dma_channels[i];
+                       if (channel->name) {
+                               if (imx_dma_sg_next(i, CNTR(i))) {
+                                       CCR(i) &= ~CCR_CEN;
+                                       mb();
+                                       CCR(i) |= CCR_CEN;
+                               } else {
+                                       if (channel->irq_handler)
+                                               channel->irq_handler(i,
+                                                       channel->data, regs);
+                               }
                        } else {
                                /*
                                 * IRQ for an unregistered DMA channel:
@@ -165,10 +538,10 @@ dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
        return IRQ_HANDLED;
 }
 
-static int __init
-imx_dma_init(void)
+static int __init imx_dma_init(void)
 {
        int ret;
+       int i;
 
        /* reset DMA module */
        DCR = DCR_DRST;
@@ -189,15 +562,27 @@ imx_dma_init(void)
        DCR = DCR_DEN;
 
        /* clear all interrupts */
-       DISR = 0x3ff;
+       DISR = (1 << IMX_DMA_CHANNELS) - 1;
 
        /* enable interrupts */
-       DIMR = 0;
+       DIMR = (1 << IMX_DMA_CHANNELS) - 1;
+
+       for (i = 0; i < IMX_DMA_CHANNELS; i++) {
+               imx_dma_channels[i].sg = NULL;
+               imx_dma_channels[i].dma_num = i;
+       }
 
        return ret;
 }
 
 arch_initcall(imx_dma_init);
 
-EXPORT_SYMBOL(imx_request_dma);
-EXPORT_SYMBOL(imx_free_dma);
+EXPORT_SYMBOL(imx_dma_setup_single);
+EXPORT_SYMBOL(imx_dma_setup_sg);
+EXPORT_SYMBOL(imx_dma_setup_handlers);
+EXPORT_SYMBOL(imx_dma_enable);
+EXPORT_SYMBOL(imx_dma_disable);
+EXPORT_SYMBOL(imx_dma_request);
+EXPORT_SYMBOL(imx_dma_free);
+EXPORT_SYMBOL(imx_dma_request_by_prio);
+EXPORT_SYMBOL(imx_dma_channels);
index 37613ad68366eda2615d384501dbcfc4dbb6ffa7..9d8331be2b58ec359d8b262352be12f3b0f2056c 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/arch/imx-regs.h>
 
 #include <asm/mach/map.h>
+#include <asm/arch/mmc.h>
 
 void imx_gpio_mode(int gpio_mode)
 {
@@ -175,13 +176,25 @@ static struct resource imx_mmc_resources[] = {
        },
 };
 
+static u64 imxmmmc_dmamask = 0xffffffffUL;
+
 static struct platform_device imx_mmc_device = {
        .name           = "imx-mmc",
        .id             = 0,
+       .dev            = {
+               .dma_mask = &imxmmmc_dmamask,
+               .coherent_dma_mask = 0xffffffff,
+       },
        .num_resources  = ARRAY_SIZE(imx_mmc_resources),
        .resource       = imx_mmc_resources,
 };
 
+void __init imx_set_mmc_info(struct imxmmc_platform_data *info)
+{
+       imx_mmc_device.dev.platform_data = info;
+}
+EXPORT_SYMBOL(imx_set_mmc_info);
+
 static struct resource imx_uart1_resources[] = {
        [0] = {
                .start  = 0x00206000,
index 8ab1b040288c0621b76ec338e04da435842ded65..e34d0df90aed897e606d44a4ab8f5f607bbfd25a 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/mach-types.h>
 
 #include <asm/mach/arch.h>
+#include <asm/arch/mmc.h>
 #include <linux/interrupt.h>
 #include "generic.h"
 
@@ -51,11 +52,28 @@ static struct platform_device *devices[] __initdata = {
        &cs89x0_device,
 };
 
+#ifdef CONFIG_MMC_IMX
+static int mx1ads_mmc_card_present(void)
+{
+       /* MMC/SD Card Detect is PB 20 on MX1ADS V1.0.7 */
+       return (SSR(1) & (1 << 20) ? 0 : 1);
+}
+
+static struct imxmmc_platform_data mx1ads_mmc_info = {
+       .card_present = mx1ads_mmc_card_present,
+};
+#endif
+
 static void __init
 mx1ads_init(void)
 {
 #ifdef CONFIG_LEDS
        imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2);
+#endif
+#ifdef CONFIG_MMC_IMX
+       /* SD/MMC card detect */
+       imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20);
+       imx_set_mmc_info(&mx1ads_mmc_info);
 #endif
        platform_add_devices(devices, ARRAY_SIZE(devices));
 }
index 2327c979041622c849dbcdcc403b2bdc5eab44d6..bf688c1286301b90db9b05e27d4809e34e0226e4 100644 (file)
 #include <asm/mach/irq.h>
 #include <asm/mach/pci.h>
 
+static int __init espresso_pci_init(void)
+{
+       if (machine_is_espresso())
+               ixp23xx_pci_slave_init();
+
+       return 0;
+};
+subsys_initcall(espresso_pci_init);
+
 static void __init espresso_init(void)
 {
        physmap_configure(0x90000000, 0x02000000, 2, NULL);
index 5330ad78c1bb2df844695729ac95e159e58359aa..ac72f94c5b4d58dd15972abe63f997a865792513 100644 (file)
@@ -201,7 +201,7 @@ int clear_master_aborts(void)
        return 0;
 }
 
-void __init ixp23xx_pci_preinit(void)
+static void __init ixp23xx_pci_common_init(void)
 {
 #ifdef __ARMEB__
        *IXP23XX_PCI_CONTROL |= 0x20000;        /* set I/O swapping */
@@ -219,7 +219,18 @@ void __init ixp23xx_pci_preinit(void)
                *IXP23XX_PCI_CPP_ADDR_BITS &= ~(1 << 1);
        } else {
                *IXP23XX_PCI_CPP_ADDR_BITS |= (1 << 1);
+
+               /*
+                * Enable coherency on A2 silicon.
+                */
+               if (arch_is_coherent())
+                       *IXP23XX_CPP2XSI_CURR_XFER_REG3 &= ~IXP23XX_CPP2XSI_COH_OFF;
        }
+}
+
+void __init ixp23xx_pci_preinit(void)
+{
+       ixp23xx_pci_common_init();
 
        hook_fault_code(16+6, ixp23xx_pci_abort_handler, SIGBUS,
                        "PCI config cycle to non-existent device");
@@ -273,3 +284,8 @@ int ixp23xx_pci_setup(int nr, struct pci_sys_data *sys)
 
        return 1;
 }
+
+void ixp23xx_pci_slave_init(void)
+{
+       ixp23xx_pci_common_init();
+}
index 86a0f0d14345c345f392502f8e93ae9977e5e15f..f8d716ccc1dfbdb278b82b88adfca95275dde60c 100644 (file)
@@ -69,12 +69,6 @@ config MACH_VOICEBLUE
          Support for Voiceblue GSM/VoIP gateway. Say Y here if you have
          such a board.
 
-config MACH_NETSTAR
-       bool "NetStar"
-       depends on ARCH_OMAP1 && ARCH_OMAP15XX
-       help
-         Support for NetStar PBX. Say Y here if you have such a board.
-
 config MACH_OMAP_PALMTE
        bool "Palm Tungsten E"
        depends on ARCH_OMAP1 && ARCH_OMAP15XX
@@ -85,6 +79,20 @@ config MACH_OMAP_PALMTE
           informations.
           Say Y here if you have such a PDA, say NO otherwise.
 
+config MACH_NOKIA770
+       bool "Nokia 770"
+       depends on ARCH_OMAP1 && ARCH_OMAP16XX
+       help
+         Support for the Nokia 770 Internet Tablet. Say Y here if you
+         have such a device.
+
+config MACH_AMS_DELTA
+       bool "Amstrad E3 (Delta)"
+       depends on ARCH_OMAP1 && ARCH_OMAP15XX
+       help
+         Support for the Amstrad E3 (codename Delta) videophone. Say Y here
+         if you have such a device.
+
 config MACH_OMAP_GENERIC
        bool "Generic OMAP board"
        depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX)
index b0b00156faaefbaf00296bdc0856a427b13596d8..9ea719550ad37f699478c1b271ed94651be246e7 100644 (file)
@@ -3,7 +3,13 @@
 #
 
 # Common support
-obj-y := io.o id.o clock.o irq.o time.o mux.o serial.o devices.o
+obj-y := io.o id.o clock.o irq.o mux.o serial.o devices.o
+
+obj-$(CONFIG_OMAP_MPU_TIMER)           += time.o
+
+# Power Management
+obj-$(CONFIG_PM) += pm.o sleep.o
+
 led-y := leds.o
 
 # Specific board support
@@ -14,8 +20,9 @@ obj-$(CONFIG_MACH_OMAP_PERSEUS2)      += board-perseus2.o
 obj-$(CONFIG_MACH_OMAP_OSK)            += board-osk.o
 obj-$(CONFIG_MACH_OMAP_H3)             += board-h3.o
 obj-$(CONFIG_MACH_VOICEBLUE)           += board-voiceblue.o
-obj-$(CONFIG_MACH_NETSTAR)             += board-netstar.o
 obj-$(CONFIG_MACH_OMAP_PALMTE)         += board-palmte.o
+obj-$(CONFIG_MACH_NOKIA770)            += board-nokia770.o
+obj-$(CONFIG_MACH_AMS_DELTA)           += board-ams-delta.o
 
 ifeq ($(CONFIG_ARCH_OMAP15XX),y)
 # Innovator-1510 FPGA
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
new file mode 100644 (file)
index 0000000..6178f04
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * linux/arch/arm/mach-omap1/board-ams-delta.c
+ *
+ * Modified from board-generic.c
+ *
+ * Board specific inits for the Amstrad E3 (codename Delta) videophone
+ *
+ * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <asm/arch/board-ams-delta.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/usb.h>
+#include <asm/arch/board.h>
+#include <asm/arch/common.h>
+
+static u8 ams_delta_latch1_reg;
+static u16 ams_delta_latch2_reg;
+
+void ams_delta_latch1_write(u8 mask, u8 value)
+{
+       ams_delta_latch1_reg &= ~mask;
+       ams_delta_latch1_reg |= value;
+       *(volatile __u8 *) AMS_DELTA_LATCH1_VIRT = ams_delta_latch1_reg;
+}
+
+void ams_delta_latch2_write(u16 mask, u16 value)
+{
+       ams_delta_latch2_reg &= ~mask;
+       ams_delta_latch2_reg |= value;
+       *(volatile __u16 *) AMS_DELTA_LATCH2_VIRT = ams_delta_latch2_reg;
+}
+
+static void __init ams_delta_init_irq(void)
+{
+       omap1_init_common_hw();
+       omap_init_irq();
+       omap_gpio_init();
+}
+
+static struct map_desc ams_delta_io_desc[] __initdata = {
+       // AMS_DELTA_LATCH1
+       {
+               .virtual        = AMS_DELTA_LATCH1_VIRT,
+               .pfn            = __phys_to_pfn(AMS_DELTA_LATCH1_PHYS),
+               .length         = 0x01000000,
+               .type           = MT_DEVICE
+       },
+       // AMS_DELTA_LATCH2
+       {
+               .virtual        = AMS_DELTA_LATCH2_VIRT,
+               .pfn            = __phys_to_pfn(AMS_DELTA_LATCH2_PHYS),
+               .length         = 0x01000000,
+               .type           = MT_DEVICE
+       },
+       // AMS_DELTA_MODEM
+       {
+               .virtual        = AMS_DELTA_MODEM_VIRT,
+               .pfn            = __phys_to_pfn(AMS_DELTA_MODEM_PHYS),
+               .length         = 0x01000000,
+               .type           = MT_DEVICE
+       }
+};
+
+static struct omap_uart_config ams_delta_uart_config __initdata = {
+       .enabled_uarts = 1,
+};
+
+static struct omap_board_config_kernel ams_delta_config[] = {
+       { OMAP_TAG_UART,        &ams_delta_uart_config },
+};
+
+static void __init ams_delta_init(void)
+{
+       iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc));
+
+       omap_board_config = ams_delta_config;
+       omap_board_config_size = ARRAY_SIZE(ams_delta_config);
+       omap_serial_init();
+
+       /* Clear latch2 (NAND, LCD, modem enable) */
+       ams_delta_latch2_write(~0, 0);
+}
+
+static void __init ams_delta_map_io(void)
+{
+       omap1_map_common_io();
+}
+
+MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
+       /* Maintainer: Jonathan McDowell <noodles@earth.li> */
+       .phys_io        = 0xfff00000,
+       .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
+       .boot_params    = 0x10000100,
+       .map_io         = ams_delta_map_io,
+       .init_irq       = ams_delta_init_irq,
+       .init_machine   = ams_delta_init,
+       .timer          = &omap_timer,
+MACHINE_END
+
+EXPORT_SYMBOL(ams_delta_latch1_write);
+EXPORT_SYMBOL(ams_delta_latch2_write);
index a177e78b2b878c141a034a6d3efa26aaca456bcd..33d01adab1ed6338c1608d33de4733304084aae7 100644 (file)
@@ -88,7 +88,7 @@ static struct omap_board_config_kernel generic_config[] = {
 static void __init omap_generic_init(void)
 {
 #ifdef CONFIG_ARCH_OMAP15XX
-       if (cpu_is_omap1510()) {
+       if (cpu_is_omap15xx()) {
                generic_config[0].data = &generic1510_usb_config;
        }
 #endif
index 89f0cc74a5197a28d521c7714750dcaf21a6f963..cd3a06dfc0a83d2e5f0d280c4ace0f49cef988c3 100644 (file)
@@ -24,7 +24,9 @@
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/input.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/tc.h>
+#include <asm/arch/irda.h>
 #include <asm/arch/usb.h>
+#include <asm/arch/keypad.h>
 #include <asm/arch/common.h>
+#include <asm/arch/mcbsp.h>
+#include <asm/arch/omap-alsa.h>
 
 extern int omap_gpio_init(void);
 
-static struct mtd_partition h2_partitions[] = {
+static int h2_keymap[] = {
+       KEY(0, 0, KEY_LEFT),
+       KEY(0, 1, KEY_RIGHT),
+       KEY(0, 2, KEY_3),
+       KEY(0, 3, KEY_F10),
+       KEY(0, 4, KEY_F5),
+       KEY(0, 5, KEY_9),
+       KEY(1, 0, KEY_DOWN),
+       KEY(1, 1, KEY_UP),
+       KEY(1, 2, KEY_2),
+       KEY(1, 3, KEY_F9),
+       KEY(1, 4, KEY_F7),
+       KEY(1, 5, KEY_0),
+       KEY(2, 0, KEY_ENTER),
+       KEY(2, 1, KEY_6),
+       KEY(2, 2, KEY_1),
+       KEY(2, 3, KEY_F2),
+       KEY(2, 4, KEY_F6),
+       KEY(2, 5, KEY_HOME),
+       KEY(3, 0, KEY_8),
+       KEY(3, 1, KEY_5),
+       KEY(3, 2, KEY_F12),
+       KEY(3, 3, KEY_F3),
+       KEY(3, 4, KEY_F8),
+       KEY(3, 5, KEY_END),
+       KEY(4, 0, KEY_7),
+       KEY(4, 1, KEY_4),
+       KEY(4, 2, KEY_F11),
+       KEY(4, 3, KEY_F1),
+       KEY(4, 4, KEY_F4),
+       KEY(4, 5, KEY_ESC),
+       KEY(5, 0, KEY_F13),
+       KEY(5, 1, KEY_F14),
+       KEY(5, 2, KEY_F15),
+       KEY(5, 3, KEY_F16),
+       KEY(5, 4, KEY_SLEEP),
+       0
+};
+
+static struct mtd_partition h2_nor_partitions[] = {
        /* bootloader (U-Boot, etc) in first sector */
        {
              .name             = "bootloader",
@@ -71,26 +116,26 @@ static struct mtd_partition h2_partitions[] = {
        }
 };
 
-static struct flash_platform_data h2_flash_data = {
+static struct flash_platform_data h2_nor_data = {
        .map_name       = "cfi_probe",
        .width          = 2,
-       .parts          = h2_partitions,
-       .nr_parts       = ARRAY_SIZE(h2_partitions),
+       .parts          = h2_nor_partitions,
+       .nr_parts       = ARRAY_SIZE(h2_nor_partitions),
 };
 
-static struct resource h2_flash_resource = {
+static struct resource h2_nor_resource = {
        /* This is on CS3, wherever it's mapped */
        .flags          = IORESOURCE_MEM,
 };
 
-static struct platform_device h2_flash_device = {
+static struct platform_device h2_nor_device = {
        .name           = "omapflash",
        .id             = 0,
        .dev            = {
-               .platform_data  = &h2_flash_data,
+               .platform_data  = &h2_nor_data,
        },
        .num_resources  = 1,
-       .resource       = &h2_flash_resource,
+       .resource       = &h2_nor_resource,
 };
 
 static struct resource h2_smc91x_resources[] = {
@@ -113,9 +158,119 @@ static struct platform_device h2_smc91x_device = {
        .resource       = h2_smc91x_resources,
 };
 
+static struct resource h2_kp_resources[] = {
+       [0] = {
+               .start  = INT_KEYBOARD,
+               .end    = INT_KEYBOARD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct omap_kp_platform_data h2_kp_data = {
+       .rows   = 8,
+       .cols   = 8,
+       .keymap = h2_keymap,
+       .rep    = 1,
+};
+
+static struct platform_device h2_kp_device = {
+       .name           = "omap-keypad",
+       .id             = -1,
+       .dev            = {
+               .platform_data = &h2_kp_data,
+       },
+       .num_resources  = ARRAY_SIZE(h2_kp_resources),
+       .resource       = h2_kp_resources,
+};
+
+#define H2_IRDA_FIRSEL_GPIO_PIN        17
+
+#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
+static int h2_transceiver_mode(struct device *dev, int state)
+{
+       if (state & IR_SIRMODE)
+               omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 0);
+       else    /* MIR/FIR */
+               omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 1);
+
+       return 0;
+}
+#endif
+
+static struct omap_irda_config h2_irda_data = {
+       .transceiver_cap        = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
+       .rx_channel             = OMAP_DMA_UART3_RX,
+       .tx_channel             = OMAP_DMA_UART3_TX,
+       .dest_start             = UART3_THR,
+       .src_start              = UART3_RHR,
+       .tx_trigger             = 0,
+       .rx_trigger             = 0,
+};
+
+static struct resource h2_irda_resources[] = {
+       [0] = {
+               .start  = INT_UART3,
+               .end    = INT_UART3,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+static struct platform_device h2_irda_device = {
+       .name           = "omapirda",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &h2_irda_data,
+       },
+       .num_resources  = ARRAY_SIZE(h2_irda_resources),
+       .resource       = h2_irda_resources,
+};
+
+static struct platform_device h2_lcd_device = {
+       .name           = "lcd_h2",
+       .id             = -1,
+};
+
+static struct omap_mcbsp_reg_cfg mcbsp_regs = {
+       .spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
+       .spcr1 = RINTM(3) | RRST,
+       .rcr2  = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
+                RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(1),
+       .rcr1  = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
+       .xcr2  = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
+                XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(1) | XFIG,
+       .xcr1  = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
+       .srgr1 = FWID(15),
+       .srgr2 = GSYNC | CLKSP | FSGM | FPER(31),
+
+       .pcr0  = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP,
+       //.pcr0 = CLKXP | CLKRP,        /* mcbsp: slave */
+};
+
+static struct omap_alsa_codec_config alsa_config = {
+       .name                   = "H2 TSC2101",
+       .mcbsp_regs_alsa        = &mcbsp_regs,
+       .codec_configure_dev    = NULL, // tsc2101_configure,
+       .codec_set_samplerate   = NULL, // tsc2101_set_samplerate,
+       .codec_clock_setup      = NULL, // tsc2101_clock_setup,
+       .codec_clock_on         = NULL, // tsc2101_clock_on,
+       .codec_clock_off        = NULL, // tsc2101_clock_off,
+       .get_default_samplerate = NULL, // tsc2101_get_default_samplerate,
+};
+
+static struct platform_device h2_mcbsp1_device = {
+       .name   = "omap_alsa_mcbsp",
+       .id     = 1,
+       .dev = {
+               .platform_data  = &alsa_config,
+       },
+};
+
 static struct platform_device *h2_devices[] __initdata = {
-       &h2_flash_device,
+       &h2_nor_device,
        &h2_smc91x_device,
+       &h2_irda_device,
+       &h2_kp_device,
+       &h2_lcd_device,
+       &h2_mcbsp1_device,
 };
 
 static void __init h2_init_smc91x(void)
@@ -164,7 +319,6 @@ static struct omap_uart_config h2_uart_config __initdata = {
 };
 
 static struct omap_lcd_config h2_lcd_config __initdata = {
-       .panel_name     = "h2",
        .ctrl_name      = "internal",
 };
 
@@ -177,16 +331,34 @@ static struct omap_board_config_kernel h2_config[] = {
 
 static void __init h2_init(void)
 {
-       /* NOTE: revC boards support NAND-boot, which can put NOR on CS2B
-        * and NAND (either 16bit or 8bit) on CS3.
+       /* Here we assume the NOR boot config:  NOR on CS3 (possibly swapped
+        * to address 0 by a dip switch), NAND on CS2B.  The NAND driver will
+        * notice whether a NAND chip is enabled at probe time.
+        *
+        * FIXME revC boards (and H3) support NAND-boot, with a dip switch to
+        * put NOR on CS2B and NAND (which on H2 may be 16bit) on CS3.  Try
+        * detecting that in code here, to avoid probing every possible flash
+        * configuration...
         */
-       h2_flash_resource.end = h2_flash_resource.start = omap_cs3_phys();
-       h2_flash_resource.end += SZ_32M - 1;
+       h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys();
+       h2_nor_resource.end += SZ_32M - 1;
+
+       omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
+       omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
 
        /* MMC:  card detect and WP */
        // omap_cfg_reg(U19_ARMIO1);            /* CD */
        omap_cfg_reg(BALLOUT_V8_ARMIO3);        /* WP */
 
+       /* Irda */
+#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
+       omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
+       if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) {
+               omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0);
+               h2_irda_data.transceiver_mode = h2_transceiver_mode;
+       }
+#endif
+
        platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
        omap_board_config = h2_config;
        omap_board_config_size = ARRAY_SIZE(h2_config);
index d9f3862659967e4322c7edbe1e9172e0ed10c564..4b8d0ec73cb76621f55add6719fc999c02a19b8e 100644 (file)
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/errno.h>
+#include <linux/workqueue.h>
 #include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/input.h>
 
 #include <asm/setup.h>
 #include <asm/page.h>
 #include <asm/mach/map.h>
 
 #include <asm/arch/gpio.h>
+#include <asm/arch/gpioexpander.h>
 #include <asm/arch/irqs.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/tc.h>
+#include <asm/arch/irda.h>
 #include <asm/arch/usb.h>
+#include <asm/arch/keypad.h>
+#include <asm/arch/dma.h>
 #include <asm/arch/common.h>
 
 extern int omap_gpio_init(void);
 
-static struct mtd_partition h3_partitions[] = {
+static int h3_keymap[] = {
+       KEY(0, 0, KEY_LEFT),
+       KEY(0, 1, KEY_RIGHT),
+       KEY(0, 2, KEY_3),
+       KEY(0, 3, KEY_F10),
+       KEY(0, 4, KEY_F5),
+       KEY(0, 5, KEY_9),
+       KEY(1, 0, KEY_DOWN),
+       KEY(1, 1, KEY_UP),
+       KEY(1, 2, KEY_2),
+       KEY(1, 3, KEY_F9),
+       KEY(1, 4, KEY_F7),
+       KEY(1, 5, KEY_0),
+       KEY(2, 0, KEY_ENTER),
+       KEY(2, 1, KEY_6),
+       KEY(2, 2, KEY_1),
+       KEY(2, 3, KEY_F2),
+       KEY(2, 4, KEY_F6),
+       KEY(2, 5, KEY_HOME),
+       KEY(3, 0, KEY_8),
+       KEY(3, 1, KEY_5),
+       KEY(3, 2, KEY_F12),
+       KEY(3, 3, KEY_F3),
+       KEY(3, 4, KEY_F8),
+       KEY(3, 5, KEY_END),
+       KEY(4, 0, KEY_7),
+       KEY(4, 1, KEY_4),
+       KEY(4, 2, KEY_F11),
+       KEY(4, 3, KEY_F1),
+       KEY(4, 4, KEY_F4),
+       KEY(4, 5, KEY_ESC),
+       KEY(5, 0, KEY_F13),
+       KEY(5, 1, KEY_F14),
+       KEY(5, 2, KEY_F15),
+       KEY(5, 3, KEY_F16),
+       KEY(5, 4, KEY_SLEEP),
+       0
+};
+
+
+static struct mtd_partition nor_partitions[] = {
        /* bootloader (U-Boot, etc) in first sector */
        {
              .name             = "bootloader",
@@ -72,26 +119,80 @@ static struct mtd_partition h3_partitions[] = {
        }
 };
 
-static struct flash_platform_data h3_flash_data = {
+static struct flash_platform_data nor_data = {
        .map_name       = "cfi_probe",
        .width          = 2,
-       .parts          = h3_partitions,
-       .nr_parts       = ARRAY_SIZE(h3_partitions),
+       .parts          = nor_partitions,
+       .nr_parts       = ARRAY_SIZE(nor_partitions),
 };
 
-static struct resource h3_flash_resource = {
+static struct resource nor_resource = {
        /* This is on CS3, wherever it's mapped */
        .flags          = IORESOURCE_MEM,
 };
 
-static struct platform_device flash_device = {
+static struct platform_device nor_device = {
        .name           = "omapflash",
        .id             = 0,
        .dev            = {
-               .platform_data  = &h3_flash_data,
+               .platform_data  = &nor_data,
+       },
+       .num_resources  = 1,
+       .resource       = &nor_resource,
+};
+
+static struct mtd_partition nand_partitions[] = {
+#if 0
+       /* REVISIT: enable these partitions if you make NAND BOOT work */
+       {
+               .name           = "xloader",
+               .offset         = 0,
+               .size           = 64 * 1024,
+               .mask_flags     = MTD_WRITEABLE,        /* force read-only */
+       },
+       {
+               .name           = "bootloader",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 256 * 1024,
+               .mask_flags     = MTD_WRITEABLE,        /* force read-only */
+       },
+       {
+               .name           = "params",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 192 * 1024,
+       },
+       {
+               .name           = "kernel",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 2 * SZ_1M,
+       },
+#endif
+       {
+               .name           = "filesystem",
+               .size           = MTDPART_SIZ_FULL,
+               .offset         = MTDPART_OFS_APPEND,
+       },
+};
+
+/* dip switches control NAND chip access:  8 bit, 16 bit, or neither */
+static struct nand_platform_data nand_data = {
+       .options        = NAND_SAMSUNG_LP_OPTIONS,
+       .parts          = nand_partitions,
+       .nr_parts       = ARRAY_SIZE(nand_partitions),
+};
+
+static struct resource nand_resource = {
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device nand_device = {
+       .name           = "omapnand",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &nand_data,
        },
        .num_resources  = 1,
-       .resource       = &h3_flash_resource,
+       .resource       = &nand_resource,
 };
 
 static struct resource smc91x_resources[] = {
@@ -138,10 +239,136 @@ static struct platform_device intlat_device = {
        .resource       = intlat_resources,
 };
 
+static struct resource h3_kp_resources[] = {
+       [0] = {
+               .start  = INT_KEYBOARD,
+               .end    = INT_KEYBOARD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct omap_kp_platform_data h3_kp_data = {
+       .rows   = 8,
+       .cols   = 8,
+       .keymap = h3_keymap,
+       .rep    = 1,
+};
+
+static struct platform_device h3_kp_device = {
+       .name           = "omap-keypad",
+       .id             = -1,
+       .dev            = {
+               .platform_data = &h3_kp_data,
+       },
+       .num_resources  = ARRAY_SIZE(h3_kp_resources),
+       .resource       = h3_kp_resources,
+};
+
+
+/* Select between the IrDA and aGPS module
+ */
+static int h3_select_irda(struct device *dev, int state)
+{
+       unsigned char expa;
+       int err = 0;
+
+       if ((err = read_gpio_expa(&expa, 0x26))) {
+               printk(KERN_ERR "Error reading from I/O EXPANDER \n");
+               return err;
+       }
+
+       /* 'P6' enable/disable IRDA_TX and IRDA_RX */
+       if (state & IR_SEL) { /* IrDA */
+               if ((err = write_gpio_expa(expa | 0x40, 0x26))) {
+                       printk(KERN_ERR "Error writing to I/O EXPANDER \n");
+                       return err;
+               }
+       } else {
+               if ((err = write_gpio_expa(expa & ~0x40, 0x26))) {
+                       printk(KERN_ERR "Error writing to I/O EXPANDER \n");
+                       return err;
+               }
+       }
+       return err;
+}
+
+static void set_trans_mode(void *data)
+{
+       int *mode = data;
+       unsigned char expa;
+       int err = 0;
+
+       if ((err = read_gpio_expa(&expa, 0x27)) != 0) {
+               printk(KERN_ERR "Error reading from I/O expander\n");
+       }
+
+       expa &= ~0x03;
+
+       if (*mode & IR_SIRMODE) {
+               expa |= 0x01;
+       } else { /* MIR/FIR */
+               expa |= 0x03;
+       }
+
+       if ((err = write_gpio_expa(expa, 0x27)) != 0) {
+               printk(KERN_ERR "Error writing to I/O expander\n");
+       }
+}
+
+static int h3_transceiver_mode(struct device *dev, int mode)
+{
+       struct omap_irda_config *irda_config = dev->platform_data;
+
+       cancel_delayed_work(&irda_config->gpio_expa);
+       PREPARE_WORK(&irda_config->gpio_expa, set_trans_mode, &mode);
+       schedule_work(&irda_config->gpio_expa);
+
+       return 0;
+}
+
+static struct omap_irda_config h3_irda_data = {
+       .transceiver_cap        = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
+       .transceiver_mode       = h3_transceiver_mode,
+       .select_irda            = h3_select_irda,
+       .rx_channel             = OMAP_DMA_UART3_RX,
+       .tx_channel             = OMAP_DMA_UART3_TX,
+       .dest_start             = UART3_THR,
+       .src_start              = UART3_RHR,
+       .tx_trigger             = 0,
+       .rx_trigger             = 0,
+};
+
+static struct resource h3_irda_resources[] = {
+       [0] = {
+               .start  = INT_UART3,
+               .end    = INT_UART3,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device h3_irda_device = {
+       .name           = "omapirda",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &h3_irda_data,
+       },
+       .num_resources  = ARRAY_SIZE(h3_irda_resources),
+       .resource       = h3_irda_resources,
+};
+
+static struct platform_device h3_lcd_device = {
+       .name           = "lcd_h3",
+       .id             = -1,
+};
+
 static struct platform_device *devices[] __initdata = {
-       &flash_device,
+       &nor_device,
+       &nand_device,
         &smc91x_device,
        &intlat_device,
+       &h3_irda_device,
+       &h3_kp_device,
+       &h3_lcd_device,
 };
 
 static struct omap_usb_config h3_usb_config __initdata = {
@@ -171,7 +398,6 @@ static struct omap_uart_config h3_uart_config __initdata = {
 };
 
 static struct omap_lcd_config h3_lcd_config __initdata = {
-       .panel_name     = "h3",
        .ctrl_name      = "internal",
 };
 
@@ -182,11 +408,36 @@ static struct omap_board_config_kernel h3_config[] = {
        { OMAP_TAG_LCD,         &h3_lcd_config },
 };
 
+#define H3_NAND_RB_GPIO_PIN    10
+
+static int nand_dev_ready(struct nand_platform_data *data)
+{
+       return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN);
+}
+
 static void __init h3_init(void)
 {
-       h3_flash_resource.end = h3_flash_resource.start = omap_cs3_phys();
-       h3_flash_resource.end += OMAP_CS3_SIZE - 1;
-       (void) platform_add_devices(devices, ARRAY_SIZE(devices));
+       /* Here we assume the NOR boot config:  NOR on CS3 (possibly swapped
+        * to address 0 by a dip switch), NAND on CS2B.  The NAND driver will
+        * notice whether a NAND chip is enabled at probe time.
+        *
+        * H3 support NAND-boot, with a dip switch to put NOR on CS2B and NAND
+        * (which on H2 may be 16bit) on CS3.  Try detecting that in code here,
+        * to avoid probing every possible flash configuration...
+        */
+       nor_resource.end = nor_resource.start = omap_cs3_phys();
+       nor_resource.end += SZ_32M - 1;
+
+       nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS;
+       nand_resource.end += SZ_4K - 1;
+       if (!(omap_request_gpio(H3_NAND_RB_GPIO_PIN)))
+               nand_data.dev_ready = nand_dev_ready;
+
+       /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */
+       /* GPIO10 pullup/down register, Enable pullup on GPIO10 */
+       omap_cfg_reg(V2_1710_GPIO10);
+
+       platform_add_devices(devices, ARRAY_SIZE(devices));
        omap_board_config = h3_config;
        omap_board_config_size = ARRAY_SIZE(h3_config);
        omap_serial_init();
index a04e4332915e63810f5ae9e85613b2e5a69f8777..e90c137a4cf315cbf70ec3959d74090d4554643e 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/delay.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/input.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/tc.h>
 #include <asm/arch/usb.h>
+#include <asm/arch/keypad.h>
 #include <asm/arch/common.h>
 
+static int innovator_keymap[] = {
+       KEY(0, 0, KEY_F1),
+       KEY(0, 3, KEY_DOWN),
+       KEY(1, 1, KEY_F2),
+       KEY(1, 2, KEY_RIGHT),
+       KEY(2, 0, KEY_F3),
+       KEY(2, 1, KEY_F4),
+       KEY(2, 2, KEY_UP),
+       KEY(3, 2, KEY_ENTER),
+       KEY(3, 3, KEY_LEFT),
+       0
+};
+
 static struct mtd_partition innovator_partitions[] = {
        /* bootloader (U-Boot, etc) in first sector */
        {
@@ -97,6 +112,31 @@ static struct platform_device innovator_flash_device = {
        .resource       = &innovator_flash_resource,
 };
 
+static struct resource innovator_kp_resources[] = {
+       [0] = {
+               .start  = INT_KEYBOARD,
+               .end    = INT_KEYBOARD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct omap_kp_platform_data innovator_kp_data = {
+       .rows   = 8,
+       .cols   = 8,
+       .keymap = innovator_keymap,
+};
+
+static struct platform_device innovator_kp_device = {
+       .name           = "omap-keypad",
+       .id             = -1,
+       .dev            = {
+               .platform_data = &innovator_kp_data,
+       },
+       .num_resources  = ARRAY_SIZE(innovator_kp_resources),
+       .resource       = innovator_kp_resources,
+};
+
+
 #ifdef CONFIG_ARCH_OMAP15XX
 
 /* Only FPGA needs to be mapped here. All others are done with ioremap */
@@ -129,9 +169,16 @@ static struct platform_device innovator1510_smc91x_device = {
        .resource       = innovator1510_smc91x_resources,
 };
 
+static struct platform_device innovator1510_lcd_device = {
+       .name           = "lcd_inn1510",
+       .id             = -1,
+};
+
 static struct platform_device *innovator1510_devices[] __initdata = {
        &innovator_flash_device,
        &innovator1510_smc91x_device,
+       &innovator_kp_device,
+       &innovator1510_lcd_device,
 };
 
 #endif /* CONFIG_ARCH_OMAP15XX */
@@ -158,9 +205,16 @@ static struct platform_device innovator1610_smc91x_device = {
        .resource       = innovator1610_smc91x_resources,
 };
 
+static struct platform_device innovator1610_lcd_device = {
+       .name           = "inn1610_lcd",
+       .id             = -1,
+};
+
 static struct platform_device *innovator1610_devices[] __initdata = {
        &innovator_flash_device,
        &innovator1610_smc91x_device,
+       &innovator_kp_device,
+       &innovator1610_lcd_device,
 };
 
 #endif /* CONFIG_ARCH_OMAP16XX */
@@ -206,7 +260,6 @@ static struct omap_usb_config innovator1510_usb_config __initdata = {
 };
 
 static struct omap_lcd_config innovator1510_lcd_config __initdata = {
-       .panel_name     = "inn1510",
        .ctrl_name      = "internal",
 };
 #endif
@@ -228,7 +281,6 @@ static struct omap_usb_config h2_usb_config __initdata = {
 };
 
 static struct omap_lcd_config innovator1610_lcd_config __initdata = {
-       .panel_name     = "inn1610",
        .ctrl_name      = "internal",
 };
 #endif
diff --git a/arch/arm/mach-omap1/board-netstar.c b/arch/arm/mach-omap1/board-netstar.c
deleted file mode 100644 (file)
index 7520e60..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Modified from board-generic.c
- *
- * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
- *
- * Code for Netstar OMAP board.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/delay.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-
-#include <asm/hardware.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <asm/arch/gpio.h>
-#include <asm/arch/mux.h>
-#include <asm/arch/usb.h>
-#include <asm/arch/common.h>
-
-extern void __init omap_init_time(void);
-extern int omap_gpio_init(void);
-
-static struct resource netstar_smc91x_resources[] = {
-       [0] = {
-               .start  = OMAP_CS1_PHYS + 0x300,
-               .end    = OMAP_CS1_PHYS + 0x300 + 16,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = OMAP_GPIO_IRQ(8),
-               .end    = OMAP_GPIO_IRQ(8),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device netstar_smc91x_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(netstar_smc91x_resources),
-       .resource       = netstar_smc91x_resources,
-};
-
-static struct platform_device *netstar_devices[] __initdata = {
-       &netstar_smc91x_device,
-};
-
-static struct omap_uart_config netstar_uart_config __initdata = {
-       .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
-};
-
-static struct omap_board_config_kernel netstar_config[] = {
-       { OMAP_TAG_UART,        &netstar_uart_config },
-};
-
-static void __init netstar_init_irq(void)
-{
-       omap1_init_common_hw();
-       omap_init_irq();
-       omap_gpio_init();
-}
-
-static void __init netstar_init(void)
-{
-       /* green LED */
-       omap_request_gpio(4);
-       omap_set_gpio_direction(4, 0);
-       /* smc91x reset */
-       omap_request_gpio(7);
-       omap_set_gpio_direction(7, 0);
-       omap_set_gpio_dataout(7, 1);
-       udelay(2);      /* wait at least 100ns */
-       omap_set_gpio_dataout(7, 0);
-       mdelay(50);     /* 50ms until PHY ready */
-       /* smc91x interrupt pin */
-       omap_request_gpio(8);
-
-       omap_request_gpio(12);
-       omap_request_gpio(13);
-       omap_request_gpio(14);
-       omap_request_gpio(15);
-       set_irq_type(OMAP_GPIO_IRQ(12), IRQT_FALLING);
-       set_irq_type(OMAP_GPIO_IRQ(13), IRQT_FALLING);
-       set_irq_type(OMAP_GPIO_IRQ(14), IRQT_FALLING);
-       set_irq_type(OMAP_GPIO_IRQ(15), IRQT_FALLING);
-
-       platform_add_devices(netstar_devices, ARRAY_SIZE(netstar_devices));
-
-       /* Switch on green LED */
-       omap_set_gpio_dataout(4, 0);
-       /* Switch off red LED */
-       omap_writeb(0x00, OMAP_LPG1_PMR);       /* Disable clock */
-       omap_writeb(0x80, OMAP_LPG1_LCR);
-
-       omap_board_config = netstar_config;
-       omap_board_config_size = ARRAY_SIZE(netstar_config);
-       omap_serial_init();
-}
-
-static void __init netstar_map_io(void)
-{
-       omap1_map_common_io();
-}
-
-#define MACHINE_PANICED                1
-#define MACHINE_REBOOTING      2
-#define MACHINE_REBOOT         4
-static unsigned long machine_state;
-
-static int panic_event(struct notifier_block *this, unsigned long event,
-        void *ptr)
-{
-       if (test_and_set_bit(MACHINE_PANICED, &machine_state))
-               return NOTIFY_DONE;
-
-       /* Switch off green LED */
-       omap_set_gpio_dataout(4, 1);
-       /* Flash red LED */
-       omap_writeb(0x78, OMAP_LPG1_LCR);
-       omap_writeb(0x01, OMAP_LPG1_PMR);       /* Enable clock */
-
-       return NOTIFY_DONE;
-}
-
-static struct notifier_block panic_block = {
-       .notifier_call  = panic_event,
-};
-
-static int __init netstar_late_init(void)
-{
-       /* TODO: Setup front panel switch here */
-
-       /* Setup panic notifier */
-       atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
-
-       return 0;
-}
-
-postcore_initcall(netstar_late_init);
-
-MACHINE_START(NETSTAR, "NetStar OMAP5910")
-       /* Maintainer: Ladislav Michl <michl@2n.cz> */
-       .phys_io        = 0xfff00000,
-       .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
-       .boot_params    = 0x10000100,
-       .map_io         = netstar_map_io,
-       .init_irq       = netstar_init_irq,
-       .init_machine   = netstar_init,
-       .timer          = &omap_timer,
-MACHINE_END
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
new file mode 100644 (file)
index 0000000..02b980d
--- /dev/null
@@ -0,0 +1,268 @@
+/*
+ * linux/arch/arm/mach-omap1/board-nokia770.c
+ *
+ * Modified from board-generic.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/input.h>
+#include <linux/clk.h>
+
+#include <linux/spi/spi.h>
+#include <linux/spi/ads7846.h>
+
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <asm/arch/gpio.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/usb.h>
+#include <asm/arch/board.h>
+#include <asm/arch/keypad.h>
+#include <asm/arch/common.h>
+#include <asm/arch/dsp_common.h>
+#include <asm/arch/aic23.h>
+#include <asm/arch/gpio.h>
+
+static void __init omap_nokia770_init_irq(void)
+{
+       /* On Nokia 770, the SleepX signal is masked with an
+        * MPUIO line by default.  It has to be unmasked for it
+        * to become functional */
+
+       /* SleepX mask direction */
+       omap_writew((omap_readw(0xfffb5008) & ~2), 0xfffb5008);
+       /* Unmask SleepX signal */
+       omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);
+
+       omap1_init_common_hw();
+       omap_init_irq();
+}
+
+static int nokia770_keymap[] = {
+       KEY(0, 1, GROUP_0 | KEY_UP),
+       KEY(0, 2, GROUP_1 | KEY_F5),
+       KEY(1, 0, GROUP_0 | KEY_LEFT),
+       KEY(1, 1, GROUP_0 | KEY_ENTER),
+       KEY(1, 2, GROUP_0 | KEY_RIGHT),
+       KEY(2, 0, GROUP_1 | KEY_ESC),
+       KEY(2, 1, GROUP_0 | KEY_DOWN),
+       KEY(2, 2, GROUP_1 | KEY_F4),
+       KEY(3, 0, GROUP_2 | KEY_F7),
+       KEY(3, 1, GROUP_2 | KEY_F8),
+       KEY(3, 2, GROUP_2 | KEY_F6),
+       0
+};
+
+static struct resource nokia770_kp_resources[] = {
+       [0] = {
+               .start  = INT_KEYBOARD,
+               .end    = INT_KEYBOARD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct omap_kp_platform_data nokia770_kp_data = {
+       .rows   = 8,
+       .cols   = 8,
+       .keymap = nokia770_keymap
+};
+
+static struct platform_device nokia770_kp_device = {
+       .name           = "omap-keypad",
+       .id             = -1,
+       .dev            = {
+               .platform_data = &nokia770_kp_data,
+       },
+       .num_resources  = ARRAY_SIZE(nokia770_kp_resources),
+       .resource       = nokia770_kp_resources,
+};
+
+static struct platform_device *nokia770_devices[] __initdata = {
+        &nokia770_kp_device,
+};
+
+static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {
+       .x_max          = 0x0fff,
+       .y_max          = 0x0fff,
+       .x_plate_ohms   = 180,
+       .pressure_max   = 255,
+       .debounce_max   = 10,
+       .debounce_tol   = 3,
+};
+
+static struct spi_board_info nokia770_spi_board_info[] __initdata = {
+       [0] = {
+               .modalias       = "lcd_lph8923",
+               .bus_num        = 2,
+               .chip_select    = 3,
+               .max_speed_hz   = 12000000,
+       },
+       [1] = {
+               .modalias       = "ads7846",
+               .bus_num        = 2,
+               .chip_select    = 0,
+               .max_speed_hz   = 2500000,
+               .irq            = OMAP_GPIO_IRQ(15),
+               .platform_data  = &nokia770_ads7846_platform_data,
+       },
+};
+
+
+/* assume no Mini-AB port */
+
+static struct omap_usb_config nokia770_usb_config __initdata = {
+       .otg            = 1,
+       .register_host  = 1,
+       .register_dev   = 1,
+       .hmc_mode       = 16,
+       .pins[0]        = 6,
+};
+
+static struct omap_mmc_config nokia770_mmc_config __initdata = {
+       .mmc[0] = {
+               .enabled        = 0,
+               .wire4          = 0,
+               .wp_pin         = -1,
+               .power_pin      = -1,
+               .switch_pin     = -1,
+       },
+       .mmc[1] = {
+               .enabled        = 0,
+               .wire4          = 0,
+               .wp_pin         = -1,
+               .power_pin      = -1,
+               .switch_pin     = -1,
+       },
+};
+
+static struct omap_board_config_kernel nokia770_config[] = {
+       { OMAP_TAG_USB,         NULL },
+       { OMAP_TAG_MMC,         &nokia770_mmc_config },
+};
+
+/*
+ * audio power control
+ */
+#define        HEADPHONE_GPIO          14
+#define        AMPLIFIER_CTRL_GPIO     58
+
+static struct clk *dspxor_ck;
+static DECLARE_MUTEX(audio_pwr_sem);
+/*
+ * audio_pwr_state
+ * +--+-------------------------+---------------------------------------+
+ * |-1|down                    |power-up request -> 0                  |
+ * +--+-------------------------+---------------------------------------+
+ * | 0|up                      |power-down(1) request -> 1             |
+ * |  |                                |power-down(2) request -> (ignore)      |
+ * +--+-------------------------+---------------------------------------+
+ * | 1|up,                     |power-up request -> 0                  |
+ * |  |received down(1) request        |power-down(2) request -> -1            |
+ * +--+-------------------------+---------------------------------------+
+ */
+static int audio_pwr_state = -1;
+
+/*
+ * audio_pwr_up / down should be called under audio_pwr_sem
+ */
+static void nokia770_audio_pwr_up(void)
+{
+       clk_enable(dspxor_ck);
+
+       /* Turn on codec */
+       tlv320aic23_power_up();
+
+       if (omap_get_gpio_datain(HEADPHONE_GPIO))
+               /* HP not connected, turn on amplifier */
+               omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 1);
+       else
+               /* HP connected, do not turn on amplifier */
+               printk("HP connected\n");
+}
+
+static void codec_delayed_power_down(void *arg)
+{
+       down(&audio_pwr_sem);
+       if (audio_pwr_state == -1)
+               tlv320aic23_power_down();
+       clk_disable(dspxor_ck);
+       up(&audio_pwr_sem);
+}
+
+static DECLARE_WORK(codec_power_down_work, codec_delayed_power_down, NULL);
+
+static void nokia770_audio_pwr_down(void)
+{
+       /* Turn off amplifier */
+       omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 0);
+
+       /* Turn off codec: schedule delayed work */
+       schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */
+}
+
+void nokia770_audio_pwr_up_request(int stage)
+{
+       down(&audio_pwr_sem);
+       if (audio_pwr_state == -1)
+               nokia770_audio_pwr_up();
+       /* force audio_pwr_state = 0, even if it was 1. */
+       audio_pwr_state = 0;
+       up(&audio_pwr_sem);
+}
+
+void nokia770_audio_pwr_down_request(int stage)
+{
+       down(&audio_pwr_sem);
+       switch (stage) {
+       case 1:
+               if (audio_pwr_state == 0)
+                       audio_pwr_state = 1;
+               break;
+       case 2:
+               if (audio_pwr_state == 1) {
+                       nokia770_audio_pwr_down();
+                       audio_pwr_state = -1;
+               }
+               break;
+       }
+       up(&audio_pwr_sem);
+}
+
+static void __init omap_nokia770_init(void)
+{
+       nokia770_config[0].data = &nokia770_usb_config;
+
+       platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
+       spi_register_board_info(nokia770_spi_board_info,
+                               ARRAY_SIZE(nokia770_spi_board_info));
+       omap_board_config = nokia770_config;
+       omap_board_config_size = ARRAY_SIZE(nokia770_config);
+       omap_serial_init();
+       omap_dsp_audio_pwr_up_request = nokia770_audio_pwr_up_request;
+       omap_dsp_audio_pwr_down_request = nokia770_audio_pwr_down_request;
+       dspxor_ck = clk_get(0, "dspxor_ck");
+}
+
+static void __init omap_nokia770_map_io(void)
+{
+       omap1_map_common_io();
+}
+
+MACHINE_START(NOKIA770, "Nokia 770")
+       .phys_io        = 0xfff00000,
+       .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
+       .boot_params    = 0x10000100,
+       .map_io         = omap_nokia770_map_io,
+       .init_irq       = omap_nokia770_init_irq,
+       .init_machine   = omap_nokia770_init,
+       .timer          = &omap_timer,
+MACHINE_END
index 543fa136106d8bfacac4d2b495f6410720318850..1160093e8ef6720dfd58d6c531ed0a447f101c36 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/input.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/arch/usb.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/tc.h>
+#include <asm/arch/keypad.h>
 #include <asm/arch/common.h>
+#include <asm/arch/mcbsp.h>
+#include <asm/arch/omap-alsa.h>
+
+static int osk_keymap[] = {
+       KEY(0, 0, KEY_F1),
+       KEY(0, 3, KEY_UP),
+       KEY(1, 1, KEY_LEFTCTRL),
+       KEY(1, 2, KEY_LEFT),
+       KEY(2, 0, KEY_SPACE),
+       KEY(2, 1, KEY_ESC),
+       KEY(2, 2, KEY_DOWN),
+       KEY(3, 2, KEY_ENTER),
+       KEY(3, 3, KEY_RIGHT),
+       0
+};
+
 
 static struct mtd_partition osk_partitions[] = {
        /* bootloader (U-Boot, etc) in first sector */
@@ -133,9 +151,69 @@ static struct platform_device osk5912_cf_device = {
        .resource       = osk5912_cf_resources,
 };