]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'misc' into devel
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 31 Jul 2010 13:20:02 +0000 (14:20 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 31 Jul 2010 13:20:02 +0000 (14:20 +0100)
Conflicts:
arch/arm/mm/init.c

528 files changed:
Documentation/00-INDEX
Documentation/bus-virt-phys-mapping.txt [moved from Documentation/IO-mapping.txt with 100% similarity]
Documentation/feature-removal-schedule.txt
Documentation/kernel-parameters.txt
MAINTAINERS
Makefile
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/boot/compressed/Makefile
arch/arm/boot/compressed/head-l7200.S [deleted file]
arch/arm/common/gic.c
arch/arm/common/sa1111.c
arch/arm/configs/lusl7200_defconfig [deleted file]
arch/arm/include/asm/kexec.h
arch/arm/include/asm/mach/arch.h
arch/arm/include/asm/memblock.h [new file with mode: 0644]
arch/arm/include/asm/memory.h
arch/arm/include/asm/mmzone.h [deleted file]
arch/arm/include/asm/setup.h
arch/arm/kernel/Makefile
arch/arm/kernel/crash_dump.c [new file with mode: 0644]
arch/arm/kernel/machine_kexec.c
arch/arm/kernel/relocate_kernel.S
arch/arm/kernel/setup.c
arch/arm/lib/Makefile
arch/arm/mach-aaec2000/include/mach/memory.h
arch/arm/mach-at91/Kconfig
arch/arm/mach-at91/Makefile
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
arch/arm/mach-at91/board-sam9g20ek.c
arch/arm/mach-at91/board-snapper9260.c [new file with mode: 0644]
arch/arm/mach-at91/include/mach/at91cap9.h
arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h
arch/arm/mach-at91/include/mach/at91sam9260.h
arch/arm/mach-at91/include/mach/at91sam9261.h
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h [new file with mode: 0644]
arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
arch/arm/mach-at91/include/mach/at91sam9rl.h
arch/arm/mach-at91/include/mach/board.h
arch/arm/mach-at91/include/mach/cpu.h
arch/arm/mach-at91/include/mach/gpio.h
arch/arm/mach-at91/pm.h
arch/arm/mach-at91/pm_slowclock.S
arch/arm/mach-bcmring/core.c
arch/arm/mach-clps711x/Kconfig
arch/arm/mach-clps711x/clep7312.c
arch/arm/mach-clps711x/edb7211-arch.c
arch/arm/mach-clps711x/fortunet.c
arch/arm/mach-clps711x/include/mach/debug-macro.S
arch/arm/mach-clps711x/include/mach/memory.h
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-davinci/include/mach/memory.h
arch/arm/mach-ep93xx/adssphere.c
arch/arm/mach-ep93xx/clock.c
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/edb93xx.c
arch/arm/mach-ep93xx/gesbc9312.c
arch/arm/mach-ep93xx/include/mach/platform.h
arch/arm/mach-ep93xx/micro9.c
arch/arm/mach-ep93xx/simone.c
arch/arm/mach-ep93xx/ts72xx.c
arch/arm/mach-footbridge/common.c
arch/arm/mach-h720x/include/mach/debug-macro.S
arch/arm/mach-integrator/common.h [new file with mode: 0644]
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-iop13xx/include/mach/memory.h
arch/arm/mach-ixp4xx/common-pci.c
arch/arm/mach-ixp4xx/include/mach/memory.h
arch/arm/mach-kirkwood/tsx1x-common.c
arch/arm/mach-kirkwood/tsx1x-common.h
arch/arm/mach-l7200/Makefile [deleted file]
arch/arm/mach-l7200/Makefile.boot [deleted file]
arch/arm/mach-l7200/core.c [deleted file]
arch/arm/mach-l7200/include/mach/aux_reg.h [deleted file]
arch/arm/mach-l7200/include/mach/debug-macro.S [deleted file]
arch/arm/mach-l7200/include/mach/entry-macro.S [deleted file]
arch/arm/mach-l7200/include/mach/gp_timers.h [deleted file]
arch/arm/mach-l7200/include/mach/gpio.h [deleted file]
arch/arm/mach-l7200/include/mach/hardware.h [deleted file]
arch/arm/mach-l7200/include/mach/io.h [deleted file]
arch/arm/mach-l7200/include/mach/irqs.h [deleted file]
arch/arm/mach-l7200/include/mach/memory.h [deleted file]
arch/arm/mach-l7200/include/mach/pmpcon.h [deleted file]
arch/arm/mach-l7200/include/mach/pmu.h [deleted file]
arch/arm/mach-l7200/include/mach/serial.h [deleted file]
arch/arm/mach-l7200/include/mach/serial_l7200.h [deleted file]
arch/arm/mach-l7200/include/mach/sib.h [deleted file]
arch/arm/mach-l7200/include/mach/sys-clock.h [deleted file]
arch/arm/mach-l7200/include/mach/system.h [deleted file]
arch/arm/mach-l7200/include/mach/time.h [deleted file]
arch/arm/mach-l7200/include/mach/timex.h [deleted file]
arch/arm/mach-l7200/include/mach/uncompress.h [deleted file]
arch/arm/mach-l7200/include/mach/vmalloc.h [deleted file]
arch/arm/mach-lh7a40x/include/mach/memory.h
arch/arm/mach-msm/board-trout.c
arch/arm/mach-nomadik/clock.c
arch/arm/mach-ns9xxx/include/mach/debug-macro.S
arch/arm/mach-ns9xxx/include/mach/uncompress.h
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-fsample.c
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-htcherald.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-nokia770.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-palmtt.c
arch/arm/mach-omap1/board-palmz71.c
arch/arm/mach-omap1/board-perseus2.c
arch/arm/mach-omap1/board-sx1.c
arch/arm/mach-omap1/board-voiceblue.c
arch/arm/mach-omap1/io.c
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-3630sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-am3517evm.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-n8x0.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3pandora.c
arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-rx51-peripherals.c
arch/arm/mach-omap2/board-rx51.c
arch/arm/mach-omap2/board-zoom2.c
arch/arm/mach-omap2/board-zoom3.c
arch/arm/mach-omap2/clock3xxx_data.c
arch/arm/mach-omap2/io.c
arch/arm/mach-pxa/cm-x2xx-pci.c
arch/arm/mach-pxa/colibri-pxa300.c
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/cpufreq-pxa2xx.c
arch/arm/mach-pxa/eseries.c
arch/arm/mach-pxa/generic.h
arch/arm/mach-pxa/include/mach/memory.h
arch/arm/mach-pxa/palmt5.c
arch/arm/mach-pxa/palmtreo.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-realview/core.c
arch/arm/mach-realview/include/mach/board-pb1176.h
arch/arm/mach-realview/include/mach/irqs-pb1176.h
arch/arm/mach-realview/include/mach/memory.h
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-realview/realview_pb1176.c
arch/arm/mach-realview/realview_pb11mp.c
arch/arm/mach-realview/realview_pba8.c
arch/arm/mach-realview/realview_pbx.c
arch/arm/mach-s3c2410/mach-h1940.c
arch/arm/mach-s3c2412/mach-smdk2413.c
arch/arm/mach-s3c2412/mach-vstms.c
arch/arm/mach-s3c2440/mach-rx1950.c
arch/arm/mach-s3c2440/mach-rx3715.c
arch/arm/mach-sa1100/generic.h
arch/arm/mach-sa1100/include/mach/memory.h
arch/arm/mach-shark/include/mach/debug-macro.S
arch/arm/mach-shark/include/mach/memory.h
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/include/mach/irqs.h
arch/arm/mach-spear3xx/clock.c
arch/arm/mach-spear6xx/clock.c
arch/arm/mach-u300/clock.c
arch/arm/mach-u300/u300.c
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/clock.c
arch/arm/mach-ux500/devices-db8500.c
arch/arm/mach-ux500/include/mach/irqs-board-mop500.h [new file with mode: 0644]
arch/arm/mach-ux500/include/mach/irqs-db5500.h [new file with mode: 0644]
arch/arm/mach-ux500/include/mach/irqs-db8500.h [new file with mode: 0644]
arch/arm/mach-ux500/include/mach/irqs.h
arch/arm/mach-ux500/pins-db8500.h [new file with mode: 0644]
arch/arm/mach-versatile/core.c
arch/arm/mach-versatile/pci.c
arch/arm/mach-vexpress/ct-ca9x4.c
arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
arch/arm/mach-vexpress/v2m.c
arch/arm/mach-w90x900/cpu.c
arch/arm/mach-w90x900/dev.c
arch/arm/mach-w90x900/include/mach/regs-gcr.h [new file with mode: 0644]
arch/arm/mach-w90x900/mach-nuc950evb.c
arch/arm/mach-w90x900/nuc910.c
arch/arm/mach-w90x900/nuc950.c
arch/arm/mm/Makefile
arch/arm/mm/discontig.c [deleted file]
arch/arm/mm/init.c
arch/arm/mm/mm.h
arch/arm/mm/mmu.c
arch/arm/mm/nommu.c
arch/arm/plat-iop/time.c
arch/arm/plat-nomadik/gpio.c
arch/arm/plat-nomadik/include/plat/gpio.h
arch/arm/plat-nomadik/include/plat/mtu.h
arch/arm/plat-nomadik/include/plat/pincfg.h [new file with mode: 0644]
arch/arm/plat-nomadik/timer.c
arch/arm/plat-omap/common.c
arch/arm/plat-omap/fb.c
arch/arm/plat-omap/include/plat/common.h
arch/arm/plat-omap/include/plat/vram.h
arch/arm/plat-spear/include/plat/debug-macro.S
arch/arm/plat-spear/time.c
arch/arm/plat-versatile/Makefile
arch/arm/plat-versatile/leds.c [new file with mode: 0644]
arch/avr32/include/asm/ioctls.h
arch/avr32/mach-at32ap/include/mach/board.h
arch/mips/alchemy/common/platform.c
arch/mips/alchemy/mtx-1/board_setup.c
arch/mips/bcm63xx/dev-enet.c
arch/mips/include/asm/atomic.h
arch/mips/include/asm/unistd.h
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/vdso.c
arch/mips/mti-malta/malta-pci.c
arch/mips/nxp/pnx8550/common/pci.c
arch/mips/nxp/pnx8550/common/setup.c
arch/mips/pci/ops-pmcmsp.c
arch/mips/pci/pci-yosemite.c
arch/mips/powertv/asic/asic_devices.c
arch/powerpc/include/asm/kexec.h
arch/powerpc/include/asm/mmu-hash64.h
arch/powerpc/kernel/perf_event_fsl_emb.c
arch/powerpc/kernel/prom.c
arch/powerpc/mm/hash_low_64.S
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/hugetlbpage-hash64.c
arch/powerpc/mm/numa.c
arch/powerpc/platforms/pseries/hotplug-memory.c
arch/sparc/configs/sparc64_defconfig
arch/sparc/include/asm/cache.h
arch/sparc/include/asm/pgtable_32.h
arch/sparc/kernel/perf_event.c
arch/sparc/kernel/sun4d_irq.c
arch/sparc/kernel/ttable.S
arch/sparc/mm/srmmu.c
arch/sparc/mm/sun4c.c
arch/x86/kernel/acpi/cstate.c
arch/x86/kernel/acpi/sleep.c
arch/x86/kernel/apic/apic.c
arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
arch/x86/kernel/early-quirks.c
arch/x86/kernel/entry_64.S
arch/x86/kernel/hpet.c
arch/x86/kernel/i8259.c
arch/x86/kernel/kgdb.c
arch/x86/kernel/kprobes.c
arch/x86/kernel/quirks.c
arch/x86/kernel/setup_percpu.c
arch/x86/kvm/mmu.c
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/x86.c
arch/x86/pci/i386.c
arch/x86/pci/mrst.c
crypto/ablkcipher.c
drivers/acpi/acpica/evxfevnt.c
drivers/acpi/battery.c
drivers/acpi/blacklist.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/sleep.c
drivers/amba/bus.c
drivers/base/core.c
drivers/char/agp/intel-gtt.c
drivers/char/sysrq.c
drivers/char/tpm/tpm_tis.c
drivers/clocksource/cs5535-clockevt.c
drivers/cpufreq/cpufreq.c
drivers/crypto/talitos.c
drivers/edac/Kconfig
drivers/edac/i7core_edac.c
drivers/edac/mpc85xx_edac.c
drivers/gpio/cs5535-gpio.c
drivers/gpio/gpiolib.c
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_fb.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_fbcon.c
drivers/gpu/drm/radeon/evergreen_cs.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r300.c
drivers/gpu/drm/radeon/r520.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/r600_blit.c
drivers/gpu/drm/radeon/r600_cs.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_atombios.c
drivers/gpu/drm/radeon/radeon_combios.c
drivers/gpu/drm/radeon/radeon_connectors.c
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/radeon_legacy_encoders.c
drivers/gpu/drm/radeon/radeon_legacy_tv.c
drivers/gpu/drm/radeon/rs400.c
drivers/gpu/drm/radeon/rs600.c
drivers/gpu/drm/radeon/rs690.c
drivers/gpu/drm/radeon/rv515.c
drivers/gpu/drm/ttm/ttm_page_alloc.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
drivers/input/joystick/gamecon.c
drivers/input/keyboard/Kconfig
drivers/input/keyboard/twl4030_keypad.c
drivers/input/keyboard/w90p910_keypad.c
drivers/input/mouse/synaptics.c
drivers/input/mouse/synaptics.h
drivers/input/serio/i8042-x86ia64io.h
drivers/input/touchscreen/w90p910_ts.c
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/misc/arm-charlcd.c [new file with mode: 0644]
drivers/misc/cs5535-mfgpt.c
drivers/mmc/host/sdhci-s3c.c
drivers/net/bnx2x.h
drivers/net/bnx2x_main.c
drivers/net/bonding/bond_alb.c
drivers/net/declance.c
drivers/net/ibmveth.c
drivers/net/igb/igb_main.c
drivers/net/ixgbe/ixgbe_main.c
drivers/net/macvlan.c
drivers/net/macvtap.c
drivers/net/pcmcia/axnet_cs.c
drivers/net/r8169.c
drivers/net/s2io.h
drivers/net/tun.c
drivers/net/wimax/i2400m/i2400m-usb.h
drivers/net/wimax/i2400m/usb.c
drivers/net/wireless/ath/ath9k/hif_usb.c
drivers/net/wireless/ath/ath9k/recv.c
drivers/net/wireless/hostap/hostap_pci.c
drivers/net/wireless/iwlwifi/iwl-sta.h
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/pci/setup-res.c
drivers/pcmcia/pcmcia_resource.c
drivers/pcmcia/pxa2xx_base.c
drivers/platform/x86/intel_scu_ipc.c
drivers/power/ds2782_battery.c
drivers/regulator/ab3100.c
drivers/regulator/tps6507x-regulator.c
drivers/regulator/wm8350-regulator.c
drivers/rtc/rtc-rx8581.c
drivers/s390/block/dasd_devmap.c
drivers/s390/cio/chsc.c
drivers/s390/scsi/zfcp_erp.c
drivers/s390/scsi/zfcp_fsf.c
drivers/s390/scsi/zfcp_qdio.c
drivers/sbus/char/openprom.c
drivers/scsi/ibmvscsi/rpa_vscsi.c
drivers/scsi/ipr.c
drivers/scsi/ipr.h
drivers/serial/atmel_serial.c
drivers/serial/suncore.c
drivers/serial/sunsu.c
drivers/usb/class/cdc-acm.c
drivers/usb/core/hub.c
drivers/usb/core/quirks.c
drivers/usb/gadget/at91_udc.c
drivers/usb/gadget/at91_udc.h
drivers/usb/gadget/f_fs.c
drivers/usb/gadget/pxa27x_udc.c
drivers/usb/gadget/s3c2410_udc.c
drivers/usb/host/ohci-pxa27x.c
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h
drivers/usb/misc/sisusbvga/sisusb.c
drivers/usb/musb/tusb6010.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio_ids.h
drivers/usb/serial/option.c
drivers/usb/serial/qcserial.c
drivers/usb/serial/sierra.c
drivers/usb/storage/transport.c
drivers/vhost/net.c
drivers/video/aty/radeon_pm.c
drivers/video/au1100fb.c
drivers/video/gbefb.c
drivers/video/omap2/vram.c
drivers/video/pmag-ba-fb.c
drivers/video/pmagb-b-fb.c
drivers/virtio/virtio_ring.c
fs/9p/vfs_dir.c
fs/btrfs/ctree.c
fs/btrfs/ioctl.c
fs/ceph/Kconfig
fs/ceph/auth_x.c
fs/ceph/caps.c
fs/ceph/dir.c
fs/ceph/file.c
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/ceph/mds_client.h
fs/ceph/messenger.c
fs/ceph/mon_client.c
fs/ceph/osd_client.c
fs/ceph/osdmap.c
fs/cifs/cifsfs.c
fs/cifs/dns_resolve.c
fs/cifs/dns_resolve.h
fs/dcache.c
fs/ecryptfs/messaging.c
fs/gfs2/bmap.c
fs/gfs2/dir.c
fs/gfs2/glock.c
fs/gfs2/inode.c
fs/gfs2/quota.c
fs/gfs2/quota.h
fs/inode.c
fs/jbd2/journal.c
fs/jbd2/transaction.c
fs/jffs2/xattr.c
fs/mbcache.c
fs/nfs/dir.c
fs/nfs/internal.h
fs/ocfs2/aops.c
fs/ocfs2/dlm/dlmdomain.c
fs/ocfs2/dlm/dlmmaster.c
fs/ocfs2/dlm/dlmrecovery.c
fs/ocfs2/file.c
fs/ocfs2/file.h
fs/ocfs2/journal.c
fs/ocfs2/localalloc.c
fs/ocfs2/quota_global.c
fs/ocfs2/quota_local.c
fs/ocfs2/refcounttree.c
fs/ocfs2/suballoc.c
fs/ocfs2/xattr.c
fs/partitions/ibm.c
fs/quota/dquot.c
fs/sysfs/symlink.c
fs/ubifs/shrinker.c
fs/ubifs/ubifs.h
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/linux-2.6/xfs_sync.c
fs/xfs/linux-2.6/xfs_sync.h
fs/xfs/linux-2.6/xfs_trace.h
fs/xfs/quota/xfs_qm.c
fs/xfs/xfs_mount.h
include/acpi/processor.h
include/asm-generic/vmlinux.lds.h
include/linux/acpi.h
include/linux/amba/bus.h
include/linux/fb.h
include/linux/fdtable.h
include/linux/i8042.h
include/linux/if_macvlan.h
include/linux/jbd2.h
include/linux/mm.h
include/linux/omapfb.h
include/linux/pci.h
include/linux/regulator/tps6507x.h [new file with mode: 0644]
include/linux/syscalls.h
include/linux/sysrq.h
include/linux/vgaarb.h
include/math-emu/op-common.h
include/net/sock.h
include/net/tc_act/tc_mirred.h
ipc/sem.c
kernel/debug/debug_core.c
kernel/debug/gdbstub.c
kernel/debug/kdb/kdb_main.c
kernel/early_res.c
kernel/module.c
mm/bootmem.c
mm/page_alloc.c
mm/page_cgroup.c
mm/vmscan.c
net/bluetooth/hci_conn.c
net/bluetooth/hci_event.c
net/bluetooth/l2cap.c
net/bridge/br_device.c
net/bridge/br_forward.c
net/core/dev.c
net/core/neighbour.c
net/core/skbuff.c
net/dsa/Kconfig
net/ipv4/ipmr.c
net/ipv4/tcp.c
net/ipv4/tcp_output.c
net/ipv6/addrconf.c
net/ipv6/mip6.c
net/mac80211/cfg.c
net/phonet/pep.c
net/sched/act_mirred.c
net/sched/act_nat.c
net/sunrpc/auth.c
net/xfrm/xfrm_policy.c
scripts/kconfig/nconf.gui.c
scripts/package/Makefile
scripts/setlocalversion
sound/soc/au1x/psc-i2s.c
sound/soc/codecs/Kconfig
sound/soc/codecs/wm8727.c
sound/soc/codecs/wm8776.c
sound/soc/codecs/wm8988.c
sound/soc/sh/fsi.c
tools/perf/Makefile
tools/perf/arch/sparc/Makefile [new file with mode: 0644]
tools/perf/arch/sparc/util/dwarf-regs.c [new file with mode: 0644]
tools/perf/builtin-report.c
tools/perf/util/PERF-VERSION-GEN
tools/perf/util/callchain.c
tools/perf/util/callchain.h
tools/perf/util/hist.c
tools/perf/util/symbol.c

index dd10b51b4e652570df9a6575ac2df654bbaca15d..5405f7aecefc334b7d16c0f2764a8757e845ad43 100644 (file)
@@ -32,8 +32,6 @@ DocBook/
        - directory with DocBook templates etc. for kernel documentation.
 HOWTO
        - the process and procedures of how to do Linux kernel development.
-IO-mapping.txt
-       - how to access I/O mapped memory from within device drivers.
 IPMI.txt
        - info on Linux Intelligent Platform Management Interface (IPMI) Driver.
 IRQ-affinity.txt
@@ -84,6 +82,8 @@ blockdev/
        - info on block devices & drivers
 btmrvl.txt
        - info on Marvell Bluetooth driver usage.
+bus-virt-phys-mapping.txt
+       - how to access I/O mapped memory from within device drivers.
 cachetlb.txt
        - describes the cache/TLB flushing interfaces Linux uses.
 cdrom/
@@ -168,6 +168,8 @@ initrd.txt
        - how to use the RAM disk as an initial/temporary root filesystem.
 input/
        - info on Linux input device support.
+io-mapping.txt
+       - description of io_mapping functions in linux/io-mapping.h
 io_ordering.txt
        - info on ordering I/O writes to memory-mapped addresses.
 ioctl/
index c268783bc4e7c18c2e4db792c3fba83d6bc44c71..1571c0c83dba0b0876ea52e4ff85ff69a56dab87 100644 (file)
@@ -647,3 +647,10 @@ Who:       Stefan Richter <stefanr@s5r6.in-berlin.de>
 
 ----------------------------
 
+What:  The acpi_sleep=s4_nonvs command line option
+When:  2.6.37
+Files: arch/x86/kernel/acpi/sleep.c
+Why:   superseded by acpi_sleep=nonvs
+Who:   Rafael J. Wysocki <rjw@sisk.pl>
+
+----------------------------
index 4ddb58df081e360311e22cafe40273d3176de46d..2b2407d9a6d025a8451605b104a35daa7da59b47 100644 (file)
@@ -254,8 +254,8 @@ and is between 256 and 4096 characters. It is defined in the file
                        control method, with respect to putting devices into
                        low power states, to be enforced (the ACPI 2.0 ordering
                        of _PTS is used by default).
-                       s4_nonvs prevents the kernel from saving/restoring the
-                       ACPI NVS memory during hibernation.
+                       nonvs prevents the kernel from saving/restoring the
+                       ACPI NVS memory during suspend/hibernation and resume.
                        sci_force_enable causes the kernel to set SCI_EN directly
                        on resume from S1/S3 (which is against the ACPI spec,
                        but some broken systems don't work without it).
index 58848125b8bfadcc70f9b37ac68d77d6aee0794b..db3d0f5061f9c42e301e420878b0dc5cbe31e6e1 100644 (file)
@@ -5336,6 +5336,7 @@ T:        git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
 S:     Maintained
 F:     arch/sparc/
+F:     drivers/sbus
 
 SPARC SERIAL DRIVERS
 M:     "David S. Miller" <davem@davemloft.net>
index 037ff4e62ca0ac605c2d63cdaa1cda79220f3cb4..886bf04931d4aea56c26761b26898a8f393fb9ce 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 35
-EXTRAVERSION = -rc5
+EXTRAVERSION = -rc6
 NAME = Sheep on Meth
 
 # *DOCUMENTATION*
index 157b08aa03663ed744c24ee49f60df9937de1995..ba1ac08b4e02175a4581d1ef49f55f9af0fa17a1 100644 (file)
@@ -10,6 +10,7 @@ config ARM
        default y
        select HAVE_AOUT
        select HAVE_IDE
+       select HAVE_MEMBLOCK
        select RTC_LIB
        select SYS_SUPPORTS_APM_EMULATION
        select GENERIC_ATOMIC64 if (!CPU_32v6K)
@@ -440,21 +441,6 @@ config ARCH_IXP4XX
        help
          Support for Intel's IXP4XX (XScale) family of processors.
 
-config ARCH_L7200
-       bool "LinkUp-L7200"
-       select CPU_ARM720T
-       select FIQ
-       select ARCH_USES_GETTIMEOFFSET
-       help
-         Say Y here if you intend to run this kernel on a LinkUp Systems
-         L7200 Software Development Board which uses an ARM720T processor.
-         Information on this board can be obtained at:
-
-         <http://www.linkupsys.com/>
-
-         If you have any questions or comments about the Linux kernel port
-         to this board, send e-mail to <sjhill@cotw.com>.
-
 config ARCH_DOVE
        bool "Marvell Dove"
        select PCI
@@ -720,7 +706,6 @@ config ARCH_SHARK
 config ARCH_LH7A40X
        bool "Sharp LH7A40X"
        select CPU_ARM922T
-       select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM
        select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM
        select ARCH_USES_GETTIMEOFFSET
        help
@@ -1168,9 +1153,10 @@ config HOTPLUG_CPU
 config LOCAL_TIMERS
        bool "Use local timer interrupts"
        depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || \
-               REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500)
+               REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
+               ARCH_U8500 || ARCH_VEXPRESS_CA9X4)
        default y
-       select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500)
+       select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_VEXPRESS || ARCH_OMAP4 || ARCH_U8500)
        help
          Enable support for local timers on SMP platforms, rather then the
          legacy IPI broadcast method.  Local timers allows the system
@@ -1181,10 +1167,10 @@ source kernel/Kconfig.preempt
 
 config HZ
        int
-       default 128 if ARCH_L7200
        default 200 if ARCH_EBSA110 || ARCH_S3C2410 || ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PV210
        default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
        default AT91_TIMER_HZ if ARCH_AT91
+       default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
        default 100
 
 config THUMB2_KERNEL
@@ -1237,10 +1223,6 @@ config OABI_COMPAT
 config ARCH_HAS_HOLES_MEMORYMODEL
        bool
 
-# Discontigmem is deprecated
-config ARCH_DISCONTIGMEM_ENABLE
-       bool
-
 config ARCH_SPARSEMEM_ENABLE
        bool
 
@@ -1248,13 +1230,7 @@ config ARCH_SPARSEMEM_DEFAULT
        def_bool ARCH_SPARSEMEM_ENABLE
 
 config ARCH_SELECT_MEMORY_MODEL
-       def_bool ARCH_DISCONTIGMEM_ENABLE && ARCH_SPARSEMEM_ENABLE
-
-config NODES_SHIFT
-       int
-       default "4" if ARCH_LH7A40X
-       default "2"
-       depends on NEED_MULTIPLE_NODES
+       def_bool ARCH_SPARSEMEM_ENABLE
 
 config HIGHMEM
        bool "High Memory Support (EXPERIMENTAL)"
index 64ba313724d2377fda7e439e130d7ad69dd1a83c..bea37a2512e74b33cafdb63b1173969c95ee49dd 100644 (file)
@@ -139,7 +139,6 @@ machine-$(CONFIG_ARCH_IXP23XX)              := ixp23xx
 machine-$(CONFIG_ARCH_IXP4XX)          := ixp4xx
 machine-$(CONFIG_ARCH_KIRKWOOD)                := kirkwood
 machine-$(CONFIG_ARCH_KS8695)          := ks8695
-machine-$(CONFIG_ARCH_L7200)           := l7200
 machine-$(CONFIG_ARCH_LH7A40X)         := lh7a40x
 machine-$(CONFIG_ARCH_LOKI)            := loki
 machine-$(CONFIG_ARCH_MMP)             := mmp
index 53faa9063a035be790c3aef7c5f32c4f48eb8025..7a29301d516b34530df958847a36f45067447838 100644 (file)
@@ -19,10 +19,6 @@ ifeq ($(CONFIG_ARCH_SHARK),y)
 OBJS           += head-shark.o ofw-shark.o
 endif
 
-ifeq ($(CONFIG_ARCH_L7200),y)
-OBJS           += head-l7200.o
-endif
-
 ifeq ($(CONFIG_ARCH_P720T),y)
 # Borrow this code from SA1100
 OBJS           += head-sa1100.o
diff --git a/arch/arm/boot/compressed/head-l7200.S b/arch/arm/boot/compressed/head-l7200.S
deleted file mode 100644 (file)
index d0e3b20..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * linux/arch/arm/boot/compressed/head-l7200.S
- * 
- * Copyright (C) 2000 Steve Hill <sjhill@cotw.com>
- * 
- * Some code borrowed from Nicolas Pitre's 'head-sa1100.S' file. This
- * is merged with head.S by the linker.
- */
-
-#include <asm/mach-types.h>
-
-#ifndef CONFIG_ARCH_L7200
-#error What am I doing here...
-#endif
-
-               .section        ".start", "ax"
-
-__L7200_start:
-               mov     r0, #0x00100000         @ FLASH address of initrd
-               mov     r2, #0xf1000000         @ RAM address of initrd
-               add     r3, r2, #0x00700000     @ Size of initrd 
-1:
-               ldmia   r0!, {r4, r5, r6, r7}
-               stmia   r2!, {r4, r5, r6, r7}
-               cmp     r2, r3
-               ble     1b
-
-               mov     r8, #0                  @ Zero it out
-               mov     r7, #MACH_TYPE_L7200    @ Set architecture ID
index 337741f734ac08d7f438e5d6240293adf3c5c366..7dfa9a85bc0c875b11567025f68e92bd768d7419 100644 (file)
@@ -108,6 +108,51 @@ static void gic_unmask_irq(unsigned int irq)
        spin_unlock(&irq_controller_lock);
 }
 
+static int gic_set_type(unsigned int irq, unsigned int type)
+{
+       void __iomem *base = gic_dist_base(irq);
+       unsigned int gicirq = gic_irq(irq);
+       u32 enablemask = 1 << (gicirq % 32);
+       u32 enableoff = (gicirq / 32) * 4;
+       u32 confmask = 0x2 << ((gicirq % 16) * 2);
+       u32 confoff = (gicirq / 16) * 4;
+       bool enabled = false;
+       u32 val;
+
+       /* Interrupt configuration for SGIs can't be changed */
+       if (gicirq < 16)
+               return -EINVAL;
+
+       if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
+               return -EINVAL;
+
+       spin_lock(&irq_controller_lock);
+
+       val = readl(base + GIC_DIST_CONFIG + confoff);
+       if (type == IRQ_TYPE_LEVEL_HIGH)
+               val &= ~confmask;
+       else if (type == IRQ_TYPE_EDGE_RISING)
+               val |= confmask;
+
+       /*
+        * As recommended by the spec, disable the interrupt before changing
+        * the configuration
+        */
+       if (readl(base + GIC_DIST_ENABLE_SET + enableoff) & enablemask) {
+               writel(enablemask, base + GIC_DIST_ENABLE_CLEAR + enableoff);
+               enabled = true;
+       }
+
+       writel(val, base + GIC_DIST_CONFIG + confoff);
+
+       if (enabled)
+               writel(enablemask, base + GIC_DIST_ENABLE_SET + enableoff);
+
+       spin_unlock(&irq_controller_lock);
+
+       return 0;
+}
+
 #ifdef CONFIG_SMP
 static int gic_set_cpu(unsigned int irq, const struct cpumask *mask_val)
 {
@@ -161,6 +206,7 @@ static struct irq_chip gic_chip = {
        .ack            = gic_ack_irq,
        .mask           = gic_mask_irq,
        .unmask         = gic_unmask_irq,
+       .set_type       = gic_set_type,
 #ifdef CONFIG_SMP
        .set_affinity   = gic_set_cpu,
 #endif
index 6f80665f477e70b0acad4d6ead228295446863c3..ac2fd440652ee06a32a2c113468871c03538d2c4 100644 (file)
@@ -185,13 +185,10 @@ static struct sa1111_dev_info sa1111_devices[] = {
        },
 };
 
-void __init sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes)
+void __init sa1111_adjust_zones(unsigned long *size, unsigned long *holes)
 {
        unsigned int sz = SZ_1M >> PAGE_SHIFT;
 
-       if (node != 0)
-               sz = 0;
-
        size[1] = size[0] - sz;
        size[0] = sz;
 }
diff --git a/arch/arm/configs/lusl7200_defconfig b/arch/arm/configs/lusl7200_defconfig
deleted file mode 100644 (file)
index 816fc42..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-CONFIG_EXPERIMENTAL=y
-CONFIG_SYSVIPC=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
-# CONFIG_HOTPLUG is not set
-CONFIG_MODULES=y
-CONFIG_ARCH_L7200=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_ZBOOT_ROM_TEXT=0x00010000
-CONFIG_ZBOOT_ROM_BSS=0xf03e0000
-CONFIG_ZBOOT_ROM=y
-CONFIG_CMDLINE="console=tty0 console=ttyLU1,115200 root=/dev/ram initrd=0xf1000000,0x005dac7b mem=32M"
-CONFIG_BINFMT_AOUT=y
-CONFIG_BLK_DEV_RAM=y
-# CONFIG_INPUT is not set
-# CONFIG_SERIO_SERPORT is not set
-# CONFIG_VT is not set
-CONFIG_SERIAL_NONSTANDARD=y
-CONFIG_EXT2_FS=y
-CONFIG_DEBUG_USER=y
-# CONFIG_CRC32 is not set
index df15a0dc228e23da027667d3a992658daadf2305..8ec9ef5c3c7be25a2705451e8aab0a8205a47e67 100644 (file)
 
 #ifndef __ASSEMBLY__
 
-struct kimage;
-/* Provide a dummy definition to avoid build failures. */
+/**
+ * crash_setup_regs() - save registers for the panic kernel
+ * @newregs: registers are saved here
+ * @oldregs: registers to be saved (may be %NULL)
+ *
+ * Function copies machine registers from @oldregs to @newregs. If @oldregs is
+ * %NULL then current registers are stored there.
+ */
 static inline void crash_setup_regs(struct pt_regs *newregs,
-                                        struct pt_regs *oldregs) { }
+                                   struct pt_regs *oldregs)
+{
+       if (oldregs) {
+               memcpy(newregs, oldregs, sizeof(*newregs));
+       } else {
+               __asm__ __volatile__ ("stmia %0, {r0 - r15}"
+                                     : : "r" (&newregs->ARM_r0));
+               __asm__ __volatile__ ("mrs %0, cpsr"
+                                     : "=r" (newregs->ARM_cpsr));
+       }
+}
 
 #endif /* __ASSEMBLY__ */
 
index 5ee6f85236a406a7aba2be14c98caf747c54fabc..8a0dd18ba6427301ed4b802739a390dec64d12c2 100644 (file)
@@ -38,6 +38,7 @@ struct machine_desc {
        void                    (*fixup)(struct machine_desc *,
                                         struct tag *, char **,
                                         struct meminfo *);
+       void                    (*reserve)(void);/* reserve mem blocks  */
        void                    (*map_io)(void);/* IO mapping function  */
        void                    (*init_irq)(void);
        struct sys_timer        *timer;         /* system tick timer    */
diff --git a/arch/arm/include/asm/memblock.h b/arch/arm/include/asm/memblock.h
new file mode 100644 (file)
index 0000000..fdbc43b
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _ASM_ARM_MEMBLOCK_H
+#define _ASM_ARM_MEMBLOCK_H
+
+#ifdef CONFIG_MMU
+extern phys_addr_t lowmem_end_addr;
+#define MEMBLOCK_REAL_LIMIT    lowmem_end_addr
+#else
+#define MEMBLOCK_REAL_LIMIT    0
+#endif
+
+struct meminfo;
+struct machine_desc;
+
+extern void arm_memblock_init(struct meminfo *, struct machine_desc *);
+
+#endif
index ab08d977ad490399e976d81cab30477963cfca9d..23c2e8e5c0faaa09d81910456d4de63a96a513da 100644 (file)
 #endif
 
 #ifndef arch_adjust_zones
-#define arch_adjust_zones(node,size,holes) do { } while (0)
+#define arch_adjust_zones(size,holes) do { } while (0)
 #elif !defined(CONFIG_ZONE_DMA)
 #error "custom arch_adjust_zones() requires CONFIG_ZONE_DMA"
 #endif
@@ -243,76 +243,11 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
  *  virt_to_page(k)    convert a _valid_ virtual address to struct page *
  *  virt_addr_valid(k) indicates whether a virtual address is valid
  */
-#ifndef CONFIG_DISCONTIGMEM
-
 #define ARCH_PFN_OFFSET                PHYS_PFN_OFFSET
 
 #define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
 #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
 
-#define PHYS_TO_NID(addr)      (0)
-
-#else /* CONFIG_DISCONTIGMEM */
-
-/*
- * This is more complex.  We have a set of mem_map arrays spread
- * around in memory.
- */
-#include <linux/numa.h>
-
-#define arch_pfn_to_nid(pfn)   PFN_TO_NID(pfn)
-#define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT)
-
-#define virt_to_page(kaddr)                                    \
-       (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
-
-#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < MAX_NUMNODES)
-
-/*
- * Common discontigmem stuff.
- *  PHYS_TO_NID is used by the ARM kernel/setup.c
- */
-#define PHYS_TO_NID(addr)      PFN_TO_NID((addr) >> PAGE_SHIFT)
-
-/*
- * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
- * and returns the mem_map of that node.
- */
-#define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
-
-/*
- * Given a page frame number, find the owning node of the memory
- * and returns the mem_map of that node.
- */
-#define PFN_TO_MAPBASE(pfn)    NODE_MEM_MAP(PFN_TO_NID(pfn))
-
-#ifdef NODE_MEM_SIZE_BITS
-#define NODE_MEM_SIZE_MASK     ((1 << NODE_MEM_SIZE_BITS) - 1)
-
-/*
- * Given a kernel address, find the home node of the underlying memory.
- */
-#define KVADDR_TO_NID(addr) \
-       (((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MEM_SIZE_BITS)
-
-/*
- * Given a page frame number, convert it to a node id.
- */
-#define PFN_TO_NID(pfn) \
-       (((pfn) - PHYS_PFN_OFFSET) >> (NODE_MEM_SIZE_BITS - PAGE_SHIFT))
-
-/*
- * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
- * and returns the index corresponding to the appropriate page in the
- * node's mem_map.
- */
-#define LOCAL_MAP_NR(addr) \
-       (((unsigned long)(addr) & NODE_MEM_SIZE_MASK) >> PAGE_SHIFT)
-
-#endif /* NODE_MEM_SIZE_BITS */
-
-#endif /* !CONFIG_DISCONTIGMEM */
-
 /*
  * Optional coherency support.  Currently used only by selected
  * Intel XSC3-based systems.
diff --git a/arch/arm/include/asm/mmzone.h b/arch/arm/include/asm/mmzone.h
deleted file mode 100644 (file)
index ae63a4f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *  arch/arm/include/asm/mmzone.h
- *
- *  1999-12-29 Nicolas Pitre           Created
- *
- * 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.
- */
-#ifndef __ASM_MMZONE_H
-#define __ASM_MMZONE_H
-
-/*
- * Currently defined in arch/arm/mm/discontig.c
- */
-extern pg_data_t discontig_node_data[];
-
-/*
- * Return a pointer to the node data for node n.
- */
-#define NODE_DATA(nid)         (&discontig_node_data[nid])
-
-/*
- * NODE_MEM_MAP gives the kaddr for the mem_map of the node.
- */
-#define NODE_MEM_MAP(nid)      (NODE_DATA(nid)->node_mem_map)
-
-#include <mach/memory.h>
-
-#endif
index f392fb4437afbd86b35807f16a152ab773df17f4..f1e5a9bca2491d982bda9fda1d40aa7b63b0cfd8 100644 (file)
@@ -201,8 +201,7 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
 struct membank {
        unsigned long start;
        unsigned long size;
-       unsigned short node;
-       unsigned short highmem;
+       unsigned int highmem;
 };
 
 struct meminfo {
@@ -212,9 +211,8 @@ struct meminfo {
 
 extern struct meminfo meminfo;
 
-#define for_each_nodebank(iter,mi,no)                  \
-       for (iter = 0; iter < (mi)->nr_banks; iter++)   \
-               if ((mi)->bank[iter].node == no)
+#define for_each_bank(iter,mi)                         \
+       for (iter = 0; iter < (mi)->nr_banks; iter++)
 
 #define bank_pfn_start(bank)   __phys_to_pfn((bank)->start)
 #define bank_pfn_end(bank)     __phys_to_pfn((bank)->start + (bank)->size)
index 26d302c28e1318b4aa5db81a491fcd6a82b0e6fa..ea023c6aa31e55599b38470913c004a437c90666 100644 (file)
@@ -39,6 +39,7 @@ obj-$(CONFIG_ARM_THUMBEE)     += thumbee.o
 obj-$(CONFIG_KGDB)             += kgdb.o
 obj-$(CONFIG_ARM_UNWIND)       += unwind.o
 obj-$(CONFIG_HAVE_TCM)         += tcm.o
+obj-$(CONFIG_CRASH_DUMP)       += crash_dump.o
 
 obj-$(CONFIG_CRUNCH)           += crunch.o crunch-bits.o
 AFLAGS_crunch-bits.o           := -Wa,-mcpu=ep9312
diff --git a/arch/arm/kernel/crash_dump.c b/arch/arm/kernel/crash_dump.c
new file mode 100644 (file)
index 0000000..cd3b853
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * arch/arm/kernel/crash_dump.c
+ *
+ * Copyright (C) 2010 Nokia Corporation.
+ * Author: Mika Westerberg
+ *
+ * This code is taken from arch/x86/kernel/crash_dump_64.c
+ *   Created by: Hariprasad Nellitheertha (hari@in.ibm.com)
+ *   Copyright (C) IBM Corporation, 2004. All rights reserved
+ *
+ * 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/errno.h>
+#include <linux/crash_dump.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
+
+/* stores the physical address of elf header of crash image */
+unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
+
+/**
+ * copy_oldmem_page() - copy one page from old kernel memory
+ * @pfn: page frame number to be copied
+ * @buf: buffer where the copied page is placed
+ * @csize: number of bytes to copy
+ * @offset: offset in bytes into the page
+ * @userbuf: if set, @buf is int he user address space
+ *
+ * This function copies one page from old kernel memory into buffer pointed by
+ * @buf. If @buf is in userspace, set @userbuf to %1. Returns number of bytes
+ * copied or negative error in case of failure.
+ */
+ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
+                        size_t csize, unsigned long offset,
+                        int userbuf)
+{
+       void *vaddr;
+
+       if (!csize)
+               return 0;
+
+       vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
+       if (!vaddr)
+               return -ENOMEM;
+
+       if (userbuf) {
+               if (copy_to_user(buf, vaddr + offset, csize)) {
+                       iounmap(vaddr);
+                       return -EFAULT;
+               }
+       } else {
+               memcpy(buf, vaddr + offset, csize);
+       }
+
+       iounmap(vaddr);
+       return csize;
+}
index df5958f6864fcde5cb3b8f1957f1cc589e0edd2e..1fc74cbd1a193ee4dcd2fd50afdd279804d9e5fd 100644 (file)
@@ -39,6 +39,10 @@ void machine_kexec_cleanup(struct kimage *image)
 
 void machine_crash_shutdown(struct pt_regs *regs)
 {
+       local_irq_disable();
+       crash_save_cpu(regs, smp_processor_id());
+
+       printk(KERN_INFO "Loading crashdump kernel...\n");
 }
 
 void machine_kexec(struct kimage *image)
index 61930eb0902941030e3e180aca40f6f82697e39e..fd26f8d65151a949e6ecff394f0146258882b9d6 100644 (file)
@@ -10,6 +10,12 @@ relocate_new_kernel:
        ldr     r0,kexec_indirection_page
        ldr     r1,kexec_start_address
 
+       /*
+        * If there is no indirection page (we are doing crashdumps)
+        * skip any relocation.
+        */
+       cmp     r0, #0
+       beq     2f
 
 0:     /* top, read another word for the indirection page */
        ldr     r3, [r0],#4
index 648c3c1e16c40dcd4504e90e96759113d5d7ee16..776ea1aa974b689285006edc70f8ba1158a36c3b 100644 (file)
 #include <linux/seq_file.h>
 #include <linux/screen_info.h>
 #include <linux/init.h>
+#include <linux/kexec.h>
+#include <linux/crash_dump.h>
 #include <linux/root_dev.h>
 #include <linux/cpu.h>
 #include <linux/interrupt.h>
 #include <linux/smp.h>
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
+#include <linux/memblock.h>
 
 #include <asm/unified.h>
 #include <asm/cpu.h>
@@ -419,13 +422,12 @@ static int __init arm_add_memory(unsigned long start, unsigned long size)
        size -= start & ~PAGE_MASK;
        bank->start = PAGE_ALIGN(start);
        bank->size  = size & PAGE_MASK;
-       bank->node  = PHYS_TO_NID(start);
 
        /*
         * Check whether this memory region has non-zero size or
         * invalid node number.
         */
-       if (bank->size == 0 || bank->node >= MAX_NUMNODES)
+       if (bank->size == 0)
                return -EINVAL;
 
        meminfo.nr_banks++;
@@ -680,6 +682,79 @@ static int __init customize_machine(void)
 }
 arch_initcall(customize_machine);
 
+#ifdef CONFIG_KEXEC
+static inline unsigned long long get_total_mem(void)
+{
+       unsigned long total;
+
+       total = max_low_pfn - min_low_pfn;
+       return total << PAGE_SHIFT;
+}
+
+/**
+ * reserve_crashkernel() - reserves memory are for crash kernel
+ *
+ * This function reserves memory area given in "crashkernel=" kernel command
+ * line parameter. The memory reserved is used by a dump capture kernel when
+ * primary kernel is crashing.
+ */
+static void __init reserve_crashkernel(void)
+{
+       unsigned long long crash_size, crash_base;
+       unsigned long long total_mem;
+       int ret;
+
+       total_mem = get_total_mem();
+       ret = parse_crashkernel(boot_command_line, total_mem,
+                               &crash_size, &crash_base);
+       if (ret)
+               return;
+
+       ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE);
+       if (ret < 0) {
+               printk(KERN_WARNING "crashkernel reservation failed - "
+                      "memory is in use (0x%lx)\n", (unsigned long)crash_base);
+               return;
+       }
+
+       printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
+              "for crashkernel (System RAM: %ldMB)\n",
+              (unsigned long)(crash_size >> 20),
+              (unsigned long)(crash_base >> 20),
+              (unsigned long)(total_mem >> 20));
+
+       crashk_res.start = crash_base;
+       crashk_res.end = crash_base + crash_size - 1;
+       insert_resource(&iomem_resource, &crashk_res);
+}
+#else
+static inline void reserve_crashkernel(void) {}
+#endif /* CONFIG_KEXEC */
+
+/*
+ * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
+ * is_kdump_kernel() to determine if we are booting after a panic. Hence
+ * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
+ */
+
+#ifdef CONFIG_CRASH_DUMP
+/*
+ * elfcorehdr= specifies the location of elf core header stored by the crashed
+ * kernel. This option will be passed by kexec loader to the capture kernel.
+ */
+static int __init setup_elfcorehdr(char *arg)
+{
+       char *end;
+
+       if (!arg)
+               return -EINVAL;
+
+       elfcorehdr_addr = memparse(arg, &end);
+       return end > arg ? 0 : -EINVAL;
+}
+early_param("elfcorehdr", setup_elfcorehdr);
+#endif /* CONFIG_CRASH_DUMP */
+
 void __init setup_arch(char **cmdline_p)
 {
        struct tag *tags = (struct tag *)&init_tags;
@@ -733,12 +808,15 @@ void __init setup_arch(char **cmdline_p)
 
        parse_early_param();
 
+       arm_memblock_init(&meminfo, mdesc);
+
        paging_init(mdesc);
        request_standard_resources(&meminfo, mdesc);
 
 #ifdef CONFIG_SMP
        smp_init_cpus();
 #endif
+       reserve_crashkernel();
 
        cpu_init();
        tcm_init();
index 030ba7219f482bfd9873b196d1a8634d5fc2eacb..59ff42ddf0aed656f3def2c44859f0eec414b1d3 100644 (file)
@@ -41,7 +41,6 @@ else
 endif
 
 lib-$(CONFIG_ARCH_RPC)         += ecard.o io-acorn.o floppydma.o
-lib-$(CONFIG_ARCH_L7200)       += io-acorn.o
 lib-$(CONFIG_ARCH_SHARK)       += io-shark.o
 
 $(obj)/csumpartialcopy.o:      $(obj)/csumpartialcopygeneric.S
index c00822543d9f78a307c4a7c7f3c576db75c2efb4..4f93c567a35a3acb8969d5ae7951bfc2e8f008e4 100644 (file)
 
 #define PHYS_OFFSET    UL(0xf0000000)
 
-/*
- * The nodes are the followings:
- *
- *   node 0: 0xf000.0000 - 0xf3ff.ffff
- *   node 1: 0xf400.0000 - 0xf7ff.ffff
- *   node 2: 0xf800.0000 - 0xfbff.ffff
- *   node 3: 0xfc00.0000 - 0xffff.ffff
- */
-#define NODE_MEM_SIZE_BITS     26
-
 #endif /* __ASM_ARCH_MEMORY_H */
index 841eaf8f27e221dfa600178e4d20ac0d56ddeaad..939bccd70569846987c6ddb304cd22c7de730bf7 100644 (file)
@@ -366,6 +366,17 @@ config MACH_STAMP9G20
 
 endif
 
+if (ARCH_AT91SAM9260 || ARCH_AT91SAM9G20)
+comment "AT91SAM9260/AT91SAM9G20 boards"
+
+config MACH_SNAPPER_9260
+        bool "Bluewater Systems Snapper 9260/9G20 module"
+        help
+          Select this if you are using the Bluewater Systems Snapper 9260 or
+          Snapper 9G20 modules.
+          <http://www.bluewatersys.com/>
+endif
+
 # ----------------------------------------------------------
 
 if ARCH_AT91SAM9G45
index c1f821e58222b77257e875c3ce5a72ea2be6429d..ca2ac003f41f5666fb8da8c1e23b34ab3e363ea6 100644 (file)
@@ -66,6 +66,9 @@ obj-$(CONFIG_MACH_CPU9G20)    += board-cpu9krea.o
 obj-$(CONFIG_MACH_STAMP9G20)   += board-stamp9g20.o
 obj-$(CONFIG_MACH_PORTUXG20)   += board-stamp9g20.o
 
+# AT91SAM9260/AT91SAM9G20 board-specific support
+obj-$(CONFIG_MACH_SNAPPER_9260)        += board-snapper9260.o
+
 # AT91SAM9G45 board-specific support
 obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o
 
index 85166b7e69a18235969336742526c2961c486d66..753c0d31a3d3f0b407cfe20b68f5ba66189cd1a7 100644 (file)
@@ -20,6 +20,7 @@
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
 #include <mach/at91_shdwc.h>
+#include <mach/cpu.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -176,6 +177,13 @@ static struct clk mmc1_clk = {
        .type           = CLK_TYPE_PERIPHERAL,
 };
 
+/* Video decoder clock - Only for sam9m10/sam9m11 */
+static struct clk vdec_clk = {
+       .name           = "vdec_clk",
+       .pmc_mask       = 1 << AT91SAM9G45_ID_VDEC,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+
 /* One additional fake clock for ohci */
 static struct clk ohci_clk = {
        .name           = "ohci_clk",
@@ -239,6 +247,9 @@ static void __init at91sam9g45_register_clocks(void)
        for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
                clk_register(periph_clocks[i]);
 
+       if (cpu_is_at91sam9m10() || cpu_is_at91sam9m11())
+               clk_register(&vdec_clk);
+
        clk_register(&pck0);
        clk_register(&pck1);
 }
index a4102d72cc9b1c8e9d323f432fb5873b2144cc44..c49f5c003ee10d9fbad7a6f076f0e1dc58b0d653 100644 (file)
@@ -26,6 +26,9 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/at73c213.h>
 #include <linux/clk.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/consumer.h>
 
 #include <mach/hardware.h>
 #include <asm/setup.h>
@@ -235,6 +238,46 @@ static struct gpio_led ek_leds[] = {
        }
 };
 
+#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
+static struct regulator_consumer_supply ek_audio_consumer_supplies[] = {
+       REGULATOR_SUPPLY("AVDD", "0-001b"),
+       REGULATOR_SUPPLY("HPVDD", "0-001b"),
+       REGULATOR_SUPPLY("DBVDD", "0-001b"),
+       REGULATOR_SUPPLY("DCVDD", "0-001b"),
+};
+
+static struct regulator_init_data ek_avdd_reg_init_data = {
+       .constraints    = {
+               .name   = "3V3",
+               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+       },
+       .consumer_supplies = ek_audio_consumer_supplies,
+       .num_consumer_supplies = ARRAY_SIZE(ek_audio_consumer_supplies),
+};
+
+static struct fixed_voltage_config ek_vdd_pdata = {
+       .supply_name    = "board-3V3",
+       .microvolts     = 3300000,
+       .gpio           = -EINVAL,
+       .enabled_at_boot = 0,
+       .init_data      = &ek_avdd_reg_init_data,
+};
+static struct platform_device ek_voltage_regulator = {
+       .name           = "reg-fixed-voltage",
+       .id             = -1,
+       .num_resources  = 0,
+       .dev            = {
+               .platform_data  = &ek_vdd_pdata,
+       },
+};
+static void __init ek_add_regulators(void)
+{
+       platform_device_register(&ek_voltage_regulator);
+}
+#else
+static void __init ek_add_regulators(void) {}
+#endif
+
 static struct i2c_board_info __initdata ek_i2c_devices[] = {
        {
                I2C_BOARD_INFO("24c512", 0x50),
@@ -256,6 +299,8 @@ static void __init ek_board_init(void)
        ek_add_device_nand();
        /* Ethernet */
        at91_add_device_eth(&ek_macb_data);
+       /* Regulators */
+       ek_add_regulators();
        /* MMC */
 #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
        at91_add_device_mci(0, &ek_mmc_data);
index c11fd47aec5d464a9f228f19a9ac79097ebcaf46..6ea9808b8868d53a0c7cefd1926f921eadd82633 100644 (file)
@@ -27,6 +27,9 @@
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/clk.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/consumer.h>
 
 #include <mach/hardware.h>
 #include <asm/setup.h>
@@ -269,6 +272,46 @@ static void __init ek_add_device_buttons(void)
 static void __init ek_add_device_buttons(void) {}
 #endif
 
+#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
+static struct regulator_consumer_supply ek_audio_consumer_supplies[] = {
+       REGULATOR_SUPPLY("AVDD", "0-001b"),
+       REGULATOR_SUPPLY("HPVDD", "0-001b"),
+       REGULATOR_SUPPLY("DBVDD", "0-001b"),
+       REGULATOR_SUPPLY("DCVDD", "0-001b"),
+};
+
+static struct regulator_init_data ek_avdd_reg_init_data = {
+       .constraints    = {
+               .name   = "3V3",
+               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+       },
+       .consumer_supplies = ek_audio_consumer_supplies,
+       .num_consumer_supplies = ARRAY_SIZE(ek_audio_consumer_supplies),
+};
+
+static struct fixed_voltage_config ek_vdd_pdata = {
+       .supply_name    = "board-3V3",
+       .microvolts     = 3300000,
+       .gpio           = -EINVAL,
+       .enabled_at_boot = 0,
+       .init_data      = &ek_avdd_reg_init_data,
+};
+static struct platform_device ek_voltage_regulator = {
+       .name           = "reg-fixed-voltage",
+       .id             = -1,
+       .num_resources  = 0,
+       .dev            = {
+               .platform_data  = &ek_vdd_pdata,
+       },
+};
+static void __init ek_add_regulators(void)
+{
+       platform_device_register(&ek_voltage_regulator);
+}
+#else
+static void __init ek_add_regulators(void) {}
+#endif
+
 
 static struct i2c_board_info __initdata ek_i2c_devices[] = {
         {
@@ -294,6 +337,8 @@ static void __init ek_board_init(void)
        ek_add_device_nand();
        /* Ethernet */
        at91_add_device_eth(&ek_macb_data);
+       /* Regulators */
+       ek_add_regulators();
        /* MMC */
        at91_add_device_mmc(0, &ek_mmc_data);
        /* I2C */
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c
new file mode 100644 (file)
index 0000000..2c08ae4
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * linux/arch/arm/mach-at91/board-snapper9260.c
+ *
+ *  Copyright (C) 2010 Bluewater System Ltd
+ *
+ * Author: Andre Renaud <andre@bluewatersys.com>
+ * Author: Ryan Mallon  <ryan@bluewatersys.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/i2c/pca953x.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+#include <mach/hardware.h>
+#include <mach/board.h>
+#include <mach/at91sam9_smc.h>
+
+#include "sam9_smc.h"
+#include "generic.h"
+
+#define SNAPPER9260_IO_EXP_GPIO(x)     (NR_BUILTIN_GPIO + (x))
+
+static void __init snapper9260_map_io(void)
+{
+       at91sam9260_initialize(18432000);
+
+       /* Debug on ttyS0 */
+       at91_register_uart(0, 0, 0);
+       at91_set_serial_console(0);
+
+       at91_register_uart(AT91SAM9260_ID_US0, 1,
+                          ATMEL_UART_CTS | ATMEL_UART_RTS);
+       at91_register_uart(AT91SAM9260_ID_US1, 2,
+                          ATMEL_UART_CTS | ATMEL_UART_RTS);
+       at91_register_uart(AT91SAM9260_ID_US2, 3, 0);
+}
+
+static void __init snapper9260_init_irq(void)
+{
+       at91sam9260_init_interrupts(NULL);
+}
+
+static struct at91_usbh_data __initdata snapper9260_usbh_data = {
+       .ports          = 2,
+};
+
+static struct at91_udc_data __initdata snapper9260_udc_data = {
+       .vbus_pin               = SNAPPER9260_IO_EXP_GPIO(5),
+       .vbus_active_low        = 1,
+       .vbus_polled            = 1,
+};
+
+static struct at91_eth_data snapper9260_macb_data = {
+       .is_rmii        = 1,
+};
+
+static struct mtd_partition __initdata snapper9260_nand_partitions[] = {
+       {
+               .name   = "Preboot",
+               .offset = 0,
+               .size   = SZ_128K,
+       },
+       {
+               .name   = "Bootloader",
+               .offset = MTDPART_OFS_APPEND,
+               .size   = SZ_256K,
+       },
+       {
+               .name   = "Environment",
+               .offset = MTDPART_OFS_APPEND,
+               .size   = SZ_128K,
+       },
+       {
+               .name   = "Kernel",
+               .offset = MTDPART_OFS_APPEND,
+               .size   = SZ_4M,
+       },
+       {
+               .name   = "Filesystem",
+               .offset = MTDPART_OFS_APPEND,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct mtd_partition * __init
+snapper9260_nand_partition_info(int size, int *num_partitions)
+{
+       *num_partitions = ARRAY_SIZE(snapper9260_nand_partitions);
+       return snapper9260_nand_partitions;
+}
+
+static struct atmel_nand_data __initdata snapper9260_nand_data = {
+       .ale            = 21,
+       .cle            = 22,
+       .rdy_pin        = AT91_PIN_PC13,
+       .partition_info = snapper9260_nand_partition_info,
+       .bus_width_16   = 0,
+};
+
+static struct sam9_smc_config __initdata snapper9260_nand_smc_config = {
+       .ncs_read_setup         = 0,
+       .nrd_setup              = 0,
+       .ncs_write_setup        = 0,
+       .nwe_setup              = 0,
+
+       .ncs_read_pulse         = 5,
+       .nrd_pulse              = 2,
+       .ncs_write_pulse        = 5,
+       .nwe_pulse              = 2,
+
+       .read_cycle             = 7,
+       .write_cycle            = 7,
+
+       .mode                   = (AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
+                                  AT91_SMC_EXNWMODE_DISABLE),
+       .tdf_cycles             = 1,
+};
+
+static struct pca953x_platform_data snapper9260_io_expander_data = {
+       .gpio_base              = SNAPPER9260_IO_EXP_GPIO(0),
+};
+
+static struct i2c_board_info __initdata snapper9260_i2c_devices[] = {
+       {
+               /* IO expander */
+               I2C_BOARD_INFO("max7312", 0x28),
+               .platform_data = &snapper9260_io_expander_data,
+       },
+       {
+               /* Audio codec */
+               I2C_BOARD_INFO("tlv320aic23", 0x1a),
+       },
+       {
+               /* RTC */
+               I2C_BOARD_INFO("isl1208", 0x6f),
+       },
+};
+
+static void __init snapper9260_add_device_nand(void)
+{
+       at91_set_A_periph(AT91_PIN_PC14, 0);
+       sam9_smc_configure(3, &snapper9260_nand_smc_config);
+       at91_add_device_nand(&snapper9260_nand_data);
+}
+
+static void __init snapper9260_board_init(void)
+{
+       at91_add_device_i2c(snapper9260_i2c_devices,
+                           ARRAY_SIZE(snapper9260_i2c_devices));
+       at91_add_device_serial();
+       at91_add_device_usbh(&snapper9260_usbh_data);
+       at91_add_device_udc(&snapper9260_udc_data);
+       at91_add_device_eth(&snapper9260_macb_data);
+       at91_add_device_ssc(AT91SAM9260_ID_SSC, (ATMEL_SSC_TF | ATMEL_SSC_TK |
+                                                ATMEL_SSC_TD | ATMEL_SSC_RD));
+       snapper9260_add_device_nand();
+}
+
+MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module")
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91sam926x_timer,
+       .map_io         = snapper9260_map_io,
+       .init_irq       = snapper9260_init_irq,
+       .init_machine   = snapper9260_board_init,
+MACHINE_END
+
+
index d8c1ededaa75aea4ab8835ade94c2dda544068f7..9c6af97374851a72d2481a0fc4b03ba64781eff8 100644 (file)
@@ -84,7 +84,7 @@
  */
 #define AT91_ECC       (0xffffe200 - AT91_BASE_SYS)
 #define AT91_BCRAMC    (0xffffe400 - AT91_BASE_SYS)
-#define AT91_DDRSDRC   (0xffffe600 - AT91_BASE_SYS)
+#define AT91_DDRSDRC0  (0xffffe600 - AT91_BASE_SYS)
 #define AT91_SMC       (0xffffe800 - AT91_BASE_SYS)
 #define AT91_MATRIX    (0xffffea00 - AT91_BASE_SYS)
 #define AT91_CCFG      (0xffffeb10 - AT91_BASE_SYS)
index 1499b1cbffddbe6c3f0ff3d70617d2314d574ab4..976f4a6c33532e85e6a8053df737cf638c820827 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef AT91CAP9_DDRSDR_H
 #define AT91CAP9_DDRSDR_H
 
-#define AT91_DDRSDRC_MR                (AT91_DDRSDRC + 0x00)   /* Mode Register */
+#define AT91_DDRSDRC_MR                0x00    /* Mode Register */
 #define                AT91_DDRSDRC_MODE       (0xf << 0)              /* Command Mode */
 #define                        AT91_DDRSDRC_MODE_NORMAL                0
 #define                        AT91_DDRSDRC_MODE_NOP           1
 #define                        AT91_DDRSDRC_MODE_EXT_LMR       5
 #define                        AT91_DDRSDRC_MODE_DEEP          6
 
-#define AT91_DDRSDRC_RTR       (AT91_DDRSDRC + 0x04)   /* Refresh Timer Register */
+#define AT91_DDRSDRC_RTR       0x04    /* Refresh Timer Register */
 #define                AT91_DDRSDRC_COUNT      (0xfff << 0)            /* Refresh Timer Counter */
 
-#define AT91_DDRSDRC_CR                (AT91_DDRSDRC + 0x08)   /* Configuration Register */
+#define AT91_DDRSDRC_CR                0x08    /* Configuration Register */
 #define                AT91_DDRSDRC_NC         (3 << 0)                /* Number of Column Bits */
 #define                        AT91_DDRSDRC_NC_SDR8    (0 << 0)
 #define                        AT91_DDRSDRC_NC_SDR9    (1 << 0)
@@ -49,7 +49,7 @@
 #define                AT91_DDRSDRC_DLL        (1 << 7)                /* Reset DLL */
 #define                AT91_DDRSDRC_DICDS      (1 << 8)                /* Output impedance control */
 
-#define AT91_DDRSDRC_T0PR      (AT91_DDRSDRC + 0x0C)   /* Timing 0 Register */
+#define AT91_DDRSDRC_T0PR      0x0C    /* Timing 0 Register */
 #define                AT91_DDRSDRC_TRAS       (0xf <<  0)             /* Active to Precharge delay */
 #define                AT91_DDRSDRC_TRCD       (0xf <<  4)             /* Row to Column delay */
 #define                AT91_DDRSDRC_TWR        (0xf <<  8)             /* Write recovery delay */
 #define                AT91_DDRSDRC_TWTR       (1   << 24)             /* Internal Write to Read delay */
 #define                AT91_DDRSDRC_TMRD       (0xf << 28)             /* Load mode to active/refresh delay */
 
-#define AT91_DDRSDRC_T1PR      (AT91_DDRSDRC + 0x10)   /* Timing 1 Register */
+#define AT91_DDRSDRC_T1PR      0x10    /* Timing 1 Register */
 #define                AT91_DDRSDRC_TRFC       (0x1f << 0)             /* Row Cycle Delay */
 #define                AT91_DDRSDRC_TXSNR      (0xff << 8)             /* Exit self-refresh to non-read */
 #define                AT91_DDRSDRC_TXSRD      (0xff << 16)            /* Exit self-refresh to read */
 #define                AT91_DDRSDRC_TXP        (0xf  << 24)            /* Exit power-down delay */
 
-#define AT91_DDRSDRC_LPR       (AT91_DDRSDRC + 0x18)   /* Low Power Register */
+#define AT91_DDRSDRC_LPR       0x18    /* Low Power Register */
 #define                AT91_DDRSDRC_LPCB               (3 << 0)        /* Low-power Configurations */
 #define                        AT91_DDRSDRC_LPCB_DISABLE               0
 #define                        AT91_DDRSDRC_LPCB_SELF_REFRESH          1
 #define                        AT91_DDRSDRC_TIMEOUT_64_CLK_CYCLES      (1 << 12)
 #define                        AT91_DDRSDRC_TIMEOUT_128_CLK_CYCLES     (2 << 12)
 
-#define AT91_DDRSDRC_MDR       (AT91_DDRSDRC + 0x1C)   /* Memory Device Register */
+#define AT91_DDRSDRC_MDR       0x1C    /* Memory Device Register */
 #define                AT91_DDRSDRC_MD         (3 << 0)                /* Memory Device Type */
 #define                        AT91_DDRSDRC_MD_SDR             0
 #define                        AT91_DDRSDRC_MD_LOW_POWER_SDR   1
 #define                        AT91_DDRSDRC_MD_DDR             2
 #define                        AT91_DDRSDRC_MD_LOW_POWER_DDR   3
 
-#define AT91_DDRSDRC_DLLR      (AT91_DDRSDRC + 0x20)   /* DLL Information Register */
+#define AT91_DDRSDRC_DLLR      0x20    /* DLL Information Register */
 #define                AT91_DDRSDRC_MDINC      (1 << 0)                /* Master Delay increment */
 #define                AT91_DDRSDRC_MDDEC      (1 << 1)                /* Master Delay decrement */
 #define                AT91_DDRSDRC_MDOVF      (1 << 2)                /* Master Delay Overflow */
 #define                AT91_DDRSDRC_SDVAL      (0xff << 16)            /* Slave Delay value */
 #define                AT91_DDRSDRC_SDCVAL     (0xff << 24)            /* Slave Delay Correction value */
 
+/* Register access macros */
+#define at91_ramc_read(num, reg) \
+       at91_sys_read(AT91_DDRSDRC##num + reg)
+#define at91_ramc_write(num, reg, value) \
+       at91_sys_write(AT91_DDRSDRC##num + reg, value)
+
 
 #endif
index 43c396b9b4cb8cc1ceedf44bf24fe62ff225c880..4e79036d3b801849ea8f547e6dd6fdf8b16d894e 100644 (file)
@@ -84,7 +84,7 @@
  * System Peripherals (offset from AT91_BASE_SYS)
  */
 #define AT91_ECC       (0xffffe800 - AT91_BASE_SYS)
-#define AT91_SDRAMC    (0xffffea00 - AT91_BASE_SYS)
+#define AT91_SDRAMC0   (0xffffea00 - AT91_BASE_SYS)
 #define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
 #define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
 #define AT91_CCFG      (0xffffef10 - AT91_BASE_SYS)
index 87de8be17484be6966c7ee02bcf4a94620932e63..2b561851812952fe60e8b44fa1d44641fcdd81bc 100644 (file)
@@ -68,7 +68,7 @@
 /*
  * System Peripherals (offset from AT91_BASE_SYS)
  */
-#define AT91_SDRAMC    (0xffffea00 - AT91_BASE_SYS)
+#define AT91_SDRAMC0   (0xffffea00 - AT91_BASE_SYS)
 #define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
 #define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
 #define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
new file mode 100644 (file)
index 0000000..d27b15b
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Header file for the Atmel DDR/SDR SDRAM Controller
+ *
+ * Copyright (C) 2010 Atmel Corporation
+ *     Nicolas Ferre <nicolas.ferre@atmel.com>
+ *
+ * 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.
+ */
+#ifndef AT91SAM9_DDRSDR_H
+#define AT91SAM9_DDRSDR_H
+
+#define AT91_DDRSDRC_MR                0x00    /* Mode Register */
+#define                AT91_DDRSDRC_MODE       (0x7 << 0)              /* Command Mode */
+#define                        AT91_DDRSDRC_MODE_NORMAL        0
+#define                        AT91_DDRSDRC_MODE_NOP           1
+#define                        AT91_DDRSDRC_MODE_PRECHARGE     2
+#define                        AT91_DDRSDRC_MODE_LMR           3
+#define                        AT91_DDRSDRC_MODE_REFRESH       4
+#define                        AT91_DDRSDRC_MODE_EXT_LMR       5
+#define                        AT91_DDRSDRC_MODE_DEEP          6
+
+#define AT91_DDRSDRC_RTR       0x04    /* Refresh Timer Register */
+#define                AT91_DDRSDRC_COUNT      (0xfff << 0)            /* Refresh Timer Counter */
+
+#define AT91_DDRSDRC_CR                0x08    /* Configuration Register */
+#define                AT91_DDRSDRC_NC         (3 << 0)                /* Number of Column Bits */
+#define                        AT91_DDRSDRC_NC_SDR8    (0 << 0)
+#define                        AT91_DDRSDRC_NC_SDR9    (1 << 0)
+#define                        AT91_DDRSDRC_NC_SDR10   (2 << 0)
+#define                        AT91_DDRSDRC_NC_SDR11   (3 << 0)
+#define                        AT91_DDRSDRC_NC_DDR9    (0 << 0)
+#define                        AT91_DDRSDRC_NC_DDR10   (1 << 0)
+#define                        AT91_DDRSDRC_NC_DDR11   (2 << 0)
+#define                        AT91_DDRSDRC_NC_DDR12   (3 << 0)
+#define                AT91_DDRSDRC_NR         (3 << 2)                /* Number of Row Bits */
+#define                        AT91_DDRSDRC_NR_11      (0 << 2)
+#define                        AT91_DDRSDRC_NR_12      (1 << 2)
+#define                        AT91_DDRSDRC_NR_13      (2 << 2)
+#define                        AT91_DDRSDRC_NR_14      (3 << 2)
+#define                AT91_DDRSDRC_CAS        (7 << 4)                /* CAS Latency */
+#define                        AT91_DDRSDRC_CAS_2      (2 << 4)
+#define                        AT91_DDRSDRC_CAS_3      (3 << 4)
+#define                        AT91_DDRSDRC_CAS_25     (6 << 4)
+#define                AT91_DDRSDRC_RST_DLL    (1 << 7)                /* Reset DLL */
+#define                AT91_DDRSDRC_DICDS      (1 << 8)                /* Output impedance control */
+#define                AT91_DDRSDRC_DIS_DLL    (1 << 9)                /* Disable DLL */
+#define                AT91_DDRSDRC_OCD        (1 << 12)               /* Off-Chip Driver */
+#define                AT91_DDRSDRC_DQMS       (1 << 16)               /* Mask Data is Shared */
+#define                AT91_DDRSDRC_ACTBST     (1 << 18)               /* Active Bank X to Burst Stop Read Access Bank Y */
+
+#define AT91_DDRSDRC_T0PR      0x0C    /* Timing 0 Register */
+#define                AT91_DDRSDRC_TRAS       (0xf <<  0)             /* Active to Precharge delay */
+#define                AT91_DDRSDRC_TRCD       (0xf <<  4)             /* Row to Column delay */
+#define                AT91_DDRSDRC_TWR        (0xf <<  8)             /* Write recovery delay */
+#define                AT91_DDRSDRC_TRC        (0xf << 12)             /* Row cycle delay */
+#define                AT91_DDRSDRC_TRP        (0xf << 16)             /* Row precharge delay */
+#define                AT91_DDRSDRC_TRRD       (0xf << 20)             /* Active BankA to BankB */
+#define                AT91_DDRSDRC_TWTR       (0x7 << 24)             /* Internal Write to Read delay */
+#define                AT91_DDRSDRC_RED_WRRD   (0x1 << 27)             /* Reduce Write to Read Delay */
+#define                AT91_DDRSDRC_TMRD       (0xf << 28)             /* Load mode to active/refresh delay */
+
+#define AT91_DDRSDRC_T1PR      0x10    /* Timing 1 Register */
+#define                AT91_DDRSDRC_TRFC       (0x1f << 0)             /* Row Cycle Delay */
+#define                AT91_DDRSDRC_TXSNR      (0xff << 8)             /* Exit self-refresh to non-read */
+#define                AT91_DDRSDRC_TXSRD      (0xff << 16)            /* Exit self-refresh to read */
+#define                AT91_DDRSDRC_TXP        (0xf  << 24)            /* Exit power-down delay */
+
+#define AT91_DDRSDRC_T2PR      0x14    /* Timing 2 Register */
+#define                AT91_DDRSDRC_TXARD      (0xf  << 0)             /* Exit active power down delay to read command in mode "Fast Exit" */
+#define                AT91_DDRSDRC_TXARDS     (0xf  << 4)             /* Exit active power down delay to read command in mode "Slow Exit" */
+#define                AT91_DDRSDRC_TRPA       (0xf  << 8)             /* Row Precharge All delay */
+#define                AT91_DDRSDRC_TRTP       (0x7  << 12)            /* Read to Precharge delay */
+
+#define AT91_DDRSDRC_LPR       0x1C    /* Low Power Register */
+#define                AT91_DDRSDRC_LPCB       (3 << 0)                /* Low-power Configurations */
+#define                        AT91_DDRSDRC_LPCB_DISABLE               0
+#define                        AT91_DDRSDRC_LPCB_SELF_REFRESH          1
+#define                        AT91_DDRSDRC_LPCB_POWER_DOWN            2
+#define                        AT91_DDRSDRC_LPCB_DEEP_POWER_DOWN       3
+#define                AT91_DDRSDRC_CLKFR      (1 << 2)        /* Clock Frozen */
+#define                AT91_DDRSDRC_PASR       (7 << 4)        /* Partial Array Self Refresh */
+#define                AT91_DDRSDRC_TCSR       (3 << 8)        /* Temperature Compensated Self Refresh */
+#define                AT91_DDRSDRC_DS         (3 << 10)       /* Drive Strength */
+#define                AT91_DDRSDRC_TIMEOUT    (3 << 12)       /* Time to define when Low Power Mode is enabled */
+#define                        AT91_DDRSDRC_TIMEOUT_0_CLK_CYCLES       (0 << 12)
+#define                        AT91_DDRSDRC_TIMEOUT_64_CLK_CYCLES      (1 << 12)
+#define                        AT91_DDRSDRC_TIMEOUT_128_CLK_CYCLES     (2 << 12)
+#define                AT91_DDRSDRC_APDE       (1 << 16)        /* Active power down exit time */
+#define                AT91_DDRSDRC_UPD_MR     (3 << 20)        /* Update load mode register and extended mode register */
+
+#define AT91_DDRSDRC_MDR       0x20    /* Memory Device Register */
+#define                AT91_DDRSDRC_MD         (3 << 0)                /* Memory Device Type */
+#define                        AT91_DDRSDRC_MD_SDR             0
+#define                        AT91_DDRSDRC_MD_LOW_POWER_SDR   1
+#define                        AT91_DDRSDRC_MD_LOW_POWER_DDR   3
+#define                        AT91_DDRSDRC_MD_DDR2            6
+#define                AT91_DDRSDRC_DBW        (1 << 4)                /* Data Bus Width */
+#define                        AT91_DDRSDRC_DBW_32BITS         (0 <<  4)
+#define                        AT91_DDRSDRC_DBW_16BITS         (1 <<  4)
+
+#define AT91_DDRSDRC_DLL       0x24    /* DLL Information Register */
+#define                AT91_DDRSDRC_MDINC      (1 << 0)                /* Master Delay increment */
+#define                AT91_DDRSDRC_MDDEC      (1 << 1)                /* Master Delay decrement */
+#define                AT91_DDRSDRC_MDOVF      (1 << 2)                /* Master Delay Overflow */
+#define                AT91_DDRSDRC_MDVAL      (0xff <<  8)            /* Master Delay value */
+
+#define AT91_DDRSDRC_HS                0x2C    /* High Speed Register */
+#define                AT91_DDRSDRC_DIS_ATCP_RD        (1 << 2)        /* Anticip read access is disabled */
+
+#define AT91_DDRSDRC_DELAY(n)  (0x30 + (0x4 * (n)))    /* Delay I/O Register n */
+
+#define AT91_DDRSDRC_WPMR      0xE4    /* Write Protect Mode Register */
+#define                AT91_DDRSDRC_WP         (1 << 0)                /* Write protect enable */
+#define                AT91_DDRSDRC_WPKEY      (0xffffff << 8)         /* Write protect key */
+#define                AT91_DDRSDRC_KEY        (0x444452 << 8)         /* Write protect key = "DDR" */
+
+#define AT91_DDRSDRC_WPSR      0xE8    /* Write Protect Status Register */
+#define                AT91_DDRSDRC_WPVS       (1 << 0)                /* Write protect violation status */
+#define                AT91_DDRSDRC_WPVSRC     (0xffff << 8)           /* Write protect violation source */
+
+/* Register access macros */
+#define at91_ramc_read(num, reg) \
+       at91_sys_read(AT91_DDRSDRC##num + reg)
+#define at91_ramc_write(num, reg, value) \
+       at91_sys_write(AT91_DDRSDRC##num + reg, value)
+
+#endif
index b7260389f7cac2a51937143c10e55e3e75ee8aa9..100f5a592926356db536780996a7796ff6856e91 100644 (file)
@@ -17,7 +17,7 @@
 #define AT91SAM9_SDRAMC_H
 
 /* SDRAM Controller (SDRAMC) registers */
-#define AT91_SDRAMC_MR         (AT91_SDRAMC + 0x00)    /* SDRAM Controller Mode Register */
+#define AT91_SDRAMC_MR         0x00    /* SDRAM Controller Mode Register */
 #define                AT91_SDRAMC_MODE        (0xf << 0)              /* Command Mode */
 #define                        AT91_SDRAMC_MODE_NORMAL         0
 #define                        AT91_SDRAMC_MODE_NOP            1
 #define                        AT91_SDRAMC_MODE_EXT_LMR        5
 #define                        AT91_SDRAMC_MODE_DEEP           6
 
-#define AT91_SDRAMC_TR         (AT91_SDRAMC + 0x04)    /* SDRAM Controller Refresh Timer Register */
+#define AT91_SDRAMC_TR         0x04    /* SDRAM Controller Refresh Timer Register */
 #define                AT91_SDRAMC_COUNT       (0xfff << 0)            /* Refresh Timer Counter */
 
-#define AT91_SDRAMC_CR         (AT91_SDRAMC + 0x08)    /* SDRAM Controller Configuration Register */
+#define AT91_SDRAMC_CR         0x08    /* SDRAM Controller Configuration Register */
 #define                AT91_SDRAMC_NC          (3 << 0)                /* Number of Column Bits */
 #define                        AT91_SDRAMC_NC_8        (0 << 0)
 #define                        AT91_SDRAMC_NC_9        (1 << 0)
@@ -57,7 +57,7 @@
 #define                AT91_SDRAMC_TRAS        (0xf << 24)             /* Active to Precharge Delay */
 #define                AT91_SDRAMC_TXSR        (0xf << 28)             /* Exit Self Refresh to Active Delay */
 
-#define AT91_SDRAMC_LPR                (AT91_SDRAMC + 0x10)    /* SDRAM Controller Low Power Register */
+#define AT91_SDRAMC_LPR                0x10    /* SDRAM Controller Low Power Register */
 #define                AT91_SDRAMC_LPCB                (3 << 0)        /* Low-power Configurations */
 #define                        AT91_SDRAMC_LPCB_DISABLE                0
 #define                        AT91_SDRAMC_LPCB_SELF_REFRESH           1
 #define                        AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES       (1 << 12)
 #define                        AT91_SDRAMC_TIMEOUT_128_CLK_CYCLES      (2 << 12)
 
-#define AT91_SDRAMC_IER                (AT91_SDRAMC + 0x14)    /* SDRAM Controller Interrupt Enable Register */
-#define AT91_SDRAMC_IDR                (AT91_SDRAMC + 0x18)    /* SDRAM Controller Interrupt Disable Register */
-#define AT91_SDRAMC_IMR                (AT91_SDRAMC + 0x1C)    /* SDRAM Controller Interrupt Mask Register */
-#define AT91_SDRAMC_ISR                (AT91_SDRAMC + 0x20)    /* SDRAM Controller Interrupt Status Register */
+#define AT91_SDRAMC_IER                0x14    /* SDRAM Controller Interrupt Enable Register */
+#define AT91_SDRAMC_IDR                0x18    /* SDRAM Controller Interrupt Disable Register */
+#define AT91_SDRAMC_IMR                0x1C    /* SDRAM Controller Interrupt Mask Register */
+#define AT91_SDRAMC_ISR                0x20    /* SDRAM Controller Interrupt Status Register */
 #define                AT91_SDRAMC_RES         (1 << 0)                /* Refresh Error Status */
 
-#define AT91_SDRAMC_MDR                (AT91_SDRAMC + 0x24)    /* SDRAM Memory Device Register */
+#define AT91_SDRAMC_MDR                0x24    /* SDRAM Memory Device Register */
 #define                AT91_SDRAMC_MD          (3 << 0)                /* Memory Device Type */
 #define                        AT91_SDRAMC_MD_SDRAM            0
 #define                        AT91_SDRAMC_MD_LOW_POWER_SDRAM  1
 
+/* Register access macros */
+#define at91_ramc_read(num, reg) \
+       at91_sys_read(AT91_SDRAMC##num + reg)
+#define at91_ramc_write(num, reg, value) \
+       at91_sys_write(AT91_SDRAMC##num + reg, value)
 
 #endif
index fc2de6c09c86a67c21073e405144ad17d94f8f64..87ba8517ad98291a12749853cfc7379e021c4997 100644 (file)
@@ -74,7 +74,7 @@
  */
 #define AT91_DMA       (0xffffe600 - AT91_BASE_SYS)
 #define AT91_ECC       (0xffffe800 - AT91_BASE_SYS)
-#define AT91_SDRAMC    (0xffffea00 - AT91_BASE_SYS)
+#define AT91_SDRAMC0   (0xffffea00 - AT91_BASE_SYS)
 #define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
 #define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
 #define AT91_CCFG      (0xffffef10 - AT91_BASE_SYS)
index df2ed848c9f89b0e9f2e0bb3ee6a7c8d0fd631d5..58528aa9c8a86ddea8286cfb9ebdac7e26ed6942 100644 (file)
@@ -44,6 +44,8 @@
  /* USB Device */
 struct at91_udc_data {
        u8      vbus_pin;               /* high == host powering us */
+       u8      vbus_active_low;        /* vbus polarity */
+       u8      vbus_polled;            /* Use polling, not interrupt */
        u8      pullup_pin;             /* active == D+ pulled up */
        u8      pullup_active_low;      /* true == pullup_pin is active low */
 };
index 833659d1200ac057faff56ccd567de4ad718e09b..3bef931d0b1c915b5de540ee860dcf37cf27cba6 100644 (file)
@@ -52,6 +52,7 @@ static inline unsigned long at91_cpu_fully_identify(void)
 
 #define ARCH_EXID_AT91SAM9M11  0x00000001
 #define ARCH_EXID_AT91SAM9M10  0x00000002
+#define ARCH_EXID_AT91SAM9G46  0x00000003
 #define ARCH_EXID_AT91SAM9G45  0x00000004
 
 static inline unsigned long at91_exid_identify(void)
@@ -128,9 +129,18 @@ static inline unsigned long at91cap9_rev_identify(void)
 #ifdef CONFIG_ARCH_AT91SAM9G45
 #define cpu_is_at91sam9g45()   (at91_cpu_identify() == ARCH_ID_AT91SAM9G45)
 #define cpu_is_at91sam9g45es() (at91_cpu_fully_identify() == ARCH_ID_AT91SAM9G45ES)
+#define cpu_is_at91sam9m10()    (cpu_is_at91sam9g45() && \
+                                (at91_exid_identify() == ARCH_EXID_AT91SAM9M10))
+#define cpu_is_at91sam9m46()    (cpu_is_at91sam9g45() && \
+                                (at91_exid_identify() == ARCH_EXID_AT91SAM9G46))
+#define cpu_is_at91sam9m11()    (cpu_is_at91sam9g45() && \
+                                (at91_exid_identify() == ARCH_EXID_AT91SAM9M11))
 #else
 #define cpu_is_at91sam9g45()   (0)
 #define cpu_is_at91sam9g45es() (0)
+#define cpu_is_at91sam9m10()   (0)
+#define cpu_is_at91sam9g46()   (0)
+#define cpu_is_at91sam9m11()   (0)
 #endif
 
 #ifdef CONFIG_ARCH_AT91CAP9
index 04c91e31c9c5be8a7c20ca5a31b6ebef99963f89..bfdd8ab26dc8a2399a379058df2e9a04f41c2888 100644 (file)
@@ -19,6 +19,7 @@
 #define PIN_BASE               NR_AIC_IRQS
 
 #define MAX_GPIO_BANKS         5
+#define NR_BUILTIN_GPIO                (PIN_BASE + (MAX_GPIO_BANKS * 32))
 
 /* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */
 
index 08322c44df1a98d287c0247321158de4d41bb99c..8c87d0c1b8f8b9b9dc0383bff155798454a6460f 100644 (file)
@@ -30,14 +30,50 @@ static inline u32 sdram_selfrefresh_enable(void)
 {
        u32 saved_lpr, lpr;
 
-       saved_lpr = at91_sys_read(AT91_DDRSDRC_LPR);
+       saved_lpr = at91_ramc_read(0, AT91_DDRSDRC_LPR);
 
        lpr = saved_lpr & ~AT91_DDRSDRC_LPCB;
-       at91_sys_write(AT91_DDRSDRC_LPR, lpr | AT91_DDRSDRC_LPCB_SELF_REFRESH);
+       at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr | AT91_DDRSDRC_LPCB_SELF_REFRESH);
        return saved_lpr;
 }
 
-#define sdram_selfrefresh_disable(saved_lpr)   at91_sys_write(AT91_DDRSDRC_LPR, saved_lpr)
+#define sdram_selfrefresh_disable(saved_lpr)   at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr)
+
+#elif defined(CONFIG_ARCH_AT91SAM9G45)
+#include <mach/at91sam9_ddrsdr.h>
+
+/* We manage both DDRAM/SDRAM controllers, we need more than one value to
+ * remember.
+ */
+static u32 saved_lpr1;
+
+static inline u32 sdram_selfrefresh_enable(void)
+{
+       /* Those tow values allow us to delay self-refresh activation
+        * to the maximum. */
+       u32 lpr0, lpr1;
+       u32 saved_lpr0;
+
+       saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR);
+       lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB;
+       lpr1 |= AT91_DDRSDRC_LPCB_SELF_REFRESH;
+
+       saved_lpr0 = at91_ramc_read(0, AT91_DDRSDRC_LPR);
+       lpr0 = saved_lpr0 & ~AT91_DDRSDRC_LPCB;
+       lpr0 |= AT91_DDRSDRC_LPCB_SELF_REFRESH;
+
+       /* self-refresh mode now */
+       at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0);
+       at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1);
+
+       return saved_lpr0;
+}
+
+#define sdram_selfrefresh_disable(saved_lpr0)  \
+       do { \
+               at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); \
+               at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); \
+       } while (0)
 
 #else
 #include <mach/at91sam9_sdramc.h>
@@ -47,7 +83,6 @@ static inline u32 sdram_selfrefresh_enable(void)
  * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
  * handle those cases both here and in the Suspend-To-RAM support.
  */
-#define        AT91_SDRAMC     AT91_SDRAMC0
 #warning Assuming EB1 SDRAM controller is *NOT* used
 #endif
 
@@ -55,13 +90,13 @@ static inline u32 sdram_selfrefresh_enable(void)
 {
        u32 saved_lpr, lpr;
 
-       saved_lpr = at91_sys_read(AT91_SDRAMC_LPR);
+       saved_lpr = at91_ramc_read(0, AT91_SDRAMC_LPR);
 
        lpr = saved_lpr & ~AT91_SDRAMC_LPCB;
-       at91_sys_write(AT91_SDRAMC_LPR, lpr | AT91_SDRAMC_LPCB_SELF_REFRESH);
+       at91_ramc_write(0, AT91_SDRAMC_LPR, lpr | AT91_SDRAMC_LPCB_SELF_REFRESH);
        return saved_lpr;
 }
 
-#define sdram_selfrefresh_disable(saved_lpr)   at91_sys_write(AT91_SDRAMC_LPR, saved_lpr)
+#define sdram_selfrefresh_disable(saved_lpr)   at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr)
 
 #endif
index 9c5b48e68a71343e26f2f17c4856886fc0509373..b6b00a1f612546eb463036214455336381560e37 100644 (file)
 #include <mach/hardware.h>
 #include <mach/at91_pmc.h>
 
-#ifdef CONFIG_ARCH_AT91RM9200
+#if defined(CONFIG_ARCH_AT91RM9200)
 #include <mach/at91rm9200_mc.h>
 #elif defined(CONFIG_ARCH_AT91CAP9)
 #include <mach/at91cap9_ddrsdr.h>
+#elif defined(CONFIG_ARCH_AT91SAM9G45)
+#include <mach/at91sam9_ddrsdr.h>
 #else
 #include <mach/at91sam9_sdramc.h>
 #endif
@@ -30,7 +32,6 @@
  * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
  * handle those cases both here and in the Suspend-To-RAM support.
  */
-#define AT91_SDRAMC    AT91_SDRAMC0
 #warning Assuming EB1 SDRAM controller is *NOT* used
 #endif
 
@@ -113,12 +114,14 @@ ENTRY(at91_slow_clock)
        /*
         * Register usage:
         *  R1 = Base address of AT91_PMC
-        *  R2 = Base address of AT91_SDRAMC (or AT91_SYS on AT91RM9200)
+        *  R2 = Base address of RAM Controller (SDRAM, DDRSDR, or AT91_SYS)
         *  R3 = temporary register
         *  R4 = temporary register
+        *  R5 = Base address of second RAM Controller or 0 if not present
         */
        ldr     r1, .at91_va_base_pmc
        ldr     r2, .at91_va_base_sdramc
+       ldr     r5, .at91_va_base_ramc1
 
        /* Drain write buffer */
        mcr     p15, 0, r0, c7, c10, 4
@@ -127,20 +130,33 @@ ENTRY(at91_slow_clock)
        /* Put SDRAM in self-refresh mode */
        mov     r3, #1
        str     r3, [r2, #AT91_SDRAMC_SRR]
-#elif defined(CONFIG_ARCH_AT91CAP9)
-       /* Enable SDRAM self-refresh mode */
-       ldr     r3, [r2, #AT91_DDRSDRC_LPR - AT91_DDRSDRC]
-       str     r3, .saved_sam9_lpr
+#elif defined(CONFIG_ARCH_AT91CAP9) \
+       || defined(CONFIG_ARCH_AT91SAM9G45)
 
-       mov     r3, #AT91_DDRSDRC_LPCB_SELF_REFRESH
-       str     r3, [r2, #AT91_DDRSDRC_LPR - AT91_DDRSDRC]
+       /* prepare for DDRAM self-refresh mode */
+       ldr     r3, [r2, #AT91_DDRSDRC_LPR]
+       str     r3, .saved_sam9_lpr
+       bic     r3, #AT91_DDRSDRC_LPCB
+       orr     r3, #AT91_DDRSDRC_LPCB_SELF_REFRESH
+
+       /* figure out if we use the second ram controller */
+       cmp     r5, #0
+       ldrne   r4, [r5, #AT91_DDRSDRC_LPR]
+       strne   r4, .saved_sam9_lpr1
+       bicne   r4, #AT91_DDRSDRC_LPCB
+       orrne   r4, #AT91_DDRSDRC_LPCB_SELF_REFRESH
+
+       /* Enable DDRAM self-refresh mode */
+       str     r3, [r2, #AT91_DDRSDRC_LPR]
+       strne   r4, [r5, #AT91_DDRSDRC_LPR]
 #else
        /* Enable SDRAM self-refresh mode */
-       ldr     r3, [r2, #AT91_SDRAMC_LPR - AT91_SDRAMC]
+       ldr     r3, [r2, #AT91_SDRAMC_LPR]
        str     r3, .saved_sam9_lpr
 
-       mov     r3, #AT91_SDRAMC_LPCB_SELF_REFRESH
-       str     r3, [r2, #AT91_SDRAMC_LPR - AT91_SDRAMC]
+       bic     r3, #AT91_SDRAMC_LPCB
+       orr     r3, #AT91_SDRAMC_LPCB_SELF_REFRESH
+       str     r3, [r2, #AT91_SDRAMC_LPR]
 #endif
 
        /* Save Master clock setting */
@@ -247,14 +263,21 @@ ENTRY(at91_slow_clock)
 
 #ifdef CONFIG_ARCH_AT91RM9200
        /* Do nothing - self-refresh is automatically disabled. */
-#elif defined(CONFIG_ARCH_AT91CAP9)
-       /* Restore LPR on AT91CAP9 */
+#elif defined(CONFIG_ARCH_AT91CAP9) \
+       || defined(CONFIG_ARCH_AT91SAM9G45)
+       /* Restore LPR on AT91 with DDRAM */
        ldr     r3, .saved_sam9_lpr
-       str     r3, [r2, #AT91_DDRSDRC_LPR - AT91_DDRSDRC]
+       str     r3, [r2, #AT91_DDRSDRC_LPR]
+
+       /* if we use the second ram controller */
+       cmp     r5, #0
+       ldrne   r4, .saved_sam9_lpr1
+       strne   r4, [r5, #AT91_DDRSDRC_LPR]
+
 #else
-       /* Restore LPR on AT91SAM9 */
+       /* Restore LPR on AT91 with SDRAM */
        ldr     r3, .saved_sam9_lpr
-       str     r3, [r2, #AT91_SDRAMC_LPR - AT91_SDRAMC]
+       str     r3, [r2, #AT91_SDRAMC_LPR]
 #endif
 
        /* Restore registers, and return */
@@ -273,18 +296,29 @@ ENTRY(at91_slow_clock)
 .saved_sam9_lpr:
        .word 0
 
+.saved_sam9_lpr1:
+       .word 0
+
 .at91_va_base_pmc:
        .word AT91_VA_BASE_SYS + AT91_PMC
 
 #ifdef CONFIG_ARCH_AT91RM9200
 .at91_va_base_sdramc:
        .word AT91_VA_BASE_SYS
-#elif defined(CONFIG_ARCH_AT91CAP9)
+#elif defined(CONFIG_ARCH_AT91CAP9) \
+       || defined(CONFIG_ARCH_AT91SAM9G45)
 .at91_va_base_sdramc:
-       .word AT91_VA_BASE_SYS + AT91_DDRSDRC
+       .word AT91_VA_BASE_SYS + AT91_DDRSDRC0
 #else
 .at91_va_base_sdramc:
-       .word AT91_VA_BASE_SYS + AT91_SDRAMC
+       .word AT91_VA_BASE_SYS + AT91_SDRAMC0
+#endif
+
+.at91_va_base_ramc1:
+#if defined(CONFIG_ARCH_AT91SAM9G45)
+       .word AT91_VA_BASE_SYS + AT91_DDRSDRC1
+#else
+       .word 0
 #endif
 
 ENTRY(at91_slow_clock_sz)
index 72e405df0fb07dd4b363153f149742875725f7ad..d3f959e92b2dd2ef15e129a3bd79e52801811efe 100644 (file)
@@ -91,14 +91,23 @@ static struct clk uart_clk = {
        .parent = &pll1_clk,
 };
 
+static struct clk dummy_apb_pclk = {
+       .name = "BUSCLK",
+       .type = CLK_TYPE_PRIMARY,
+       .mode = CLK_MODE_XTAL,
+};
+
 static struct clk_lookup lookups[] = {
-       {                       /* UART0 */
-        .dev_id = "uarta",
-        .clk = &uart_clk,
-        }, {                   /* UART1 */
-            .dev_id = "uartb",
-            .clk = &uart_clk,
-            }
+       {                       /* Bus clock */
+               .con_id = "apb_pclk",
+               .clk = &dummy_apb_pclk,
+       }, {                    /* UART0 */
+               .dev_id = "uarta",
+               .clk = &uart_clk,
+       }, {                    /* UART1 */
+               .dev_id = "uartb",
+               .clk = &uart_clk,
+       }
 };
 
 static struct amba_device *amba_devs[] __initdata = {
index dbaae5f746a1ced107faf56439c7f2bf71bc845c..eb34bd1251d491224f95216ca882070baa5933ce 100644 (file)
@@ -30,7 +30,6 @@ config ARCH_CLEP7312
 config ARCH_EDB7211
        bool "EDB7211"
        select ISA
-       select ARCH_DISCONTIGMEM_ENABLE
        select ARCH_SPARSEMEM_ENABLE
        select ARCH_SELECT_MEMORY_MODEL
        help
index 09fb57e452130d0766f4fe3eab0219138572ea13..3c3bf45039ff05f44c122adbc3bb1cceded613ab 100644 (file)
@@ -32,7 +32,6 @@ fixup_clep7312(struct machine_desc *desc, struct tag *tags,
        mi->nr_banks=1;
        mi->bank[0].start = 0xc0000000;
        mi->bank[0].size = 0x01000000;
-       mi->bank[0].node = 0;
 }
 
 
index dc81cc68595de96edd2f9e2679d1cd855bace03f..4a7a2322979a17c3dcb833bf44122f8af51bba8a 100644 (file)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <linux/init.h>
+#include <linux/memblock.h>
 #include <linux/types.h>
 #include <linux/string.h>
 
 
 extern void edb7211_map_io(void);
 
+/* Reserve screen memory region at the start of main system memory. */
+static void __init edb7211_reserve(void)
+{
+       memblock_reserve(PHYS_OFFSET, 0x00020000);
+}
+
 static void __init
 fixup_edb7211(struct machine_desc *desc, struct tag *tags,
              char **cmdline, struct meminfo *mi)
@@ -43,10 +50,8 @@ fixup_edb7211(struct machine_desc *desc, struct tag *tags,
         */
        mi->bank[0].start = 0xc0000000;
        mi->bank[0].size = 8*1024*1024;
-       mi->bank[0].node = 0;
        mi->bank[1].start = 0xc1000000;
        mi->bank[1].size = 8*1024*1024;
-       mi->bank[1].node = 1;
        mi->nr_banks = 2;
 }
 
@@ -57,6 +62,7 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
        .boot_params    = 0xc0020100,   /* 0xc0000000 - 0xc001ffff can be video RAM */
        .fixup          = fixup_edb7211,
        .map_io         = edb7211_map_io,
+       .reserve        = edb7211_reserve,
        .init_irq       = clps711x_init_irq,
        .timer          = &clps711x_timer,
 MACHINE_END
index 7430e4049d87b1ca789b372f2641c4088547c31c..a696099aa4f8f22ddd32e836b4bbb124acdc4ea0 100644 (file)
@@ -39,7 +39,6 @@ struct meminfo memmap = {
                {
                        .start  = 0xC0000000,
                        .size   = 0x01000000,
-                       .node   = 0
                },
        },
 };
index fedd8076a689a3555a986b5e96bc9348cf4ae77f..072cc6b61ba30b7b6e363040b40d409e8a43e38f 100644 (file)
@@ -11,6 +11,7 @@
  *
 */
 
+#include <mach/hardware.h>
 #include <asm/hardware/clps7111.h>
 
                .macro  addruart, rx, tmp
index f70d52be48a2a61c88b7276a830b7b3abf17aee5..f45c8e892cb5a0ae9cdf0c9cd2c78c2dfa61bb07 100644 (file)
@@ -20,7 +20,6 @@
 #ifndef __ASM_ARCH_MEMORY_H
 #define __ASM_ARCH_MEMORY_H
 
-
 /*
  * Physical DRAM offset.
  */
@@ -72,7 +71,6 @@
  *     node 2:  0xd0000000 - 0xd7ffffff
  *     node 3:  0xd8000000 - 0xdfffffff
  */
-#define NODE_MEM_SIZE_BITS     24
 #define SECTION_SIZE_BITS      24
 #define MAX_PHYSMEM_BITS       32
 
index 2ec3095ffb7b564e61a54bcc4e366f32b87e671c..b280efb1fa120806b1cfe85bdea1f90d1bc0caaf 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/tps6507x.h>
 #include <linux/mfd/tps6507x.h>
 #include <linux/input/tps6507x-ts.h>
 
@@ -469,6 +470,11 @@ struct regulator_consumer_supply tps65070_ldo2_consumers[] = {
        },
 };
 
+/* We take advantage of the fact that both defdcdc{2,3} are tied high */
+static struct tps6507x_reg_platform_data tps6507x_platform_data = {
+       .defdcdc_default = true,
+};
+
 struct regulator_init_data tps65070_regulator_data[] = {
        /* dcdc1 */
        {
@@ -494,6 +500,7 @@ struct regulator_init_data tps65070_regulator_data[] = {
                },
                .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers),
                .consumer_supplies = tps65070_dcdc2_consumers,
+               .driver_data = &tps6507x_platform_data,
        },
 
        /* dcdc3 */
@@ -507,6 +514,7 @@ struct regulator_init_data tps65070_regulator_data[] = {
                },
                .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers),
                .consumer_supplies = tps65070_dcdc3_consumers,
+               .driver_data = &tps6507x_platform_data,
        },
 
        /* ldo1 */
index a91edfb8beeac3109542989c957256436fd5a5c8..22eb97c1c30b48c89e6e2f397f73ee5727f5240a 100644 (file)
  * below 128M
  */
 static inline void
-__arch_adjust_zones(int node, unsigned long *size, unsigned long *holes)
+__arch_adjust_zones(unsigned long *size, unsigned long *holes)
 {
        unsigned int sz = (128<<20) >> PAGE_SHIFT;
 
-       if (node != 0)
-               sz = 0;
-
        size[1] = size[0] - sz;
        size[0] = sz;
 }
 
-#define arch_adjust_zones(node, zone_size, holes) \
-        if ((meminfo.bank[0].size >> 20) > 128) __arch_adjust_zones(node, zone_size, holes)
+#define arch_adjust_zones(zone_size, holes) \
+        if ((meminfo.bank[0].size >> 20) > 128) __arch_adjust_zones(zone_size, holes)
 
 #define ISA_DMA_THRESHOLD      (PHYS_OFFSET + (128<<20) - 1)
 #define MAX_DMA_ADDRESS                (PAGE_OFFSET + (128<<20))
index 3a1a855bfdcace3e35591a50ede18edb6f2a1ec3..f744f676783f3024c0d18be2bff733432b260d9c 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
 
 #include <mach/hardware.h>
 
 #include <asm/mach/arch.h>
 
 
-static struct physmap_flash_data adssphere_flash_data = {
-       .width          = 4,
-};
-
-static struct resource adssphere_flash_resource = {
-       .start          = EP93XX_CS6_PHYS_BASE,
-       .end            = EP93XX_CS6_PHYS_BASE + SZ_32M - 1,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device adssphere_flash = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &adssphere_flash_data,
-       },
-       .num_resources  = 1,
-       .resource       = &adssphere_flash_resource,
-};
-
 static struct ep93xx_eth_data __initdata adssphere_eth_data = {
        .phy_id         = 1,
 };
@@ -48,8 +27,7 @@ static struct ep93xx_eth_data __initdata adssphere_eth_data = {
 static void __init adssphere_init_machine(void)
 {
        ep93xx_init_devices();
-       platform_device_register(&adssphere_flash);
-
+       ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M);
        ep93xx_register_eth(&adssphere_eth_data, 1);
 }
 
index e29bdef9b2e201ea345c4139487e4895dffad94d..7f3039761d91aecf0c0c46c84424f5ad4c1bf743 100644 (file)
@@ -185,7 +185,7 @@ static struct clk_lookup clocks[] = {
        INIT_CK(NULL,                   "pll1",         &clk_pll1),
        INIT_CK(NULL,                   "fclk",         &clk_f),
        INIT_CK(NULL,                   "hclk",         &clk_h),
-       INIT_CK(NULL,                   "pclk",         &clk_p),
+       INIT_CK(NULL,                   "apb_pclk",     &clk_p),
        INIT_CK(NULL,                   "pll2",         &clk_pll2),
        INIT_CK("ep93xx-ohci",          NULL,           &clk_usb_host),
        INIT_CK("ep93xx-keypad",        NULL,           &clk_keypad),
index 9092677f63eb739a529d137b5b1be891b11f53da..8e37a045188cbcf4bc334d521186b8d4a2871d5d 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/termios.h>
 #include <linux/amba/bus.h>
 #include <linux/amba/serial.h>
+#include <linux/mtd/physmap.h>
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
 #include <linux/spi/spi.h>
@@ -215,8 +216,8 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits)
        spin_lock_irqsave(&syscon_swlock, flags);
 
        val = __raw_readl(EP93XX_SYSCON_DEVCFG);
-       val |= set_bits;
        val &= ~clear_bits;
+       val |= set_bits;
        __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
        __raw_writel(val, EP93XX_SYSCON_DEVCFG);
 
@@ -347,6 +348,43 @@ static struct platform_device ep93xx_ohci_device = {
 };
 
 
+/*************************************************************************
+ * EP93xx physmap'ed flash
+ *************************************************************************/
+static struct physmap_flash_data ep93xx_flash_data;
+
+static struct resource ep93xx_flash_resource = {
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device ep93xx_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &ep93xx_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &ep93xx_flash_resource,
+};
+
+/**
+ * ep93xx_register_flash() - Register the external flash device.
+ * @width:     bank width in octets
+ * @start:     resource start address
+ * @size:      resource size
+ */
+void __init ep93xx_register_flash(unsigned int width,
+                                 resource_size_t start, resource_size_t size)
+{
+       ep93xx_flash_data.width         = width;
+
+       ep93xx_flash_resource.start     = start;
+       ep93xx_flash_resource.end       = start + size - 1;
+
+       platform_device_register(&ep93xx_flash);
+}
+
+
 /*************************************************************************
  * EP93xx ethernet peripheral handling
  *************************************************************************/
@@ -620,6 +658,11 @@ static struct platform_device ep93xx_fb_device = {
        .resource               = ep93xx_fb_resource,
 };
 
+static struct platform_device ep93xx_bl_device = {
+       .name           = "ep93xx-bl",
+       .id             = -1,
+};
+
 /**
  * ep93xx_register_fb - Register the framebuffer platform device.
  * @data:      platform specific framebuffer configuration (__initdata)
@@ -628,6 +671,7 @@ void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data)
 {
        ep93xxfb_data = *data;
        platform_device_register(&ep93xx_fb_device);
+       platform_device_register(&ep93xx_bl_device);
 }
 
 
index 3884182cd3623e8799b00323115d097f1894e4e9..c2ce9034ba87f5b856cb6e1cae89fb69060b8ffe 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
 #include <linux/gpio.h>
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
 #include <asm/mach/arch.h>
 
 
-static struct physmap_flash_data edb93xx_flash_data;
-
-static struct resource edb93xx_flash_resource = {
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device edb93xx_flash = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &edb93xx_flash_data,
-       },
-       .num_resources  = 1,
-       .resource       = &edb93xx_flash_resource,
-};
-
-static void __init __edb93xx_register_flash(unsigned int width,
-                       resource_size_t start, resource_size_t size)
-{
-       edb93xx_flash_data.width        = width;
-       edb93xx_flash_resource.start    = start;
-       edb93xx_flash_resource.end      = start + size - 1;
-
-       platform_device_register(&edb93xx_flash);
-}
-
 static void __init edb93xx_register_flash(void)
 {
        if (machine_is_edb9307() || machine_is_edb9312() ||
            machine_is_edb9315()) {
-               __edb93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M);
+               ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M);
        } else {
-               __edb93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
+               ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
        }
 }
 
index a809618e9f059043b706bf25e57ffcf070dd3ff4..d97168c0ba336fa22179328b9dc72316807c13bb 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
 
 #include <mach/hardware.h>
 
 #include <asm/mach/arch.h>
 
 
-static struct physmap_flash_data gesbc9312_flash_data = {
-       .width          = 4,
-};
-
-static struct resource gesbc9312_flash_resource = {
-       .start          = EP93XX_CS6_PHYS_BASE,
-       .end            = EP93XX_CS6_PHYS_BASE + SZ_8M - 1,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device gesbc9312_flash = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &gesbc9312_flash_data,
-       },
-       .num_resources  = 1,
-       .resource       = &gesbc9312_flash_resource,
-};
-
 static struct ep93xx_eth_data __initdata gesbc9312_eth_data = {
        .phy_id         = 1,
 };
@@ -48,8 +27,7 @@ static struct ep93xx_eth_data __initdata gesbc9312_eth_data = {
 static void __init gesbc9312_init_machine(void)
 {
        ep93xx_init_devices();
-       platform_device_register(&gesbc9312_flash);
-
+       ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_8M);
        ep93xx_register_eth(&gesbc9312_eth_data, 0);
 }
 
index 9a4413dd44bb6e1cd2ac6cbc291cfd87b7220d6f..a6c09176334ce1a7028705feeddfc38ddadf235e 100644 (file)
@@ -43,6 +43,9 @@ static inline void ep93xx_devcfg_clear_bits(unsigned int bits)
 
 unsigned int ep93xx_chip_revision(void);
 
+void ep93xx_register_flash(unsigned int width,
+                          resource_size_t start, resource_size_t size);
+
 void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr);
 void ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
                         struct i2c_board_info *devices, int num);
index 1cc911b4efa659dbfbc7e35aee6f80236e81e800..2ba776320a8282e978d989eea0377d6511dc3ab7 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
 #include <linux/io.h>
 
 #include <mach/hardware.h>
  * Micro9-Lite uses a separate MTD map driver for flash support
  * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1
  *************************************************************************/
-static struct physmap_flash_data micro9_flash_data;
-
-static struct resource micro9_flash_resource = {
-       .start          = EP93XX_CS1_PHYS_BASE,
-       .end            = EP93XX_CS1_PHYS_BASE + SZ_64M - 1,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device micro9_flash = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &micro9_flash_data,
-       },
-       .num_resources  = 1,
-       .resource       = &micro9_flash_resource,
-};
-
-static void __init __micro9_register_flash(unsigned int width)
-{
-       micro9_flash_data.width = width;
-
-       platform_device_register(&micro9_flash);
-}
-
 static unsigned int __init micro9_detect_bootwidth(void)
 {
        u32 v;
@@ -70,10 +44,17 @@ static unsigned int __init micro9_detect_bootwidth(void)
 
 static void __init micro9_register_flash(void)
 {
+       unsigned int width;
+
        if (machine_is_micro9())
-               __micro9_register_flash(4);
+               width = 4;
        else if (machine_is_micro9m() || machine_is_micro9s())
-               __micro9_register_flash(micro9_detect_bootwidth());
+               width = micro9_detect_bootwidth();
+       else
+               width = 0;
+
+       if (width)
+               ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M);
 }
 
 
index 388aec95f60e39fb304ac48c655c413f33129c45..5dded5884133f89e27898567a61163c583fa8f3d 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
 #include <linux/gpio.h>
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
-static struct physmap_flash_data simone_flash_data = {
-       .width          = 2,
-};
-
-static struct resource simone_flash_resource = {
-       .start          = EP93XX_CS6_PHYS_BASE,
-       .end            = EP93XX_CS6_PHYS_BASE + SZ_8M - 1,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device simone_flash = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .num_resources  = 1,
-       .resource       = &simone_flash_resource,
-       .dev = {
-               .platform_data  = &simone_flash_data,
-       },
-};
-
 static struct ep93xx_eth_data __initdata simone_eth_data = {
        .phy_id         = 1,
 };
@@ -77,8 +56,7 @@ static struct i2c_board_info __initdata simone_i2c_board_info[] = {
 static void __init simone_init_machine(void)
 {
        ep93xx_init_devices();
-
-       platform_device_register(&simone_flash);
+       ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_8M);
        ep93xx_register_eth(&simone_eth_data, 1);
        ep93xx_register_fb(&simone_fb_info);
        ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info,
index ae7319e588c7e59ca570173d47d1e95a0fe06d0f..93aeab8af705e8dd3dde989b1658e81e6ed60062 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/m48t86.h>
-#include <linux/mtd/physmap.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 
@@ -173,31 +172,13 @@ static struct platform_device ts72xx_nand_flash = {
 };
 
 
-/*************************************************************************
- * NOR flash (TS-7200 only)
- *************************************************************************/
-static struct physmap_flash_data ts72xx_nor_data = {
-       .width          = 2,
-};
-
-static struct resource ts72xx_nor_resource = {
-       .start          = EP93XX_CS6_PHYS_BASE,
-       .end            = EP93XX_CS6_PHYS_BASE + SZ_16M - 1,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device ts72xx_nor_flash = {
-       .name                   = "physmap-flash",
-       .id                     = 0,
-       .dev.platform_data      = &ts72xx_nor_data,
-       .resource               = &ts72xx_nor_resource,
-       .num_resources          = 1,
-};
-
 static void __init ts72xx_register_flash(void)
 {
+       /*
+        * TS7200 has NOR flash all other TS72xx board have NAND flash.
+        */
        if (board_is_ts7200()) {
-               platform_device_register(&ts72xx_nor_flash);
+               ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
        } else {
                resource_size_t start;
 
index e3bc3f6f6b105d42c8d4f73d33b4d5f92fc15a81..88b3dd89be89a20b65761de100c7799798ccb1df 100644 (file)
@@ -232,7 +232,7 @@ EXPORT_SYMBOL(__bus_to_virt);
 
 unsigned long __pfn_to_bus(unsigned long pfn)
 {
-       return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET));
+       return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET);
 }
 EXPORT_SYMBOL(__pfn_to_bus);
 
index a9ee8f0d48b7f6792ea5004844649c3acb3a5bd0..27cafd12f033cbba19bd507e5a90ac198c1db8e1 100644 (file)
  *
 */
 
-               .equ    io_virt, IO_BASE
-               .equ    io_phys, IO_START
+#include <mach/hardware.h>
+
+               .equ    io_virt, IO_VIRT
+               .equ    io_phys, IO_PHYS
 
                .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h
new file mode 100644 (file)
index 0000000..5f96e15
--- /dev/null
@@ -0,0 +1 @@
+void integrator_reserve(void);
index b02cfc06e0aeeff452a2c3813523fccd53f1edf2..8f4fb6d638f7ea66717a5afb5d962ef0d88723a3 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/memblock.h>
 #include <linux/sched.h>
 #include <linux/smp.h>
 #include <linux/termios.h>
@@ -30,6 +31,7 @@
 #include <asm/system.h>
 #include <asm/leds.h>
 #include <asm/mach/time.h>
+#include <asm/pgtable.h>
 
 static struct amba_pl010_data integrator_uart_data;
 
@@ -119,8 +121,13 @@ static struct clk uartclk = {
        .rate   = 14745600,
 };
 
+static struct clk dummy_apb_pclk;
+
 static struct clk_lookup lookups[] = {
-       {       /* UART0 */
+       {       /* Bus clock */
+               .con_id         = "apb_pclk",
+               .clk            = &dummy_apb_pclk,
+       }, {    /* UART0 */
                .dev_id         = "mb:16",
                .clk            = &uartclk,
        }, {    /* UART1 */
@@ -215,3 +222,13 @@ void cm_control(u32 mask, u32 set)
 }
 
 EXPORT_SYMBOL(cm_control);
+
+/*
+ * We need to stop things allocating the low memory; ideally we need a
+ * better implementation of GFP_DMA which does not assume that DMA-able
+ * memory starts at zero.
+ */
+void __init integrator_reserve(void)
+{
+       memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET);
+}
index 227cf4d05088ec85bf870e1423b7044d0758d133..6ab5a03ab9d8b0a7f45311595b0ee1fa16474ef3 100644 (file)
@@ -48,6 +48,8 @@
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 
+#include "common.h"
+
 /* 
  * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx
  * is the (PA >> 12).
@@ -502,6 +504,7 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
        .io_pg_offst    = ((0xf1600000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .map_io         = ap_map_io,
+       .reserve        = integrator_reserve,
        .init_irq       = ap_init_irq,
        .timer          = &ap_timer,
        .init_machine   = ap_init,
index cde57b2b83b57a36288382ef5b57a39ae895d802..05db40e3c4f75a7fcf661718269cdcf330d7f9cc 100644 (file)
@@ -43,6 +43,8 @@
 
 #include <plat/timer-sp.h>
 
+#include "common.h"
+
 #define INTCP_PA_FLASH_BASE            0x24000000
 #define INTCP_FLASH_SIZE               SZ_32M
 
@@ -601,6 +603,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
        .io_pg_offst    = ((0xf1600000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .map_io         = intcp_map_io,
+       .reserve        = integrator_reserve,
        .init_irq       = intcp_init_irq,
        .timer          = &cp_timer,
        .init_machine   = intcp_init,
index 25b1da9a5035469fcf4355e80082f3dd7af586c8..7415e4338651e7c84e2e3a587092a1c1859cda1d 100644 (file)
@@ -69,6 +69,4 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
 #endif /* CONFIG_ARCH_IOP13XX */
 #endif /* !ASSEMBLY */
 
-#define PFN_TO_NID(addr)       (0)
-
 #endif
index f4fbb5ec645b0a04c27318319969441ef897c10c..61cd4d64b98596c7507dcaf67d069dbe22508e50 100644 (file)
@@ -348,7 +348,7 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
  * This is really ugly and we need a better way of specifying
  * DMA-capable regions of memory.
  */
-void __init ixp4xx_adjust_zones(int node, unsigned long *zone_size,
+void __init ixp4xx_adjust_zones(unsigned long *zone_size,
        unsigned long *zhole_size)
 {
        unsigned int sz = SZ_64M >> PAGE_SHIFT;
@@ -356,7 +356,7 @@ void __init ixp4xx_adjust_zones(int node, unsigned long *zone_size,
        /*
         * Only adjust if > 64M on current system
         */
-       if (node || (zone_size[0] <= sz))
+       if (zone_size[0] <= sz)
                return;
 
        zone_size[1] = zone_size[0] - sz;
index 98f5e5e2098001398d45930d2fb5d33b3452f0ea..0136eaa29224a538cfdd65179dd59432fa7b1488 100644 (file)
 
 #if !defined(__ASSEMBLY__) && defined(CONFIG_PCI)
 
-void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes);
+void ixp4xx_adjust_zones(unsigned long *size, unsigned long *holes);
 
-#define arch_adjust_zones(node, size, holes) \
-       ixp4xx_adjust_zones(node, size, holes)
+#define arch_adjust_zones(size, holes) \
+       ixp4xx_adjust_zones(size, holes)
 
 #define ISA_DMA_THRESHOLD (SZ_64M - 1)
 #define MAX_DMA_ADDRESS                (PAGE_OFFSET + SZ_64M)
index 7221c20b2afa241b5854c90b90f24352b73572c8..f781164e623fc89e7a4362b3d039f9e58688fd0d 100644 (file)
@@ -77,7 +77,7 @@ struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = {
        },
 };
 
-void qnap_tsx1x_register_flash(void)
+void __init qnap_tsx1x_register_flash(void)
 {
        spi_register_board_info(qnap_tsx1x_spi_slave_info,
                                ARRAY_SIZE(qnap_tsx1x_spi_slave_info));
index 9a592962a6ea0df6f7546d847a50b150d45243c1..7fa037361b55a5e23738f9a37c8637f64d91b56e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H
 #define __ARCH_KIRKWOOD_TSX1X_COMMON_H
 
-extern void qnap_tsx1x_register_flash(void);
+extern void __init qnap_tsx1x_register_flash(void);
 extern void qnap_tsx1x_power_off(void);
 
 #endif
diff --git a/arch/arm/mach-l7200/Makefile b/arch/arm/mach-l7200/Makefile
deleted file mode 100644 (file)
index 4bd8ebd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# Makefile for the linux kernel.
-#
-
-# Object file lists.
-
-obj-y                  := core.o
-obj-m                  :=
-obj-n                  :=
-obj-                   :=
-
diff --git a/arch/arm/mach-l7200/Makefile.boot b/arch/arm/mach-l7200/Makefile.boot
deleted file mode 100644 (file)
index 6c72ecb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-   zreladdr-y  := 0xf0008000
-
diff --git a/arch/arm/mach-l7200/core.c b/arch/arm/mach-l7200/core.c
deleted file mode 100644 (file)
index 50d2324..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *  linux/arch/arm/mm/mm-lusl7200.c
- *
- *  Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
- *
- *  Extra MM routines for L7200 architecture
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/device.h>
-
-#include <asm/types.h>
-#include <asm/irq.h>
-#include <asm/mach-types.h>
-#include <mach/hardware.h>
-#include <asm/page.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-/*
- * IRQ base register
- */
-#define        IRQ_BASE        (IO_BASE_2 + 0x1000)
-
-/* 
- * Normal IRQ registers
- */
-#define IRQ_STATUS     (*(volatile unsigned long *) (IRQ_BASE + 0x000))
-#define IRQ_RAWSTATUS  (*(volatile unsigned long *) (IRQ_BASE + 0x004))
-#define IRQ_ENABLE     (*(volatile unsigned long *) (IRQ_BASE + 0x008))
-#define IRQ_ENABLECLEAR        (*(volatile unsigned long *) (IRQ_BASE + 0x00c))
-#define IRQ_SOFT       (*(volatile unsigned long *) (IRQ_BASE + 0x010))
-#define IRQ_SOURCESEL  (*(volatile unsigned long *) (IRQ_BASE + 0x018))
-
-/* 
- * Fast IRQ registers
- */
-#define FIQ_STATUS     (*(volatile unsigned long *) (IRQ_BASE + 0x100))
-#define FIQ_RAWSTATUS  (*(volatile unsigned long *) (IRQ_BASE + 0x104))
-#define FIQ_ENABLE     (*(volatile unsigned long *) (IRQ_BASE + 0x108))
-#define FIQ_ENABLECLEAR        (*(volatile unsigned long *) (IRQ_BASE + 0x10c))
-#define FIQ_SOFT       (*(volatile unsigned long *) (IRQ_BASE + 0x110))
-#define FIQ_SOURCESEL  (*(volatile unsigned long *) (IRQ_BASE + 0x118))
-
-static void l7200_mask_irq(unsigned int irq)
-{
-       IRQ_ENABLECLEAR = 1 << irq;
-}
-
-static void l7200_unmask_irq(unsigned int irq)
-{
-       IRQ_ENABLE = 1 << irq;
-}
-
-static struct irq_chip l7200_irq_chip = {
-       .ack            = l7200_mask_irq,
-       .mask           = l7200_mask_irq,
-       .unmask         = l7200_unmask_irq
-};
-static void __init l7200_init_irq(void)
-{
-       int irq;
-
-       IRQ_ENABLECLEAR = 0xffffffff;   /* clear all interrupt enables */
-       FIQ_ENABLECLEAR = 0xffffffff;   /* clear all fast interrupt enables */
-
-       for (irq = 0; irq < NR_IRQS; irq++) {
-               set_irq_chip(irq, &l7200_irq_chip);
-               set_irq_flags(irq, IRQF_VALID);
-               set_irq_handler(irq, handle_level_irq);
-       }
-
-       init_FIQ();
-}
-
-static struct map_desc l7200_io_desc[] __initdata = {
-       { IO_BASE,      IO_START,       IO_SIZE,        MT_DEVICE },
-       { IO_BASE_2,    IO_START_2,     IO_SIZE_2,      MT_DEVICE },
-       { AUX_BASE,     AUX_START,      AUX_SIZE,       MT_DEVICE },
-       { FLASH1_BASE,  FLASH1_START,   FLASH1_SIZE,    MT_DEVICE },
-       { FLASH2_BASE,  FLASH2_START,   FLASH2_SIZE,    MT_DEVICE }
-};
-
-static void __init l7200_map_io(void)
-{
-       iotable_init(l7200_io_desc, ARRAY_SIZE(l7200_io_desc));
-}
-
-MACHINE_START(L7200, "LinkUp Systems L7200")
-       /* Maintainer: Steve Hill / Scott McConnell */
-       .phys_io        = 0x80040000,
-       .io_pg_offst    = ((0xd0000000) >> 18) & 0xfffc,
-       .map_io         = l7200_map_io,
-       .init_irq       = l7200_init_irq,
-MACHINE_END
-
diff --git a/arch/arm/mach-l7200/include/mach/aux_reg.h b/arch/arm/mach-l7200/include/mach/aux_reg.h
deleted file mode 100644 (file)
index 4671558..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/aux_reg.h
- *
- * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
- *
- * Changelog:
- *   08-02-2000        SJH     Created file
- */
-#ifndef _ASM_ARCH_AUXREG_H
-#define _ASM_ARCH_AUXREG_H
-
-#include <mach/hardware.h>
-
-#define l7200aux_reg   *((volatile unsigned int *) (AUX_BASE))
-
-/*
- * Auxillary register values
- */
-#define AUX_CLEAR              0x00000000
-#define AUX_DIAG_LED_ON                0x00000002
-#define AUX_RTS_UART1          0x00000004
-#define AUX_DTR_UART1          0x00000008
-#define AUX_KBD_COLUMN_12_HIGH 0x00000010
-#define AUX_KBD_COLUMN_12_OFF  0x00000020
-#define AUX_KBD_COLUMN_13_HIGH 0x00000040
-#define AUX_KBD_COLUMN_13_OFF  0x00000080
-
-#endif
diff --git a/arch/arm/mach-l7200/include/mach/debug-macro.S b/arch/arm/mach-l7200/include/mach/debug-macro.S
deleted file mode 100644 (file)
index b69ed34..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* arch/arm/mach-l7200/include/mach/debug-macro.S
- *
- * Debugging macro include header
- *
- *  Copyright (C) 1994-1999 Russell King
- *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
- *
- * 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.
- *
-*/
-
-               .equ    io_virt, IO_BASE
-               .equ    io_phys, IO_START
-
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #io_phys           @ physical base address
-               movne   \rx, #io_virt           @ virtual address
-               add     \rx, \rx, #0x00044000   @ UART1
-@              add     \rx, \rx, #0x00045000   @ UART2
-               .endm
-
-               .macro  senduart,rd,rx
-               str     \rd, [\rx, #0x0]        @ UARTDR
-               .endm
-
-               .macro  waituart,rd,rx
-1001:          ldr     \rd, [\rx, #0x18]       @ UARTFLG
-               tst     \rd, #1 << 5            @ UARTFLGUTXFF - 1 when full
-               bne     1001b
-               .endm
-
-               .macro  busyuart,rd,rx
-1001:          ldr     \rd, [\rx, #0x18]       @ UARTFLG
-               tst     \rd, #1 << 3            @ UARTFLGUBUSY - 1 when busy
-               bne     1001b
-               .endm
diff --git a/arch/arm/mach-l7200/include/mach/entry-macro.S b/arch/arm/mach-l7200/include/mach/entry-macro.S
deleted file mode 100644 (file)
index 1726d91..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/entry-macro.S
- *
- * Low-level IRQ helper macros for L7200-based platforms
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-#include <mach/hardware.h>
-
-               .equ    irq_base_addr,  IO_BASE_2
-
-               .macro  disable_fiq
-               .endm
-
-               .macro  get_irqnr_preamble, base, tmp
-               .endm
-
-               .macro  arch_ret_to_user, tmp1, tmp2
-               .endm
-
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               mov     \irqstat, #irq_base_addr                @ Virt addr IRQ regs
-               add     \irqstat, \irqstat, #0x00001000         @ Status reg
-               ldr     \irqstat, [\irqstat, #0]                @ get interrupts
-               mov     \irqnr, #0
-1001:          tst     \irqstat, #1
-               addeq   \irqnr, \irqnr, #1
-               moveq   \irqstat, \irqstat, lsr #1
-               tsteq   \irqnr, #32
-               beq     1001b
-               teq     \irqnr, #32
-               .endm
-
diff --git a/arch/arm/mach-l7200/include/mach/gp_timers.h b/arch/arm/mach-l7200/include/mach/gp_timers.h
deleted file mode 100644 (file)
index 2b7086a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/gp_timers.h
- *
- * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
- *
- * Changelog:
- *   07-28-2000        SJH     Created file
- *   08-02-2000        SJH     Used structure for registers
- */
-#ifndef _ASM_ARCH_GPTIMERS_H
-#define _ASM_ARCH_GPTIMERS_H
-
-#include <mach/hardware.h>
-
-/*
- * Layout of L7200 general purpose timer registers
- */
-struct GPT_Regs {
-       unsigned int TIMERLOAD;
-       unsigned int TIMERVALUE;
-       unsigned int TIMERCONTROL;
-       unsigned int TIMERCLEAR;
-};
-
-#define GPT_BASE               (IO_BASE_2 + 0x3000)
-#define l7200_timer1_regs      ((volatile struct GPT_Regs *) (GPT_BASE))
-#define l7200_timer2_regs      ((volatile struct GPT_Regs *) (GPT_BASE + 0x20))
-
-/*
- * General register values
- */
-#define        GPT_PRESCALE_1          0x00000000
-#define        GPT_PRESCALE_16         0x00000004
-#define        GPT_PRESCALE_256        0x00000008
-#define GPT_MODE_FREERUN       0x00000000
-#define GPT_MODE_PERIODIC      0x00000040
-#define GPT_ENABLE             0x00000080
-#define GPT_BZTOG              0x00000100
-#define GPT_BZMOD              0x00000200
-#define GPT_LOAD_MASK          0x0000ffff
-
-#endif
diff --git a/arch/arm/mach-l7200/include/mach/gpio.h b/arch/arm/mach-l7200/include/mach/gpio.h
deleted file mode 100644 (file)
index c7b0a5d..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************/
-/*
- *      arch/arm/mach-l7200/include/mach/gpio.h
- *
- *      Registers and  helper functions for the L7200 Link-Up Systems
- *      GPIO.
- *
- *      (C) Copyright 2000, S A McConnell  (samcconn@cotw.com)
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License. See the file COPYING in the main directory of this archive for
- *  more details.
- */
-
-/****************************************************************************/
-
-#define GPIO_OFF   0x00005000  /* Offset from IO_START to the GPIO reg's. */
-
-/* IO_START and IO_BASE are defined in hardware.h */
-
-#define GPIO_START (IO_START_2 + GPIO_OFF) /* Physical addr of the GPIO reg. */
-#define GPIO_BASE  (IO_BASE_2  + GPIO_OFF) /* Virtual addr of the GPIO reg. */
-
-/* Offsets from the start of the GPIO for all the registers. */
-#define PADR_OFF     0x000
-#define PADDR_OFF    0x004
-#define PASBSR_OFF   0x008
-#define PAEENR_OFF   0x00c
-#define PAESNR_OFF   0x010
-#define PAESTR_OFF   0x014
-#define PAIMR_OFF    0x018
-#define PAINT_OFF    0x01c
-
-#define PBDR_OFF     0x020
-#define PBDDR_OFF    0x024
-#define PBSBSR_OFF   0x028
-#define PBIMR_OFF    0x038
-#define PBINT_OFF    0x03c
-
-#define PCDR_OFF     0x040
-#define PCDDR_OFF    0x044
-#define PCSBSR_OFF   0x048
-#define PCIMR_OFF    0x058
-#define PCINT_OFF    0x05c
-
-#define PDDR_OFF     0x060
-#define PDDDR_OFF    0x064
-#define PDSBSR_OFF   0x068
-#define PDEENR_OFF   0x06c
-#define PDESNR_OFF   0x070
-#define PDESTR_OFF   0x074
-#define PDIMR_OFF    0x078
-#define PDINT_OFF    0x07c
-
-#define PEDR_OFF     0x080
-#define PEDDR_OFF    0x084
-#define PESBSR_OFF   0x088
-#define PEEENR_OFF   0x08c
-#define PEESNR_OFF   0x090
-#define PEESTR_OFF   0x094
-#define PEIMR_OFF    0x098
-#define PEINT_OFF    0x09c
-
-/* Define the GPIO registers for use by device drivers and the kernel. */
-#define PADR   (*(volatile unsigned long *)(GPIO_BASE+PADR_OFF))
-#define PADDR  (*(volatile unsigned long *)(GPIO_BASE+PADDR_OFF))
-#define PASBSR (*(volatile unsigned long *)(GPIO_BASE+PASBSR_OFF))
-#define PAEENR (*(volatile unsigned long *)(GPIO_BASE+PAEENR_OFF))
-#define PAESNR (*(volatile unsigned long *)(GPIO_BASE+PAESNR_OFF))
-#define PAESTR (*(volatile unsigned long *)(GPIO_BASE+PAESTR_OFF))
-#define PAIMR  (*(volatile unsigned long *)(GPIO_BASE+PAIMR_OFF))
-#define PAINT  (*(volatile unsigned long *)(GPIO_BASE+PAINT_OFF))
-
-#define PBDR   (*(volatile unsigned long *)(GPIO_BASE+PBDR_OFF))
-#define PBDDR  (*(volatile unsigned long *)(GPIO_BASE+PBDDR_OFF))
-#define PBSBSR (*(volatile unsigned long *)(GPIO_BASE+PBSBSR_OFF))
-#define PBIMR  (*(volatile unsigned long *)(GPIO_BASE+PBIMR_OFF))
-#define PBINT  (*(volatile unsigned long *)(GPIO_BASE+PBINT_OFF))
-
-#define PCDR   (*(volatile unsigned long *)(GPIO_BASE+PCDR_OFF))
-#define PCDDR  (*(volatile unsigned long *)(GPIO_BASE+PCDDR_OFF))
-#define PCSBSR (*(volatile unsigned long *)(GPIO_BASE+PCSBSR_OFF))
-#define PCIMR  (*(volatile unsigned long *)(GPIO_BASE+PCIMR_OFF))
-#define PCINT  (*(volatile unsigned long *)(GPIO_BASE+PCINT_OFF))
-
-#define PDDR   (*(volatile unsigned long *)(GPIO_BASE+PDDR_OFF))
-#define PDDDR  (*(volatile unsigned long *)(GPIO_BASE+PDDDR_OFF))
-#define PDSBSR (*(volatile unsigned long *)(GPIO_BASE+PDSBSR_OFF))
-#define PDEENR (*(volatile unsigned long *)(GPIO_BASE+PDEENR_OFF))
-#define PDESNR (*(volatile unsigned long *)(GPIO_BASE+PDESNR_OFF))
-#define PDESTR (*(volatile unsigned long *)(GPIO_BASE+PDESTR_OFF))
-#define PDIMR  (*(volatile unsigned long *)(GPIO_BASE+PDIMR_OFF))
-#define PDINT  (*(volatile unsigned long *)(GPIO_BASE+PDINT_OFF))
-
-#define PEDR   (*(volatile unsigned long *)(GPIO_BASE+PEDR_OFF))
-#define PEDDR  (*(volatile unsigned long *)(GPIO_BASE+PEDDR_OFF))
-#define PESBSR (*(volatile unsigned long *)(GPIO_BASE+PESBSR_OFF))
-#define PEEENR (*(volatile unsigned long *)(GPIO_BASE+PEEENR_OFF))
-#define PEESNR (*(volatile unsigned long *)(GPIO_BASE+PEESNR_OFF))
-#define PEESTR (*(volatile unsigned long *)(GPIO_BASE+PEESTR_OFF))
-#define PEIMR  (*(volatile unsigned long *)(GPIO_BASE+PEIMR_OFF))
-#define PEINT  (*(volatile unsigned long *)(GPIO_BASE+PEINT_OFF))
-
-#define VEE_EN         0x02
-#define BACKLIGHT_EN   0x04
diff --git a/arch/arm/mach-l7200/include/mach/hardware.h b/arch/arm/mach-l7200/include/mach/hardware.h
deleted file mode 100644 (file)
index c31909c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/hardware.h
- *
- * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
- *                    Steve Hill (sjhill@cotw.com)
- *
- * This file contains the hardware definitions for the 
- * LinkUp Systems L7200 SOC development board.
- *
- * Changelog:
- *   02-01-2000         RS     Created L7200 version, derived from rpc code
- *   03-21-2000        SJH     Cleaned up file
- *   04-21-2000         RS     Changed mapping of I/O in virtual space
- *   04-25-2000        SJH     Removed unused symbols and such
- *   05-05-2000        SJH     Complete rewrite
- *   07-31-2000        SJH     Added undocumented debug auxillary port to
- *                     get at last two columns for keyboard driver
- */
-#ifndef __ASM_ARCH_HARDWARE_H
-#define __ASM_ARCH_HARDWARE_H
-
-/* Hardware addresses of major areas.
- *  *_START is the physical address
- *  *_SIZE  is the size of the region
- *  *_BASE  is the virtual address
- */
-#define RAM_START              0xf0000000
-#define RAM_SIZE               0x02000000
-#define RAM_BASE               0xc0000000
-
-#define IO_START               0x80000000      /* I/O */
-#define IO_SIZE                        0x01000000
-#define IO_BASE                        0xd0000000
-
-#define IO_START_2             0x90000000      /* I/O */
-#define IO_SIZE_2              0x01000000
-#define IO_BASE_2              0xd1000000
-
-#define AUX_START              0x1a000000      /* AUX PORT */
-#define AUX_SIZE               0x01000000
-#define AUX_BASE               0xd2000000
-
-#define FLASH1_START           0x00000000      /* FLASH BANK 1 */
-#define FLASH1_SIZE            0x01000000
-#define FLASH1_BASE            0xd3000000
-
-#define FLASH2_START           0x10000000      /* FLASH BANK 2 */
-#define FLASH2_SIZE            0x01000000
-#define FLASH2_BASE            0xd4000000
-
-#define ISA_START              0x20000000      /* ISA */
-#define ISA_SIZE               0x20000000
-#define ISA_BASE               0xe0000000
-
-#define PCIO_BASE              IO_BASE
-
-#endif
diff --git a/arch/arm/mach-l7200/include/mach/io.h b/arch/arm/mach-l7200/include/mach/io.h
deleted file mode 100644 (file)
index a770a89..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/io.h
- *
- * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
- *
- * Changelog:
- *  03-21-2000 SJH     Created from arch/arm/mach-nexuspci/include/mach/io.h
- *  08-31-2000 SJH     Added in IO functions necessary for new drivers
- */
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#define IO_SPACE_LIMIT 0xffffffff
-
-/*
- * There are not real ISA nor PCI buses, so we fake it.
- */
-#define __io(a)                __typesafe_io(a)
-#define __mem_pci(a)   (a)
-
-#endif
diff --git a/arch/arm/mach-l7200/include/mach/irqs.h b/arch/arm/mach-l7200/include/mach/irqs.h
deleted file mode 100644 (file)
index 7edffd7..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/irqs.h
- *
- * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
- *                    Steve Hill (sjhill@cotw.com)
- *
- * Changelog:
- *   01-02-2000 RS     Create l7200 version
- *   03-28-2000 SJH    Removed unused interrupt
- *   07-28-2000 SJH    Added pseudo-keyboard interrupt
- */
-
-/*
- * NOTE: The second timer (Timer 2) is used as the keyboard
- *       interrupt when the keyboard driver is enabled.
- */
-
-#define NR_IRQS          32
-
-#define IRQ_STWDOG        0   /* Watchdog timer */
-#define IRQ_PROG          1   /* Programmable interrupt */
-#define IRQ_DEBUG_RX      2   /* Comm Rx debug */
-#define IRQ_DEBUG_TX      3   /* Comm Tx debug */
-#define IRQ_GCTC1         4   /* Timer 1 */
-#define IRQ_GCTC2         5   /* Timer 2 / Keyboard */
-#define IRQ_DMA           6   /* DMA controller */
-#define IRQ_CLCD          7   /* Color LCD controller */
-#define IRQ_SM_RX         8   /* Smart card */
-#define IRQ_SM_TX         9   /* Smart cart */
-#define IRQ_SM_RST       10   /* Smart card */
-#define IRQ_SIB          11   /* Serial Interface Bus */
-#define IRQ_MMC          12   /* MultiMediaCard */
-#define IRQ_SSP1         13   /* Synchronous Serial Port 1 */
-#define IRQ_SSP2         14   /* Synchronous Serial Port 1 */
-#define IRQ_SPI          15   /* SPI slave */
-#define IRQ_UART_1       16   /* UART 1 */
-#define IRQ_UART_2       17   /* UART 2 */
-#define IRQ_IRDA         18   /* IRDA */
-#define IRQ_RTC_TICK     19   /* Real Time Clock tick */
-#define IRQ_RTC_ALARM    20   /* Real Time Clock alarm */
-#define IRQ_GPIO         21   /* General Purpose IO */
-#define IRQ_GPIO_DMA     22   /* General Purpose IO, DMA */
-#define IRQ_M2M          23   /* Memory to memory DMA  */
-#define IRQ_RESERVED     24   /* RESERVED, don't use */
-#define IRQ_INTF         25   /* External active low interrupt */
-#define IRQ_INT0         26   /* External active low interrupt */
-#define IRQ_INT1         27   /* External active low interrupt */
-#define IRQ_INT2         28   /* External active low interrupt */
-#define IRQ_UCB1200      29   /* Interrupt generated by UCB1200*/
-#define IRQ_BAT_LO       30   /* Low batery or external power */
-#define IRQ_MEDIA_CHG    31   /* Media change interrupt */
-
-/*
- * This is the offset of the FIQ "IRQ" numbers
- */
-#define FIQ_START      64
diff --git a/arch/arm/mach-l7200/include/mach/memory.h b/arch/arm/mach-l7200/include/mach/memory.h
deleted file mode 100644 (file)
index 9fb40ed..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/memory.h
- *
- * Copyright (c) 2000 Steve Hill (sjhill@cotw.com)
- * Copyright (c) 2000 Rob Scott (rscott@mtrob.fdns.net)
- *
- * Changelog:
- *  03-13-2000 SJH     Created
- *  04-13-2000  RS      Changed bus macros for new addr
- *  05-03-2000  SJH     Removed bus macros and fixed virt_to_phys macro
- */
-#ifndef __ASM_ARCH_MEMORY_H
-#define __ASM_ARCH_MEMORY_H
-
-/*
- * Physical DRAM offset on the L7200 SDB.
- */
-#define PHYS_OFFSET     UL(0xf0000000)
-
-/*
- * Cache flushing area - ROM
- */
-#define FLUSH_BASE_PHYS                0x40000000
-#define FLUSH_BASE             0xdf000000
-
-#endif
diff --git a/arch/arm/mach-l7200/include/mach/pmpcon.h b/arch/arm/mach-l7200/include/mach/pmpcon.h
deleted file mode 100644 (file)
index 3959871..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************/
-/*
- *  arch/arm/mach-l7200/include/mach/pmpcon.h
- *
- *   Registers and  helper functions for the L7200 Link-Up Systems
- *   DC/DC converter register.
- *
- *   (C) Copyright 2000, S A McConnell  (samcconn@cotw.com)
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License. See the file COPYING in the main directory of this archive for
- *  more details.
- */
-
-/****************************************************************************/
-
-#define PMPCON_OFF 0x00006000  /* Offset from IO_START_2. */
-
-/* IO_START_2 and IO_BASE_2 are defined in hardware.h */
-
-#define PMPCON_START (IO_START_2 + PMPCON_OFF)  /* Physical address of reg. */
-#define PMPCON_BASE  (IO_BASE_2  + PMPCON_OFF)  /* Virtual address of reg. */
-
-
-#define PMPCON (*(volatile unsigned int *)(PMPCON_BASE))
-
-#define PWM2_50CYCLE 0x800
-#define CONTRAST     0x9
-
-#define PWM1H (CONTRAST)
-#define PWM1L (CONTRAST << 4)
-
-#define PMPCON_VALUE  (PWM2_50CYCLE | PWM1L | PWM1H) 
-       
-/* PMPCON = 0x811;   // too light and fuzzy
- * PMPCON = 0x844;   
- * PMPCON = 0x866;   // better color poor depth
- * PMPCON = 0x888;   // Darker but better depth 
- * PMPCON = 0x899;   // Darker even better depth
- * PMPCON = 0x8aa;   // too dark even better depth
- * PMPCON = 0X8cc;   // Way too dark
- */
-
-/* As CONTRAST value increases the greater the depth perception and
- * the darker the colors.
- */
diff --git a/arch/arm/mach-l7200/include/mach/pmu.h b/arch/arm/mach-l7200/include/mach/pmu.h
deleted file mode 100644 (file)
index a2da7ae..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************/
-/*
- *  arch/arm/mach-l7200/include/mach/pmu.h
- *
- *   Registers and  helper functions for the L7200 Link-Up Systems
- *   Power Management Unit (PMU).
- *
- *   (C) Copyright 2000, S A McConnell  (samcconn@cotw.com)
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License. See the file COPYING in the main directory of this archive for
- *  more details.
- */
-
-/****************************************************************************/
-
-#define PMU_OFF   0x00050000  /* Offset from IO_START to the PMU registers. */
-
-/* IO_START and IO_BASE are defined in hardware.h */
-
-#define PMU_START (IO_START + PMU_OFF)  /* Physical addr. of the PMU reg. */
-#define PMU_BASE  (IO_BASE  + PMU_OFF)  /* Virtual addr. of the PMU reg. */
-
-
-/* Define the PMU registers for use by device drivers and the kernel. */
-
-typedef struct {
-     unsigned int CURRENT;  /* Current configuration register */
-     unsigned int NEXT;     /* Next configuration register */
-     unsigned int reserved;
-     unsigned int RUN;      /* Run configuration register */
-     unsigned int COMM;     /* Configuration command register */
-     unsigned int SDRAM;    /* SDRAM configuration bypass register */
-} pmu_interface;
-
-#define PMU ((volatile pmu_interface *)(PMU_BASE))
-
-
-/* Macro's for reading the common register fields. */
-
-#define GET_TRANSOP(reg)  ((reg >> 25) & 0x03) /* Bits 26-25 */
-#define GET_OSCEN(reg)    ((reg >> 16) & 0x01)
-#define GET_OSCMUX(reg)   ((reg >> 15) & 0x01)
-#define GET_PLLMUL(reg)   ((reg >>  9) & 0x3f) /* Bits 14-9 */
-#define GET_PLLEN(reg)    ((reg >>  8) & 0x01)
-#define GET_PLLMUX(reg)   ((reg >>  7) & 0x01)
-#define GET_BCLK_DIV(reg) ((reg >>  3) & 0x03) /* Bits 4-3 */
-#define GET_SDRB_SEL(reg) ((reg >>  2) & 0x01)
-#define GET_SDRF_SEL(reg) ((reg >>  1) & 0x01)
-#define GET_FASTBUS(reg)  (reg & 0x1)
-
-/* CFG_NEXT register */
-
-#define CFG_NEXT_CLOCKRECOVERY ((PMU->NEXT >> 18) & 0x7f)   /* Bits 24-18 */
-#define CFG_NEXT_INTRET        ((PMU->NEXT >> 17) & 0x01)
-#define CFG_NEXT_SDR_STOP      ((PMU->NEXT >>  6) & 0x01)
-#define CFG_NEXT_SYSCLKEN      ((PMU->NEXT >>  5) & 0x01)
-
-/* Useful field values that can be used to construct the
- * CFG_NEXT and CFG_RUN registers.
- */
-
-#define TRANSOP_NOP      0<<25  /* NOCHANGE_NOSTALL */
-#define NOCHANGE_STALL   1<<25
-#define CHANGE_NOSTALL   2<<25
-#define CHANGE_STALL     3<<25
-
-#define INTRET           1<<17
-#define OSCEN            1<<16
-#define OSCMUX           1<<15
-
-/* PLL frequencies */
-
-#define PLLMUL_0         0<<9         /*  3.6864 MHz */
-#define PLLMUL_1         1<<9         /*  ?????? MHz */
-#define PLLMUL_5         5<<9         /*  18.432 MHz */
-#define PLLMUL_10       10<<9         /*  36.864 MHz */
-#define PLLMUL_18       18<<9         /*  ?????? MHz */
-#define PLLMUL_20       20<<9         /*  73.728 MHz */
-#define PLLMUL_32       32<<9         /*  ?????? MHz */
-#define PLLMUL_35       35<<9         /* 129.024 MHz */
-#define PLLMUL_36       36<<9         /*  ?????? MHz */
-#define PLLMUL_39       39<<9         /*  ?????? MHz */
-#define PLLMUL_40       40<<9         /* 147.456 MHz */
-
-/* Clock recovery times */
-
-#define CRCLOCK_1        1<<18
-#define CRCLOCK_2        2<<18
-#define CRCLOCK_4        4<<18
-#define CRCLOCK_8        8<<18
-#define CRCLOCK_16      16<<18
-#define CRCLOCK_32      32<<18
-#define CRCLOCK_63      63<<18
-#define CRCLOCK_127    127<<18
-
-#define PLLEN            1<<8
-#define PLLMUX           1<<7
-#define SDR_STOP         1<<6
-#define SYSCLKEN         1<<5
-
-#define BCLK_DIV_4       2<<3
-#define BCLK_DIV_2       1<<3
-#define BCLK_DIV_1       0<<3
-
-#define SDRB_SEL         1<<2
-#define SDRF_SEL         1<<1
-#define FASTBUS          1<<0
-
-
-/* CFG_SDRAM */
-
-#define SDRREFFQ         1<<0  /* Only if SDRSTOPRQ is not set. */
-#define SDRREFACK        1<<1  /* Read-only */
-#define SDRSTOPRQ        1<<2  /* Only if SDRREFFQ is not set. */
-#define SDRSTOPACK       1<<3  /* Read-only */
-#define PICEN            1<<4  /* Enable Co-procesor */
-#define PICTEST          1<<5
-
-#define GET_SDRREFFQ    ((PMU->SDRAM >> 0) & 0x01)
-#define GET_SDRREFACK   ((PMU->SDRAM >> 1) & 0x01) /* Read-only */
-#define GET_SDRSTOPRQ   ((PMU->SDRAM >> 2) & 0x01)
-#define GET_SDRSTOPACK  ((PMU->SDRAM >> 3) & 0x01) /* Read-only */
-#define GET_PICEN       ((PMU->SDRAM >> 4) & 0x01)
-#define GET_PICTEST     ((PMU->SDRAM >> 5) & 0x01)
diff --git a/arch/arm/mach-l7200/include/mach/serial.h b/arch/arm/mach-l7200/include/mach/serial.h
deleted file mode 100644 (file)
index adc05e5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/serial.h
- *
- * Copyright (c) 2000 Rob Scott (rscott@mtrob.fdns.net)
- *                    Steve Hill (sjhill@cotw.com)
- *
- * Changelog:
- *  03-20-2000  SJH     Created
- *  03-26-2000  SJH     Added flags for serial ports
- *  03-27-2000  SJH     Corrected BASE_BAUD value
- *  04-14-2000  RS      Made register addr dependent on IO_BASE
- *  05-03-2000  SJH     Complete rewrite
- *  05-09-2000 SJH     Stripped out architecture specific serial stuff
- *                      and placed it in a separate file
- *  07-28-2000 SJH     Moved base baud rate variable
- */
-#ifndef __ASM_ARCH_SERIAL_H
-#define __ASM_ARCH_SERIAL_H
-
-/*
- * This assumes you have a 3.6864 MHz clock for your UART.
- */
-#define BASE_BAUD      3686400
-
-/*
- * Standard COM flags
- */
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
-
-#define STD_SERIAL_PORT_DEFNS          \
-       /* MAGIC UART CLK   PORT       IRQ     FLAGS */                 \
-       { 0, BASE_BAUD, UART1_BASE, IRQ_UART_1, STD_COM_FLAGS },  /* ttyLU0 */ \
-       { 0, BASE_BAUD, UART2_BASE, IRQ_UART_2, STD_COM_FLAGS },  /* ttyLU1 */ \
-
-#define EXTRA_SERIAL_PORT_DEFNS
-
-#endif
diff --git a/arch/arm/mach-l7200/include/mach/serial_l7200.h b/arch/arm/mach-l7200/include/mach/serial_l7200.h
deleted file mode 100644 (file)
index 645f1c5..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/serial_l7200.h
- *
- * Copyright (c) 2000 Steven Hill (sjhill@cotw.com)
- *
- * Changelog:
- *  05-09-2000 SJH     Created
- */
-#ifndef __ASM_ARCH_SERIAL_L7200_H
-#define __ASM_ARCH_SERIAL_L7200_H
-
-#include <mach/memory.h>
-
-/*
- * This assumes you have a 3.6864 MHz clock for your UART.
- */
-#define BASE_BAUD 3686400
-
-/*
- * UART base register addresses
- */
-#define UART1_BASE     (IO_BASE + 0x00044000)
-#define UART2_BASE     (IO_BASE + 0x00045000)
-
-/*
- * UART register offsets
- */
-#define UARTDR                 0x00    /* Tx/Rx data */
-#define RXSTAT                 0x04    /* Rx status */
-#define H_UBRLCR               0x08    /* mode register high */
-#define M_UBRLCR               0x0C    /* mode reg mid (MSB of baud)*/
-#define L_UBRLCR               0x10    /* mode reg low (LSB of baud)*/
-#define UARTCON                        0x14    /* control register */
-#define UARTFLG                        0x18    /* flag register */
-#define UARTINTSTAT            0x1C    /* FIFO IRQ status register */
-#define UARTINTMASK            0x20    /* FIFO IRQ mask register */
-
-/*
- * UART baud rate register values
- */
-#define BR_110                 0x827
-#define BR_1200                        0x06e
-#define BR_2400                        0x05f
-#define BR_4800                        0x02f
-#define BR_9600                        0x017
-#define BR_14400               0x00f
-#define BR_19200               0x00b
-#define BR_38400               0x005
-#define BR_57600               0x003
-#define BR_76800               0x002
-#define BR_115200              0x001
-
-/*
- * Receiver status register (RXSTAT) mask values
- */
-#define RXSTAT_NO_ERR          0x00    /* No error */
-#define RXSTAT_FRM_ERR         0x01    /* Framing error */
-#define RXSTAT_PAR_ERR         0x02    /* Parity error */
-#define RXSTAT_OVR_ERR         0x04    /* Overrun error */
-
-/*
- * High byte of UART bit rate and line control register (H_UBRLCR) values
- */
-#define UBRLCR_BRK             0x01    /* generate break on tx */
-#define UBRLCR_PEN             0x02    /* enable parity */
-#define UBRLCR_PDIS            0x00    /* disable parity */
-#define UBRLCR_EVEN            0x04    /* 1= even parity,0 = odd parity */
-#define UBRLCR_STP2            0x08    /* transmit 2 stop bits */
-#define UBRLCR_FIFO            0x10    /* enable FIFO */
-#define UBRLCR_LEN5            0x60    /* word length5 */
-#define UBRLCR_LEN6            0x40    /* word length6 */
-#define UBRLCR_LEN7            0x20    /* word length7 */
-#define UBRLCR_LEN8            0x00    /* word length8 */
-
-/*
- * UART control register (UARTCON) values
- */
-#define UARTCON_UARTEN         0x01    /* Enable UART */
-#define UARTCON_DMAONERR       0x08    /* Mask RxDmaRq when errors occur */
-
-/*
- * UART flag register (UARTFLG) mask values
- */
-#define UARTFLG_UTXFF          0x20    /* Transmit FIFO full */
-#define UARTFLG_URXFE          0x10    /* Receiver FIFO empty */
-#define UARTFLG_UBUSY          0x08    /* Transmitter busy */
-#define UARTFLG_DCD            0x04    /* Data carrier detect */
-#define UARTFLG_DSR            0x02    /* Data set ready */
-#define UARTFLG_CTS            0x01    /* Clear to send */
-
-/*
- * UART interrupt status/clear registers (UARTINTSTAT/CLR) values
- */
-#define UART_TXINT             0x01    /* TX interrupt */
-#define UART_RXINT             0x02    /* RX interrupt */
-#define UART_RXERRINT          0x04    /* RX error interrupt */
-#define UART_MSINT             0x08    /* Modem Status interrupt */
-#define UART_UDINT             0x10    /* UART Disabled interrupt */
-#define UART_ALLIRQS           0x1f    /* All interrupts */
-
-#endif
diff --git a/arch/arm/mach-l7200/include/mach/sib.h b/arch/arm/mach-l7200/include/mach/sib.h
deleted file mode 100644 (file)
index 9657287..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************/
-/*
- *  arch/arm/mach-l7200/include/mach/sib.h
- *
- *  Registers and helper functions for the Serial Interface Bus.
- *
- *  (C) Copyright 2000, S A McConnell  (samcconn@cotw.com)
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License. See the file COPYING in the main directory of this archive for
- *  more details.
- */
-
-/****************************************************************************/
-
-#define SIB_OFF   0x00040000  /* Offset from IO_START to the SIB reg's. */
-
-/* IO_START and IO_BASE are defined in hardware.h */
-
-#define SIB_START (IO_START + SIB_OFF) /* Physical addr of the SIB reg. */
-#define SIB_BASE  (IO_BASE  + SIB_OFF) /* Virtual addr of the SIB reg.  */
-
-/* Offsets from the start of the SIB for all the registers. */
-
-/* Define the SIB registers for use by device drivers and the kernel. */
-
-typedef struct
-{
-     unsigned int MCCR;    /* SIB Control Register           Offset: 0x00 */
-     unsigned int RES1;    /* Reserved                       Offset: 0x04 */
-     unsigned int MCDR0;   /* SIB Data Register 0            Offset: 0x08 */
-     unsigned int MCDR1;   /* SIB Data Register 1            Offset: 0x0c */
-     unsigned int MCDR2;   /* SIB Data Register 2 (UCB1x00)  Offset: 0x10 */
-     unsigned int RES2;    /* Reserved                       Offset: 0x14 */
-     unsigned int MCSR;    /* SIB Status Register            Offset: 0x18 */
-} SIB_Interface;
-
-#define SIB ((volatile SIB_Interface *) (SIB_BASE))
-
-/* MCCR */
-
-#define INTERNAL_FREQ   9216000  /* Hertz */
-#define AUDIO_FREQ         5000  /* Hertz */
-#define TELECOM_FREQ       5000  /* Hertz */
-
-#define AUDIO_DIVIDE    (INTERNAL_FREQ / (32 * AUDIO_FREQ))
-#define TELECOM_DIVIDE  (INTERNAL_FREQ / (32 * TELECOM_FREQ))
-
-#define MCCR_ASD57      AUDIO_DIVIDE
-#define MCCR_TSD57      (TELECOM_DIVIDE << 8)
-#define MCCR_MCE        (1 << 16)             /* SIB enable */
-#define MCCR_ECS        (1 << 17)             /* External Clock Select */
-#define MCCR_ADM        (1 << 18)             /* A/D Data Sampling */
-#define MCCR_PMC        (1 << 26)             /* PIN Multiplexer Control */
-
-
-#define GET_ASD ((SIB->MCCR >>  0) & 0x3f) /* Audio Sample Rate Div. */
-#define GET_TSD ((SIB->MCCR >>  8) & 0x3f) /* Telcom Sample Rate Div. */
-#define GET_MCE ((SIB->MCCR >> 16) & 0x01) /* SIB Enable */
-#define GET_ECS ((SIB->MCCR >> 17) & 0x01) /* External Clock Select */
-#define GET_ADM ((SIB->MCCR >> 18) & 0x01) /* A/D Data Sampling Mode */
-#define GET_TTM ((SIB->MCCR >> 19) & 0x01) /* Telco Trans. FIFO I mask */ 
-#define GET_TRM ((SIB->MCCR >> 20) & 0x01) /* Telco Recv. FIFO I mask */
-#define GET_ATM ((SIB->MCCR >> 21) & 0x01) /* Audio Trans. FIFO I mask */ 
-#define GET_ARM ((SIB->MCCR >> 22) & 0x01) /* Audio Recv. FIFO I mask */
-#define GET_LBM ((SIB->MCCR >> 23) & 0x01) /* Loop Back Mode */
-#define GET_ECP ((SIB->MCCR >> 24) & 0x03) /* Extern. Clck Prescale sel */
-#define GET_PMC ((SIB->MCCR >> 26) & 0x01) /* PIN Multiplexer Control */
-#define GET_ERI ((SIB->MCCR >> 27) & 0x01) /* External Read Interrupt */
-#define GET_EWI ((SIB->MCCR >> 28) & 0x01) /* External Write Interrupt */
-
-/* MCDR0 */
-
-#define AUDIO_RECV     ((SIB->MCDR0 >> 4) & 0xfff)
-#define AUDIO_WRITE(v) ((SIB->MCDR0 = (v & 0xfff) << 4))
-
-/* MCDR1 */
-
-#define TELECOM_RECV     ((SIB->MCDR1 >> 2) & 032fff)
-#define TELECOM_WRITE(v) ((SIB->MCDR1 = (v & 0x3fff) << 2))
-
-
-/* MCSR */
-
-#define MCSR_ATU (1 << 4)  /* Audio Transmit FIFO Underrun */
-#define MCSR_ARO (1 << 5)  /* Audio Receive  FIFO Underrun */
-#define MCSR_TTU (1 << 6)  /* TELECOM Transmit FIFO Underrun */
-#define MCSR_TRO (1 << 7)  /* TELECOM Receive  FIFO Underrun */
-
-#define MCSR_CLEAR_UNDERUN_BITS (MCSR_ATU | MCSR_ARO | MCSR_TTU | MCSR_TRO)
-
-
-#define GET_ATS ((SIB->MCSR >>  0) & 0x01) /* Audio Transmit FIFO Service Req*/
-#define GET_ARS ((SIB->MCSR >>  1) & 0x01) /* Audio Recv FIFO Service Request*/
-#define GET_TTS ((SIB->MCSR >>  2) & 0x01) /* TELECOM Transmit FIFO  Flag */
-#define GET_TRS ((SIB->MCSR >>  3) & 0x01) /* TELECOM Recv FIFO Service Req. */
-#define GET_ATU ((SIB->MCSR >>  4) & 0x01) /* Audio Transmit FIFO Underrun */
-#define GET_ARO ((SIB->MCSR >>  5) & 0x01) /* Audio Receive  FIFO Underrun */
-#define GET_TTU ((SIB->MCSR >>  6) & 0x01) /* TELECOM Transmit FIFO Underrun */
-#define GET_TRO ((SIB->MCSR >>  7) & 0x01) /* TELECOM Receive  FIFO Underrun */
-#define GET_ANF ((SIB->MCSR >>  8) & 0x01) /* Audio Transmit FIFO not full */
-#define GET_ANE ((SIB->MCSR >>  9) & 0x01) /* Audio Receive FIFO not empty */
-#define GET_TNF ((SIB->MCSR >> 10) & 0x01) /* Telecom Transmit FIFO not full */
-#define GET_TNE ((SIB->MCSR >> 11) & 0x01) /* Telecom Receive FIFO not empty */
-#define GET_CWC ((SIB->MCSR >> 12) & 0x01) /* Codec Write Complete */
-#define GET_CRC ((SIB->MCSR >> 13) & 0x01) /* Codec Read Complete */
-#define GET_ACE ((SIB->MCSR >> 14) & 0x01) /* Audio Codec Enabled */
-#define GET_TCE ((SIB->MCSR >> 15) & 0x01) /* Telecom Codec Enabled */
-
-/* MCDR2 */
-
-#define MCDR2_rW               (1 << 16)
-
-#define WRITE_MCDR2(reg, data) (SIB->MCDR2 =((reg<<17)|MCDR2_rW|(data&0xffff)))
-#define MCDR2_WRITE_COMPLETE   GET_CWC
-
-#define INITIATE_MCDR2_READ(reg) (SIB->MCDR2 = (reg << 17))
-#define MCDR2_READ_COMPLETE      GET_CRC
-#define MCDR2_READ               (SIB->MCDR2 & 0xffff)
diff --git a/arch/arm/mach-l7200/include/mach/sys-clock.h b/arch/arm/mach-l7200/include/mach/sys-clock.h
deleted file mode 100644 (file)
index e9729a3..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************/
-/*
- *  arch/arm/mach-l7200/include/mach/sys-clock.h
- *
- *   Registers and  helper functions for the L7200 Link-Up Systems
- *   System clocks.
- *
- *   (C) Copyright 2000, S A McConnell  (samcconn@cotw.com)
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License. See the file COPYING in the main directory of this archive for
- *  more details.
- */
-
-/****************************************************************************/
-
-#define SYS_CLOCK_OFF   0x00050030  /* Offset from IO_START. */
-
-/* IO_START and IO_BASE are defined in hardware.h */
-
-#define SYS_CLOCK_START (IO_START + SYS_CLOCK_OFF)  /* Physical address */
-#define SYS_CLOCK_BASE  (IO_BASE  + SYS_CLOCK_OFF)  /* Virtual address  */
-
-/* Define the interface to the SYS_CLOCK */
-
-typedef struct
-{
-     unsigned int ENABLE;
-     unsigned int ESYNC;
-     unsigned int SELECT;
-} sys_clock_interface;
-
-#define SYS_CLOCK   ((volatile sys_clock_interface *)(SYS_CLOCK_BASE))
-
-//#define CLOCK_EN    (*(volatile unsigned long *)(PMU_BASE+CLOCK_EN_OFF))
-//#define CLOCK_ESYNC (*(volatile unsigned long *)(PMU_BASE+CLOCK_ESYNC_OFF))
-//#define CLOCK_SEL   (*(volatile unsigned long *)(PMU_BASE+CLOCK_SEL_OFF))
-
-/* SYS_CLOCK -> ENABLE */
-
-#define SYN_EN          1<<0
-#define B18M_EN         1<<1
-#define CLK3M6_EN       1<<2
-#define BUART_EN        1<<3
-#define CLK18MU_EN      1<<4
-#define FIR_EN          1<<5
-#define MIRN_EN         1<<6
-#define UARTM_EN        1<<7
-#define SIBADC_EN       1<<8
-#define ALTD_EN         1<<9
-#define CLCLK_EN        1<<10
-
-/* SYS_CLOCK -> SELECT */
-
-#define CLK18M_DIV      1<<0
-#define MIR_SEL         1<<1
-#define SSP_SEL         1<<4
-#define MM_DIV          1<<5
-#define MM_SEL          1<<6
-#define ADC_SEL_2       0<<7
-#define ADC_SEL_4       1<<7
-#define ADC_SEL_8       3<<7
-#define ADC_SEL_16      7<<7
-#define ADC_SEL_32      0x0f<<7
-#define ADC_SEL_64      0x1f<<7
-#define ADC_SEL_128     0x3f<<7
-#define ALTD_SEL        1<<13
diff --git a/arch/arm/mach-l7200/include/mach/system.h b/arch/arm/mach-l7200/include/mach/system.h
deleted file mode 100644 (file)
index e0dd3b6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/system.h
- *
- * Copyright (c) 2000 Steve Hill (sjhill@cotw.com)
- *
- * Changelog
- *  03-21-2000  SJH    Created
- *  04-26-2000  SJH    Fixed functions
- *  05-03-2000  SJH    Removed usage of obsolete 'iomd.h'
- *  05-31-2000  SJH    Properly implemented 'arch_idle'
- */
-#ifndef __ASM_ARCH_SYSTEM_H
-#define __ASM_ARCH_SYSTEM_H
-
-#include <mach/hardware.h>
-
-static inline void arch_idle(void)
-{
-       *(unsigned long *)(IO_BASE + 0x50004) = 1;      /* idle mode */
-}
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       if (mode == 's') {
-               cpu_reset(0);
-       }
-}
-
-#endif
diff --git a/arch/arm/mach-l7200/include/mach/time.h b/arch/arm/mach-l7200/include/mach/time.h
deleted file mode 100644 (file)
index 061771c..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/time.h
- *
- * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
- *                    Steve Hill (sjhill@cotw.com)
- *
- * Changelog:
- *   01-02-2000        RS      Created l7200 version, derived from rpc code
- *   05-03-2000        SJH     Complete rewrite
- */
-#ifndef _ASM_ARCH_TIME_H
-#define _ASM_ARCH_TIME_H
-
-#include <mach/irqs.h>
-
-/*
- * RTC base register address
- */
-#define RTC_BASE       (IO_BASE_2 + 0x2000)
-
-/*
- * RTC registers
- */
-#define RTC_RTCDR      (*(volatile unsigned char *) (RTC_BASE + 0x000))
-#define RTC_RTCMR      (*(volatile unsigned char *) (RTC_BASE + 0x004))
-#define RTC_RTCS       (*(volatile unsigned char *) (RTC_BASE + 0x008))
-#define RTC_RTCC       (*(volatile unsigned char *) (RTC_BASE + 0x008))
-#define RTC_RTCDV      (*(volatile unsigned char *) (RTC_BASE + 0x00c))
-#define RTC_RTCCR      (*(volatile unsigned char *) (RTC_BASE + 0x010))
-
-/*
- * RTCCR register values
- */
-#define RTC_RATE_32    0x00      /* 32 Hz tick */
-#define RTC_RATE_64    0x10      /* 64 Hz tick */
-#define RTC_RATE_128   0x20      /* 128 Hz tick */
-#define RTC_RATE_256   0x30      /* 256 Hz tick */
-#define RTC_EN_ALARM   0x01      /* Enable alarm */
-#define RTC_EN_TIC     0x04      /* Enable counter */
-#define RTC_EN_STWDOG  0x08      /* Enable watchdog */
-
-/*
- * Handler for RTC timer interrupt
- */
-static irqreturn_t
-timer_interrupt(int irq, void *dev_id)
-{
-       struct pt_regs *regs = get_irq_regs();
-       do_timer(1);
-#ifndef CONFIG_SMP
-       update_process_times(user_mode(regs));
-#endif
-       do_profile(regs);
-       RTC_RTCC = 0;                           /* Clear interrupt */
-
-       return IRQ_HANDLED;
-}
-
-/*
- * Set up RTC timer interrupt, and return the current time in seconds.
- */
-void __init time_init(void)
-{
-       RTC_RTCC = 0;                           /* Clear interrupt */
-
-       timer_irq.handler = timer_interrupt;
-
-       setup_irq(IRQ_RTC_TICK, &timer_irq);
-
-       RTC_RTCCR = RTC_RATE_128 | RTC_EN_TIC;  /* Set rate and enable timer */
-}
-
-#endif
diff --git a/arch/arm/mach-l7200/include/mach/timex.h b/arch/arm/mach-l7200/include/mach/timex.h
deleted file mode 100644 (file)
index ffc96a6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/timex.h
- *
- * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
- *                    Steve Hill (sjhill@cotw.com)
- *
- * 04-21-2000  RS Created file
- * 05-03-2000 SJH Tick rate was wrong
- *
- */
-
-/*
- * On the ARM720T, clock ticks are set to 128 Hz.
- *
- * NOTE: The actual RTC value is set in 'time.h' which
- *       must be changed when choosing a different tick
- *       rate. The value of HZ in 'param.h' must also
- *       be changed to match below.
- */
-#define CLOCK_TICK_RATE                128
diff --git a/arch/arm/mach-l7200/include/mach/uncompress.h b/arch/arm/mach-l7200/include/mach/uncompress.h
deleted file mode 100644 (file)
index 591c962..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/uncompress.h
- *
- * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
- *
- * Changelog:
- *  05-01-2000 SJH     Created
- *  05-13-2000 SJH     Filled in function bodies
- *  07-26-2000 SJH     Removed hard coded baud rate
- */
-
-#include <mach/hardware.h>
-
-#define IO_UART  IO_START + 0x00044000
-
-#define __raw_writeb(v,p)      (*(volatile unsigned char *)(p) = (v))
-#define __raw_readb(p)         (*(volatile unsigned char *)(p))
-
-static inline void putc(int c)
-{
-       while(__raw_readb(IO_UART + 0x18) & 0x20 ||
-             __raw_readb(IO_UART + 0x18) & 0x08)
-               barrier();
-
-       __raw_writeb(c, IO_UART + 0x00);
-}
-
-static inline void flush(void)
-{
-}
-
-static __inline__ void arch_decomp_setup(void)
-{
-       __raw_writeb(0x00, IO_UART + 0x08);     /* Set HSB */
-       __raw_writeb(0x00, IO_UART + 0x20);     /* Disable IRQs */
-       __raw_writeb(0x01, IO_UART + 0x14);     /* Enable UART */
-}
-
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-l7200/include/mach/vmalloc.h b/arch/arm/mach-l7200/include/mach/vmalloc.h
deleted file mode 100644 (file)
index 85f0abb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/*
- * arch/arm/mach-l7200/include/mach/vmalloc.h
- */
-#define VMALLOC_END       (PAGE_OFFSET + 0x10000000)
index 189d20e543e75f41b52a39f4f009e30ed87ed2d5..edb8f5faf5d5032c9047d4c743a66e1230dbe0e8 100644 (file)
  */
 #define PHYS_OFFSET    UL(0xc0000000)
 
-#ifdef CONFIG_DISCONTIGMEM
-
-/*
- * Given a kernel address, find the home node of the underlying memory.
- */
-
-# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
-#  define KVADDR_TO_NID(addr) \
-  (  ((((unsigned long) (addr) - PAGE_OFFSET) >> 24) &  1)\
-   | ((((unsigned long) (addr) - PAGE_OFFSET) >> 25) & ~1))
-# else  /* 2 banks per node */
-#  define KVADDR_TO_NID(addr) \
-      (((unsigned long) (addr) - PAGE_OFFSET) >> 26)
-# endif
-
-/*
- * Given a page frame number, convert it to a node id.
- */
-
-# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
-#  define PFN_TO_NID(pfn) \
-  (((((pfn) - PHYS_PFN_OFFSET) >> (24 - PAGE_SHIFT)) &  1)\
- | ((((pfn) - PHYS_PFN_OFFSET) >> (25 - PAGE_SHIFT)) & ~1))
-# else  /* 2 banks per node */
-#  define PFN_TO_NID(pfn) \
-    (((pfn) - PHYS_PFN_OFFSET) >> (26 - PAGE_SHIFT))
-#endif
-
-/*
- * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
- * and returns the index corresponding to the appropriate page in the
- * node's mem_map.
- */
-
-# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
-#  define LOCAL_MAP_NR(addr) \
-       (((unsigned long)(addr) & 0x003fffff) >> PAGE_SHIFT)
-# else  /* 2 banks per node */
-#  define LOCAL_MAP_NR(addr) \
-       (((unsigned long)(addr) & 0x01ffffff) >> PAGE_SHIFT)
-# endif
-
-#endif
-
 /*
  * Sparsemem version of the above
  */
index dca5a5f062dce229fe98b9e00fe5f18e5ff40620..e69a1502e4e8dc80cac9dd620497b5adddd0e6d4 100644 (file)
@@ -50,7 +50,6 @@ static void __init trout_fixup(struct machine_desc *desc, struct tag *tags,
 {
        mi->nr_banks = 1;
        mi->bank[0].start = PHYS_OFFSET;
-       mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
        mi->bank[0].size = (101*1024*1024);
 }
 
index f035f4185274160757e11d32377509defbdfb1b7..89f793adf77643093c9e465c35447553102ae295 100644 (file)
@@ -53,6 +53,10 @@ static struct clk clk_default;
        }
 
 static struct clk_lookup lookups[] = {
+       {
+               .con_id         = "apb_pclk",
+               .clk            = &clk_default,
+       },
        CLK(&clk_24, "mtu0"),
        CLK(&clk_24, "mtu1"),
        CLK(&clk_48, "uart0"),
index 0859336a8e6d1be71a8090c1e8ef53b1640c87bc..5c934bdb71583e037c59fdadc3490e43838ff425 100644 (file)
@@ -8,6 +8,7 @@
  * the Free Software Foundation.
  */
 #include <mach/hardware.h>
+#include <asm/memory.h>
 
 #include <mach/regs-board-a9m9750dev.h>
 
index 1b12d324b087d1528c87d828bebec3308be1dbaa..770a68c46e8114f4a7360b559e0ddecd15cfdc57 100644 (file)
@@ -20,50 +20,49 @@ static void putc_dummy(char c, void __iomem *base)
        /* nothing */
 }
 
+static int timeout;
+
 static void putc_ns9360(char c, void __iomem *base)
 {
-       static int t = 0x10000;
        do {
-               if (t)
-                       --t;
+               if (timeout)
+                       --timeout;
 
                if (__raw_readl(base + 8) & (1 << 3)) {
                        __raw_writeb(c, base + 16);
-                       t = 0x10000;
+                       timeout = 0x10000;
                        break;
                }
-       } while (t);
+       } while (timeout);
 }
 
 static void putc_a9m9750dev(char c, void __iomem *base)
 {
-       static int t = 0x10000;
        do {
-               if (t)
-                       --t;
+               if (timeout)
+                       --timeout;
 
                if (__raw_readb(base + 5) & (1 << 5)) {
                        __raw_writeb(c, base);
-                       t = 0x10000;
+                       timeout = 0x10000;
                        break;
                }
-       } while (t);
+       } while (timeout);
 
 }
 
 static void putc_ns921x(char c, void __iomem *base)
 {
-       static int t = 0x10000;
        do {
-               if (t)
-                       --t;
+               if (timeout)
+                       --timeout;
 
                if (!(__raw_readl(base) & (1 << 11))) {
                        __raw_writeb(c, base + 0x0028);
-                       t = 0x10000;
+                       timeout = 0x10000;
                        break;
                }
-       } while (t);
+       } while (timeout);
 }
 
 #define MSCS __REG(0xA0900184)
@@ -89,6 +88,7 @@ static void putc_ns921x(char c, void __iomem *base)
 
 static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base)
 {
+       timeout = 0x10000;
        if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) {
                /* ns9360 or ns9750 */
                if (NS9360_UART_ENABLED(NS9360_UARTA)) {
index fdd1dd53fa9ceddcc5738687b36215d31c3b8ca0..0a9d61d2d2293f8b51c32eb82cd4bea5ada9e6d9 100644 (file)
@@ -301,6 +301,7 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = ams_delta_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = ams_delta_init_irq,
        .init_machine   = ams_delta_init,
        .timer          = &omap_timer,
index 096f2ed102cbe5aa8fff6a3632022f999776c51d..059bac60b35ae7a3d5d5a59a7e481e549989ae2d 100644 (file)
@@ -378,6 +378,7 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_fsample_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_fsample_init_irq,
        .init_machine   = omap_fsample_init,
        .timer          = &omap_timer,
index e1195a3467b86106a60c258a429c664ca818569e..7a65684d2a15b52064a7afee5be0926b5d8e0ffd 100644 (file)
@@ -98,6 +98,7 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_generic_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_generic_init_irq,
        .init_machine   = omap_generic_init,
        .timer          = &omap_timer,
index d1100e4f65aca736c6113643c1310cff4bc2a9b4..68b2beda8b99c8ef9e5261e7a658d0968bb7d27b 100644 (file)
@@ -467,6 +467,7 @@ MACHINE_START(OMAP_H2, "TI-H2")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = h2_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = h2_init_irq,
        .init_machine   = h2_init,
        .timer          = &omap_timer,
index a53ab8297d25eb05185b433d310ab2dd415290bf..0b0825fe6751aea72a6ee39e490ab75bf087fd79 100644 (file)
@@ -437,6 +437,7 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = h3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = h3_init_irq,
        .init_machine   = h3_init,
        .timer          = &omap_timer,
index 8e313b4b99a9d91145201f1d2e28a4a022a7f151..d70a4f0923f53278858692e2bf48637dbb495a4b 100644 (file)
@@ -304,6 +304,7 @@ MACHINE_START(HERALD, "HTC Herald")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = htcherald_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = htcherald_init_irq,
        .init_machine   = htcherald_init,
        .timer          = &omap_timer,
index 5d12fd35681b24041695fd3a324bb5a8f2d226bc..91064b37859a131e1d71250d941ebb4e3844237f 100644 (file)
@@ -463,6 +463,7 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = innovator_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = innovator_init_irq,
        .init_machine   = innovator_init,
        .timer          = &omap_timer,
index 71e1a3fad0ead110b7947e555af8c652da261695..8c28b10f3dae75b091017600d03c2d1ed67eca07 100644 (file)
@@ -400,6 +400,7 @@ MACHINE_START(NOKIA770, "Nokia 770")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_nokia770_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_nokia770_init_irq,
        .init_machine   = omap_nokia770_init,
        .timer          = &omap_timer,
index 80d862001def595ef2fada032e909a9bcd9aea01..e2a72af30890bbd54850257c3d82df1e5e38339f 100644 (file)
@@ -584,6 +584,7 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = osk_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = osk_init_irq,
        .init_machine   = osk_init,
        .timer          = &omap_timer,
index 569b4c9085cd8b952f91716ebe7e00984ebe7169..61a2321b97323d200db96f1e6e8ceb73794189ed 100644 (file)
@@ -373,6 +373,7 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_palmte_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_palmte_init_irq,
        .init_machine   = omap_palmte_init,
        .timer          = &omap_timer,
index 6ad49a2cc1a03af4368628ddef06896786d6c3ae..21c01c6afcc1690faaa3cea3399b085b2e8efc9f 100644 (file)
@@ -321,6 +321,7 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_palmtt_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_palmtt_init_irq,
        .init_machine   = omap_palmtt_init,
        .timer          = &omap_timer,
index 6641de9257efa047cbf02d94e37506675913c354..f324924515332e956e1eebbda1319b54f9a8a407 100644 (file)
@@ -338,10 +338,12 @@ omap_palmz71_map_io(void)
 }
 
 MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
-       .phys_io = 0xfff00000,
-       .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
-       .boot_params = 0x10000100,.map_io = omap_palmz71_map_io,
-       .init_irq = omap_palmz71_init_irq,
-       .init_machine = omap_palmz71_init,
-       .timer = &omap_timer,
+       .phys_io        = 0xfff00000,
+       .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
+       .boot_params    = 0x10000100,
+       .map_io         = omap_palmz71_map_io,
+       .reserve        = omap_reserve,
+       .init_irq       = omap_palmz71_init_irq,
+       .init_machine   = omap_palmz71_init,
+       .timer          = &omap_timer,
 MACHINE_END
index e854d5741c8889daad675ae230bef5848bdcf6fa..8b5ab1fcc405820979ea0e70c2f7a86ed68c17bb 100644 (file)
@@ -339,6 +339,7 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_perseus2_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_perseus2_init_irq,
        .init_machine   = omap_perseus2_init,
        .timer          = &omap_timer,
index 2fb1e5f8e2ec5c637a992007123842bf7e48d2f3..995566b862bb739c04953e2d3ad94175b494570b 100644 (file)
@@ -423,7 +423,8 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_sx1_map_io,
-       .init_irq               = omap_sx1_init_irq,
+       .reserve        = omap_reserve,
+       .init_irq       = omap_sx1_init_irq,
        .init_machine   = omap_sx1_init,
        .timer          = &omap_timer,
 MACHINE_END
index 87b9436fe7c0c011972fd24b7da43716a5aad5fd..4c483dc1de5c4fa3ee22f2db095b1b4b4d273e31 100644 (file)
@@ -287,6 +287,7 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = voiceblue_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = voiceblue_init_irq,
        .init_machine   = voiceblue_init,
        .timer          = &omap_timer,
index d9b8d82530ae165bf18ab272c49ff61a069ae298..0ce3fec2d257c2b6183a4b426608e56679ff556c 100644 (file)
@@ -22,7 +22,6 @@
 
 extern void omap_check_revision(void);
 extern void omap_sram_init(void);
-extern void omapfb_reserve_sdram(void);
 
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -122,7 +121,6 @@ void __init omap1_map_common_io(void)
 #endif
 
        omap_sram_init();
-       omapfb_reserve_sdram();
 }
 
 /*
index a11a575745e44c5bcab1d1fd7cc202afeedd06ea..42f49f785c93811c8956192287159ed711a07115 100644 (file)
@@ -248,6 +248,7 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_2430sdp_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_2430sdp_init_irq,
        .init_machine   = omap_2430sdp_init,
        .timer          = &omap_timer,
index f474a80b886733582af7f3dba04929ce02cd561b..dd9c03171a19c3dd0d83c69a9109fb92c18c380c 100644 (file)
@@ -815,6 +815,7 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_3430sdp_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_3430sdp_init_irq,
        .init_machine   = omap_3430sdp_init,
        .timer          = &omap_timer,
index 504d2bd222fe35ec02bb277f5f87d6af6f18e5e8..57290fb3fcd76d5171c1316b17c944f7df78c3d4 100644 (file)
@@ -108,6 +108,7 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_sdp_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_sdp_init_irq,
        .init_machine   = omap_sdp_init,
        .timer          = &omap_timer,
index e4a5d66b83b8bbb5e8f1701bbba5a94f825b9703..4bb2c5d151ec9908164e5263ad7a903342e732f6 100644 (file)
@@ -402,6 +402,7 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_4430sdp_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_4430sdp_init_irq,
        .init_machine   = omap_4430sdp_init,
        .timer          = &omap_timer,
index af383a8769432fd108bc48efedf5e893e93f60fe..7da92defcde04e0604125da51d320f548f91c82e 100644 (file)
@@ -472,6 +472,7 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
        .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = am3517_evm_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = am3517_evm_init_irq,
        .init_machine   = am3517_evm_init,
        .timer          = &omap_timer,
index aa69fb999748af3698a6950f9549a59c8260f5a7..bd75642aee65d0828ebf7897806662c20b616c54 100644 (file)
@@ -346,6 +346,7 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_apollon_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_apollon_init_irq,
        .init_machine   = omap_apollon_init,
        .timer          = &omap_timer,
index e679a2cc86c3061031923123c21e4189bf028e8a..bc4c3f807068ee76848370482587e6566aa2f482 100644 (file)
@@ -837,6 +837,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
        .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = cm_t35_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = cm_t35_init_irq,
        .init_machine   = cm_t35_init,
        .timer          = &omap_timer,
index 77022b58881670fc38bf3c88840a4b925ae0ff03..922b7464807fb964193b5298d2f2f99d98f6e7fd 100644 (file)
@@ -825,6 +825,7 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
        .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = devkit8000_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = devkit8000_init_irq,
        .init_machine   = devkit8000_init,
        .timer          = &omap_timer,
index 16cc06860670ed7cf22c4a6e1d991d6e76fe3b89..9242902d3a43ccf36670f89daee4a2a5677b11ef 100644 (file)
@@ -59,6 +59,7 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_generic_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_generic_init_irq,
        .init_machine   = omap_generic_init,
        .timer          = &omap_timer,
index 0665f2c8dc8e894a1e949baf2a273e7bef104159..16703fdb3515e73347bb1bb5c1c556295fbce223 100644 (file)
@@ -378,6 +378,7 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_h4_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_h4_init_irq,
        .init_machine   = omap_h4_init,
        .timer          = &omap_timer,
index d55c57b761a988e3bb62cc2adeb999709861db2c..759e39d1a702fdc9b84f12a70990e995154bc6d6 100644 (file)
@@ -543,6 +543,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = igep2_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = igep2_init_irq,
        .init_machine   = igep2_init,
        .timer          = &omap_timer,
index fefd7e6e97796a9ede0ce8076de96f9ee437fb9d..9cd2669113e49f548375b09260100e9da078cfd1 100644 (file)
@@ -417,6 +417,7 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_ldp_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_ldp_init_irq,
        .init_machine   = omap_ldp_init,
        .timer          = &omap_timer,
index 3ccc34ebdcc79c11e021b4c80e9fca550bfea037..2565ff08a2218963d1b0213b75127f764e37ea2b 100644 (file)
@@ -667,6 +667,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = n8x0_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = n8x0_init_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap_timer,
@@ -677,6 +678,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = n8x0_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = n8x0_init_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap_timer,
@@ -687,6 +689,7 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = n8x0_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = n8x0_init_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap_timer,
index 69b154cdc75dcaa2c46d0a33434cfc7c379fd1fc..0ab0c26db4dd063c99966612ca210c80ec6f3092 100644 (file)
@@ -519,6 +519,7 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap3_beagle_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap3_beagle_init_irq,
        .init_machine   = omap3_beagle_init,
        .timer          = &omap_timer,
index b952610138121862368aab2296ef30552bdc5528..a3d2e285e116111161939de0c8d2ec689cc5cb8f 100644 (file)
@@ -727,6 +727,7 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap3_evm_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap3_evm_init_irq,
        .init_machine   = omap3_evm_init,
        .timer          = &omap_timer,
index db06dc910ba755c6988cc11155c3f047dff3c792..c0f4f12eba549458fefc82124dfd3938f9976efe 100644 (file)
@@ -601,6 +601,7 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap3pandora_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap3pandora_init_irq,
        .init_machine   = omap3pandora_init,
        .timer          = &omap_timer,
index 2f5f8233dd5b8857bcfddb29d178f802fbd1271f..f05b867c585109392708a6bdb37f49392fbc775c 100644 (file)
@@ -571,6 +571,7 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
        .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap3_touchbook_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap3_touchbook_init_irq,
        .init_machine   = omap3_touchbook_init,
        .timer          = &omap_timer,
index 79ac41400c218039193ab8a3384805d74953797a..87acb2f198ecaedf274b18973f6ca1e99f037d96 100644 (file)
@@ -495,6 +495,7 @@ MACHINE_START(OVERO, "Gumstix Overo")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = overo_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = overo_init_irq,
        .init_machine   = overo_init,
        .timer          = &omap_timer,
index abdf321c2d4155b1d7b021722b37026d2ab60a81..03483920ed6e0b12fa007c3438d3ea4401f8ec7f 100644 (file)
@@ -175,6 +175,10 @@ static void __init rx51_add_gpio_keys(void)
 #endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */
 
 static int board_keymap[] = {
+       /*
+        * Note that KEY(x, 8, KEY_XXX) entries represent "entrire row
+        * connected to the ground" matrix state.
+        */
        KEY(0, 0, KEY_Q),
        KEY(0, 1, KEY_O),
        KEY(0, 2, KEY_P),
@@ -182,6 +186,7 @@ static int board_keymap[] = {
        KEY(0, 4, KEY_BACKSPACE),
        KEY(0, 6, KEY_A),
        KEY(0, 7, KEY_S),
+
        KEY(1, 0, KEY_W),
        KEY(1, 1, KEY_D),
        KEY(1, 2, KEY_F),
@@ -190,6 +195,7 @@ static int board_keymap[] = {
        KEY(1, 5, KEY_J),
        KEY(1, 6, KEY_K),
        KEY(1, 7, KEY_L),
+
        KEY(2, 0, KEY_E),
        KEY(2, 1, KEY_DOT),
        KEY(2, 2, KEY_UP),
@@ -197,6 +203,8 @@ static int board_keymap[] = {
        KEY(2, 5, KEY_Z),
        KEY(2, 6, KEY_X),
        KEY(2, 7, KEY_C),
+       KEY(2, 8, KEY_F9),
+
        KEY(3, 0, KEY_R),
        KEY(3, 1, KEY_V),
        KEY(3, 2, KEY_B),
@@ -205,20 +213,23 @@ static int board_keymap[] = {
        KEY(3, 5, KEY_SPACE),
        KEY(3, 6, KEY_SPACE),
        KEY(3, 7, KEY_LEFT),
+
        KEY(4, 0, KEY_T),
        KEY(4, 1, KEY_DOWN),
        KEY(4, 2, KEY_RIGHT),
        KEY(4, 4, KEY_LEFTCTRL),
        KEY(4, 5, KEY_RIGHTALT),
        KEY(4, 6, KEY_LEFTSHIFT),
+       KEY(4, 8, KEY_F10),
+
        KEY(5, 0, KEY_Y),
+       KEY(5, 8, KEY_F11),
+
        KEY(6, 0, KEY_U),
+
        KEY(7, 0, KEY_I),
        KEY(7, 1, KEY_F7),
        KEY(7, 2, KEY_F8),
-       KEY(0xff, 2, KEY_F9),
-       KEY(0xff, 4, KEY_F10),
-       KEY(0xff, 5, KEY_F11),
 };
 
 static struct matrix_keymap_data board_map_data = {
index 1b86b5bb87a219bc89d3703131c2d70c28181d04..3bd956f9e19f5bb74588dd28fcae16aa047e55de 100644 (file)
@@ -154,6 +154,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = rx51_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = rx51_init_irq,
        .init_machine   = rx51_init,
        .timer          = &omap_timer,
index 803ef14cbf2d64ca3218e56ce4e48572088fe67f..ffe188cb18e90185f306199bae2b6da0acb71a91 100644 (file)
@@ -95,6 +95,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
        .io_pg_offst    = (ZOOM_UART_VIRT >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_zoom2_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_zoom2_init_irq,
        .init_machine   = omap_zoom2_init,
        .timer          = &omap_timer,
index 33147042485f5f505c7a0906f2b0d94e02a9f460..5b605eba3e7bcf449c9fa62020233e49b8f8ae8a 100644 (file)
@@ -77,6 +77,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
        .io_pg_offst    = (ZOOM_UART_VIRT >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_zoom_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_zoom_init_irq,
        .init_machine   = omap_zoom_init,
        .timer          = &omap_timer,
index 41b155acfca7cf2605202f78ffbe45a84ebf594a..d33744117ce2488067b50c739afd701623beb315 100644 (file)
@@ -3166,6 +3166,10 @@ static struct clk uart4_ick_am35xx = {
        .recalc         = &followparent_recalc,
 };
 
+static struct clk dummy_apb_pclk = {
+       .name           = "apb_pclk",
+       .ops            = &clkops_null,
+};
 
 /*
  * clkdev
@@ -3173,6 +3177,7 @@ static struct clk uart4_ick_am35xx = {
 
 /* XXX At some point we should rename this file to clock3xxx_data.c */
 static struct omap_clk omap3xxx_clks[] = {
+       CLK(NULL,       "apb_pclk",     &dummy_apb_pclk,        CK_3XXX),
        CLK(NULL,       "omap_32k_fck", &omap_32k_fck,  CK_3XXX),
        CLK(NULL,       "virt_12m_ck",  &virt_12m_ck,   CK_3XXX),
        CLK(NULL,       "virt_13m_ck",  &virt_13m_ck,   CK_3XXX),
index 3cfb425ea67e86585f66e1595b29e2c28b4d31ea..4e1f53d0b8801cfb799a626d80562d1df0378103 100644 (file)
@@ -33,7 +33,6 @@
 #include <plat/sdrc.h>
 #include <plat/gpmc.h>
 #include <plat/serial.h>
-#include <plat/vram.h>
 
 #include "clock2xxx.h"
 #include "clock3xxx.h"
@@ -241,8 +240,6 @@ static void __init _omap2_map_common_io(void)
 
        omap2_check_revision();
        omap_sram_init();
-       omapfb_reserve_sdram();
-       omap_vram_reserve_sdram();
 }
 
 #ifdef CONFIG_ARCH_OMAP2420
index 161fc2d6120705b2f4737c5f1980b7631fd089a5..0f3130599770f2a7008d2de009ea09266620e708 100644 (file)
@@ -35,7 +35,7 @@ static int cmx2xx_it8152_irq_gpio;
  * This is really ugly and we need a better way of specifying
  * DMA-capable regions of memory.
  */
-void __init cmx2xx_pci_adjust_zones(int node, unsigned long *zone_size,
+void __init cmx2xx_pci_adjust_zones(unsigned long *zone_size,
        unsigned long *zhole_size)
 {
        unsigned int sz = SZ_64M >> PAGE_SHIFT;
@@ -46,7 +46,7 @@ void __init cmx2xx_pci_adjust_zones(int node, unsigned long *zone_size,
                /*
                 * Only adjust if > 64M on current system
                 */
-               if (node || (zone_size[0] <= sz))
+               if (zone_size[0] <= sz)
                        return;
 
                zone_size[1] = zone_size[0] - sz;
index 45c23fd6df31e9696d2b0c42be0752cba1683217..40b6ac2de876cf8dcc4c0328b72b086e15253eb8 100644 (file)
@@ -26,6 +26,7 @@
 #include <mach/colibri.h>
 #include <mach/ohci.h>
 #include <mach/pxafb.h>
+#include <mach/audio.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -145,7 +146,7 @@ static void __init colibri_pxa300_init_lcd(void)
 static inline void colibri_pxa300_init_lcd(void) {}
 #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
 
-#if defined(SND_AC97_CODEC) || defined(SND_AC97_CODEC_MODULE)
+#if defined(CONFIG_SND_AC97_CODEC) || defined(CONFIG_SND_AC97_CODEC_MODULE)
 static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = {
        GPIO24_AC97_SYSCLK,
        GPIO23_AC97_nACRESET,
index 3d1dcb9ac08f497fc63e333ee6d20438f20d0d28..461ba4080155414d6e64b8d0f61f4dcee49a24fa 100644 (file)
@@ -446,7 +446,7 @@ static struct platform_device corgiled_device = {
 static struct pxamci_platform_data corgi_mci_platform_data = {
        .detect_delay_ms        = 250,
        .ocr_mask               = MMC_VDD_32_33|MMC_VDD_33_34,
-       .gpio_card_detect       = -1,
+       .gpio_card_detect       = CORGI_GPIO_nSD_DETECT,
        .gpio_card_ro           = CORGI_GPIO_nSD_WP,
        .gpio_power             = CORGI_GPIO_SD_PWR,
 };
@@ -715,7 +715,6 @@ static void __init fixup_corgi(struct machine_desc *desc,
        sharpsl_save_param();
        mi->nr_banks=1;
        mi->bank[0].start = 0xa0000000;
-       mi->bank[0].node = 0;
        if (machine_is_corgi())
                mi->bank[0].size = (32*1024*1024);
        else
index 9e4d9816726ad5d75c0657f9a32d0b36c0ec3aa7..268a9bc6be8a22a4ca0ac4fed742d035753581a3 100644 (file)
@@ -256,13 +256,9 @@ static void init_sdram_rows(void)
 
 static u32 mdrefr_dri(unsigned int freq)
 {
-       u32 dri = 0;
+       u32 interval = freq * SDRAM_TREF / sdram_rows;
 
-       if (cpu_is_pxa25x())
-               dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
-       if (cpu_is_pxa27x())
-               dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
-       return dri;
+       return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32;
 }
 
 /* find a valid frequency point */
index 96ed13081639598335309b23b992751d27102ea5..a0ab3082a0009d31b3837f1234f6f4175cde6a8b 100644 (file)
@@ -34,7 +34,6 @@ void __init eseries_fixup(struct machine_desc *desc,
 {
        mi->nr_banks=1;
        mi->bank[0].start = 0xa0000000;
-       mi->bank[0].node = 0;
        if (machine_is_e800())
                mi->bank[0].size = (128*1024*1024);
        else
index 890fb90a672f5e957af6f9d75f78425f4d371fd5..c6305c5b8a72c1497ee05aee42d7795b07513c94 100644 (file)
@@ -26,8 +26,7 @@ extern unsigned int get_clk_frequency_khz(int info);
 
 #define SET_BANK(__nr,__start,__size) \
        mi->bank[__nr].start = (__start), \
-       mi->bank[__nr].size = (__size), \
-       mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
+       mi->bank[__nr].size = (__size)
 
 #define ARRAY_AND_SIZE(x)      (x), ARRAY_SIZE(x)
 
index f626730ee42e11a8071149677b43f55fb85666a7..92361a66b223d9f62243074d26ee534a131cba64 100644 (file)
  */
 #define PHYS_OFFSET    UL(0xa0000000)
 
-/*
- * The nodes are matched with the physical SDRAM banks as follows:
- *
- *     node 0:  0xa0000000-0xa3ffffff  -->  0xc0000000-0xc3ffffff
- *     node 1:  0xa4000000-0xa7ffffff  -->  0xc4000000-0xc7ffffff
- *     node 2:  0xa8000000-0xabffffff  -->  0xc8000000-0xcbffffff
- *     node 3:  0xac000000-0xafffffff  -->  0xcc000000-0xcfffffff
- *
- * This needs a node mem size of 26 bits.
- */
-#define NODE_MEM_SIZE_BITS     26
-
 #if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
-void cmx2xx_pci_adjust_zones(int node, unsigned long *size,
-                            unsigned long *holes);
+void cmx2xx_pci_adjust_zones(unsigned long *size, unsigned long *holes);
 
-#define arch_adjust_zones(node, size, holes) \
-       cmx2xx_pci_adjust_zones(node, size, holes)
+#define arch_adjust_zones(size, holes) \
+       cmx2xx_pci_adjust_zones(size, holes)
 
 #define ISA_DMA_THRESHOLD      (PHYS_OFFSET + SZ_64M - 1)
 #define MAX_DMA_ADDRESS                (PAGE_OFFSET + SZ_64M)
index 5305a3993e694b77666920db5e1581a1abb503fc..5e92d84fe50d0805be94a07f583c40ee46f0e6c4 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/irq.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
+#include <linux/memblock.h>
 #include <linux/pda_power.h>
 #include <linux/pwm_backlight.h>
 #include <linux/gpio.h>
@@ -396,6 +397,11 @@ static void __init palmt5_udc_init(void)
        }
 }
 
+static void __init palmt5_reserve(void)
+{
+       memblock_reserve(0xa0200000, 0x1000);
+}
+
 static void __init palmt5_init(void)
 {
        pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config));
@@ -421,6 +427,7 @@ MACHINE_START(PALMT5, "Palm Tungsten|T5")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .reserve        = palmt5_reserve,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = palmt5_init
index d8b4469607a1e1794a1775238bddd8c478e99e4a..3d0c9cc2a40648a049a3ccc81a34c5f03f4126de 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/irq.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
+#include <linux/memblock.h>
 #include <linux/pda_power.h>
 #include <linux/pwm_backlight.h>
 #include <linux/gpio.h>
@@ -633,6 +634,12 @@ static void __init treo_lcd_power_init(void)
        treo_lcd_screen.pxafb_lcd_power = treo_lcd_power;
 }
 
+static void __init treo_reserve(void)
+{
+       memblock_reserve(0xa0000000, 0x1000);
+       memblock_reserve(0xa2000000, 0x1000);
+}
+
 static void __init treo_init(void)
 {
        pxa_set_ffuart_info(NULL);
@@ -668,6 +675,7 @@ MACHINE_START(TREO680, "Palm Treo 680")
        .io_pg_offst    = io_p2v(0x40000000),
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .reserve        = treo_reserve,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = treo680_init,
@@ -691,6 +699,7 @@ MACHINE_START(CENTRO, "Palm Centro 685")
        .io_pg_offst    = io_p2v(0x40000000),
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .reserve        = treo_reserve,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = centro_init,
index f4abdaafdac4d5c552bd7aa72421b8f8bd97a263..bc2758b54446fc5cc38db451fc70a9ed77d0511a 100644 (file)
@@ -463,7 +463,6 @@ static void __init fixup_poodle(struct machine_desc *desc,
        sharpsl_save_param();
        mi->nr_banks=1;
        mi->bank[0].start = 0xa0000000;
-       mi->bank[0].node = 0;
        mi->bank[0].size = (32*1024*1024);
 }
 
index 0af36177ff085c92f34cd729bd5775f25d948a2f..c059dac02b61412b64b22f869d2e8913404236ed 100644 (file)
@@ -41,10 +41,10 @@ void pxa27x_clear_otgph(void)
 EXPORT_SYMBOL(pxa27x_clear_otgph);
 
 static unsigned long ac97_reset_config[] = {
-       GPIO95_AC97_nRESET,
-       GPIO95_GPIO,
-       GPIO113_AC97_nRESET,
        GPIO113_GPIO,
+       GPIO113_AC97_nRESET,
+       GPIO95_GPIO,
+       GPIO95_AC97_nRESET,
 };
 
 void pxa27x_assert_ac97reset(int reset_gpio, int on)
index c1048a35f187e990984a83111110671241ff1f93..51756c723557e8c25eee690aa57e252a1aa08376 100644 (file)
@@ -847,7 +847,6 @@ static void __init fixup_spitz(struct machine_desc *desc,
        sharpsl_save_param();
        mi->nr_banks = 1;
        mi->bank[0].start = 0xa0000000;
-       mi->bank[0].node = 0;
        mi->bank[0].size = (64*1024*1024);
 }
 
index 7512b822c6cac0f1b0473a7ec029a66a45b33030..83cc3a18c2e9a0ded180a0b223f29167b3a290f7 100644 (file)
@@ -948,7 +948,6 @@ static void __init fixup_tosa(struct machine_desc *desc,
        sharpsl_save_param();
        mi->nr_banks=1;
        mi->bank[0].start = 0xa0000000;
-       mi->bank[0].node = 0;
        mi->bank[0].size = (64*1024*1024);
 }
 
index 595be19f8ad5027e29daed72bbe0fb2c5d2d1a04..a54fbda77e453f454060246264124b66a3589416 100644 (file)
@@ -61,12 +61,11 @@ void __iomem *gic_cpu_base_addr;
 /*
  * Adjust the zones if there are restrictions for DMA access.
  */
-void __init realview_adjust_zones(int node, unsigned long *size,
-                                 unsigned long *hole)
+void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)
 {
        unsigned long dma_size = SZ_256M >> PAGE_SHIFT;
 
-       if (!machine_is_realview_pbx() || node || (size[0] <= dma_size))
+       if (!machine_is_realview_pbx() || size[0] <= dma_size)
                return;
 
        size[ZONE_NORMAL] = size[0] - dma_size;
@@ -232,6 +231,21 @@ static unsigned int realview_mmc_status(struct device *dev)
        struct amba_device *adev = container_of(dev, struct amba_device, dev);
        u32 mask;
 
+       if (machine_is_realview_pb1176()) {
+               static bool inserted = false;
+
+               /*
+                * The PB1176 does not have the status register,
+                * assume it is inserted at startup, then invert
+                * for each call so card insertion/removal will
+                * be detected anyway. This will not be called if
+                * GPIO on PL061 is active, which is the proper
+                * way to do this on the PB1176.
+                */
+               inserted = !inserted;
+               return inserted ? 0 : 1;
+       }
+
        if (adev->res.start == REALVIEW_MMCI0_BASE)
                mask = 1;
        else
@@ -300,8 +314,13 @@ static struct clk ref24_clk = {
        .rate   = 24000000,
 };
 
+static struct clk dummy_apb_pclk;
+
 static struct clk_lookup lookups[] = {
-       {       /* UART0 */
+       {       /* Bus clock */
+               .con_id         = "apb_pclk",
+               .clk            = &dummy_apb_pclk,
+       }, {    /* UART0 */
                .dev_id         = "dev:uart0",
                .clk            = &ref24_clk,
        }, {    /* UART1 */
@@ -313,6 +332,12 @@ static struct clk_lookup lookups[] = {
        }, {    /* UART3 */
                .dev_id         = "fpga:uart3",
                .clk            = &ref24_clk,
+       }, {    /* UART3 is on the dev chip in PB1176 */
+               .dev_id         = "dev:uart3",
+               .clk            = &ref24_clk,
+       }, {    /* UART4 only exists in PB1176 */
+               .dev_id         = "fpga:uart4",
+               .clk            = &ref24_clk,
        }, {    /* KMI0 */
                .dev_id         = "fpga:kmi0",
                .clk            = &ref24_clk,
@@ -322,12 +347,15 @@ static struct clk_lookup lookups[] = {
        }, {    /* MMC0 */
                .dev_id         = "fpga:mmc0",
                .clk            = &ref24_clk,
-       }, {    /* EB:CLCD */
+       }, {    /* CLCD is in the PB1176 and EB DevChip */
                .dev_id         = "dev:clcd",
                .clk            = &oscvco_clk,
        }, {    /* PB:CLCD */
                .dev_id         = "issp:clcd",
                .clk            = &oscvco_clk,
+       }, {    /* SSP */
+               .dev_id         = "dev:ssp0",
+               .clk            = &ref24_clk,
        }
 };
 
@@ -342,7 +370,7 @@ static int __init clk_init(void)
 
        return 0;
 }
-arch_initcall(clk_init);
+core_initcall(clk_init);
 
 /*
  * CLCD support.
index 2f5ccb298858def61458ed544fdac81383718982..002ab5d8c11c31705ce2f419b16a0fa9b23ccfa8 100644 (file)
@@ -26,6 +26,7 @@
 /*
  * Peripheral addresses
  */
+#define REALVIEW_PB1176_UART4_BASE             0x10009000 /* UART 4 */
 #define REALVIEW_PB1176_SCTL_BASE              0x10100000 /* System controller */
 #define REALVIEW_PB1176_SMC_BASE               0x10111000 /* SMC */
 #define REALVIEW_PB1176_DMC_BASE               0x10109000 /* DMC configuration */
index 830055bb86289860626fd5cbbfb08a3c64bfe04e..5c3c625e3e04f3b84db19f25a3c1c849f3833a5b 100644 (file)
@@ -40,6 +40,7 @@
 #define IRQ_DC1176_L2CC                (IRQ_DC1176_GIC_START + 13)
 #define IRQ_DC1176_RTC         (IRQ_DC1176_GIC_START + 14)
 #define IRQ_DC1176_CLCD                (IRQ_DC1176_GIC_START + 15)     /* CLCD controller */
+#define IRQ_DC1176_SSP         (IRQ_DC1176_GIC_START + 17)     /* SSP port */
 #define IRQ_DC1176_UART0       (IRQ_DC1176_GIC_START + 18)     /* UART 0 on development chip */
 #define IRQ_DC1176_UART1       (IRQ_DC1176_GIC_START + 19)     /* UART 1 on development chip */
 #define IRQ_DC1176_UART2       (IRQ_DC1176_GIC_START + 20)     /* UART 2 on development chip */
@@ -73,7 +74,6 @@
 #define IRQ_PB1176_RTC         (IRQ_PB1176_GIC_START + 25)     /* Real Time Clock */
 
 #define IRQ_PB1176_GPIO0       -1
-#define IRQ_PB1176_SSP         -1
 #define IRQ_PB1176_SCTL                -1
 
 #define NR_GIC_PB1176          2
index 2417bbcf97fd267ff236c09f31d71ef86ad2a047..5dafc157b276207f91837923cd2efd51762820cd 100644 (file)
 #endif
 
 #if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA)
-extern void realview_adjust_zones(int node, unsigned long *size,
-                                 unsigned long *hole);
-#define arch_adjust_zones(node, size, hole) \
-       realview_adjust_zones(node, size, hole)
+extern void realview_adjust_zones(unsigned long *size, unsigned long *hole);
+#define arch_adjust_zones(size, hole) \
+       realview_adjust_zones(size, hole)
 
 #define ISA_DMA_THRESHOLD      (PHYS_OFFSET + SZ_256M - 1)
 #define MAX_DMA_ADDRESS                (PAGE_OFFSET + SZ_256M)
index 4425018fab828c864e662dfb4bfd5db369a76a15..991c1f8390e2a8eccfbbfae39ccab3768a7badbe 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/amba/bus.h>
 #include <linux/amba/pl061.h>
 #include <linux/amba/mmci.h>
+#include <linux/amba/pl022.h>
 #include <linux/io.h>
 
 #include <mach/hardware.h>
@@ -129,6 +130,12 @@ static struct pl061_platform_data gpio2_plat_data = {
        .irq_base       = -1,
 };
 
+static struct pl022_ssp_controller ssp0_plat_data = {
+       .bus_id = 0,
+       .enable_dma = 0,
+       .num_chipselect = 1,
+};
+
 /*
  * RealView EB AMBA devices
  */
@@ -213,7 +220,7 @@ AMBA_DEVICE(sci0,  "dev:sci0",  SCI,      NULL);
 AMBA_DEVICE(uart0, "dev:uart0", EB_UART0, NULL);
 AMBA_DEVICE(uart1, "dev:uart1", EB_UART1, NULL);
 AMBA_DEVICE(uart2, "dev:uart2", EB_UART2, NULL);
-AMBA_DEVICE(ssp0,  "dev:ssp0",  EB_SSP,   NULL);
+AMBA_DEVICE(ssp0,  "dev:ssp0",  EB_SSP,   &ssp0_plat_data);
 
 static struct amba_device *amba_devs[] __initdata = {
        &dmac_device,
@@ -324,6 +331,26 @@ static struct platform_device pmu_device = {
        .resource               = pmu_resources,
 };
 
+static struct resource char_lcd_resources[] = {
+       {
+               .start = REALVIEW_CHAR_LCD_BASE,
+               .end   = (REALVIEW_CHAR_LCD_BASE + SZ_4K - 1),
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start  = IRQ_EB_CHARLCD,
+               .end    = IRQ_EB_CHARLCD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device char_lcd_device = {
+       .name           =       "arm-charlcd",
+       .id             =       -1,
+       .num_resources  =       ARRAY_SIZE(char_lcd_resources),
+       .resource       =       char_lcd_resources,
+};
+
 static void __init gic_init_irq(void)
 {
        if (core_tile_eb11mp() || core_tile_a9mp()) {
@@ -442,6 +469,7 @@ static void __init realview_eb_init(void)
 
        realview_flash_register(&realview_eb_flash_resource, 1);
        platform_device_register(&realview_i2c_device);
+       platform_device_register(&char_lcd_device);
        eth_device_register();
        realview_usb_register(realview_eb_isp1761_resources);
 
index 099a1f125cf8f6c10b1720ccdcee7623ff5a73ad..d2be12eb829eb3b759be8a37bc8020df9f01d253 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/amba/bus.h>
 #include <linux/amba/pl061.h>
 #include <linux/amba/mmci.h>
+#include <linux/amba/pl022.h>
 #include <linux/io.h>
 
 #include <mach/hardware.h>
@@ -123,6 +124,12 @@ static struct pl061_platform_data gpio2_plat_data = {
        .irq_base       = -1,
 };
 
+static struct pl022_ssp_controller ssp0_plat_data = {
+       .bus_id = 0,
+       .enable_dma = 0,
+       .num_chipselect = 1,
+};
+
 /*
  * RealView PB1176 AMBA devices
  */
@@ -144,8 +151,6 @@ static struct pl061_platform_data gpio2_plat_data = {
 #define MPMC_DMA       { 0, 0 }
 #define PB1176_CLCD_IRQ        { IRQ_DC1176_CLCD, NO_IRQ }
 #define PB1176_CLCD_DMA        { 0, 0 }
-#define DMAC_IRQ       { IRQ_PB1176_DMAC, NO_IRQ }
-#define DMAC_DMA       { 0, 0 }
 #define SCTL_IRQ       { NO_IRQ, NO_IRQ }
 #define SCTL_DMA       { 0, 0 }
 #define PB1176_WATCHDOG_IRQ    { IRQ_DC1176_WATCHDOG, NO_IRQ }
@@ -166,7 +171,9 @@ static struct pl061_platform_data gpio2_plat_data = {
 #define PB1176_UART2_DMA       { 11, 10 }
 #define PB1176_UART3_IRQ       { IRQ_DC1176_UART3, NO_IRQ }
 #define PB1176_UART3_DMA       { 0x86, 0x87 }
-#define PB1176_SSP_IRQ         { IRQ_PB1176_SSP, NO_IRQ }
+#define PB1176_UART4_IRQ       { IRQ_PB1176_UART4, NO_IRQ }
+#define PB1176_UART4_DMA       { 0, 0 }
+#define PB1176_SSP_IRQ         { IRQ_DC1176_SSP, NO_IRQ }
 #define PB1176_SSP_DMA         { 9, 8 }
 
 /* FPGA Primecells */
@@ -174,7 +181,7 @@ AMBA_DEVICE(aaci,   "fpga:aaci",    AACI,           NULL);
 AMBA_DEVICE(mmc0,      "fpga:mmc0",    MMCI0,          &realview_mmc0_plat_data);
 AMBA_DEVICE(kmi0,      "fpga:kmi0",    KMI0,           NULL);
 AMBA_DEVICE(kmi1,      "fpga:kmi1",    KMI1,           NULL);
-AMBA_DEVICE(uart3,     "fpga:uart3",   PB1176_UART3,   NULL);
+AMBA_DEVICE(uart4,     "fpga:uart4",   PB1176_UART4,   NULL);
 
 /* DevChip Primecells */
 AMBA_DEVICE(smc,       "dev:smc",      PB1176_SMC,     NULL);
@@ -188,18 +195,16 @@ AMBA_DEVICE(sci0, "dev:sci0",     SCI,            NULL);
 AMBA_DEVICE(uart0,     "dev:uart0",    PB1176_UART0,   NULL);
 AMBA_DEVICE(uart1,     "dev:uart1",    PB1176_UART1,   NULL);
 AMBA_DEVICE(uart2,     "dev:uart2",    PB1176_UART2,   NULL);
-AMBA_DEVICE(ssp0,      "dev:ssp0",     PB1176_SSP,     NULL);
-
-/* Primecells on the NEC ISSP chip */
-AMBA_DEVICE(clcd,      "issp:clcd",    PB1176_CLCD,    &clcd_plat_data);
-//AMBA_DEVICE(dmac,    "issp:dmac",    PB1176_DMAC,    NULL);
+AMBA_DEVICE(uart3,     "dev:uart3",    PB1176_UART3,   NULL);
+AMBA_DEVICE(ssp0,      "dev:ssp0",     PB1176_SSP,     &ssp0_plat_data);
+AMBA_DEVICE(clcd,      "dev:clcd",     PB1176_CLCD,    &clcd_plat_data);
 
 static struct amba_device *amba_devs[] __initdata = {
-//     &dmac_device,
        &uart0_device,
        &uart1_device,
        &uart2_device,
        &uart3_device,
+       &uart4_device,
        &smc_device,
        &clcd_device,
        &sctl_device,
@@ -276,6 +281,26 @@ static struct platform_device pmu_device = {
        .resource               = &pmu_resource,
 };
 
+static struct resource char_lcd_resources[] = {
+       {
+               .start = REALVIEW_CHAR_LCD_BASE,
+               .end   = (REALVIEW_CHAR_LCD_BASE + SZ_4K - 1),
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start  = IRQ_PB1176_CHARLCD,
+               .end    = IRQ_PB1176_CHARLCD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device char_lcd_device = {
+       .name           =       "arm-charlcd",
+       .id             =       -1,
+       .num_resources  =       ARRAY_SIZE(char_lcd_resources),
+       .resource       =       char_lcd_resources,
+};
+
 static void __init gic_init_irq(void)
 {
        /* ARM1176 DevChip GIC, primary */
@@ -338,6 +363,7 @@ static void __init realview_pb1176_init(void)
        platform_device_register(&realview_i2c_device);
        realview_usb_register(realview_pb1176_isp1761_resources);
        platform_device_register(&pmu_device);
+       platform_device_register(&char_lcd_device);
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
                struct amba_device *d = amba_devs[i];
index 0e07a5ccb75f56de33bec477f242d93d88bca448..d591bc00b86ec74147b0ff0b8c7bb85e99d52041 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/amba/bus.h>
 #include <linux/amba/pl061.h>
 #include <linux/amba/mmci.h>
+#include <linux/amba/pl022.h>
 #include <linux/io.h>
 
 #include <mach/hardware.h>
@@ -124,6 +125,12 @@ static struct pl061_platform_data gpio2_plat_data = {
        .irq_base       = -1,
 };
 
+static struct pl022_ssp_controller ssp0_plat_data = {
+       .bus_id = 0,
+       .enable_dma = 0,
+       .num_chipselect = 1,
+};
+
 /*
  * RealView PB11MPCore AMBA devices
  */
@@ -190,7 +197,7 @@ AMBA_DEVICE(sci0,   "dev:sci0",     SCI,            NULL);
 AMBA_DEVICE(uart0,     "dev:uart0",    PB11MP_UART0,   NULL);
 AMBA_DEVICE(uart1,     "dev:uart1",    PB11MP_UART1,   NULL);
 AMBA_DEVICE(uart2,     "dev:uart2",    PB11MP_UART2,   NULL);
-AMBA_DEVICE(ssp0,      "dev:ssp0",     PB11MP_SSP,     NULL);
+AMBA_DEVICE(ssp0,      "dev:ssp0",     PB11MP_SSP,     &ssp0_plat_data);
 
 /* Primecells on the NEC ISSP chip */
 AMBA_DEVICE(clcd,      "issp:clcd",    PB11MP_CLCD,    &clcd_plat_data);
index ac2f06f1ca500e9bd26603b21ba6c6badf046e11..6c37621217bc916fba02af26a8d3163c4b1d4aec 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/amba/bus.h>
 #include <linux/amba/pl061.h>
 #include <linux/amba/mmci.h>
+#include <linux/amba/pl022.h>
 #include <linux/io.h>
 
 #include <asm/irq.h>
@@ -114,6 +115,12 @@ static struct pl061_platform_data gpio2_plat_data = {
        .irq_base       = -1,
 };
 
+static struct pl022_ssp_controller ssp0_plat_data = {
+       .bus_id = 0,
+       .enable_dma = 0,
+       .num_chipselect = 1,
+};
+
 /*
  * RealView PBA8Core AMBA devices
  */
@@ -180,7 +187,7 @@ AMBA_DEVICE(sci0,   "dev:sci0",     SCI,            NULL);
 AMBA_DEVICE(uart0,     "dev:uart0",    PBA8_UART0,     NULL);
 AMBA_DEVICE(uart1,     "dev:uart1",    PBA8_UART1,     NULL);
 AMBA_DEVICE(uart2,     "dev:uart2",    PBA8_UART2,     NULL);
-AMBA_DEVICE(ssp0,      "dev:ssp0",     PBA8_SSP,       NULL);
+AMBA_DEVICE(ssp0,      "dev:ssp0",     PBA8_SSP,       &ssp0_plat_data);
 
 /* Primecells on the NEC ISSP chip */
 AMBA_DEVICE(clcd,      "issp:clcd",    PBA8_CLCD,      &clcd_plat_data);
index 08fd683adc4ced929eb255fd8da2e3b733850a87..9428eff0b116addda238d99d492cbe9d80c6b8a5 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/amba/bus.h>
 #include <linux/amba/pl061.h>
 #include <linux/amba/mmci.h>
+#include <linux/amba/pl022.h>
 #include <linux/io.h>
 
 #include <asm/irq.h>
@@ -136,6 +137,12 @@ static struct pl061_platform_data gpio2_plat_data = {
        .irq_base       = -1,
 };
 
+static struct pl022_ssp_controller ssp0_plat_data = {
+       .bus_id = 0,
+       .enable_dma = 0,
+       .num_chipselect = 1,
+};
+
 /*
  * RealView PBXCore AMBA devices
  */
@@ -202,7 +209,7 @@ AMBA_DEVICE(sci0,   "dev:sci0",     SCI,            NULL);
 AMBA_DEVICE(uart0,     "dev:uart0",    PBX_UART0,      NULL);
 AMBA_DEVICE(uart1,     "dev:uart1",    PBX_UART1,      NULL);
 AMBA_DEVICE(uart2,     "dev:uart2",    PBX_UART2,      NULL);
-AMBA_DEVICE(ssp0,      "dev:ssp0",     PBX_SSP,        NULL);
+AMBA_DEVICE(ssp0,      "dev:ssp0",     PBX_SSP,        &ssp0_plat_data);
 
 /* Primecells on the NEC ISSP chip */
 AMBA_DEVICE(clcd,      "issp:clcd",    PBX_CLCD,       &clcd_plat_data);
index 779b45b3f80fdca1f6815782eef8b8dfa81b4841..3ba3bab139d0917ce45feaeb079573428f8a2af2 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
+#include <linux/memblock.h>
 #include <linux/timer.h>
 #include <linux/init.h>
 #include <linux/sysdev.h>
@@ -304,6 +305,13 @@ static void __init h1940_map_io(void)
        s3c_pm_init();
 }
 
+/* H1940 and RX3715 need to reserve this for suspend */
+static void __init h1940_reserve(void)
+{
+       memblock_reserve(0x30003000, 0x1000);
+       memblock_reserve(0x30081000, 0x1000);
+}
+
 static void __init h1940_init_irq(void)
 {
        s3c24xx_init_irq();
@@ -346,6 +354,7 @@ MACHINE_START(H1940, "IPAQ-H1940")
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
        .map_io         = h1940_map_io,
+       .reserve        = h1940_reserve,
        .init_irq       = h1940_init_irq,
        .init_machine   = h1940_init,
        .timer          = &s3c24xx_timer,
index ba93a356a83998a2b6e0ab2dfc83be7945321345..054c9f92232aa676dad11c0b86359ad21ef47fa6 100644 (file)
@@ -119,7 +119,6 @@ static void __init smdk2413_fixup(struct machine_desc *desc,
                mi->nr_banks=1;
                mi->bank[0].start = 0x30000000;
                mi->bank[0].size = SZ_64M;
-               mi->bank[0].node = 0;
        }
 }
 
index 3ca9265b699716f518d6d5b9e28f4e6f3c9e3d53..f291ac25d31252a8882bc632434a2c03f71e0361 100644 (file)
@@ -137,7 +137,6 @@ static void __init vstms_fixup(struct machine_desc *desc,
                mi->nr_banks=1;
                mi->bank[0].start = 0x30000000;
                mi->bank[0].size = SZ_64M;
-               mi->bank[0].node = 0;
        }
 }
 
index 8603b577a24b7673703db6992e2a4e3d7549e8c6..142d1f92117651e60fdad7e55fcc52997e430962 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
+#include <linux/memblock.h>
 #include <linux/delay.h>
 #include <linux/timer.h>
 #include <linux/init.h>
@@ -570,12 +571,20 @@ static void __init rx1950_init_machine(void)
        platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices));
 }
 
+/* H1940 and RX3715 need to reserve this for suspend */
+static void __init rx1950_reserve(void)
+{
+       memblock_reserve(0x30003000, 0x1000);
+       memblock_reserve(0x30081000, 0x1000);
+}
+
 MACHINE_START(RX1950, "HP iPAQ RX1950")
     /* Maintainers: Vasily Khoruzhick */
     .phys_io = S3C2410_PA_UART,
        .io_pg_offst = (((u32) S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params = S3C2410_SDRAM_PA + 0x100,
        .map_io = rx1950_map_io,
+       .reserve        = rx1950_reserve,
        .init_irq = s3c24xx_init_irq,
        .init_machine = rx1950_init_machine,
        .timer = &s3c24xx_timer,
index d2946de3f3659d3e2588cc980a727973b9716062..6bb44f75a9ce65094a35c1bdad78775c1c655eee 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
+#include <linux/memblock.h>
 #include <linux/timer.h>
 #include <linux/init.h>
 #include <linux/tty.h>
@@ -191,6 +192,13 @@ static void __init rx3715_map_io(void)
        s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
 }
 
+/* H1940 and RX3715 need to reserve this for suspend */
+static void __init rx3715_reserve(void)
+{
+       memblock_reserve(0x30003000, 0x1000);
+       memblock_reserve(0x30081000, 0x1000);
+}
+
 static void __init rx3715_init_irq(void)
 {
        s3c24xx_init_irq();
@@ -214,6 +222,7 @@ MACHINE_START(RX3715, "IPAQ-RX3715")
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
        .map_io         = rx3715_map_io,
+       .reserve        = rx3715_reserve,
        .init_irq       = rx3715_init_irq,
        .init_machine   = rx3715_init_machine,
        .timer          = &s3c24xx_timer,
index ec03f187c52bcef3e1cf28145b373016b7e66e2d..b7a9a601c2d1e18a407c6110976812e35ebf93a3 100644 (file)
@@ -13,8 +13,7 @@ extern void __init sa1100_init_gpio(void);
 
 #define SET_BANK(__nr,__start,__size) \
        mi->bank[__nr].start = (__start), \
-       mi->bank[__nr].size = (__size), \
-       mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
+       mi->bank[__nr].size = (__size)
 
 extern void (*sa1100fb_backlight_power)(int on);
 extern void (*sa1100fb_lcd_power)(int on);
index d5277f9bee77d8dc7a98b2acb60d494e5fcc9df1..128a1dfa96b9b4ae9f64286f5b11df60c2297d79 100644 (file)
 #ifndef __ASSEMBLY__
 
 #ifdef CONFIG_SA1111
-void sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes);
+void sa1111_adjust_zones(unsigned long *size, unsigned long *holes);
 
-#define arch_adjust_zones(node, size, holes) \
-       sa1111_adjust_zones(node, size, holes)
+#define arch_adjust_zones(size, holes) \
+       sa1111_adjust_zones(size, holes)
 
 #define ISA_DMA_THRESHOLD      (PHYS_OFFSET + SZ_1M - 1)
 #define MAX_DMA_ADDRESS                (PAGE_OFFSET + SZ_1M)
index 50f071c5bf4d603656a01a9c8c2865bf07ee2eb9..5ea24d4d1ba6e176985b16076b48412952de9aec 100644 (file)
@@ -20,6 +20,9 @@
                strb    \rd, [\rx]
                .endm
 
+               .macro waituart,rd,rx
+               .endm
+
                .macro  busyuart,rd,rx
                mov     \rd, #0
 1001:          add     \rd, \rd, #1
index 3053e5b7f1685290eccc1c44a9b011c030ffd741..d9c4812f1c316c69ab650a44cd513948410320ce 100644 (file)
@@ -19,9 +19,8 @@
 
 #ifndef __ASSEMBLY__
 
-static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsigned long *zhole_size) 
+static inline void __arch_adjust_zones(unsigned long *zone_size, unsigned long *zhole_size)
 {
-  if (node != 0) return;
   /* Only the first 4 MB (=1024 Pages) are usable for DMA */
   /* See dev / -> .properties in OpenFirmware. */
   zone_size[1] = zone_size[0] - 1024;
@@ -30,8 +29,8 @@ static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsig
   zhole_size[0] = 0;
 }
 
-#define arch_adjust_zones(node, size, holes) \
-       __arch_adjust_zones(node, size, holes)
+#define arch_adjust_zones(size, holes) \
+       __arch_adjust_zones(size, holes)
 
 #define ISA_DMA_THRESHOLD      (PHYS_OFFSET + SZ_4M - 1)
 #define MAX_DMA_ADDRESS                (PAGE_OFFSET + SZ_4M)
index f2b88c5fe142841e718928a0bd787dc6185032c3..4c704b4e8b340c9a6482e2c3ec87da15029c67a8 100644 (file)
@@ -70,6 +70,18 @@ endmenu
 
 menu "Timer and clock configuration"
 
+config SHMOBILE_TIMER_HZ
+       int "Kernel HZ (jiffies per second)"
+       range 32 1024
+       default "128"
+       help
+         Allows the configuration of the timer frequency. It is customary
+         to have the timer interrupt run at 1000 Hz or 100 Hz, but in the
+         case of low timer frequencies other values may be more suitable.
+         SH-Mobile systems using a 32768 Hz RCLK for clock events may want
+         to select a HZ value such as 128 that can evenly divide RCLK.
+         A HZ value that does not divide evenly may cause timer drift.
+
 config SH_TIMER_CMT
        bool "CMT timer driver"
        default y
index 5179b72e1ee3d04186f2cfba7d675778853735ae..132256bb8c817b1b5ab9aa08cd1af7875b22ca00 100644 (file)
@@ -2,7 +2,6 @@
 #define __ASM_MACH_IRQS_H
 
 #define NR_IRQS         512
-#define NR_IRQS_LEGACY  8
 
 #define evt2irq(evt)           (((evt) >> 5) - 16)
 #define irq2evt(irq)           (((irq) + 16) << 5)
index 39f6ccf22294d1e8a9c27f90a771a3c0090fa2d5..18febf92f20a10bfe38df87fc75d6c7f23dd9d83 100644 (file)
@@ -341,8 +341,11 @@ static struct clk gpio_clk = {
        .recalc = &follow_parent,
 };
 
+static struct clk dummy_apb_pclk;
+
 /* array of all spear 3xx clock lookups */
 static struct clk_lookup spear_clk_lookups[] = {
+       { .con_id = "apb_pclk", .clk = &dummy_apb_pclk},
        /* root clks */
        { .con_id = "osc_32k_clk",      .clk = &osc_32k_clk},
        { .con_id = "osc_24m_clk",      .clk = &osc_24m_clk},
index 13e27c769685018bb82b75b745ca45c56bf6d5d9..36ff056b73219f5b07339ab627558a64eb96adae 100644 (file)
@@ -428,8 +428,11 @@ static struct clk gpio2_clk = {
        .recalc = &follow_parent,
 };
 
+static struct clk dummy_apb_pclk;
+
 /* array of all spear 6xx clock lookups */
 static struct clk_lookup spear_clk_lookups[] = {
+       { .con_id = "apb_pclk", .clk = &dummy_apb_pclk},
        /* root clks */
        { .con_id = "osc_32k_clk",      .clk = &osc_32k_clk},
        { .con_id = "osc_30m_clk",      .clk = &osc_30m_clk},
index 5af71d5ba6656c648fc724a36b66e6d419389a1d..5d12d547789e3f17ee993c9df7d8e1056486045b 100644 (file)
@@ -1212,6 +1212,8 @@ static struct clk ppm_clk = {
 };
 #endif
 
+static struct clk dummy_apb_pclk;
+
 #define DEF_LOOKUP(devid, clkref)              \
        {                                       \
        .dev_id = devid,                        \
@@ -1223,6 +1225,10 @@ static struct clk ppm_clk = {
  * look up through clockdevice.
  */
 static struct clk_lookup lookups[] = {
+       {
+               .con_id = "apb_pclk",
+               .clk = &dummy_apb_pclk,
+       },
        /* Connected directly to the AMBA bus */
        DEF_LOOKUP("amba",      &amba_clk),
        DEF_LOOKUP("cpu",       &cpu_clk),
index d2a0b8847a18061e36576f5dec89bc567745d473..bfcda9820888b6083fd10779b63fe89580f76036 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
+#include <linux/memblock.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+static void __init u300_reserve(void)
+{
+       /*
+        * U300 - This platform family can share physical memory
+        * between two ARM cpus, one running Linux and the other
+        * running another OS.
+        */
+#ifdef CONFIG_MACH_U300_SINGLE_RAM
+#if ((CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1) == 1) && \
+       CONFIG_MACH_U300_2MB_ALIGNMENT_FIX
+        memblock_reserve(PHYS_OFFSET, 0x00100000);
+#endif
+#endif
+}
+
 static void __init u300_init_machine(void)
 {
        u300_init_devices();
@@ -49,6 +65,7 @@ MACHINE_START(U300, MACH_U300_STRING)
        .io_pg_offst    = ((U300_AHB_PER_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = BOOT_PARAMS_OFFSET,
        .map_io         = u300_map_io,
+       .reserve        = u300_reserve,
        .init_irq       = u300_init_irq,
        .timer          = &u300_timer,
        .init_machine   = u300_init_machine,
index bb8d7b771817b774a7ff3406e87d46552cf8391c..0e8fd135a57dee1d56afb200208d62bf7d756fa8 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/gpio.h>
 #include <linux/amba/bus.h>
 #include <linux/amba/pl022.h>
 #include <linux/spi/spi.h>
+#include <linux/mfd/ab8500.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+#include <plat/pincfg.h>
 #include <plat/i2c.h>
 
 #include <mach/hardware.h>
 #include <mach/setup.h>
 #include <mach/devices.h>
 
+#include "pins-db8500.h"
+
+static pin_cfg_t mop500_pins[] = {
+       /* SSP0 */
+       GPIO143_SSP0_CLK,
+       GPIO144_SSP0_FRM,
+       GPIO145_SSP0_RXD,
+       GPIO146_SSP0_TXD,
+
+       /* I2C */
+       GPIO147_I2C0_SCL,
+       GPIO148_I2C0_SDA,
+       GPIO16_I2C1_SCL,
+       GPIO17_I2C1_SDA,
+       GPIO10_I2C2_SDA,
+       GPIO11_I2C2_SCL,
+       GPIO229_I2C3_SDA,
+       GPIO230_I2C3_SCL,
+};
+
 static void ab4500_spi_cs_control(u32 command)
 {
        /* set the FRM signal, which is CS  - TODO */
@@ -48,15 +71,20 @@ struct pl022_config_chip ab4500_chip_info = {
        .cs_control = ab4500_spi_cs_control,
 };
 
+static struct ab8500_platform_data ab8500_platdata = {
+       .irq_base       = MOP500_AB8500_IRQ_BASE,
+};
+
 static struct spi_board_info u8500_spi_devices[] = {
        {
                .modalias = "ab8500",
                .controller_data = &ab4500_chip_info,
+               .platform_data = &ab8500_platdata,
                .max_speed_hz = 12000000,
                .bus_num = 0,
                .chip_select = 0,
                .mode = SPI_MODE_0,
-               .irq = IRQ_AB4500,
+               .irq = IRQ_DB8500_AB8500,
        },
 };
 
@@ -118,6 +146,10 @@ static void __init u8500_init_machine(void)
 {
        int i;
 
+       u8500_init_devices();
+
+       nmk_config_pins(mop500_pins, ARRAY_SIZE(mop500_pins));
+
        u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data;
        ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data;
        ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data;
@@ -133,8 +165,6 @@ static void __init u8500_init_machine(void)
 
        spi_register_board_info(u8500_spi_devices,
                        ARRAY_SIZE(u8500_spi_devices));
-
-       u8500_init_devices();
 }
 
 MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
index 0a1318fc8e2bd6c29774bcf1ab8cc48f6a5cfa0c..d8ab7f184fe439ec2492079a063def04c5e3c690 100644 (file)
@@ -453,7 +453,11 @@ static DEFINE_PRCC_CLK_CUSTOM(7, mtu0_ed, 2, -1, NULL, clk_mtu_get_rate, 0);
 static DEFINE_PRCC_CLK(7, wdg_ed,      1, -1, NULL);
 static DEFINE_PRCC_CLK(7, cfgreg_ed,   0, -1, NULL);
 
+static struct clk clk_dummy_apb_pclk;
+
 static struct clk_lookup u8500_common_clks[] = {
+       CLK(dummy_apb_pclk, NULL,       "apb_pclk"),
+
        /* Peripheral Cluster #1 */
        CLK(gpio0,      "gpio.0",       NULL),
        CLK(gpio0,      "gpio.1",       NULL),
index 8229034219432ad1f2090fe99b5da7723992ac22..654fca944e6554cd65eb77fff9c9563a96e58173 100644 (file)
@@ -65,7 +65,7 @@ struct amba_device u8500_ssp0_device = {
                .end   = U8500_SSP0_BASE + SZ_4K - 1,
                .flags = IORESOURCE_MEM,
        },
-       .irq = {IRQ_SSP0, NO_IRQ },
+       .irq = {IRQ_DB8500_SSP0, NO_IRQ },
        /* ST-Ericsson modified id */
        .periphid = SSP_PER_ID,
 };
@@ -77,8 +77,8 @@ static struct resource u8500_i2c0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = IRQ_I2C0,
-               .end    = IRQ_I2C0,
+               .start  = IRQ_DB8500_I2C0,
+               .end    = IRQ_DB8500_I2C0,
                .flags  = IORESOURCE_IRQ,
        }
 };
@@ -97,8 +97,8 @@ static struct resource u8500_i2c4_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = IRQ_I2C4,
-               .end    = IRQ_I2C4,
+               .start  = IRQ_DB8500_I2C4,
+               .end    = IRQ_DB8500_I2C4,
                .flags  = IORESOURCE_IRQ,
        }
 };
@@ -130,8 +130,8 @@ static struct resource dma40_resources[] = {
                .name = "lcla",
        },
        [3] = {
-               .start = IRQ_DMA,
-               .end = IRQ_DMA,
+               .start = IRQ_DB8500_DMA,
+               .end   = IRQ_DB8500_DMA,
                .flags = IORESOURCE_IRQ}
 };
 
diff --git a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
new file mode 100644 (file)
index 0000000..cca4f70
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * Author: Rabin Vincent <rabin.vincent@stericsson.com>
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#ifndef __MACH_IRQS_BOARD_MOP500_H
+#define __MACH_IRQS_BOARD_MOP500_H
+
+#define AB8500_NR_IRQS                 104
+
+#define MOP500_AB8500_IRQ_BASE         IRQ_BOARD_START
+#define MOP500_AB8500_IRQ_END          (MOP500_AB8500_IRQ_BASE \
+                                        + AB8500_NR_IRQS)
+#define MOP500_IRQ_END                 MOP500_AB8500_IRQ_END
+
+#if MOP500_IRQ_END > IRQ_BOARD_END
+#undef IRQ_BOARD_END
+#define IRQ_BOARD_END  MOP500_IRQ_END
+#endif
+
+#endif
diff --git a/arch/arm/mach-ux500/include/mach/irqs-db5500.h b/arch/arm/mach-ux500/include/mach/irqs-db5500.h
new file mode 100644 (file)
index 0000000..6fbfe5e
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * Author: Rabin Vincent <rabin.vincent@stericsson.com>
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#ifndef __MACH_IRQS_DB5500_H
+#define __MACH_IRQS_DB5500_H
+
+#define IRQ_DB5500_MTU0                        (IRQ_SHPI_START + 4)
+#define IRQ_DB5500_SPI2                        (IRQ_SHPI_START + 6)
+#define IRQ_DB5500_PMU0                        (IRQ_SHPI_START + 7)
+#define IRQ_DB5500_SPI0                        (IRQ_SHPI_START + 8)
+#define IRQ_DB5500_RTT                 (IRQ_SHPI_START + 9)
+#define IRQ_DB5500_PKA                 (IRQ_SHPI_START + 10)
+#define IRQ_DB5500_UART0               (IRQ_SHPI_START + 11)
+#define IRQ_DB5500_I2C3                        (IRQ_SHPI_START + 12)
+#define IRQ_DB5500_L2CC                        (IRQ_SHPI_START + 13)
+#define IRQ_DB5500_MSP0                        (IRQ_SHPI_START + 14)
+#define IRQ_DB5500_CRYP1               (IRQ_SHPI_START + 15)
+#define IRQ_DB5500_PMU1                        (IRQ_SHPI_START + 16)
+#define IRQ_DB5500_MTU1                        (IRQ_SHPI_START + 17)
+#define IRQ_DB5500_RTC                 (IRQ_SHPI_START + 18)
+#define IRQ_DB5500_UART1               (IRQ_SHPI_START + 19)
+#define IRQ_DB5500_USB_WAKEUP          (IRQ_SHPI_START + 20)
+#define IRQ_DB5500_I2C0                        (IRQ_SHPI_START + 21)
+#define IRQ_DB5500_I2C1                        (IRQ_SHPI_START + 22)
+#define IRQ_DB5500_USBOTG              (IRQ_SHPI_START + 23)
+#define IRQ_DB5500_DMA_SECURE          (IRQ_SHPI_START + 24)
+#define IRQ_DB5500_DMA                 (IRQ_SHPI_START + 25)
+#define IRQ_DB5500_UART2               (IRQ_SHPI_START + 26)
+#define IRQ_DB5500_ICN_PMU1            (IRQ_SHPI_START + 27)
+#define IRQ_DB5500_ICN_PMU2            (IRQ_SHPI_START + 28)
+#define IRQ_DB5500_UART3               (IRQ_SHPI_START + 29)
+#define IRQ_DB5500_SPI3                        (IRQ_SHPI_START + 30)
+#define IRQ_DB5500_SDMMC4              (IRQ_SHPI_START + 31)
+#define IRQ_DB5500_IRRC                        (IRQ_SHPI_START + 33)
+#define IRQ_DB5500_IRDA_FT             (IRQ_SHPI_START + 34)
+#define IRQ_DB5500_IRDA_SD             (IRQ_SHPI_START + 35)
+#define IRQ_DB5500_IRDA_FI             (IRQ_SHPI_START + 36)
+#define IRQ_DB5500_IRDA_FD             (IRQ_SHPI_START + 37)
+#define IRQ_DB5500_FSMC_CODEREADY      (IRQ_SHPI_START + 38)
+#define IRQ_DB5500_FSMC_NANDWAIT       (IRQ_SHPI_START + 39)
+#define IRQ_DB5500_AB5500              (IRQ_SHPI_START + 40)
+#define IRQ_DB5500_SDMMC2              (IRQ_SHPI_START + 41)
+#define IRQ_DB5500_SIA                 (IRQ_SHPI_START + 42)
+#define IRQ_DB5500_SIA2                        (IRQ_SHPI_START + 43)
+#define IRQ_DB5500_HVA                 (IRQ_SHPI_START + 44)
+#define IRQ_DB5500_HVA2                        (IRQ_SHPI_START + 45)
+#define IRQ_DB5500_PRCMU0              (IRQ_SHPI_START + 46)
+#define IRQ_DB5500_PRCMU1              (IRQ_SHPI_START + 47)
+#define IRQ_DB5500_DISP                        (IRQ_SHPI_START + 48)
+#define IRQ_DB5500_SDMMC1              (IRQ_SHPI_START + 50)
+#define IRQ_DB5500_MSP1                        (IRQ_SHPI_START + 52)
+#define IRQ_DB5500_KBD                 (IRQ_SHPI_START + 53)
+#define IRQ_DB5500_I2C2                        (IRQ_SHPI_START + 55)
+#define IRQ_DB5500_B2R2                        (IRQ_SHPI_START + 56)
+#define IRQ_DB5500_CRYP0               (IRQ_SHPI_START + 57)
+#define IRQ_DB5500_SDMMC3              (IRQ_SHPI_START + 59)
+#define IRQ_DB5500_SDMMC0              (IRQ_SHPI_START + 60)
+#define IRQ_DB5500_HSEM                        (IRQ_SHPI_START + 61)
+#define IRQ_DB5500_SBAG                        (IRQ_SHPI_START + 63)
+#define IRQ_DB5500_SPI1                        (IRQ_SHPI_START + 96)
+#define IRQ_DB5500_MSP2                        (IRQ_SHPI_START + 98)
+#define IRQ_DB5500_SRPTIMER            (IRQ_SHPI_START + 101)
+#define IRQ_DB5500_CTI0                        (IRQ_SHPI_START + 108)
+#define IRQ_DB5500_CTI1                        (IRQ_SHPI_START + 109)
+#define IRQ_DB5500_ICN_ERR             (IRQ_SHPI_START + 110)
+#define IRQ_DB5500_MALI_PPMMU          (IRQ_SHPI_START + 112)
+#define IRQ_DB5500_MALI_PP             (IRQ_SHPI_START + 113)
+#define IRQ_DB5500_MALI_GPMMU          (IRQ_SHPI_START + 114)
+#define IRQ_DB5500_MALI_GP             (IRQ_SHPI_START + 115)
+#define IRQ_DB5500_MALI                        (IRQ_SHPI_START + 116)
+#define IRQ_DB5500_PRCMU_SEM           (IRQ_SHPI_START + 118)
+#define IRQ_DB5500_GPIO0               (IRQ_SHPI_START + 119)
+#define IRQ_DB5500_GPIO1               (IRQ_SHPI_START + 120)
+#define IRQ_DB5500_GPIO2               (IRQ_SHPI_START + 121)
+#define IRQ_DB5500_GPIO3               (IRQ_SHPI_START + 122)
+#define IRQ_DB5500_GPIO4               (IRQ_SHPI_START + 123)
+#define IRQ_DB5500_GPIO5               (IRQ_SHPI_START + 124)
+#define IRQ_DB5500_GPIO6               (IRQ_SHPI_START + 125)
+#define IRQ_DB5500_GPIO7               (IRQ_SHPI_START + 126)
+
+#endif
diff --git a/arch/arm/mach-ux500/include/mach/irqs-db8500.h b/arch/arm/mach-ux500/include/mach/irqs-db8500.h
new file mode 100644 (file)
index 0000000..8b5d9f0
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * Author: Rabin Vincent <rabin.vincent@stericsson.com>
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#ifndef __MACH_IRQS_DB8500_H
+#define __MACH_IRQS_DB8500_H
+
+#define IRQ_DB8500_MTU0                        (IRQ_SHPI_START + 4)
+#define IRQ_DB8500_SPI2                        (IRQ_SHPI_START + 6)
+#define IRQ_DB8500_PMU                 (IRQ_SHPI_START + 7)
+#define IRQ_DB8500_SPI0                        (IRQ_SHPI_START + 8)
+#define IRQ_DB8500_RTT                 (IRQ_SHPI_START + 9)
+#define IRQ_DB8500_PKA                 (IRQ_SHPI_START + 10)
+#define IRQ_DB8500_UART0               (IRQ_SHPI_START + 11)
+#define IRQ_DB8500_I2C3                        (IRQ_SHPI_START + 12)
+#define IRQ_DB8500_L2CC                        (IRQ_SHPI_START + 13)
+#define IRQ_DB8500_SSP0                        (IRQ_SHPI_START + 14)
+#define IRQ_DB8500_CRYP1               (IRQ_SHPI_START + 15)
+#define IRQ_DB8500_MSP1_RX             (IRQ_SHPI_START + 16)
+#define IRQ_DB8500_MTU1                        (IRQ_SHPI_START + 17)
+#define IRQ_DB8500_RTC                 (IRQ_SHPI_START + 18)
+#define IRQ_DB8500_UART1               (IRQ_SHPI_START + 19)
+#define IRQ_DB8500_USB_WAKEUP          (IRQ_SHPI_START + 20)
+#define IRQ_DB8500_I2C0                        (IRQ_SHPI_START + 21)
+#define IRQ_DB8500_I2C1                        (IRQ_SHPI_START + 22)
+#define IRQ_DB8500_USBOTG              (IRQ_SHPI_START + 23)
+#define IRQ_DB8500_DMA_SECURE          (IRQ_SHPI_START + 24)
+#define IRQ_DB8500_DMA                 (IRQ_SHPI_START + 25)
+#define IRQ_DB8500_UART2               (IRQ_SHPI_START + 26)
+#define IRQ_DB8500_ICN_PMU1            (IRQ_SHPI_START + 27)
+#define IRQ_DB8500_ICN_PMU2            (IRQ_SHPI_START + 28)
+#define IRQ_DB8500_HSIR_EXCEP          (IRQ_SHPI_START + 29)
+#define IRQ_DB8500_MSP0                        (IRQ_SHPI_START + 31)
+#define IRQ_DB8500_HSIR_CH0_OVRRUN     (IRQ_SHPI_START + 32)
+#define IRQ_DB8500_HSIR_CH1_OVRRUN     (IRQ_SHPI_START + 33)
+#define IRQ_DB8500_HSIR_CH2_OVRRUN     (IRQ_SHPI_START + 34)
+#define IRQ_DB8500_HSIR_CH3_OVRRUN     (IRQ_SHPI_START + 35)
+#define IRQ_DB8500_HSIR_CH4_OVRRUN     (IRQ_SHPI_START + 36)
+#define IRQ_DB8500_HSIR_CH5_OVRRUN     (IRQ_SHPI_START + 37)
+#define IRQ_DB8500_HSIR_CH6_OVRRUN     (IRQ_SHPI_START + 38)
+#define IRQ_DB8500_HSIR_CH7_OVRRUN     (IRQ_SHPI_START + 39)
+#define IRQ_DB8500_AB8500              (IRQ_SHPI_START + 40)
+#define IRQ_DB8500_SDMMC2              (IRQ_SHPI_START + 41)
+#define IRQ_DB8500_SIA                 (IRQ_SHPI_START + 42)
+#define IRQ_DB8500_SIA2                        (IRQ_SHPI_START + 43)
+#define IRQ_DB8500_SVA                 (IRQ_SHPI_START + 44)
+#define IRQ_DB8500_SVA2                        (IRQ_SHPI_START + 45)
+#define IRQ_DB8500_PRCMU0              (IRQ_SHPI_START + 46)
+#define IRQ_DB8500_PRCMU1              (IRQ_SHPI_START + 47)
+#define IRQ_DB8500_DISP                        (IRQ_SHPI_START + 48)
+#define IRQ_DB8500_SPI3                        (IRQ_SHPI_START + 49)
+#define IRQ_DB8500_SDMMC1              (IRQ_SHPI_START + 50)
+#define IRQ_DB8500_I2C4                        (IRQ_SHPI_START + 51)
+#define IRQ_DB8500_SSP1                        (IRQ_SHPI_START + 52)
+#define IRQ_DB8500_SKE                 (IRQ_SHPI_START + 53)
+#define IRQ_DB8500_KB                  (IRQ_SHPI_START + 54)
+#define IRQ_DB8500_I2C2                        (IRQ_SHPI_START + 55)
+#define IRQ_DB8500_B2R2                        (IRQ_SHPI_START + 56)
+#define IRQ_DB8500_CRYP0               (IRQ_SHPI_START + 57)
+#define IRQ_DB8500_SDMMC3              (IRQ_SHPI_START + 59)
+#define IRQ_DB8500_SDMMC0              (IRQ_SHPI_START + 60)
+#define IRQ_DB8500_HSEM                        (IRQ_SHPI_START + 61)
+#define IRQ_DB8500_MSP1                        (IRQ_SHPI_START + 62)
+#define IRQ_DB8500_SBAG                        (IRQ_SHPI_START + 63)
+#define IRQ_DB8500_SPI1                        (IRQ_SHPI_START + 96)
+#define IRQ_DB8500_SRPTIMER            (IRQ_SHPI_START + 97)
+#define IRQ_DB8500_MSP2                        (IRQ_SHPI_START + 98)
+#define IRQ_DB8500_SDMMC4              (IRQ_SHPI_START + 99)
+#define IRQ_DB8500_SDMMC5              (IRQ_SHPI_START + 100)
+#define IRQ_DB8500_HSIRD0              (IRQ_SHPI_START + 104)
+#define IRQ_DB8500_HSIRD1              (IRQ_SHPI_START + 105)
+#define IRQ_DB8500_HSITD0              (IRQ_SHPI_START + 106)
+#define IRQ_DB8500_HSITD1              (IRQ_SHPI_START + 107)
+#define IRQ_DB8500_CTI0                        (IRQ_SHPI_START + 108)
+#define IRQ_DB8500_CTI1                        (IRQ_SHPI_START + 109)
+#define IRQ_DB8500_ICN_ERR             (IRQ_SHPI_START + 110)
+#define IRQ_DB8500_MALI_PPMMU          (IRQ_SHPI_START + 112)
+#define IRQ_DB8500_MALI_PP             (IRQ_SHPI_START + 113)
+#define IRQ_DB8500_MALI_GPMMU          (IRQ_SHPI_START + 114)
+#define IRQ_DB8500_MALI_GP             (IRQ_SHPI_START + 115)
+#define IRQ_DB8500_MALI                        (IRQ_SHPI_START + 116)
+#define IRQ_DB8500_PRCMU_SEM           (IRQ_SHPI_START + 118)
+#define IRQ_DB8500_GPIO0               (IRQ_SHPI_START + 119)
+#define IRQ_DB8500_GPIO1               (IRQ_SHPI_START + 120)
+#define IRQ_DB8500_GPIO2               (IRQ_SHPI_START + 121)
+#define IRQ_DB8500_GPIO3               (IRQ_SHPI_START + 122)
+#define IRQ_DB8500_GPIO4               (IRQ_SHPI_START + 123)
+#define IRQ_DB8500_GPIO5               (IRQ_SHPI_START + 124)
+#define IRQ_DB8500_GPIO6               (IRQ_SHPI_START + 125)
+#define IRQ_DB8500_GPIO7               (IRQ_SHPI_START + 126)
+#define IRQ_DB8500_GPIO8               (IRQ_SHPI_START + 127)
+
+#endif
index 7970684b1d0983841bd74e623daf93412fd8797e..10385bdc2b7760506af333077fd1fd34fe5972fc 100644 (file)
@@ -10,7 +10,8 @@
 #ifndef ASM_ARCH_IRQS_H
 #define ASM_ARCH_IRQS_H
 
-#include <mach/hardware.h>
+#include <mach/irqs-db5500.h>
+#include <mach/irqs-db8500.h>
 
 #define IRQ_LOCALTIMER                  29
 #define IRQ_LOCALWDOG                   30
 /* There are 128 shared peripheral interrupts assigned to
  * INTID[160:32]. The first 32 interrupts are reserved.
  */
-#define U8500_SOC_NR_IRQS              161
+#define DBX500_NR_INTERNAL_IRQS                161
 
 /* After chip-specific IRQ numbers we have the GPIO ones */
 #define NOMADIK_NR_GPIO                        288
-#define NOMADIK_GPIO_TO_IRQ(gpio)      ((gpio) + U8500_SOC_NR_IRQS)
-#define NOMADIK_IRQ_TO_GPIO(irq)       ((irq) - U8500_SOC_NR_IRQS)
-#define NR_IRQS                                NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO)
+#define NOMADIK_GPIO_TO_IRQ(gpio)      ((gpio) + DBX500_NR_INTERNAL_IRQS)
+#define NOMADIK_IRQ_TO_GPIO(irq)       ((irq) - DBX500_NR_INTERNAL_IRQS)
+#define IRQ_BOARD_START                        NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO)
 
-#endif /*ASM_ARCH_IRQS_H*/
+/* This will be overridden by board-specific irq headers */
+#define IRQ_BOARD_END                  IRQ_BOARD_START
+
+#ifdef CONFIG_MACH_U8500_MOP
+#include <mach/irqs-board-mop500.h>
+#endif
+
+#define NR_IRQS                                IRQ_BOARD_END
+
+#endif /* ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-ux500/pins-db8500.h b/arch/arm/mach-ux500/pins-db8500.h
new file mode 100644 (file)
index 0000000..9055d5d
--- /dev/null
@@ -0,0 +1,742 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * License terms: GNU General Public License, version 2
+ * Author: Rabin Vincent <rabin.vincent@stericsson.com>
+ */
+
+#ifndef __MACH_PINS_DB8500_H
+#define __MACH_PINS_DB8500_H
+
+/*
+ * TODO: Eventually encode all non-board specific pull up/down configuration
+ * here.
+ */
+
+#define GPIO0_GPIO             PIN_CFG(0, GPIO)
+#define GPIO0_U0_CTSn          PIN_CFG(0, ALT_A)
+#define GPIO0_TRIG_OUT         PIN_CFG(0, ALT_B)
+#define GPIO0_IP_TDO           PIN_CFG(0, ALT_C)
+
+#define GPIO1_GPIO             PIN_CFG(1, GPIO)
+#define GPIO1_U0_RTSn          PIN_CFG(1, ALT_A)
+#define GPIO1_TRIG_IN          PIN_CFG(1, ALT_B)
+#define GPIO1_IP_TDI           PIN_CFG(1, ALT_C)
+
+#define GPIO2_GPIO             PIN_CFG(2, GPIO)
+#define GPIO2_U0_RXD           PIN_CFG(2, ALT_A)
+#define GPIO2_NONE             PIN_CFG(2, ALT_B)
+#define GPIO2_IP_TMS           PIN_CFG(2, ALT_C)
+
+#define GPIO3_GPIO             PIN_CFG(3, GPIO)
+#define GPIO3_U0_TXD           PIN_CFG(3, ALT_A)
+#define GPIO3_NONE             PIN_CFG(3, ALT_B)
+#define GPIO3_IP_TCK           PIN_CFG(3, ALT_C)
+
+#define GPIO4_GPIO             PIN_CFG(4, GPIO)
+#define GPIO4_U1_RXD           PIN_CFG(4, ALT_A)
+#define GPIO4_I2C4_SCL         PIN_CFG_PULL(4, ALT_B, UP)
+#define GPIO4_IP_TRSTn         PIN_CFG(4, ALT_C)
+
+#define GPIO5_GPIO             PIN_CFG(5, GPIO)
+#define GPIO5_U1_TXD           PIN_CFG(5, ALT_A)
+#define GPIO5_I2C4_SDA         PIN_CFG_PULL(5, ALT_B, UP)
+#define GPIO5_IP_GPIO6         PIN_CFG(5, ALT_C)
+
+#define GPIO6_GPIO             PIN_CFG(6, GPIO)
+#define GPIO6_U1_CTSn          PIN_CFG(6, ALT_A)
+#define GPIO6_I2C1_SCL         PIN_CFG_PULL(6, ALT_B, UP)
+#define GPIO6_IP_GPIO0         PIN_CFG(6, ALT_C)
+
+#define GPIO7_GPIO             PIN_CFG(7, GPIO)
+#define GPIO7_U1_RTSn          PIN_CFG(7, ALT_A)
+#define GPIO7_I2C1_SDA         PIN_CFG_PULL(7, ALT_B, UP)
+#define GPIO7_IP_GPIO1         PIN_CFG(7, ALT_C)
+
+#define GPIO8_GPIO             PIN_CFG(8, GPIO)
+#define GPIO8_IPI2C_SDA                PIN_CFG_PULL(8, ALT_A, UP)
+#define GPIO8_I2C2_SDA         PIN_CFG_PULL(8, ALT_B, UP)
+
+#define GPIO9_GPIO             PIN_CFG(9, GPIO)
+#define GPIO9_IPI2C_SCL                PIN_CFG_PULL(9, ALT_A, UP)
+#define GPIO9_I2C2_SCL         PIN_CFG_PULL(9, ALT_B, UP)
+
+#define GPIO10_GPIO            PIN_CFG(10, GPIO)
+#define GPIO10_IPI2C_SDA       PIN_CFG_PULL(10, ALT_A, UP)
+#define GPIO10_I2C2_SDA                PIN_CFG_PULL(10, ALT_B, UP)
+#define GPIO10_IP_GPIO3                PIN_CFG(10, ALT_C)
+
+#define GPIO11_GPIO            PIN_CFG(11, GPIO)
+#define GPIO11_IPI2C_SCL       PIN_CFG_PULL(11, ALT_A, UP)
+#define GPIO11_I2C2_SCL                PIN_CFG_PULL(11, ALT_B, UP)
+#define GPIO11_IP_GPIO2                PIN_CFG(11, ALT_C)
+
+#define GPIO12_GPIO            PIN_CFG(12, GPIO)
+#define GPIO12_MSP0_TXD                PIN_CFG(12, ALT_A)
+#define GPIO12_MSP0_RXD                PIN_CFG(12, ALT_B)
+
+#define GPIO13_GPIO            PIN_CFG(13, GPIO)
+#define GPIO13_MSP0_TFS                PIN_CFG(13, ALT_A)
+
+#define GPIO14_GPIO            PIN_CFG(14, GPIO)
+#define GPIO14_MSP0_TCK                PIN_CFG(14, ALT_A)
+
+#define GPIO15_GPIO            PIN_CFG(15, GPIO)
+#define GPIO15_MSP0_RXD                PIN_CFG(15, ALT_A)
+#define GPIO15_MSP0_TXD                PIN_CFG(15, ALT_B)
+
+#define GPIO16_GPIO            PIN_CFG(16, GPIO)
+#define GPIO16_MSP0_RFS                PIN_CFG(16, ALT_A)
+#define GPIO16_I2C1_SCL                PIN_CFG_PULL(16, ALT_B, UP)
+#define GPIO16_SLIM0_DAT       PIN_CFG(16, ALT_C)
+
+#define GPIO17_GPIO            PIN_CFG(17, GPIO)
+#define GPIO17_MSP0_RCK                PIN_CFG(17, ALT_A)
+#define GPIO17_I2C1_SDA                PIN_CFG_PULL(17, ALT_B, UP)
+#define GPIO17_SLIM0_CLK       PIN_CFG(17, ALT_C)
+
+#define GPIO18_GPIO            PIN_CFG(18, GPIO)
+#define GPIO18_MC0_CMDDIR      PIN_CFG(18, ALT_A)
+#define GPIO18_U2_RXD          PIN_CFG(18, ALT_B)
+#define GPIO18_MS_IEP          PIN_CFG(18, ALT_C)
+
+#define GPIO19_GPIO            PIN_CFG(19, GPIO)
+#define GPIO19_MC0_DAT0DIR     PIN_CFG(19, ALT_A)
+#define GPIO19_U2_TXD          PIN_CFG(19, ALT_B)
+#define GPIO19_MS_DAT0DIR      PIN_CFG(19, ALT_C)
+
+#define GPIO20_GPIO            PIN_CFG(20, GPIO)
+#define GPIO20_MC0_DAT2DIR     PIN_CFG(20, ALT_A)
+#define GPIO20_UARTMOD_TXD     PIN_CFG(20, ALT_B)
+#define GPIO20_IP_TRIGOUT      PIN_CFG(20, ALT_C)
+
+#define GPIO21_GPIO            PIN_CFG(21, GPIO)
+#define GPIO21_MC0_DAT31DIR    PIN_CFG(21, ALT_A)
+#define GPIO21_MSP0_SCK                PIN_CFG(21, ALT_B)
+#define GPIO21_MS_DAT31DIR     PIN_CFG(21, ALT_C)
+
+#define GPIO22_GPIO            PIN_CFG(22, GPIO)
+#define GPIO22_MC0_FBCLK       PIN_CFG(22, ALT_A)
+#define GPIO22_UARTMOD_RXD     PIN_CFG(22, ALT_B)
+#define GPIO22_MS_FBCLK                PIN_CFG(22, ALT_C)
+
+#define GPIO23_GPIO            PIN_CFG(23, GPIO)
+#define GPIO23_MC0_CLK         PIN_CFG(23, ALT_A)
+#define GPIO23_STMMOD_CLK      PIN_CFG(23, ALT_B)
+#define GPIO23_MS_CLK          PIN_CFG(23, ALT_C)
+
+#define GPIO24_GPIO            PIN_CFG(24, GPIO)
+#define GPIO24_MC0_CMD         PIN_CFG(24, ALT_A)
+#define GPIO24_UARTMOD_RXD     PIN_CFG(24, ALT_B)
+#define GPIO24_MS_BS           PIN_CFG(24, ALT_C)
+
+#define GPIO25_GPIO            PIN_CFG(25, GPIO)
+#define GPIO25_MC0_DAT0                PIN_CFG(25, ALT_A)
+#define GPIO25_STMMOD_DAT0     PIN_CFG(25, ALT_B)
+#define GPIO25_MS_DAT0         PIN_CFG(25, ALT_C)
+
+#define GPIO26_GPIO            PIN_CFG(26, GPIO)
+#define GPIO26_MC0_DAT1                PIN_CFG(26, ALT_A)
+#define GPIO26_STMMOD_DAT1     PIN_CFG(26, ALT_B)
+#define GPIO26_MS_DAT1         PIN_CFG(26, ALT_C)
+
+#define GPIO27_GPIO            PIN_CFG(27, GPIO)
+#define GPIO27_MC0_DAT2                PIN_CFG(27, ALT_A)
+#define GPIO27_STMMOD_DAT2     PIN_CFG(27, ALT_B)
+#define GPIO27_MS_DAT2         PIN_CFG(27, ALT_C)
+
+#define GPIO28_GPIO            PIN_CFG(28, GPIO)
+#define GPIO28_MC0_DAT3                PIN_CFG(28, ALT_A)
+#define GPIO28_STMMOD_DAT3     PIN_CFG(28, ALT_B)
+#define GPIO28_MS_DAT3         PIN_CFG(28, ALT_C)
+
+#define GPIO29_GPIO            PIN_CFG(29, GPIO)
+#define GPIO29_MC0_DAT4                PIN_CFG(29, ALT_A)
+#define GPIO29_SPI3_CLK                PIN_CFG(29, ALT_B)
+#define GPIO29_U2_RXD          PIN_CFG(29, ALT_C)
+
+#define GPIO30_GPIO            PIN_CFG(30, GPIO)
+#define GPIO30_MC0_DAT5                PIN_CFG(30, ALT_A)
+#define GPIO30_SPI3_RXD                PIN_CFG(30, ALT_B)
+#define GPIO30_U2_TXD          PIN_CFG(30, ALT_C)
+
+#define GPIO31_GPIO            PIN_CFG(31, GPIO)
+#define GPIO31_MC0_DAT6                PIN_CFG(31, ALT_A)
+#define GPIO31_SPI3_FRM                PIN_CFG(31, ALT_B)
+#define GPIO31_U2_CTSn         PIN_CFG(31, ALT_C)
+
+#define GPIO32_GPIO            PIN_CFG(32, GPIO)
+#define GPIO32_MC0_DAT7                PIN_CFG(32, ALT_A)
+#define GPIO32_SPI3_TXD                PIN_CFG(32, ALT_B)
+#define GPIO32_U2_RTSn         PIN_CFG(32, ALT_C)
+
+#define GPIO33_GPIO            PIN_CFG(33, GPIO)
+#define GPIO33_MSP1_TXD                PIN_CFG(33, ALT_A)
+#define GPIO33_MSP1_RXD                PIN_CFG(33, ALT_B)
+#define GPIO33_U0_DTRn         PIN_CFG(33, ALT_C)
+
+#define GPIO34_GPIO            PIN_CFG(34, GPIO)
+#define GPIO34_MSP1_TFS                PIN_CFG(34, ALT_A)
+#define GPIO34_NONE            PIN_CFG(34, ALT_B)
+#define GPIO34_U0_DCDn         PIN_CFG(34, ALT_C)
+
+#define GPIO35_GPIO            PIN_CFG(35, GPIO)
+#define GPIO35_MSP1_TCK                PIN_CFG(35, ALT_A)
+#define GPIO35_NONE            PIN_CFG(35, ALT_B)
+#define GPIO35_U0_DSRn         PIN_CFG(35, ALT_C)
+
+#define GPIO36_GPIO            PIN_CFG(36, GPIO)
+#define GPIO36_MSP1_RXD                PIN_CFG(36, ALT_A)
+#define GPIO36_MSP1_TXD                PIN_CFG(36, ALT_B)
+#define GPIO36_U0_RIn          PIN_CFG(36, ALT_C)
+
+#define GPIO64_GPIO            PIN_CFG(64, GPIO)
+#define GPIO64_LCDB_DE         PIN_CFG(64, ALT_A)
+#define GPIO64_KP_O1           PIN_CFG(64, ALT_B)
+#define GPIO64_IP_GPIO4                PIN_CFG(64, ALT_C)
+
+#define GPIO65_GPIO            PIN_CFG(65, GPIO)
+#define GPIO65_LCDB_HSO                PIN_CFG(65, ALT_A)
+#define GPIO65_KP_O0           PIN_CFG(65, ALT_B)
+#define GPIO65_IP_GPIO5                PIN_CFG(65, ALT_C)
+
+#define GPIO66_GPIO            PIN_CFG(66, GPIO)
+#define GPIO66_LCDB_VSO                PIN_CFG(66, ALT_A)
+#define GPIO66_KP_I1           PIN_CFG(66, ALT_B)
+#define GPIO66_IP_GPIO6                PIN_CFG(66, ALT_C)
+
+#define GPIO67_GPIO            PIN_CFG(67, GPIO)
+#define GPIO67_LCDB_CLK                PIN_CFG(67, ALT_A)
+#define GPIO67_KP_I0           PIN_CFG(67, ALT_B)
+#define GPIO67_IP_GPIO7                PIN_CFG(67, ALT_C)
+
+#define GPIO68_GPIO            PIN_CFG(68, GPIO)
+#define GPIO68_LCD_VSI0                PIN_CFG(68, ALT_A)
+#define GPIO68_KP_O7           PIN_CFG(68, ALT_B)
+#define GPIO68_SM_CLE          PIN_CFG(68, ALT_C)
+
+#define GPIO69_GPIO            PIN_CFG(69, GPIO)
+#define GPIO69_LCD_VSI1                PIN_CFG(69, ALT_A)
+#define GPIO69_KP_I7           PIN_CFG(69, ALT_B)
+#define GPIO69_SM_ALE          PIN_CFG(69, ALT_C)
+
+#define GPIO70_GPIO            PIN_CFG(70, GPIO)
+#define GPIO70_LCD_D0          PIN_CFG(70, ALT_A)
+#define GPIO70_KP_O5           PIN_CFG(70, ALT_B)
+#define GPIO70_STMAPE_CLK      PIN_CFG(70, ALT_C)
+
+#define GPIO71_GPIO            PIN_CFG(71, GPIO)
+#define GPIO71_LCD_D1          PIN_CFG(71, ALT_A)
+#define GPIO71_KP_O4           PIN_CFG(71, ALT_B)
+#define GPIO71_STMAPE_DAT3     PIN_CFG(71, ALT_C)
+
+#define GPIO72_GPIO            PIN_CFG(72, GPIO)
+#define GPIO72_LCD_D2          PIN_CFG(72, ALT_A)
+#define GPIO72_KP_O3           PIN_CFG(72, ALT_B)
+#define GPIO72_STMAPE_DAT2     PIN_CFG(72, ALT_C)
+
+#define GPIO73_GPIO            PIN_CFG(73, GPIO)
+#define GPIO73_LCD_D3          PIN_CFG(73, ALT_A)
+#define GPIO73_KP_O2           PIN_CFG(73, ALT_B)
+#define GPIO73_STMAPE_DAT1     PIN_CFG(73, ALT_C)
+
+#define GPIO74_GPIO            PIN_CFG(74, GPIO)
+#define GPIO74_LCD_D4          PIN_CFG(74, ALT_A)
+#define GPIO74_KP_I5           PIN_CFG(74, ALT_B)
+#define GPIO74_STMAPE_DAT0     PIN_CFG(74, ALT_C)
+
+#define GPIO75_GPIO            PIN_CFG(75, GPIO)
+#define GPIO75_LCD_D5          PIN_CFG(75, ALT_A)
+#define GPIO75_KP_I4           PIN_CFG(75, ALT_B)
+#define GPIO75_U2_RXD          PIN_CFG(75, ALT_C)
+
+#define GPIO76_GPIO            PIN_CFG(76, GPIO)
+#define GPIO76_LCD_D6          PIN_CFG(76, ALT_A)
+#define GPIO76_KP_I3           PIN_CFG(76, ALT_B)
+#define GPIO76_U2_TXD          PIN_CFG(76, ALT_C)
+
+#define GPIO77_GPIO            PIN_CFG(77, GPIO)
+#define GPIO77_LCD_D7          PIN_CFG(77, ALT_A)
+#define GPIO77_KP_I2           PIN_CFG(77, ALT_B)
+#define GPIO77_NONE            PIN_CFG(77, ALT_C)
+
+#define GPIO78_GPIO            PIN_CFG(78, GPIO)
+#define GPIO78_LCD_D8          PIN_CFG(78, ALT_A)
+#define GPIO78_KP_O6           PIN_CFG(78, ALT_B)
+#define GPIO78_IP_GPIO2                PIN_CFG(78, ALT_C)
+
+#define GPIO79_GPIO            PIN_CFG(79, GPIO)
+#define GPIO79_LCD_D9          PIN_CFG(79, ALT_A)
+#define GPIO79_KP_I6           PIN_CFG(79, ALT_B)
+#define GPIO79_IP_GPIO3                PIN_CFG(79, ALT_C)
+
+#define GPIO80_GPIO            PIN_CFG(80, GPIO)
+#define GPIO80_LCD_D10         PIN_CFG(80, ALT_A)
+#define GPIO80_KP_SKA0         PIN_CFG(80, ALT_B)
+#define GPIO80_IP_GPIO4                PIN_CFG(80, ALT_C)
+
+#define GPIO81_GPIO            PIN_CFG(81, GPIO)
+#define GPIO81_LCD_D11         PIN_CFG(81, ALT_A)
+#define GPIO81_KP_SKB0         PIN_CFG(81, ALT_B)
+#define GPIO81_IP_GPIO5                PIN_CFG(81, ALT_C)
+
+#define GPIO82_GPIO            PIN_CFG(82, GPIO)
+#define GPIO82_LCD_D12         PIN_CFG(82, ALT_A)
+#define GPIO82_KP_O5           PIN_CFG(82, ALT_B)
+
+#define GPIO83_GPIO            PIN_CFG(83, GPIO)
+#define GPIO83_LCD_D13         PIN_CFG(83, ALT_A)
+#define GPIO83_KP_O4           PIN_CFG(83, ALT_B)
+
+#define GPIO84_GPIO            PIN_CFG(84, GPIO)
+#define GPIO84_LCD_D14         PIN_CFG(84, ALT_A)
+#define GPIO84_KP_I5           PIN_CFG(84, ALT_B)
+
+#define GPIO85_GPIO            PIN_CFG(85, GPIO)
+#define GPIO85_LCD_D15         PIN_CFG(85, ALT_A)
+#define GPIO85_KP_I4           PIN_CFG(85, ALT_B)
+
+#define GPIO86_GPIO            PIN_CFG(86, GPIO)
+#define GPIO86_LCD_D16         PIN_CFG(86, ALT_A)
+#define GPIO86_SM_ADQ0         PIN_CFG(86, ALT_B)
+#define GPIO86_MC5_DAT0                PIN_CFG(86, ALT_C)
+
+#define GPIO87_GPIO            PIN_CFG(87, GPIO)
+#define GPIO87_LCD_D17         PIN_CFG(87, ALT_A)
+#define GPIO87_SM_ADQ1         PIN_CFG(87, ALT_B)
+#define GPIO87_MC5_DAT1                PIN_CFG(87, ALT_C)
+
+#define GPIO88_GPIO            PIN_CFG(88, GPIO)
+#define GPIO88_LCD_D18         PIN_CFG(88, ALT_A)
+#define GPIO88_SM_ADQ2         PIN_CFG(88, ALT_B)
+#define GPIO88_MC5_DAT2                PIN_CFG(88, ALT_C)
+
+#define GPIO89_GPIO            PIN_CFG(89, GPIO)
+#define GPIO89_LCD_D19         PIN_CFG(89, ALT_A)
+#define GPIO89_SM_ADQ3         PIN_CFG(89, ALT_B)
+#define GPIO89_MC5_DAT3                PIN_CFG(89, ALT_C)
+
+#define GPIO90_GPIO            PIN_CFG(90, GPIO)
+#define GPIO90_LCD_D20         PIN_CFG(90, ALT_A)
+#define GPIO90_SM_ADQ4         PIN_CFG(90, ALT_B)
+#define GPIO90_MC5_CMD         PIN_CFG(90, ALT_C)
+
+#define GPIO91_GPIO            PIN_CFG(91, GPIO)
+#define GPIO91_LCD_D21         PIN_CFG(91, ALT_A)
+#define GPIO91_SM_ADQ5         PIN_CFG(91, ALT_B)
+#define GPIO91_MC5_FBCLK       PIN_CFG(91, ALT_C)
+
+#define GPIO92_GPIO            PIN_CFG(92, GPIO)
+#define GPIO92_LCD_D22         PIN_CFG(92, ALT_A)
+#define GPIO92_SM_ADQ6         PIN_CFG(92, ALT_B)
+#define GPIO92_MC5_CLK         PIN_CFG(92, ALT_C)
+
+#define GPIO93_GPIO            PIN_CFG(93, GPIO)
+#define GPIO93_LCD_D23         PIN_CFG(93, ALT_A)
+#define GPIO93_SM_ADQ7         PIN_CFG(93, ALT_B)
+#define GPIO93_MC5_DAT4                PIN_CFG(93, ALT_C)
+
+#define GPIO94_GPIO            PIN_CFG(94, GPIO)
+#define GPIO94_KP_O7           PIN_CFG(94, ALT_A)
+#define GPIO94_SM_ADVn         PIN_CFG(94, ALT_B)
+#define GPIO94_MC5_DAT5                PIN_CFG(94, ALT_C)
+
+#define GPIO95_GPIO            PIN_CFG(95, GPIO)
+#define GPIO95_KP_I7           PIN_CFG(95, ALT_A)
+#define GPIO95_SM_CS0n         PIN_CFG(95, ALT_B)
+#define GPIO95_SM_PS0n         PIN_CFG(95, ALT_C)
+
+#define GPIO96_GPIO            PIN_CFG(96, GPIO)
+#define GPIO96_KP_O6           PIN_CFG(96, ALT_A)
+#define GPIO96_SM_OEn          PIN_CFG(96, ALT_B)
+#define GPIO96_MC5_DAT6                PIN_CFG(96, ALT_C)
+
+#define GPIO97_GPIO            PIN_CFG(97, GPIO)
+#define GPIO97_KP_I6           PIN_CFG(97, ALT_A)
+#define GPIO97_SM_WEn          PIN_CFG(97, ALT_B)
+#define GPIO97_MC5_DAT7                PIN_CFG(97, ALT_C)
+
+#define GPIO128_GPIO           PIN_CFG(128, GPIO)
+#define GPIO128_MC2_CLK                PIN_CFG(128, ALT_A)
+#define GPIO128_SM_CKO         PIN_CFG(128, ALT_B)
+
+#define GPIO129_GPIO           PIN_CFG(129, GPIO)
+#define GPIO129_MC2_CMD                PIN_CFG(129, ALT_A)
+#define GPIO129_SM_WAIT0n      PIN_CFG(129, ALT_B)
+
+#define GPIO130_GPIO           PIN_CFG(130, GPIO)
+#define GPIO130_MC2_FBCLK      PIN_CFG(130, ALT_A)
+#define GPIO130_SM_FBCLK       PIN_CFG(130, ALT_B)
+#define GPIO130_MC2_RSTN       PIN_CFG(130, ALT_C)
+
+#define GPIO131_GPIO           PIN_CFG(131, GPIO)
+#define GPIO131_MC2_DAT0       PIN_CFG(131, ALT_A)
+#define GPIO131_SM_ADQ8                PIN_CFG(131, ALT_B)
+
+#define GPIO132_GPIO           PIN_CFG(132, GPIO)
+#define GPIO132_MC2_DAT1       PIN_CFG(132, ALT_A)
+#define GPIO132_SM_ADQ9                PIN_CFG(132, ALT_B)
+
+#define GPIO133_GPIO           PIN_CFG(133, GPIO)
+#define GPIO133_MC2_DAT2       PIN_CFG(133, ALT_A)
+#define GPIO133_SM_ADQ10       PIN_CFG(133, ALT_B)
+
+#define GPIO134_GPIO           PIN_CFG(134, GPIO)
+#define GPIO134_MC2_DAT3       PIN_CFG(134, ALT_A)
+#define GPIO134_SM_ADQ11       PIN_CFG(134, ALT_B)
+
+#define GPIO135_GPIO           PIN_CFG(135, GPIO)
+#define GPIO135_MC2_DAT4       PIN_CFG(135, ALT_A)
+#define GPIO135_SM_ADQ12       PIN_CFG(135, ALT_B)
+
+#define GPIO136_GPIO           PIN_CFG(136, GPIO)
+#define GPIO136_MC2_DAT5       PIN_CFG(136, ALT_A)
+#define GPIO136_SM_ADQ13       PIN_CFG(136, ALT_B)
+
+#define GPIO137_GPIO           PIN_CFG(137, GPIO)
+#define GPIO137_MC2_DAT6       PIN_CFG(137, ALT_A)
+#define GPIO137_SM_ADQ14       PIN_CFG(137, ALT_B)
+
+#define GPIO138_GPIO           PIN_CFG(138, GPIO)
+#define GPIO138_MC2_DAT7       PIN_CFG(138, ALT_A)
+#define GPIO138_SM_ADQ15       PIN_CFG(138, ALT_B)
+
+#define GPIO139_GPIO           PIN_CFG(139, GPIO)
+#define GPIO139_SSP1_RXD       PIN_CFG(139, ALT_A)
+#define GPIO139_SM_WAIT1n      PIN_CFG(139, ALT_B)
+#define GPIO139_KP_O8          PIN_CFG(139, ALT_C)
+
+#define GPIO140_GPIO           PIN_CFG(140, GPIO)
+#define GPIO140_SSP1_TXD       PIN_CFG(140, ALT_A)
+#define GPIO140_IP_GPIO7       PIN_CFG(140, ALT_B)
+#define GPIO140_KP_SKA1                PIN_CFG(140, ALT_C)
+
+#define GPIO141_GPIO           PIN_CFG(141, GPIO)
+#define GPIO141_SSP1_CLK       PIN_CFG(141, ALT_A)
+#define GPIO141_IP_GPIO2       PIN_CFG(141, ALT_B)
+#define GPIO141_KP_O9          PIN_CFG(141, ALT_C)
+
+#define GPIO142_GPIO           PIN_CFG(142, GPIO)
+#define GPIO142_SSP1_FRM       PIN_CFG(142, ALT_A)
+#define GPIO142_IP_GPIO3       PIN_CFG(142, ALT_B)
+#define GPIO142_KP_SKB1                PIN_CFG(142, ALT_C)
+
+#define GPIO143_GPIO           PIN_CFG(143, GPIO)
+#define GPIO143_SSP0_CLK       PIN_CFG(143, ALT_A)
+
+#define GPIO144_GPIO           PIN_CFG(144, GPIO)
+#define GPIO144_SSP0_FRM       PIN_CFG(144, ALT_A)
+
+#define GPIO145_GPIO           PIN_CFG(145, GPIO)
+#define GPIO145_SSP0_RXD       PIN_CFG(145, ALT_A)
+
+#define GPIO146_GPIO           PIN_CFG(146, GPIO)
+#define GPIO146_SSP0_TXD       PIN_CFG(146, ALT_A)
+
+#define GPIO147_GPIO           PIN_CFG(147, GPIO)
+#define GPIO147_I2C0_SCL       PIN_CFG_PULL(147, ALT_A, UP)
+
+#define GPIO148_GPIO           PIN_CFG(148, GPIO)
+#define GPIO148_I2C0_SDA       PIN_CFG_PULL(148, ALT_A, UP)
+
+#define GPIO149_GPIO           PIN_CFG(149, GPIO)
+#define GPIO149_IP_GPIO0       PIN_CFG(149, ALT_A)
+#define GPIO149_SM_CS1n                PIN_CFG(149, ALT_B)
+#define GPIO149_SM_PS1n                PIN_CFG(149, ALT_C)
+
+#define GPIO150_GPIO           PIN_CFG(150, GPIO)
+#define GPIO150_IP_GPIO1       PIN_CFG(150, ALT_A)
+#define GPIO150_LCDA_CLK       PIN_CFG(150, ALT_B)
+
+#define GPIO151_GPIO           PIN_CFG(151, GPIO)
+#define GPIO151_KP_SKA0                PIN_CFG(151, ALT_A)
+#define GPIO151_LCD_VSI0       PIN_CFG(151, ALT_B)
+#define GPIO151_KP_O8          PIN_CFG(151, ALT_C)
+
+#define GPIO152_GPIO           PIN_CFG(152, GPIO)
+#define GPIO152_KP_SKB0                PIN_CFG(152, ALT_A)
+#define GPIO152_LCD_VSI1       PIN_CFG(152, ALT_B)
+#define GPIO152_KP_O9          PIN_CFG(152, ALT_C)
+
+#define GPIO153_GPIO           PIN_CFG(153, GPIO)
+#define GPIO153_KP_I7          PIN_CFG(153, ALT_A)
+#define GPIO153_LCD_D24                PIN_CFG(153, ALT_B)
+#define GPIO153_U2_RXD         PIN_CFG(153, ALT_C)
+
+#define GPIO154_GPIO           PIN_CFG(154, GPIO)
+#define GPIO154_KP_I6          PIN_CFG(154, ALT_A)
+#define GPIO154_LCD_D25                PIN_CFG(154, ALT_B)
+#define GPIO154_U2_TXD         PIN_CFG(154, ALT_C)
+
+#define GPIO155_GPIO           PIN_CFG(155, GPIO)
+#define GPIO155_KP_I5          PIN_CFG(155, ALT_A)
+#define GPIO155_LCD_D26                PIN_CFG(155, ALT_B)
+#define GPIO155_STMAPE_CLK     PIN_CFG(155, ALT_C)
+
+#define GPIO156_GPIO           PIN_CFG(156, GPIO)
+#define GPIO156_KP_I4          PIN_CFG(156, ALT_A)
+#define GPIO156_LCD_D27                PIN_CFG(156, ALT_B)
+#define GPIO156_STMAPE_DAT3    PIN_CFG(156, ALT_C)
+
+#define GPIO157_GPIO           PIN_CFG(157, GPIO)
+#define GPIO157_KP_O7          PIN_CFG(157, ALT_A)
+#define GPIO157_LCD_D28                PIN_CFG(157, ALT_B)
+#define GPIO157_STMAPE_DAT2    PIN_CFG(157, ALT_C)
+
+#define GPIO158_GPIO           PIN_CFG(158, GPIO)
+#define GPIO158_KP_O6          PIN_CFG(158, ALT_A)
+#define GPIO158_LCD_D29                PIN_CFG(158, ALT_B)
+#define GPIO158_STMAPE_DAT1    PIN_CFG(158, ALT_C)
+
+#define GPIO159_GPIO           PIN_CFG(159, GPIO)
+#define GPIO159_KP_O5          PIN_CFG(159, ALT_A)
+#define GPIO159_LCD_D30                PIN_CFG(159, ALT_B)
+#define GPIO159_STMAPE_DAT0    PIN_CFG(159, ALT_C)
+
+#define GPIO160_GPIO           PIN_CFG(160, GPIO)
+#define GPIO160_KP_O4          PIN_CFG(160, ALT_A)
+#define GPIO160_LCD_D31                PIN_CFG(160, ALT_B)
+#define GPIO160_NONE           PIN_CFG(160, ALT_C)
+
+#define GPIO161_GPIO           PIN_CFG(161, GPIO)
+#define GPIO161_KP_I3          PIN_CFG(161, ALT_A)
+#define GPIO161_LCD_D32                PIN_CFG(161, ALT_B)
+#define GPIO161_UARTMOD_RXD    PIN_CFG(161, ALT_C)
+
+#define GPIO162_GPIO           PIN_CFG(162, GPIO)
+#define GPIO162_KP_I2          PIN_CFG(162, ALT_A)
+#define GPIO162_LCD_D33                PIN_CFG(162, ALT_B)
+#define GPIO162_UARTMOD_TXD    PIN_CFG(162, ALT_C)
+
+#define GPIO163_GPIO           PIN_CFG(163, GPIO)
+#define GPIO163_KP_I1          PIN_CFG(163, ALT_A)
+#define GPIO163_LCD_D34                PIN_CFG(163, ALT_B)
+#define GPIO163_STMMOD_CLK     PIN_CFG(163, ALT_C)
+
+#define GPIO164_GPIO           PIN_CFG(164, GPIO)
+#define GPIO164_KP_I0          PIN_CFG(164, ALT_A)
+#define GPIO164_LCD_D35                PIN_CFG(164, ALT_B)
+#define GPIO164_STMMOD_DAT3    PIN_CFG(164, ALT_C)
+
+#define GPIO165_GPIO           PIN_CFG(165, GPIO)
+#define GPIO165_KP_O3          PIN_CFG(165, ALT_A)
+#define GPIO165_LCD_D36                PIN_CFG(165, ALT_B)
+#define GPIO165_STMMOD_DAT2    PIN_CFG(165, ALT_C)
+
+#define GPIO166_GPIO           PIN_CFG(166, GPIO)
+#define GPIO166_KP_O2          PIN_CFG(166, ALT_A)
+#define GPIO166_LCD_D37                PIN_CFG(166, ALT_B)
+#define GPIO166_STMMOD_DAT1    PIN_CFG(166, ALT_C)
+
+#define GPIO167_GPIO           PIN_CFG(167, GPIO)
+#define GPIO167_KP_O1          PIN_CFG(167, ALT_A)
+#define GPIO167_LCD_D38                PIN_CFG(167, ALT_B)
+#define GPIO167_STMMOD_DAT0    PIN_CFG(167, ALT_C)
+
+#define GPIO168_GPIO           PIN_CFG(168, GPIO)
+#define GPIO168_KP_O0          PIN_CFG(168, ALT_A)
+#define GPIO168_LCD_D39                PIN_CFG(168, ALT_B)
+#define GPIO168_NONE           PIN_CFG(168, ALT_C)
+
+#define GPIO169_GPIO           PIN_CFG(169, GPIO)
+#define GPIO169_RF_PURn                PIN_CFG(169, ALT_A)
+#define GPIO169_LCDA_DE                PIN_CFG(169, ALT_B)
+#define GPIO169_USBSIM_PDC     PIN_CFG(169, ALT_C)
+
+#define GPIO170_GPIO           PIN_CFG(170, GPIO)
+#define GPIO170_MODEM_STATE    PIN_CFG(170, ALT_A)
+#define GPIO170_LCDA_VSO       PIN_CFG(170, ALT_B)
+#define GPIO170_KP_SKA1                PIN_CFG(170, ALT_C)
+
+#define GPIO171_GPIO           PIN_CFG(171, GPIO)
+#define GPIO171_MODEM_PWREN    PIN_CFG(171, ALT_A)
+#define GPIO171_LCDA_HSO       PIN_CFG(171, ALT_B)
+#define GPIO171_KP_SKB1                PIN_CFG(171, ALT_C)
+
+#define GPIO192_GPIO           PIN_CFG(192, GPIO)
+#define GPIO192_MSP2_SCK       PIN_CFG(192, ALT_A)
+
+#define GPIO193_GPIO           PIN_CFG(193, GPIO)
+#define GPIO193_MSP2_TXD       PIN_CFG(193, ALT_A)
+
+#define GPIO194_GPIO           PIN_CFG(194, GPIO)
+#define GPIO194_MSP2_TCK       PIN_CFG(194, ALT_A)
+
+#define GPIO195_GPIO           PIN_CFG(195, GPIO)
+#define GPIO195_MSP2_TFS       PIN_CFG(195, ALT_A)
+
+#define GPIO196_GPIO           PIN_CFG(196, GPIO)
+#define GPIO196_MSP2_RXD       PIN_CFG(196, ALT_A)
+
+#define GPIO197_GPIO           PIN_CFG(197, GPIO)
+#define GPIO197_MC4_DAT3       PIN_CFG(197, ALT_A)
+
+#define GPIO198_GPIO           PIN_CFG(198, GPIO)
+#define GPIO198_MC4_DAT2       PIN_CFG(198, ALT_A)
+
+#define GPIO199_GPIO           PIN_CFG(199, GPIO)
+#define GPIO199_MC4_DAT1       PIN_CFG(199, ALT_A)
+
+#define GPIO200_GPIO           PIN_CFG(200, GPIO)
+#define GPIO200_MC4_DAT0       PIN_CFG(200, ALT_A)
+
+#define GPIO201_GPIO           PIN_CFG(201, GPIO)
+#define GPIO201_MC4_CMD                PIN_CFG(201, ALT_A)
+
+#define GPIO202_GPIO           PIN_CFG(202, GPIO)
+#define GPIO202_MC4_FBCLK      PIN_CFG(202, ALT_A)
+#define GPIO202_PWL            PIN_CFG(202, ALT_B)
+#define GPIO202_MC4_RSTN       PIN_CFG(202, ALT_C)
+
+#define GPIO203_GPIO           PIN_CFG(203, GPIO)
+#define GPIO203_MC4_CLK                PIN_CFG(203, ALT_A)
+
+#define GPIO204_GPIO           PIN_CFG(204, GPIO)
+#define GPIO204_MC4_DAT7       PIN_CFG(204, ALT_A)
+
+#define GPIO205_GPIO           PIN_CFG(205, GPIO)
+#define GPIO205_MC4_DAT6       PIN_CFG(205, ALT_A)
+
+#define GPIO206_GPIO           PIN_CFG(206, GPIO)
+#define GPIO206_MC4_DAT5       PIN_CFG(206, ALT_A)
+
+#define GPIO207_GPIO           PIN_CFG(207, GPIO)
+#define GPIO207_MC4_DAT4       PIN_CFG(207, ALT_A)
+
+#define GPIO208_GPIO           PIN_CFG(208, GPIO)
+#define GPIO208_MC1_CLK                PIN_CFG(208, ALT_A)
+
+#define GPIO209_GPIO           PIN_CFG(209, GPIO)
+#define GPIO209_MC1_FBCLK      PIN_CFG(209, ALT_A)
+#define GPIO209_SPI1_CLK       PIN_CFG(209, ALT_B)
+
+#define GPIO210_GPIO           PIN_CFG(210, GPIO)
+#define GPIO210_MC1_CMD                PIN_CFG(210, ALT_A)
+
+#define GPIO211_GPIO           PIN_CFG(211, GPIO)
+#define GPIO211_MC1_DAT0       PIN_CFG(211, ALT_A)
+
+#define GPIO212_GPIO           PIN_CFG(212, GPIO)
+#define GPIO212_MC1_DAT1       PIN_CFG(212, ALT_A)
+#define GPIO212_SPI1_FRM       PIN_CFG(212, ALT_B)
+
+#define GPIO213_GPIO           PIN_CFG(213, GPIO)
+#define GPIO213_MC1_DAT2       PIN_CFG(213, ALT_A)
+#define GPIO213_SPI1_TXD       PIN_CFG(213, ALT_B)
+
+#define GPIO214_GPIO           PIN_CFG(214, GPIO)
+#define GPIO214_MC1_DAT3       PIN_CFG(214, ALT_A)
+#define GPIO214_SPI1_RXD       PIN_CFG(214, ALT_B)
+
+#define GPIO215_GPIO           PIN_CFG(215, GPIO)
+#define GPIO215_MC1_CMDDIR     PIN_CFG(215, ALT_A)
+#define GPIO215_MC3_DAT2DIR    PIN_CFG(215, ALT_B)
+#define GPIO215_CLKOUT1                PIN_CFG(215, ALT_C)
+
+#define GPIO216_GPIO           PIN_CFG(216, GPIO)
+#define GPIO216_MC1_DAT2DIR    PIN_CFG(216, ALT_A)
+#define GPIO216_MC3_CMDDIR     PIN_CFG(216, ALT_B)
+#define GPIO216_I2C3_SDA       PIN_CFG_PULL(216, ALT_C, UP)
+
+#define GPIO217_GPIO           PIN_CFG(217, GPIO)
+#define GPIO217_MC1_DAT0DIR    PIN_CFG(217, ALT_A)
+#define GPIO217_MC3_DAT31DIR   PIN_CFG(217, ALT_B)
+#define GPIO217_CLKOUT2                PIN_CFG(217, ALT_C)
+
+#define GPIO218_GPIO           PIN_CFG(218, GPIO)
+#define GPIO218_MC1_DAT31DIR   PIN_CFG(218, ALT_A)
+#define GPIO218_MC3_DAT0DIR    PIN_CFG(218, ALT_B)
+#define GPIO218_I2C3_SCL       PIN_CFG_PULL(218, ALT_C, UP)
+
+#define GPIO219_GPIO           PIN_CFG(219, GPIO)
+#define GPIO219_HSIR_FLA0      PIN_CFG(219, ALT_A)
+#define GPIO219_MC3_CLK                PIN_CFG(219, ALT_B)
+
+#define GPIO220_GPIO           PIN_CFG(220, GPIO)
+#define GPIO220_HSIR_DAT0      PIN_CFG(220, ALT_A)
+#define GPIO220_MC3_FBCLK      PIN_CFG(220, ALT_B)
+#define GPIO220_SPI0_CLK       PIN_CFG(220, ALT_C)
+
+#define GPIO221_GPIO           PIN_CFG(221, GPIO)
+#define GPIO221_HSIR_RDY0      PIN_CFG(221, ALT_A)
+#define GPIO221_MC3_CMD                PIN_CFG(221, ALT_B)
+
+#define GPIO222_GPIO           PIN_CFG(222, GPIO)
+#define GPIO222_HSIT_FLA0      PIN_CFG(222, ALT_A)
+#define GPIO222_MC3_DAT0       PIN_CFG(222, ALT_B)
+
+#define GPIO223_GPIO           PIN_CFG(223, GPIO)
+#define GPIO223_HSIT_DAT0      PIN_CFG(223, ALT_A)
+#define GPIO223_MC3_DAT1       PIN_CFG(223, ALT_B)
+#define GPIO223_SPI0_FRM       PIN_CFG(223, ALT_C)
+
+#define GPIO224_GPIO           PIN_CFG(224, GPIO)
+#define GPIO224_HSIT_RDY0      PIN_CFG(224, ALT_A)
+#define GPIO224_MC3_DAT2       PIN_CFG(224, ALT_B)
+#define GPIO224_SPI0_TXD       PIN_CFG(224, ALT_C)
+
+#define GPIO225_GPIO           PIN_CFG(225, GPIO)
+#define GPIO225_HSIT_CAWAKE0   PIN_CFG(225, ALT_A)
+#define GPIO225_MC3_DAT3       PIN_CFG(225, ALT_B)
+#define GPIO225_SPI0_RXD       PIN_CFG(225, ALT_C)
+
+#define GPIO226_GPIO           PIN_CFG(226, GPIO)
+#define GPIO226_HSIT_ACWAKE0   PIN_CFG(226, ALT_A)
+#define GPIO226_PWL            PIN_CFG(226, ALT_B)
+#define GPIO226_USBSIM_PDC     PIN_CFG(226, ALT_C)
+
+#define GPIO227_GPIO           PIN_CFG(227, GPIO)
+#define GPIO227_CLKOUT1                PIN_CFG(227, ALT_A)
+
+#define GPIO228_GPIO           PIN_CFG(228, GPIO)
+#define GPIO228_CLKOUT2                PIN_CFG(228, ALT_A)
+
+#define GPIO229_GPIO           PIN_CFG(229, GPIO)
+#define GPIO229_CLKOUT1                PIN_CFG(229, ALT_A)
+#define GPIO229_PWL            PIN_CFG(229, ALT_B)
+#define GPIO229_I2C3_SDA       PIN_CFG_PULL(229, ALT_C, UP)
+
+#define GPIO230_GPIO           PIN_CFG(230, GPIO)
+#define GPIO230_CLKOUT2                PIN_CFG(230, ALT_A)
+#define GPIO230_PWL            PIN_CFG(230, ALT_B)
+#define GPIO230_I2C3_SCL       PIN_CFG_PULL(230, ALT_C, UP)
+
+#define GPIO256_GPIO           PIN_CFG(256, GPIO)
+#define GPIO256_USB_NXT                PIN_CFG(256, ALT_A)
+
+#define GPIO257_GPIO           PIN_CFG(257, GPIO)
+#define GPIO257_USB_STP                PIN_CFG(257, ALT_A)
+
+#define GPIO258_GPIO           PIN_CFG(258, GPIO)
+#define GPIO258_USB_XCLK       PIN_CFG(258, ALT_A)
+#define GPIO258_NONE           PIN_CFG(258, ALT_B)
+#define GPIO258_DDR_TRIG       PIN_CFG(258, ALT_C)
+
+#define GPIO259_GPIO           PIN_CFG(259, GPIO)
+#define GPIO259_USB_DIR                PIN_CFG(259, ALT_A)
+
+#define GPIO260_GPIO           PIN_CFG(260, GPIO)
+#define GPIO260_USB_DAT7       PIN_CFG(260, ALT_A)
+
+#define GPIO261_GPIO           PIN_CFG(261, GPIO)
+#define GPIO261_USB_DAT6       PIN_CFG(261, ALT_A)
+
+#define GPIO262_GPIO           PIN_CFG(262, GPIO)
+#define GPIO262_USB_DAT5       PIN_CFG(262, ALT_A)
+
+#define GPIO263_GPIO           PIN_CFG(263, GPIO)
+#define GPIO263_USB_DAT4       PIN_CFG(263, ALT_A)
+
+#define GPIO264_GPIO           PIN_CFG(264, GPIO)
+#define GPIO264_USB_DAT3       PIN_CFG(264, ALT_A)
+
+#define GPIO265_GPIO           PIN_CFG(265, GPIO)
+#define GPIO265_USB_DAT2       PIN_CFG(265, ALT_A)
+
+#define GPIO266_GPIO           PIN_CFG(266, GPIO)
+#define GPIO266_USB_DAT1       PIN_CFG(266, ALT_A)
+
+#define GPIO267_GPIO           PIN_CFG(267, GPIO)
+#define GPIO267_USB_DAT0       PIN_CFG(267, ALT_A)
+
+#endif
index 3dff8641b03fa7a639d5f886345dad1e84706445..e38acb0f89c884b961bdb1dc11fa59b1a0112bc0 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/amba/clcd.h>
 #include <linux/amba/pl061.h>
 #include <linux/amba/mmci.h>
+#include <linux/amba/pl022.h>
 #include <linux/io.h>
 #include <linux/gfp.h>
 
@@ -354,6 +355,21 @@ static struct mmci_platform_data mmc0_plat_data = {
        .gpio_cd        = -1,
 };
 
+static struct resource char_lcd_resources[] = {
+       {
+               .start = VERSATILE_CHAR_LCD_BASE,
+               .end   = (VERSATILE_CHAR_LCD_BASE + SZ_4K - 1),
+               .flags = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device char_lcd_device = {
+       .name           =       "arm-charlcd",
+       .id             =       -1,
+       .num_resources  =       ARRAY_SIZE(char_lcd_resources),
+       .resource       =       char_lcd_resources,
+};
+
 /*
  * Clock handling
  */
@@ -400,8 +416,13 @@ static struct clk ref24_clk = {
        .rate   = 24000000,
 };
 
+static struct clk dummy_apb_pclk;
+
 static struct clk_lookup lookups[] = {
-       {       /* UART0 */
+       {       /* AMBA bus clock */
+               .con_id         = "apb_pclk",
+               .clk            = &dummy_apb_pclk,
+       }, {    /* UART0 */
                .dev_id         = "dev:f1",
                .clk            = &ref24_clk,
        }, {    /* UART1 */
@@ -425,6 +446,9 @@ static struct clk_lookup lookups[] = {
        }, {    /* MMC1 */
                .dev_id         = "fpga:0b",
                .clk            = &ref24_clk,
+       }, {    /* SSP */
+               .dev_id         = "dev:f4",
+               .clk            = &ref24_clk,
        }, {    /* CLCD */
                .dev_id         = "dev:20",
                .clk            = &osc4_clk,
@@ -703,6 +727,12 @@ static struct pl061_platform_data gpio1_plat_data = {
        .irq_base       = IRQ_GPIO1_START,
 };
 
+static struct pl022_ssp_controller ssp0_plat_data = {
+       .bus_id = 0,
+       .enable_dma = 0,
+       .num_chipselect = 1,
+};
+
 #define AACI_IRQ       { IRQ_AACI, NO_IRQ }
 #define AACI_DMA       { 0x80, 0x81 }
 #define MMCI0_IRQ      { IRQ_MMCI0A,IRQ_SIC_MMCI0B }
@@ -772,7 +802,7 @@ AMBA_DEVICE(sci0,  "dev:f0",  SCI,      NULL);
 AMBA_DEVICE(uart0, "dev:f1",  UART0,    NULL);
 AMBA_DEVICE(uart1, "dev:f2",  UART1,    NULL);
 AMBA_DEVICE(uart2, "dev:f3",  UART2,    NULL);
-AMBA_DEVICE(ssp0,  "dev:f4",  SSP,      NULL);
+AMBA_DEVICE(ssp0,  "dev:f4",  SSP,      &ssp0_plat_data);
 
 static struct amba_device *amba_devs[] __initdata = {
        &dmac_device,
@@ -843,6 +873,7 @@ void __init versatile_init(void)
        platform_device_register(&versatile_flash_device);
        platform_device_register(&versatile_i2c_device);
        platform_device_register(&smc91x_device);
+       platform_device_register(&char_lcd_device);
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
                struct amba_device *d = amba_devs[i];
index 334f0df4e948bc46c322c3ca0c50fe8002b676c0..13c7e5f90a82eb1d4f52883e784eea8d08257546 100644 (file)
@@ -304,7 +304,7 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
 }
 
 
-struct pci_bus *pci_versatile_scan_bus(int nr, struct pci_sys_data *sys)
+struct pci_bus * __init pci_versatile_scan_bus(int nr, struct pci_sys_data *sys)
 {
        return pci_scan_bus(sys->busnr, &pci_versatile_ops, sys);
 }
index 6353459bb5671bc2623377529b9a6dfcd5db4a8f..577df6cccb0891503bf0188f3c0f33103c159000 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/pmu.h>
+#include <asm/smp_twd.h>
 
 #include <mach/clkdev.h>
 #include <mach/ct-ca9x4.h>
@@ -53,6 +54,7 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = {
 
 static void __init ct_ca9x4_map_io(void)
 {
+       twd_base = MMIO_P2V(A9_MPCORE_TWD);
        v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
 }
 
index 8650f04136efa0e744edb230f4d94afb1325f755..f9e2f8d229623d5825251e1999b0bf501a18b4a6 100644 (file)
@@ -28,6 +28,7 @@
 #define A9_MPCORE_SCU          (CT_CA9X4_MPIC + 0x0000)
 #define A9_MPCORE_GIC_CPU      (CT_CA9X4_MPIC + 0x0100)
 #define A9_MPCORE_GIT          (CT_CA9X4_MPIC + 0x0200)
+#define A9_MPCORE_TWD          (CT_CA9X4_MPIC + 0x0600)
 #define A9_MPCORE_GIC_DIST     (CT_CA9X4_MPIC + 0x1000)
 
 /*
index d250711b8c7a4e3c17ee2ddcc53ad5b2e24ee420..d6db3453908b7412b39bf262bb355cc3e3931a07 100644 (file)
@@ -298,8 +298,13 @@ static struct clk osc2_clk = {
        .rate   = 24000000,
 };
 
+static struct clk dummy_apb_pclk;
+
 static struct clk_lookup v2m_lookups[] = {
-       {       /* UART0 */
+       {       /* AMBA bus clock */
+               .con_id         = "apb_pclk",
+               .clk            = &dummy_apb_pclk,
+       }, {    /* UART0 */
                .dev_id         = "mb:uart0",
                .clk            = &osc2_clk,
        }, {    /* UART1 */
index 642207e18198db20777ef475a27ada0bd2ae0c3d..83c56324a472f16a5f155df056b4cc29ba9e562d 100644 (file)
@@ -93,7 +93,7 @@ static struct clk_lookup nuc900_clkregs[] = {
        DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL),
        DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL),
        DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL),
-       DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL),
+       DEF_CLKLOOK(&clk_adc, "nuc900-ts", NULL),
        DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL),
        DEF_CLKLOOK(&clk_ext, NULL, "ext"),
        DEF_CLKLOOK(&clk_timer0, NULL, "timer0"),
index b2eda4dc1c34ea7172a773899275c18bbfab5dd4..7a1fa6adb7c32d5645b1f0e608b1e61794081afc 100644 (file)
@@ -36,6 +36,8 @@
 #include <mach/nuc900_spi.h>
 #include <mach/map.h>
 #include <mach/fb.h>
+#include <mach/regs-ldm.h>
+#include <mach/w90p910_keypad.h>
 
 #include "cpu.h"
 
@@ -207,7 +209,7 @@ static struct nuc900_spi_info nuc900_spiflash_data = {
        .divider        = 24,
        .sleep          = 0,
        .txnum          = 0,
-       .txbitlen       = 1,
+       .txbitlen       = 8,
        .bus_num        = 0,
 };
 
@@ -256,7 +258,7 @@ static struct spi_board_info nuc900_spi_board_info[] __initdata = {
                .modalias = "m25p80",
                .max_speed_hz = 20000000,
                .bus_num = 0,
-               .chip_select = 1,
+               .chip_select = 0,
                .platform_data = &nuc900_spi_flash_data,
                .mode = SPI_MODE_0,
        },
@@ -361,6 +363,39 @@ struct platform_device nuc900_device_fmi = {
 
 /* KPI controller*/
 
+static int nuc900_keymap[] = {
+       KEY(0, 0, KEY_A),
+       KEY(0, 1, KEY_B),
+       KEY(0, 2, KEY_C),
+       KEY(0, 3, KEY_D),
+
+       KEY(1, 0, KEY_E),
+       KEY(1, 1, KEY_F),
+       KEY(1, 2, KEY_G),
+       KEY(1, 3, KEY_H),
+
+       KEY(2, 0, KEY_I),
+       KEY(2, 1, KEY_J),
+       KEY(2, 2, KEY_K),
+       KEY(2, 3, KEY_L),
+
+       KEY(3, 0, KEY_M),
+       KEY(3, 1, KEY_N),
+       KEY(3, 2, KEY_O),
+       KEY(3, 3, KEY_P),
+};
+
+static struct matrix_keymap_data nuc900_map_data = {
+       .keymap                 = nuc900_keymap,
+       .keymap_size            = ARRAY_SIZE(nuc900_keymap),
+};
+
+struct w90p910_keypad_platform_data nuc900_keypad_info = {
+       .keymap_data    = &nuc900_map_data,
+       .prescale       = 0xfa,
+       .debounce       = 0x50,
+};
+
 static struct resource nuc900_kpi_resource[] = {
        [0] = {
                .start = W90X900_PA_KPI,
@@ -380,9 +415,49 @@ struct platform_device nuc900_device_kpi = {
        .id             = -1,
        .num_resources  = ARRAY_SIZE(nuc900_kpi_resource),
        .resource       = nuc900_kpi_resource,
+       .dev            = {
+                               .platform_data = &nuc900_keypad_info,
+                       }
 };
 
-#ifdef CONFIG_FB_NUC900
+/* LCD controller*/
+
+static struct nuc900fb_display __initdata nuc900_lcd_info[] = {
+       /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */
+       [0] = {
+               .type           = LCM_DCCS_VA_SRC_RGB565,
+               .width          = 320,
+               .height         = 240,
+               .xres           = 320,
+               .yres           = 240,
+               .bpp            = 16,
+               .pixclock       = 200000,
+               .left_margin    = 34,
+               .right_margin   = 54,
+               .hsync_len      = 10,
+               .upper_margin   = 18,
+               .lower_margin   = 4,
+               .vsync_len      = 1,
+               .dccs           = 0x8e00041a,
+               .devctl         = 0x060800c0,
+               .fbctrl         = 0x00a000a0,
+               .scale          = 0x04000400,
+       },
+};
+
+static struct nuc900fb_mach_info nuc900_fb_info __initdata = {
+#if defined(CONFIG_GPM1040A0_320X240)
+       .displays               = &nuc900_lcd_info[0],
+#else
+       .displays               = nuc900_lcd_info,
+#endif
+       .num_displays           = ARRAY_SIZE(nuc900_lcd_info),
+       .default_display        = 0,
+       .gpio_dir               = 0x00000004,
+       .gpio_dir_mask          = 0xFFFFFFFD,
+       .gpio_data              = 0x00000004,
+       .gpio_data_mask         = 0xFFFFFFFD,
+};
 
 static struct resource nuc900_lcd_resource[] = {
        [0] = {
@@ -406,23 +481,10 @@ struct platform_device nuc900_device_lcd = {
        .dev              = {
                .dma_mask               = &nuc900_device_lcd_dmamask,
                .coherent_dma_mask      = -1,
+               .platform_data = &nuc900_fb_info,
        }
 };
 
-void  nuc900_fb_set_platdata(struct nuc900fb_mach_info *pd)
-{
-       struct nuc900fb_mach_info *npd;
-
-       npd = kmalloc(sizeof(*npd), GFP_KERNEL);
-       if (npd) {
-               memcpy(npd, pd, sizeof(*npd));
-               nuc900_device_lcd.dev.platform_data = npd;
-       } else {
-               printk(KERN_ERR "no memory for LCD platform data\n");
-       }
-}
-#endif
-
 /* AUDIO controller*/
 static u64 nuc900_device_audio_dmamask = -1;
 static struct resource nuc900_ac97_resource[] = {
diff --git a/arch/arm/mach-w90x900/include/mach/regs-gcr.h b/arch/arm/mach-w90x900/include/mach/regs-gcr.h
new file mode 100644 (file)
index 0000000..6087abd
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * arch/arm/mach-w90x900/include/mach/regs-gcr.h
+ *
+ * Copyright (c) 2010 Nuvoton technology corporation
+ * All rights reserved.
+ *
+ * Wan ZongShun <mcuos.com@gmail.com>
+ *
+ * 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.
+ *
+ */
+
+#ifndef __ASM_ARCH_REGS_GCR_H
+#define __ASM_ARCH_REGS_GCR_H
+
+/* Global control registers */
+
+#define GCR_BA         W90X900_VA_GCR
+#define REG_PDID       (GCR_BA+0x000)
+#define REG_PWRON      (GCR_BA+0x004)
+#define REG_ARBCON     (GCR_BA+0x008)
+#define REG_MFSEL      (GCR_BA+0x00C)
+#define REG_EBIDPE     (GCR_BA+0x010)
+#define REG_LCDDPE     (GCR_BA+0x014)
+#define REG_GPIOCPE    (GCR_BA+0x018)
+#define REG_GPIODPE    (GCR_BA+0x01C)
+#define REG_GPIOEPE    (GCR_BA+0x020)
+#define REG_GPIOFPE    (GCR_BA+0x024)
+#define REG_GPIOGPE    (GCR_BA+0x028)
+#define REG_GPIOHPE    (GCR_BA+0x02C)
+#define REG_GPIOIPE    (GCR_BA+0x030)
+#define REG_GTMP1      (GCR_BA+0x034)
+#define REG_GTMP2      (GCR_BA+0x038)
+#define REG_GTMP3      (GCR_BA+0x03C)
+
+#endif /*  __ASM_ARCH_REGS_GCR_H */
index b3edc3cccf52f4c152ce9008e4d92fcc157c1584..04d295f89eb049f86ed0b8c6ba8386c5d0c0c09e 100644 (file)
 #include <asm/mach/map.h>
 #include <asm/mach-types.h>
 #include <mach/map.h>
-#include <mach/regs-ldm.h>
 #include <mach/fb.h>
 
 #include "nuc950.h"
 
-#ifdef CONFIG_FB_NUC900
-/* LCD Controller */
-static struct nuc900fb_display __initdata nuc950_lcd_info[] = {
-       /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */
-       [0] = {
-               .type           = LCM_DCCS_VA_SRC_RGB565,
-               .width          = 320,
-               .height         = 240,
-               .xres           = 320,
-               .yres           = 240,
-               .bpp            = 16,
-               .pixclock       = 200000,
-               .left_margin    = 34,
-               .right_margin   = 54,
-               .hsync_len      = 10,
-               .upper_margin   = 18,
-               .lower_margin   = 4,
-               .vsync_len      = 1,
-               .dccs           = 0x8e00041a,
-               .devctl         = 0x060800c0,
-               .fbctrl         = 0x00a000a0,
-               .scale          = 0x04000400,
-       },
-};
-
-static struct nuc900fb_mach_info nuc950_fb_info __initdata = {
-#if defined(CONFIG_GPM1040A0_320X240)
-       .displays               = &nuc950_lcd_info[0],
-#else
-       .displays               = nuc950_lcd_info,
-#endif
-       .num_displays           = ARRAY_SIZE(nuc950_lcd_info),
-       .default_display        = 0,
-       .gpio_dir               = 0x00000004,
-       .gpio_dir_mask          = 0xFFFFFFFD,
-       .gpio_data              = 0x00000004,
-       .gpio_data_mask         = 0xFFFFFFFD,
-};
-#endif
-
 static void __init nuc950evb_map_io(void)
 {
        nuc950_map_io();
@@ -74,9 +33,6 @@ static void __init nuc950evb_map_io(void)
 static void __init nuc950evb_init(void)
 {
        nuc950_board_init();
-#ifdef CONFIG_FB_NUC900
-       nuc900_fb_set_platdata(&nuc950_fb_info);
-#endif
 }
 
 MACHINE_START(W90P950EVB, "W90P950EVB")
index 656f03b3b629f28e8972d983f652a406ef7d7e94..1523f41369857a95ad8669679bae3ecf88820a00 100644 (file)
@@ -26,6 +26,8 @@
 static struct platform_device *nuc910_dev[] __initdata = {
        &nuc900_device_ts,
        &nuc900_device_rtc,
+       &nuc900_device_lcd,
+       &nuc900_device_kpi,
 };
 
 /* define specific CPU platform io map */
index 4d1f1ab044c48868d588b6081d8ebcabad98c7b5..5704f74a50eeaf768667c07669108396fdcd1fe0 100644 (file)
@@ -26,9 +26,7 @@
 static struct platform_device *nuc950_dev[] __initdata = {
        &nuc900_device_kpi,
        &nuc900_device_fmi,
-#ifdef CONFIG_FB_NUC900
        &nuc900_device_lcd,
-#endif
 };
 
 /* define specific CPU platform io map */
index e8d34a80851c66baf47c3d97e89e029e5e9a96ca..d63b6c413758a23389cbb09ea1ab8686c61e56db 100644 (file)
@@ -15,7 +15,6 @@ endif
 obj-$(CONFIG_MODULES)          += proc-syms.o
 
 obj-$(CONFIG_ALIGNMENT_TRAP)   += alignment.o
-obj-$(CONFIG_DISCONTIGMEM)     += discontig.o
 obj-$(CONFIG_HIGHMEM)          += highmem.o
 
 obj-$(CONFIG_CPU_ABRT_NOMMU)   += abort-nommu.o
diff --git a/arch/arm/mm/discontig.c b/arch/arm/mm/discontig.c
deleted file mode 100644 (file)
index c8c0c4b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * linux/arch/arm/mm/discontig.c
- *
- * Discontiguous memory support.
- *
- * Initial code: Copyright (C) 1999-2000 Nicolas Pitre
- *
- * 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/module.h>
-#include <linux/mmzone.h>
-#include <linux/bootmem.h>
-
-#if MAX_NUMNODES != 4 && MAX_NUMNODES != 16
-# error Fix Me Please
-#endif
-
-/*
- * Our node_data structure for discontiguous memory.
- */
-
-pg_data_t discontig_node_data[MAX_NUMNODES] = {
-  { .bdata = &bootmem_node_data[0] },
-  { .bdata = &bootmem_node_data[1] },
-  { .bdata = &bootmem_node_data[2] },
-  { .bdata = &bootmem_node_data[3] },
-#if MAX_NUMNODES == 16
-  { .bdata = &bootmem_node_data[4] },
-  { .bdata = &bootmem_node_data[5] },
-  { .bdata = &bootmem_node_data[6] },
-  { .bdata = &bootmem_node_data[7] },
-  { .bdata = &bootmem_node_data[8] },
-  { .bdata = &bootmem_node_data[9] },
-  { .bdata = &bootmem_node_data[10] },
-  { .bdata = &bootmem_node_data[11] },
-  { .bdata = &bootmem_node_data[12] },
-  { .bdata = &bootmem_node_data[13] },
-  { .bdata = &bootmem_node_data[14] },
-  { .bdata = &bootmem_node_data[15] },
-#endif
-};
-
-EXPORT_SYMBOL(discontig_node_data);
index e00404e6f45b6d3f6d2ea166061a87151fd153ea..240b68d511dc1437c6fcb8bbfb491582fea72280 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/initrd.h>
 #include <linux/highmem.h>
 #include <linux/gfp.h>
+#include <linux/memblock.h>
 
 #include <asm/mach-types.h>
 #include <asm/sections.h>
@@ -79,38 +80,37 @@ struct meminfo meminfo;
 void show_mem(void)
 {
        int free = 0, total = 0, reserved = 0;
-       int shared = 0, cached = 0, slab = 0, node, i;
+       int shared = 0, cached = 0, slab = 0, i;
        struct meminfo * mi = &meminfo;
 
        printk("Mem-info:\n");
        show_free_areas();
-       for_each_online_node(node) {
-               for_each_nodebank (i,mi,node) {
-                       struct membank *bank = &mi->bank[i];
-                       unsigned int pfn1, pfn2;
-                       struct page *page, *end;
-
-                       pfn1 = bank_pfn_start(bank);
-                       pfn2 = bank_pfn_end(bank);
-
-                       page = pfn_to_page(pfn1);
-                       end  = pfn_to_page(pfn2 - 1) + 1;
-
-                       do {
-                               total++;
-                               if (PageReserved(page))
-                                       reserved++;
-                               else if (PageSwapCache(page))
-                                       cached++;
-                               else if (PageSlab(page))
-                                       slab++;
-                               else if (!page_count(page))
-                                       free++;
-                               else
-                                       shared += page_count(page) - 1;
-                               page++;
-                       } while (page < end);
-               }
+
+       for_each_bank (i, mi) {
+               struct membank *bank = &mi->bank[i];
+               unsigned int pfn1, pfn2;
+               struct page *page, *end;
+
+               pfn1 = bank_pfn_start(bank);
+               pfn2 = bank_pfn_end(bank);
+
+               page = pfn_to_page(pfn1);
+               end  = pfn_to_page(pfn2 - 1) + 1;
+
+               do {
+                       total++;
+                       if (PageReserved(page))
+                               reserved++;
+                       else if (PageSwapCache(page))
+                               cached++;
+                       else if (PageSlab(page))
+                               slab++;
+                       else if (!page_count(page))
+                               free++;
+                       else
+                               shared += page_count(page) - 1;
+                       page++;
+               } while (page < end);
        }
 
        printk("%d pages of RAM\n", total);
@@ -121,7 +121,7 @@ void show_mem(void)
        printk("%d pages swap cached\n", cached);
 }
 
-static void __init find_node_limits(int node, struct meminfo *mi,
+static void __init find_limits(struct meminfo *mi,
        unsigned long *min, unsigned long *max_low, unsigned long *max_high)
 {
        int i;
@@ -129,7 +129,7 @@ static void __init find_node_limits(int node, struct meminfo *mi,
        *min = -1UL;
        *max_low = *max_high = 0;
 
-       for_each_nodebank(i, mi, node) {
+       for_each_bank (i, mi) {
                struct membank *bank = &mi->bank[i];
                unsigned long start, end;
 
@@ -147,155 +147,64 @@ static void __init find_node_limits(int node, struct meminfo *mi,
        }
 }
 
-/*
- * FIXME: We really want to avoid allocating the bootmap bitmap
- * over the top of the initrd.  Hopefully, this is located towards
- * the start of a bank, so if we allocate the bootmap bitmap at
- * the end, we won't clash.
- */
-static unsigned int __init
-find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages)
-{
-       unsigned int start_pfn, i, bootmap_pfn;
-
-       start_pfn   = PAGE_ALIGN(__pa(_end)) >> PAGE_SHIFT;
-       bootmap_pfn = 0;
-
-       for_each_nodebank(i, mi, node) {
-               struct membank *bank = &mi->bank[i];
-               unsigned int start, end;
-
-               start = bank_pfn_start(bank);
-               end   = bank_pfn_end(bank);
-
-               if (end < start_pfn)
-                       continue;
-
-               if (start < start_pfn)
-                       start = start_pfn;
-
-               if (end <= start)
-                       continue;
-
-               if (end - start >= bootmap_pages) {
-                       bootmap_pfn = start;
-                       break;
-               }
-       }
-
-       if (bootmap_pfn == 0)
-               BUG();
-
-       return bootmap_pfn;
-}
-
-static int __init check_initrd(struct meminfo *mi)
-{
-       int initrd_node = -2;
-#ifdef CONFIG_BLK_DEV_INITRD
-       unsigned long end = phys_initrd_start + phys_initrd_size;
-
-       /*
-        * Make sure that the initrd is within a valid area of
-        * memory.
-        */
-       if (phys_initrd_size) {
-               unsigned int i;
-
-               initrd_node = -1;
-
-               for (i = 0; i < mi->nr_banks; i++) {
-                       struct membank *bank = &mi->bank[i];
-                       if (bank_phys_start(bank) <= phys_initrd_start &&
-                           end <= bank_phys_end(bank))
-                               initrd_node = bank->node;
-               }
-       }
-
-       if (initrd_node == -1) {
-               printk(KERN_ERR "INITRD: 0x%08lx+0x%08lx extends beyond "
-                      "physical memory - disabling initrd\n",
-                      phys_initrd_start, phys_initrd_size);
-               phys_initrd_start = phys_initrd_size = 0;
-       }
-#endif
-
-       return initrd_node;
-}
-
-static void __init bootmem_init_node(int node, struct meminfo *mi,
+static void __init arm_bootmem_init(struct meminfo *mi,
        unsigned long start_pfn, unsigned long end_pfn)
 {
-       unsigned long boot_pfn;
        unsigned int boot_pages;
+       phys_addr_t bitmap;
        pg_data_t *pgdat;
        int i;
 
        /*
-        * Allocate the bootmem bitmap page.
+        * Allocate the bootmem bitmap page.  This must be in a region
+        * of memory which has already been mapped.
         */
        boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
-       boot_pfn = find_bootmap_pfn(node, mi, boot_pages);
+       bitmap = memblock_alloc_base(boot_pages << PAGE_SHIFT, L1_CACHE_BYTES,
+                               __pfn_to_phys(end_pfn));
 
        /*
-        * Initialise the bootmem allocator for this node, handing the
+        * Initialise the bootmem allocator, handing the
         * memory banks over to bootmem.
         */
-       node_set_online(node);
-       pgdat = NODE_DATA(node);
-       init_bootmem_node(pgdat, boot_pfn, start_pfn, end_pfn);
+       node_set_online(0);
+       pgdat = NODE_DATA(0);
+       init_bootmem_node(pgdat, __phys_to_pfn(bitmap), start_pfn, end_pfn);
 
-       for_each_nodebank(i, mi, node) {
+       for_each_bank(i, mi) {
                struct membank *bank = &mi->bank[i];
                if (!bank->highmem)
-                       free_bootmem_node(pgdat, bank_phys_start(bank), bank_phys_size(bank));
+                       free_bootmem(bank_phys_start(bank), bank_phys_size(bank));
        }
 
        /*
-        * Reserve the bootmem bitmap for this node.
+        * Reserve the memblock reserved regions in bootmem.
         */
-       reserve_bootmem_node(pgdat, boot_pfn << PAGE_SHIFT,
-                            boot_pages << PAGE_SHIFT, BOOTMEM_DEFAULT);
-}
-
-static void __init bootmem_reserve_initrd(int node)
-{
-#ifdef CONFIG_BLK_DEV_INITRD
-       pg_data_t *pgdat = NODE_DATA(node);
-       int res;
-
-       res = reserve_bootmem_node(pgdat, phys_initrd_start,
-                            phys_initrd_size, BOOTMEM_EXCLUSIVE);
-
-       if (res == 0) {
-               initrd_start = __phys_to_virt(phys_initrd_start);
-               initrd_end = initrd_start + phys_initrd_size;
-       } else {
-               printk(KERN_ERR
-                       "INITRD: 0x%08lx+0x%08lx overlaps in-use "
-                       "memory region - disabling initrd\n",
-                       phys_initrd_start, phys_initrd_size);
+       for (i = 0; i < memblock.reserved.cnt; i++) {
+               phys_addr_t start = memblock_start_pfn(&memblock.reserved, i);
+               if (start >= start_pfn &&
+                   memblock_end_pfn(&memblock.reserved, i) <= end_pfn)
+                       reserve_bootmem_node(pgdat, __pfn_to_phys(start),
+                               memblock_size_bytes(&memblock.reserved, i),
+                               BOOTMEM_DEFAULT);
        }
-#endif
 }
 
-static void __init bootmem_free_node(int node, struct meminfo *mi)
+static void __init arm_bootmem_free(struct meminfo *mi, unsigned long min,
+       unsigned long max_low, unsigned long max_high)
 {
        unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
-       unsigned long min, max_low, max_high;
        int i;
 
-       find_node_limits(node, mi, &min, &max_low, &max_high);
-
        /*
-        * initialise the zones within this node.
+        * initialise the zones.
         */
        memset(zone_size, 0, sizeof(zone_size));
 
        /*
-        * The size of this node has already been determined.  If we need
-        * to do anything fancy with the allocation of this memory to the
-        * zones, now is the time to do it.
+        * The memory size has already been determined.  If we need
+        * to do anything fancy with the allocation of this memory
+        * to the zones, now is the time to do it.
         */
        zone_size[0] = max_low - min;
 #ifdef CONFIG_HIGHMEM
@@ -303,11 +212,11 @@ static void __init bootmem_free_node(int node, struct meminfo *mi)
 #endif
 
        /*
-        * For each bank in this node, calculate the size of the holes.
-        *  holes = node_size - sum(bank_sizes_in_node)
+        * Calculate the size of the holes.
+        *  holes = node_size - sum(bank_sizes)
         */
        memcpy(zhole_size, zone_size, sizeof(zhole_size));
-       for_each_nodebank(i, mi, node) {
+       for_each_bank(i, mi) {
                int idx = 0;
 #ifdef CONFIG_HIGHMEM
                if (mi->bank[i].highmem)
@@ -320,24 +229,23 @@ static void __init bootmem_free_node(int node, struct meminfo *mi)
         * Adjust the sizes according to any special requirements for
         * this machine type.
         */
-       arch_adjust_zones(node, zone_size, zhole_size);
+       arch_adjust_zones(zone_size, zhole_size);
 
-       free_area_init_node(node, zone_size, min, zhole_size);
+       free_area_init_node(0, zone_size, min, zhole_size);
 }
 
 #ifndef CONFIG_SPARSEMEM
 int pfn_valid(unsigned long pfn)
 {
-       struct meminfo *mi = &meminfo;
-       unsigned int left = 0, right = mi->nr_banks;
+       struct memblock_region *mem = &memblock.memory;
+       unsigned int left = 0, right = mem->cnt;
 
        do {
                unsigned int mid = (right + left) / 2;
-               struct membank *bank = &mi->bank[mid];
 
-               if (pfn < bank_pfn_start(bank))
+               if (pfn < memblock_start_pfn(mem, mid))
                        right = mid;
-               else if (pfn >= bank_pfn_end(bank))
+               else if (pfn >= memblock_end_pfn(mem, mid))
                        left = mid + 1;
                else
                        return 1;
@@ -346,73 +254,69 @@ int pfn_valid(unsigned long pfn)
 }
 EXPORT_SYMBOL(pfn_valid);
 
-static void arm_memory_present(struct meminfo *mi, int node)
+static void arm_memory_present(void)
 {
 }
 #else
-static void arm_memory_present(struct meminfo *mi, int node)
+static void arm_memory_present(void)
 {
        int i;
-       for_each_nodebank(i, mi, node) {
-               struct membank *bank = &mi->bank[i];
-               memory_present(node, bank_pfn_start(bank), bank_pfn_end(bank));
-       }
+       for (i = 0; i < memblock.memory.cnt; i++)
+               memory_present(0, memblock_start_pfn(&memblock.memory, i),
+                                 memblock_end_pfn(&memblock.memory, i));
 }
 #endif
 
-void __init bootmem_init(void)
+void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
 {
-       struct meminfo *mi = &meminfo;
-       unsigned long min, max_low, max_high;
-       int node, initrd_node;
+       int i;
 
-       /*
-        * Locate which node contains the ramdisk image, if any.
-        */
-       initrd_node = check_initrd(mi);
+       memblock_init();
+       for (i = 0; i < mi->nr_banks; i++)
+               memblock_add(mi->bank[i].start, mi->bank[i].size);
 
-       max_low = max_high = 0;
+       /* Register the kernel text, kernel data and initrd with memblock. */
+#ifdef CONFIG_XIP_KERNEL
+       memblock_reserve(__pa(_data), _end - _data);
+#else
+       memblock_reserve(__pa(_stext), _end - _stext);
+#endif
+#ifdef CONFIG_BLK_DEV_INITRD
+       if (phys_initrd_size) {
+               memblock_reserve(phys_initrd_start, phys_initrd_size);
 
-       /*
-        * Run through each node initialising the bootmem allocator.
-        */
-       for_each_node(node) {
-               unsigned long node_low, node_high;
+               /* Now convert initrd to virtual addresses */
+               initrd_start = __phys_to_virt(phys_initrd_start);
+               initrd_end = initrd_start + phys_initrd_size;
+       }
+#endif
 
-               find_node_limits(node, mi, &min, &node_low, &node_high);
+       arm_mm_memblock_reserve();
 
-               if (node_low > max_low)
-                       max_low = node_low;
-               if (node_high > max_high)
-                       max_high = node_high;
+       /* reserve any platform specific memblock areas */
+       if (mdesc->reserve)
+               mdesc->reserve();
 
-               /*
-                * If there is no memory in this node, ignore it.
-                * (We can't have nodes which have no lowmem)
-                */
-               if (node_low == 0)
-                       continue;
+       memblock_analyze();
+       memblock_dump_all();
+}
 
-               bootmem_init_node(node, mi, min, node_low);
+void __init bootmem_init(void)
+{
+       struct meminfo *mi = &meminfo;
+       unsigned long min, max_low, max_high;
 
-               /*
-                * Reserve any special node zero regions.
-                */
-               if (node == 0)
-                       reserve_node_zero(NODE_DATA(node));
+       max_low = max_high = 0;
 
-               /*
-                * If the initrd is in this node, reserve its memory.
-                */
-               if (node == initrd_node)
-                       bootmem_reserve_initrd(node);
+       find_limits(mi, &min, &max_low, &max_high);
 
-               /*
-                * Sparsemem tries to allocate bootmem in memory_present(),
-                * so must be done after the fixed reservations
-                */
-               arm_memory_present(mi, node);
-       }
+       arm_bootmem_init(mi, min, max_low);
+
+       /*
+        * Sparsemem tries to allocate bootmem in memory_present(),
+        * so must be done after the fixed reservations
+        */
+       arm_memory_present();
 
        /*
         * sparse_init() needs the bootmem allocator up and running.
@@ -420,12 +324,11 @@ void __init bootmem_init(void)
        sparse_init();
 
        /*
-        * Now free memory in each node - free_area_init_node needs
+        * Now free the memory - free_area_init_node needs
         * the sparse mem_map arrays initialized by sparse_init()
         * for memmap_init_zone(), otherwise all PFNs are invalid.
         */
-       for_each_node(node)
-               bootmem_free_node(node, mi);
+       arm_bootmem_free(mi, min, max_low, max_high);
 
        high_memory = __va((max_low << PAGE_SHIFT) - 1) + 1;
 
@@ -460,7 +363,7 @@ static inline int free_area(unsigned long pfn, unsigned long end, char *s)
 }
 
 static inline void
-free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn)
+free_memmap(unsigned long start_pfn, unsigned long end_pfn)
 {
        struct page *start_pg, *end_pg;
        unsigned long pg, pgend;
@@ -483,13 +386,13 @@ free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn)
         * free the section of the memmap array.
         */
        if (pg < pgend)
-               free_bootmem_node(NODE_DATA(node), pg, pgend - pg);
+               free_bootmem(pg, pgend - pg);
 }
 
 /*
  * The mem_map array can get very big.  Free the unused area of the memory map.
  */
-static void __init free_unused_memmap_node(int node, struct meminfo *mi)
+static void __init free_unused_memmap(struct meminfo *mi)
 {
        unsigned long bank_start, prev_bank_end = 0;
        unsigned int i;
@@ -499,7 +402,7 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi)
         * may not be the case, especially if the user has provided the
         * information on the command line.
         */
-       for_each_nodebank(i, mi, node) {
+       for_each_bank(i, mi) {
                struct membank *bank = &mi->bank[i];
 
                bank_start = bank_pfn_start(bank);
@@ -514,7 +417,7 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi)
                 * between the current bank and the previous, free it.
                 */
                if (prev_bank_end && prev_bank_end != bank_start)
-                       free_memmap(node, prev_bank_end, bank_start);
+                       free_memmap(prev_bank_end, bank_start);
 
                prev_bank_end = bank_pfn_end(bank);
        }
@@ -528,26 +431,19 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi)
 void __init mem_init(void)
 {
        unsigned long reserved_pages, free_pages;
-       int i, node;
+       int i;
 #ifdef CONFIG_HAVE_TCM
        /* These pointers are filled in on TCM detection */
        extern u32 dtcm_end;
        extern u32 itcm_end;
 #endif
 
-#ifndef CONFIG_DISCONTIGMEM
        max_mapnr   = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
-#endif
 
        /* this will put all unused low memory onto the freelists */
-       for_each_online_node(node) {
-               pg_data_t *pgdat = NODE_DATA(node);
-
-               free_unused_memmap_node(node, &meminfo);
+       free_unused_memmap(&meminfo);
 
-               if (pgdat->node_spanned_pages != 0)
-                       totalram_pages += free_all_bootmem_node(pgdat);
-       }
+       totalram_pages += free_all_bootmem();
 
 #ifdef CONFIG_SA1111
        /* now that our DMA memory is actually so designated, we can free it */
@@ -557,39 +453,35 @@ void __init mem_init(void)
 
 #ifdef CONFIG_HIGHMEM
        /* set highmem page free */
-       for_each_online_node(node) {
-               for_each_nodebank (i, &meminfo, node) {
-                       unsigned long start = bank_pfn_start(&meminfo.bank[i]);
-                       unsigned long end = bank_pfn_end(&meminfo.bank[i]);
-                       if (start >= max_low_pfn + PHYS_PFN_OFFSET)
-                               totalhigh_pages += free_area(start, end, NULL);
-               }
+       for_each_bank (i, &meminfo) {
+               unsigned long start = bank_pfn_start(&meminfo.bank[i]);
+               unsigned long end = bank_pfn_end(&meminfo.bank[i]);
+               if (start >= max_low_pfn + PHYS_PFN_OFFSET)
+                       totalhigh_pages += free_area(start, end, NULL);
        }
        totalram_pages += totalhigh_pages;
 #endif
 
        reserved_pages = free_pages = 0;
 
-       for_each_online_node(node) {
-               for_each_nodebank(i, &meminfo, node) {
-                       struct membank *bank = &meminfo.bank[i];
-                       unsigned int pfn1, pfn2;
-                       struct page *page, *end;
-
-                       pfn1 = bank_pfn_start(bank);
-                       pfn2 = bank_pfn_end(bank);
-
-                       page = pfn_to_page(pfn1);
-                       end  = pfn_to_page(pfn2 - 1) + 1;
-
-                       do {
-                               if (PageReserved(page))
-                                       reserved_pages++;
-                               else if (!page_count(page))
-                                       free_pages++;
-                               page++;
-                       } while (page < end);
-               }
+       for_each_bank(i, &meminfo) {
+               struct membank *bank = &meminfo.bank[i];
+               unsigned int pfn1, pfn2;
+               struct page *page, *end;
+
+               pfn1 = bank_pfn_start(bank);
+               pfn2 = bank_pfn_end(bank);
+
+               page = pfn_to_page(pfn1);
+               end  = pfn_to_page(pfn2 - 1) + 1;
+
+               do {
+                       if (PageReserved(page))
+                               reserved_pages++;
+                       else if (!page_count(page))
+                               free_pages++;
+                       page++;
+               } while (page < end);
        }
 
        /*
index 815d08eecbb0f69a15a46f6990c481fd49dae779..6630620380a4aa0f538aed006a2de6f04c71d3dd 100644 (file)
@@ -28,7 +28,5 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
 
 #endif
 
-struct pglist_data;
-
 void __init bootmem_init(void);
-void reserve_node_zero(struct pglist_data *pgdat);
+void arm_mm_memblock_reserve(void);
index e53480148c05509688e0e2b3556379dfe6c0d09c..6e1c4f6a2b3f3a09ed3f10be9aeafab36c9a0924 100644 (file)
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
-#include <linux/bootmem.h>
 #include <linux/mman.h>
 #include <linux/nodemask.h>
+#include <linux/memblock.h>
 #include <linux/sort.h>
 
 #include <asm/cputype.h>
-#include <asm/mach-types.h>
 #include <asm/sections.h>
 #include <asm/cachetype.h>
 #include <asm/setup.h>
@@ -501,18 +500,28 @@ static void __init build_mem_type_table(void)
 
 #define vectors_base() (vectors_high() ? 0xffff0000 : 0)
 
-static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
-                                 unsigned long end, unsigned long pfn,
-                                 const struct mem_type *type)
+static void __init *early_alloc(unsigned long sz)
 {
-       pte_t *pte;
+       void *ptr = __va(memblock_alloc(sz, sz));
+       memset(ptr, 0, sz);
+       return ptr;
+}
 
+static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot)
+{
        if (pmd_none(*pmd)) {
-               pte = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * sizeof(pte_t));
-               __pmd_populate(pmd, __pa(pte) | type->prot_l1);
+               pte_t *pte = early_alloc(2 * PTRS_PER_PTE * sizeof(pte_t));
+               __pmd_populate(pmd, __pa(pte) | prot);
        }
+       BUG_ON(pmd_bad(*pmd));
+       return pte_offset_kernel(pmd, addr);
+}
 
-       pte = pte_offset_kernel(pmd, addr);
+static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
+                                 unsigned long end, unsigned long pfn,
+                                 const struct mem_type *type)
+{
+       pte_t *pte = early_pte_alloc(pmd, addr, type->prot_l1);
        do {
                set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)), 0);
                pfn++;
@@ -681,7 +690,7 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
                create_mapping(io_desc + i);
 }
 
-static unsigned long __initdata vmalloc_reserve = SZ_128M;
+static void * __initdata vmalloc_min = (void *)(VMALLOC_END - SZ_128M);
 
 /*
  * vmalloc=size forces the vmalloc area to be exactly 'size'
@@ -690,7 +699,7 @@ static unsigned long __initdata vmalloc_reserve = SZ_128M;
  */
 static int __init early_vmalloc(char *arg)
 {
-       vmalloc_reserve = memparse(arg, NULL);
+       unsigned long vmalloc_reserve = memparse(arg, NULL);
 
        if (vmalloc_reserve < SZ_16M) {
                vmalloc_reserve = SZ_16M;
@@ -705,22 +714,26 @@ static int __init early_vmalloc(char *arg)
                        "vmalloc area is too big, limiting to %luMB\n",
                        vmalloc_reserve >> 20);
        }
+
+       vmalloc_min = (void *)(VMALLOC_END - vmalloc_reserve);
        return 0;
 }
 early_param("vmalloc", early_vmalloc);
 
-#define VMALLOC_MIN    (void *)(VMALLOC_END - vmalloc_reserve)
+phys_addr_t lowmem_end_addr;
 
 static void __init sanity_check_meminfo(void)
 {
        int i, j, highmem = 0;
 
+       lowmem_end_addr = __pa(vmalloc_min - 1) + 1;
+
        for (i = 0, j = 0; i < meminfo.nr_banks; i++) {
                struct membank *bank = &meminfo.bank[j];
                *bank = meminfo.bank[i];
 
 #ifdef CONFIG_HIGHMEM
-               if (__va(bank->start) > VMALLOC_MIN ||
+               if (__va(bank->start) > vmalloc_min ||
                    __va(bank->start) < (void *)PAGE_OFFSET)
                        highmem = 1;
 
@@ -730,8 +743,8 @@ static void __init sanity_check_meminfo(void)
                 * Split those memory banks which are partially overlapping
                 * the vmalloc area greatly simplifying things later.
                 */
-               if (__va(bank->start) < VMALLOC_MIN &&
-                   bank->size > VMALLOC_MIN - __va(bank->start)) {
+               if (__va(bank->start) < vmalloc_min &&
+                   bank->size > vmalloc_min - __va(bank->start)) {
                        if (meminfo.nr_banks >= NR_BANKS) {
                                printk(KERN_CRIT "NR_BANKS too low, "
                                                 "ignoring high memory\n");
@@ -740,12 +753,12 @@ static void __init sanity_check_meminfo(void)
                                        (meminfo.nr_banks - i) * sizeof(*bank));
                                meminfo.nr_banks++;
                                i++;
-                               bank[1].size -= VMALLOC_MIN - __va(bank->start);
-                               bank[1].start = __pa(VMALLOC_MIN - 1) + 1;
+                               bank[1].size -= vmalloc_min - __va(bank->start);
+                               bank[1].start = __pa(vmalloc_min - 1) + 1;
                                bank[1].highmem = highmem = 1;
                                j++;
                        }
-                       bank->size = VMALLOC_MIN - __va(bank->start);
+                       bank->size = vmalloc_min - __va(bank->start);
                }
 #else
                bank->highmem = highmem;
@@ -754,7 +767,7 @@ static void __init sanity_check_meminfo(void)
                 * Check whether this memory bank would entirely overlap
                 * the vmalloc area.
                 */
-               if (__va(bank->start) >= VMALLOC_MIN ||
+               if (__va(bank->start) >= vmalloc_min ||
                    __va(bank->start) < (void *)PAGE_OFFSET) {
                        printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx "
                               "(vmalloc region overlap).\n",
@@ -766,9 +779,9 @@ static void __init sanity_check_meminfo(void)
                 * Check whether this memory bank would partially overlap
                 * the vmalloc area.
                 */
-               if (__va(bank->start + bank->size) > VMALLOC_MIN ||
+               if (__va(bank->start + bank->size) > vmalloc_min ||
                    __va(bank->start + bank->size) < __va(bank->start)) {
-                       unsigned long newsize = VMALLOC_MIN - __va(bank->start);
+                       unsigned long newsize = vmalloc_min - __va(bank->start);
                        printk(KERN_NOTICE "Truncating RAM at %.8lx-%.8lx "
                               "to -%.8lx (vmalloc region overlap).\n",
                               bank->start, bank->start + bank->size - 1,
@@ -840,101 +853,23 @@ static inline void prepare_page_table(void)
 }
 
 /*
- * Reserve the various regions of node 0
+ * Reserve the special regions of memory
  */
-void __init reserve_node_zero(pg_data_t *pgdat)
+void __init arm_mm_memblock_reserve(void)
 {
-       unsigned long res_size = 0;
-
-       /*
-        * Register the kernel text and data with bootmem.
-        * Note that this can only be in node 0.
-        */
-#ifdef CONFIG_XIP_KERNEL
-       reserve_bootmem_node(pgdat, __pa(_data), _end - _data,
-                       BOOTMEM_DEFAULT);
-#else
-       reserve_bootmem_node(pgdat, __pa(_stext), _end - _stext,
-                       BOOTMEM_DEFAULT);
-#endif
-
        /*
         * Reserve the page tables.  These are already in use,
         * and can only be in node 0.
         */
-       reserve_bootmem_node(pgdat, __pa(swapper_pg_dir),
-                            PTRS_PER_PGD * sizeof(pgd_t), BOOTMEM_DEFAULT);
-
-       /*
-        * Hmm... This should go elsewhere, but we really really need to
-        * stop things allocating the low memory; ideally we need a better
-        * implementation of GFP_DMA which does not assume that DMA-able
-        * memory starts at zero.
-        */
-       if (machine_is_integrator() || machine_is_cintegrator())
-               res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
-
-       /*
-        * These should likewise go elsewhere.  They pre-reserve the
-        * screen memory region at the start of main system memory.
-        */
-       if (machine_is_edb7211())
-               res_size = 0x00020000;
-       if (machine_is_p720t())
-               res_size = 0x00014000;
-
-       /* H1940, RX3715 and RX1950 need to reserve this for suspend */
-
-       if (machine_is_h1940() || machine_is_rx3715()
-               || machine_is_rx1950()) {
-               reserve_bootmem_node(pgdat, 0x30003000, 0x1000,
-                               BOOTMEM_DEFAULT);
-               reserve_bootmem_node(pgdat, 0x30081000, 0x1000,
-                               BOOTMEM_DEFAULT);
-       }
-
-       if (machine_is_palmld() || machine_is_palmtx()) {
-               reserve_bootmem_node(pgdat, 0xa0000000, 0x1000,
-                               BOOTMEM_EXCLUSIVE);
-               reserve_bootmem_node(pgdat, 0xa0200000, 0x1000,
-                               BOOTMEM_EXCLUSIVE);
-       }
-
-       if (machine_is_treo680() || machine_is_centro()) {
-               reserve_bootmem_node(pgdat, 0xa0000000, 0x1000,
-                               BOOTMEM_EXCLUSIVE);
-               reserve_bootmem_node(pgdat, 0xa2000000, 0x1000,
-                               BOOTMEM_EXCLUSIVE);
-       }
-
-       if (machine_is_palmt5())
-               reserve_bootmem_node(pgdat, 0xa0200000, 0x1000,
-                               BOOTMEM_EXCLUSIVE);
-
-       /*
-        * U300 - This platform family can share physical memory
-        * between two ARM cpus, one running Linux and the other
-        * running another OS.
-        */
-       if (machine_is_u300()) {
-#ifdef CONFIG_MACH_U300_SINGLE_RAM
-#if ((CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1) == 1) &&   \
-       CONFIG_MACH_U300_2MB_ALIGNMENT_FIX
-               res_size = 0x00100000;
-#endif
-#endif
-       }
+       memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t));
 
 #ifdef CONFIG_SA1111
        /*
         * Because of the SA1111 DMA bug, we want to preserve our
         * precious DMA-able memory...
         */
-       res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
+       memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET);
 #endif
-       if (res_size)
-               reserve_bootmem_node(pgdat, PHYS_OFFSET, res_size,
-                               BOOTMEM_DEFAULT);
 }
 
 /*
@@ -953,7 +888,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
        /*
         * Allocate the vector page early.
         */
-       vectors = alloc_bootmem_low_pages(PAGE_SIZE);
+       vectors = early_alloc(PAGE_SIZE);
 
        for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE)
                pmd_clear(pmd_off_k(addr));
@@ -1024,11 +959,8 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
 static void __init kmap_init(void)
 {
 #ifdef CONFIG_HIGHMEM
-       pmd_t *pmd = pmd_off_k(PKMAP_BASE);
-       pte_t *pte = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * sizeof(pte_t));
-       BUG_ON(!pmd_none(*pmd) || !pte);
-       __pmd_populate(pmd, __pa(pte) | _PAGE_KERNEL_TABLE);
-       pkmap_page_table = pte + PTRS_PER_PTE;
+       pkmap_page_table = early_pte_alloc(pmd_off_k(PKMAP_BASE),
+               PKMAP_BASE, _PAGE_KERNEL_TABLE);
 #endif
 }
 
@@ -1079,17 +1011,16 @@ void __init paging_init(struct machine_desc *mdesc)
        sanity_check_meminfo();
        prepare_page_table();
        map_lowmem();
-       bootmem_init();
        devicemaps_init(mdesc);
        kmap_init();
 
        top_pmd = pmd_off_k(0xffff0000);
 
-       /*
-        * allocate the zero page.  Note that this always succeeds and
-        * returns a zeroed result.
-        */
-       zero_page = alloc_bootmem_low_pages(PAGE_SIZE);
+       /* allocate the zero page. */
+       zero_page = early_alloc(PAGE_SIZE);
+
+       bootmem_init();
+
        empty_zero_page = virt_to_page(zero_page);
        __flush_dcache_page(NULL, empty_zero_page);
 }
index 33b327379f0756e14eff3d9f0cd23a2f022eb112..687d02319a41ea68afcfe65698204a4db84d8400 100644 (file)
@@ -6,8 +6,8 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/pagemap.h>
-#include <linux/bootmem.h>
 #include <linux/io.h>
+#include <linux/memblock.h>
 
 #include <asm/cacheflush.h>
 #include <asm/sections.h>
 
 #include "mm.h"
 
-/*
- * Reserve the various regions of node 0
- */
-void __init reserve_node_zero(pg_data_t *pgdat)
+void __init arm_mm_memblock_reserve(void)
 {
-       /*
-        * Register the kernel text and data with bootmem.
-        * Note that this can only be in node 0.
-        */
-#ifdef CONFIG_XIP_KERNEL
-       reserve_bootmem_node(pgdat, __pa(_data), _end - _data,
-                       BOOTMEM_DEFAULT);
-#else
-       reserve_bootmem_node(pgdat, __pa(_stext), _end - _stext,
-                       BOOTMEM_DEFAULT);
-#endif
-
        /*
         * Register the exception vector page.
         * some architectures which the DRAM is the exception vector to trap,
         * alloc_page breaks with error, although it is not NULL, but "0."
         */
-       reserve_bootmem_node(pgdat, CONFIG_VECTORS_BASE, PAGE_SIZE,
-                       BOOTMEM_DEFAULT);
+       memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);
 }
 
 /*
index 6c8a02ad98e33f9a374fd62c58c5ea7630427f0c..85d3e55ca4a9c293c67d4b2557bb52d90f93d22f 100644 (file)
 #include <asm/mach/time.h>
 #include <mach/time.h>
 
+/*
+ * Minimum clocksource/clockevent timer range in seconds
+ */
+#define IOP_MIN_RANGE 4
+
 /*
  * IOP clocksource (free-running timer 1).
  */
@@ -44,27 +49,6 @@ static struct clocksource iop_clocksource = {
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-static void __init iop_clocksource_set_hz(struct clocksource *cs, unsigned int hz)
-{
-       u64 temp;
-       u32 shift;
-
-       /* Find shift and mult values for hz. */
-       shift = 32;
-       do {
-               temp = (u64) NSEC_PER_SEC << shift;
-               do_div(temp, hz);
-               if ((temp >> 32) == 0)
-                       break;
-       } while (--shift != 0);
-
-       cs->shift = shift;
-       cs->mult = (u32) temp;
-
-       printk(KERN_INFO "clocksource: %s uses shift %u mult %#x\n",
-              cs->name, cs->shift, cs->mult);
-}
-
 /*
  * IOP sched_clock() implementation via its clocksource.
  */
@@ -130,27 +114,6 @@ static struct clock_event_device iop_clockevent = {
        .set_mode       = iop_set_mode,
 };
 
-static void __init iop_clockevent_set_hz(struct clock_event_device *ce, unsigned int hz)
-{
-       u64 temp;
-       u32 shift;
-
-       /* Find shift and mult values for hz. */
-       shift = 32;
-       do {
-               temp = (u64) hz << shift;
-               do_div(temp, NSEC_PER_SEC);
-               if ((temp >> 32) == 0)
-                       break;
-       } while (--shift != 0);
-
-       ce->shift = shift;
-       ce->mult = (u32) temp;
-
-       printk(KERN_INFO "clockevent: %s uses shift %u mult %#lx\n",
-              ce->name, ce->shift, ce->mult);
-}
-
 static irqreturn_t
 iop_timer_interrupt(int irq, void *dev_id)
 {
@@ -190,7 +153,8 @@ void __init iop_init_time(unsigned long tick_rate)
         */
        write_tmr0(timer_ctl & ~IOP_TMR_EN);
        setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq);
-       iop_clockevent_set_hz(&iop_clockevent, tick_rate);
+       clockevents_calc_mult_shift(&iop_clockevent,
+                                   tick_rate, IOP_MIN_RANGE);
        iop_clockevent.max_delta_ns =
                clockevent_delta2ns(0xfffffffe, &iop_clockevent);
        iop_clockevent.min_delta_ns =
@@ -207,6 +171,7 @@ void __init iop_init_time(unsigned long tick_rate)
        write_trr1(0xffffffff);
        write_tcr1(0xffffffff);
        write_tmr1(timer_ctl);
-       iop_clocksource_set_hz(&iop_clocksource, tick_rate);
+       clocksource_calc_mult_shift(&iop_clocksource, tick_rate,
+                                   IOP_MIN_RANGE);
        clocksource_register(&iop_clocksource);
 }
index 5a6ef252c38b37732d36e8dc52c97b96d9385604..977c8f9a07a2194322deada32da2afd0481d50ad 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/irq.h>
 #include <linux/slab.h>
 
+#include <plat/pincfg.h>
 #include <mach/hardware.h>
 #include <mach/gpio.h>
 
@@ -46,28 +47,217 @@ struct nmk_gpio_chip {
        u32 edge_falling;
 };
 
+static void __nmk_gpio_set_mode(struct nmk_gpio_chip *nmk_chip,
+                               unsigned offset, int gpio_mode)
+{
+       u32 bit = 1 << offset;
+       u32 afunc, bfunc;
+
+       afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & ~bit;
+       bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & ~bit;
+       if (gpio_mode & NMK_GPIO_ALT_A)
+               afunc |= bit;
+       if (gpio_mode & NMK_GPIO_ALT_B)
+               bfunc |= bit;
+       writel(afunc, nmk_chip->addr + NMK_GPIO_AFSLA);
+       writel(bfunc, nmk_chip->addr + NMK_GPIO_AFSLB);
+}
+
+static void __nmk_gpio_set_slpm(struct nmk_gpio_chip *nmk_chip,
+                               unsigned offset, enum nmk_gpio_slpm mode)
+{
+       u32 bit = 1 << offset;
+       u32 slpm;
+
+       slpm = readl(nmk_chip->addr + NMK_GPIO_SLPC);
+       if (mode == NMK_GPIO_SLPM_NOCHANGE)
+               slpm |= bit;
+       else
+               slpm &= ~bit;
+       writel(slpm, nmk_chip->addr + NMK_GPIO_SLPC);
+}
+
+static void __nmk_gpio_set_pull(struct nmk_gpio_chip *nmk_chip,
+                               unsigned offset, enum nmk_gpio_pull pull)
+{
+       u32 bit = 1 << offset;
+       u32 pdis;
+
+       pdis = readl(nmk_chip->addr + NMK_GPIO_PDIS);
+       if (pull == NMK_GPIO_PULL_NONE)
+               pdis |= bit;
+       else
+               pdis &= ~bit;
+       writel(pdis, nmk_chip->addr + NMK_GPIO_PDIS);
+
+       if (pull == NMK_GPIO_PULL_UP)
+               writel(bit, nmk_chip->addr + NMK_GPIO_DATS);
+       else if (pull == NMK_GPIO_PULL_DOWN)
+               writel(bit, nmk_chip->addr + NMK_GPIO_DATC);
+}
+
+static void __nmk_gpio_make_input(struct nmk_gpio_chip *nmk_chip,
+                                 unsigned offset)
+{
+       writel(1 << offset, nmk_chip->addr + NMK_GPIO_DIRC);
+}
+
+static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset,
+                            pin_cfg_t cfg)
+{
+       static const char *afnames[] = {
+               [NMK_GPIO_ALT_GPIO]     = "GPIO",
+               [NMK_GPIO_ALT_A]        = "A",
+               [NMK_GPIO_ALT_B]        = "B",
+               [NMK_GPIO_ALT_C]        = "C"
+       };
+       static const char *pullnames[] = {
+               [NMK_GPIO_PULL_NONE]    = "none",
+               [NMK_GPIO_PULL_UP]      = "up",
+               [NMK_GPIO_PULL_DOWN]    = "down",
+               [3] /* illegal */       = "??"
+       };
+       static const char *slpmnames[] = {
+               [NMK_GPIO_SLPM_INPUT]           = "input",
+               [NMK_GPIO_SLPM_NOCHANGE]        = "no-change",
+       };
+
+       int pin = PIN_NUM(cfg);
+       int pull = PIN_PULL(cfg);
+       int af = PIN_ALT(cfg);
+       int slpm = PIN_SLPM(cfg);
+
+       dev_dbg(nmk_chip->chip.dev, "pin %d: af %s, pull %s, slpm %s\n",
+               pin, afnames[af], pullnames[pull], slpmnames[slpm]);
+
+       __nmk_gpio_make_input(nmk_chip, offset);
+       __nmk_gpio_set_pull(nmk_chip, offset, pull);
+       __nmk_gpio_set_slpm(nmk_chip, offset, slpm);
+       __nmk_gpio_set_mode(nmk_chip, offset, af);
+}
+
+/**
+ * nmk_config_pin - configure a pin's mux attributes
+ * @cfg: pin confguration
+ *
+ * Configures a pin's mode (alternate function or GPIO), its pull up status,
+ * and its sleep mode based on the specified configuration.  The @cfg is
+ * usually one of the SoC specific macros defined in mach/<soc>-pins.h.  These
+ * are constructed using, and can be further enhanced with, the macros in
+ * plat/pincfg.h.
+ *
+ * If a pin's mode is set to GPIO, it is configured as an input to avoid
+ * side-effects.  The gpio can be manipulated later using standard GPIO API
+ * calls.
+ */
+int nmk_config_pin(pin_cfg_t cfg)
+{
+       struct nmk_gpio_chip *nmk_chip;
+       int gpio = PIN_NUM(cfg);
+       unsigned long flags;
+
+       nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
+       if (!nmk_chip)
+               return -EINVAL;
+
+       spin_lock_irqsave(&nmk_chip->lock, flags);
+       __nmk_config_pin(nmk_chip, gpio - nmk_chip->chip.base, cfg);
+       spin_unlock_irqrestore(&nmk_chip->lock, flags);
+
+       return 0;
+}
+EXPORT_SYMBOL(nmk_config_pin);
+
+/**
+ * nmk_config_pins - configure several pins at once
+ * @cfgs: array of pin configurations
+ * @num: number of elments in the array
+ *
+ * Configures several pins using nmk_config_pin().  Refer to that function for
+ * further information.
+ */
+int nmk_config_pins(pin_cfg_t *cfgs, int num)
+{
+       int ret = 0;
+       int i;
+
+       for (i = 0; i < num; i++) {
+               int ret = nmk_config_pin(cfgs[i]);
+               if (ret)
+                       break;
+       }
+
+       return ret;
+}
+EXPORT_SYMBOL(nmk_config_pins);
+
+/**
+ * nmk_gpio_set_slpm() - configure the sleep mode of a pin
+ * @gpio: pin number
+ * @mode: NMK_GPIO_SLPM_INPUT or NMK_GPIO_SLPM_NOCHANGE,
+ *
+ * Sets the sleep mode of a pin.  If @mode is NMK_GPIO_SLPM_INPUT, the pin is
+ * changed to an input (with pullup/down enabled) in sleep and deep sleep.  If
+ * @mode is NMK_GPIO_SLPM_NOCHANGE, the pin remains in the state it was
+ * configured even when in sleep and deep sleep.
+ */
+int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode)
+{
+       struct nmk_gpio_chip *nmk_chip;
+       unsigned long flags;
+
+       nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
+       if (!nmk_chip)
+               return -EINVAL;
+
+       spin_lock_irqsave(&nmk_chip->lock, flags);
+       __nmk_gpio_set_slpm(nmk_chip, gpio - nmk_chip->chip.base, mode);
+       spin_unlock_irqrestore(&nmk_chip->lock, flags);
+
+       return 0;
+}
+
+/**
+ * nmk_gpio_set_pull() - enable/disable pull up/down on a gpio
+ * @gpio: pin number
+ * @pull: one of NMK_GPIO_PULL_DOWN, NMK_GPIO_PULL_UP, and NMK_GPIO_PULL_NONE
+ *
+ * Enables/disables pull up/down on a specified pin.  This only takes effect if
+ * the pin is configured as an input (either explicitly or by the alternate
+ * function).
+ *
+ * NOTE: If enabling the pull up/down, the caller must ensure that the GPIO is
+ * configured as an input.  Otherwise, due to the way the controller registers
+ * work, this function will change the value output on the pin.
+ */
+int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull)
+{
+       struct nmk_gpio_chip *nmk_chip;
+       unsigned long flags;
+
+       nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
+       if (!nmk_chip)
+               return -EINVAL;
+
+       spin_lock_irqsave(&nmk_chip->lock, flags);
+       __nmk_gpio_set_pull(nmk_chip, gpio - nmk_chip->chip.base, pull);
+       spin_unlock_irqrestore(&nmk_chip->lock, flags);
+
+       return 0;
+}
+
 /* Mode functions */
 int nmk_gpio_set_mode(int gpio, int gpio_mode)
 {
        struct nmk_gpio_chip *nmk_chip;
        unsigned long flags;
-       u32 afunc, bfunc, bit;
 
        nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
        if (!nmk_chip)
                return -EINVAL;
 
-       bit = 1 << (gpio - nmk_chip->chip.base);
-
        spin_lock_irqsave(&nmk_chip->lock, flags);
-       afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & ~bit;
-       bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & ~bit;
-       if (gpio_mode & NMK_GPIO_ALT_A)
-               afunc |= bit;
-       if (gpio_mode & NMK_GPIO_ALT_B)
-               bfunc |= bit;
-       writel(afunc, nmk_chip->addr + NMK_GPIO_AFSLA);
-       writel(bfunc, nmk_chip->addr + NMK_GPIO_AFSLB);
+       __nmk_gpio_set_mode(nmk_chip, gpio - nmk_chip->chip.base, gpio_mode);
        spin_unlock_irqrestore(&nmk_chip->lock, flags);
 
        return 0;
@@ -111,32 +301,41 @@ static void nmk_gpio_irq_ack(unsigned int irq)
        writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC);
 }
 
+enum nmk_gpio_irq_type {
+       NORMAL,
+       WAKE,
+};
+
 static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip,
-                                 int gpio, bool enable)
+                                 int gpio, enum nmk_gpio_irq_type which,
+                                 bool enable)
 {
+       u32 rimsc = which == WAKE ? NMK_GPIO_RWIMSC : NMK_GPIO_RIMSC;
+       u32 fimsc = which == WAKE ? NMK_GPIO_FWIMSC : NMK_GPIO_FIMSC;
        u32 bitmask = nmk_gpio_get_bitmask(gpio);
        u32 reg;
 
        /* we must individually set/clear the two edges */
        if (nmk_chip->edge_rising & bitmask) {
-               reg = readl(nmk_chip->addr + NMK_GPIO_RIMSC);
+               reg = readl(nmk_chip->addr + rimsc);
                if (enable)
                        reg |= bitmask;
                else
                        reg &= ~bitmask;
-               writel(reg, nmk_chip->addr + NMK_GPIO_RIMSC);
+               writel(reg, nmk_chip->addr + rimsc);
        }
        if (nmk_chip->edge_falling & bitmask) {
-               reg = readl(nmk_chip->addr + NMK_GPIO_FIMSC);
+               reg = readl(nmk_chip->addr + fimsc);
                if (enable)
                        reg |= bitmask;
                else
                        reg &= ~bitmask;
-               writel(reg, nmk_chip->addr + NMK_GPIO_FIMSC);
+               writel(reg, nmk_chip->addr + fimsc);
        }
 }
 
-static void nmk_gpio_irq_modify(unsigned int irq, bool enable)
+static int nmk_gpio_irq_modify(unsigned int irq, enum nmk_gpio_irq_type which,
+                              bool enable)
 {
        int gpio;
        struct nmk_gpio_chip *nmk_chip;
@@ -147,26 +346,35 @@ static void nmk_gpio_irq_modify(unsigned int irq, bool enable)
        nmk_chip = get_irq_chip_data(irq);
        bitmask = nmk_gpio_get_bitmask(gpio);
        if (!nmk_chip)
-               return;
+               return -EINVAL;
 
        spin_lock_irqsave(&nmk_chip->lock, flags);
-       __nmk_gpio_irq_modify(nmk_chip, gpio, enable);
+       __nmk_gpio_irq_modify(nmk_chip, gpio, which, enable);
        spin_unlock_irqrestore(&nmk_chip->lock, flags);
+
+       return 0;
 }
 
 static void nmk_gpio_irq_mask(unsigned int irq)
 {
-       nmk_gpio_irq_modify(irq, false);
-};
+       nmk_gpio_irq_modify(irq, NORMAL, false);
+}
 
 static void nmk_gpio_irq_unmask(unsigned int irq)
 {
-       nmk_gpio_irq_modify(irq, true);
+       nmk_gpio_irq_modify(irq, NORMAL, true);
+}
+
+static int nmk_gpio_irq_set_wake(unsigned int irq, unsigned int on)
+{
+       return nmk_gpio_irq_modify(irq, WAKE, on);
 }
 
 static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
 {
-       bool enabled = !(irq_to_desc(irq)->status & IRQ_DISABLED);
+       struct irq_desc *desc = irq_to_desc(irq);
+       bool enabled = !(desc->status & IRQ_DISABLED);
+       bool wake = desc->wake_depth;
        int gpio;
        struct nmk_gpio_chip *nmk_chip;
        unsigned long flags;
@@ -186,7 +394,10 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
        spin_lock_irqsave(&nmk_chip->lock, flags);
 
        if (enabled)
-               __nmk_gpio_irq_modify(nmk_chip, gpio, false);
+               __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, false);
+
+       if (wake)
+               __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, false);
 
        nmk_chip->edge_rising &= ~bitmask;
        if (type & IRQ_TYPE_EDGE_RISING)
@@ -197,7 +408,10 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
                nmk_chip->edge_falling |= bitmask;
 
        if (enabled)
-               __nmk_gpio_irq_modify(nmk_chip, gpio, true);
+               __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, true);
+
+       if (wake)
+               __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, true);
 
        spin_unlock_irqrestore(&nmk_chip->lock, flags);
 
@@ -210,6 +424,7 @@ static struct irq_chip nmk_gpio_irq_chip = {
        .mask           = nmk_gpio_irq_mask,
        .unmask         = nmk_gpio_irq_unmask,
        .set_type       = nmk_gpio_irq_set_type,
+       .set_wake       = nmk_gpio_irq_set_wake,
 };
 
 static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
@@ -266,16 +481,6 @@ static int nmk_gpio_make_input(struct gpio_chip *chip, unsigned offset)
        return 0;
 }
 
-static int nmk_gpio_make_output(struct gpio_chip *chip, unsigned offset,
-                               int val)
-{
-       struct nmk_gpio_chip *nmk_chip =
-               container_of(chip, struct nmk_gpio_chip, chip);
-
-       writel(1 << offset, nmk_chip->addr + NMK_GPIO_DIRS);
-       return 0;
-}
-
 static int nmk_gpio_get_input(struct gpio_chip *chip, unsigned offset)
 {
        struct nmk_gpio_chip *nmk_chip =
@@ -298,12 +503,33 @@ static void nmk_gpio_set_output(struct gpio_chip *chip, unsigned offset,
                writel(bit, nmk_chip->addr + NMK_GPIO_DATC);
 }
 
+static int nmk_gpio_make_output(struct gpio_chip *chip, unsigned offset,
+                               int val)
+{
+       struct nmk_gpio_chip *nmk_chip =
+               container_of(chip, struct nmk_gpio_chip, chip);
+
+       writel(1 << offset, nmk_chip->addr + NMK_GPIO_DIRS);
+       nmk_gpio_set_output(chip, offset, val);
+
+       return 0;
+}
+
+static int nmk_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+       struct nmk_gpio_chip *nmk_chip =
+               container_of(chip, struct nmk_gpio_chip, chip);
+
+       return NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base) + offset;
+}
+
 /* This structure is replicated for each GPIO block allocated at probe time */
 static struct gpio_chip nmk_gpio_template = {
        .direction_input        = nmk_gpio_make_input,
        .get                    = nmk_gpio_get_input,
        .direction_output       = nmk_gpio_make_output,
        .set                    = nmk_gpio_set_output,
+       .to_irq                 = nmk_gpio_to_irq,
        .ngpio                  = NMK_GPIO_PER_CHIP,
        .can_sleep              = 0,
 };
@@ -393,30 +619,12 @@ out:
        return ret;
 }
 
-static int __exit nmk_gpio_remove(struct platform_device *dev)
-{
-       struct nmk_gpio_chip *nmk_chip;
-       struct resource *res;
-
-       res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-
-       nmk_chip = platform_get_drvdata(dev);
-       gpiochip_remove(&nmk_chip->chip);
-       clk_disable(nmk_chip->clk);
-       clk_put(nmk_chip->clk);
-       kfree(nmk_chip);
-       release_mem_region(res->start, resource_size(res));
-       return 0;
-}
-
-
 static struct platform_driver nmk_gpio_driver = {
        .driver = {
                .owner = THIS_MODULE,
                .name = "gpio",
                },
        .probe = nmk_gpio_probe,
-       .remove = __exit_p(nmk_gpio_remove),
        .suspend = NULL, /* to be done */
        .resume = NULL,
 };
@@ -426,7 +634,7 @@ static int __init nmk_gpio_init(void)
        return platform_driver_register(&nmk_gpio_driver);
 }
 
-arch_initcall(nmk_gpio_init);
+core_initcall(nmk_gpio_init);
 
 MODULE_AUTHOR("Prafulla WADASKAR and Alessandro Rubini");
 MODULE_DESCRIPTION("Nomadik GPIO Driver");
index 4200811249ca25180e9b2357ed58140f17cb9cd4..aba355101f492687e39e303fff8b26ceb761541e 100644 (file)
 #define NMK_GPIO_ALT_B 2
 #define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
 
+/* Pull up/down values */
+enum nmk_gpio_pull {
+       NMK_GPIO_PULL_NONE,
+       NMK_GPIO_PULL_UP,
+       NMK_GPIO_PULL_DOWN,
+};
+
+/* Sleep mode */
+enum nmk_gpio_slpm {
+       NMK_GPIO_SLPM_INPUT,
+       NMK_GPIO_SLPM_NOCHANGE,
+};
+
+extern int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode);
+extern int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull);
 extern int nmk_gpio_set_mode(int gpio, int gpio_mode);
 extern int nmk_gpio_get_mode(int gpio);
 
index 42c907258b14a04e34622d1ca99c638c5827631f..65704a3d42410890b044fd499cfba2ceaf067b9c 100644 (file)
@@ -1,6 +1,12 @@
 #ifndef __PLAT_MTU_H
 #define __PLAT_MTU_H
 
+/*
+ * Guaranteed runtime conversion range in seconds for
+ * the clocksource and clockevent.
+ */
+#define MTU_MIN_RANGE 4
+
 /* should be set by the platform code */
 extern void __iomem *mtu_base;
 
diff --git a/arch/arm/plat-nomadik/include/plat/pincfg.h b/arch/arm/plat-nomadik/include/plat/pincfg.h
new file mode 100644 (file)
index 0000000..7eed11c
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * License terms: GNU General Public License, version 2
+ * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
+ *
+ * Based on arch/arm/mach-pxa/include/mach/mfp.h:
+ *   Copyright (C) 2007 Marvell International Ltd.
+ *   eric miao <eric.miao@marvell.com>
+ */
+
+#ifndef __PLAT_PINCFG_H
+#define __PLAT_PINCFG_H
+
+/*
+ * pin configurations are represented by 32-bit integers:
+ *
+ *     bit  0.. 8 - Pin Number (512 Pins Maximum)
+ *     bit  9..10 - Alternate Function Selection
+ *     bit 11..12 - Pull up/down state
+ *     bit     13 - Sleep mode behaviour
+ *
+ * to facilitate the definition, the following macros are provided
+ *
+ * PIN_CFG_DEFAULT - default config (0):
+ *                  pull up/down = disabled
+ *                  sleep mode = input
+ *
+ * PIN_CFG        - default config with alternate function
+ * PIN_CFG_PULL           - default config with alternate function and pull up/down
+ */
+
+typedef unsigned long pin_cfg_t;
+
+#define PIN_NUM_MASK           0x1ff
+#define PIN_NUM(x)             ((x) & PIN_NUM_MASK)
+
+#define PIN_ALT_SHIFT          9
+#define PIN_ALT_MASK           (0x3 << PIN_ALT_SHIFT)
+#define PIN_ALT(x)             (((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT)
+#define PIN_GPIO               (NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT)
+#define PIN_ALT_A              (NMK_GPIO_ALT_A << PIN_ALT_SHIFT)
+#define PIN_ALT_B              (NMK_GPIO_ALT_B << PIN_ALT_SHIFT)
+#define PIN_ALT_C              (NMK_GPIO_ALT_C << PIN_ALT_SHIFT)
+
+#define PIN_PULL_SHIFT         11
+#define PIN_PULL_MASK          (0x3 << PIN_PULL_SHIFT)
+#define PIN_PULL(x)            (((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT)
+#define PIN_PULL_NONE          (NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT)
+#define PIN_PULL_UP            (NMK_GPIO_PULL_UP << PIN_PULL_SHIFT)
+#define PIN_PULL_DOWN          (NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT)
+
+#define PIN_SLPM_SHIFT         13
+#define PIN_SLPM_MASK          (0x1 << PIN_SLPM_SHIFT)
+#define PIN_SLPM(x)            (((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT)
+#define PIN_SLPM_INPUT         (NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT)
+#define PIN_SLPM_NOCHANGE      (NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT)
+
+#define PIN_CFG_DEFAULT                (PIN_PULL_NONE | PIN_SLPM_INPUT)
+
+#define PIN_CFG(num, alt)              \
+       (PIN_CFG_DEFAULT |\
+        (PIN_NUM(num) | PIN_##alt))
+
+#define PIN_CFG_PULL(num, alt, pull)   \
+       ((PIN_CFG_DEFAULT & ~PIN_PULL_MASK) |\
+        (PIN_NUM(num) | PIN_##alt | PIN_PULL_##pull))
+
+extern int nmk_config_pin(pin_cfg_t cfg);
+extern int nmk_config_pins(pin_cfg_t *cfgs, int num);
+
+#endif
index 08aaa4a7f65fe0e868b1a8cbfa8dd80d73209cec..ea3ca86c52836ba1ec9fe780da9c1629db91723f 100644 (file)
@@ -42,7 +42,6 @@ static struct clocksource nmdk_clksrc = {
        .rating         = 200,
        .read           = nmdk_read_timer_dummy,
        .mask           = CLOCKSOURCE_MASK(32),
-       .shift          = 20,
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
@@ -82,6 +81,12 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode,
        case CLOCK_EVT_MODE_UNUSED:
                /* disable irq */
                writel(0, mtu_base + MTU_IMSC);
+               /* disable timer */
+               cr = readl(mtu_base + MTU_CR(1));
+               cr &= ~MTU_CRn_ENA;
+               writel(cr, mtu_base + MTU_CR(1));
+               /* load some high default value */
+               writel(0xffffffff, mtu_base + MTU_LR(1));
                break;
        case CLOCK_EVT_MODE_RESUME:
                break;
@@ -98,7 +103,6 @@ static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev)
 static struct clock_event_device nmdk_clkevt = {
        .name           = "mtu_1",
        .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .rating         = 200,
        .set_mode       = nmdk_clkevt_mode,
        .set_next_event = nmdk_clkevt_next,
@@ -151,6 +155,7 @@ void __init nmdk_timer_init(void)
        } else {
                cr |= MTU_CRn_PRESCALE_1;
        }
+       clocksource_calc_mult_shift(&nmdk_clksrc, rate, MTU_MIN_RANGE);
 
        /* Timer 0 is the free running clocksource */
        writel(cr, mtu_base + MTU_CR(0));
@@ -158,7 +163,6 @@ void __init nmdk_timer_init(void)
        writel(0, mtu_base + MTU_BGLR(0));
        writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0));
 
-       nmdk_clksrc.mult = clocksource_hz2mult(rate, nmdk_clksrc.shift);
        /* Now the scheduling clock is ready */
        nmdk_clksrc.read = nmdk_read_timer;
 
@@ -175,8 +179,10 @@ void __init nmdk_timer_init(void)
        } else {
                cr |= MTU_CRn_PRESCALE_1;
        }
+       clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);
+
        writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */
-       nmdk_clkevt.mult = div_sc(rate, NSEC_PER_SEC, nmdk_clkevt.shift);
+
        nmdk_clkevt.max_delta_ns =
                clockevent_delta2ns(0xffffffff, &nmdk_clkevt);
        nmdk_clkevt.min_delta_ns =
index 219c01e82bc5a3cf70055f5e7593b0c115000e21..ebed82699eb2625b87898b6fcbc6f75bd44a9325 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/serial_reg.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/omapfb.h>
 
 #include <mach/hardware.h>
 #include <asm/system.h>
@@ -35,6 +36,7 @@
 #include <plat/mux.h>
 #include <plat/fpga.h>
 #include <plat/serial.h>
+#include <plat/vram.h>
 
 #include <plat/clock.h>
 
@@ -81,6 +83,12 @@ const void *omap_get_var_config(u16 tag, size_t *len)
 }
 EXPORT_SYMBOL(omap_get_var_config);
 
+void __init omap_reserve(void)
+{
+       omapfb_reserve_sdram_memblock();
+       omap_vram_reserve_sdram_memblock();
+}
+
 /*
  * 32KHz clocksource ... always available, on pretty most chips except
  * OMAP 730 and 1510.  Other timers could be used as clocksources, with
index d3eea4f47533050618ce2a0e489a79f5f2725088..0054b9501a53976a384cde437b43be7c03cc582a 100644 (file)
@@ -26,7 +26,7 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/bootmem.h>
+#include <linux/memblock.h>
 #include <linux/io.h>
 #include <linux/omapfb.h>
 
@@ -171,49 +171,78 @@ static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg,
        return 0;
 }
 
+static int valid_sdram(unsigned long addr, unsigned long size)
+{
+       struct memblock_property res;
+
+       res.base = addr;
+       res.size = size;
+       return !memblock_find(&res) && res.base == addr && res.size == size;
+}
+
+static int reserve_sdram(unsigned long addr, unsigned long size)
+{
+       if (memblock_is_region_reserved(addr, size))
+               return -EBUSY;
+       if (memblock_reserve(addr, size))
+               return -ENOMEM;
+       return 0;
+}
+
 /*
  * Called from map_io. We need to call to this early enough so that we
  * can reserve the fixed SDRAM regions before VM could get hold of them.
  */
-void __init omapfb_reserve_sdram(void)
+void __init omapfb_reserve_sdram_memblock(void)
 {
-       struct bootmem_data     *bdata;
-       unsigned long           sdram_start, sdram_size;
-       unsigned long           reserved;
-       int                     i;
+       unsigned long reserved = 0;
+       int i;
 
        if (config_invalid)
                return;
 
-       bdata = NODE_DATA(0)->bdata;
-       sdram_start = bdata->node_min_pfn << PAGE_SHIFT;
-       sdram_size = (bdata->node_low_pfn << PAGE_SHIFT) - sdram_start;
-       reserved = 0;
        for (i = 0; ; i++) {
-               struct omapfb_mem_region        rg;
+               struct omapfb_mem_region rg;
 
                if (get_fbmem_region(i, &rg) < 0)
                        break;
+
                if (i == OMAPFB_PLANE_NUM) {
-                       printk(KERN_ERR
-                               "Extraneous FB mem configuration entries\n");
+                       pr_err("Extraneous FB mem configuration entries\n");
                        config_invalid = 1;
                        return;
                }
+
                /* Check if it's our memory type. */
-               if (set_fbmem_region_type(&rg, OMAPFB_MEMTYPE_SDRAM,
-                                         sdram_start, sdram_size) < 0 ||
-                   (rg.type != OMAPFB_MEMTYPE_SDRAM))
+               if (rg.type != OMAPFB_MEMTYPE_SDRAM)
                        continue;
-               BUG_ON(omapfb_config.mem_desc.region[i].size);
-               if (check_fbmem_region(i, &rg, sdram_start, sdram_size) < 0) {
+
+               /* Check if the region falls within SDRAM */
+               if (rg.paddr && !valid_sdram(rg.paddr, rg.size))
+                       continue;
+
+               if (rg.size == 0) {
+                       pr_err("Zero size for FB region %d\n", i);
                        config_invalid = 1;
                        return;
                }
+
                if (rg.paddr) {
-                       reserve_bootmem(rg.paddr, rg.size, BOOTMEM_DEFAULT);
+                       if (reserve_sdram(rg.paddr, rg.size)) {
+                               pr_err("Trying to use reserved memory for FB region %d\n",
+                                       i);
+                               config_invalid = 1;
+                               return;
+                       }
                        reserved += rg.size;
                }
+
+               if (omapfb_config.mem_desc.region[i].size) {
+                       pr_err("FB region %d already set\n", i);
+                       config_invalid = 1;
+                       return;
+               }
+
                omapfb_config.mem_desc.region[i] = rg;
                configured_regions++;
        }
@@ -359,7 +388,10 @@ static inline int omap_init_fb(void)
 
 arch_initcall(omap_init_fb);
 
-void omapfb_reserve_sdram(void) {}
+void omapfb_reserve_sdram_memblock(void)
+{
+}
+
 unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
                                  unsigned long sram_vstart,
                                  unsigned long sram_size,
@@ -375,7 +407,10 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
 {
 }
 
-void omapfb_reserve_sdram(void) {}
+void omapfb_reserve_sdram_memblock(void)
+{
+}
+
 unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
                                  unsigned long sram_vstart,
                                  unsigned long sram_size,
index d265018f5e6b729a146a351388f3213dc8c72472..5e4afbee0fd7812e2fe907b67fb7abaab0fb34fa 100644 (file)
@@ -34,6 +34,8 @@ struct sys_timer;
 extern void omap_map_common_io(void);
 extern struct sys_timer omap_timer;
 
+extern void omap_reserve(void);
+
 /*
  * IO bases for various OMAP processors
  * Except the tap base, rest all the io bases
index edd4987758a64db91d606a26806593ae2a48d698..0aa4ecd12c7d5768f74efa2d4e7977f729e2338d 100644 (file)
@@ -38,7 +38,7 @@ extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
 extern void omap_vram_set_sdram_vram(u32 size, u32 start);
 extern void omap_vram_set_sram_vram(u32 size, u32 start);
 
-extern void omap_vram_reserve_sdram(void);
+extern void omap_vram_reserve_sdram_memblock(void);
 extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
                                            unsigned long sram_vstart,
                                            unsigned long sram_size,
@@ -48,7 +48,7 @@ extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
 static inline void omap_vram_set_sdram_vram(u32 size, u32 start) { }
 static inline void omap_vram_set_sram_vram(u32 size, u32 start) { }
 
-static inline void omap_vram_reserve_sdram(void) { }
+static inline void omap_vram_reserve_sdram_memblock(void) { }
 static inline unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
                                            unsigned long sram_vstart,
                                            unsigned long sram_size,
index 1670734b7e5159d34ada41710c0dc5381fcc4c3a..37fa593884ee64d345add30e2ca9738e238e3511 100644 (file)
@@ -17,8 +17,8 @@
                .macro  addruart, rx
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                                 @ MMU enabled?
-               moveq   \rx, =SPEAR_DBG_UART_BASE               @ Physical base
-               movne   \rx, =VA_SPEAR_DBG_UART_BASE            @ Virtual base
+               moveq   \rx, #SPEAR_DBG_UART_BASE               @ Physical base
+               movne   \rx, #VA_SPEAR_DBG_UART_BASE            @ Virtual base
                .endm
 
                .macro  senduart, rd, rx
index a1025d38f38370ddcb769898cf3854bdab2bbe29..ab211652e4ca79d3e814bc9967cdace8d10edf7c 100644 (file)
 
 #define INT_STATUS             0x1
 
+/*
+ * Minimum clocksource/clockevent timer range in seconds
+ */
+#define SPEAR_MIN_RANGE 4
+
 static __iomem void *gpt_base;
 static struct clk *gpt_clk;
 
@@ -66,44 +71,6 @@ static void clockevent_set_mode(enum clock_event_mode mode,
 static int clockevent_next_event(unsigned long evt,
                                 struct clock_event_device *clk_event_dev);
 
-/*
- * Following clocksource_set_clock and clockevent_set_clock picked
- * from arch/mips/kernel/time.c
- */
-
-void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock)
-{
-       u64 temp;
-       u32 shift;
-
-       /* Find a shift value */
-       for (shift = 32; shift > 0; shift--) {
-               temp = (u64) NSEC_PER_SEC << shift;
-               do_div(temp, clock);
-               if ((temp >> 32) == 0)
-                       break;
-       }
-       cs->shift = shift;
-       cs->mult = (u32) temp;
-}
-
-void __init clockevent_set_clock(struct clock_event_device *cd,
-       unsigned int clock)
-{
-       u64 temp;
-       u32 shift;
-
-       /* Find a shift value */
-       for (shift = 32; shift > 0; shift--) {
-               temp = (u64) clock << shift;
-               do_div(temp, NSEC_PER_SEC);
-               if ((temp >> 32) == 0)
-                       break;
-       }
-       cd->shift = shift;
-       cd->mult = (u32) temp;
-}
-
 static cycle_t clocksource_read_cycles(struct clocksource *cs)
 {
        return (cycle_t) readw(gpt_base + COUNT(CLKSRC));
@@ -138,7 +105,7 @@ static void spear_clocksource_init(void)
        val |= CTRL_ENABLE ;
        writew(val, gpt_base + CR(CLKSRC));
 
-       clocksource_set_clock(&clksrc, tick_rate);
+       clocksource_calc_mult_shift(&clksrc, tick_rate, SPEAR_MIN_RANGE);
 
        /* register the clocksource */
        clocksource_register(&clksrc);
@@ -233,7 +200,7 @@ static void __init spear_clockevent_init(void)
        tick_rate = clk_get_rate(gpt_clk);
        tick_rate >>= CTRL_PRESCALER16;
 
-       clockevent_set_clock(&clkevt, tick_rate);
+       clockevents_calc_mult_shift(&clkevt, tick_rate, SPEAR_MIN_RANGE);
 
        clkevt.max_delta_ns = clockevent_delta2ns(0xfff0,
                        &clkevt);
index 9b1a66816aa652d97460bca5feafe5ec97069d61..5cf88e8427b15e66aafa287f1960e937a26fb89a 100644 (file)
@@ -2,3 +2,7 @@ obj-y   := clock.o
 obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
 obj-$(CONFIG_ARCH_REALVIEW) += sched-clock.o
 obj-$(CONFIG_ARCH_VERSATILE) += sched-clock.o
+ifeq ($(CONFIG_LEDS_CLASS),y)
+obj-$(CONFIG_ARCH_REALVIEW) += leds.o
+obj-$(CONFIG_ARCH_VERSATILE) += leds.o
+endif
diff --git a/arch/arm/plat-versatile/leds.c b/arch/arm/plat-versatile/leds.c
new file mode 100644 (file)
index 0000000..3169fa5
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Driver for the 8 user LEDs found on the RealViews and Versatiles
+ * Based on DaVinci's DM365 board code
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ * Author: Linus Walleij <triad@df.lth.se>
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/leds.h>
+
+#include <mach/hardware.h>
+#include <mach/platform.h>
+
+#ifdef VERSATILE_SYS_BASE
+#define LEDREG (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LED_OFFSET)
+#endif
+
+#ifdef REALVIEW_SYS_BASE
+#define LEDREG (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET)
+#endif
+
+struct versatile_led {
+       struct led_classdev     cdev;
+       u8                      mask;
+};
+
+/*
+ * The triggers lines up below will only be used if the
+ * LED triggers are compiled in.
+ */
+static const struct {
+       const char *name;
+       const char *trigger;
+} versatile_leds[] = {
+       { "versatile:0", "heartbeat", },
+       { "versatile:1", "mmc0", },
+       { "versatile:2", },
+       { "versatile:3", },
+       { "versatile:4", },
+       { "versatile:5", },
+       { "versatile:6", },
+       { "versatile:7", },
+};
+
+static void versatile_led_set(struct led_classdev *cdev,
+                             enum led_brightness b)
+{
+       struct versatile_led *led = container_of(cdev,
+                                                struct versatile_led, cdev);
+       u32 reg = readl(LEDREG);
+
+       if (b != LED_OFF)
+               reg |= led->mask;
+       else
+               reg &= ~led->mask;
+       writel(reg, LEDREG);
+}
+
+static enum led_brightness versatile_led_get(struct led_classdev *cdev)
+{
+       struct versatile_led *led = container_of(cdev,
+                                                struct versatile_led, cdev);
+       u32 reg = readl(LEDREG);
+
+       return (reg & led->mask) ? LED_FULL : LED_OFF;
+}
+
+static int __init versatile_leds_init(void)
+{
+       int i;
+
+       /* All ON */
+       writel(0xff, LEDREG);
+       for (i = 0; i < ARRAY_SIZE(versatile_leds); i++) {
+               struct versatile_led *led;
+
+               led = kzalloc(sizeof(*led), GFP_KERNEL);
+               if (!led)
+                       break;
+
+               led->cdev.name = versatile_leds[i].name;
+               led->cdev.brightness_set = versatile_led_set;
+               led->cdev.brightness_get = versatile_led_get;
+               led->cdev.default_trigger = versatile_leds[i].trigger;
+               led->mask = BIT(i);
+
+               if (led_classdev_register(NULL, &led->cdev) < 0) {
+                       kfree(led);
+                       break;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * Since we may have triggers on any subsystem, defer registration
+ * until after subsystem_init.
+ */
+fs_initcall(versatile_leds_init);
index 0cf2c0a4502bd55769edf2166899a2c47d833f8a..e6ac0b6610763e6a51c30d64c607691c4fe869fe 100644 (file)
@@ -54,6 +54,9 @@
 #define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
 #define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
 
+#define TIOCGRS485      0x542E
+#define TIOCSRS485      0x542F
+
 #define FIONCLEX       0x5450
 #define FIOCLEX                0x5451
 #define FIOASYNC       0x5452
index c7f25bb1d068e0de55c8d2eeeb9ea817d5232328..61740201b3115eb7988ff3eca6728195f5d90d8b 100644 (file)
@@ -5,6 +5,7 @@
 #define __ASM_ARCH_BOARD_H
 
 #include <linux/types.h>
+#include <linux/serial.h>
 
 #define GPIO_PIN_NONE  (-1)
 
@@ -35,6 +36,7 @@ struct atmel_uart_data {
        short           use_dma_tx;     /* use transmit DMA? */
        short           use_dma_rx;     /* use receive DMA? */
        void __iomem    *regs;          /* virtual base address, if any */
+       struct serial_rs485     rs485;          /* rs485 settings */
 };
 void at32_map_usart(unsigned int hw_id, unsigned int line, int flags);
 struct platform_device *at32_add_device_usart(unsigned int id);
index 2580e77624d2072b4637b28eb32f5deb5053c1c0..f9e5622ebc95b8e37a42ac96d3556176c44b11c9 100644 (file)
@@ -435,20 +435,21 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = {
 static int __init au1xxx_platform_init(void)
 {
        unsigned int uartclk = get_au1x00_uart_baud_base() * 16;
-       int i;
+       int err, i;
 
        /* Fill up uartclk. */
        for (i = 0; au1x00_uart_data[i].flags; i++)
                au1x00_uart_data[i].uartclk = uartclk;
 
+       err = platform_add_devices(au1xxx_platform_devices,
+                                  ARRAY_SIZE(au1xxx_platform_devices));
 #ifndef CONFIG_SOC_AU1100
        /* Register second MAC if enabled in pinfunc */
-       if (!(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2))
+       if (!err && !(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2))
                platform_device_register(&au1xxx_eth1_device);
 #endif
 
-       return platform_add_devices(au1xxx_platform_devices,
-                                   ARRAY_SIZE(au1xxx_platform_devices));
+       return err;
 }
 
 arch_initcall(au1xxx_platform_init);
index a9f0336e1f1fd626cca60c57748c1430be64c8f4..52d883d37dd7e4b69a82ab89e724c7b0c2cca7d4 100644 (file)
@@ -67,8 +67,6 @@ static void mtx1_power_off(void)
 
 void __init board_setup(void)
 {
-       alchemy_gpio2_enable();
-
 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
        /* Enable USB power switch */
        alchemy_gpio_direction_output(204, 0);
@@ -117,11 +115,11 @@ mtx1_pci_idsel(unsigned int devsel, int assert)
 
        if (assert && devsel != 0)
                /* Suppress signal to Cardbus */
-               gpio_set_value(1, 0);   /* set EXT_IO3 OFF */
+               alchemy_gpio_set_value(1, 0);   /* set EXT_IO3 OFF */
        else
-               gpio_set_value(1, 1);   /* set EXT_IO3 ON */
+               alchemy_gpio_set_value(1, 1);   /* set EXT_IO3 ON */
 
-       au_sync_udelay(1);
+       udelay(1);
        return 1;
 }
 
index 9f544badd0b4d5dddc25701a690bb63b797cf8f8..39c23366c5c7ea4bcbe6c272fe0279aca4d82aba 100644 (file)
@@ -104,6 +104,9 @@ int __init bcm63xx_enet_register(int unit,
        if (unit > 1)
                return -ENODEV;
 
+       if (unit == 1 && BCMCPU_IS_6338())
+               return -ENODEV;
+
        if (!shared_device_registered) {
                shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA);
                shared_res[0].end = shared_res[0].start;
index 59dc0c7ef7334b2e28e4b508e03f84e8f2ea2aca..c63c56bfd18461b558e0cba7380d6297fc47115e 100644 (file)
@@ -434,7 +434,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %0, %1          # atomic64_add          \n"
-               "       addu    %0, %2                                  \n"
+               "       daddu   %0, %2                                  \n"
                "       scd     %0, %1                                  \n"
                "       beqzl   %0, 1b                                  \n"
                "       .set    mips0                                   \n"
@@ -446,7 +446,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %0, %1          # atomic64_add          \n"
-               "       addu    %0, %2                                  \n"
+               "       daddu   %0, %2                                  \n"
                "       scd     %0, %1                                  \n"
                "       beqz    %0, 2f                                  \n"
                "       .subsection 2                                   \n"
@@ -479,7 +479,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %0, %1          # atomic64_sub          \n"
-               "       subu    %0, %2                                  \n"
+               "       dsubu   %0, %2                                  \n"
                "       scd     %0, %1                                  \n"
                "       beqzl   %0, 1b                                  \n"
                "       .set    mips0                                   \n"
@@ -491,7 +491,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %0, %1          # atomic64_sub          \n"
-               "       subu    %0, %2                                  \n"
+               "       dsubu   %0, %2                                  \n"
                "       scd     %0, %1                                  \n"
                "       beqz    %0, 2f                                  \n"
                "       .subsection 2                                   \n"
@@ -524,10 +524,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %1, %2          # atomic64_add_return   \n"
-               "       addu    %0, %1, %3                              \n"
+               "       daddu   %0, %1, %3                              \n"
                "       scd     %0, %2                                  \n"
                "       beqzl   %0, 1b                                  \n"
-               "       addu    %0, %1, %3                              \n"
+               "       daddu   %0, %1, %3                              \n"
                "       .set    mips0                                   \n"
                : "=&r" (result), "=&r" (temp), "=m" (v->counter)
                : "Ir" (i), "m" (v->counter)
@@ -538,10 +538,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %1, %2          # atomic64_add_return   \n"
-               "       addu    %0, %1, %3                              \n"
+               "       daddu   %0, %1, %3                              \n"
                "       scd     %0, %2                                  \n"
                "       beqz    %0, 2f                                  \n"
-               "       addu    %0, %1, %3                              \n"
+               "       daddu   %0, %1, %3                              \n"
                "       .subsection 2                                   \n"
                "2:     b       1b                                      \n"
                "       .previous                                       \n"
@@ -576,10 +576,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %1, %2          # atomic64_sub_return   \n"
-               "       subu    %0, %1, %3                              \n"
+               "       dsubu   %0, %1, %3                              \n"
                "       scd     %0, %2                                  \n"
                "       beqzl   %0, 1b                                  \n"
-               "       subu    %0, %1, %3                              \n"
+               "       dsubu   %0, %1, %3                              \n"
                "       .set    mips0                                   \n"
                : "=&r" (result), "=&r" (temp), "=m" (v->counter)
                : "Ir" (i), "m" (v->counter)
@@ -590,10 +590,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %1, %2          # atomic64_sub_return   \n"
-               "       subu    %0, %1, %3                              \n"
+               "       dsubu   %0, %1, %3                              \n"
                "       scd     %0, %2                                  \n"
                "       beqz    %0, 2f                                  \n"
-               "       subu    %0, %1, %3                              \n"
+               "       dsubu   %0, %1, %3                              \n"
                "       .subsection 2                                   \n"
                "2:     b       1b                                      \n"
                "       .previous                                       \n"
index 1b5a6648eb86dda1598877acf8fd4a9ac9b301c1..baa318a59c97f8c2791842df809c1218796c7492 100644 (file)
 #define __NR_perf_event_open           (__NR_Linux + 296)
 #define __NR_accept4                   (__NR_Linux + 297)
 #define __NR_recvmmsg                  (__NR_Linux + 298)
+#define __NR_getdents64                        (__NR_Linux + 299)
 
 /*
  * Offset of the last N32 flavoured syscall
  */
-#define __NR_Linux_syscalls            298
+#define __NR_Linux_syscalls            299
 
 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
 
 #define __NR_N32_Linux                 6000
-#define __NR_N32_Linux_syscalls                298
+#define __NR_N32_Linux_syscalls                299
 
 #ifdef __KERNEL__
 
index a5297e2a353aede2279664446611de8100bf1f98..a4faceea9d885043a0628afcf649d6b957c9b7a3 100644 (file)
@@ -419,4 +419,5 @@ EXPORT(sysn32_call_table)
        PTR     sys_perf_event_open
        PTR     sys_accept4
        PTR     compat_sys_recvmmsg
+       PTR     sys_getdents
        .size   sysn32_call_table,.-sysn32_call_table
index b773c1112b140f0f976139a3f57a9e69b2ee4bde..e5cdfd603f8fb6dabbdf22051b043604c8ad6496 100644 (file)
@@ -61,11 +61,9 @@ static int __init init_vdso(void)
 
        vunmap(vdso);
 
-       pr_notice("init_vdso successfull\n");
-
        return 0;
 }
-device_initcall(init_vdso);
+subsys_initcall(init_vdso);
 
 static unsigned long vdso_addr(unsigned long start)
 {
index 2fbfa1a8c3a9a96a4a2bc159a9eb8c986bc4297e..bf80921f2f56c0b145e698fa2c673ff49c7c0636 100644 (file)
@@ -247,6 +247,8 @@ void __init mips_pcibios_init(void)
        iomem_resource.end &= 0xfffffffffULL;                   /* 64 GB */
        ioport_resource.end = controller->io_resource->end;
 
+       controller->io_map_base = mips_io_port_base;
+
        register_pci_controller(controller);
 }
 
index eee4f3dfc410e248d5caf1e625b14dcbbb273ff3..98e86ddb86ccd6e07766d53a04998d7f3a413cc4 100644 (file)
@@ -44,6 +44,7 @@ extern struct pci_ops pnx8550_pci_ops;
 
 static struct pci_controller pnx8550_controller = {
        .pci_ops        = &pnx8550_pci_ops,
+       .io_map_base    = PNX8550_PORT_BASE,
        .io_resource    = &pci_io_resource,
        .mem_resource   = &pci_mem_resource,
 };
index 2aed50fef10ff8b800a58c8cdc0551d654b8fbf8..64246c9c875c51d09e5c3861ca0e6f1096d50ac5 100644 (file)
@@ -113,7 +113,7 @@ void __init plat_mem_setup(void)
        PNX8550_GLB2_ENAB_INTA_O = 0;
 
        /* IO/MEM resources. */
-       set_io_port_base(KSEG1);
+       set_io_port_base(PNX8550_PORT_BASE);
        ioport_resource.start = 0;
        ioport_resource.end = ~0;
        iomem_resource.start = 0;
index 04b31478a6d7d6631ad3faa684be6f41e66e2a09..b7c03d80c88c80e1a54af4254d42522b95e9f76a 100644 (file)
@@ -944,6 +944,7 @@ static struct pci_controller msp_pci_controller = {
        .pci_ops        = &msp_pci_ops,
        .mem_resource   = &pci_mem_resource,
        .mem_offset     = 0,
+       .io_map_base    = MSP_PCI_IOSPACE_BASE,
        .io_resource    = &pci_io_resource,
        .io_offset      = 0
 };
index 0357946f30e6ec5d2719446eaf68a9b86e980b98..cf5e1a25cb7d7fb942c3d0ebe53e9b3c6e5e14c1 100644 (file)
@@ -54,6 +54,7 @@ static int __init pmc_yosemite_setup(void)
                panic(ioremap_failed);
 
        set_io_port_base(io_v_base);
+       py_controller.io_map_base = io_v_base;
        TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1);
 
        ioport_resource.end = TITAN_IO_SIZE - 1;
index 8ee77887306a24986a54b27af1b3dc009011273a..9ec523e4dd060afb93ebd5fea93c07450daf933f 100644 (file)
@@ -472,6 +472,9 @@ void __init configure_platform(void)
                 * it*/
                platform_features = FFS_CAPABLE | DISPLAY_CAPABLE;
 
+               /* Cronus and Cronus Lite have the same register map */
+               set_register_map(CRONUS_IO_BASE, &cronus_register_map);
+
                /* ASIC version will determine if this is a real CronusLite or
                 * Castrati(Cronus) */
                chipversion  = asic_read(chipver3) << 24;
@@ -484,8 +487,6 @@ void __init configure_platform(void)
                else
                        asic = ASIC_CRONUSLITE;
 
-               /* Cronus and Cronus Lite have the same register map */
-               set_register_map(CRONUS_IO_BASE, &cronus_register_map);
                gp_resources = non_dvr_cronuslite_resources;
                pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, "
                        "chipversion=0x%08X\n",
index 2a9cd74a841e3e234b6d1a4bb6beb8e5cd1b207b..076327f2eff777b2cdbd4e15de8336ce7b03faa6 100644 (file)
@@ -8,9 +8,9 @@
  * On FSL-BookE we setup a 1:1 mapping which covers the first 2GiB of memory
  * and therefore we can only deal with memory within this range
  */
-#define KEXEC_SOURCE_MEMORY_LIMIT      (2 * 1024 * 1024 * 1024UL)
-#define KEXEC_DESTINATION_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL)
-#define KEXEC_CONTROL_MEMORY_LIMIT     (2 * 1024 * 1024 * 1024UL)
+#define KEXEC_SOURCE_MEMORY_LIMIT      (2 * 1024 * 1024 * 1024UL - 1)
+#define KEXEC_DESTINATION_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1)
+#define KEXEC_CONTROL_MEMORY_LIMIT     (2 * 1024 * 1024 * 1024UL - 1)
 
 #else
 
index 2102b214a87c9ab49b7540962c2faef15251f55c..0e398cfee2c82826b6abad1eb8ece6330df6b0b4 100644 (file)
@@ -250,7 +250,9 @@ extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
 int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
                     pte_t *ptep, unsigned long trap, int local, int ssize,
                     unsigned int shift, unsigned int mmu_psize);
-
+extern void hash_failure_debug(unsigned long ea, unsigned long access,
+                              unsigned long vsid, unsigned long trap,
+                              int ssize, int psize, unsigned long pte);
 extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
                             unsigned long pstart, unsigned long prot,
                             int psize, int ssize);
index 369872f6cf78aa139564275b714af2f6901af85a..babcceecd2eab6335217d2434c6e91e5c7fe5884 100644 (file)
@@ -566,9 +566,9 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
         * Finally record data if requested.
         */
        if (record) {
-               struct perf_sample_data data = {
-                       .period = event->hw.last_period,
-               };
+               struct perf_sample_data data;
+
+               perf_sample_data_init(&data, 0);
 
                if (perf_event_overflow(event, nmi, &data, regs)) {
                        /*
index 9d3953983fb74759a2ab2bfbb2a5f7dd316e62ca..fed9bf6187d1a514e88677b144c5ad1273be8505 100644 (file)
@@ -414,7 +414,7 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
        u64 base, size, memblock_size;
        unsigned int is_kexec_kdump = 0, rngs;
 
-       ls = of_get_flat_dt_prop(node, "ibm,memblock-size", &l);
+       ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l);
        if (ls == NULL || l < dt_root_size_cells * sizeof(__be32))
                return 0;
        memblock_size = dt_mem_next_cell(dt_root_size_cells, &ls);
index a719f53921a57c390503b708c38cb4e1146a176b..3079f6b44cf531e5f1dafc8fa9e9a9e38e59dc15 100644 (file)
@@ -68,9 +68,6 @@ _GLOBAL(__hash_page_4K)
        std     r8,STK_PARM(r8)(r1)
        std     r9,STK_PARM(r9)(r1)
        
-       /* Add _PAGE_PRESENT to access */
-       ori     r4,r4,_PAGE_PRESENT
-
        /* Save non-volatile registers.
         * r31 will hold "old PTE"
         * r30 is "new PTE"
@@ -347,9 +344,6 @@ _GLOBAL(__hash_page_4K)
        std     r8,STK_PARM(r8)(r1)
        std     r9,STK_PARM(r9)(r1)
 
-       /* Add _PAGE_PRESENT to access */
-       ori     r4,r4,_PAGE_PRESENT
-
        /* Save non-volatile registers.
         * r31 will hold "old PTE"
         * r30 is "new PTE"
@@ -687,9 +681,6 @@ _GLOBAL(__hash_page_64K)
        std     r8,STK_PARM(r8)(r1)
        std     r9,STK_PARM(r9)(r1)
 
-       /* Add _PAGE_PRESENT to access */
-       ori     r4,r4,_PAGE_PRESENT
-
        /* Save non-volatile registers.
         * r31 will hold "old PTE"
         * r30 is "new PTE"
index 98f262de558526899fa5c58fe6802654bb0a5833..09dffe6efa46aeae84d62a922215f87fe0a8ca2d 100644 (file)
@@ -871,6 +871,18 @@ static inline int subpage_protection(struct mm_struct *mm, unsigned long ea)
 }
 #endif
 
+void hash_failure_debug(unsigned long ea, unsigned long access,
+                       unsigned long vsid, unsigned long trap,
+                       int ssize, int psize, unsigned long pte)
+{
+       if (!printk_ratelimit())
+               return;
+       pr_info("mm: Hashing failure ! EA=0x%lx access=0x%lx current=%s\n",
+               ea, access, current->comm);
+       pr_info("    trap=0x%lx vsid=0x%lx ssize=%d psize=%d pte=0x%lx\n",
+               trap, vsid, ssize, psize, pte);
+}
+
 /* Result code is:
  *  0 - handled
  *  1 - normal page fault
@@ -955,6 +967,17 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
                return 1;
        }
 
+       /* Add _PAGE_PRESENT to the required access perm */
+       access |= _PAGE_PRESENT;
+
+       /* Pre-check access permissions (will be re-checked atomically
+        * in __hash_page_XX but this pre-check is a fast path
+        */
+       if (access & ~pte_val(*ptep)) {
+               DBG_LOW(" no access !\n");
+               return 1;
+       }
+
 #ifdef CONFIG_HUGETLB_PAGE
        if (hugeshift)
                return __hash_page_huge(ea, access, vsid, ptep, trap, local,
@@ -967,14 +990,6 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
        DBG_LOW(" i-pte: %016lx %016lx\n", pte_val(*ptep),
                pte_val(*(ptep + PTRS_PER_PTE)));
 #endif
-       /* Pre-check access permissions (will be re-checked atomically
-        * in __hash_page_XX but this pre-check is a fast path
-        */
-       if (access & ~pte_val(*ptep)) {
-               DBG_LOW(" no access !\n");
-               return 1;
-       }
-
        /* Do actual hashing */
 #ifdef CONFIG_PPC_64K_PAGES
        /* If _PAGE_4K_PFN is set, make sure this is a 4k segment */
@@ -1033,6 +1048,12 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
                                            local, ssize, spp);
        }
 
+       /* Dump some info in case of hash insertion failure, they should
+        * never happen so it is really useful to know if/when they do
+        */
+       if (rc == -1)
+               hash_failure_debug(ea, access, vsid, trap, ssize, psize,
+                                  pte_val(*ptep));
 #ifndef CONFIG_PPC_64K_PAGES
        DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep));
 #else
@@ -1051,8 +1072,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
        void *pgdir;
        pte_t *ptep;
        unsigned long flags;
-       int local = 0;
-       int ssize;
+       int rc, ssize, local = 0;
 
        BUG_ON(REGION_ID(ea) != USER_REGION_ID);
 
@@ -1098,11 +1118,18 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
        /* Hash it in */
 #ifdef CONFIG_PPC_HAS_HASH_64K
        if (mm->context.user_psize == MMU_PAGE_64K)
-               __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize);
+               rc = __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize);
        else
 #endif /* CONFIG_PPC_HAS_HASH_64K */
-               __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize,
-                              subpage_protection(pgdir, ea));
+               rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize,
+                                   subpage_protection(pgdir, ea));
+
+       /* Dump some info in case of hash insertion failure, they should
+        * never happen so it is really useful to know if/when they do
+        */
+       if (rc == -1)
+               hash_failure_debug(ea, access, vsid, trap, ssize,
+                                  mm->context.user_psize, pte_val(*ptep));
 
        local_irq_restore(flags);
 }
index 199539882f927620d6a435b92241e1f08f9aa4a1..cc5c273086cf833e28bc89a91bb814b09c16a4e4 100644 (file)
@@ -21,21 +21,13 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
        unsigned long old_pte, new_pte;
        unsigned long va, rflags, pa, sz;
        long slot;
-       int err = 1;
 
        BUG_ON(shift != mmu_psize_defs[mmu_psize].shift);
 
        /* Search the Linux page table for a match with va */
        va = hpt_va(ea, vsid, ssize);
 
-       /*
-        * Check the user's access rights to the page.  If access should be
-        * prevented then send the problem up to do_page_fault.
-        */
-       if (unlikely(access & ~pte_val(*ptep)))
-               goto out;
-       /*
-        * At this point, we have a pte (old_pte) which can be used to build
+       /* At this point, we have a pte (old_pte) which can be used to build
         * or update an HPTE. There are 2 cases:
         *
         * 1. There is a valid (present) pte with no associated HPTE (this is
@@ -49,9 +41,17 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
 
        do {
                old_pte = pte_val(*ptep);
-               if (old_pte & _PAGE_BUSY)
-                       goto out;
+               /* If PTE busy, retry the access */
+               if (unlikely(old_pte & _PAGE_BUSY))
+                       return 0;
+               /* If PTE permissions don't match, take page fault */
+               if (unlikely(access & ~old_pte))
+                       return 1;
+               /* Try to lock the PTE, add ACCESSED and DIRTY if it was
+                * a write access */
                new_pte = old_pte | _PAGE_BUSY | _PAGE_ACCESSED;
+               if (access & _PAGE_RW)
+                       new_pte |= _PAGE_DIRTY;
        } while(old_pte != __cmpxchg_u64((unsigned long *)ptep,
                                         old_pte, new_pte));
 
@@ -121,8 +121,16 @@ repeat:
                         }
                }
 
-               if (unlikely(slot == -2))
-                       panic("hash_huge_page: pte_insert failed\n");
+               /*
+                * Hypervisor failure. Restore old pte and return -1
+                * similar to __hash_page_*
+                */
+               if (unlikely(slot == -2)) {
+                       *ptep = __pte(old_pte);
+                       hash_failure_debug(ea, access, vsid, trap, ssize,
+                                          mmu_psize, old_pte);
+                       return -1;
+               }
 
                new_pte |= (slot << 12) & (_PAGE_F_SECOND | _PAGE_F_GIX);
        }
@@ -131,9 +139,5 @@ repeat:
         * No need to use ldarx/stdcx here
         */
        *ptep = __pte(new_pte & ~_PAGE_BUSY);
-
-       err = 0;
-
- out:
-       return err;
+       return 0;
 }
index f47364585ecd0bce3df61a5397fa3f9d0ccf7feb..aa731af720c04e4816f0e9826d7f05109631bccb 100644 (file)
@@ -398,15 +398,15 @@ static int of_get_drconf_memory(struct device_node *memory, const u32 **dm)
 }
 
 /*
- * Retreive and validate the ibm,memblock-size property for drconf memory
+ * Retreive and validate the ibm,lmb-size property for drconf memory
  * from the device tree.
  */
-static u64 of_get_memblock_size(struct device_node *memory)
+static u64 of_get_lmb_size(struct device_node *memory)
 {
        const u32 *prop;
        u32 len;
 
-       prop = of_get_property(memory, "ibm,memblock-size", &len);
+       prop = of_get_property(memory, "ibm,lmb-size", &len);
        if (!prop || len < sizeof(unsigned int))
                return 0;
 
@@ -562,7 +562,7 @@ static unsigned long __init numa_enforce_memory_limit(unsigned long start,
 static inline int __init read_usm_ranges(const u32 **usm)
 {
        /*
-        * For each memblock in ibm,dynamic-memory a corresponding
+        * For each lmb in ibm,dynamic-memory a corresponding
         * entry in linux,drconf-usable-memory property contains
         * a counter followed by that many (base, size) duple.
         * read the counter from linux,drconf-usable-memory
@@ -578,7 +578,7 @@ static void __init parse_drconf_memory(struct device_node *memory)
 {
        const u32 *dm, *usm;
        unsigned int n, rc, ranges, is_kexec_kdump = 0;
-       unsigned long memblock_size, base, size, sz;
+       unsigned long lmb_size, base, size, sz;
        int nid;
        struct assoc_arrays aa;
 
@@ -586,8 +586,8 @@ static void __init parse_drconf_memory(struct device_node *memory)
        if (!n)
                return;
 
-       memblock_size = of_get_memblock_size(memory);
-       if (!memblock_size)
+       lmb_size = of_get_lmb_size(memory);
+       if (!lmb_size)
                return;
 
        rc = of_get_assoc_arrays(memory, &aa);
@@ -611,7 +611,7 @@ static void __init parse_drconf_memory(struct device_node *memory)
                        continue;
 
                base = drmem.base_addr;
-               size = memblock_size;
+               size = lmb_size;
                ranges = 1;
 
                if (is_kexec_kdump) {
@@ -1072,7 +1072,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
 {
        const u32 *dm;
        unsigned int drconf_cell_cnt, rc;
-       unsigned long memblock_size;
+       unsigned long lmb_size;
        struct assoc_arrays aa;
        int nid = -1;
 
@@ -1080,8 +1080,8 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
        if (!drconf_cell_cnt)
                return -1;
 
-       memblock_size = of_get_memblock_size(memory);
-       if (!memblock_size)
+       lmb_size = of_get_lmb_size(memory);
+       if (!lmb_size)
                return -1;
 
        rc = of_get_assoc_arrays(memory, &aa);
@@ -1100,7 +1100,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
                        continue;
 
                if ((scn_addr < drmem.base_addr)
-                   || (scn_addr >= (drmem.base_addr + memblock_size)))
+                   || (scn_addr >= (drmem.base_addr + lmb_size)))
                        continue;
 
                nid = of_drconf_to_nid_single(&drmem, &aa);
index deab5f9460907891a3134a1d7f6bcdb459796dcf..bc88036641406bf283aa96f8c3b4609a3ecef85a 100644 (file)
@@ -69,7 +69,7 @@ static int pseries_remove_memory(struct device_node *np)
        const char *type;
        const unsigned int *regs;
        unsigned long base;
-       unsigned int memblock_size;
+       unsigned int lmb_size;
        int ret = -EINVAL;
 
        /*
@@ -87,9 +87,9 @@ static int pseries_remove_memory(struct device_node *np)
                return ret;
 
        base = *(unsigned long *)regs;
-       memblock_size = regs[3];
+       lmb_size = regs[3];
 
-       ret = pseries_remove_memblock(base, memblock_size);
+       ret = pseries_remove_memblock(base, lmb_size);
        return ret;
 }
 
@@ -98,7 +98,7 @@ static int pseries_add_memory(struct device_node *np)
        const char *type;
        const unsigned int *regs;
        unsigned long base;
-       unsigned int memblock_size;
+       unsigned int lmb_size;
        int ret = -EINVAL;
 
        /*
@@ -116,36 +116,36 @@ static int pseries_add_memory(struct device_node *np)
                return ret;
 
        base = *(unsigned long *)regs;
-       memblock_size = regs[3];
+       lmb_size = regs[3];
 
        /*
         * Update memory region to represent the memory add
         */
-       ret = memblock_add(base, memblock_size);
+       ret = memblock_add(base, lmb_size);
        return (ret < 0) ? -EINVAL : 0;
 }
 
 static int pseries_drconf_memory(unsigned long *base, unsigned int action)
 {
        struct device_node *np;
-       const unsigned long *memblock_size;
+       const unsigned long *lmb_size;
        int rc;
 
        np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
        if (!np)
                return -EINVAL;
 
-       memblock_size = of_get_property(np, "ibm,memblock-size", NULL);
-       if (!memblock_size) {
+       lmb_size = of_get_property(np, "ibm,lmb-size", NULL);
+       if (!lmb_size) {
                of_node_put(np);
                return -EINVAL;
        }
 
        if (action == PSERIES_DRCONF_MEM_ADD) {
-               rc = memblock_add(*base, *memblock_size);
+               rc = memblock_add(*base, *lmb_size);
                rc = (rc < 0) ? -EINVAL : 0;
        } else if (action == PSERIES_DRCONF_MEM_REMOVE) {
-               rc = pseries_remove_memblock(*base, *memblock_size);
+               rc = pseries_remove_memblock(*base, *lmb_size);
        } else {
                rc = -EINVAL;
        }
index 259e3fd50993a95a2970f404a9c7a4a5224a1b5d..1dc07a0014c17b22bc2af459c581e3fc216d0948 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.34-rc3
-# Sat Apr  3 15:49:56 2010
+# Linux kernel version: 2.6.34
+# Wed May 26 21:14:01 2010
 #
 CONFIG_64BIT=y
 CONFIG_SPARC=y
@@ -107,10 +107,9 @@ CONFIG_PERF_COUNTERS=y
 # CONFIG_DEBUG_PERF_USE_VMALLOC is not set
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_PCI_QUIRKS=y
-CONFIG_SLUB_DEBUG=y
 # CONFIG_COMPAT_BRK is not set
-# CONFIG_SLAB is not set
-CONFIG_SLUB=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 CONFIG_PROFILING=y
 CONFIG_TRACEPOINTS=y
@@ -239,6 +238,7 @@ CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
 CONFIG_SPARSEMEM_VMEMMAP=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_COMPACTION is not set
 CONFIG_MIGRATION=y
 CONFIG_PHYS_ADDR_T_64BIT=y
 CONFIG_ZONE_DMA_FLAG=0
@@ -351,6 +351,7 @@ CONFIG_IPV6_TUNNEL=m
 # CONFIG_RDS is not set
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
+# CONFIG_L2TP is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_NET_DSA is not set
 CONFIG_VLAN_8021Q=m
@@ -367,6 +368,7 @@ CONFIG_VLAN_8021Q=m
 # CONFIG_IEEE802154 is not set
 # CONFIG_NET_SCHED is not set
 # CONFIG_DCB is not set
+CONFIG_RPS=y
 
 #
 # Network testing
@@ -386,9 +388,14 @@ CONFIG_WIRELESS=y
 #
 # CFG80211 needs to be enabled for MAC80211
 #
+
+#
+# Some wireless drivers require a rate control algorithm
+#
 # CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
 
 #
 # Device Drivers
@@ -658,6 +665,7 @@ CONFIG_PHYLIB=m
 # CONFIG_NATIONAL_PHY is not set
 # CONFIG_STE10XP is not set
 # CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_MICREL_PHY is not set
 # CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=m
@@ -734,6 +742,8 @@ CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 CONFIG_CHELSIO_T3_DEPENDS=y
 # CONFIG_CHELSIO_T3 is not set
+CONFIG_CHELSIO_T4_DEPENDS=y
+# CONFIG_CHELSIO_T4 is not set
 # CONFIG_ENIC is not set
 # CONFIG_IXGBE is not set
 # CONFIG_IXGBEVF is not set
@@ -766,6 +776,7 @@ CONFIG_NIU=m
 # CONFIG_USB_PEGASUS is not set
 # CONFIG_USB_RTL8150 is not set
 # CONFIG_USB_USBNET is not set
+# CONFIG_USB_IPHETH is not set
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
@@ -778,7 +789,6 @@ CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_BSDCOMP=m
 CONFIG_PPP_MPPE=m
 CONFIG_PPPOE=m
-# CONFIG_PPPOL2TP is not set
 # CONFIG_SLIP is not set
 CONFIG_SLHC=m
 # CONFIG_NET_FC is not set
@@ -816,6 +826,7 @@ CONFIG_INPUT_KEYBOARD=y
 CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_QT2160 is not set
 CONFIG_KEYBOARD_LKKBD=m
+# CONFIG_KEYBOARD_TCA6416 is not set
 # CONFIG_KEYBOARD_MAX7359 is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_OPENCORES is not set
@@ -840,6 +851,7 @@ CONFIG_MOUSE_SERIAL=y
 # CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_AD714X is not set
 CONFIG_INPUT_SPARCSPKR=y
 # CONFIG_INPUT_ATI_REMOTE is not set
 # CONFIG_INPUT_ATI_REMOTE2 is not set
@@ -848,6 +860,7 @@ CONFIG_INPUT_SPARCSPKR=y
 # CONFIG_INPUT_YEALINK is not set
 # CONFIG_INPUT_CM109 is not set
 # CONFIG_INPUT_UINPUT is not set
+# CONFIG_INPUT_PCF8574 is not set
 
 #
 # Hardware I/O ports
@@ -871,6 +884,7 @@ CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
 # CONFIG_DEVKMEM is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
 # CONFIG_NOZOMI is not set
 
 #
@@ -893,6 +907,8 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_SERIAL_JSM is not set
 # CONFIG_SERIAL_TIMBERDALE is not set
 # CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
 CONFIG_UNIX98_PTYS=y
 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 # CONFIG_LEGACY_PTYS is not set
@@ -1306,11 +1322,14 @@ CONFIG_USB_HIDDEV=y
 CONFIG_HID_A4TECH=y
 CONFIG_HID_APPLE=y
 CONFIG_HID_BELKIN=y
+# CONFIG_HID_CANDO is not set
 CONFIG_HID_CHERRY=y
 CONFIG_HID_CHICONY=y
+# CONFIG_HID_PRODIKEYS is not set
 CONFIG_HID_CYPRESS=y
 CONFIG_HID_DRAGONRISE=y
 # CONFIG_DRAGONRISE_FF is not set
+# CONFIG_HID_EGALAX is not set
 CONFIG_HID_EZKEY=y
 CONFIG_HID_KYE=y
 CONFIG_HID_GYRATION=y
@@ -1328,7 +1347,9 @@ CONFIG_HID_ORTEK=y
 CONFIG_HID_PANTHERLORD=y
 # CONFIG_PANTHERLORD_FF is not set
 CONFIG_HID_PETALYNX=y
+# CONFIG_HID_PICOLCD is not set
 # CONFIG_HID_QUANTA is not set
+# CONFIG_HID_ROCCAT_KONE is not set
 CONFIG_HID_SAMSUNG=y
 CONFIG_HID_SONY=y
 # CONFIG_HID_STANTUM is not set
@@ -1342,6 +1363,7 @@ CONFIG_HID_THRUSTMASTER=y
 # CONFIG_THRUSTMASTER_FF is not set
 CONFIG_HID_ZEROPLUS=y
 # CONFIG_ZEROPLUS_FF is not set
+# CONFIG_HID_ZYDACRON is not set
 CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1356,7 +1378,6 @@ CONFIG_USB=y
 # CONFIG_USB_DEVICEFS is not set
 # CONFIG_USB_DEVICE_CLASS is not set
 # CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_OTG is not set
 # CONFIG_USB_MON is not set
 # CONFIG_USB_WUSB is not set
 # CONFIG_USB_WUSB_CBAF is not set
@@ -1521,10 +1542,6 @@ CONFIG_RTC_DRV_STARFIRE=y
 # CONFIG_DMADEVICES is not set
 # CONFIG_AUXDISPLAY is not set
 # CONFIG_UIO is not set
-
-#
-# TI VLYNQ
-#
 # CONFIG_STAGING is not set
 
 #
@@ -1706,8 +1723,8 @@ CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
 CONFIG_SCHEDSTATS=y
 # CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_OBJECTS is not set
-# CONFIG_SLUB_DEBUG_ON is not set
-# CONFIG_SLUB_STATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_KMEMLEAK is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
@@ -1742,6 +1759,9 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 # CONFIG_DEBUG_PAGEALLOC is not set
 CONFIG_NOP_TRACER=y
 CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
 CONFIG_HAVE_DYNAMIC_FTRACE=y
 CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
@@ -1769,12 +1789,12 @@ CONFIG_BLK_DEV_IO_TRACE=y
 # CONFIG_RING_BUFFER_BENCHMARK is not set
 # CONFIG_DYNAMIC_DEBUG is not set
 # CONFIG_DMA_API_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
 # CONFIG_SAMPLES is not set
 CONFIG_HAVE_ARCH_KGDB=y
 # CONFIG_KGDB is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_DCFLUSH is not set
-# CONFIG_STACK_DEBUG is not set
 # CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
 
 #
@@ -1895,6 +1915,7 @@ CONFIG_CRYPTO_DEFLATE=y
 #
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_NIAGARA2 is not set
 # CONFIG_CRYPTO_DEV_HIFN_795X is not set
 CONFIG_BINARY_PRINTF=y
 
index 0588b8c7faa26b5eb596a1c52a1bcbf77a53bc92..69358b590c9156953ee3c45deb471e4833c7d370 100644 (file)
@@ -11,7 +11,6 @@
 
 #define L1_CACHE_SHIFT 5
 #define L1_CACHE_BYTES 32
-#define L1_CACHE_ALIGN(x) ((((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)))
 
 #ifdef CONFIG_SPARC32
 #define SMP_CACHE_BYTES_SHIFT 5
index 77f906d8cc21f3874ee079aa731edf49f02dea75..0ece77f477536b773a9bd310515008c3b152055c 100644 (file)
@@ -142,13 +142,12 @@ BTFIXUPDEF_CALL_CONST(unsigned long, pgd_page_vaddr, pgd_t)
 #define pmd_page(pmd) BTFIXUP_CALL(pmd_page)(pmd)
 #define pgd_page_vaddr(pgd) BTFIXUP_CALL(pgd_page_vaddr)(pgd)
 
-BTFIXUPDEF_SETHI(none_mask)
 BTFIXUPDEF_CALL_CONST(int, pte_present, pte_t)
 BTFIXUPDEF_CALL(void, pte_clear, pte_t *)
 
 static inline int pte_none(pte_t pte)
 {
-       return !(pte_val(pte) & ~BTFIXUP_SETHI(none_mask));
+       return !pte_val(pte);
 }
 
 #define pte_present(pte) BTFIXUP_CALL(pte_present)(pte)
@@ -160,7 +159,7 @@ BTFIXUPDEF_CALL(void, pmd_clear, pmd_t *)
 
 static inline int pmd_none(pmd_t pmd)
 {
-       return !(pmd_val(pmd) & ~BTFIXUP_SETHI(none_mask));
+       return !pmd_val(pmd);
 }
 
 #define pmd_bad(pmd) BTFIXUP_CALL(pmd_bad)(pmd)
index 0ec92c8861dd3a68fe0465b71ccf8007ad6e40a7..44faabc3c02c920bba1b9f12272d1a907895161e 100644 (file)
@@ -657,6 +657,7 @@ static u64 maybe_change_configuration(struct cpu_hw_events *cpuc, u64 pcr)
                cpuc->current_idx[i] = idx;
 
                enc = perf_event_get_enc(cpuc->events[i]);
+               pcr &= ~mask_for_index(idx);
                pcr |= event_encoding(enc, idx);
        }
 out:
index ab036a72de5a16460cdb8b548dbcf15bb2e04db6..e11b4612dabb32df7cd0155ed6aed40515c038ad 100644 (file)
@@ -183,7 +183,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id)
                goto out_unlock;
        }
        
-       if (action && tmp)
+       if (tmp)
                tmp->next = action->next;
        else
                *actionp = action->next;
index 76d837fc47d3fdd498c0b2fdb276c9b25abe1c0b..c6dfdaa29e208994fab3b1942cd24878d0bd2d98 100644 (file)
@@ -64,7 +64,7 @@ tl0_irq6:     TRAP_IRQ(smp_call_function_single_client, 6)
 tl0_irq6:      BTRAP(0x46)
 #endif
 tl0_irq7:      TRAP_IRQ(deferred_pcr_work_irq, 7)
-#ifdef CONFIG_KGDB
+#if defined(CONFIG_KGDB) && defined(CONFIG_SMP)
 tl0_irq8:      TRAP_IRQ(smp_kgdb_capture_client, 8)
 #else
 tl0_irq8:      BTRAP(0x48)
index f5f75a58e0b3cc7077f78a610f6cc6107c75bcb8..b0b43aa5e45a483984b0acd7a4641c0765eb8859 100644 (file)
@@ -2215,8 +2215,6 @@ void __init ld_mmu_srmmu(void)
        BTFIXUPSET_CALL(pmd_page, srmmu_pmd_page, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(pgd_page_vaddr, srmmu_pgd_page, BTFIXUPCALL_NORM);
 
-       BTFIXUPSET_SETHI(none_mask, 0xF0000000);
-
        BTFIXUPSET_CALL(pte_present, srmmu_pte_present, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(pte_clear, srmmu_pte_clear, BTFIXUPCALL_SWAPO0G0);
 
index cf38846753dd55c3ece5d7be244b23d9ca3fbda3..4289f90f86972f6020318bf002162fccf5a968e8 100644 (file)
@@ -2087,9 +2087,6 @@ void __init ld_mmu_sun4c(void)
 
        BTFIXUPSET_CALL(set_pte, sun4c_set_pte, BTFIXUPCALL_STO1O0);
 
-       /* The 2.4.18 code does not set this on sun4c, how does it work? XXX */
-       /* BTFIXUPSET_SETHI(none_mask, 0x00000000); */  /* Defaults to zero? */
-
        BTFIXUPSET_CALL(pte_pfn, sun4c_pte_pfn, BTFIXUPCALL_NORM);
 #if 0 /* PAGE_SHIFT <= 12 */ /* Eek. Investigate. XXX */
        BTFIXUPSET_CALL(pmd_page, sun4c_pmd_page, BTFIXUPCALL_ANDNINT(PAGE_SIZE - 1));
index 2e837f5080fe56d3ad0c87d308564cf157147624..fb7a5f052e2b8766d11115e3f7fc174fadf6ac2f 100644 (file)
@@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
                percpu_entry->states[cx->index].eax = cx->address;
                percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK;
        }
+
+       /*
+        * For _CST FFH on Intel, if GAS.access_size bit 1 is cleared,
+        * then we should skip checking BM_STS for this C-state.
+        * ref: "Intel Processor Vendor-Specific ACPI Interface Specification"
+        */
+       if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2))
+               cx->bm_sts_skip = 1;
+
        return retval;
 }
 EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe);
index 82e508677b91116ec8428e434ae164a8390084bf..fcc3c61fdecc0a8e73859868f5f863c9fdb315e3 100644 (file)
@@ -157,9 +157,14 @@ static int __init acpi_sleep_setup(char *str)
 #ifdef CONFIG_HIBERNATION
                if (strncmp(str, "s4_nohwsig", 10) == 0)
                        acpi_no_s4_hw_signature();
-               if (strncmp(str, "s4_nonvs", 8) == 0)
-                       acpi_s4_no_nvs();
+               if (strncmp(str, "s4_nonvs", 8) == 0) {
+                       pr_warning("ACPI: acpi_sleep=s4_nonvs is deprecated, "
+                                       "please use acpi_sleep=nonvs instead");
+                       acpi_nvs_nosave();
+               }
 #endif
+               if (strncmp(str, "nonvs", 5) == 0)
+                       acpi_nvs_nosave();
                if (strncmp(str, "old_ordering", 12) == 0)
                        acpi_old_suspend_ordering();
                str = strchr(str, ',');
index c02cc692985c13b902f1a9c914535170f9670d01..a96489ee6cabf04a53664300f87141c4bbffc293 100644 (file)
@@ -921,7 +921,7 @@ void disable_local_APIC(void)
        unsigned int value;
 
        /* APIC hasn't been mapped yet */
-       if (!apic_phys)
+       if (!x2apic_mode && !apic_phys)
                return;
 
        clear_local_APIC();
index ce7cde713e7174e8293b552b332f968946a46904..a36de5bbb6222e953986ee4f4b34fe4caee1388d 100644 (file)
@@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle)
                return -ENODEV;
 
        out_obj = output.pointer;
-       if (out_obj->type != ACPI_TYPE_BUFFER) {
-               ret = -ENODEV;
-               goto out_free;
-       }
+       if (out_obj->type != ACPI_TYPE_BUFFER)
+               return -ENODEV;
 
        errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
-       if (errors) {
-               ret = -ENODEV;
-               goto out_free;
-       }
+       if (errors)
+               return -ENODEV;
 
        supported = *((u32 *)(out_obj->buffer.pointer + 4));
-       if (!(supported & 0x1)) {
-               ret = -ENODEV;
-               goto out_free;
-       }
+       if (!(supported & 0x1))
+               return -ENODEV;
 
 out_free:
        kfree(output.pointer);
@@ -397,13 +391,17 @@ static int __init pcc_cpufreq_probe(void)
        struct pcc_memory_resource *mem_resource;
        struct pcc_register_resource *reg_resource;
        union acpi_object *out_obj, *member;
-       acpi_handle handle, osc_handle;
+       acpi_handle handle, osc_handle, pcch_handle;
        int ret = 0;
 
        status = acpi_get_handle(NULL, "\\_SB", &handle);
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
+       status = acpi_get_handle(handle, "PCCH", &pcch_handle);
+       if (ACPI_FAILURE(status))
+               return -ENODEV;
+
        status = acpi_get_handle(handle, "_OSC", &osc_handle);
        if (ACPI_SUCCESS(status)) {
                ret = pcc_cpufreq_do_osc(&osc_handle);
@@ -543,13 +541,13 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
        if (!pcch_virt_addr) {
                result = -1;
-               goto pcch_null;
+               goto out;
        }
 
        result = pcc_get_offset(cpu);
        if (result) {
                dprintk("init: PCCP evaluation failed\n");
-               goto free;
+               goto out;
        }
 
        policy->max = policy->cpuinfo.max_freq =
@@ -558,14 +556,15 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
                ioread32(&pcch_hdr->minimum_frequency) * 1000;
        policy->cur = pcc_get_freq(cpu);
 
+       if (!policy->cur) {
+               dprintk("init: Unable to get current CPU frequency\n");
+               result = -EINVAL;
+               goto out;
+       }
+
        dprintk("init: policy->max is %d, policy->min is %d\n",
                policy->max, policy->min);
-
-       return 0;
-free:
-       pcc_clear_mapping();
-       free_percpu(pcc_cpu_info);
-pcch_null:
+out:
        return result;
 }
 
index 7ec2123838e6f70f5af02e6e5804143bcc29090c..3e90cce3dc8bfe50fa245e8febe2aaf2625df25e 100644 (file)
@@ -1023,13 +1023,12 @@ static int get_transition_latency(struct powernow_k8_data *data)
        }
        if (max_latency == 0) {
                /*
-                * Fam 11h always returns 0 as transition latency.
-                * This is intended and means "very fast". While cpufreq core
-                * and governors currently can handle that gracefully, better
-                * set it to 1 to avoid problems in the future.
-                * For all others it's a BIOS bug.
+                * Fam 11h and later may return 0 as transition latency. This
+                * is intended and means "very fast". While cpufreq core and
+                * governors currently can handle that gracefully, better set it
+                * to 1 to avoid problems in the future.
                 */
-               if (boot_cpu_data.x86 != 0x11)
+               if (boot_cpu_data.x86 < 0x11)
                        printk(KERN_ERR FW_WARN PFX "Invalid zero transition "
                                "latency\n");
                max_latency = 1;
index ebdb85cf2686fa36702cd4d50b657f22de85b3bd..e5cc7e82e60ddbf1bd1ca2871fdb7d7fc7628e34 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/apic.h>
 #include <asm/iommu.h>
 #include <asm/gart.h>
+#include <asm/hpet.h>
 
 static void __init fix_hypertransport_config(int num, int slot, int func)
 {
@@ -191,6 +192,21 @@ static void __init ati_bugs_contd(int num, int slot, int func)
 }
 #endif
 
+/*
+ * Force the read back of the CMP register in hpet_next_event()
+ * to work around the problem that the CMP register write seems to be
+ * delayed. See hpet_next_event() for details.
+ *
+ * We do this on all SMBUS incarnations for now until we have more
+ * information about the affected chipsets.
+ */
+static void __init ati_hpet_bugs(int num, int slot, int func)
+{
+#ifdef CONFIG_HPET_TIMER
+       hpet_readback_cmp = 1;
+#endif
+}
+
 #define QFLAG_APPLY_ONCE       0x1
 #define QFLAG_APPLIED          0x2
 #define QFLAG_DONE             (QFLAG_APPLY_ONCE|QFLAG_APPLIED)
@@ -220,6 +236,8 @@ static struct chipset early_qrk[] __initdata = {
          PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs },
        { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS,
          PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd },
+       { PCI_VENDOR_ID_ATI, PCI_ANY_ID,
+         PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_hpet_bugs },
        {}
 };
 
index 0697ff139837644f170f032ae525d9e112c71681..4db7c4d12ffacb0ac5bdfe8d26c2ee1c181e52fc 100644 (file)
@@ -571,8 +571,8 @@ auditsys:
         * masked off.
         */
 sysret_audit:
-       movq %rax,%rsi          /* second arg, syscall return value */
-       cmpq $0,%rax            /* is it < 0? */
+       movq RAX-ARGOFFSET(%rsp),%rsi   /* second arg, syscall return value */
+       cmpq $0,%rsi            /* is it < 0? */
        setl %al                /* 1 if so, 0 if not */
        movzbl %al,%edi         /* zero-extend that into %edi */
        inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */
index a198b7c87a123d2f80c6313261e9b80e8346cad1..ba390d731175a492686643dd873786eafda9521b 100644 (file)
@@ -964,7 +964,7 @@ fs_initcall(hpet_late_init);
 
 void hpet_disable(void)
 {
-       if (is_hpet_capable()) {
+       if (is_hpet_capable() && hpet_virt_address) {
                unsigned int cfg = hpet_readl(HPET_CFG);
 
                if (hpet_legacy_int_enabled) {
index 7c9f02c130f3ca9167e81205f39c968174a8e9ef..cafa7c80ac95714e7097ba06ff195cd6f285417f 100644 (file)
@@ -276,16 +276,6 @@ static struct sys_device device_i8259A = {
        .cls    = &i8259_sysdev_class,
 };
 
-static int __init i8259A_init_sysfs(void)
-{
-       int error = sysdev_class_register(&i8259_sysdev_class);
-       if (!error)
-               error = sysdev_register(&device_i8259A);
-       return error;
-}
-
-device_initcall(i8259A_init_sysfs);
-
 static void mask_8259A(void)
 {
        unsigned long flags;
@@ -407,3 +397,18 @@ struct legacy_pic default_legacy_pic = {
 };
 
 struct legacy_pic *legacy_pic = &default_legacy_pic;
+
+static int __init i8259A_init_sysfs(void)
+{
+       int error;
+
+       if (legacy_pic != &default_legacy_pic)
+               return 0;
+
+       error = sysdev_class_register(&i8259_sysdev_class);
+       if (!error)
+               error = sysdev_register(&device_i8259A);
+       return error;
+}
+
+device_initcall(i8259A_init_sysfs);
index 4f4af75b94828af47b811b6b5c6a45e7c4ae650e..01ab17ae2ae72c7bdf2d2c4de2a51f19f59755bf 100644 (file)
@@ -572,7 +572,6 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd)
        return NOTIFY_STOP;
 }
 
-#ifdef CONFIG_KGDB_LOW_LEVEL_TRAP
 int kgdb_ll_trap(int cmd, const char *str,
                 struct pt_regs *regs, long err, int trap, int sig)
 {
@@ -590,7 +589,6 @@ int kgdb_ll_trap(int cmd, const char *str,
 
        return __kgdb_notify(&args, cmd);
 }
-#endif /* CONFIG_KGDB_LOW_LEVEL_TRAP */
 
 static int
 kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr)
@@ -625,6 +623,12 @@ int kgdb_arch_init(void)
        return register_die_notifier(&kgdb_notifier);
 }
 
+static void kgdb_hw_overflow_handler(struct perf_event *event, int nmi,
+               struct perf_sample_data *data, struct pt_regs *regs)
+{
+       kgdb_ll_trap(DIE_DEBUG, "debug", regs, 0, 0, SIGTRAP);
+}
+
 void kgdb_arch_late(void)
 {
        int i, cpu;
@@ -655,6 +659,7 @@ void kgdb_arch_late(void)
                for_each_online_cpu(cpu) {
                        pevent = per_cpu_ptr(breakinfo[i].pev, cpu);
                        pevent[0]->hw.sample_period = 1;
+                       pevent[0]->overflow_handler = kgdb_hw_overflow_handler;
                        if (pevent[0]->destroy != NULL) {
                                pevent[0]->destroy = NULL;
                                release_bp_slot(*pevent);
index 345a4b1fe1446812d65e25fd424886d05aeb1fe4..675879b65ce666c91b868c96972ea35f107810f4 100644 (file)
@@ -640,8 +640,8 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
        /* Skip cs, ip, orig_ax and gs. */      \
        "       subl $16, %esp\n"       \
        "       pushl %fs\n"            \
-       "       pushl %ds\n"            \
        "       pushl %es\n"            \
+       "       pushl %ds\n"            \
        "       pushl %eax\n"           \
        "       pushl %ebp\n"           \
        "       pushl %edi\n"           \
index e72d3fc6547d6fe767785e869deb90ea683d8cdc..939b9e98245f733262cdee8198daa08498abf87e 100644 (file)
@@ -498,15 +498,10 @@ void force_hpet_resume(void)
  * See erratum #27 (Misinterpreted MSI Requests May Result in
  * Corrupted LPC DMA Data) in AMD Publication #46837,
  * "SB700 Family Product Errata", Rev. 1.0, March 2010.
- *
- * Also force the read back of the CMP register in hpet_next_event()
- * to work around the problem that the CMP register write seems to be
- * delayed. See hpet_next_event() for details.
  */
 static void force_disable_hpet_msi(struct pci_dev *unused)
 {
        hpet_msi_disable = 1;
-       hpet_readback_cmp = 1;
 }
 
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS,
index de3b63ae3da26300297e315a6f7a9b5157d429ee..a60df9ae645440789181acd318e12bd4c450aeff 100644 (file)
@@ -238,6 +238,15 @@ void __init setup_per_cpu_areas(void)
 #ifdef CONFIG_NUMA
                per_cpu(x86_cpu_to_node_map, cpu) =
                        early_per_cpu_map(x86_cpu_to_node_map, cpu);
+               /*
+                * Ensure that the boot cpu numa_node is correct when the boot
+                * cpu is on a node that doesn't have memory installed.
+                * Also cpu_up() will call cpu_to_node() for APs when
+                * MEMORY_HOTPLUG is defined, before per_cpu(numa_node) is set
+                * up later with c_init aka intel_init/amd_init.
+                * So set them all (boot cpu and all APs).
+                */
+               set_cpu_numa_node(cpu, early_cpu_to_node(cpu));
 #endif
 #endif
                /*
@@ -257,14 +266,6 @@ void __init setup_per_cpu_areas(void)
        early_per_cpu_ptr(x86_cpu_to_node_map) = NULL;
 #endif
 
-#if defined(CONFIG_X86_64) && defined(CONFIG_NUMA)
-       /*
-        * make sure boot cpu numa_node is right, when boot cpu is on the
-        * node that doesn't have mem installed
-        */
-       set_cpu_numa_node(boot_cpu_id, early_cpu_to_node(boot_cpu_id));
-#endif
-
        /* Setup node to cpumask map */
        setup_node_to_cpumask_map();
 
index 3699613e88304d81cb4774c5ee69e1e4464d8a1f..b1ed0a1a591338c801d49268c2f784477fd4a0a1 100644 (file)
@@ -2926,7 +2926,7 @@ static int kvm_mmu_remove_some_alloc_mmu_pages(struct kvm *kvm)
        return kvm_mmu_zap_page(kvm, page) + 1;
 }
 
-static int mmu_shrink(int nr_to_scan, gfp_t gfp_mask)
+static int mmu_shrink(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask)
 {
        struct kvm *kvm;
        struct kvm *kvm_freed = NULL;
index 89d66ca4d87cb2982ae48c5877580e733ab0cce8..2331bdc2b549569e56f7dcec275c72bf06275928 100644 (file)
@@ -342,6 +342,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
                        /* advance table_gfn when emulating 1gb pages with 4k */
                        if (delta == 0)
                                table_gfn += PT_INDEX(addr, level);
+                       access &= gw->pte_access;
                } else {
                        direct = 0;
                        table_gfn = gw->table_gfn[level - 2];
index 05d571f6f19615cab8a90dec413e0a39537e914a..7fa89c39c64f67df0a62804cfa242ae6a2d6f638 100644 (file)
@@ -1562,7 +1562,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
 
        r = -ENOMEM;
        size = sizeof(struct kvm_msr_entry) * msrs.nmsrs;
-       entries = vmalloc(size);
+       entries = kmalloc(size, GFP_KERNEL);
        if (!entries)
                goto out;
 
@@ -1581,7 +1581,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
        r = n;
 
 out_free:
-       vfree(entries);
+       kfree(entries);
 out:
        return r;
 }
index 6fdb3ec30c3197e15fc54e18c91291f5eb403450..55253095be84c66d37c5dcaaba63bd4ebaee6df2 100644 (file)
@@ -184,6 +184,7 @@ static void __init pcibios_allocate_resources(int pass)
                                        idx, r, disabled, pass);
                                if (pci_claim_resource(dev, idx) < 0) {
                                        /* We'll assign a new address later */
+                                       dev->fw_addr[idx] = r->start;
                                        r->end -= r->start;
                                        r->start = 0;
                                }
index 7ef3a2735df39f2fdfbd4624a440e22d3e169879..cb29191cee5877824391a33de0cea9c5255f2c55 100644 (file)
@@ -66,8 +66,9 @@ static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn)
                                          devfn, pos, 4, &pcie_cap))
                        return 0;
 
-               if (pcie_cap == 0xffffffff)
-                       return 0;
+               if (PCI_EXT_CAP_ID(pcie_cap) == 0x0000 ||
+                       PCI_EXT_CAP_ID(pcie_cap) == 0xffff)
+                       break;
 
                if (PCI_EXT_CAP_ID(pcie_cap) == PCI_EXT_CAP_ID_VNDR) {
                        raw_pci_ext_ops->read(pci_domain_nr(bus), bus->number,
@@ -76,7 +77,7 @@ static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn)
                                return pos;
                }
 
-               pos = pcie_cap >> 20;
+               pos = PCI_EXT_CAP_NEXT(pcie_cap);
        }
 
        return 0;
index 98a66103f4f23b1aafaec67e66116e74e1bf0c8c..a854df2a5a4b860b223d6ad49f45255b0678e970 100644 (file)
@@ -165,7 +165,7 @@ static inline int ablkcipher_next_slow(struct ablkcipher_request *req,
 
        p = kmalloc(n, GFP_ATOMIC);
        if (!p)
-               ablkcipher_walk_done(req, walk, -ENOMEM);
+               return ablkcipher_walk_done(req, walk, -ENOMEM);
 
        base = p + 1;
 
index d97b8dce16681ba90886a3b0e5546cf5b7060ce8..18b3f1468b7daeebd94dbe43216a4078951d9972 100644 (file)
@@ -70,6 +70,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
 acpi_status acpi_enable(void)
 {
        acpi_status status;
+       int retry;
 
        ACPI_FUNCTION_TRACE(acpi_enable);
 
@@ -98,16 +99,18 @@ acpi_status acpi_enable(void)
 
        /* Sanity check that transition succeeded */
 
-       if (acpi_hw_get_mode() != ACPI_SYS_MODE_ACPI) {
-               ACPI_ERROR((AE_INFO,
-                           "Hardware did not enter ACPI mode"));
-               return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
+       for (retry = 0; retry < 30000; ++retry) {
+               if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) {
+                       if (retry != 0)
+                               ACPI_WARNING((AE_INFO,
+                               "Platform took > %d00 usec to enter ACPI mode", retry));
+                       return_ACPI_STATUS(AE_OK);
+               }
+               acpi_os_stall(100);     /* 100 usec */
        }
 
-       ACPI_DEBUG_PRINT((ACPI_DB_INIT,
-                         "Transition to ACPI mode successful\n"));
-
-       return_ACPI_STATUS(AE_OK);
+       ACPI_ERROR((AE_INFO, "Hardware did not enter ACPI mode"));
+       return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_enable)
index 3026e3fa83efc82923daf64e1f00fd2b59f23848..dc58402b0a177a4e03e8dc54e7a094804edc1d36 100644 (file)
@@ -868,9 +868,15 @@ static void acpi_battery_remove_fs(struct acpi_device *device)
 static void acpi_battery_notify(struct acpi_device *device, u32 event)
 {
        struct acpi_battery *battery = acpi_driver_data(device);
+#ifdef CONFIG_ACPI_SYSFS_POWER
+       struct device *old;
+#endif
 
        if (!battery)
                return;
+#ifdef CONFIG_ACPI_SYSFS_POWER
+       old = battery->bat.dev;
+#endif
        acpi_battery_update(battery);
        acpi_bus_generate_proc_event(device, event,
                                     acpi_battery_present(battery));
@@ -879,7 +885,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
                                        acpi_battery_present(battery));
 #ifdef CONFIG_ACPI_SYSFS_POWER
        /* acpi_battery_update could remove power_supply object */
-       if (battery->bat.dev)
+       if (old && battery->bat.dev)
                power_supply_changed(&battery->bat);
 #endif
 }
index 01381be05e96b3dda60b1d753b81ecf5dc610dcd..2bb28b9d91c4c2643106ed0d63069ae85799d136 100644 (file)
@@ -214,7 +214,7 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
        .ident = "Sony VGN-SR290J",
        .matches = {
                     DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-                    DMI_MATCH(DMI_PRODUCT_NAME, "Sony VGN-SR290J"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR290J"),
                },
        },
        {
index 51284351418f4a5cb0f176e1475d94db1e5e4b83..e9699aaed1092874b0f275d2ca86a8142850db1c 100644 (file)
@@ -223,7 +223,7 @@ static bool processor_physically_present(acpi_handle handle)
        type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
        cpuid = acpi_get_cpuid(handle, type, acpi_id);
 
-       if (cpuid == -1)
+       if ((cpuid == -1) && (num_possible_cpus() > 1))
                return false;
 
        return true;
index b1b385692f46e09f05dd55882ed3ea9c73039b74..e9a8026d39f091444ddcf90446f008fc407cc9c8 100644 (file)
@@ -76,14 +76,19 @@ static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER;
 module_param(max_cstate, uint, 0000);
 static unsigned int nocst __read_mostly;
 module_param(nocst, uint, 0000);
+static int bm_check_disable __read_mostly;
+module_param(bm_check_disable, uint, 0000);
 
 static unsigned int latency_factor __read_mostly = 2;
 module_param(latency_factor, uint, 0644);
 
+#ifdef CONFIG_ACPI_PROCFS
 static u64 us_to_pm_timer_ticks(s64 t)
 {
        return div64_u64(t * PM_TIMER_FREQUENCY, 1000000);
 }
+#endif
+
 /*
  * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3.
  * For now disable this. Probably a bug somewhere else.
@@ -763,6 +768,9 @@ static int acpi_idle_bm_check(void)
 {
        u32 bm_status = 0;
 
+       if (bm_check_disable)
+               return 0;
+
        acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
        if (bm_status)
                acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, 1);
@@ -947,7 +955,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
        if (acpi_idle_suspend)
                return(acpi_idle_enter_c1(dev, state));
 
-       if (acpi_idle_bm_check()) {
+       if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
                if (dev->safe_state) {
                        dev->last_state = dev->safe_state;
                        return dev->safe_state->enter(dev, dev->safe_state);
index 5b7c52e4a00f09001becab5df101e7e5fa4dabc8..2862c781b37266aecee8052dac047aa2bcb31ef2 100644 (file)
@@ -81,6 +81,20 @@ static int acpi_sleep_prepare(u32 acpi_state)
 #ifdef CONFIG_ACPI_SLEEP
 static u32 acpi_target_sleep_state = ACPI_STATE_S0;
 
+/*
+ * The ACPI specification wants us to save NVS memory regions during hibernation
+ * and to restore them during the subsequent resume.  Windows does that also for
+ * suspend to RAM.  However, it is known that this mechanism does not work on
+ * all machines, so we allow the user to disable it with the help of the
+ * 'acpi_sleep=nonvs' kernel command line option.
+ */
+static bool nvs_nosave;
+
+void __init acpi_nvs_nosave(void)
+{
+       nvs_nosave = true;
+}
+
 /*
  * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the
  * user to request that behavior by using the 'acpi_old_suspend_ordering'
@@ -197,8 +211,7 @@ static int acpi_suspend_begin(suspend_state_t pm_state)
        u32 acpi_state = acpi_suspend_states[pm_state];
        int error = 0;
 
-       error = suspend_nvs_alloc();
-
+       error = nvs_nosave ? 0 : suspend_nvs_alloc();
        if (error)
                return error;
 
@@ -388,20 +401,6 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
 #endif /* CONFIG_SUSPEND */
 
 #ifdef CONFIG_HIBERNATION
-/*
- * The ACPI specification wants us to save NVS memory regions during hibernation
- * and to restore them during the subsequent resume.  However, it is not certain
- * if this mechanism is going to work on all machines, so we allow the user to
- * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line
- * option.
- */
-static bool s4_no_nvs;
-
-void __init acpi_s4_no_nvs(void)
-{
-       s4_no_nvs = true;
-}
-
 static unsigned long s4_hardware_signature;
 static struct acpi_table_facs *facs;
 static bool nosigcheck;
@@ -415,7 +414,7 @@ static int acpi_hibernation_begin(void)
 {
        int error;
 
-       error = s4_no_nvs ? 0 : suspend_nvs_alloc();
+       error = nvs_nosave ? 0 : suspend_nvs_alloc();
        if (!error) {
                acpi_target_sleep_state = ACPI_STATE_S4;
                acpi_sleep_tts_switch(acpi_target_sleep_state);
@@ -510,7 +509,7 @@ static int acpi_hibernation_begin_old(void)
        error = acpi_sleep_prepare(ACPI_STATE_S4);
 
        if (!error) {
-               if (!s4_no_nvs)
+               if (!nvs_nosave)
                        error = suspend_nvs_alloc();
                if (!error)
                        acpi_target_sleep_state = ACPI_STATE_S4;
index f60b2b6a0931d7d7279bfbfe7d29b3ac7ce6efea..d31590e7011bf895092535d15af5df6cc2e62df5 100644 (file)
@@ -122,6 +122,31 @@ static int __init amba_init(void)
 
 postcore_initcall(amba_init);
 
+static int amba_get_enable_pclk(struct amba_device *pcdev)
+{
+       struct clk *pclk = clk_get(&pcdev->dev, "apb_pclk");
+       int ret;
+
+       pcdev->pclk = pclk;
+
+       if (IS_ERR(pclk))
+               return PTR_ERR(pclk);
+
+       ret = clk_enable(pclk);
+       if (ret)
+               clk_put(pclk);
+
+       return ret;
+}
+
+static void amba_put_disable_pclk(struct amba_device *pcdev)
+{
+       struct clk *pclk = pcdev->pclk;
+
+       clk_disable(pclk);
+       clk_put(pclk);
+}
+
 /*
  * These are the device model conversion veneers; they convert the
  * device model structures to our more specific structures.
@@ -130,17 +155,33 @@ static int amba_probe(struct device *dev)
 {
        struct amba_device *pcdev = to_amba_device(dev);
        struct amba_driver *pcdrv = to_amba_driver(dev->driver);
-       struct amba_id *id;
+       struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev);
+       int ret;
 
-       id = amba_lookup(pcdrv->id_table, pcdev);
+       do {
+               ret = amba_get_enable_pclk(pcdev);
+               if (ret)
+                       break;
+
+               ret = pcdrv->probe(pcdev, id);
+               if (ret == 0)
+                       break;
 
-       return pcdrv->probe(pcdev, id);
+               amba_put_disable_pclk(pcdev);
+       } while (0);
+
+       return ret;
 }
 
 static int amba_remove(struct device *dev)
 {
+       struct amba_device *pcdev = to_amba_device(dev);
        struct amba_driver *drv = to_amba_driver(dev->driver);
-       return drv->remove(to_amba_device(dev));
+       int ret = drv->remove(pcdev);
+
+       amba_put_disable_pclk(pcdev);
+
+       return ret;
 }
 
 static void amba_shutdown(struct device *dev)
@@ -203,7 +244,6 @@ static void amba_device_release(struct device *dev)
  */
 int amba_device_register(struct amba_device *dev, struct resource *parent)
 {
-       u32 pid, cid;
        u32 size;
        void __iomem *tmp;
        int i, ret;
@@ -241,25 +281,35 @@ int amba_device_register(struct amba_device *dev, struct resource *parent)
                goto err_release;
        }
 
-       /*
-        * Read pid and cid based on size of resource
-        * they are located at end of region
-        */
-       for (pid = 0, i = 0; i < 4; i++)
-               pid |= (readl(tmp + size - 0x20 + 4 * i) & 255) << (i * 8);
-       for (cid = 0, i = 0; i < 4; i++)
-               cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) << (i * 8);
+       ret = amba_get_enable_pclk(dev);
+       if (ret == 0) {
+               u32 pid, cid;
 
-       iounmap(tmp);
+               /*
+                * Read pid and cid based on size of resource
+                * they are located at end of region
+                */
+               for (pid = 0, i = 0; i < 4; i++)
+                       pid |= (readl(tmp + size - 0x20 + 4 * i) & 255) <<
+                               (i * 8);
+               for (cid = 0, i = 0; i < 4; i++)
+                       cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) <<
+                               (i * 8);
 
-       if (cid == 0xb105f00d)
-               dev->periphid = pid;
+               amba_put_disable_pclk(dev);
 
-       if (!dev->periphid) {
-               ret = -ENODEV;
-               goto err_release;
+               if (cid == 0xb105f00d)
+                       dev->periphid = pid;
+
+               if (!dev->periphid)
+                       ret = -ENODEV;
        }
 
+       iounmap(tmp);
+
+       if (ret)
+               goto err_release;
+
        ret = device_add(&dev->dev);
        if (ret)
                goto err_release;
index 9630fbdf4e6c210eb09a92f4489bb55f60e3b3a7..9b9d3bd54e3a5359f8f0aa3e833ab5380ea11a47 100644 (file)
@@ -673,7 +673,7 @@ static struct kobject *get_device_parent(struct device *dev,
                 */
                if (parent == NULL)
                        parent_kobj = virtual_device_parent(dev);
-               else if (parent->class)
+               else if (parent->class && !dev->class->ns_type)
                        return &parent->kobj;
                else
                        parent_kobj = &parent->kobj;
index 9344216183a433a84210b5ebaef0efd57e6aa9c7..a7547150a705235f75f7949f89ebd99a8e3ba329 100644 (file)
@@ -1216,17 +1216,20 @@ static int intel_i915_get_gtt_size(void)
 
                /* G33's GTT size defined in gmch_ctrl */
                pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl);
-               switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) {
-               case G33_PGETBL_SIZE_1M:
+               switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
+               case I830_GMCH_GMS_STOLEN_512:
+                       size = 512;
+                       break;
+               case I830_GMCH_GMS_STOLEN_1024:
                        size = 1024;
                        break;
-               case G33_PGETBL_SIZE_2M:
-                       size = 2048;
+               case I830_GMCH_GMS_STOLEN_8192:
+                       size = 8*1024;
                        break;
                default:
                        dev_info(&agp_bridge->dev->dev,
                                 "unknown page table size 0x%x, assuming 512KB\n",
-                               (gmch_ctrl & G33_PGETBL_SIZE_MASK));
+                               (gmch_ctrl & I830_GMCH_GMS_MASK));
                        size = 512;
                }
        } else {
index 5d64e3acb000ef62b08921d7f946f9fdfc2d2182..878ac0c2cc6864a84c7df230c5c12efee1944607 100644 (file)
@@ -493,7 +493,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p)
                 sysrq_key_table[i] = op_p;
 }
 
-static void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
+void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
 {
        struct sysrq_key_op *op_p;
        int orig_log_level;
index 24314a9cffe83875858b4d2b4aeb0ab5a68acf21..1030f8420137adb8ff7363eb259f9578026fe178 100644 (file)
@@ -623,7 +623,14 @@ static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg)
 
 static int tpm_tis_pnp_resume(struct pnp_dev *dev)
 {
-       return tpm_pm_resume(&dev->dev);
+       struct tpm_chip *chip = pnp_get_drvdata(dev);
+       int ret;
+
+       ret = tpm_pm_resume(&dev->dev);
+       if (!ret)
+               tpm_continue_selftest(chip);
+
+       return ret;
 }
 
 static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = {
index d7be69f131546b02a1784ac750e4f3dc042e10d1..b7dab32ce63cd883974ac0e9b3646d301460cc7e 100644 (file)
@@ -194,6 +194,6 @@ err_timer:
 
 module_init(cs5535_mfgpt_init);
 
-MODULE_AUTHOR("Andres Salomon <dilinger@collabora.co.uk>");
+MODULE_AUTHOR("Andres Salomon <dilinger@queued.net>");
 MODULE_DESCRIPTION("CS5535/CS5536 MFGPT clock event driver");
 MODULE_LICENSE("GPL");
index 063b2184caf5506fc1e1a83e1cd6c8dc6f22b6c3..938b74ea9ffbee8e6c195baa2eae97520c7a07cb 100644 (file)
@@ -1077,6 +1077,7 @@ err_out_unregister:
 
 err_unlock_policy:
        unlock_policy_rwsem_write(cpu);
+       free_cpumask_var(policy->related_cpus);
 err_free_cpumask:
        free_cpumask_var(policy->cpus);
 err_free_policy:
@@ -1762,17 +1763,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
                        dprintk("governor switch\n");
 
                        /* end old governor */
-                       if (data->governor) {
-                               /*
-                                * Need to release the rwsem around governor
-                                * stop due to lock dependency between
-                                * cancel_delayed_work_sync and the read lock
-                                * taken in the delayed work handler.
-                                */
-                               unlock_policy_rwsem_write(data->cpu);
+                       if (data->governor)
                                __cpufreq_governor(data, CPUFREQ_GOV_STOP);
-                               lock_policy_rwsem_write(data->cpu);
-                       }
 
                        /* start new governor */
                        data->governor = policy->governor;
index 637c105f53d262f904230c77b5bc5a5a5234fda7..bd78acf3c365aa1910a467f3fce882fa26c84841 100644 (file)
@@ -1183,10 +1183,14 @@ static size_t sg_copy_end_to_buffer(struct scatterlist *sgl, unsigned int nents,
                                /* Copy part of this segment */
                                ignore = skip - offset;
                                len = miter.length - ignore;
+                               if (boffset + len > buflen)
+                                       len = buflen - boffset;
                                memcpy(buf + boffset, miter.addr + ignore, len);
                        } else {
-                               /* Copy all of this segment */
+                               /* Copy all of this segment (up to buflen) */
                                len = miter.length;
+                               if (boffset + len > buflen)
+                                       len = buflen - boffset;
                                memcpy(buf + boffset, miter.addr, len);
                        }
                        boffset += len;
index aedef7941b22855f17c892f73d370ae10f17632c..0d2f9dbb47e4fa6d3d3a4440b8427fe544407af3 100644 (file)
@@ -209,7 +209,7 @@ config EDAC_I5100
 
 config EDAC_MPC85XX
        tristate "Freescale MPC83xx / MPC85xx"
-       depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || MPC85xx)
+       depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || PPC_85xx)
        help
          Support for error detection and correction on the Freescale
          MPC8349, MPC8560, MPC8540, MPC8548
index cc9357da0e3442ad9666a415f80b3dd29321b6a0..e0187d16dd7c53fd240b58d62005e4c17df14bc4 100644 (file)
@@ -1300,7 +1300,7 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno,
                if (devno == 0)
                        return -ENODEV;
 
-               i7core_printk(KERN_ERR,
+               i7core_printk(KERN_INFO,
                        "Device not found: dev %02x.%d PCI ID %04x:%04x\n",
                        dev_descr->dev, dev_descr->func,
                        PCI_VENDOR_ID_INTEL, dev_descr->dev_id);
index 52ca09bf4726ae9cb5984d38c79d86705c5b51f8..1052340e6802658db085627f501f3c6102347e67 100644 (file)
@@ -336,6 +336,7 @@ static struct of_device_id mpc85xx_pci_err_of_match[] = {
        },
        {},
 };
+MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match);
 
 static struct of_platform_driver mpc85xx_pci_err_driver = {
        .probe = mpc85xx_pci_err_probe,
@@ -650,6 +651,7 @@ static struct of_device_id mpc85xx_l2_err_of_match[] = {
        { .compatible = "fsl,p2020-l2-cache-controller", },
        {},
 };
+MODULE_DEVICE_TABLE(of, mpc85xx_l2_err_of_match);
 
 static struct of_platform_driver mpc85xx_l2_err_driver = {
        .probe = mpc85xx_l2_err_probe,
@@ -1120,11 +1122,13 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = {
        { .compatible = "fsl,mpc8555-memory-controller", },
        { .compatible = "fsl,mpc8560-memory-controller", },
        { .compatible = "fsl,mpc8568-memory-controller", },
+       { .compatible = "fsl,mpc8569-memory-controller", },
        { .compatible = "fsl,mpc8572-memory-controller", },
        { .compatible = "fsl,mpc8349-memory-controller", },
        { .compatible = "fsl,p2020-memory-controller", },
        {},
 };
+MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match);
 
 static struct of_platform_driver mpc85xx_mc_err_driver = {
        .probe = mpc85xx_mc_err_probe,
index f73a1555e49d7d92fad5da024c4face448a8e114..e23c06893d19f62195247220075aafce1cfa75c0 100644 (file)
@@ -352,6 +352,6 @@ static void __exit cs5535_gpio_exit(void)
 module_init(cs5535_gpio_init);
 module_exit(cs5535_gpio_exit);
 
-MODULE_AUTHOR("Andres Salomon <dilinger@collabora.co.uk>");
+MODULE_AUTHOR("Andres Salomon <dilinger@queued.net>");
 MODULE_DESCRIPTION("AMD CS5535/CS5536 GPIO driver");
 MODULE_LICENSE("GPL");
index 3ca36542e3385b0c62a33b703e637fac31884c93..4e51fe3c1fc4f97594d96fcb9a4e719fa40b8edc 100644 (file)
@@ -893,10 +893,12 @@ EXPORT_SYMBOL_GPL(gpio_sysfs_set_active_low);
 void gpio_unexport(unsigned gpio)
 {
        struct gpio_desc        *desc;
-       int                     status = -EINVAL;
+       int                     status = 0;
 
-       if (!gpio_is_valid(gpio))
+       if (!gpio_is_valid(gpio)) {
+               status = -EINVAL;
                goto done;
+       }
 
        mutex_lock(&sysfs_lock);
 
@@ -911,7 +913,6 @@ void gpio_unexport(unsigned gpio)
                        clear_bit(FLAG_EXPORT, &desc->flags);
                        put_device(dev);
                        device_unregister(dev);
-                       status = 0;
                } else
                        status = -ENODEV;
        }
index aee83fa178f6a6dc60c7273eaaae29b43dbe000d..9214119c01540fb5244d3ca383adb1c5ee04722c 100644 (file)
@@ -605,6 +605,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
                case FBC_NOT_TILED:
                        seq_printf(m, "scanout buffer not tiled");
                        break;
+               case FBC_MULTIPLE_PIPES:
+                       seq_printf(m, "multiple pipes are enabled");
+                       break;
                default:
                        seq_printf(m, "unknown reason");
                }
index f00c5ae9556ccb47358ce1f5267dd9cc5cb17a21..2305a1234f1e5727cf835227ff2422ed930ce097 100644 (file)
@@ -1300,7 +1300,7 @@ static void i915_cleanup_compression(struct drm_device *dev)
        struct drm_i915_private *dev_priv = dev->dev_private;
 
        drm_mm_put_block(dev_priv->compressed_fb);
-       if (!IS_GM45(dev))
+       if (dev_priv->compressed_llb)
                drm_mm_put_block(dev_priv->compressed_llb);
 }
 
index d147ab2f5bfcabfc8bc82cd5ccdea93064fa4cf0..2e1744d37ad59e055f37f5c413c6ad3d6c56e02f 100644 (file)
@@ -215,6 +215,7 @@ enum no_fbc_reason {
        FBC_MODE_TOO_LARGE, /* mode too large for compression */
        FBC_BAD_PLANE, /* fbc not supported on plane */
        FBC_NOT_TILED, /* buffer not tiled */
+       FBC_MULTIPLE_PIPES, /* more than one pipe active */
 };
 
 enum intel_pch {
@@ -222,6 +223,8 @@ enum intel_pch {
        PCH_CPT,        /* Cougarpoint PCH */
 };
 
+#define QUIRK_PIPEA_FORCE (1<<0)
+
 struct intel_fbdev;
 
 typedef struct drm_i915_private {
@@ -337,6 +340,8 @@ typedef struct drm_i915_private {
        /* PCH chipset type */
        enum intel_pch pch_type;
 
+       unsigned long quirks;
+
        /* Register state */
        bool modeset_on_lid;
        u8 saveLBB;
index 074385882ccfe721ff5630b9e825950c6479af7e..5aa747fc25a9b34161ead103fff6bdba37c092a8 100644 (file)
@@ -2241,6 +2241,7 @@ i915_gem_object_get_pages(struct drm_gem_object *obj,
                page = read_cache_page_gfp(mapping, i,
                                           GFP_HIGHUSER |
                                           __GFP_COLD |
+                                          __GFP_RECLAIMABLE |
                                           gfpmask);
                if (IS_ERR(page))
                        goto err_pages;
@@ -3646,6 +3647,7 @@ i915_gem_wait_for_pending_flip(struct drm_device *dev,
        return ret;
 }
 
+
 int
 i915_gem_do_execbuffer(struct drm_device *dev, void *data,
                       struct drm_file *file_priv,
@@ -3793,7 +3795,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
                                unsigned long long total_size = 0;
                                int num_fences = 0;
                                for (i = 0; i < args->buffer_count; i++) {
-                                       obj_priv = object_list[i]->driver_private;
+                                       obj_priv = to_intel_bo(object_list[i]);
 
                                        total_size += object_list[i]->size;
                                        num_fences +=
@@ -4741,6 +4743,16 @@ i915_gem_load(struct drm_device *dev)
        list_add(&dev_priv->mm.shrink_list, &shrink_list);
        spin_unlock(&shrink_list_lock);
 
+       /* On GEN3 we really need to make sure the ARB C3 LP bit is set */
+       if (IS_GEN3(dev)) {
+               u32 tmp = I915_READ(MI_ARB_STATE);
+               if (!(tmp & MI_ARB_C3_LP_WRITE_ENABLE)) {
+                       /* arb state is a masked write, so set bit + bit in mask */
+                       tmp = MI_ARB_C3_LP_WRITE_ENABLE | (MI_ARB_C3_LP_WRITE_ENABLE << MI_ARB_MASK_SHIFT);
+                       I915_WRITE(MI_ARB_STATE, tmp);
+               }
+       }
+
        /* Old X drivers will take 0-2 for front, back, depth buffers */
        if (!drm_core_check_feature(dev, DRIVER_MODESET))
                dev_priv->fence_reg_start = 3;
@@ -4977,7 +4989,7 @@ i915_gpu_is_active(struct drm_device *dev)
 }
 
 static int
-i915_gem_shrink(int nr_to_scan, gfp_t gfp_mask)
+i915_gem_shrink(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask)
 {
        drm_i915_private_t *dev_priv, *next_dev;
        struct drm_i915_gem_object *obj_priv, *next_obj;
index 150400f405346de04d5693bfedc91d36f0a85a2c..cf41c672defe9415fc0b656357cb44af00758b7d 100644 (file)
 #define LM_BURST_LENGTH     0x00000700
 #define LM_FIFO_WATERMARK   0x0000001F
 #define MI_ARB_STATE   0x020e4 /* 915+ only */
+#define   MI_ARB_MASK_SHIFT      16    /* shift for enable bits */
+
+/* Make render/texture TLB fetches lower priorty than associated data
+ *   fetches. This is not turned on by default
+ */
+#define   MI_ARB_RENDER_TLB_LOW_PRIORITY       (1 << 15)
+
+/* Isoch request wait on GTT enable (Display A/B/C streams).
+ * Make isoch requests stall on the TLB update. May cause
+ * display underruns (test mode only)
+ */
+#define   MI_ARB_ISOCH_WAIT_GTT                        (1 << 14)
+
+/* Block grant count for isoch requests when block count is
+ * set to a finite value.
+ */
+#define   MI_ARB_BLOCK_GRANT_MASK              (3 << 12)
+#define   MI_ARB_BLOCK_GRANT_8                 (0 << 12)       /* for 3 display planes */
+#define   MI_ARB_BLOCK_GRANT_4                 (1 << 12)       /* for 2 display planes */
+#define   MI_ARB_BLOCK_GRANT_2                 (2 << 12)       /* for 1 display plane */
+#define   MI_ARB_BLOCK_GRANT_0                 (3 << 12)       /* don't use */
+
+/* Enable render writes to complete in C2/C3/C4 power states.
+ * If this isn't enabled, render writes are prevented in low
+ * power states. That seems bad to me.
+ */
+#define   MI_ARB_C3_LP_WRITE_ENABLE            (1 << 11)
+
+/* This acknowledges an async flip immediately instead
+ * of waiting for 2TLB fetches.
+ */
+#define   MI_ARB_ASYNC_FLIP_ACK_IMMEDIATE      (1 << 10)
+
+/* Enables non-sequential data reads through arbiter
+ */
+#define   MI_ARB_DUAL_DATA_PHASE_DISABLE               (1 << 9)
+
+/* Disable FSB snooping of cacheable write cycles from binner/render
+ * command stream
+ */
+#define   MI_ARB_CACHE_SNOOP_DISABLE           (1 << 8)
+
+/* Arbiter time slice for non-isoch streams */
+#define   MI_ARB_TIME_SLICE_MASK               (7 << 5)
+#define   MI_ARB_TIME_SLICE_1                  (0 << 5)
+#define   MI_ARB_TIME_SLICE_2                  (1 << 5)
+#define   MI_ARB_TIME_SLICE_4                  (2 << 5)
+#define   MI_ARB_TIME_SLICE_6                  (3 << 5)
+#define   MI_ARB_TIME_SLICE_8                  (4 << 5)
+#define   MI_ARB_TIME_SLICE_10                 (5 << 5)
+#define   MI_ARB_TIME_SLICE_14                 (6 << 5)
+#define   MI_ARB_TIME_SLICE_16                 (7 << 5)
+
+/* Low priority grace period page size */
+#define   MI_ARB_LOW_PRIORITY_GRACE_4KB                (0 << 4)        /* default */
+#define   MI_ARB_LOW_PRIORITY_GRACE_8KB                (1 << 4)
+
+/* Disable display A/B trickle feed */
+#define   MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE  (1 << 2)
+
+/* Set display plane priority */
+#define   MI_ARB_DISPLAY_PRIORITY_A_B          (0 << 0)        /* display A > display B */
+#define   MI_ARB_DISPLAY_PRIORITY_B_A          (1 << 0)        /* display B > display A */
+
 #define CACHE_MODE_0   0x02120 /* 915+ only */
 #define   CM0_MASK_SHIFT          16
 #define   CM0_IZ_OPT_DISABLE      (1<<6)
 
 #define PCH_PP_STATUS          0xc7200
 #define PCH_PP_CONTROL         0xc7204
+#define  PANEL_UNLOCK_REGS     (0xabcd << 16)
 #define  EDP_FORCE_VDD         (1 << 3)
 #define  EDP_BLC_ENABLE                (1 << 2)
 #define  PANEL_POWER_RESET     (1 << 1)
index 68dcf36e2793f51fa42aeecb9b67037aa8515205..5e21b31198249349dc5e69265dbe20c8b0a23d02 100644 (file)
@@ -862,8 +862,8 @@ intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
        intel_clock_t clock;
        int max_n;
        bool found;
-       /* approximately equals target * 0.00488 */
-       int err_most = (target >> 8) + (target >> 10);
+       /* approximately equals target * 0.00585 */
+       int err_most = (target >> 8) + (target >> 9);
        found = false;
 
        if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
@@ -1180,8 +1180,12 @@ static void intel_update_fbc(struct drm_crtc *crtc,
        struct drm_framebuffer *fb = crtc->fb;
        struct intel_framebuffer *intel_fb;
        struct drm_i915_gem_object *obj_priv;
+       struct drm_crtc *tmp_crtc;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        int plane = intel_crtc->plane;
+       int crtcs_enabled = 0;
+
+       DRM_DEBUG_KMS("\n");
 
        if (!i915_powersave)
                return;
@@ -1199,10 +1203,21 @@ static void intel_update_fbc(struct drm_crtc *crtc,
         * If FBC is already on, we just have to verify that we can
         * keep it that way...
         * Need to disable if:
+        *   - more than one pipe is active
         *   - changing FBC params (stride, fence, mode)
         *   - new fb is too large to fit in compressed buffer
         *   - going to an unsupported config (interlace, pixel multiply, etc.)
         */
+       list_for_each_entry(tmp_crtc, &dev->mode_config.crtc_list, head) {
+               if (tmp_crtc->enabled)
+                       crtcs_enabled++;
+       }
+       DRM_DEBUG_KMS("%d pipes active\n", crtcs_enabled);
+       if (crtcs_enabled > 1) {
+               DRM_DEBUG_KMS("more than one pipe active, disabling compression\n");
+               dev_priv->no_fbc_reason = FBC_MULTIPLE_PIPES;
+               goto out_disable;
+       }
        if (intel_fb->obj->size > dev_priv->cfb_size) {
                DRM_DEBUG_KMS("framebuffer too large, disabling "
                                "compression\n");
@@ -1255,7 +1270,7 @@ out_disable:
        }
 }
 
-static int
+int
 intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj)
 {
        struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
@@ -2255,6 +2270,11 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode)
                        intel_wait_for_vblank(dev);
                }
 
+               /* Don't disable pipe A or pipe A PLLs if needed */
+               if (pipeconf_reg == PIPEACONF &&
+                   (dev_priv->quirks & QUIRK_PIPEA_FORCE))
+                       goto skip_pipe_off;
+
                /* Next, disable display pipes */
                temp = I915_READ(pipeconf_reg);
                if ((temp & PIPEACONF_ENABLE) != 0) {
@@ -2270,7 +2290,7 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode)
                        I915_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE);
                        I915_READ(dpll_reg);
                }
-
+       skip_pipe_off:
                /* Wait for the clocks to turn off. */
                udelay(150);
                break;
@@ -2356,8 +2376,6 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
                if (mode->clock * 3 > 27000 * 4)
                        return MODE_CLOCK_HIGH;
        }
-
-       drm_mode_set_crtcinfo(adjusted_mode, 0);
        return true;
 }
 
@@ -3736,6 +3754,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
                        if (dev_priv->lvds_dither) {
                                if (HAS_PCH_SPLIT(dev)) {
                                        pipeconf |= PIPE_ENABLE_DITHER;
+                                       pipeconf &= ~PIPE_DITHER_TYPE_MASK;
                                        pipeconf |= PIPE_DITHER_TYPE_ST01;
                                } else
                                        lvds |= LVDS_ENABLE_DITHER;
@@ -4412,7 +4431,8 @@ static void intel_increase_pllclock(struct drm_crtc *crtc, bool schedule)
                DRM_DEBUG_DRIVER("upclocking LVDS\n");
 
                /* Unlock panel regs */
-               I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16));
+               I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) |
+                          PANEL_UNLOCK_REGS);
 
                dpll &= ~DISPLAY_RATE_SELECT_FPA1;
                I915_WRITE(dpll_reg, dpll);
@@ -4455,7 +4475,8 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
                DRM_DEBUG_DRIVER("downclocking LVDS\n");
 
                /* Unlock panel regs */
-               I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16));
+               I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) |
+                          PANEL_UNLOCK_REGS);
 
                dpll |= DISPLAY_RATE_SELECT_FPA1;
                I915_WRITE(dpll_reg, dpll);
@@ -4695,7 +4716,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
        struct drm_gem_object *obj;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        struct intel_unpin_work *work;
-       unsigned long flags;
+       unsigned long flags, offset;
        int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC;
        int ret, pipesrc;
        u32 flip_mask;
@@ -4762,19 +4783,23 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
                while (I915_READ(ISR) & flip_mask)
                        ;
 
+       /* Offset into the new buffer for cases of shared fbs between CRTCs */
+       offset = obj_priv->gtt_offset;
+       offset += (crtc->y * fb->pitch) + (crtc->x * (fb->bits_per_pixel) / 8);
+
        BEGIN_LP_RING(4);
        if (IS_I965G(dev)) {
                OUT_RING(MI_DISPLAY_FLIP |
                         MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
                OUT_RING(fb->pitch);
-               OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode);
+               OUT_RING(offset | obj_priv->tiling_mode);
                pipesrc = I915_READ(pipesrc_reg); 
                OUT_RING(pipesrc & 0x0fff0fff);
        } else {
                OUT_RING(MI_DISPLAY_FLIP_I915 |
                         MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
                OUT_RING(fb->pitch);
-               OUT_RING(obj_priv->gtt_offset);
+               OUT_RING(offset);
                OUT_RING(MI_NOOP);
        }
        ADVANCE_LP_RING();
@@ -5506,6 +5531,66 @@ static void intel_init_display(struct drm_device *dev)
        }
 }
 
+/*
+ * Some BIOSes insist on assuming the GPU's pipe A is enabled at suspend,
+ * resume, or other times.  This quirk makes sure that's the case for
+ * affected systems.
+ */
+static void quirk_pipea_force (struct drm_device *dev)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+
+       dev_priv->quirks |= QUIRK_PIPEA_FORCE;
+       DRM_DEBUG_DRIVER("applying pipe a force quirk\n");
+}
+
+struct intel_quirk {
+       int device;
+       int subsystem_vendor;
+       int subsystem_device;
+       void (*hook)(struct drm_device *dev);
+};
+
+struct intel_quirk intel_quirks[] = {
+       /* HP Compaq 2730p needs pipe A force quirk (LP: #291555) */
+       { 0x2a42, 0x103c, 0x30eb, quirk_pipea_force },
+       /* HP Mini needs pipe A force quirk (LP: #322104) */
+       { 0x27ae,0x103c, 0x361a, quirk_pipea_force },
+
+       /* Thinkpad R31 needs pipe A force quirk */
+       { 0x3577, 0x1014, 0x0505, quirk_pipea_force },
+       /* Toshiba Protege R-205, S-209 needs pipe A force quirk */
+       { 0x2592, 0x1179, 0x0001, quirk_pipea_force },
+
+       /* ThinkPad X30 needs pipe A force quirk (LP: #304614) */
+       { 0x3577,  0x1014, 0x0513, quirk_pipea_force },
+       /* ThinkPad X40 needs pipe A force quirk */
+
+       /* ThinkPad T60 needs pipe A force quirk (bug #16494) */
+       { 0x2782, 0x17aa, 0x201a, quirk_pipea_force },
+
+       /* 855 & before need to leave pipe A & dpll A up */
+       { 0x3582, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
+       { 0x2562, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
+};
+
+static void intel_init_quirks(struct drm_device *dev)
+{
+       struct pci_dev *d = dev->pdev;
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(intel_quirks); i++) {
+               struct intel_quirk *q = &intel_quirks[i];
+
+               if (d->device == q->device &&
+                   (d->subsystem_vendor == q->subsystem_vendor ||
+                    q->subsystem_vendor == PCI_ANY_ID) &&
+                   (d->subsystem_device == q->subsystem_device ||
+                    q->subsystem_device == PCI_ANY_ID))
+                       q->hook(dev);
+       }
+}
+
 void intel_modeset_init(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
@@ -5518,6 +5603,8 @@ void intel_modeset_init(struct drm_device *dev)
 
        dev->mode_config.funcs = (void *)&intel_mode_funcs;
 
+       intel_init_quirks(dev);
+
        intel_init_display(dev);
 
        if (IS_I965G(dev)) {
index 1aac59e83bff0c45a0da94e1f083d40d9e30b396..5dde80f9e652ecc213353c59d6969c277869c874 100644 (file)
@@ -717,6 +717,51 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
        }
 }
 
+static void ironlake_edp_panel_on (struct drm_device *dev)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       unsigned long timeout = jiffies + msecs_to_jiffies(5000);
+       u32 pp, pp_status;
+
+       pp_status = I915_READ(PCH_PP_STATUS);
+       if (pp_status & PP_ON)
+               return;
+
+       pp = I915_READ(PCH_PP_CONTROL);
+       pp |= PANEL_UNLOCK_REGS | POWER_TARGET_ON;
+       I915_WRITE(PCH_PP_CONTROL, pp);
+       do {
+               pp_status = I915_READ(PCH_PP_STATUS);
+       } while (((pp_status & PP_ON) == 0) && !time_after(jiffies, timeout));
+
+       if (time_after(jiffies, timeout))
+               DRM_DEBUG_KMS("panel on wait timed out: 0x%08x\n", pp_status);
+
+       pp &= ~(PANEL_UNLOCK_REGS | EDP_FORCE_VDD);
+       I915_WRITE(PCH_PP_CONTROL, pp);
+}
+
+static void ironlake_edp_panel_off (struct drm_device *dev)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       unsigned long timeout = jiffies + msecs_to_jiffies(5000);
+       u32 pp, pp_status;
+
+       pp = I915_READ(PCH_PP_CONTROL);
+       pp &= ~POWER_TARGET_ON;
+       I915_WRITE(PCH_PP_CONTROL, pp);
+       do {
+               pp_status = I915_READ(PCH_PP_STATUS);
+       } while ((pp_status & PP_ON) && !time_after(jiffies, timeout));
+
+       if (time_after(jiffies, timeout))
+               DRM_DEBUG_KMS("panel off wait timed out\n");
+
+       /* Make sure VDD is enabled so DP AUX will work */
+       pp |= EDP_FORCE_VDD;
+       I915_WRITE(PCH_PP_CONTROL, pp);
+}
+
 static void ironlake_edp_backlight_on (struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
@@ -751,14 +796,18 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode)
        if (mode != DRM_MODE_DPMS_ON) {
                if (dp_reg & DP_PORT_EN) {
                        intel_dp_link_down(intel_encoder, dp_priv->DP);
-                       if (IS_eDP(intel_encoder))
+                       if (IS_eDP(intel_encoder)) {
                                ironlake_edp_backlight_off(dev);
+                               ironlake_edp_panel_off(dev);
+                       }
                }
        } else {
                if (!(dp_reg & DP_PORT_EN)) {
                        intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration);
-                       if (IS_eDP(intel_encoder))
+                       if (IS_eDP(intel_encoder)) {
+                               ironlake_edp_panel_on(dev);
                                ironlake_edp_backlight_on(dev);
+                       }
                }
        }
        dp_priv->dpms_mode = mode;
index 72206f37c4fb847c8d32d80c5c893fd3a68a5faa..2f7970be9051a2c5eb308b9a5a4eebc09e6b636c 100644 (file)
@@ -215,6 +215,9 @@ extern void intel_init_clock_gating(struct drm_device *dev);
 extern void ironlake_enable_drps(struct drm_device *dev);
 extern void ironlake_disable_drps(struct drm_device *dev);
 
+extern int intel_pin_and_fence_fb_obj(struct drm_device *dev,
+                                     struct drm_gem_object *obj);
+
 extern int intel_framebuffer_init(struct drm_device *dev,
                                  struct intel_framebuffer *ifb,
                                  struct drm_mode_fb_cmd *mode_cmd,
index c3c505244e07367c3a8a3cb17698d60ef5ce5407..3e18c9e7729b6a475ce270d3329acf3d54288f1c 100644 (file)
@@ -98,7 +98,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
 
        mutex_lock(&dev->struct_mutex);
 
-       ret = i915_gem_object_pin(fbo, 64*1024);
+       ret = intel_pin_and_fence_fb_obj(dev, fbo);
        if (ret) {
                DRM_ERROR("failed to pin fb: %d\n", ret);
                goto out_unref;
@@ -236,7 +236,7 @@ int intel_fbdev_destroy(struct drm_device *dev,
 
        drm_framebuffer_cleanup(&ifb->base);
        if (ifb->obj)
-               drm_gem_object_unreference_unlocked(ifb->obj);
+               drm_gem_object_unreference(ifb->obj);
 
        return 0;
 }
index 31df55f0a0a7950a0e59ebce556fc30cde35b891..0eab8df5bf7e1c679b52752311e665e51d3ab21d 100644 (file)
@@ -599,6 +599,26 @@ static int intel_lvds_get_modes(struct drm_connector *connector)
        return 0;
 }
 
+static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id)
+{
+       DRM_DEBUG_KMS("Skipping forced modeset for %s\n", id->ident);
+       return 1;
+}
+
+/* The GPU hangs up on these systems if modeset is performed on LID open */
+static const struct dmi_system_id intel_no_modeset_on_lid[] = {
+       {
+               .callback = intel_no_modeset_on_lid_dmi_callback,
+               .ident = "Toshiba Tecra A11",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A11"),
+               },
+       },
+
+       { }     /* terminating entry */
+};
+
 /*
  * Lid events. Note the use of 'modeset_on_lid':
  *  - we set it on lid close, and reset it on open
@@ -622,6 +642,9 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
         */
        if (connector)
                connector->status = connector->funcs->detect(connector);
+       /* Don't force modeset on machines where it causes a GPU lockup */
+       if (dmi_check_system(intel_no_modeset_on_lid))
+               return NOTIFY_OK;
        if (!acpi_lid_open()) {
                dev_priv->modeset_on_lid = 1;
                return NOTIFY_OK;
index fc924b64919529cfccc14a85c3eb28ae0ab8f50d..e492919faf44167b14b97da9537f4aa881eb7969 100644 (file)
@@ -203,36 +203,26 @@ struct methods {
        const bool rw;
 };
 
-static struct methods nv04_methods[] = {
-       { "PROM", load_vbios_prom, false },
-       { "PRAMIN", load_vbios_pramin, true },
-       { "PCIROM", load_vbios_pci, true },
-};
-
-static struct methods nv50_methods[] = {
-       { "ACPI", load_vbios_acpi, true },
+static struct methods shadow_methods[] = {
        { "PRAMIN", load_vbios_pramin, true },
        { "PROM", load_vbios_prom, false },
        { "PCIROM", load_vbios_pci, true },
+       { "ACPI", load_vbios_acpi, true },
 };
 
-#define METHODCNT 3
-
 static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data)
 {
-       struct drm_nouveau_private *dev_priv = dev->dev_private;
-       struct methods *methods;
-       int i;
+       const int nr_methods = ARRAY_SIZE(shadow_methods);
+       struct methods *methods = shadow_methods;
        int testscore = 3;
-       int scores[METHODCNT];
+       int scores[nr_methods], i;
 
        if (nouveau_vbios) {
-               methods = nv04_methods;
-               for (i = 0; i < METHODCNT; i++)
+               for (i = 0; i < nr_methods; i++)
                        if (!strcasecmp(nouveau_vbios, methods[i].desc))
                                break;
 
-               if (i < METHODCNT) {
+               if (i < nr_methods) {
                        NV_INFO(dev, "Attempting to use BIOS image from %s\n",
                                methods[i].desc);
 
@@ -244,12 +234,7 @@ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data)
                NV_ERROR(dev, "VBIOS source \'%s\' invalid\n", nouveau_vbios);
        }
 
-       if (dev_priv->card_type < NV_50)
-               methods = nv04_methods;
-       else
-               methods = nv50_methods;
-
-       for (i = 0; i < METHODCNT; i++) {
+       for (i = 0; i < nr_methods; i++) {
                NV_TRACE(dev, "Attempting to load BIOS image from %s\n",
                         methods[i].desc);
                data[0] = data[1] = 0;  /* avoid reuse of previous image */
@@ -260,7 +245,7 @@ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data)
        }
 
        while (--testscore > 0) {
-               for (i = 0; i < METHODCNT; i++) {
+               for (i = 0; i < nr_methods; i++) {
                        if (scores[i] == testscore) {
                                NV_TRACE(dev, "Using BIOS image from %s\n",
                                         methods[i].desc);
index c9a4a0d2a11593a0d2010bdd979352c4d5cd6003..257ea130ae13a3c7fa0c8d2ca5b60ab5ce79d706 100644 (file)
@@ -387,7 +387,8 @@ int nouveau_fbcon_init(struct drm_device *dev)
        dev_priv->nfbdev = nfbdev;
        nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs;
 
-       ret = drm_fb_helper_init(dev, &nfbdev->helper, 2, 4);
+       ret = drm_fb_helper_init(dev, &nfbdev->helper,
+                                nv_two_heads(dev) ? 2 : 1, 4);
        if (ret) {
                kfree(nfbdev);
                return ret;
index 010963d4570fe1d3fcfa37926e4ad26d17d95148..345a75a03c9639f2fe7e53cd6bf8815a35ba49fe 100644 (file)
@@ -333,7 +333,6 @@ static int evergreen_cs_packet_parse_vline(struct radeon_cs_parser *p)
        header = radeon_get_ib_value(p, h_idx);
        crtc_id = radeon_get_ib_value(p, h_idx + 2 + 7 + 1);
        reg = CP_PACKET0_GET_REG(header);
-       mutex_lock(&p->rdev->ddev->mode_config.mutex);
        obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC);
        if (!obj) {
                DRM_ERROR("cannot find crtc %d\n", crtc_id);
@@ -368,7 +367,6 @@ static int evergreen_cs_packet_parse_vline(struct radeon_cs_parser *p)
                }
        }
 out:
-       mutex_unlock(&p->rdev->ddev->mode_config.mutex);
        return r;
 }
 
index 3970e62eaab8f75582e0838e5770a7346731bff6..a89a15ab524d87d64f734b9475418b0538525dd2 100644 (file)
@@ -1230,7 +1230,6 @@ int r100_cs_packet_parse_vline(struct radeon_cs_parser *p)
        header = radeon_get_ib_value(p, h_idx);
        crtc_id = radeon_get_ib_value(p, h_idx + 5);
        reg = CP_PACKET0_GET_REG(header);
-       mutex_lock(&p->rdev->ddev->mode_config.mutex);
        obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC);
        if (!obj) {
                DRM_ERROR("cannot find crtc %d\n", crtc_id);
@@ -1264,7 +1263,6 @@ int r100_cs_packet_parse_vline(struct radeon_cs_parser *p)
                ib[h_idx + 3] |= RADEON_ENG_DISPLAY_SELECT_CRTC1;
        }
 out:
-       mutex_unlock(&p->rdev->ddev->mode_config.mutex);
        return r;
 }
 
@@ -2354,6 +2352,7 @@ void r100_mc_init(struct radeon_device *rdev)
        if (rdev->flags & RADEON_IS_IGP)
                base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16;
        radeon_vram_location(rdev, &rdev->mc, base);
+       rdev->mc.gtt_base_align = 0;
        if (!(rdev->flags & RADEON_IS_AGP))
                radeon_gtt_location(rdev, &rdev->mc);
        radeon_update_bandwidth_info(rdev);
index 7e81db5eb8041b1c66afe1ade046724abf235805..19a7ef7ee3448f867ec11ab4a0f57f9dfa047013 100644 (file)
@@ -481,6 +481,7 @@ void r300_mc_init(struct radeon_device *rdev)
        if (rdev->flags & RADEON_IS_IGP)
                base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16;
        radeon_vram_location(rdev, &rdev->mc, base);
+       rdev->mc.gtt_base_align = 0;
        if (!(rdev->flags & RADEON_IS_AGP))
                radeon_gtt_location(rdev, &rdev->mc);
        radeon_update_bandwidth_info(rdev);
@@ -1176,6 +1177,8 @@ int r300_cs_parse(struct radeon_cs_parser *p)
        int r;
 
        track = kzalloc(sizeof(*track), GFP_KERNEL);
+       if (track == NULL)
+               return -ENOMEM;
        r100_cs_track_clear(p->rdev, track);
        p->track = track;
        do {
index 34330df2848329c178a9f2a659d44b0596b0bbaf..694af7cc23ac1b3ce91b8abb71ca1d3fdbb58ae2 100644 (file)
@@ -125,6 +125,7 @@ void r520_mc_init(struct radeon_device *rdev)
        r520_vram_get_type(rdev);
        r100_vram_init_sizes(rdev);
        radeon_vram_location(rdev, &rdev->mc, 0);
+       rdev->mc.gtt_base_align = 0;
        if (!(rdev->flags & RADEON_IS_AGP))
                radeon_gtt_location(rdev, &rdev->mc);
        radeon_update_bandwidth_info(rdev);
index 3d6645ce21518a640dd0981e38a67e223e86a49e..e100f69faeec80a0c447ee186774a14ea95620c4 100644 (file)
@@ -1179,6 +1179,7 @@ void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc)
                if (rdev->flags & RADEON_IS_IGP)
                        base = (RREG32(MC_VM_FB_LOCATION) & 0xFFFF) << 24;
                radeon_vram_location(rdev, &rdev->mc, base);
+               rdev->mc.gtt_base_align = 0;
                radeon_gtt_location(rdev, mc);
        }
 }
index f4fb88ece2bbc0221e9a967518a94745fb545be6..ca5c29f707797425f8844c4f464c25a8ecb137cc 100644 (file)
@@ -538,9 +538,12 @@ int
 r600_prepare_blit_copy(struct drm_device *dev, struct drm_file *file_priv)
 {
        drm_radeon_private_t *dev_priv = dev->dev_private;
+       int ret;
        DRM_DEBUG("\n");
 
-       r600_nomm_get_vb(dev);
+       ret = r600_nomm_get_vb(dev);
+       if (ret)
+               return ret;
 
        dev_priv->blit_vb->file_priv = file_priv;
 
index c39c1bc13016075f2bd7151937b3faadc2bf0143..144c32d371362b0a167e1dc9bd95322ddc8614e7 100644 (file)
@@ -585,7 +585,7 @@ static int r600_cs_packet_parse_vline(struct radeon_cs_parser *p)
        header = radeon_get_ib_value(p, h_idx);
        crtc_id = radeon_get_ib_value(p, h_idx + 2 + 7 + 1);
        reg = CP_PACKET0_GET_REG(header);
-       mutex_lock(&p->rdev->ddev->mode_config.mutex);
+
        obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC);
        if (!obj) {
                DRM_ERROR("cannot find crtc %d\n", crtc_id);
@@ -620,7 +620,6 @@ static int r600_cs_packet_parse_vline(struct radeon_cs_parser *p)
                ib[h_idx + 4] = AVIVO_D2MODE_VLINE_STATUS >> 2;
        }
 out:
-       mutex_unlock(&p->rdev->ddev->mode_config.mutex);
        return r;
 }
 
index ab61aaa887bb449c486b59abccb89772b021f35a..2f94dc66c1836f4bf5d6814bb51b5730a13945ad 100644 (file)
@@ -351,6 +351,7 @@ struct radeon_mc {
        int                     vram_mtrr;
        bool                    vram_is_ddr;
        bool                    igp_sideport_enabled;
+       u64                     gtt_base_align;
 };
 
 bool radeon_combios_sideport_present(struct radeon_device *rdev);
index 99bd8a9c56b38f8431510bf3cde781345510feb1..10673ae59cfa10ee8e408de3a9f84e54e2cab7ed 100644 (file)
@@ -280,6 +280,15 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
                }
        }
 
+       /* ASUS HD 3600 board lists the DVI port as HDMI */
+       if ((dev->pdev->device == 0x9598) &&
+           (dev->pdev->subsystem_vendor == 0x1043) &&
+           (dev->pdev->subsystem_device == 0x01e4)) {
+               if (*connector_type == DRM_MODE_CONNECTOR_HDMIA) {
+                       *connector_type = DRM_MODE_CONNECTOR_DVII;
+               }
+       }
+
        /* ASUS HD 3450 board lists the DVI port as HDMI */
        if ((dev->pdev->device == 0x95C5) &&
            (dev->pdev->subsystem_vendor == 0x1043) &&
@@ -1029,8 +1038,15 @@ bool radeon_atombios_sideport_present(struct radeon_device *rdev)
                                      data_offset);
                switch (crev) {
                case 1:
-                       if (igp_info->info.ucMemoryType & 0xf0)
-                               return true;
+                       /* AMD IGPS */
+                       if ((rdev->family == CHIP_RS690) ||
+                           (rdev->family == CHIP_RS740)) {
+                               if (igp_info->info.ulBootUpMemoryClock)
+                                       return true;
+                       } else {
+                               if (igp_info->info.ucMemoryType & 0xf0)
+                                       return true;
+                       }
                        break;
                case 2:
                        if (igp_info->info_2.ucMemoryType & 0x0f)
index d1c1d8dd93ceb045257e35627f1fb429251a8d38..2417d7b06fdb6dae3a6f486fad9a37a6e967b4ed 100644 (file)
@@ -3050,6 +3050,14 @@ void radeon_combios_asic_init(struct drm_device *dev)
            rdev->pdev->subsystem_device == 0x308b)
                return;
 
+       /* quirk for rs4xx HP dv5000 laptop to make it resume
+        * - it hangs on resume inside the dynclk 1 table.
+        */
+       if (rdev->family == CHIP_RS480 &&
+           rdev->pdev->subsystem_vendor == 0x103c &&
+           rdev->pdev->subsystem_device == 0x30a4)
+               return;
+
        /* DYN CLK 1 */
        table = combios_get_table_offset(dev, COMBIOS_DYN_CLK_1_TABLE);
        if (table)
index f58f8bd8f77b0c7f2fc984130d83cfbb3a40c591..adccbc2c202c6b01e22cca3f1ae27dc0334e351b 100644 (file)
@@ -771,14 +771,14 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect
                        } else
                                ret = connector_status_connected;
 
-                       /* multiple connectors on the same encoder with the same ddc line
-                        * This tends to be HDMI and DVI on the same encoder with the
-                        * same ddc line.  If the edid says HDMI, consider the HDMI port
-                        * connected and the DVI port disconnected.  If the edid doesn't
-                        * say HDMI, vice versa.
+                       /* This gets complicated.  We have boards with VGA + HDMI with a
+                        * shared DDC line and we have boards with DVI-D + HDMI with a shared
+                        * DDC line.  The latter is more complex because with DVI<->HDMI adapters
+                        * you don't really know what's connected to which port as both are digital.
                         */
                        if (radeon_connector->shared_ddc && (ret == connector_status_connected)) {
                                struct drm_device *dev = connector->dev;
+                               struct radeon_device *rdev = dev->dev_private;
                                struct drm_connector *list_connector;
                                struct radeon_connector *list_radeon_connector;
                                list_for_each_entry(list_connector, &dev->mode_config.connector_list, head) {
@@ -788,15 +788,10 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect
                                        if (list_radeon_connector->shared_ddc &&
                                            (list_radeon_connector->ddc_bus->rec.i2c_id ==
                                             radeon_connector->ddc_bus->rec.i2c_id)) {
-                                               if (drm_detect_hdmi_monitor(radeon_connector->edid)) {
-                                                       if (connector->connector_type == DRM_MODE_CONNECTOR_DVID) {
-                                                               kfree(radeon_connector->edid);
-                                                               radeon_connector->edid = NULL;
-                                                               ret = connector_status_disconnected;
-                                                       }
-                                               } else {
-                                                       if ((connector->connector_type == DRM_MODE_CONNECTOR_HDMIA) ||
-                                                           (connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)) {
+                                               /* cases where both connectors are digital */
+                                               if (list_connector->connector_type != DRM_MODE_CONNECTOR_VGA) {
+                                                       /* hpd is our only option in this case */
+                                                       if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {
                                                                kfree(radeon_connector->edid);
                                                                radeon_connector->edid = NULL;
                                                                ret = connector_status_disconnected;
index 5f317317aba29dc972331f32994c0acae66e9840..dd279da90546ee03929b02b8bd7095683ef31caf 100644 (file)
@@ -226,20 +226,20 @@ void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc)
 {
        u64 size_af, size_bf;
 
-       size_af = 0xFFFFFFFF - mc->vram_end;
-       size_bf = mc->vram_start;
+       size_af = ((0xFFFFFFFF - mc->vram_end) + mc->gtt_base_align) & ~mc->gtt_base_align;
+       size_bf = mc->vram_start & ~mc->gtt_base_align;
        if (size_bf > size_af) {
                if (mc->gtt_size > size_bf) {
                        dev_warn(rdev->dev, "limiting GTT\n");
                        mc->gtt_size = size_bf;
                }
-               mc->gtt_start = mc->vram_start - mc->gtt_size;
+               mc->gtt_start = (mc->vram_start & ~mc->gtt_base_align) - mc->gtt_size;
        } else {
                if (mc->gtt_size > size_af) {
                        dev_warn(rdev->dev, "limiting GTT\n");
                        mc->gtt_size = size_af;
                }
-               mc->gtt_start = mc->vram_end + 1;
+               mc->gtt_start = (mc->vram_end + 1 + mc->gtt_base_align) & ~mc->gtt_base_align;
        }
        mc->gtt_end = mc->gtt_start + mc->gtt_size - 1;
        dev_info(rdev->dev, "GTT: %lluM 0x%08llX - 0x%08llX\n",
index 6a70c0dc7f92dbb74cdf2e24ac986b14555ef177..ab389f89fa8df7fca6af0a3ca9197c0102dc39f4 100644 (file)
@@ -128,7 +128,8 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                for (i = 0, found = 0; i < rdev->num_crtc; i++) {
                        crtc = (struct drm_crtc *)minfo->crtcs[i];
                        if (crtc && crtc->base.id == value) {
-                               value = i;
+                               struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
+                               value = radeon_crtc->crtc_id;
                                found = 1;
                                break;
                        }
index bad77f40a9dad73e375ef791cfe865604aac61b6..5688a0cf6bbecbea020edd8c96bcc9c70c0b28e5 100644 (file)
@@ -108,6 +108,7 @@ static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode)
                udelay(panel_pwr_delay * 1000);
                WREG32(RADEON_LVDS_GEN_CNTL, lvds_gen_cntl);
                WREG32_PLL(RADEON_PIXCLKS_CNTL, pixclks_cntl);
+               udelay(panel_pwr_delay * 1000);
                break;
        }
 
index f2ed27c8055bc90c0f9004471e063d0e89471801..03204039774308bc01eefdd69616f310b50af739 100644 (file)
@@ -642,8 +642,8 @@ void radeon_legacy_tv_mode_set(struct drm_encoder *encoder,
        }
        flicker_removal = (tmp + 500) / 1000;
 
-       if (flicker_removal < 2)
-               flicker_removal = 2;
+       if (flicker_removal < 3)
+               flicker_removal = 3;
        for (i = 0; i < ARRAY_SIZE(SLOPE_limit); ++i) {
                if (flicker_removal == SLOPE_limit[i])
                        break;
index 9e4240b3bf0bb1ff950b4c74a8e003fc51903e2b..f454c9a5e7f22269a9ffe0618d87f1a74e05f276 100644 (file)
@@ -57,7 +57,9 @@ void rs400_gart_adjust_size(struct radeon_device *rdev)
        }
        if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) {
                /* FIXME: RS400 & RS480 seems to have issue with GART size
-                * if 4G of system memory (needs more testing) */
+                * if 4G of system memory (needs more testing)
+                */
+               /* XXX is this still an issue with proper alignment? */
                rdev->mc.gtt_size = 32 * 1024 * 1024;
                DRM_ERROR("Forcing to 32M GART size (because of ASIC bug ?)\n");
        }
@@ -263,6 +265,7 @@ void rs400_mc_init(struct radeon_device *rdev)
        r100_vram_init_sizes(rdev);
        base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16;
        radeon_vram_location(rdev, &rdev->mc, base);
+       rdev->mc.gtt_base_align = rdev->mc.gtt_size - 1;
        radeon_gtt_location(rdev, &rdev->mc);
        radeon_update_bandwidth_info(rdev);
 }
index 7bb4c3e52f3b055ceafc27471e516477e4a3fa5b..6dc15ea8ba33ce088f273b17eea0f1fc42e537df 100644 (file)
@@ -698,6 +698,7 @@ void rs600_mc_init(struct radeon_device *rdev)
        base = G_000004_MC_FB_START(base) << 16;
        rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
        radeon_vram_location(rdev, &rdev->mc, base);
+       rdev->mc.gtt_base_align = 0;
        radeon_gtt_location(rdev, &rdev->mc);
        radeon_update_bandwidth_info(rdev);
 }
index f4f0a61bcdce3d188dd01a5737120c4e9a0d6432..ce4ecbe108163126c74fb14779eaf90dcf15ce41 100644 (file)
@@ -162,6 +162,7 @@ void rs690_mc_init(struct radeon_device *rdev)
        rs690_pm_info(rdev);
        rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
        radeon_vram_location(rdev, &rdev->mc, base);
+       rdev->mc.gtt_base_align = rdev->mc.gtt_size - 1;
        radeon_gtt_location(rdev, &rdev->mc);
        radeon_update_bandwidth_info(rdev);
 }
index 7d9a7b0a180ac7b735702221450e2a9e12be92fe..0c9c169a6852f453c6703901cd64dc2fb84699e9 100644 (file)
@@ -195,6 +195,7 @@ void rv515_mc_init(struct radeon_device *rdev)
        rv515_vram_get_type(rdev);
        r100_vram_init_sizes(rdev);
        radeon_vram_location(rdev, &rdev->mc, 0);
+       rdev->mc.gtt_base_align = 0;
        if (!(rdev->flags & RADEON_IS_AGP))
                radeon_gtt_location(rdev, &rdev->mc);
        radeon_update_bandwidth_info(rdev);
index b1d67dc973dce9b2f86581f3de139bf2ad34f80b..ca904799f018a6e3ae23c80933bd1e007aec8f7f 100644 (file)
 #include <linux/slab.h>
 
 #include <asm/atomic.h>
-#include <asm/agp.h>
 
 #include "ttm/ttm_bo_driver.h"
 #include "ttm/ttm_page_alloc.h"
 
+#ifdef TTM_HAS_AGP
+#include <asm/agp.h>
+#endif
 
 #define NUM_PAGES_TO_ALLOC             (PAGE_SIZE/sizeof(struct page *))
 #define SMALL_ALLOCATION               16
@@ -392,7 +394,7 @@ static int ttm_pool_get_num_unused_pages(void)
 /**
  * Callback for mm to request pool to reduce number of page held.
  */
-static int ttm_pool_mm_shrink(int shrink_pages, gfp_t gfp_mask)
+static int ttm_pool_mm_shrink(struct shrinker *shrink, int shrink_pages, gfp_t gfp_mask)
 {
        static atomic_t start_pool = ATOMIC_INIT(0);
        unsigned i;
index f1d62611241586f73115a0a8cd60f853837308f6..437ac786277a22520ec9fca32f1488ab6bcdcab4 100644 (file)
@@ -972,6 +972,7 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data,
        ret = copy_from_user(rects, user_rects, rects_size);
        if (unlikely(ret != 0)) {
                DRM_ERROR("Failed to get rects.\n");
+               ret = -EFAULT;
                goto out_free;
        }
 
index fbd62abb66f9dc3017fc4f678dddd28cd889309e..0ffaf2c77a19fa7715af800f43f5fe90ba215fc3 100644 (file)
@@ -89,7 +89,6 @@ struct gc_pad {
 struct gc {
        struct pardevice *pd;
        struct gc_pad pads[GC_MAX_DEVICES];
-       struct input_dev *dev[GC_MAX_DEVICES];
        struct timer_list timer;
        int pad_count[GC_MAX];
        int used;
@@ -387,7 +386,7 @@ static void gc_nes_process_packet(struct gc *gc)
        for (i = 0; i < GC_MAX_DEVICES; i++) {
 
                pad = &gc->pads[i];
-               dev = gc->dev[i];
+               dev = pad->dev;
                s = gc_status_bit[i];
 
                switch (pad->type) {
@@ -579,7 +578,7 @@ static void gc_psx_command(struct gc *gc, int b, unsigned char *data)
                read = parport_read_status(port) ^ 0x80;
 
                for (j = 0; j < GC_MAX_DEVICES; j++) {
-                       struct gc_pad *pad = &gc->pads[i];
+                       struct gc_pad *pad = &gc->pads[j];
 
                        if (pad->type == GC_PSX || pad->type == GC_DDR)
                                data[j] |= (read & gc_status_bit[j]) ? (1 << i) : 0;
index 3525f533e186d3f3cf0e7990d9efa4af90a66d85..1ba25145b333bb79628d2b08c106825ed1c5c5fa 100644 (file)
@@ -124,7 +124,7 @@ config KEYBOARD_ATKBD_RDI_KEYCODES
          right-hand column will be interpreted as the key shown in the
          left-hand column.
 
-config QT2160
+config KEYBOARD_QT2160
        tristate "Atmel AT42QT2160 Touch Sensor Chip"
        depends on I2C && EXPERIMENTAL
        help
index 7aa59e07b6893bead02dcc97bd8035aca08a3773..fb16b5e5ea13fd64a461577778bec1d3e9c04343 100644 (file)
  */
 #define TWL4030_MAX_ROWS       8       /* TWL4030 hard limit */
 #define TWL4030_MAX_COLS       8
-#define TWL4030_ROW_SHIFT      3
-#define TWL4030_KEYMAP_SIZE    (TWL4030_MAX_ROWS * TWL4030_MAX_COLS)
+/*
+ * Note that we add space for an extra column so that we can handle
+ * row lines connected to the gnd (see twl4030_col_xlate()).
+ */
+#define TWL4030_ROW_SHIFT      4
+#define TWL4030_KEYMAP_SIZE    (TWL4030_MAX_ROWS << TWL4030_ROW_SHIFT)
 
 struct twl4030_keypad {
        unsigned short  keymap[TWL4030_KEYMAP_SIZE];
@@ -182,7 +186,7 @@ static int twl4030_read_kp_matrix_state(struct twl4030_keypad *kp, u16 *state)
        return ret;
 }
 
-static int twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state)
+static bool twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state)
 {
        int i;
        u16 check = 0;
@@ -191,12 +195,12 @@ static int twl4030_is_in_ghost_state(struct twl4030_keypad *kp, u16 *key_state)
                u16 col = key_state[i];
 
                if ((col & check) && hweight16(col) > 1)
-                       return 1;
+                       return true;
 
                check |= col;
        }
 
-       return 0;
+       return false;
 }
 
 static void twl4030_kp_scan(struct twl4030_keypad *kp, bool release_all)
@@ -225,7 +229,8 @@ static void twl4030_kp_scan(struct twl4030_keypad *kp, bool release_all)
                if (!changed)
                        continue;
 
-               for (col = 0; col < kp->n_cols; col++) {
+               /* Extra column handles "all gnd" rows */
+               for (col = 0; col < kp->n_cols + 1; col++) {
                        int code;
 
                        if (!(changed & (1 << col)))
index 4ef764cc493c06c49fa135e735ed6dcf2e2aa93e..ee2bf6bcf2912becd87c02023cd4477395fbb63d 100644 (file)
@@ -258,7 +258,7 @@ static struct platform_driver w90p910_keypad_driver = {
        .probe          = w90p910_keypad_probe,
        .remove         = __devexit_p(w90p910_keypad_remove),
        .driver         = {
-               .name   = "nuc900-keypad",
+               .name   = "nuc900-kpi",
                .owner  = THIS_MODULE,
        },
 };
index 40cea334ad13f8159d0f71057680496e42150791..705589dc9ac50678f080f8b6a86dcc8443a573fb 100644 (file)
@@ -141,8 +141,13 @@ static int synaptics_capability(struct psmouse *psmouse)
        priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2];
        priv->ext_cap = priv->ext_cap_0c = 0;
 
-       if (!SYN_CAP_VALID(priv->capabilities))
+       /*
+        * Older firmwares had submodel ID fixed to 0x47
+        */
+       if (SYN_ID_FULL(priv->identity) < 0x705 &&
+           SYN_CAP_SUBMODEL_ID(priv->capabilities) != 0x47) {
                return -1;
+       }
 
        /*
         * Unless capExtended is set the rest of the flags should be ignored
@@ -206,6 +211,7 @@ static int synaptics_resolution(struct psmouse *psmouse)
        unsigned char max[3];
 
        if (SYN_ID_MAJOR(priv->identity) < 4)
+               return 0;
 
        if (synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, res) == 0) {
                if (res[0] != 0 && (res[1] & 0x80) && res[2] != 0) {
index 7d4d5e12c0dfc2ada9bec28e5db82805bc859fed..b6aa7d20d8a35c0c2eb3f313c388bd80b8638f1e 100644 (file)
@@ -47,7 +47,7 @@
 #define SYN_CAP_FOUR_BUTTON(c)         ((c) & (1 << 3))
 #define SYN_CAP_MULTIFINGER(c)         ((c) & (1 << 1))
 #define SYN_CAP_PALMDETECT(c)          ((c) & (1 << 0))
-#define SYN_CAP_VALID(c)               ((((c) & 0x00ff00) >> 8) == 0x47)
+#define SYN_CAP_SUBMODEL_ID(c)         (((c) & 0x00ff00) >> 8)
 #define SYN_EXT_CAP_REQUESTS(c)                (((c) & 0x700000) >> 20)
 #define SYN_CAP_MULTI_BUTTON_NO(ec)    (((ec) & 0x00f000) >> 12)
 #define SYN_CAP_PRODUCT_ID(ec)         (((ec) & 0xff0000) >> 16)
@@ -66,6 +66,7 @@
 #define SYN_ID_MODEL(i)                        (((i) >> 4) & 0x0f)
 #define SYN_ID_MAJOR(i)                        ((i) & 0x0f)
 #define SYN_ID_MINOR(i)                        (((i) >> 16) & 0xff)
+#define SYN_ID_FULL(i)                 ((SYN_ID_MAJOR(i) << 8) | SYN_ID_MINOR(i))
 #define SYN_ID_IS_SYNAPTICS(i)         ((((i) >> 8) & 0xff) == 0x47)
 
 /* synaptics special commands */
index 81003c4739f4f32351566759b9225fdfb974a7b7..ed7ad7416b24d8f40c9cccd61d8371f732b73441 100644 (file)
@@ -169,6 +169,13 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
                        DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
                },
        },
+       {
+               /* Gigabyte Spring Peak - defines wrong chassis type */
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
+               },
+       },
        {
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
index cc18265be1a8f2266480f93841c0530d3e180cea..7a45d68c35166d62d2e2404d3f65644b32cea42c 100644 (file)
@@ -233,7 +233,7 @@ static int __devinit w90x900ts_probe(struct platform_device *pdev)
        w90p910_ts->state = TS_IDLE;
        spin_lock_init(&w90p910_ts->lock);
        setup_timer(&w90p910_ts->timer, w90p910_check_pen_up,
-                   (unsigned long)&w90p910_ts);
+                   (unsigned long)w90p910_ts);
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res) {
index 26386a92f5aafbb614c3308d7c03c05f638cfc15..9b089dfb173ef987f5220d38bce0336c66b92a0f 100644 (file)
@@ -353,6 +353,16 @@ config VMWARE_BALLOON
          To compile this driver as a module, choose M here: the
          module will be called vmware_balloon.
 
+config ARM_CHARLCD
+       bool "ARM Ltd. Character LCD Driver"
+       depends on PLAT_VERSATILE
+       help
+         This is a driver for the character LCD found on the ARM Ltd.
+         Versatile and RealView Platform Baseboards. It doesn't do
+         very much more than display the text "ARM Linux" on the first
+         line and the Linux version on the second line, but that's
+         still useful.
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 source "drivers/misc/cb710/Kconfig"
index 6ed06a19474acc23de3b93b732ecce25b9a55c40..67552d6e932784b2e8c19e8f0c840483a52faa65 100644 (file)
@@ -31,3 +31,4 @@ obj-$(CONFIG_IWMC3200TOP)      += iwmc3200top/
 obj-y                          += eeprom/
 obj-y                          += cb710/
 obj-$(CONFIG_VMWARE_BALLOON)   += vmware_balloon.o
+obj-$(CONFIG_ARM_CHARLCD)      += arm-charlcd.o
diff --git a/drivers/misc/arm-charlcd.c b/drivers/misc/arm-charlcd.c
new file mode 100644 (file)
index 0000000..9e3879e
--- /dev/null
@@ -0,0 +1,396 @@
+/*
+ * Driver for the on-board character LCD found on some ARM reference boards
+ * This is basically an Hitachi HD44780 LCD with a custom IP block to drive it
+ * http://en.wikipedia.org/wiki/HD44780_Character_LCD
+ * Currently it will just display the text "ARM Linux" and the linux version
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ * Author: Linus Walleij <triad@df.lth.se>
+ */
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/completion.h>
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/workqueue.h>
+#include <generated/utsrelease.h>
+
+#define DRIVERNAME "arm-charlcd"
+#define CHARLCD_TIMEOUT (msecs_to_jiffies(1000))
+
+/* Offsets to registers */
+#define CHAR_COM       0x00U
+#define CHAR_DAT       0x04U
+#define CHAR_RD                0x08U
+#define CHAR_RAW       0x0CU
+#define CHAR_MASK      0x10U
+#define CHAR_STAT      0x14U
+
+#define CHAR_RAW_CLEAR 0x00000000U
+#define CHAR_RAW_VALID 0x00000100U
+
+/* Hitachi HD44780 display commands */
+#define HD_CLEAR                       0x01U
+#define HD_HOME                                0x02U
+#define HD_ENTRYMODE                   0x04U
+#define HD_ENTRYMODE_INCREMENT         0x02U
+#define HD_ENTRYMODE_SHIFT             0x01U
+#define HD_DISPCTRL                    0x08U
+#define HD_DISPCTRL_ON                 0x04U
+#define HD_DISPCTRL_CURSOR_ON          0x02U
+#define HD_DISPCTRL_CURSOR_BLINK       0x01U
+#define HD_CRSR_SHIFT                  0x10U
+#define HD_CRSR_SHIFT_DISPLAY          0x08U
+#define HD_CRSR_SHIFT_DISPLAY_RIGHT    0x04U
+#define HD_FUNCSET                     0x20U
+#define HD_FUNCSET_8BIT                        0x10U
+#define HD_FUNCSET_2_LINES             0x08U
+#define HD_FUNCSET_FONT_5X10           0x04U
+#define HD_SET_CGRAM                   0x40U
+#define HD_SET_DDRAM                   0x80U
+#define HD_BUSY_FLAG                   0x80U
+
+/**
+ * @dev: a pointer back to containing device
+ * @phybase: the offset to the controller in physical memory
+ * @physize: the size of the physical page
+ * @virtbase: the offset to the controller in virtual memory
+ * @irq: reserved interrupt number
+ * @complete: completion structure for the last LCD command
+ */
+struct charlcd {
+       struct device *dev;
+       u32 phybase;
+       u32 physize;
+       void __iomem *virtbase;
+       int irq;
+       struct completion complete;
+       struct delayed_work init_work;
+};
+
+static irqreturn_t charlcd_interrupt(int irq, void *data)
+{
+       struct charlcd *lcd = data;
+       u8 status;
+
+       status = readl(lcd->virtbase + CHAR_STAT) & 0x01;
+       /* Clear IRQ */
+       writel(CHAR_RAW_CLEAR, lcd->virtbase + CHAR_RAW);
+       if (status)
+               complete(&lcd->complete);
+       else
+               dev_info(lcd->dev, "Spurious IRQ (%02x)\n", status);
+       return IRQ_HANDLED;
+}
+
+
+static void charlcd_wait_complete_irq(struct charlcd *lcd)
+{
+       int ret;
+
+       ret = wait_for_completion_interruptible_timeout(&lcd->complete,
+                                                       CHARLCD_TIMEOUT);
+       /* Disable IRQ after completion */
+       writel(0x00, lcd->virtbase + CHAR_MASK);
+
+       if (ret < 0) {
+               dev_err(lcd->dev,
+                       "wait_for_completion_interruptible_timeout() "
+                       "returned %d waiting for ready\n", ret);
+               return;
+       }
+
+       if (ret == 0) {
+               dev_err(lcd->dev, "charlcd controller timed out "
+                       "waiting for ready\n");
+               return;
+       }
+}
+
+static u8 charlcd_4bit_read_char(struct charlcd *lcd)
+{
+       u8 data;
+       u32 val;
+       int i;
+
+       /* If we can, use an IRQ to wait for the data, else poll */
+       if (lcd->irq >= 0)
+               charlcd_wait_complete_irq(lcd);
+       else {
+               i = 0;
+               val = 0;
+               while (!(val & CHAR_RAW_VALID) && i < 10) {
+                       udelay(100);
+                       val = readl(lcd->virtbase + CHAR_RAW);
+                       i++;
+               }
+
+               writel(CHAR_RAW_CLEAR, lcd->virtbase + CHAR_RAW);
+       }
+       msleep(1);
+
+       /* Read the 4 high bits of the data */
+       data = readl(lcd->virtbase + CHAR_RD) & 0xf0;
+
+       /*
+        * The second read for the low bits does not trigger an IRQ
+        * so in this case we have to poll for the 4 lower bits
+        */
+       i = 0;
+       val = 0;
+       while (!(val & CHAR_RAW_VALID) && i < 10) {
+               udelay(100);
+               val = readl(lcd->virtbase + CHAR_RAW);
+               i++;
+       }
+       writel(CHAR_RAW_CLEAR, lcd->virtbase + CHAR_RAW);
+       msleep(1);
+
+       /* Read the 4 low bits of the data */
+       data |= (readl(lcd->virtbase + CHAR_RD) >> 4) & 0x0f;
+
+       return data;
+}
+
+static bool charlcd_4bit_read_bf(struct charlcd *lcd)
+{
+       if (lcd->irq >= 0) {
+               /*
+                * If we'll use IRQs to wait for the busyflag, clear any
+                * pending flag and enable IRQ
+                */
+               writel(CHAR_RAW_CLEAR, lcd->virtbase + CHAR_RAW);
+               init_completion(&lcd->complete);
+               writel(0x01, lcd->virtbase + CHAR_MASK);
+       }
+       readl(lcd->virtbase + CHAR_COM);
+       return charlcd_4bit_read_char(lcd) & HD_BUSY_FLAG ? true : false;
+}
+
+static void charlcd_4bit_wait_busy(struct charlcd *lcd)
+{
+       int retries = 50;
+
+       udelay(100);
+       while (charlcd_4bit_read_bf(lcd) && retries)
+               retries--;
+       if (!retries)
+               dev_err(lcd->dev, "timeout waiting for busyflag\n");
+}
+
+static void charlcd_4bit_command(struct charlcd *lcd, u8 cmd)
+{
+       u32 cmdlo = (cmd << 4) & 0xf0;
+       u32 cmdhi = (cmd & 0xf0);
+
+       writel(cmdhi, lcd->virtbase + CHAR_COM);
+       udelay(10);
+       writel(cmdlo, lcd->virtbase + CHAR_COM);
+       charlcd_4bit_wait_busy(lcd);
+}
+
+static void charlcd_4bit_char(struct charlcd *lcd, u8 ch)
+{
+       u32 chlo = (ch << 4) & 0xf0;
+       u32 chhi = (ch & 0xf0);
+
+       writel(chhi, lcd->virtbase + CHAR_DAT);
+       udelay(10);
+       writel(chlo, lcd->virtbase + CHAR_DAT);
+       charlcd_4bit_wait_busy(lcd);
+}
+
+static void charlcd_4bit_print(struct charlcd *lcd, int line, const char *str)
+{
+       u8 offset;
+       int i;
+
+       /*
+        * We support line 0, 1
+        * Line 1 runs from 0x00..0x27
+        * Line 2 runs from 0x28..0x4f
+        */
+       if (line == 0)
+               offset = 0;
+       else if (line == 1)
+               offset = 0x28;
+       else
+               return;
+
+       /* Set offset */
+       charlcd_4bit_command(lcd, HD_SET_DDRAM | offset);
+
+       /* Send string */
+       for (i = 0; i < strlen(str) && i < 0x28; i++)
+               charlcd_4bit_char(lcd, str[i]);
+}
+
+static void charlcd_4bit_init(struct charlcd *lcd)
+{
+       /* These commands cannot be checked with the busy flag */
+       writel(HD_FUNCSET | HD_FUNCSET_8BIT, lcd->virtbase + CHAR_COM);
+       msleep(5);
+       writel(HD_FUNCSET | HD_FUNCSET_8BIT, lcd->virtbase + CHAR_COM);
+       udelay(100);
+       writel(HD_FUNCSET | HD_FUNCSET_8BIT, lcd->virtbase + CHAR_COM);
+       udelay(100);
+       /* Go to 4bit mode */
+       writel(HD_FUNCSET, lcd->virtbase + CHAR_COM);
+       udelay(100);
+       /*
+        * 4bit mode, 2 lines, 5x8 font, after this the number of lines
+        * and the font cannot be changed until the next initialization sequence
+        */
+       charlcd_4bit_command(lcd, HD_FUNCSET | HD_FUNCSET_2_LINES);
+       charlcd_4bit_command(lcd, HD_DISPCTRL | HD_DISPCTRL_ON);
+       charlcd_4bit_command(lcd, HD_ENTRYMODE | HD_ENTRYMODE_INCREMENT);
+       charlcd_4bit_command(lcd, HD_CLEAR);
+       charlcd_4bit_command(lcd, HD_HOME);
+       /* Put something useful in the display */
+       charlcd_4bit_print(lcd, 0, "ARM Linux");
+       charlcd_4bit_print(lcd, 1, UTS_RELEASE);
+}
+
+static void charlcd_init_work(struct work_struct *work)
+{
+       struct charlcd *lcd =
+               container_of(work, struct charlcd, init_work.work);
+
+       charlcd_4bit_init(lcd);
+}
+
+static int __init charlcd_probe(struct platform_device *pdev)
+{
+       int ret;
+       struct charlcd *lcd;
+       struct resource *res;
+
+       lcd = kzalloc(sizeof(struct charlcd), GFP_KERNEL);
+       if (!lcd)
+               return -ENOMEM;
+
+       lcd->dev = &pdev->dev;
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!res) {
+               ret = -ENOENT;
+               goto out_no_resource;
+       }
+       lcd->phybase = res->start;
+       lcd->physize = resource_size(res);
+
+       if (request_mem_region(lcd->phybase, lcd->physize,
+                              DRIVERNAME) == NULL) {
+               ret = -EBUSY;
+               goto out_no_memregion;
+       }
+
+       lcd->virtbase = ioremap(lcd->phybase, lcd->physize);
+       if (!lcd->virtbase) {
+               ret = -ENOMEM;
+               goto out_no_remap;
+       }
+
+       lcd->irq = platform_get_irq(pdev, 0);
+       /* If no IRQ is supplied, we'll survive without it */
+       if (lcd->irq >= 0) {
+               if (request_irq(lcd->irq, charlcd_interrupt, IRQF_DISABLED,
+                               DRIVERNAME, lcd)) {
+                       ret = -EIO;
+                       goto out_no_irq;
+               }
+       }
+
+       platform_set_drvdata(pdev, lcd);
+
+       /*
+        * Initialize the display in a delayed work, because
+        * it is VERY slow and would slow down the boot of the system.
+        */
+       INIT_DELAYED_WORK(&lcd->init_work, charlcd_init_work);
+       schedule_delayed_work(&lcd->init_work, 0);
+
+       dev_info(&pdev->dev, "initalized ARM character LCD at %08x\n",
+               lcd->phybase);
+
+       return 0;
+
+out_no_irq:
+       iounmap(lcd->virtbase);
+out_no_remap:
+       platform_set_drvdata(pdev, NULL);
+out_no_memregion:
+       release_mem_region(lcd->phybase, SZ_4K);
+out_no_resource:
+       kfree(lcd);
+       return ret;
+}
+
+static int __exit charlcd_remove(struct platform_device *pdev)
+{
+       struct charlcd *lcd = platform_get_drvdata(pdev);
+
+       if (lcd) {
+               free_irq(lcd->irq, lcd);
+               iounmap(lcd->virtbase);
+               release_mem_region(lcd->phybase, lcd->physize);
+               platform_set_drvdata(pdev, NULL);
+               kfree(lcd);
+       }
+
+       return 0;
+}
+
+static int charlcd_suspend(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct charlcd *lcd = platform_get_drvdata(pdev);
+
+       /* Power the display off */
+       charlcd_4bit_command(lcd, HD_DISPCTRL);
+       return 0;
+}
+
+static int charlcd_resume(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct charlcd *lcd = platform_get_drvdata(pdev);
+
+       /* Turn the display back on */
+       charlcd_4bit_command(lcd, HD_DISPCTRL | HD_DISPCTRL_ON);
+       return 0;
+}
+
+static const struct dev_pm_ops charlcd_pm_ops = {
+       .suspend = charlcd_suspend,
+       .resume = charlcd_resume,
+};
+
+static struct platform_driver charlcd_driver = {
+       .driver = {
+               .name = DRIVERNAME,
+               .owner = THIS_MODULE,
+               .pm = &charlcd_pm_ops,
+       },
+       .remove = __exit_p(charlcd_remove),
+};
+
+static int __init charlcd_init(void)
+{
+       return platform_driver_probe(&charlcd_driver, charlcd_probe);
+}
+
+static void __exit charlcd_exit(void)
+{
+       platform_driver_unregister(&charlcd_driver);
+}
+
+module_init(charlcd_init);
+module_exit(charlcd_exit);
+
+MODULE_AUTHOR("Linus Walleij <triad@df.lth.se>");
+MODULE_DESCRIPTION("ARM Character LCD Driver");
+MODULE_LICENSE("GPL v2");
index 9bec24db4d41385efe8a1c891f0a6e9daf072488..2d44b3300104eb183f902212bf281849dce00186 100644 (file)
@@ -366,6 +366,6 @@ static int __init cs5535_mfgpt_init(void)
 
 module_init(cs5535_mfgpt_init);
 
-MODULE_AUTHOR("Andres Salomon <dilinger@collabora.co.uk>");
+MODULE_AUTHOR("Andres Salomon <dilinger@queued.net>");
 MODULE_DESCRIPTION("CS5535/CS5536 MFGPT timer driver");
 MODULE_LICENSE("GPL");
index af217924a76eb94511fddf7789d5d1a458a2c21b..ad30f074ee151eead0ebe435037fde70055f1d20 100644 (file)
@@ -365,6 +365,26 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 
 static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
 {
+       struct sdhci_host *host =  platform_get_drvdata(pdev);
+       struct sdhci_s3c *sc = sdhci_priv(host);
+       int ptr;
+
+       sdhci_remove_host(host, 1);
+
+       for (ptr = 0; ptr < 3; ptr++) {
+               clk_disable(sc->clk_bus[ptr]);
+               clk_put(sc->clk_bus[ptr]);
+       }
+       clk_disable(sc->clk_io);
+       clk_put(sc->clk_io);
+
+       iounmap(host->ioaddr);
+       release_resource(sc->ioarea);
+       kfree(sc->ioarea);
+
+       sdhci_free_host(host);
+       platform_set_drvdata(pdev, NULL);
+
        return 0;
 }
 
index 8bd23687c530f2e244c7050091d14c05b8fa7901..bb0872a633157157501b5c2312cc6a73d642ed1b 100644 (file)
@@ -1062,6 +1062,10 @@ struct bnx2x {
 
        /* used to synchronize stats collecting */
        int                     stats_state;
+
+       /* used for synchronization of concurrent threads statistics handling */
+       spinlock_t              stats_lock;
+
        /* used by dmae command loader */
        struct dmae_command     stats_dmae;
        int                     executer_idx;
index 57ff5b3bcce6fcd58edc438998ea1bf1ca08ee63..46167c0817274b793348039ea50db4754003b98e 100644 (file)
@@ -57,8 +57,8 @@
 #include "bnx2x_init_ops.h"
 #include "bnx2x_dump.h"
 
-#define DRV_MODULE_VERSION     "1.52.53-1"
-#define DRV_MODULE_RELDATE     "2010/18/04"
+#define DRV_MODULE_VERSION     "1.52.53-2"
+#define DRV_MODULE_RELDATE     "2010/21/07"
 #define BNX2X_BC_VER           0x040200
 
 #include <linux/firmware.h>
@@ -3789,6 +3789,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp)
                struct eth_query_ramrod_data ramrod_data = {0};
                int i, rc;
 
+               spin_lock_bh(&bp->stats_lock);
+
                ramrod_data.drv_counter = bp->stats_counter++;
                ramrod_data.collect_port = bp->port.pmf ? 1 : 0;
                for_each_queue(bp, i)
@@ -3802,6 +3804,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp)
                        bp->spq_left++;
                        bp->stats_pending = 1;
                }
+
+               spin_unlock_bh(&bp->stats_lock);
        }
 }
 
@@ -4367,6 +4371,14 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
        struct host_func_stats *fstats = bnx2x_sp(bp, func_stats);
        struct bnx2x_eth_stats *estats = &bp->eth_stats;
        int i;
+       u16 cur_stats_counter;
+
+       /* Make sure we use the value of the counter
+        * used for sending the last stats ramrod.
+        */
+       spin_lock_bh(&bp->stats_lock);
+       cur_stats_counter = bp->stats_counter - 1;
+       spin_unlock_bh(&bp->stats_lock);
 
        memcpy(&(fstats->total_bytes_received_hi),
               &(bnx2x_sp(bp, func_stats_base)->total_bytes_received_hi),
@@ -4394,25 +4406,22 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
                u32 diff;
 
                /* are storm stats valid? */
-               if ((u16)(le16_to_cpu(xclient->stats_counter) + 1) !=
-                                                       bp->stats_counter) {
+               if (le16_to_cpu(xclient->stats_counter) != cur_stats_counter) {
                        DP(BNX2X_MSG_STATS, "[%d] stats not updated by xstorm"
                           "  xstorm counter (0x%x) != stats_counter (0x%x)\n",
-                          i, xclient->stats_counter, bp->stats_counter);
+                          i, xclient->stats_counter, cur_stats_counter + 1);
                        return -1;
                }
-               if ((u16)(le16_to_cpu(tclient->stats_counter) + 1) !=
-                                                       bp->stats_counter) {
+               if (le16_to_cpu(tclient->stats_counter) != cur_stats_counter) {
                        DP(BNX2X_MSG_STATS, "[%d] stats not updated by tstorm"
                           "  tstorm counter (0x%x) != stats_counter (0x%x)\n",
-                          i, tclient->stats_counter, bp->stats_counter);
+                          i, tclient->stats_counter, cur_stats_counter + 1);
                        return -2;
                }
-               if ((u16)(le16_to_cpu(uclient->stats_counter) + 1) !=
-                                                       bp->stats_counter) {
+               if (le16_to_cpu(uclient->stats_counter) != cur_stats_counter) {
                        DP(BNX2X_MSG_STATS, "[%d] stats not updated by ustorm"
                           "  ustorm counter (0x%x) != stats_counter (0x%x)\n",
-                          i, uclient->stats_counter, bp->stats_counter);
+                          i, uclient->stats_counter, cur_stats_counter + 1);
                        return -4;
                }
 
@@ -4849,16 +4858,18 @@ static const struct {
 
 static void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event)
 {
-       enum bnx2x_stats_state state = bp->stats_state;
+       enum bnx2x_stats_state state;
 
        if (unlikely(bp->panic))
                return;
 
-       bnx2x_stats_stm[state][event].action(bp);
+       /* Protect a state change flow */
+       spin_lock_bh(&bp->stats_lock);
+       state = bp->stats_state;
        bp->stats_state = bnx2x_stats_stm[state][event].next_state;
+       spin_unlock_bh(&bp->stats_lock);
 
-       /* Make sure the state has been "changed" */
-       smp_wmb();
+       bnx2x_stats_stm[state][event].action(bp);
 
        if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp))
                DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n",
@@ -9908,6 +9919,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
 
        mutex_init(&bp->port.phy_mutex);
        mutex_init(&bp->fw_mb_mutex);
+       spin_lock_init(&bp->stats_lock);
 #ifdef BCM_CNIC
        mutex_init(&bp->cnic_mutex);
 #endif
index df483076eda6df4284e9e576fc522a0ff022af11..8d7dfd2f1e90cf1bd7d32fcc1a0aa1da87a61332 100644 (file)
@@ -822,7 +822,7 @@ static int rlb_initialize(struct bonding *bond)
 
        /*initialize packet type*/
        pk_type->type = cpu_to_be16(ETH_P_ARP);
-       pk_type->dev = NULL;
+       pk_type->dev = bond->dev;
        pk_type->func = rlb_arp_recv;
 
        /* register to receive ARPs */
index 1d973db27c32752241eb4ed8355163406e9e9fb7..d7de376d7178ad2b9470797d5cab92846277e363 100644 (file)
@@ -1022,7 +1022,7 @@ static const struct net_device_ops lance_netdev_ops = {
        .ndo_set_mac_address    = eth_mac_addr,
 };
 
-static int __init dec_lance_probe(struct device *bdev, const int type)
+static int __devinit dec_lance_probe(struct device *bdev, const int type)
 {
        static unsigned version_printed;
        static const char fmt[] = "declance%d";
@@ -1326,7 +1326,7 @@ static void __exit dec_lance_platform_remove(void)
 }
 
 #ifdef CONFIG_TC
-static int __init dec_lance_tc_probe(struct device *dev);
+static int __devinit dec_lance_tc_probe(struct device *dev);
 static int __exit dec_lance_tc_remove(struct device *dev);
 
 static const struct tc_device_id dec_lance_tc_table[] = {
@@ -1345,7 +1345,7 @@ static struct tc_driver dec_lance_tc_driver = {
        },
 };
 
-static int __init dec_lance_tc_probe(struct device *dev)
+static int __devinit dec_lance_tc_probe(struct device *dev)
 {
         int status = dec_lance_probe(dev, PMAD_LANCE);
         if (!status)
index 7acb3edc47ef88ba62a2de614213a85518b98274..2602852cc55a6037c5160575f3620632397fcd2c 100644 (file)
@@ -677,7 +677,7 @@ static int ibmveth_close(struct net_device *netdev)
        if (!adapter->pool_config)
                netif_stop_queue(netdev);
 
-       free_irq(netdev->irq, netdev);
+       h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
 
        do {
                lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
@@ -689,6 +689,8 @@ static int ibmveth_close(struct net_device *netdev)
                                     lpar_rc);
        }
 
+       free_irq(netdev->irq, netdev);
+
        adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8);
 
        ibmveth_cleanup(adapter);
index 3881918f5382c4e1305e4c5127bfbb2180bb85cd..cea37e0837ff64d3ed4ae16ccc78f85557be9700 100644 (file)
@@ -1722,6 +1722,15 @@ static int __devinit igb_probe(struct pci_dev *pdev,
        u16 eeprom_apme_mask = IGB_EEPROM_APME;
        u32 part_num;
 
+       /* Catch broken hardware that put the wrong VF device ID in
+        * the PCIe SR-IOV capability.
+        */
+       if (pdev->is_virtfn) {
+               WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n",
+                    pci_name(pdev), pdev->vendor, pdev->device);
+               return -EINVAL;
+       }
+
        err = pci_enable_device_mem(pdev);
        if (err)
                return err;
index 7b5d9764f317c3c776712009dde301c27d9c3b99..74d9b6df3029f3c67e9e85ff5a95a14c5ef6ff0b 100644 (file)
@@ -6492,6 +6492,15 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
 #endif
        u32 part_num, eec;
 
+       /* Catch broken hardware that put the wrong VF device ID in
+        * the PCIe SR-IOV capability.
+        */
+       if (pdev->is_virtfn) {
+               WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n",
+                    pci_name(pdev), pdev->vendor, pdev->device);
+               return -EINVAL;
+       }
+
        err = pci_enable_device_mem(pdev);
        if (err)
                return err;
index 87e8d4cb40579a8947419446012b38896b29064c..f15fe2cf72ae1261fe6d0cde6ca263c2d0c54809 100644 (file)
@@ -499,7 +499,7 @@ static const struct net_device_ops macvlan_netdev_ops = {
        .ndo_validate_addr      = eth_validate_addr,
 };
 
-static void macvlan_setup(struct net_device *dev)
+void macvlan_common_setup(struct net_device *dev)
 {
        ether_setup(dev);
 
@@ -508,6 +508,12 @@ static void macvlan_setup(struct net_device *dev)
        dev->destructor         = free_netdev;
        dev->header_ops         = &macvlan_hard_header_ops,
        dev->ethtool_ops        = &macvlan_ethtool_ops;
+}
+EXPORT_SYMBOL_GPL(macvlan_common_setup);
+
+static void macvlan_setup(struct net_device *dev)
+{
+       macvlan_common_setup(dev);
        dev->tx_queue_len       = 0;
 }
 
@@ -705,7 +711,6 @@ int macvlan_link_register(struct rtnl_link_ops *ops)
        /* common fields */
        ops->priv_size          = sizeof(struct macvlan_dev);
        ops->get_tx_queues      = macvlan_get_tx_queues;
-       ops->setup              = macvlan_setup;
        ops->validate           = macvlan_validate;
        ops->maxtype            = IFLA_MACVLAN_MAX;
        ops->policy             = macvlan_policy;
@@ -719,6 +724,7 @@ EXPORT_SYMBOL_GPL(macvlan_link_register);
 
 static struct rtnl_link_ops macvlan_link_ops = {
        .kind           = "macvlan",
+       .setup          = macvlan_setup,
        .newlink        = macvlan_newlink,
        .dellink        = macvlan_dellink,
 };
index a8a94e2f6ddcfc04917ab2ec39305ac26e69ecf2..ff02b836c3c4a3d23c6b78fc707508b40732d9f8 100644 (file)
@@ -180,11 +180,18 @@ static int macvtap_forward(struct net_device *dev, struct sk_buff *skb)
 {
        struct macvtap_queue *q = macvtap_get_queue(dev, skb);
        if (!q)
-               return -ENOLINK;
+               goto drop;
+
+       if (skb_queue_len(&q->sk.sk_receive_queue) >= dev->tx_queue_len)
+               goto drop;
 
        skb_queue_tail(&q->sk.sk_receive_queue, skb);
        wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND);
-       return 0;
+       return NET_RX_SUCCESS;
+
+drop:
+       kfree_skb(skb);
+       return NET_RX_DROP;
 }
 
 /*
@@ -235,8 +242,15 @@ static void macvtap_dellink(struct net_device *dev,
        macvlan_dellink(dev, head);
 }
 
+static void macvtap_setup(struct net_device *dev)
+{
+       macvlan_common_setup(dev);
+       dev->tx_queue_len = TUN_READQ_SIZE;
+}
+
 static struct rtnl_link_ops macvtap_link_ops __read_mostly = {
        .kind           = "macvtap",
+       .setup          = macvtap_setup,
        .newlink        = macvtap_newlink,
        .dellink        = macvtap_dellink,
 };
index 5b3dfb4ab27985cd8823c08035dd066da36e4d1c..33525bf2a3d3e87f6769ac24c65861441c375dd3 100644 (file)
@@ -1168,6 +1168,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
        int interrupts, nr_serviced = 0, i;
        struct ei_device *ei_local;
        int handled = 0;
+       unsigned long flags;
 
        e8390_base = dev->base_addr;
        ei_local = netdev_priv(dev);
@@ -1176,7 +1177,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
         *      Protect the irq test too.
         */
         
-       spin_lock(&ei_local->page_lock);
+       spin_lock_irqsave(&ei_local->page_lock, flags);
 
        if (ei_local->irqlock) 
        {
@@ -1188,7 +1189,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
                           dev->name, inb_p(e8390_base + EN0_ISR),
                           inb_p(e8390_base + EN0_IMR));
 #endif
-               spin_unlock(&ei_local->page_lock);
+               spin_unlock_irqrestore(&ei_local->page_lock, flags);
                return IRQ_NONE;
        }
     
@@ -1261,7 +1262,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
        ei_local->irqlock = 0;
        outb_p(ENISR_ALL, e8390_base + EN0_IMR);
 
-       spin_unlock(&ei_local->page_lock);
+       spin_unlock_irqrestore(&ei_local->page_lock, flags);
        return IRQ_RETVAL(handled);
 }
 
index 96b6cfbf0a3a682b14216fa23a9e737a48973aaa..cdc6a5c2e70d81955efec9d3c633a593ef943b16 100644 (file)
@@ -1316,7 +1316,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
                { 0x7c800000, 0x28000000,       RTL_GIGA_MAC_VER_26 },
 
                /* 8168C family. */
-               { 0x7cf00000, 0x3ca00000,       RTL_GIGA_MAC_VER_24 },
+               { 0x7cf00000, 0x3cb00000,       RTL_GIGA_MAC_VER_24 },
                { 0x7cf00000, 0x3c900000,       RTL_GIGA_MAC_VER_23 },
                { 0x7cf00000, 0x3c800000,       RTL_GIGA_MAC_VER_18 },
                { 0x7c800000, 0x3c800000,       RTL_GIGA_MAC_VER_24 },
index 5e52c75892dfdb5bd878fb58b1fa715e72be5db3..7f3a53dcc6ef303ca91fa506703074195f549d11 100644 (file)
@@ -65,7 +65,7 @@ static int debug_level = ERR_DBG;
 
 /* DEBUG message print. */
 #define DBG_PRINT(dbg_level, fmt, args...) do {                        \
-       if (dbg_level >= debug_level)                           \
+       if (dbg_level <= debug_level)                           \
                pr_info(fmt, ##args);                           \
        } while (0)
 
index 6ad6fe706312ff4c2cff31034b37428275e2f230..63042596f0cf34962afe9c25133e27b0aa746701 100644 (file)
@@ -736,8 +736,18 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
                                gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
                        else if (sinfo->gso_type & SKB_GSO_UDP)
                                gso.gso_type = VIRTIO_NET_HDR_GSO_UDP;
-                       else
-                               BUG();
+                       else {
+                               printk(KERN_ERR "tun: unexpected GSO type: "
+                                      "0x%x, gso_size %d, hdr_len %d\n",
+                                      sinfo->gso_type, gso.gso_size,
+                                      gso.hdr_len);
+                               print_hex_dump(KERN_ERR, "tun: ",
+                                              DUMP_PREFIX_NONE,
+                                              16, 1, skb->head,
+                                              min((int)gso.hdr_len, 64), true);
+                               WARN_ON_ONCE(1);
+                               return -EINVAL;
+                       }
                        if (sinfo->gso_type & SKB_GSO_TCP_ECN)
                                gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN;
                } else
index 2d7c96d7e865957df251046a7ba5193e94a0c423..eb80243e22df27315f7b271aa71593e4ebe534e9 100644 (file)
@@ -152,6 +152,7 @@ enum {
        /* Device IDs */
        USB_DEVICE_ID_I6050 = 0x0186,
        USB_DEVICE_ID_I6050_2 = 0x0188,
+       USB_DEVICE_ID_I6250 = 0x0187,
 };
 
 
index 0d5081d77dc045f01849676a54d1b13e39ae0b72..d3365ac85dde4639e455b35b65c805cdec1aa552 100644 (file)
@@ -491,6 +491,7 @@ int i2400mu_probe(struct usb_interface *iface,
        switch (id->idProduct) {
        case USB_DEVICE_ID_I6050:
        case USB_DEVICE_ID_I6050_2:
+       case USB_DEVICE_ID_I6250:
                i2400mu->i6050 = 1;
                break;
        default:
@@ -739,6 +740,7 @@ static
 struct usb_device_id i2400mu_id_table[] = {
        { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) },
        { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) },
+       { USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) },
        { USB_DEVICE(0x8086, 0x0181) },
        { USB_DEVICE(0x8086, 0x1403) },
        { USB_DEVICE(0x8086, 0x1405) },
index 77b359162d6cad0a408754fff4cc8b9af64d3063..23c15aa9fbd5167c51e80601eb5213c0dd144283 100644 (file)
@@ -730,13 +730,17 @@ static int ath9k_hif_usb_alloc_urbs(struct hif_device_usb *hif_dev)
 
        /* RX */
        if (ath9k_hif_usb_alloc_rx_urbs(hif_dev) < 0)
-               goto err;
+               goto err_rx;
 
        /* Register Read */
        if (ath9k_hif_usb_alloc_reg_in_urb(hif_dev) < 0)
-               goto err;
+               goto err_reg;
 
        return 0;
+err_reg:
+       ath9k_hif_usb_dealloc_rx_urbs(hif_dev);
+err_rx:
+       ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
 err:
        return -ENOMEM;
 }
index ca6065b71b46fb463c914f61061304177f693d2c..e3e52913d83a49326e3319cd67e1a0275b302d39 100644 (file)
@@ -844,9 +844,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
        int dma_type;
 
        if (edma)
-               dma_type = DMA_FROM_DEVICE;
-       else
                dma_type = DMA_BIDIRECTIONAL;
+       else
+               dma_type = DMA_FROM_DEVICE;
 
        qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP;
        spin_lock_bh(&sc->rx.rxbuflock);
index d24dc7dc072328fcecab649193ed4cbad0c17caa..972a9c3af39e5e7ad11dafa354b5f7314083a985 100644 (file)
@@ -330,6 +330,7 @@ static int prism2_pci_probe(struct pci_dev *pdev,
 
         dev->irq = pdev->irq;
         hw_priv->mem_start = mem;
+       dev->base_addr = (unsigned long) mem;
 
        prism2_pci_cor_sreset(local);
 
index c2a453a1a9917e4e6bb9124b4af0318416ff0f34..dc43ebd1f1fd2eb3012c900456ec30b35b9fbbb5 100644 (file)
@@ -97,6 +97,17 @@ static inline void iwl_clear_driver_stations(struct iwl_priv *priv)
        spin_lock_irqsave(&priv->sta_lock, flags);
        memset(priv->stations, 0, sizeof(priv->stations));
        priv->num_stations = 0;
+
+       /*
+        * Remove all key information that is not stored as part of station
+        * information since mac80211 may not have had a
+        * chance to remove all the keys. When device is reconfigured by
+        * mac80211 after an error all keys will be reconfigured.
+        */
+       priv->ucode_key_table = 0;
+       priv->key_mapping_key = 0;
+       memset(priv->wep_keys, 0, sizeof(priv->wep_keys));
+
        spin_unlock_irqrestore(&priv->sta_lock, flags);
 }
 
index 3ae468c4d7604b3b8e82eac570445bdbf098ab7a..f20d3eeeea7fe0ee4001bf3597255bab1ad9856e 100644 (file)
@@ -853,6 +853,11 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
                    BIT(NL80211_IFTYPE_MESH_POINT) |
                    BIT(NL80211_IFTYPE_WDS);
 
+       /*
+        * Initialize configuration work.
+        */
+       INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled);
+
        /*
         * Let the driver probe the device to detect the capabilities.
         */
@@ -862,11 +867,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
                goto exit;
        }
 
-       /*
-        * Initialize configuration work.
-        */
-       INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled);
-
        /*
         * Allocate queue array.
         */
index 92379e2d37e77ed4797dba23b7402f795dec80e2..2aaa13150de3ba40fd0a65cbb569f1fe96b9a49f 100644 (file)
@@ -156,6 +156,38 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
                                             pcibios_align_resource, dev);
        }
 
+       if (ret < 0 && dev->fw_addr[resno]) {
+               struct resource *root, *conflict;
+               resource_size_t start, end;
+
+               /*
+                * If we failed to assign anything, let's try the address
+                * where firmware left it.  That at least has a chance of
+                * working, which is better than just leaving it disabled.
+                */
+
+               if (res->flags & IORESOURCE_IO)
+                       root = &ioport_resource;
+               else
+                       root = &iomem_resource;
+
+               start = res->start;
+               end = res->end;
+               res->start = dev->fw_addr[resno];
+               res->end = res->start + size - 1;
+               dev_info(&dev->dev, "BAR %d: trying firmware assignment %pR\n",
+                        resno, res);
+               conflict = request_resource_conflict(root, res);
+               if (conflict) {
+                       dev_info(&dev->dev,
+                                "BAR %d: %pR conflicts with %s %pR\n", resno,
+                                res, conflict->name, conflict);
+                       res->start = start;
+                       res->end = end;
+               } else
+                       ret = 0;
+       }
+
        if (!ret) {
                res->flags &= ~IORESOURCE_STARTALIGN;
                dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res);
index 29f91fac1dff81238616a076821191e8c273e01d..a4cd9adfcbc0a543462158b76a796a7f96aa811a 100644 (file)
@@ -857,8 +857,10 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev)
 {
        pcmcia_release_configuration(p_dev);
        pcmcia_release_io(p_dev, &p_dev->io);
-       if (p_dev->_irq)
+       if (p_dev->_irq) {
                free_irq(p_dev->irq, p_dev->priv);
+               p_dev->_irq = 0;
+       }
        if (p_dev->win)
                pcmcia_release_window(p_dev, p_dev->win);
 }
index df4532e91b1a0da9627a7fc5916c2438a5829af1..f370476d5417d49b48540e49432c5f82b97cf53c 100644 (file)
@@ -178,7 +178,6 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
                               unsigned long val,
                               struct cpufreq_freqs *freqs)
 {
-#warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock"
        switch (val) {
        case CPUFREQ_PRECHANGE:
                if (freqs->new > freqs->old) {
@@ -186,7 +185,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
                               "pre-updating\n",
                               freqs->new / 1000, (freqs->new / 100) % 10,
                               freqs->old / 1000, (freqs->old / 100) % 10);
-                       pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
+                       pxa2xx_pcmcia_set_timing(skt);
                }
                break;
 
@@ -196,7 +195,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
                               "post-updating\n",
                               freqs->new / 1000, (freqs->new / 100) % 10,
                               freqs->old / 1000, (freqs->old / 100) % 10);
-                       pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
+                       pxa2xx_pcmcia_set_timing(skt);
                }
                break;
        }
index 40658e3385b45346ddc91132816e28ccfee4dd84..bb2f1fba637b36ec041909a26dd176be6f472c0a 100644 (file)
@@ -489,7 +489,7 @@ int intel_scu_ipc_simple_command(int cmd, int sub)
                mutex_unlock(&ipclock);
                return -ENODEV;
        }
-       ipc_command(cmd << 12 | sub);
+       ipc_command(sub << 12 | cmd);
        err = busy_loop();
        mutex_unlock(&ipclock);
        return err;
@@ -501,9 +501,9 @@ EXPORT_SYMBOL(intel_scu_ipc_simple_command);
  *     @cmd: command
  *     @sub: sub type
  *     @in: input data
- *     @inlen: input length
+ *     @inlen: input length in dwords
  *     @out: output data
- *     @outlein: output length
+ *     @outlein: output length in dwords
  *
  *     Issue a command to the SCU which involves data transfers. Do the
  *     data copies under the lock but leave it for the caller to interpret
@@ -524,7 +524,7 @@ int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen,
        for (i = 0; i < inlen; i++)
                ipc_data_writel(*in++, 4 * i);
 
-       ipc_command((cmd << 12) | sub | (inlen << 18));
+       ipc_command((sub << 12) | cmd | (inlen << 18));
        err = busy_loop();
 
        for (i = 0; i < outlen; i++)
@@ -556,6 +556,10 @@ int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data)
        u32 cmd = 0;
 
        mutex_lock(&ipclock);
+       if (ipcdev.pdev == NULL) {
+               mutex_unlock(&ipclock);
+               return -ENODEV;
+       }
        cmd = (addr >> 24) & 0xFF;
        if (cmd == IPC_I2C_READ) {
                writel(addr, ipcdev.i2c_base + IPC_I2C_CNTRL_ADDR);
index d762a0cbc6af40b2c4aa58bde75e18e514fcd658..84d3c43cf2bc83f92ea05c1a381d113f4f7b6375 100644 (file)
 struct ds278x_info;
 
 struct ds278x_battery_ops {
-       int     (*get_current)(struct ds278x_info *info, int *current_uA);
-       int     (*get_voltage)(struct ds278x_info *info, int *voltage_uA);
-       int     (*get_capacity)(struct ds278x_info *info, int *capacity_uA);
-
+       int (*get_battery_current)(struct ds278x_info *info, int *current_uA);
+       int (*get_battery_voltage)(struct ds278x_info *info, int *voltage_uA);
+       int (*get_battery_capacity)(struct ds278x_info *info, int *capacity_uA);
 };
 
 #define to_ds278x_info(x) container_of(x, struct ds278x_info, battery)
@@ -163,7 +162,7 @@ static int ds2782_get_capacity(struct ds278x_info *info, int *capacity)
        if (err)
                return err;
        *capacity = raw;
-       return raw;
+       return 0;
 }
 
 static int ds2786_get_current(struct ds278x_info *info, int *current_uA)
@@ -213,11 +212,11 @@ static int ds278x_get_status(struct ds278x_info *info, int *status)
        int current_uA;
        int capacity;
 
-       err = info->ops->get_current(info, &current_uA);
+       err = info->ops->get_battery_current(info, &current_uA);
        if (err)
                return err;
 
-       err = info->ops->get_capacity(info, &capacity);
+       err = info->ops->get_battery_capacity(info, &capacity);
        if (err)
                return err;
 
@@ -246,15 +245,15 @@ static int ds278x_battery_get_property(struct power_supply *psy,
                break;
 
        case POWER_SUPPLY_PROP_CAPACITY:
-               ret = info->ops->get_capacity(info, &val->intval);
+               ret = info->ops->get_battery_capacity(info, &val->intval);
                break;
 
        case POWER_SUPPLY_PROP_VOLTAGE_NOW:
-               ret = info->ops->get_voltage(info, &val->intval);
+               ret = info->ops->get_battery_voltage(info, &val->intval);
                break;
 
        case POWER_SUPPLY_PROP_CURRENT_NOW:
-               ret = info->ops->get_current(info, &val->intval);
+               ret = info->ops->get_battery_current(info, &val->intval);
                break;
 
        case POWER_SUPPLY_PROP_TEMP:
@@ -307,14 +306,14 @@ enum ds278x_num_id {
 
 static struct ds278x_battery_ops ds278x_ops[] = {
        [DS2782] = {
-               .get_current  = ds2782_get_current,
-               .get_voltage  = ds2782_get_voltage,
-               .get_capacity = ds2782_get_capacity,
+               .get_battery_current  = ds2782_get_current,
+               .get_battery_voltage  = ds2782_get_voltage,
+               .get_battery_capacity = ds2782_get_capacity,
        },
        [DS2786] = {
-               .get_current  = ds2786_get_current,
-               .get_voltage  = ds2786_get_voltage,
-               .get_capacity = ds2786_get_capacity,
+               .get_battery_current  = ds2786_get_current,
+               .get_battery_voltage  = ds2786_get_voltage,
+               .get_battery_capacity = ds2786_get_capacity,
        }
 };
 
index 7b14a67bdca2df021e99b9615657da7d5bd3b361..11790990277a3dbd9a96ca2ba398f505480f5e19 100644 (file)
@@ -286,7 +286,7 @@ static int ab3100_list_voltage_regulator(struct regulator_dev *reg,
 {
        struct ab3100_regulator *abreg = reg->reg_data;
 
-       if (selector > abreg->voltages_len)
+       if (selector >= abreg->voltages_len)
                return -EINVAL;
        return abreg->typ_voltages[selector];
 }
@@ -318,7 +318,7 @@ static int ab3100_get_voltage_regulator(struct regulator_dev *reg)
        regval &= 0xE0;
        regval >>= 5;
 
-       if (regval > abreg->voltages_len) {
+       if (regval >= abreg->voltages_len) {
                dev_err(&reg->dev,
                        "regulator register %02x contains an illegal voltage setting\n",
                        abreg->regreg);
index 14b4576281c5e7e24fb5652d7383a6bb21df7dfe..8152d65220f5f342a7f312b326aff9c4047620c3 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/tps6507x.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/mfd/tps6507x.h>
@@ -101,9 +102,12 @@ struct tps_info {
        unsigned max_uV;
        u8 table_len;
        const u16 *table;
+
+       /* Does DCDC high or the low register defines output voltage? */
+       bool defdcdc_default;
 };
 
-static const struct tps_info tps6507x_pmic_regs[] = {
+static struct tps_info tps6507x_pmic_regs[] = {
        {
                .name = "VDCDC1",
                .min_uV = 725000,
@@ -145,7 +149,7 @@ struct tps6507x_pmic {
        struct regulator_desc desc[TPS6507X_NUM_REGULATOR];
        struct tps6507x_dev *mfd;
        struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR];
-       const struct tps_info *info[TPS6507X_NUM_REGULATOR];
+       struct tps_info *info[TPS6507X_NUM_REGULATOR];
        struct mutex io_lock;
 };
 static inline int tps6507x_pmic_read(struct tps6507x_pmic *tps, u8 reg)
@@ -341,10 +345,16 @@ static int tps6507x_pmic_dcdc_get_voltage(struct regulator_dev *dev)
                reg = TPS6507X_REG_DEFDCDC1;
                break;
        case TPS6507X_DCDC_2:
-               reg = TPS6507X_REG_DEFDCDC2_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC2_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC2_LOW;
                break;
        case TPS6507X_DCDC_3:
-               reg = TPS6507X_REG_DEFDCDC3_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC3_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC3_LOW;
                break;
        default:
                return -EINVAL;
@@ -370,10 +380,16 @@ static int tps6507x_pmic_dcdc_set_voltage(struct regulator_dev *dev,
                reg = TPS6507X_REG_DEFDCDC1;
                break;
        case TPS6507X_DCDC_2:
-               reg = TPS6507X_REG_DEFDCDC2_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC2_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC2_LOW;
                break;
        case TPS6507X_DCDC_3:
-               reg = TPS6507X_REG_DEFDCDC3_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC3_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC3_LOW;
                break;
        default:
                return -EINVAL;
@@ -532,7 +548,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev)
 {
        struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent);
        static int desc_id;
-       const struct tps_info *info = &tps6507x_pmic_regs[0];
+       struct tps_info *info = &tps6507x_pmic_regs[0];
        struct regulator_init_data *init_data;
        struct regulator_dev *rdev;
        struct tps6507x_pmic *tps;
@@ -569,6 +585,12 @@ int tps6507x_pmic_probe(struct platform_device *pdev)
        for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) {
                /* Register the regulators */
                tps->info[i] = info;
+               if (init_data->driver_data) {
+                       struct tps6507x_reg_platform_data *data =
+                                                       init_data->driver_data;
+                       tps->info[i]->defdcdc_default = data->defdcdc_default;
+               }
+
                tps->desc[i].name = info->name;
                tps->desc[i].id = desc_id++;
                tps->desc[i].n_voltages = num_voltages[i];
index 723cd1fb4867191078e3488ce3ff8267c8ec8f63..0e6ed7db93643436eadaeee5fbc48b7fd8ed599f 100644 (file)
@@ -1495,7 +1495,7 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
        if (ret != 0) {
                dev_err(wm8350->dev, "Failed to register regulator %d: %d\n",
                        reg, ret);
-               platform_device_del(pdev);
+               platform_device_put(pdev);
                wm8350->pmic.pdev[reg] = NULL;
        }
 
index 9718aaaa821534c876240e1f254166f800bbbd7f..600b890a3c150f926be508633c49436cfae1b113 100644 (file)
@@ -168,7 +168,7 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm)
                return -EIO;
        }
 
-       err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG,
+       err = i2c_smbus_write_byte_data(client, RX8581_REG_CTRL,
                (data | RX8581_CTRL_STOP));
        if (err < 0) {
                dev_err(&client->dev, "Unable to write control register\n");
@@ -182,6 +182,20 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm)
                return -EIO;
        }
 
+       /* get VLF and clear it */
+       data = i2c_smbus_read_byte_data(client, RX8581_REG_FLAG);
+       if (data < 0) {
+               dev_err(&client->dev, "Unable to read flag register\n");
+               return -EIO;
+       }
+
+       err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG,
+               (data & ~(RX8581_FLAG_VLF)));
+       if (err != 0) {
+               dev_err(&client->dev, "Unable to write flag register\n");
+               return -EIO;
+       }
+
        /* Restart the clock */
        data = i2c_smbus_read_byte_data(client, RX8581_REG_CTRL);
        if (data < 0) {
@@ -189,8 +203,8 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm)
                return -EIO;
        }
 
-       err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG,
-               (data | ~(RX8581_CTRL_STOP)));
+       err = i2c_smbus_write_byte_data(client, RX8581_REG_CTRL,
+               (data & ~(RX8581_CTRL_STOP)));
        if (err != 0) {
                dev_err(&client->dev, "Unable to write control register\n");
                return -EIO;
index 34d51dd4c53902d79ef3c21434db61923ee79fc8..bed7b4634ccd4648f42c188d8e5e2937534b1f8e 100644 (file)
@@ -948,8 +948,10 @@ static ssize_t dasd_alias_show(struct device *dev,
        if (device->discipline && device->discipline->get_uid &&
            !device->discipline->get_uid(device, &uid)) {
                if (uid.type == UA_BASE_PAV_ALIAS ||
-                   uid.type == UA_HYPER_PAV_ALIAS)
+                   uid.type == UA_HYPER_PAV_ALIAS) {
+                       dasd_put_device(device);
                        return sprintf(buf, "1\n");
+               }
        }
        dasd_put_device(device);
 
index ce7cb87479fe3b8aed786eeea182549da7352b35..407d0e9adfaf96a0d4362f8e56c986f0c17700fa 100644 (file)
@@ -713,7 +713,7 @@ int chsc_determine_base_channel_path_desc(struct chp_id chpid,
        ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, chsc_resp);
        if (ret)
                goto out_free;
-       memcpy(desc, &chsc_resp->data, chsc_resp->length);
+       memcpy(desc, &chsc_resp->data, sizeof(*desc));
 out_free:
        kfree(chsc_resp);
        return ret;
index e3dbeda97179bccc814e424c705a53255ef61f54..fd068bc1bd0a11e5f7f698efa4d84f52a4df3073 100644 (file)
@@ -714,6 +714,14 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act)
        if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED)
                return ZFCP_ERP_FAILED;
 
+       if (mempool_resize(act->adapter->pool.status_read_data,
+                          act->adapter->stat_read_buf_num, GFP_KERNEL))
+               return ZFCP_ERP_FAILED;
+
+       if (mempool_resize(act->adapter->pool.status_read_req,
+                          act->adapter->stat_read_buf_num, GFP_KERNEL))
+               return ZFCP_ERP_FAILED;
+
        atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num);
        if (zfcp_status_read_refill(act->adapter))
                return ZFCP_ERP_FAILED;
index 9ac6a6e4a6047531d142b86256c8266e5c411dfc..71663fb77310b5a51a9331d7210b978a444dd707 100644 (file)
@@ -496,7 +496,8 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req)
 
        adapter->hydra_version = bottom->adapter_type;
        adapter->timer_ticks = bottom->timer_interval;
-       adapter->stat_read_buf_num = max(bottom->status_read_buf_num, (u16)16);
+       adapter->stat_read_buf_num = max(bottom->status_read_buf_num,
+                                        (u16)FSF_STATUS_READS_RECOM);
 
        if (fc_host_permanent_port_name(shost) == -1)
                fc_host_permanent_port_name(shost) = fc_host_port_name(shost);
@@ -719,11 +720,6 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_qdio *qdio,
        zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype,
                           req->qtcb, sizeof(struct fsf_qtcb));
 
-       if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) {
-               zfcp_fsf_req_free(req);
-               return ERR_PTR(-EIO);
-       }
-
        return req;
 }
 
@@ -981,7 +977,7 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req,
        }
 
        /* use single, unchained SBAL if it can hold the request */
-       if (zfcp_qdio_sg_one_sbale(sg_req) || zfcp_qdio_sg_one_sbale(sg_resp)) {
+       if (zfcp_qdio_sg_one_sbale(sg_req) && zfcp_qdio_sg_one_sbale(sg_resp)) {
                zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req,
                                                sg_req, sg_resp);
                return 0;
index 28117e130e2c0848ddb64d3ac5c41c725fcd9bc9..6fa5e0453176e033b6c7367a07908cc15d035f8f 100644 (file)
@@ -251,7 +251,8 @@ static int zfcp_qdio_sbal_check(struct zfcp_qdio *qdio)
        struct zfcp_qdio_queue *req_q = &qdio->req_q;
 
        spin_lock_bh(&qdio->req_q_lock);
-       if (atomic_read(&req_q->count))
+       if (atomic_read(&req_q->count) ||
+           !(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
                return 1;
        spin_unlock_bh(&qdio->req_q_lock);
        return 0;
@@ -274,8 +275,13 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio)
        spin_unlock_bh(&qdio->req_q_lock);
        ret = wait_event_interruptible_timeout(qdio->req_q_wq,
                               zfcp_qdio_sbal_check(qdio), 5 * HZ);
+
+       if (!(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
+               return -EIO;
+
        if (ret > 0)
                return 0;
+
        if (!ret) {
                atomic_inc(&qdio->req_q_full);
                /* assume hanging outbound queue, try queue recovery */
@@ -375,6 +381,8 @@ void zfcp_qdio_close(struct zfcp_qdio *qdio)
        atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status);
        spin_unlock_bh(&qdio->req_q_lock);
 
+       wake_up(&qdio->req_q_wq);
+
        qdio_shutdown(qdio->adapter->ccw_device,
                      QDIO_FLAG_CLEANUP_USING_CLEAR);
 
index d53e62ab09da46866e808affd0d1af11d16a3c18..aacbe14e2e7aa76c0180a4e269ec23aa04aae5a8 100644 (file)
@@ -554,7 +554,7 @@ static int opiocgetnext(unsigned int cmd, void __user *argp)
 static int openprom_bsd_ioctl(struct file * file,
                              unsigned int cmd, unsigned long arg)
 {
-       DATA *data = (DATA *) file->private_data;
+       DATA *data = file->private_data;
        void __user *argp = (void __user *)arg;
        int err;
 
@@ -601,7 +601,7 @@ static int openprom_bsd_ioctl(struct file * file,
 static long openprom_ioctl(struct file * file,
                           unsigned int cmd, unsigned long arg)
 {
-       DATA *data = (DATA *) file->private_data;
+       DATA *data = file->private_data;
 
        switch (cmd) {
        case OPROMGETOPT:
index a864ccc0a342867d387c949e3e11b44ff071f95f..989b9a8ba72d7ab2cea41ad34797aa738f799129 100644 (file)
@@ -277,6 +277,12 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue,
                goto reg_crq_failed;
        }
 
+       queue->cur = 0;
+       spin_lock_init(&queue->lock);
+
+       tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task,
+                    (unsigned long)hostdata);
+
        if (request_irq(vdev->irq,
                        rpavscsi_handle_event,
                        0, "ibmvscsi", (void *)hostdata) != 0) {
@@ -291,15 +297,10 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue,
                goto req_irq_failed;
        }
 
-       queue->cur = 0;
-       spin_lock_init(&queue->lock);
-
-       tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task,
-                    (unsigned long)hostdata);
-
        return retrc;
 
       req_irq_failed:
+       tasklet_kill(&hostdata->srp_task);
        do {
                rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
        } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
index 82ea4a8226b0242040716134ab3f3efc19bdf254..f820cffb7f00e7f81fb00566711ee74efbbeab66 100644 (file)
@@ -1129,20 +1129,22 @@ static int ipr_is_same_device(struct ipr_resource_entry *res,
 }
 
 /**
- * ipr_format_resource_path - Format the resource path for printing.
+ * ipr_format_res_path - Format the resource path for printing.
  * @res_path:  resource path
  * @buf:       buffer
  *
  * Return value:
  *     pointer to buffer
  **/
-static char *ipr_format_resource_path(u8 *res_path, char *buffer)
+static char *ipr_format_res_path(u8 *res_path, char *buffer, int len)
 {
        int i;
+       char *p = buffer;
 
-       sprintf(buffer, "%02X", res_path[0]);
-       for (i=1; res_path[i] != 0xff; i++)
-               sprintf(buffer, "%s-%02X", buffer, res_path[i]);
+       res_path[0] = '\0';
+       p += snprintf(p, buffer + len - p, "%02X", res_path[0]);
+       for (i = 1; res_path[i] != 0xff && ((i * 3) < len); i++)
+               p += snprintf(p, buffer + len - p, "-%02X", res_path[i]);
 
        return buffer;
 }
@@ -1187,7 +1189,8 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res,
 
                if (res->sdev && new_path)
                        sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n",
-                                   ipr_format_resource_path(&res->res_path[0], &buffer[0]));
+                                   ipr_format_res_path(res->res_path, buffer,
+                                                       sizeof(buffer)));
        } else {
                res->flags = cfgtew->u.cfgte->flags;
                if (res->flags & IPR_IS_IOA_RESOURCE)
@@ -1573,7 +1576,8 @@ static void ipr_log_sis64_config_error(struct ipr_ioa_cfg *ioa_cfg,
                ipr_err_separator;
 
                ipr_err("Device %d : %s", i + 1,
-                        ipr_format_resource_path(&dev_entry->res_path[0], &buffer[0]));
+                        ipr_format_res_path(dev_entry->res_path, buffer,
+                                            sizeof(buffer)));
                ipr_log_ext_vpd(&dev_entry->vpd);
 
                ipr_err("-----New Device Information-----\n");
@@ -1919,13 +1923,14 @@ static void ipr_log64_fabric_path(struct ipr_hostrcb *hostrcb,
 
                        ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n",
                                     path_active_desc[i].desc, path_state_desc[j].desc,
-                                    ipr_format_resource_path(&fabric->res_path[0], &buffer[0]));
+                                    ipr_format_res_path(fabric->res_path, buffer,
+                                                        sizeof(buffer)));
                        return;
                }
        }
 
        ipr_err("Path state=%02X Resource Path=%s\n", path_state,
-               ipr_format_resource_path(&fabric->res_path[0], &buffer[0]));
+               ipr_format_res_path(fabric->res_path, buffer, sizeof(buffer)));
 }
 
 static const struct {
@@ -2066,7 +2071,8 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb,
 
                        ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n",
                                     path_status_desc[j].desc, path_type_desc[i].desc,
-                                    ipr_format_resource_path(&cfg->res_path[0], &buffer[0]),
+                                    ipr_format_res_path(cfg->res_path, buffer,
+                                                        sizeof(buffer)),
                                     link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK],
                                     be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1]));
                        return;
@@ -2074,7 +2080,7 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb,
        }
        ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s "
                     "WWN=%08X%08X\n", cfg->type_status,
-                    ipr_format_resource_path(&cfg->res_path[0], &buffer[0]),
+                    ipr_format_res_path(cfg->res_path, buffer, sizeof(buffer)),
                     link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK],
                     be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1]));
 }
@@ -2139,7 +2145,7 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg,
 
        ipr_err("RAID %s Array Configuration: %s\n",
                error->protection_level,
-               ipr_format_resource_path(&error->last_res_path[0], &buffer[0]));
+               ipr_format_res_path(error->last_res_path, buffer, sizeof(buffer)));
 
        ipr_err_separator;
 
@@ -2160,9 +2166,11 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg,
                ipr_err("Array Member %d:\n", i);
                ipr_log_ext_vpd(&array_entry->vpd);
                ipr_err("Current Location: %s",
-                        ipr_format_resource_path(&array_entry->res_path[0], &buffer[0]));
+                        ipr_format_res_path(array_entry->res_path, buffer,
+                                            sizeof(buffer)));
                ipr_err("Expected Location: %s",
-                        ipr_format_resource_path(&array_entry->expected_res_path[0], &buffer[0]));
+                        ipr_format_res_path(array_entry->expected_res_path,
+                                            buffer, sizeof(buffer)));
 
                ipr_err_separator;
        }
@@ -4079,7 +4087,8 @@ static struct device_attribute ipr_adapter_handle_attr = {
 };
 
 /**
- * ipr_show_resource_path - Show the resource path for this device.
+ * ipr_show_resource_path - Show the resource path or the resource address for
+ *                         this device.
  * @dev:       device struct
  * @buf:       buffer
  *
@@ -4097,9 +4106,14 @@ static ssize_t ipr_show_resource_path(struct device *dev, struct device_attribut
 
        spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
        res = (struct ipr_resource_entry *)sdev->hostdata;
-       if (res)
+       if (res && ioa_cfg->sis64)
                len = snprintf(buf, PAGE_SIZE, "%s\n",
-                              ipr_format_resource_path(&res->res_path[0], &buffer[0]));
+                              ipr_format_res_path(res->res_path, buffer,
+                                                  sizeof(buffer)));
+       else if (res)
+               len = snprintf(buf, PAGE_SIZE, "%d:%d:%d:%d\n", ioa_cfg->host->host_no,
+                              res->bus, res->target, res->lun);
+
        spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
        return len;
 }
@@ -4351,7 +4365,8 @@ static int ipr_slave_configure(struct scsi_device *sdev)
                        scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
                if (ioa_cfg->sis64)
                        sdev_printk(KERN_INFO, sdev, "Resource path: %s\n",
-                                   ipr_format_resource_path(&res->res_path[0], &buffer[0]));
+                                   ipr_format_res_path(res->res_path, buffer,
+                                                       sizeof(buffer)));
                return 0;
        }
        spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
index 9ecd2259eb398dcc0f1e88746df8555dca09e80d..b965f3587c9d8afba54420e461464cf19a524356 100644 (file)
@@ -1684,8 +1684,9 @@ struct ipr_ucode_image_header {
        if (ipr_is_device(hostrcb)) {                                   \
                if ((hostrcb)->ioa_cfg->sis64) {                        \
                        printk(KERN_ERR IPR_NAME ": %s: " fmt,          \
-                               ipr_format_resource_path(&hostrcb->hcam.u.error64.fd_res_path[0], \
-                                       &hostrcb->rp_buffer[0]),        \
+                               ipr_format_res_path(hostrcb->hcam.u.error64.fd_res_path, \
+                                       hostrcb->rp_buffer,             \
+                                       sizeof(hostrcb->rp_buffer)),    \
                                __VA_ARGS__);                           \
                } else {                                                \
                        ipr_ra_err((hostrcb)->ioa_cfg,                  \
index eed3c2d8dd1ce010e13e143213b292e1f0ec1569..a182def7007d2c678b1712b9f7ca78fdc80042ca 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/uaccess.h>
 
 #include <asm/io.h>
+#include <asm/ioctls.h>
 
 #include <asm/mach/serial_at91.h>
 #include <mach/board.h>
index ed7d958b0a01fa96a2f4a746189090cdce45bc6d..544f2e25d0e545f30f959019f4a176bdccb20af8 100644 (file)
@@ -71,7 +71,9 @@ int sunserial_console_match(struct console *con, struct device_node *dp,
 
        con->index = line;
        drv->cons = con;
-       add_preferred_console(con->name, line, NULL);
+
+       if (!console_set_on_cmdline)
+               add_preferred_console(con->name, line, NULL);
 
        return 1;
 }
index 234459c2f0122fc24e78f5b173f3fe4a3f83555d..ffbf4553f6651966269b1be1bc57b43b37b34b98 100644 (file)
@@ -1500,20 +1500,25 @@ out_unmap:
 static int __devexit su_remove(struct of_device *op)
 {
        struct uart_sunsu_port *up = dev_get_drvdata(&op->dev);
+       bool kbdms = false;
 
        if (up->su_type == SU_PORT_MS ||
-           up->su_type == SU_PORT_KBD) {
+           up->su_type == SU_PORT_KBD)
+               kbdms = true;
+
+       if (kbdms) {
 #ifdef CONFIG_SERIO
                serio_unregister_port(&up->serio);
 #endif
-               kfree(up);
-       } else if (up->port.type != PORT_UNKNOWN) {
+       } else if (up->port.type != PORT_UNKNOWN)
                uart_remove_one_port(&sunsu_reg, &up->port);
-       }
 
        if (up->port.membase)
                of_iounmap(&op->resource[0], up->port.membase, up->reg_size);
 
+       if (kbdms)
+               kfree(up);
+
        dev_set_drvdata(&op->dev, NULL);
 
        return 0;
index 61d75507d5d0e8f385019f0917ef8f4f6b726ecb..162c95a088ed5efc2a747a1d739a44e30656de01 100644 (file)
@@ -1596,6 +1596,7 @@ static const struct usb_device_id acm_ids[] = {
        { NOKIA_PCSUITE_ACM_INFO(0x00e9), }, /* Nokia 5320 XpressMusic */
        { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */
        { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */
+       { NOKIA_PCSUITE_ACM_INFO(0x02e3), }, /* Nokia 5230, RM-588 */
 
        /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */
 
index 83e7bbbe97fa7421c3365f3c749d3c2622817fbb..70cccc75a362013267de1744c7d4b196d78a3a95 100644 (file)
@@ -1982,6 +1982,8 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
                    (portstatus & USB_PORT_STAT_ENABLE)) {
                        if (hub_is_wusb(hub))
                                udev->speed = USB_SPEED_WIRELESS;
+                       else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
+                               udev->speed = USB_SPEED_SUPER;
                        else if (portstatus & USB_PORT_STAT_HIGH_SPEED)
                                udev->speed = USB_SPEED_HIGH;
                        else if (portstatus & USB_PORT_STAT_LOW_SPEED)
index f22d03df8b1724fd8fdbc1b49667e9fa4936c478..db99c084df92edf8df98191f419cba6bbf4eb473 100644 (file)
@@ -41,6 +41,10 @@ static const struct usb_device_id usb_quirk_list[] = {
        /* Philips PSC805 audio device */
        { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
 
+       /* Artisman Watchdog Dongle */
+       { USB_DEVICE(0x04b4, 0x0526), .driver_info =
+                       USB_QUIRK_CONFIG_INTF_STRINGS },
+
        /* Roland SC-8820 */
        { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
 
@@ -64,6 +68,9 @@ static const struct usb_device_id usb_quirk_list[] = {
        /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */
        { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
 
+       /* Broadcom BCM92035DGROM BT dongle */
+       { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME },
+
        /* Action Semiconductor flash disk */
        { USB_DEVICE(0x10d6, 0x2200), .driver_info =
                        USB_QUIRK_STRING_FETCH_255 },
index eaa79c8a9b8c2bee44fdce43f2963d19087213a3..93ead19507b632c20095980fd5b0350d6407d23d 100644 (file)
 static const char driver_name [] = "at91_udc";
 static const char ep0name[] = "ep0";
 
+#define VBUS_POLL_TIMEOUT      msecs_to_jiffies(1000)
 
-#define at91_udp_read(dev, reg) \
-       __raw_readl((dev)->udp_baseaddr + (reg))
-#define at91_udp_write(dev, reg, val) \
-       __raw_writel((val), (dev)->udp_baseaddr + (reg))
+#define at91_udp_read(udc, reg) \
+       __raw_readl((udc)->udp_baseaddr + (reg))
+#define at91_udp_write(udc, reg, val) \
+       __raw_writel((val), (udc)->udp_baseaddr + (reg))
 
 /*-------------------------------------------------------------------------*/
 
@@ -102,8 +103,9 @@ static void proc_ep_show(struct seq_file *s, struct at91_ep *ep)
        u32                     csr;
        struct at91_request     *req;
        unsigned long   flags;
+       struct at91_udc *udc = ep->udc;
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&udc->lock, flags);
 
        csr = __raw_readl(ep->creg);
 
@@ -147,7 +149,7 @@ static void proc_ep_show(struct seq_file *s, struct at91_ep *ep)
                                &req->req, length,
                                req->req.length, req->req.buf);
        }
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&udc->lock, flags);
 }
 
 static void proc_irq_show(struct seq_file *s, const char *label, u32 mask)
@@ -272,7 +274,9 @@ static void done(struct at91_ep *ep, struct at91_request *req, int status)
                VDBG("%s done %p, status %d\n", ep->ep.name, req, status);
 
        ep->stopped = 1;
+       spin_unlock(&udc->lock);
        req->req.complete(&ep->ep, &req->req);
+       spin_lock(&udc->lock);
        ep->stopped = stopped;
 
        /* ep0 is always ready; other endpoints need a non-empty queue */
@@ -472,7 +476,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
                                const struct usb_endpoint_descriptor *desc)
 {
        struct at91_ep  *ep = container_of(_ep, struct at91_ep, ep);
-       struct at91_udc *dev = ep->udc;
+       struct at91_udc *udc = ep->udc;
        u16             maxpacket;
        u32             tmp;
        unsigned long   flags;
@@ -487,7 +491,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
                return -EINVAL;
        }
 
-       if (!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN) {
+       if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN) {
                DBG("bogus device state\n");
                return -ESHUTDOWN;
        }
@@ -521,7 +525,7 @@ bogus_max:
        }
 
 ok:
-       local_irq_save(flags);
+       spin_lock_irqsave(&udc->lock, flags);
 
        /* initialize endpoint to match this descriptor */
        ep->is_in = usb_endpoint_dir_in(desc);
@@ -540,10 +544,10 @@ ok:
         * reset/init endpoint fifo.  NOTE:  leaves fifo_bank alone,
         * since endpoint resets don't reset hw pingpong state.
         */
-       at91_udp_write(dev, AT91_UDP_RST_EP, ep->int_mask);
-       at91_udp_write(dev, AT91_UDP_RST_EP, 0);
+       at91_udp_write(udc, AT91_UDP_RST_EP, ep->int_mask);
+       at91_udp_write(udc, AT91_UDP_RST_EP, 0);
 
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&udc->lock, flags);
        return 0;
 }
 
@@ -556,7 +560,7 @@ static int at91_ep_disable (struct usb_ep * _ep)
        if (ep == &ep->udc->ep[0])
                return -EINVAL;
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&udc->lock, flags);
 
        nuke(ep, -ESHUTDOWN);
 
@@ -571,7 +575,7 @@ static int at91_ep_disable (struct usb_ep * _ep)
                __raw_writel(0, ep->creg);
        }
 
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&udc->lock, flags);
        return 0;
 }
 
@@ -607,7 +611,7 @@ static int at91_ep_queue(struct usb_ep *_ep,
 {
        struct at91_request     *req;
        struct at91_ep          *ep;
-       struct at91_udc         *dev;
+       struct at91_udc         *udc;
        int                     status;
        unsigned long           flags;
 
@@ -625,9 +629,9 @@ static int at91_ep_queue(struct usb_ep *_ep,
                return -EINVAL;
        }
 
-       dev = ep->udc;
+       udc = ep->udc;
 
-       if (!dev || !dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN) {
+       if (!udc || !udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN) {
                DBG("invalid device\n");
                return -EINVAL;
        }
@@ -635,7 +639,7 @@ static int at91_ep_queue(struct usb_ep *_ep,
        _req->status = -EINPROGRESS;
        _req->actual = 0;
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&udc->lock, flags);
 
        /* try to kickstart any empty and idle queue */
        if (list_empty(&ep->queue) && !ep->stopped) {
@@ -653,7 +657,7 @@ static int at91_ep_queue(struct usb_ep *_ep,
                if (is_ep0) {
                        u32     tmp;
 
-                       if (!dev->req_pending) {
+                       if (!udc->req_pending) {
                                status = -EINVAL;
                                goto done;
                        }
@@ -662,11 +666,11 @@ static int at91_ep_queue(struct usb_ep *_ep,
                         * defer changing CONFG until after the gadget driver
                         * reconfigures the endpoints.
                         */
-                       if (dev->wait_for_config_ack) {
-                               tmp = at91_udp_read(dev, AT91_UDP_GLB_STAT);
+                       if (udc->wait_for_config_ack) {
+                               tmp = at91_udp_read(udc, AT91_UDP_GLB_STAT);
                                tmp ^= AT91_UDP_CONFG;
                                VDBG("toggle config\n");
-                               at91_udp_write(dev, AT91_UDP_GLB_STAT, tmp);
+                               at91_udp_write(udc, AT91_UDP_GLB_STAT, tmp);
                        }
                        if (req->req.length == 0) {
 ep0_in_status:
@@ -676,7 +680,7 @@ ep0_in_status:
                                tmp &= ~SET_FX;
                                tmp |= CLR_FX | AT91_UDP_TXPKTRDY;
                                __raw_writel(tmp, ep->creg);
-                               dev->req_pending = 0;
+                               udc->req_pending = 0;
                                goto done;
                        }
                }
@@ -695,31 +699,40 @@ ep0_in_status:
 
        if (req && !status) {
                list_add_tail (&req->queue, &ep->queue);
-               at91_udp_write(dev, AT91_UDP_IER, ep->int_mask);
+               at91_udp_write(udc, AT91_UDP_IER, ep->int_mask);
        }
 done:
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&udc->lock, flags);
        return (status < 0) ? status : 0;
 }
 
 static int at91_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
 {
-       struct at91_ep  *ep;
+       struct at91_ep          *ep;
        struct at91_request     *req;
+       unsigned long           flags;
+       struct at91_udc         *udc;
 
        ep = container_of(_ep, struct at91_ep, ep);
        if (!_ep || ep->ep.name == ep0name)
                return -EINVAL;
 
+       udc = ep->udc;
+
+       spin_lock_irqsave(&udc->lock, flags);
+
        /* make sure it's actually queued on this endpoint */
        list_for_each_entry (req, &ep->queue, queue) {
                if (&req->req == _req)
                        break;
        }
-       if (&req->req != _req)
+       if (&req->req != _req) {
+               spin_unlock_irqrestore(&udc->lock, flags);
                return -EINVAL;
+       }
 
        done(ep, req, -ECONNRESET);
+       spin_unlock_irqrestore(&udc->lock, flags);
        return 0;
 }
 
@@ -736,7 +749,7 @@ static int at91_ep_set_halt(struct usb_ep *_ep, int value)
                return -EINVAL;
 
        creg = ep->creg;
-       local_irq_save(flags);
+       spin_lock_irqsave(&udc->lock, flags);
 
        csr = __raw_readl(creg);
 
@@ -761,7 +774,7 @@ static int at91_ep_set_halt(struct usb_ep *_ep, int value)
                __raw_writel(csr, creg);
        }
 
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&udc->lock, flags);
        return status;
 }
 
@@ -795,7 +808,7 @@ static int at91_wakeup(struct usb_gadget *gadget)
        unsigned long   flags;
 
        DBG("%s\n", __func__ );
-       local_irq_save(flags);
+       spin_lock_irqsave(&udc->lock, flags);
 
        if (!udc->clocked || !udc->suspended)
                goto done;
@@ -809,7 +822,7 @@ static int at91_wakeup(struct usb_gadget *gadget)
        at91_udp_write(udc, AT91_UDP_GLB_STAT, glbstate);
 
 done:
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&udc->lock, flags);
        return status;
 }
 
@@ -851,8 +864,11 @@ static void stop_activity(struct at91_udc *udc)
                ep->stopped = 1;
                nuke(ep, -ESHUTDOWN);
        }
-       if (driver)
+       if (driver) {
+               spin_unlock(&udc->lock);
                driver->disconnect(&udc->gadget);
+               spin_lock(&udc->lock);
+       }
 
        udc_reinit(udc);
 }
@@ -935,13 +951,13 @@ static int at91_vbus_session(struct usb_gadget *gadget, int is_active)
        unsigned long   flags;
 
        // VDBG("vbus %s\n", is_active ? "on" : "off");
-       local_irq_save(flags);
+       spin_lock_irqsave(&udc->lock, flags);
        udc->vbus = (is_active != 0);
        if (udc->driver)
                pullup(udc, is_active);
        else
                pullup(udc, 0);
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&udc->lock, flags);
        return 0;
 }
 
@@ -950,10 +966,10 @@ static int at91_pullup(struct usb_gadget *gadget, int is_on)
        struct at91_udc *udc = to_udc(gadget);
        unsigned long   flags;
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&udc->lock, flags);
        udc->enabled = is_on = !!is_on;
        pullup(udc, is_on);
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&udc->lock, flags);
        return 0;
 }
 
@@ -962,9 +978,9 @@ static int at91_set_selfpowered(struct usb_gadget *gadget, int is_on)
        struct at91_udc *udc = to_udc(gadget);
        unsigned long   flags;
 
-       local_irq_save(flags);
+       spin_lock_irqsave(&udc->lock, flags);
        udc->selfpowered = (is_on != 0);
-       local_irq_restore(flags);
+       spin_unlock_irqrestore(&udc->lock, flags);
        return 0;
 }
 
@@ -1226,8 +1242,11 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr)
 #undef w_length
 
        /* pass request up to the gadget driver */
-       if (udc->driver)
+       if (udc->driver) {
+               spin_unlock(&udc->lock);
                status = udc->driver->setup(&udc->gadget, &pkt.r);
+               spin_lock(&udc->lock);
+       }
        else
                status = -ENODEV;
        if (status < 0) {
@@ -1378,6 +1397,9 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc)
        struct at91_udc         *udc = _udc;
        u32                     rescans = 5;
        int                     disable_clock = 0;
+       unsigned long           flags;
+
+       spin_lock_irqsave(&udc->lock, flags);
 
        if (!udc->clocked) {
                clk_on(udc);
@@ -1433,8 +1455,11 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc)
                         * and then into standby to avoid drawing more than
                         * 500uA power (2500uA for some high-power configs).
                         */
-                       if (udc->driver && udc->driver->suspend)
+                       if (udc->driver && udc->driver->suspend) {
+                               spin_unlock(&udc->lock);
                                udc->driver->suspend(&udc->gadget);
+                               spin_lock(&udc->lock);
+                       }
 
                /* host initiated resume */
                } else if (status & AT91_UDP_RXRSM) {
@@ -1451,8 +1476,11 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc)
                         * would normally want to switch out of slow clock
                         * mode into normal mode.
                         */
-                       if (udc->driver && udc->driver->resume)
+                       if (udc->driver && udc->driver->resume) {
+                               spin_unlock(&udc->lock);
                                udc->driver->resume(&udc->gadget);
+                               spin_lock(&udc->lock);
+                       }
 
                /* endpoint IRQs are cleared by handling them */
                } else {
@@ -1474,6 +1502,8 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc)
        if (disable_clock)
                clk_off(udc);
 
+       spin_unlock_irqrestore(&udc->lock, flags);
+
        return IRQ_HANDLED;
 }
 
@@ -1556,24 +1586,53 @@ static struct at91_udc controller = {
        /* ep6 and ep7 are also reserved (custom silicon might use them) */
 };
 
+static void at91_vbus_update(struct at91_udc *udc, unsigned value)
+{
+       value ^= udc->board.vbus_active_low;
+       if (value != udc->vbus)
+               at91_vbus_session(&udc->gadget, value);
+}
+
 static irqreturn_t at91_vbus_irq(int irq, void *_udc)
 {
        struct at91_udc *udc = _udc;
-       unsigned        value;
 
        /* vbus needs at least brief debouncing */
        udelay(10);
-       value = gpio_get_value(udc->board.vbus_pin);
-       if (value != udc->vbus)
-               at91_vbus_session(&udc->gadget, value);
+       at91_vbus_update(udc, gpio_get_value(udc->board.vbus_pin));
 
        return IRQ_HANDLED;
 }
 
+static void at91_vbus_timer_work(struct work_struct *work)
+{
+       struct at91_udc *udc = container_of(work, struct at91_udc,
+                                           vbus_timer_work);
+
+       at91_vbus_update(udc, gpio_get_value_cansleep(udc->board.vbus_pin));
+
+       if (!timer_pending(&udc->vbus_timer))
+               mod_timer(&udc->vbus_timer, jiffies + VBUS_POLL_TIMEOUT);
+}
+
+static void at91_vbus_timer(unsigned long data)
+{
+       struct at91_udc *udc = (struct at91_udc *)data;
+
+       /*
+        * If we are polling vbus it is likely that the gpio is on an
+        * bus such as i2c or spi which may sleep, so schedule some work
+        * to read the vbus gpio
+        */
+       if (!work_pending(&udc->vbus_timer_work))
+               schedule_work(&udc->vbus_timer_work);
+}
+
 int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 {
        struct at91_udc *udc = &controller;
        int             retval;
+       unsigned long   flags;
 
        if (!driver
                        || driver->speed < USB_SPEED_FULL
@@ -1605,9 +1664,9 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
                return retval;
        }
 
-       local_irq_disable();
+       spin_lock_irqsave(&udc->lock, flags);
        pullup(udc, 1);
-       local_irq_enable();
+       spin_unlock_irqrestore(&udc->lock, flags);
 
        DBG("bound to %s\n", driver->driver.name);
        return 0;
@@ -1617,15 +1676,16 @@ EXPORT_SYMBOL (usb_gadget_register_driver);
 int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
 {
        struct at91_udc *udc = &controller;
+       unsigned long   flags;
 
        if (!driver || driver != udc->driver || !driver->unbind)
                return -EINVAL;
 
-       local_irq_disable();
+       spin_lock_irqsave(&udc->lock, flags);
        udc->enabled = 0;
        at91_udp_write(udc, AT91_UDP_IDR, ~0);
        pullup(udc, 0);
-       local_irq_enable();
+       spin_unlock_irqrestore(&udc->lock, flags);
 
        driver->unbind(&udc->gadget);
        udc->gadget.dev.driver = NULL;
@@ -1641,8 +1701,13 @@ EXPORT_SYMBOL (usb_gadget_unregister_driver);
 
 static void at91udc_shutdown(struct platform_device *dev)
 {
+       struct at91_udc *udc = platform_get_drvdata(dev);
+       unsigned long   flags;
+
        /* force disconnect on reboot */
+       spin_lock_irqsave(&udc->lock, flags);
        pullup(platform_get_drvdata(dev), 0);
+       spin_unlock_irqrestore(&udc->lock, flags);
 }
 
 static int __init at91udc_probe(struct platform_device *pdev)
@@ -1683,6 +1748,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
        udc->board = *(struct at91_udc_data *) dev->platform_data;
        udc->pdev = pdev;
        udc->enabled = 0;
+       spin_lock_init(&udc->lock);
 
        /* rm9200 needs manual D+ pullup; off by default */
        if (cpu_is_at91rm9200()) {
@@ -1763,13 +1829,23 @@ static int __init at91udc_probe(struct platform_device *pdev)
                 * Get the initial state of VBUS - we cannot expect
                 * a pending interrupt.
                 */
-               udc->vbus = gpio_get_value(udc->board.vbus_pin);
-               if (request_irq(udc->board.vbus_pin, at91_vbus_irq,
-                               IRQF_DISABLED, driver_name, udc)) {
-                       DBG("request vbus irq %d failed\n",
-                                       udc->board.vbus_pin);
-                       retval = -EBUSY;
-                       goto fail3;
+               udc->vbus = gpio_get_value_cansleep(udc->board.vbus_pin) ^
+                       udc->board.vbus_active_low;
+
+               if (udc->board.vbus_polled) {
+                       INIT_WORK(&udc->vbus_timer_work, at91_vbus_timer_work);
+                       setup_timer(&udc->vbus_timer, at91_vbus_timer,
+                                   (unsigned long)udc);
+                       mod_timer(&udc->vbus_timer,
+                                 jiffies + VBUS_POLL_TIMEOUT);
+               } else {
+                       if (request_irq(udc->board.vbus_pin, at91_vbus_irq,
+                                       IRQF_DISABLED, driver_name, udc)) {
+                               DBG("request vbus irq %d failed\n",
+                                   udc->board.vbus_pin);
+                               retval = -EBUSY;
+                               goto fail3;
+                       }
                }
        } else {
                DBG("no VBUS detection, assuming always-on\n");
@@ -1804,13 +1880,16 @@ static int __exit at91udc_remove(struct platform_device *pdev)
 {
        struct at91_udc *udc = platform_get_drvdata(pdev);
        struct resource *res;
+       unsigned long   flags;
 
        DBG("remove\n");
 
        if (udc->driver)
                return -EBUSY;
 
+       spin_lock_irqsave(&udc->lock, flags);
        pullup(udc, 0);
+       spin_unlock_irqrestore(&udc->lock, flags);
 
        device_init_wakeup(&pdev->dev, 0);
        remove_debug_file(udc);
@@ -1840,6 +1919,7 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg)
 {
        struct at91_udc *udc = platform_get_drvdata(pdev);
        int             wake = udc->driver && device_may_wakeup(&pdev->dev);
+       unsigned long   flags;
 
        /* Unless we can act normally to the host (letting it wake us up
         * whenever it has work for us) force disconnect.  Wakeup requires
@@ -1849,13 +1929,15 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg)
        if ((!udc->suspended && udc->addr)
                        || !wake
                        || at91_suspend_entering_slow_clock()) {
+               spin_lock_irqsave(&udc->lock, flags);
                pullup(udc, 0);
                wake = 0;
+               spin_unlock_irqrestore(&udc->lock, flags);
        } else
                enable_irq_wake(udc->udp_irq);
 
        udc->active_suspend = wake;
-       if (udc->board.vbus_pin > 0 && wake)
+       if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled && wake)
                enable_irq_wake(udc->board.vbus_pin);
        return 0;
 }
@@ -1863,15 +1945,20 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg)
 static int at91udc_resume(struct platform_device *pdev)
 {
        struct at91_udc *udc = platform_get_drvdata(pdev);
+       unsigned long   flags;
 
-       if (udc->board.vbus_pin > 0 && udc->active_suspend)
+       if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled &&
+           udc->active_suspend)
                disable_irq_wake(udc->board.vbus_pin);
 
        /* maybe reconnect to host; if so, clocks on */
        if (udc->active_suspend)
                disable_irq_wake(udc->udp_irq);
-       else
+       else {
+               spin_lock_irqsave(&udc->lock, flags);
                pullup(udc, 1);
+               spin_unlock_irqrestore(&udc->lock, flags);
+       }
        return 0;
 }
 #else
index c65d62295890e94584045ab9f0cc4b872ab29711..108ca54f9092ff4d01679292cd5acf0d221e81a1 100644 (file)
@@ -144,6 +144,9 @@ struct at91_udc {
        struct proc_dir_entry           *pde;
        void __iomem                    *udp_baseaddr;
        int                             udp_irq;
+       spinlock_t                      lock;
+       struct timer_list               vbus_timer;
+       struct work_struct              vbus_timer_work;
 };
 
 static inline struct at91_udc *to_udc(struct usb_gadget *g)
index d69eccf5f197cb8bc890d78d847ca5637eab0a54..2aaa0f75c6cf79936f5f1e03bc1c002e42f5e59a 100644 (file)
@@ -136,7 +136,7 @@ struct ffs_data {
         * handling setup requests immidiatelly user space may be so
         * slow that another setup will be sent to the gadget but this
         * time not to us but another function and then there could be
-        * a race.  Is taht the case? Or maybe we can use cdev->req
+        * a race.  Is that the case? Or maybe we can use cdev->req
         * after all, maybe we just need some spinlock for that? */
        struct usb_request              *ep0req;                /* P: mutex */
        struct completion               ep0req_completion;      /* P: mutex */
index 85b0d8921eae4fbfe14c86c1ac7bf1f9ffae3705..980762453a9c293d6bdda38bdc54317c55a3433c 100644 (file)
@@ -2561,7 +2561,7 @@ static void pxa_udc_shutdown(struct platform_device *_dev)
                udc_disable(udc);
 }
 
-#ifdef CONFIG_CPU_PXA27x
+#ifdef CONFIG_PXA27x
 extern void pxa27x_clear_otgph(void);
 #else
 #define pxa27x_clear_otgph()   do {} while (0)
index e724a051bfdd11bcd520ae90ff0b0c448883d13f..ea2b3c7ebee50d6d93e498ea2c37a995e2a5ed3e 100644 (file)
@@ -735,6 +735,10 @@ static void s3c2410_udc_handle_ep0_idle(struct s3c2410_udc *dev,
        else
                dev->ep0state = EP0_OUT_DATA_PHASE;
 
+       if (!dev->driver)
+               return;
+
+       /* deliver the request to the gadget driver */
        ret = dev->driver->setup(&dev->gadget, crq);
        if (ret < 0) {
                if (dev->req_config) {
index a18debdd79b8cec346f7f625baf66a47800affd1..418163894775e36ff129aa96ba107f7e6145ca20 100644 (file)
@@ -203,7 +203,7 @@ static inline void pxa27x_reset_hc(struct pxa27x_ohci *ohci)
        __raw_writel(uhchr & ~UHCHR_FHR, ohci->mmio_base + UHCHR);
 }
 
-#ifdef CONFIG_CPU_PXA27x
+#ifdef CONFIG_PXA27x
 extern void pxa27x_clear_otgph(void);
 #else
 #define pxa27x_clear_otgph()   do {} while (0)
index fd9e03afd91c1664344be73ed0000705fd31c6cc..2eb658d2639477bccb3051804fb6364dc79e29c0 100644 (file)
@@ -835,6 +835,27 @@ fail:
        return 0;
 }
 
+void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci,
+               struct usb_device *udev)
+{
+       struct xhci_virt_device *virt_dev;
+       struct xhci_ep_ctx      *ep0_ctx;
+       struct xhci_ring        *ep_ring;
+
+       virt_dev = xhci->devs[udev->slot_id];
+       ep0_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, 0);
+       ep_ring = virt_dev->eps[0].ring;
+       /*
+        * FIXME we don't keep track of the dequeue pointer very well after a
+        * Set TR dequeue pointer, so we're setting the dequeue pointer of the
+        * host to our enqueue pointer.  This should only be called after a
+        * configured device has reset, so all control transfers should have
+        * been completed or cancelled before the reset.
+        */
+       ep0_ctx->deq = xhci_trb_virt_to_dma(ep_ring->enq_seg, ep_ring->enqueue);
+       ep0_ctx->deq |= ep_ring->cycle_state;
+}
+
 /* Setup an xHCI virtual device for a Set Address command */
 int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev)
 {
@@ -1002,7 +1023,7 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
        return EP_INTERVAL(interval);
 }
 
-/* The "Mult" field in the endpoint context is only set for SuperSpeed devices.
+/* The "Mult" field in the endpoint context is only set for SuperSpeed isoc eps.
  * High speed endpoint descriptors can define "the number of additional
  * transaction opportunities per microframe", but that goes in the Max Burst
  * endpoint context field.
@@ -1010,7 +1031,8 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
 static inline u32 xhci_get_endpoint_mult(struct usb_device *udev,
                struct usb_host_endpoint *ep)
 {
-       if (udev->speed != USB_SPEED_SUPER)
+       if (udev->speed != USB_SPEED_SUPER ||
+                       !usb_endpoint_xfer_isoc(&ep->desc))
                return 0;
        return ep->ss_ep_comp.bmAttributes;
 }
index 94e6934edb09c0e3a06dd696a96c3d825719ede6..bfc99a93945506bc745d830cf0bd4efbfcc4a92e 100644 (file)
@@ -2380,16 +2380,19 @@ static int queue_command(struct xhci_hcd *xhci, u32 field1, u32 field2,
                u32 field3, u32 field4, bool command_must_succeed)
 {
        int reserved_trbs = xhci->cmd_ring_reserved_trbs;
+       int ret;
+
        if (!command_must_succeed)
                reserved_trbs++;
 
-       if (!room_on_ring(xhci, xhci->cmd_ring, reserved_trbs)) {
-               if (!in_interrupt())
-                       xhci_err(xhci, "ERR: No room for command on command ring\n");
+       ret = prepare_ring(xhci, xhci->cmd_ring, EP_STATE_RUNNING,
+                       reserved_trbs, GFP_ATOMIC);
+       if (ret < 0) {
+               xhci_err(xhci, "ERR: No room for command on command ring\n");
                if (command_must_succeed)
                        xhci_err(xhci, "ERR: Reserved TRB counting for "
                                        "unfailable commands failed.\n");
-               return -ENOMEM;
+               return ret;
        }
        queue_trb(xhci, xhci->cmd_ring, false, false, field1, field2, field3,
                        field4 | xhci->cmd_ring->cycle_state);
index 27345cd04da0ccf99335064e2f37ad0950fb511f..3998f72cd0c4bbfb497517c81f48ca7ed6cafca0 100644 (file)
@@ -2134,6 +2134,8 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
        /* If this is a Set Address to an unconfigured device, setup ep 0 */
        if (!udev->config)
                xhci_setup_addressable_virt_dev(xhci, udev);
+       else
+               xhci_copy_ep0_dequeue_into_input_ctx(xhci, udev);
        /* Otherwise, assume the core has the device configured how it wants */
        xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
        xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
index 8b4b7d39f79cafb927523e94d95a93f59dd1b9cf..6c7e3430ec935bee309fe74cec995592bfe1635b 100644 (file)
@@ -1292,6 +1292,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags);
 void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id);
 int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags);
 int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev);
+void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci,
+               struct usb_device *udev);
 unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc);
 unsigned int xhci_get_endpoint_flag(struct usb_endpoint_descriptor *desc);
 unsigned int xhci_get_endpoint_flag_from_index(unsigned int ep_index);
index 30d930386b651789f236809f04aa7cf67eab7dce..d25814c172b27403f67715d157d67dce553e0c67 100644 (file)
@@ -2436,7 +2436,8 @@ sisusb_open(struct inode *inode, struct file *file)
        }
 
        if (!sisusb->devinit) {
-               if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH) {
+               if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH ||
+                   sisusb->sisusb_dev->speed == USB_SPEED_SUPER) {
                        if (sisusb_init_gfxdevice(sisusb, 0)) {
                                mutex_unlock(&sisusb->lock);
                                dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n");
@@ -3166,7 +3167,7 @@ static int sisusb_probe(struct usb_interface *intf,
 
        sisusb->present = 1;
 
-       if (dev->speed == USB_SPEED_HIGH) {
+       if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) {
                int initscreen = 1;
 #ifdef INCL_SISUSB_CON
                if (sisusb_first_vc > 0 &&
index 05c077f8f9acbd3c87fe99a945aa61878ca7471f..3c48e77a0aa2c6c73ec52fcb9832689bf557e5a0 100644 (file)
@@ -29,19 +29,6 @@ static void tusb_source_power(struct musb *musb, int is_on);
 #define TUSB_REV_MAJOR(reg_val)                ((reg_val >> 4) & 0xf)
 #define TUSB_REV_MINOR(reg_val)                (reg_val & 0xf)
 
-#ifdef CONFIG_PM
-/* REVISIT: These should be only needed if somebody implements off idle */
-void musb_platform_save_context(struct musb *musb,
-                       struct musb_context_registers *musb_context)
-{
-}
-
-void musb_platform_restore_context(struct musb *musb,
-                       struct musb_context_registers *musb_context)
-{
-}
-#endif
-
 /*
  * Checks the revision. We need to use the DMA register as 3.0 does not
  * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV.
index da7e334b0407a3ef0e210a56dcc02ea3f2a14db8..e298dc4baed771bdf88e6ea931ce74aab6c096cb 100644 (file)
@@ -691,6 +691,7 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID),
                .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
        { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
+       { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) },
        { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) },
@@ -737,6 +738,14 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) },
        { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) },
        { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) },
+       { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
        { },                                    /* Optional parameter entry */
        { }                                     /* Terminating entry */
 };
index bbc159a1df45d330f926a6e003dadece3c1b4daa..d01946db8fac2fe5db6001fb2242fe8a551f6509 100644 (file)
 #define TELLDUS_VID                    0x1781  /* Vendor ID */
 #define TELLDUS_TELLSTICK_PID          0x0C30  /* RF control dongle 433 MHz using FT232RL */
 
+/*
+ * RT Systems programming cables for various ham radios
+ */
+#define RTSYSTEMS_VID                  0x2100  /* Vendor ID */
+#define RTSYSTEMS_SERIAL_VX7_PID       0x9e52  /* Serial converter for VX-7 Radios using FT232RL */
+
 /*
  * Bayer Ascensia Contour blood glucose meter USB-converter cable.
  * http://winglucofacts.com/cables/
 #define MJSG_SR_RADIO_PID      0x9379
 #define MJSG_XM_RADIO_PID      0x937A
 #define MJSG_HD_RADIO_PID      0x937C
+
+/*
+ * Xverve Signalyzer tools (http://www.signalyzer.com/)
+ */
+#define XVERVE_SIGNALYZER_ST_PID       0xBCA0
+#define XVERVE_SIGNALYZER_SLITE_PID    0xBCA1
+#define XVERVE_SIGNALYZER_SH2_PID      0xBCA2
+#define XVERVE_SIGNALYZER_SH4_PID      0xBCA4
+
index e280ad8e12f75898850eb03659d513ce1d1dee7b..5cd30e4345c62050aeacdfeddd4bca543a135fa1 100644 (file)
@@ -206,6 +206,7 @@ static void option_instat_callback(struct urb *urb);
 #define AMOI_PRODUCT_H01                       0x0800
 #define AMOI_PRODUCT_H01A                      0x7002
 #define AMOI_PRODUCT_H02                       0x0802
+#define AMOI_PRODUCT_SKYPEPHONE_S2             0x0407
 
 #define DELL_VENDOR_ID                         0x413C
 
@@ -302,6 +303,7 @@ static void option_instat_callback(struct urb *urb);
 #define QISDA_PRODUCT_H21_4512                 0x4512
 #define QISDA_PRODUCT_H21_4523                 0x4523
 #define QISDA_PRODUCT_H20_4515                 0x4515
+#define QISDA_PRODUCT_H20_4518                 0x4518
 #define QISDA_PRODUCT_H20_4519                 0x4519
 
 /* TLAYTECH PRODUCTS */
@@ -516,6 +518,7 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
        { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
        { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) },
+       { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_SKYPEPHONE_S2) },
 
        { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) },             /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */
        { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) },             /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
@@ -852,6 +855,7 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) },
        { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) },
        { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) },
+       { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4518) },
        { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) },
        { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) },
        { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */
index 93d72eb8cafc8deaa36a52e2632a6cee3429ce66..cde67cacb2c3e823773f49c922365473c9f4c82c 100644 (file)
@@ -51,6 +51,8 @@ static const struct usb_device_id id_table[] = {
        {USB_DEVICE(0x1f45, 0x0001)},   /* Unknown Gobi QDL device */
        {USB_DEVICE(0x413c, 0x8185)},   /* Dell Gobi 2000 QDL device (N0218, VU936) */
        {USB_DEVICE(0x413c, 0x8186)},   /* Dell Gobi 2000 Modem device (N0218, VU936) */
+       {USB_DEVICE(0x05c6, 0x9208)},   /* Generic Gobi 2000 QDL device */
+       {USB_DEVICE(0x05c6, 0x920b)},   /* Generic Gobi 2000 Modem device */
        {USB_DEVICE(0x05c6, 0x9224)},   /* Sony Gobi 2000 QDL device (N0279, VU730) */
        {USB_DEVICE(0x05c6, 0x9225)},   /* Sony Gobi 2000 Modem device (N0279, VU730) */
        {USB_DEVICE(0x05c6, 0x9244)},   /* Samsung Gobi 2000 QDL device (VL176) */
index ef0bdb08d7887b17c7a6a17bc933be7aa0680175..d47b56e9e8ce9dc22c423967f2ab73a4f0dd5db1 100644 (file)
@@ -245,6 +245,7 @@ static const struct usb_device_id id_table[] = {
        { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
        { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */
        { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */
+       { USB_DEVICE(0x1199, 0x0301) }, /* Sierra Wireless USB Dongle 250U */
        /* Sierra Wireless C597 */
        { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) },
        /* Sierra Wireless T598 */
index 44716427c51c9548562035ad81753616e5632158..64ec073e89de74bcc14a78b3e050efe55295f9b9 100644 (file)
@@ -139,9 +139,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout)
 
        /* fill the common fields in the URB */
        us->current_urb->context = &urb_done;
-       us->current_urb->actual_length = 0;
-       us->current_urb->error_count = 0;
-       us->current_urb->status = 0;
+       us->current_urb->transfer_flags = 0;
 
        /* we assume that if transfer_buffer isn't us->iobuf then it
         * hasn't been mapped for DMA.  Yes, this is clunky, but it's
index 57a593c58cf418769537c06d4602910203f8e5e0..d219070fed3da07b3944ac53363673f310435f33 100644 (file)
@@ -177,8 +177,8 @@ static void handle_tx(struct vhost_net *net)
                        break;
                }
                if (err != len)
-                       pr_err("Truncated TX packet: "
-                              " len %d != %zd\n", err, len);
+                       pr_debug("Truncated TX packet: "
+                                " len %d != %zd\n", err, len);
                vhost_add_used_and_signal(&net->dev, vq, head, 0);
                total_len += len;
                if (unlikely(total_len >= VHOST_NET_WEIGHT)) {
@@ -275,8 +275,8 @@ static void handle_rx(struct vhost_net *net)
                }
                /* TODO: Should check and handle checksum. */
                if (err > len) {
-                       pr_err("Discarded truncated rx packet: "
-                              " len %d > %zd\n", err, len);
+                       pr_debug("Discarded truncated rx packet: "
+                                " len %d > %zd\n", err, len);
                        vhost_discard_vq_desc(vq);
                        continue;
                }
@@ -534,11 +534,16 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
        rcu_assign_pointer(vq->private_data, sock);
        vhost_net_enable_vq(n, vq);
 done:
+       mutex_unlock(&vq->mutex);
+
        if (oldsock) {
                vhost_net_flush_vq(n, index);
                fput(oldsock->file);
        }
 
+       mutex_unlock(&n->dev.mutex);
+       return 0;
+
 err_vq:
        mutex_unlock(&vq->mutex);
 err:
index 515cf1978d19ef21fc5062471e1357826e4da8c6..c4e17642d9c5b9e4a8bbbd61dad399311f0a58ee 100644 (file)
@@ -2872,7 +2872,7 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlis
                }
 
 #if 0
-               /* Power down TV DAC, taht saves a significant amount of power,
+               /* Power down TV DAC, that saves a significant amount of power,
                 * we'll have something better once we actually have some TVOut
                 * support
                 */
index 40f61320ce1665b156b04761b739b8c4bbc96862..34b2fc472fe8c917d08738b620aac63b49ea9914 100644 (file)
@@ -95,7 +95,7 @@ struct fb_bitfield rgb_bitfields[][4] =
        { { 8, 4, 0 },  { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } },
 };
 
-static struct fb_fix_screeninfo au1100fb_fix __initdata = {
+static struct fb_fix_screeninfo au1100fb_fix __devinitdata = {
        .id             = "AU1100 FB",
        .xpanstep       = 1,
        .ypanstep       = 1,
@@ -103,7 +103,7 @@ static struct fb_fix_screeninfo au1100fb_fix __initdata = {
        .accel          = FB_ACCEL_NONE,
 };
 
-static struct fb_var_screeninfo au1100fb_var __initdata = {
+static struct fb_var_screeninfo au1100fb_var __devinitdata = {
        .activate       = FB_ACTIVATE_NOW,
        .height         = -1,
        .width          = -1,
@@ -458,7 +458,7 @@ static struct fb_ops au1100fb_ops =
 
 /* AU1100 LCD controller device driver */
 
-static int __init au1100fb_drv_probe(struct platform_device *dev)
+static int __devinit au1100fb_drv_probe(struct platform_device *dev)
 {
        struct au1100fb_device *fbdev = NULL;
        struct resource *regs_res;
index 7d8c55d7fd28a42c5d73a7f9e5f226bd9362a799..ca3355e430bfd18ac5e55897fd4cab633d3772f8 100644 (file)
@@ -91,10 +91,10 @@ static uint32_t pseudo_palette[16];
 static uint32_t gbe_cmap[256];
 static int gbe_turned_on; /* 0 turned off, 1 turned on */
 
-static char *mode_option __initdata = NULL;
+static char *mode_option __devinitdata = NULL;
 
 /* default CRT mode */
-static struct fb_var_screeninfo default_var_CRT __initdata = {
+static struct fb_var_screeninfo default_var_CRT __devinitdata = {
        /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */
        .xres           = 640,
        .yres           = 480,
@@ -125,7 +125,7 @@ static struct fb_var_screeninfo default_var_CRT __initdata = {
 };
 
 /* default LCD mode */
-static struct fb_var_screeninfo default_var_LCD __initdata = {
+static struct fb_var_screeninfo default_var_LCD __devinitdata = {
        /* 1600x1024, 8 bpp */
        .xres           = 1600,
        .yres           = 1024,
@@ -157,7 +157,7 @@ static struct fb_var_screeninfo default_var_LCD __initdata = {
 
 /* default modedb mode */
 /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */
-static struct fb_videomode default_mode_CRT __initdata = {
+static struct fb_videomode default_mode_CRT __devinitdata = {
        .refresh        = 60,
        .xres           = 640,
        .yres           = 480,
@@ -172,7 +172,7 @@ static struct fb_videomode default_mode_CRT __initdata = {
        .vmode          = FB_VMODE_NONINTERLACED,
 };
 /* 1600x1024 SGI flatpanel 1600sw */
-static struct fb_videomode default_mode_LCD __initdata = {
+static struct fb_videomode default_mode_LCD __devinitdata = {
        /* 1600x1024, 8 bpp */
        .xres           = 1600,
        .yres           = 1024,
@@ -186,8 +186,8 @@ static struct fb_videomode default_mode_LCD __initdata = {
        .vmode          = FB_VMODE_NONINTERLACED,
 };
 
-static struct fb_videomode *default_mode __initdata = &default_mode_CRT;
-static struct fb_var_screeninfo *default_var __initdata = &default_var_CRT;
+static struct fb_videomode *default_mode __devinitdata = &default_mode_CRT;
+static struct fb_var_screeninfo *default_var __devinitdata = &default_var_CRT;
 
 static int flat_panel_enabled = 0;
 
@@ -1098,7 +1098,7 @@ static void gbefb_create_sysfs(struct device *dev)
  * Initialization
  */
 
-static int __init gbefb_setup(char *options)
+static int __devinit gbefb_setup(char *options)
 {
        char *this_opt;
 
index 3b1237ad85ed384a3adba6dfe07451d2a732ed11..f6fdc2085f3e20147a4e9b0ae8ab4080c4fa4728 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/seq_file.h>
-#include <linux/bootmem.h>
+#include <linux/memblock.h>
 #include <linux/completion.h>
 #include <linux/debugfs.h>
 #include <linux/jiffies.h>
@@ -525,10 +525,8 @@ early_param("vram", omap_vram_early_vram);
  * Called from map_io. We need to call to this early enough so that we
  * can reserve the fixed SDRAM regions before VM could get hold of them.
  */
-void __init omap_vram_reserve_sdram(void)
+void __init omap_vram_reserve_sdram_memblock(void)
 {
-       struct bootmem_data     *bdata;
-       unsigned long           sdram_start, sdram_size;
        u32 paddr;
        u32 size = 0;
 
@@ -555,29 +553,28 @@ void __init omap_vram_reserve_sdram(void)
 
        size = PAGE_ALIGN(size);
 
-       bdata = NODE_DATA(0)->bdata;
-       sdram_start = bdata->node_min_pfn << PAGE_SHIFT;
-       sdram_size = (bdata->node_low_pfn << PAGE_SHIFT) - sdram_start;
-
        if (paddr) {
-               if ((paddr & ~PAGE_MASK) || paddr < sdram_start ||
-                               paddr + size > sdram_start + sdram_size) {
+               struct memblock_property res;
+
+               res.base = paddr;
+               res.size = size;
+               if ((paddr & ~PAGE_MASK) || memblock_find(&res) ||
+                   res.base != paddr || res.size != size) {
                        pr_err("Illegal SDRAM region for VRAM\n");
                        return;
                }
 
-               if (reserve_bootmem(paddr, size, BOOTMEM_EXCLUSIVE) < 0) {
-                       pr_err("FB: failed to reserve VRAM\n");
+               if (memblock_is_region_reserved(paddr, size)) {
+                       pr_err("FB: failed to reserve VRAM - busy\n");
                        return;
                }
-       } else {
-               if (size > sdram_size) {
-                       pr_err("Illegal SDRAM size for VRAM\n");
+
+               if (memblock_reserve(paddr, size) < 0) {
+                       pr_err("FB: failed to reserve VRAM - no memory\n");
                        return;
                }
-
-               paddr = virt_to_phys(alloc_bootmem_pages(size));
-               BUG_ON(paddr & ~PAGE_MASK);
+       } else {
+               paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT);
        }
 
        omap_vram_add_region(paddr, size);
index 0f361b6100d2b6dc671c1ff1297718e2e47735fc..0c69fa20251b681bfc1eaa03d886c615f11bc8de 100644 (file)
@@ -44,7 +44,7 @@ struct pmagbafb_par {
 };
 
 
-static struct fb_var_screeninfo pmagbafb_defined __initdata = {
+static struct fb_var_screeninfo pmagbafb_defined __devinitdata = {
        .xres           = 1024,
        .yres           = 864,
        .xres_virtual   = 1024,
@@ -68,7 +68,7 @@ static struct fb_var_screeninfo pmagbafb_defined __initdata = {
        .vmode          = FB_VMODE_NONINTERLACED,
 };
 
-static struct fb_fix_screeninfo pmagbafb_fix __initdata = {
+static struct fb_fix_screeninfo pmagbafb_fix __devinitdata = {
        .id             = "PMAG-BA",
        .smem_len       = (1024 * 1024),
        .type           = FB_TYPE_PACKED_PIXELS,
@@ -142,7 +142,7 @@ static void __init pmagbafb_erase_cursor(struct fb_info *info)
 }
 
 
-static int __init pmagbafb_probe(struct device *dev)
+static int __devinit pmagbafb_probe(struct device *dev)
 {
        struct tc_dev *tdev = to_tc_dev(dev);
        resource_size_t start, len;
index 2de0806421b49b450c5a9c73b12aceec4719f3cd..22fcb9a3d5c0d0088d6f1d8294783f91989c7564 100644 (file)
@@ -45,7 +45,7 @@ struct pmagbbfb_par {
 };
 
 
-static struct fb_var_screeninfo pmagbbfb_defined __initdata = {
+static struct fb_var_screeninfo pmagbbfb_defined __devinitdata = {
        .bits_per_pixel = 8,
        .red.length     = 8,
        .green.length   = 8,
@@ -58,7 +58,7 @@ static struct fb_var_screeninfo pmagbbfb_defined __initdata = {
        .vmode          = FB_VMODE_NONINTERLACED,
 };
 
-static struct fb_fix_screeninfo pmagbbfb_fix __initdata = {
+static struct fb_fix_screeninfo pmagbbfb_fix __devinitdata = {
        .id             = "PMAGB-BA",
        .smem_len       = (2048 * 1024),
        .type           = FB_TYPE_PACKED_PIXELS,
@@ -148,7 +148,7 @@ static void __init pmagbbfb_erase_cursor(struct fb_info *info)
 /*
  * Set up screen parameters.
  */
-static void __init pmagbbfb_screen_setup(struct fb_info *info)
+static void __devinit pmagbbfb_screen_setup(struct fb_info *info)
 {
        struct pmagbbfb_par *par = info->par;
 
@@ -180,9 +180,9 @@ static void __init pmagbbfb_screen_setup(struct fb_info *info)
 /*
  * Determine oscillator configuration.
  */
-static void __init pmagbbfb_osc_setup(struct fb_info *info)
+static void __devinit pmagbbfb_osc_setup(struct fb_info *info)
 {
-       static unsigned int pmagbbfb_freqs[] __initdata = {
+       static unsigned int pmagbbfb_freqs[] __devinitdata = {
                130808, 119843, 104000, 92980, 74370, 72800,
                69197, 66000, 65000, 50350, 36000, 32000, 25175
        };
@@ -247,7 +247,7 @@ static void __init pmagbbfb_osc_setup(struct fb_info *info)
 };
 
 
-static int __init pmagbbfb_probe(struct device *dev)
+static int __devinit pmagbbfb_probe(struct device *dev)
 {
        struct tc_dev *tdev = to_tc_dev(dev);
        resource_size_t start, len;
index afe7e21dd0ae8a7dce4db7ee1a480ce931c42247..1475ed6b575fd7a9984380b9e0841ac5f019a306 100644 (file)
@@ -164,7 +164,8 @@ int virtqueue_add_buf_gfp(struct virtqueue *_vq,
                          gfp_t gfp)
 {
        struct vring_virtqueue *vq = to_vvq(_vq);
-       unsigned int i, avail, head, uninitialized_var(prev);
+       unsigned int i, avail, uninitialized_var(prev);
+       int head;
 
        START_USE(vq);
 
@@ -174,7 +175,7 @@ int virtqueue_add_buf_gfp(struct virtqueue *_vq,
         * buffers, then go indirect. FIXME: tune this threshold */
        if (vq->indirect && (out + in) > 1 && vq->num_free) {
                head = vring_add_indirect(vq, sg, out, in, gfp);
-               if (head != vq->vring.num)
+               if (likely(head >= 0))
                        goto add_head;
        }
 
index d61e3b28ce37a09caca5b5c40214b0e1ec109b22..36d961f342af5b95e4e79c42f4a82b5893a73823 100644 (file)
@@ -146,7 +146,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
                while (rdir->head < rdir->tail) {
                        p9stat_init(&st);
                        err = p9stat_read(rdir->buf + rdir->head,
-                                               buflen - rdir->head, &st,
+                                               rdir->tail - rdir->head, &st,
                                                fid->clnt->proto_version);
                        if (err) {
                                P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err);
index 0d1d966b0fe45d20e6ff75f44a6dea64f66eb54e..c3df14ce2cc2c00d232028d1238121ff9c37e35c 100644 (file)
@@ -2304,12 +2304,17 @@ noinline int btrfs_leaf_free_space(struct btrfs_root *root,
        return ret;
 }
 
+/*
+ * min slot controls the lowest index we're willing to push to the
+ * right.  We'll push up to and including min_slot, but no lower
+ */
 static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
                                      struct btrfs_root *root,
                                      struct btrfs_path *path,
                                      int data_size, int empty,
                                      struct extent_buffer *right,
-                                     int free_space, u32 left_nritems)
+                                     int free_space, u32 left_nritems,
+                                     u32 min_slot)
 {
        struct extent_buffer *left = path->nodes[0];
        struct extent_buffer *upper = path->nodes[1];
@@ -2327,7 +2332,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
        if (empty)
                nr = 0;
        else
-               nr = 1;
+               nr = max_t(u32, 1, min_slot);
 
        if (path->slots[0] >= left_nritems)
                push_space += data_size;
@@ -2469,10 +2474,14 @@ out_unlock:
  *
  * returns 1 if the push failed because the other node didn't have enough
  * room, 0 if everything worked out and < 0 if there were major errors.
+ *
+ * this will push starting from min_slot to the end of the leaf.  It won't
+ * push any slot lower than min_slot
  */
 static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root
-                          *root, struct btrfs_path *path, int data_size,
-                          int empty)
+                          *root, struct btrfs_path *path,
+                          int min_data_size, int data_size,
+                          int empty, u32 min_slot)
 {
        struct extent_buffer *left = path->nodes[0];
        struct extent_buffer *right;
@@ -2514,8 +2523,8 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root
        if (left_nritems == 0)
                goto out_unlock;
 
-       return __push_leaf_right(trans, root, path, data_size, empty,
-                               right, free_space, left_nritems);
+       return __push_leaf_right(trans, root, path, min_data_size, empty,
+                               right, free_space, left_nritems, min_slot);
 out_unlock:
        btrfs_tree_unlock(right);
        free_extent_buffer(right);
@@ -2525,12 +2534,17 @@ out_unlock:
 /*
  * push some data in the path leaf to the left, trying to free up at
  * least data_size bytes.  returns zero if the push worked, nonzero otherwise
+ *
+ * max_slot can put a limit on how far into the leaf we'll push items.  The
+ * item at 'max_slot' won't be touched.  Use (u32)-1 to make us do all the
+ * items
  */
 static noinline int __push_leaf_left(struct btrfs_trans_handle *trans,
                                     struct btrfs_root *root,
                                     struct btrfs_path *path, int data_size,
                                     int empty, struct extent_buffer *left,
-                                    int free_space, int right_nritems)
+                                    int free_space, u32 right_nritems,
+                                    u32 max_slot)
 {
        struct btrfs_disk_key disk_key;
        struct extent_buffer *right = path->nodes[0];
@@ -2549,9 +2563,9 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans,
        slot = path->slots[1];
 
        if (empty)
-               nr = right_nritems;
+               nr = min(right_nritems, max_slot);
        else
-               nr = right_nritems - 1;
+               nr = min(right_nritems - 1, max_slot);
 
        for (i = 0; i < nr; i++) {
                item = btrfs_item_nr(right, i);
@@ -2712,10 +2726,14 @@ out:
 /*
  * push some data in the path leaf to the left, trying to free up at
  * least data_size bytes.  returns zero if the push worked, nonzero otherwise
+ *
+ * max_slot can put a limit on how far into the leaf we'll push items.  The
+ * item at 'max_slot' won't be touched.  Use (u32)-1 to make us push all the
+ * items
  */
 static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
-                         *root, struct btrfs_path *path, int data_size,
-                         int empty)
+                         *root, struct btrfs_path *path, int min_data_size,
+                         int data_size, int empty, u32 max_slot)
 {
        struct extent_buffer *right = path->nodes[0];
        struct extent_buffer *left;
@@ -2761,8 +2779,9 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
                goto out;
        }
 
-       return __push_leaf_left(trans, root, path, data_size,
-                              empty, left, free_space, right_nritems);
+       return __push_leaf_left(trans, root, path, min_data_size,
+                              empty, left, free_space, right_nritems,
+                              max_slot);
 out:
        btrfs_tree_unlock(left);
        free_extent_buffer(left);
@@ -2854,6 +2873,64 @@ static noinline int copy_for_split(struct btrfs_trans_handle *trans,
        return ret;
 }
 
+/*
+ * double splits happen when we need to insert a big item in the middle
+ * of a leaf.  A double split can leave us with 3 mostly empty leaves:
+ * leaf: [ slots 0 - N] [ our target ] [ N + 1 - total in leaf ]
+ *          A                 B                 C
+ *
+ * We avoid this by trying to push the items on either side of our target
+ * into the adjacent leaves.  If all goes well we can avoid the double split
+ * completely.
+ */
+static noinline int push_for_double_split(struct btrfs_trans_handle *trans,
+                                         struct btrfs_root *root,
+                                         struct btrfs_path *path,
+                                         int data_size)
+{
+       int ret;
+       int progress = 0;
+       int slot;
+       u32 nritems;
+
+       slot = path->slots[0];
+
+       /*
+        * try to push all the items after our slot into the
+        * right leaf
+        */
+       ret = push_leaf_right(trans, root, path, 1, data_size, 0, slot);
+       if (ret < 0)
+               return ret;
+
+       if (ret == 0)
+               progress++;
+
+       nritems = btrfs_header_nritems(path->nodes[0]);
+       /*
+        * our goal is to get our slot at the start or end of a leaf.  If
+        * we've done so we're done
+        */
+       if (path->slots[0] == 0 || path->slots[0] == nritems)
+               return 0;
+
+       if (btrfs_leaf_free_space(root, path->nodes[0]) >= data_size)
+               return 0;
+
+       /* try to push all the items before our slot into the next leaf */
+       slot = path->slots[0];
+       ret = push_leaf_left(trans, root, path, 1, data_size, 0, slot);
+       if (ret < 0)
+               return ret;
+
+       if (ret == 0)
+               progress++;
+
+       if (progress)
+               return 0;
+       return 1;
+}
+
 /*
  * split the path's leaf in two, making sure there is at least data_size
  * available for the resulting leaf level of the path.
@@ -2876,6 +2953,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
        int wret;
        int split;
        int num_doubles = 0;
+       int tried_avoid_double = 0;
 
        l = path->nodes[0];
        slot = path->slots[0];
@@ -2884,12 +2962,14 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
                return -EOVERFLOW;
 
        /* first try to make some room by pushing left and right */
-       if (data_size && ins_key->type != BTRFS_DIR_ITEM_KEY) {
-               wret = push_leaf_right(trans, root, path, data_size, 0);
+       if (data_size) {
+               wret = push_leaf_right(trans, root, path, data_size,
+                                      data_size, 0, 0);
                if (wret < 0)
                        return wret;
                if (wret) {
-                       wret = push_leaf_left(trans, root, path, data_size, 0);
+                       wret = push_leaf_left(trans, root, path, data_size,
+                                             data_size, 0, (u32)-1);
                        if (wret < 0)
                                return wret;
                }
@@ -2923,6 +3003,8 @@ again:
                                if (mid != nritems &&
                                    leaf_space_used(l, mid, nritems - mid) +
                                    data_size > BTRFS_LEAF_DATA_SIZE(root)) {
+                                       if (data_size && !tried_avoid_double)
+                                               goto push_for_double;
                                        split = 2;
                                }
                        }
@@ -2939,6 +3021,8 @@ again:
                                if (mid != nritems &&
                                    leaf_space_used(l, mid, nritems - mid) +
                                    data_size > BTRFS_LEAF_DATA_SIZE(root)) {
+                                       if (data_size && !tried_avoid_double)
+                                               goto push_for_double;
                                        split = 2 ;
                                }
                        }
@@ -3019,6 +3103,13 @@ again:
        }
 
        return ret;
+
+push_for_double:
+       push_for_double_split(trans, root, path, data_size);
+       tried_avoid_double = 1;
+       if (btrfs_leaf_free_space(root, path->nodes[0]) >= data_size)
+               return 0;
+       goto again;
 }
 
 static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
@@ -3915,13 +4006,15 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
                        extent_buffer_get(leaf);
 
                        btrfs_set_path_blocking(path);
-                       wret = push_leaf_left(trans, root, path, 1, 1);
+                       wret = push_leaf_left(trans, root, path, 1, 1,
+                                             1, (u32)-1);
                        if (wret < 0 && wret != -ENOSPC)
                                ret = wret;
 
                        if (path->nodes[0] == leaf &&
                            btrfs_header_nritems(leaf)) {
-                               wret = push_leaf_right(trans, root, path, 1, 1);
+                               wret = push_leaf_right(trans, root, path, 1,
+                                                      1, 1, 0);
                                if (wret < 0 && wret != -ENOSPC)
                                        ret = wret;
                        }
index 4dbaf89b1337632ac7800b84b183d6cd0ab14242..9254b3d58dbef22974af3c7c61dbc9a4af7a33b6 100644 (file)
@@ -1458,7 +1458,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
         */
 
        /* the destination must be opened for writing */
-       if (!(file->f_mode & FMODE_WRITE))
+       if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND))
                return -EINVAL;
 
        ret = mnt_want_write(file->f_path.mnt);
@@ -1511,7 +1511,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
 
        /* determine range to clone */
        ret = -EINVAL;
-       if (off >= src->i_size || off + len > src->i_size)
+       if (off + len > src->i_size || off + len < off)
                goto out_unlock;
        if (len == 0)
                olen = len = src->i_size - off;
@@ -1578,6 +1578,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
                        u64 disko = 0, diskl = 0;
                        u64 datao = 0, datal = 0;
                        u8 comp;
+                       u64 endoff;
 
                        size = btrfs_item_size_nr(leaf, slot);
                        read_extent_buffer(leaf, buf,
@@ -1712,9 +1713,18 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
                        btrfs_release_path(root, path);
 
                        inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-                       if (new_key.offset + datal > inode->i_size)
-                               btrfs_i_size_write(inode,
-                                                  new_key.offset + datal);
+
+                       /*
+                        * we round up to the block size at eof when
+                        * determining which extents to clone above,
+                        * but shouldn't round up the file size
+                        */
+                       endoff = new_key.offset + datal;
+                       if (endoff > off+olen)
+                               endoff = off+olen;
+                       if (endoff > inode->i_size)
+                               btrfs_i_size_write(inode, endoff);
+
                        BTRFS_I(inode)->flags = BTRFS_I(src)->flags;
                        ret = btrfs_update_inode(trans, root, inode);
                        BUG_ON(ret);
index 04b8280582a94d2002cffb291b43f7fe586e6ff3..bc87b9c1d27ea8e253f5a1b9b395a287ede4106e 100644 (file)
@@ -2,7 +2,7 @@ config CEPH_FS
         tristate "Ceph distributed file system (EXPERIMENTAL)"
        depends on INET && EXPERIMENTAL
        select LIBCRC32C
-       select CONFIG_CRYPTO_AES
+       select CRYPTO_AES
        help
          Choose Y or M here to include support for mounting the
          experimental Ceph distributed file system.  Ceph is an extremely
index 3fe49042d8adaffe6b0f18de5d1b1fd63def729f..6d44053ecff1f08af7bee8546a0435ac55a0e1e2 100644 (file)
@@ -613,6 +613,9 @@ static void ceph_x_destroy(struct ceph_auth_client *ac)
                remove_ticket_handler(ac, th);
        }
 
+       if (xi->auth_authorizer.buf)
+               ceph_buffer_put(xi->auth_authorizer.buf);
+
        kfree(ac->private);
        ac->private = NULL;
 }
index 74144d6389f0af2181d0f1e22fb4ae67c9839ca5..b81be9a5648792c3e6988855a903fb65473fa9c9 100644 (file)
@@ -627,7 +627,7 @@ retry:
        if (fmode >= 0)
                __ceph_get_fmode(ci, fmode);
        spin_unlock(&inode->i_lock);
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
        return 0;
 }
 
@@ -1181,7 +1181,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
        }
 
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
 
        return delayed;
 }
@@ -2153,7 +2153,7 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had)
        else if (flushsnaps)
                ceph_flush_snaps(ci);
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
        if (put)
                iput(inode);
 }
@@ -2229,7 +2229,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,
                iput(inode);
        } else if (complete_capsnap) {
                ceph_flush_snaps(ci);
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
        }
        if (drop_capsnap)
                iput(inode);
@@ -2405,7 +2405,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
        if (queue_invalidate)
                ceph_queue_invalidate(inode);
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
 
        if (check_caps == 1)
                ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_AUTHONLY,
@@ -2460,7 +2460,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
                                         struct ceph_inode_info,
                                         i_flushing_item)->vfs_inode);
                mdsc->num_cap_flushing--;
-               wake_up(&mdsc->cap_flushing_wq);
+               wake_up_all(&mdsc->cap_flushing_wq);
                dout(" inode %p now !flushing\n", inode);
 
                if (ci->i_dirty_caps == 0) {
@@ -2472,7 +2472,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
                }
        }
        spin_unlock(&mdsc->cap_dirty_lock);
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
 
 out:
        spin_unlock(&inode->i_lock);
@@ -2984,6 +2984,7 @@ int ceph_encode_dentry_release(void **p, struct dentry *dentry,
                memcpy(*p, dentry->d_name.name, dentry->d_name.len);
                *p += dentry->d_name.len;
                rel->dname_seq = cpu_to_le32(di->lease_seq);
+               __ceph_mdsc_drop_dentry_lease(dentry);
        }
        spin_unlock(&dentry->d_lock);
        return ret;
index f85719310db2f7aa48d15dee2b3b278e5e8375e0..f94ed3c7f6a5a862a3276b4b222231ab4c40e97f 100644 (file)
@@ -266,6 +266,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
        spin_lock(&inode->i_lock);
        if ((filp->f_pos == 2 || fi->dentry) &&
            !ceph_test_opt(client, NOASYNCREADDIR) &&
+           ceph_snap(inode) != CEPH_SNAPDIR &&
            (ci->i_ceph_flags & CEPH_I_COMPLETE) &&
            __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1)) {
                err = __dcache_readdir(filp, dirent, filldir);
@@ -1013,18 +1014,22 @@ out_touch:
 
 /*
  * When a dentry is released, clear the dir I_COMPLETE if it was part
- * of the current dir gen.
+ * of the current dir gen or if this is in the snapshot namespace.
  */
 static void ceph_dentry_release(struct dentry *dentry)
 {
        struct ceph_dentry_info *di = ceph_dentry(dentry);
        struct inode *parent_inode = dentry->d_parent->d_inode;
+       u64 snapid = ceph_snap(parent_inode);
 
-       if (parent_inode) {
+       dout("dentry_release %p parent %p\n", dentry, parent_inode);
+
+       if (parent_inode && snapid != CEPH_SNAPDIR) {
                struct ceph_inode_info *ci = ceph_inode(parent_inode);
 
                spin_lock(&parent_inode->i_lock);
-               if (ci->i_shared_gen == di->lease_shared_gen) {
+               if (ci->i_shared_gen == di->lease_shared_gen ||
+                   snapid <= CEPH_MAXSNAP) {
                        dout(" clearing %p complete (d_release)\n",
                             parent_inode);
                        ci->i_ceph_flags &= ~CEPH_I_COMPLETE;
@@ -1241,7 +1246,9 @@ struct dentry_operations ceph_dentry_ops = {
 
 struct dentry_operations ceph_snapdir_dentry_ops = {
        .d_revalidate = ceph_snapdir_d_revalidate,
+       .d_release = ceph_dentry_release,
 };
 
 struct dentry_operations ceph_snap_dentry_ops = {
+       .d_release = ceph_dentry_release,
 };
index 6251a1574b9473b7e267c987cd6f9613e49eb57f..7c08698fad3ef6a3aa4502f7ff1b830cde33146f 100644 (file)
@@ -265,7 +265,7 @@ int ceph_release(struct inode *inode, struct file *file)
        kmem_cache_free(ceph_file_cachep, cf);
 
        /* wake up anyone waiting for caps on this inode */
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
        return 0;
 }
 
index 8f9b9fe8ef9f4a84056c16289650d482a8c0c8ff..389f9dbd9949557add69369e6fc4ba68e2c84e69 100644 (file)
@@ -1199,8 +1199,10 @@ retry_lookup:
                                goto out;
                        }
                        err = ceph_init_dentry(dn);
-                       if (err < 0)
+                       if (err < 0) {
+                               dput(dn);
                                goto out;
+                       }
                } else if (dn->d_inode &&
                           (ceph_ino(dn->d_inode) != vino.ino ||
                            ceph_snap(dn->d_inode) != vino.snap)) {
@@ -1499,7 +1501,7 @@ retry:
        if (wrbuffer_refs == 0)
                ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
 }
 
 
index 3ab79f6c4ce8808fa7c72a66adc23dcf0fcfc97d..dd440bd438a930a5dbd30cfa5e6ea63ae24f5947 100644 (file)
@@ -868,7 +868,7 @@ static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap,
 {
        struct ceph_inode_info *ci = ceph_inode(inode);
 
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
        if (arg) {
                spin_lock(&inode->i_lock);
                ci->i_wanted_max_size = 0;
@@ -1514,6 +1514,9 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc,
        ceph_encode_filepath(&p, end, ino1, path1);
        ceph_encode_filepath(&p, end, ino2, path2);
 
+       /* make note of release offset, in case we need to replay */
+       req->r_request_release_offset = p - msg->front.iov_base;
+
        /* cap releases */
        releases = 0;
        if (req->r_inode_drop)
@@ -1561,7 +1564,7 @@ static void complete_request(struct ceph_mds_client *mdsc,
        if (req->r_callback)
                req->r_callback(mdsc, req);
        else
-               complete(&req->r_completion);
+               complete_all(&req->r_completion);
 }
 
 /*
@@ -1580,6 +1583,32 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc,
        dout("prepare_send_request %p tid %lld %s (attempt %d)\n", req,
             req->r_tid, ceph_mds_op_name(req->r_op), req->r_attempts);
 
+       if (req->r_got_unsafe) {
+               /*
+                * Replay.  Do not regenerate message (and rebuild
+                * paths, etc.); just use the original message.
+                * Rebuilding paths will break for renames because
+                * d_move mangles the src name.
+                */
+               msg = req->r_request;
+               rhead = msg->front.iov_base;
+
+               flags = le32_to_cpu(rhead->flags);
+               flags |= CEPH_MDS_FLAG_REPLAY;
+               rhead->flags = cpu_to_le32(flags);
+
+               if (req->r_target_inode)
+                       rhead->ino = cpu_to_le64(ceph_ino(req->r_target_inode));
+
+               rhead->num_retry = req->r_attempts - 1;
+
+               /* remove cap/dentry releases from message */
+               rhead->num_releases = 0;
+               msg->hdr.front_len = cpu_to_le32(req->r_request_release_offset);
+               msg->front.iov_len = req->r_request_release_offset;
+               return 0;
+       }
+
        if (req->r_request) {
                ceph_msg_put(req->r_request);
                req->r_request = NULL;
@@ -1601,13 +1630,9 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc,
        rhead->flags = cpu_to_le32(flags);
        rhead->num_fwd = req->r_num_fwd;
        rhead->num_retry = req->r_attempts - 1;
+       rhead->ino = 0;
 
        dout(" r_locked_dir = %p\n", req->r_locked_dir);
-
-       if (req->r_target_inode && req->r_got_unsafe)
-               rhead->ino = cpu_to_le64(ceph_ino(req->r_target_inode));
-       else
-               rhead->ino = 0;
        return 0;
 }
 
@@ -1907,7 +1932,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
        if (head->safe) {
                req->r_got_safe = true;
                __unregister_request(mdsc, req);
-               complete(&req->r_safe_completion);
+               complete_all(&req->r_safe_completion);
 
                if (req->r_got_unsafe) {
                        /*
@@ -1922,7 +1947,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
 
                        /* last unsafe request during umount? */
                        if (mdsc->stopping && !__get_oldest_req(mdsc))
-                               complete(&mdsc->safe_umount_waiters);
+                               complete_all(&mdsc->safe_umount_waiters);
                        mutex_unlock(&mdsc->mutex);
                        goto out;
                }
@@ -2101,7 +2126,7 @@ static void handle_session(struct ceph_mds_session *session,
                        pr_info("mds%d reconnect denied\n", session->s_mds);
                remove_session_caps(session);
                wake = 1; /* for good measure */
-               complete(&mdsc->session_close_waiters);
+               complete_all(&mdsc->session_close_waiters);
                kick_requests(mdsc, mds);
                break;
 
index b292fa42a66d8026b49a0217ffc0b4e89f381497..952410c60d093e7ba5c39ed630c6283664d90c5a 100644 (file)
@@ -188,6 +188,7 @@ struct ceph_mds_request {
        int r_old_inode_drop, r_old_inode_unless;
 
        struct ceph_msg  *r_request;  /* original request */
+       int r_request_release_offset;
        struct ceph_msg  *r_reply;
        struct ceph_mds_reply_info_parsed r_reply_info;
        int r_err;
index 9ad43a310a415595e338b3a45187131d31fca8cd..15167b2daa5562c3a093ba03fa14932657718551 100644 (file)
@@ -43,7 +43,8 @@ static void ceph_fault(struct ceph_connection *con);
  * nicely render a sockaddr as a string.
  */
 #define MAX_ADDR_STR 20
-static char addr_str[MAX_ADDR_STR][40];
+#define MAX_ADDR_STR_LEN 60
+static char addr_str[MAX_ADDR_STR][MAX_ADDR_STR_LEN];
 static DEFINE_SPINLOCK(addr_str_lock);
 static int last_addr_str;
 
@@ -52,7 +53,6 @@ const char *pr_addr(const struct sockaddr_storage *ss)
        int i;
        char *s;
        struct sockaddr_in *in4 = (void *)ss;
-       unsigned char *quad = (void *)&in4->sin_addr.s_addr;
        struct sockaddr_in6 *in6 = (void *)ss;
 
        spin_lock(&addr_str_lock);
@@ -64,25 +64,13 @@ const char *pr_addr(const struct sockaddr_storage *ss)
 
        switch (ss->ss_family) {
        case AF_INET:
-               sprintf(s, "%u.%u.%u.%u:%u",
-                       (unsigned int)quad[0],
-                       (unsigned int)quad[1],
-                       (unsigned int)quad[2],
-                       (unsigned int)quad[3],
-                       (unsigned int)ntohs(in4->sin_port));
+               snprintf(s, MAX_ADDR_STR_LEN, "%pI4:%u", &in4->sin_addr,
+                        (unsigned int)ntohs(in4->sin_port));
                break;
 
        case AF_INET6:
-               sprintf(s, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%u",
-                       in6->sin6_addr.s6_addr16[0],
-                       in6->sin6_addr.s6_addr16[1],
-                       in6->sin6_addr.s6_addr16[2],
-                       in6->sin6_addr.s6_addr16[3],
-                       in6->sin6_addr.s6_addr16[4],
-                       in6->sin6_addr.s6_addr16[5],
-                       in6->sin6_addr.s6_addr16[6],
-                       in6->sin6_addr.s6_addr16[7],
-                       (unsigned int)ntohs(in6->sin6_port));
+               snprintf(s, MAX_ADDR_STR_LEN, "[%pI6c]:%u", &in6->sin6_addr,
+                        (unsigned int)ntohs(in6->sin6_port));
                break;
 
        default:
@@ -215,12 +203,13 @@ static void set_sock_callbacks(struct socket *sock,
  */
 static struct socket *ceph_tcp_connect(struct ceph_connection *con)
 {
-       struct sockaddr *paddr = (struct sockaddr *)&con->peer_addr.in_addr;
+       struct sockaddr_storage *paddr = &con->peer_addr.in_addr;
        struct socket *sock;
        int ret;
 
        BUG_ON(con->sock);
-       ret = sock_create_kern(AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
+       ret = sock_create_kern(con->peer_addr.in_addr.ss_family, SOCK_STREAM,
+                              IPPROTO_TCP, &sock);
        if (ret)
                return ERR_PTR(ret);
        con->sock = sock;
@@ -234,7 +223,8 @@ static struct socket *ceph_tcp_connect(struct ceph_connection *con)
 
        dout("connect %s\n", pr_addr(&con->peer_addr.in_addr));
 
-       ret = sock->ops->connect(sock, paddr, sizeof(*paddr), O_NONBLOCK);
+       ret = sock->ops->connect(sock, (struct sockaddr *)paddr, sizeof(*paddr),
+                                O_NONBLOCK);
        if (ret == -EINPROGRESS) {
                dout("connect %s EINPROGRESS sk_state = %u\n",
                     pr_addr(&con->peer_addr.in_addr),
@@ -1009,19 +999,32 @@ int ceph_parse_ips(const char *c, const char *end,
                struct sockaddr_in *in4 = (void *)ss;
                struct sockaddr_in6 *in6 = (void *)ss;
                int port;
+               char delim = ',';
+
+               if (*p == '[') {
+                       delim = ']';
+                       p++;
+               }
 
                memset(ss, 0, sizeof(*ss));
                if (in4_pton(p, end - p, (u8 *)&in4->sin_addr.s_addr,
-                            ',', &ipend)) {
+                            delim, &ipend))
                        ss->ss_family = AF_INET;
-               else if (in6_pton(p, end - p, (u8 *)&in6->sin6_addr.s6_addr,
-                                   ',', &ipend)) {
+               else if (in6_pton(p, end - p, (u8 *)&in6->sin6_addr.s6_addr,
+                                 delim, &ipend))
                        ss->ss_family = AF_INET6;
-               } else {
+               else
                        goto bad;
-               }
                p = ipend;
 
+               if (delim == ']') {
+                       if (*p != ']') {
+                               dout("missing matching ']'\n");
+                               goto bad;
+                       }
+                       p++;
+               }
+
                /* port? */
                if (p < end && *p == ':') {
                        port = 0;
@@ -1055,7 +1058,7 @@ int ceph_parse_ips(const char *c, const char *end,
        return 0;
 
 bad:
-       pr_err("parse_ips bad ip '%s'\n", c);
+       pr_err("parse_ips bad ip '%.*s'\n", (int)(end - c), c);
        return -EINVAL;
 }
 
@@ -2015,20 +2018,20 @@ void ceph_con_revoke(struct ceph_connection *con, struct ceph_msg *msg)
 {
        mutex_lock(&con->mutex);
        if (!list_empty(&msg->list_head)) {
-               dout("con_revoke %p msg %p\n", con, msg);
+               dout("con_revoke %p msg %p - was on queue\n", con, msg);
                list_del_init(&msg->list_head);
                ceph_msg_put(msg);
                msg->hdr.seq = 0;
-               if (con->out_msg == msg) {
-                       ceph_msg_put(con->out_msg);
-                       con->out_msg = NULL;
-               }
+       }
+       if (con->out_msg == msg) {
+               dout("con_revoke %p msg %p - was sending\n", con, msg);
+               con->out_msg = NULL;
                if (con->out_kvec_is_msg) {
                        con->out_skip = con->out_kvec_bytes;
                        con->out_kvec_is_msg = false;
                }
-       } else {
-               dout("con_revoke %p msg %p - not queued (sent?)\n", con, msg);
+               ceph_msg_put(msg);
+               msg->hdr.seq = 0;
        }
        mutex_unlock(&con->mutex);
 }
index cc115eafae11e23702cc38b7b015f8cf1d7c597c..54fe01c50706a935da2a9611677320bebae8b967 100644 (file)
@@ -345,7 +345,7 @@ static void ceph_monc_handle_map(struct ceph_mon_client *monc,
 
 out:
        mutex_unlock(&monc->mutex);
-       wake_up(&client->auth_wq);
+       wake_up_all(&client->auth_wq);
 }
 
 /*
@@ -462,7 +462,7 @@ static void handle_statfs_reply(struct ceph_mon_client *monc,
        }
        mutex_unlock(&monc->mutex);
        if (req) {
-               complete(&req->completion);
+               complete_all(&req->completion);
                put_generic_request(req);
        }
        return;
@@ -718,7 +718,7 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
                                     monc->m_auth->front_max);
        if (ret < 0) {
                monc->client->auth_err = ret;
-               wake_up(&monc->client->auth_wq);
+               wake_up_all(&monc->client->auth_wq);
        } else if (ret > 0) {
                __send_prepared_auth_request(monc, ret);
        } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) {
index 92b7251a53f1415275ba8fd0a2d09f3b0cac6010..e38522347898046fe778df23bdc467c5d4248363 100644 (file)
@@ -862,12 +862,12 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg,
        if (req->r_callback)
                req->r_callback(req, msg);
        else
-               complete(&req->r_completion);
+               complete_all(&req->r_completion);
 
        if (flags & CEPH_OSD_FLAG_ONDISK) {
                if (req->r_safe_callback)
                        req->r_safe_callback(req, msg);
-               complete(&req->r_safe_completion);  /* fsync waiter */
+               complete_all(&req->r_safe_completion);  /* fsync waiter */
        }
 
 done:
@@ -1083,7 +1083,7 @@ done:
        if (newmap)
                kick_requests(osdc, NULL);
        up_read(&osdc->map_sem);
-       wake_up(&osdc->client->auth_wq);
+       wake_up_all(&osdc->client->auth_wq);
        return;
 
 bad:
index 50ce64ebd3301eb24cf358ca7d6c1cdb6c0fe444..416d46adbf87208544a1813ddfdadbabf4beb511 100644 (file)
@@ -568,6 +568,7 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end)
                if (ev > CEPH_PG_POOL_VERSION) {
                        pr_warning("got unknown v %d > %d of ceph_pg_pool\n",
                                   ev, CEPH_PG_POOL_VERSION);
+                       kfree(pi);
                        goto bad;
                }
                __decode_pool(p, pi);
@@ -830,12 +831,13 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
                /* remove any? */
                while (rbp && pgid_cmp(rb_entry(rbp, struct ceph_pg_mapping,
                                                node)->pgid, pgid) <= 0) {
-                       struct rb_node *cur = rbp;
+                       struct ceph_pg_mapping *cur =
+                               rb_entry(rbp, struct ceph_pg_mapping, node);
+                       
                        rbp = rb_next(rbp);
-                       dout(" removed pg_temp %llx\n",
-                            *(u64 *)&rb_entry(cur, struct ceph_pg_mapping,
-                                              node)->pgid);
-                       rb_erase(cur, &map->pg_temp);
+                       dout(" removed pg_temp %llx\n", *(u64 *)&cur->pgid);
+                       rb_erase(&cur->node, &map->pg_temp);
+                       kfree(cur);
                }
 
                if (pglen) {
@@ -851,19 +853,22 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
                        for (j = 0; j < pglen; j++)
                                pg->osds[j] = ceph_decode_32(p);
                        err = __insert_pg_mapping(pg, &map->pg_temp);
-                       if (err)
+                       if (err) {
+                               kfree(pg);
                                goto bad;
+                       }
                        dout(" added pg_temp %llx len %d\n", *(u64 *)&pgid,
                             pglen);
                }
        }
        while (rbp) {
-               struct rb_node *cur = rbp;
+               struct ceph_pg_mapping *cur =
+                       rb_entry(rbp, struct ceph_pg_mapping, node);
+
                rbp = rb_next(rbp);
-               dout(" removed pg_temp %llx\n",
-                    *(u64 *)&rb_entry(cur, struct ceph_pg_mapping,
-                                      node)->pgid);
-               rb_erase(cur, &map->pg_temp);
+               dout(" removed pg_temp %llx\n", *(u64 *)&cur->pgid);
+               rb_erase(&cur->node, &map->pg_temp);
+               kfree(cur);
        }
 
        /* ignore the rest */
index 484e52bb40bb20436956167a511567147b6136c5..2cb1a70214d7298070266840bb97ad7bf2c98a57 100644 (file)
@@ -923,7 +923,7 @@ init_cifs(void)
                goto out_unregister_filesystem;
 #endif
 #ifdef CONFIG_CIFS_DFS_UPCALL
-       rc = register_key_type(&key_type_dns_resolver);
+       rc = cifs_init_dns_resolver();
        if (rc)
                goto out_unregister_key_type;
 #endif
@@ -935,7 +935,7 @@ init_cifs(void)
 
  out_unregister_resolver_key:
 #ifdef CONFIG_CIFS_DFS_UPCALL
-       unregister_key_type(&key_type_dns_resolver);
+       cifs_exit_dns_resolver();
  out_unregister_key_type:
 #endif
 #ifdef CONFIG_CIFS_UPCALL
@@ -961,7 +961,7 @@ exit_cifs(void)
        cifs_proc_clean();
 #ifdef CONFIG_CIFS_DFS_UPCALL
        cifs_dfs_release_automount_timer();
-       unregister_key_type(&key_type_dns_resolver);
+       cifs_exit_dns_resolver();
 #endif
 #ifdef CONFIG_CIFS_UPCALL
        unregister_key_type(&cifs_spnego_key_type);
index 4db2c5e7283fa27f6c17848cbc5ab7386ace0432..49315cbf742d7ab22876b69349b6441723d850b7 100644 (file)
  */
 
 #include <linux/slab.h>
+#include <linux/keyctl.h>
+#include <linux/key-type.h>
 #include <keys/user-type.h>
 #include "dns_resolve.h"
 #include "cifsglob.h"
 #include "cifsproto.h"
 #include "cifs_debug.h"
 
+static const struct cred *dns_resolver_cache;
+
 /* Checks if supplied name is IP address
  * returns:
  *             1 - name is IP
@@ -94,6 +98,7 @@ struct key_type key_type_dns_resolver = {
 int
 dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
 {
+       const struct cred *saved_cred;
        int rc = -EAGAIN;
        struct key *rkey = ERR_PTR(-EAGAIN);
        char *name;
@@ -133,8 +138,15 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
                goto skip_upcall;
        }
 
+       saved_cred = override_creds(dns_resolver_cache);
        rkey = request_key(&key_type_dns_resolver, name, "");
+       revert_creds(saved_cred);
        if (!IS_ERR(rkey)) {
+               if (!(rkey->perm & KEY_USR_VIEW)) {
+                       down_read(&rkey->sem);
+                       rkey->perm |= KEY_USR_VIEW;
+                       up_read(&rkey->sem);
+               }
                len = rkey->type_data.x[0];
                data = rkey->payload.data;
        } else {
@@ -165,4 +177,61 @@ out:
        return rc;
 }
 
+int __init cifs_init_dns_resolver(void)
+{
+       struct cred *cred;
+       struct key *keyring;
+       int ret;
+
+       printk(KERN_NOTICE "Registering the %s key type\n",
+              key_type_dns_resolver.name);
+
+       /* create an override credential set with a special thread keyring in
+        * which DNS requests are cached
+        *
+        * this is used to prevent malicious redirections from being installed
+        * with add_key().
+        */
+       cred = prepare_kernel_cred(NULL);
+       if (!cred)
+               return -ENOMEM;
+
+       keyring = key_alloc(&key_type_keyring, ".dns_resolver", 0, 0, cred,
+                           (KEY_POS_ALL & ~KEY_POS_SETATTR) |
+                           KEY_USR_VIEW | KEY_USR_READ,
+                           KEY_ALLOC_NOT_IN_QUOTA);
+       if (IS_ERR(keyring)) {
+               ret = PTR_ERR(keyring);
+               goto failed_put_cred;
+       }
+
+       ret = key_instantiate_and_link(keyring, NULL, 0, NULL, NULL);
+       if (ret < 0)
+               goto failed_put_key;
+
+       ret = register_key_type(&key_type_dns_resolver);
+       if (ret < 0)
+               goto failed_put_key;
+
+       /* instruct request_key() to use this special keyring as a cache for
+        * the results it looks up */
+       cred->thread_keyring = keyring;
+       cred->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING;
+       dns_resolver_cache = cred;
+       return 0;
+
+failed_put_key:
+       key_put(keyring);
+failed_put_cred:
+       put_cred(cred);
+       return ret;
+}
 
+void __exit cifs_exit_dns_resolver(void)
+{
+       key_revoke(dns_resolver_cache->thread_keyring);
+       unregister_key_type(&key_type_dns_resolver);
+       put_cred(dns_resolver_cache);
+       printk(KERN_NOTICE "Unregistered %s key type\n",
+              key_type_dns_resolver.name);
+}
index 966e9288930be75bc9d952cde2960ef3191db212..26b9eaa9f5ee5898ae4241412e4127512fc95ec4 100644 (file)
@@ -24,8 +24,8 @@
 #define _DNS_RESOLVE_H
 
 #ifdef __KERNEL__
-#include <linux/key-type.h>
-extern struct key_type key_type_dns_resolver;
+extern int __init cifs_init_dns_resolver(void);
+extern void __exit cifs_exit_dns_resolver(void);
 extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr);
 #endif /* KERNEL */
 
index c8c78ba078271163f567c26045afff6cf0b5cd71..86d4db15473e51b3b95fa4103eedf28227cc336a 100644 (file)
@@ -896,7 +896,7 @@ EXPORT_SYMBOL(shrink_dcache_parent);
  *
  * In this case we return -1 to tell the caller that we baled.
  */
-static int shrink_dcache_memory(int nr, gfp_t gfp_mask)
+static int shrink_dcache_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
 {
        if (nr) {
                if (!(gfp_mask & __GFP_FS))
index 2d8dbce9d485e4a453903eb1f93473c5942155cc..46c4dd8dfcc3749acc04a03377c6740e280c519c 100644 (file)
@@ -31,9 +31,9 @@ static struct mutex ecryptfs_msg_ctx_lists_mux;
 
 static struct hlist_head *ecryptfs_daemon_hash;
 struct mutex ecryptfs_daemon_hash_mux;
-static int ecryptfs_hash_buckets;
+static int ecryptfs_hash_bits;
 #define ecryptfs_uid_hash(uid) \
-        hash_long((unsigned long)uid, ecryptfs_hash_buckets)
+        hash_long((unsigned long)uid, ecryptfs_hash_bits)
 
 static u32 ecryptfs_msg_counter;
 static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;
@@ -486,18 +486,19 @@ int ecryptfs_init_messaging(void)
        }
        mutex_init(&ecryptfs_daemon_hash_mux);
        mutex_lock(&ecryptfs_daemon_hash_mux);
-       ecryptfs_hash_buckets = 1;
-       while (ecryptfs_number_of_users >> ecryptfs_hash_buckets)
-               ecryptfs_hash_buckets++;
+       ecryptfs_hash_bits = 1;
+       while (ecryptfs_number_of_users >> ecryptfs_hash_bits)
+               ecryptfs_hash_bits++;
        ecryptfs_daemon_hash = kmalloc((sizeof(struct hlist_head)
-                                       * ecryptfs_hash_buckets), GFP_KERNEL);
+                                       * (1 << ecryptfs_hash_bits)),
+                                      GFP_KERNEL);
        if (!ecryptfs_daemon_hash) {
                rc = -ENOMEM;
                printk(KERN_ERR "%s: Failed to allocate memory\n", __func__);
                mutex_unlock(&ecryptfs_daemon_hash_mux);
                goto out;
        }
-       for (i = 0; i < ecryptfs_hash_buckets; i++)
+       for (i = 0; i < (1 << ecryptfs_hash_bits); i++)
                INIT_HLIST_HEAD(&ecryptfs_daemon_hash[i]);
        mutex_unlock(&ecryptfs_daemon_hash_mux);
        ecryptfs_msg_ctx_arr = kmalloc((sizeof(struct ecryptfs_msg_ctx)
@@ -554,7 +555,7 @@ void ecryptfs_release_messaging(void)
                int i;
 
                mutex_lock(&ecryptfs_daemon_hash_mux);
-               for (i = 0; i < ecryptfs_hash_buckets; i++) {
+               for (i = 0; i < (1 << ecryptfs_hash_bits); i++) {
                        int rc;
 
                        hlist_for_each_entry(daemon, elem,
index 4a48c0f4b40275bce81f5c4b5fb40784a45a00bc..84da64b551b2c1170f4e68550ead612ed6fd7b41 100644 (file)
@@ -1041,6 +1041,7 @@ static int trunc_start(struct gfs2_inode *ip, u64 size)
 
        if (gfs2_is_stuffed(ip)) {
                u64 dsize = size + sizeof(struct gfs2_inode);
+               ip->i_disksize = size;
                ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
                gfs2_trans_add_bh(ip->i_gl, dibh, 1);
                gfs2_dinode_out(ip, dibh->b_data);
index 8295c5b5d4a9591e5d112d88ec99a8fd50bcc4d7..6b48d7c268b24b65fae281e606fa32080490cf78 100644 (file)
@@ -392,7 +392,7 @@ static int gfs2_dirent_find_space(const struct gfs2_dirent *dent,
        unsigned totlen = be16_to_cpu(dent->de_rec_len);
 
        if (gfs2_dirent_sentinel(dent))
-               actual = GFS2_DIRENT_SIZE(0);
+               actual = 0;
        if (totlen - actual >= required)
                return 1;
        return 0;
@@ -1231,6 +1231,25 @@ static int do_filldir_main(struct gfs2_inode *dip, u64 *offset,
        return 0;
 }
 
+static void *gfs2_alloc_sort_buffer(unsigned size)
+{
+       void *ptr = NULL;
+
+       if (size < KMALLOC_MAX_SIZE)
+               ptr = kmalloc(size, GFP_NOFS | __GFP_NOWARN);
+       if (!ptr)
+               ptr = __vmalloc(size, GFP_NOFS, PAGE_KERNEL);
+       return ptr;
+}
+
+static void gfs2_free_sort_buffer(void *ptr)
+{
+       if (is_vmalloc_addr(ptr))
+               vfree(ptr);
+       else
+               kfree(ptr);
+}
+
 static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
                              filldir_t filldir, int *copied, unsigned *depth,
                              u64 leaf_no)
@@ -1271,7 +1290,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
         * 99 is the maximum number of entries that can fit in a single
         * leaf block.
         */
-       larr = vmalloc((leaves + entries + 99) * sizeof(void *));
+       larr = gfs2_alloc_sort_buffer((leaves + entries + 99) * sizeof(void *));
        if (!larr)
                goto out;
        darr = (const struct gfs2_dirent **)(larr + leaves);
@@ -1282,7 +1301,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
        do {
                error = get_leaf(ip, lfn, &bh);
                if (error)
-                       goto out_kfree;
+                       goto out_free;
                lf = (struct gfs2_leaf *)bh->b_data;
                lfn = be64_to_cpu(lf->lf_next);
                if (lf->lf_entries) {
@@ -1291,7 +1310,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
                                                gfs2_dirent_gather, NULL, &g);
                        error = PTR_ERR(dent);
                        if (IS_ERR(dent))
-                               goto out_kfree;
+                               goto out_free;
                        if (entries2 != g.offset) {
                                fs_warn(sdp, "Number of entries corrupt in dir "
                                                "leaf %llu, entries2 (%u) != "
@@ -1300,7 +1319,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
                                        entries2, g.offset);
                                        
                                error = -EIO;
-                               goto out_kfree;
+                               goto out_free;
                        }
                        error = 0;
                        larr[leaf++] = bh;
@@ -1312,10 +1331,10 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
        BUG_ON(entries2 != entries);
        error = do_filldir_main(ip, offset, opaque, filldir, darr,
                                entries, copied);
-out_kfree:
+out_free:
        for(i = 0; i < leaf; i++)
                brelse(larr[i]);
-       vfree(larr);
+       gfs2_free_sort_buffer(larr);
 out:
        return error;
 }
index ddcdbf4935366b4eac1a85a74590f98c3a4b0c62..0898f3ec8212e5599df8c547d7d106aeb15d6c86 100644 (file)
@@ -706,8 +706,18 @@ static void glock_work_func(struct work_struct *work)
 {
        unsigned long delay = 0;
        struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_work.work);
+       struct gfs2_holder *gh;
        int drop_ref = 0;
 
+       if (unlikely(test_bit(GLF_FROZEN, &gl->gl_flags))) {
+               spin_lock(&gl->gl_spin);
+               gh = find_first_waiter(gl);
+               if (gh && (gh->gh_flags & LM_FLAG_NOEXP) &&
+                   test_and_clear_bit(GLF_FROZEN, &gl->gl_flags))
+                       set_bit(GLF_REPLY_PENDING, &gl->gl_flags);
+               spin_unlock(&gl->gl_spin);
+       }
+
        if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) {
                finish_xmote(gl, gl->gl_reply);
                drop_ref = 1;
@@ -1348,7 +1358,7 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret)
 }
 
 
-static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask)
+static int gfs2_shrink_glock_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
 {
        struct gfs2_glock *gl;
        int may_demote;
index b5612cbb62a51b75dc97699490658ce6939a4118..f03afd9c44bc748b51811bff46ccdab3d66fa619 100644 (file)
@@ -169,7 +169,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb,
 {
        struct inode *inode;
        struct gfs2_inode *ip;
-       struct gfs2_glock *io_gl;
+       struct gfs2_glock *io_gl = NULL;
        int error;
 
        inode = gfs2_iget(sb, no_addr);
@@ -198,6 +198,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb,
                ip->i_iopen_gh.gh_gl->gl_object = ip;
 
                gfs2_glock_put(io_gl);
+               io_gl = NULL;
 
                if ((type == DT_UNKNOWN) && (no_formal_ino == 0))
                        goto gfs2_nfsbypass;
@@ -228,7 +229,8 @@ gfs2_nfsbypass:
 fail_glock:
        gfs2_glock_dq(&ip->i_iopen_gh);
 fail_iopen:
-       gfs2_glock_put(io_gl);
+       if (io_gl)
+               gfs2_glock_put(io_gl);
 fail_put:
        if (inode->i_state & I_NEW)
                ip->i_gl->gl_object = NULL;
@@ -256,7 +258,7 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr)
 {
        struct gfs2_sbd *sdp;
        struct gfs2_inode *ip;
-       struct gfs2_glock *io_gl;
+       struct gfs2_glock *io_gl = NULL;
        int error;
        struct gfs2_holder gh;
        struct inode *inode;
@@ -293,6 +295,7 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr)
 
        ip->i_iopen_gh.gh_gl->gl_object = ip;
        gfs2_glock_put(io_gl);
+       io_gl = NULL;
 
        inode->i_mode = DT2IF(DT_UNKNOWN);
 
@@ -319,7 +322,8 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr)
 fail_glock:
        gfs2_glock_dq(&ip->i_iopen_gh);
 fail_iopen:
-       gfs2_glock_put(io_gl);
+       if (io_gl)
+               gfs2_glock_put(io_gl);
 fail_put:
        ip->i_gl->gl_object = NULL;
        gfs2_glock_put(ip->i_gl);
index 49667d68769ef8fe5a82920a79f1a37df216804b..8f02d3db8f428fa345062fa50581f1a35c420a0e 100644 (file)
@@ -77,7 +77,7 @@ static LIST_HEAD(qd_lru_list);
 static atomic_t qd_lru_count = ATOMIC_INIT(0);
 static DEFINE_SPINLOCK(qd_lru_lock);
 
-int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask)
+int gfs2_shrink_qd_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
 {
        struct gfs2_quota_data *qd;
        struct gfs2_sbd *sdp;
@@ -694,10 +694,8 @@ get_a_page:
                if (!buffer_mapped(bh))
                        goto unlock_out;
                /* If it's a newly allocated disk block for quota, zero it */
-               if (buffer_new(bh)) {
-                       memset(bh->b_data, 0, bh->b_size);
-                       set_buffer_uptodate(bh);
-               }
+               if (buffer_new(bh))
+                       zero_user(page, pos - blocksize, bh->b_size);
        }
 
        if (PageUptodate(page))
@@ -723,7 +721,7 @@ get_a_page:
 
        /* If quota straddles page boundary, we need to update the rest of the
         * quota at the beginning of the next page */
-       if (offset != 0) { /* first page, offset is closer to PAGE_CACHE_SIZE */
+       if ((offset + sizeof(struct gfs2_quota)) > PAGE_CACHE_SIZE) {
                ptr = ptr + nbytes;
                nbytes = sizeof(struct gfs2_quota) - nbytes;
                offset = 0;
index 195f60c8bd144b6ae5040c878e4f14305cafccc4..e7d236ca48bd28df49f8555fbaa9e1b90460fbd0 100644 (file)
@@ -51,7 +51,7 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip)
        return ret;
 }
 
-extern int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask);
+extern int gfs2_shrink_qd_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask);
 extern const struct quotactl_ops gfs2_quotactl_ops;
 
 #endif /* __QUOTA_DOT_H__ */
index 2bee20ae3d65ba74f970129ec8d147ab7cd4fe50..722860b323a9b40e0dc9f8b2e27e68563eb293c1 100644 (file)
@@ -512,7 +512,7 @@ static void prune_icache(int nr_to_scan)
  * This function is passed the number of inodes to scan, and it returns the
  * total number of remaining possibly-reclaimable inodes.
  */
-static int shrink_icache_memory(int nr, gfp_t gfp_mask)
+static int shrink_icache_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
 {
        if (nr) {
                /*
index bc2ff5932769199f271db9055f7881b2e9c4bf54..036880895bfc8c2e99c42f6fd900819315bd508a 100644 (file)
@@ -297,7 +297,6 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
        struct page *new_page;
        unsigned int new_offset;
        struct buffer_head *bh_in = jh2bh(jh_in);
-       struct jbd2_buffer_trigger_type *triggers;
        journal_t *journal = transaction->t_journal;
 
        /*
@@ -328,21 +327,21 @@ repeat:
                done_copy_out = 1;
                new_page = virt_to_page(jh_in->b_frozen_data);
                new_offset = offset_in_page(jh_in->b_frozen_data);
-               triggers = jh_in->b_frozen_triggers;
        } else {
                new_page = jh2bh(jh_in)->b_page;
                new_offset = offset_in_page(jh2bh(jh_in)->b_data);
-               triggers = jh_in->b_triggers;
        }
 
        mapped_data = kmap_atomic(new_page, KM_USER0);
        /*
-        * Fire any commit trigger.  Do this before checking for escaping,
-        * as the trigger may modify the magic offset.  If a copy-out
-        * happens afterwards, it will have the correct data in the buffer.
+        * Fire data frozen trigger if data already wasn't frozen.  Do this
+        * before checking for escaping, as the trigger may modify the magic
+        * offset.  If a copy-out happens afterwards, it will have the correct
+        * data in the buffer.
         */
-       jbd2_buffer_commit_trigger(jh_in, mapped_data + new_offset,
-                                  triggers);
+       if (!done_copy_out)
+               jbd2_buffer_frozen_trigger(jh_in, mapped_data + new_offset,
+                                          jh_in->b_triggers);
 
        /*
         * Check for escaping
index e214d68620ac167fb5ddeb71775ead1b6063a571..b8e0806681bb0f4acf63964fa3f72ae00e1f8900 100644 (file)
@@ -725,6 +725,9 @@ done:
                page = jh2bh(jh)->b_page;
                offset = ((unsigned long) jh2bh(jh)->b_data) & ~PAGE_MASK;
                source = kmap_atomic(page, KM_USER0);
+               /* Fire data frozen trigger just before we copy the data */
+               jbd2_buffer_frozen_trigger(jh, source + offset,
+                                          jh->b_triggers);
                memcpy(jh->b_frozen_data, source+offset, jh2bh(jh)->b_size);
                kunmap_atomic(source, KM_USER0);
 
@@ -963,15 +966,15 @@ void jbd2_journal_set_triggers(struct buffer_head *bh,
        jh->b_triggers = type;
 }
 
-void jbd2_buffer_commit_trigger(struct journal_head *jh, void *mapped_data,
+void jbd2_buffer_frozen_trigger(struct journal_head *jh, void *mapped_data,
                                struct jbd2_buffer_trigger_type *triggers)
 {
        struct buffer_head *bh = jh2bh(jh);
 
-       if (!triggers || !triggers->t_commit)
+       if (!triggers || !triggers->t_frozen)
                return;
 
-       triggers->t_commit(triggers, bh, mapped_data, bh->b_size);
+       triggers->t_frozen(triggers, bh, mapped_data, bh->b_size);
 }
 
 void jbd2_buffer_abort_trigger(struct journal_head *jh,
index a2d58c96f1b455e55429415d0fc1497dceb9fcaa..d258e261bdc76662b9620e8a14811aaf01b4306b 100644 (file)
@@ -626,7 +626,7 @@ void jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *i
 
 static int check_xattr_ref_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic)
 {
-       /* success of check_xattr_ref_inode() means taht inode (ic) dose not have
+       /* success of check_xattr_ref_inode() means that inode (ic) dose not have
         * duplicate name/value pairs. If duplicate name/value pair would be found,
         * one will be removed.
         */
index ec88ff3d04a9194a4b595701e917ef784b8bdc2a..e28f21b95344378aa09ce95771481711870be902 100644 (file)
@@ -115,7 +115,7 @@ mb_cache_indexes(struct mb_cache *cache)
  * What the mbcache registers as to get shrunk dynamically.
  */
 
-static int mb_cache_shrink_fn(int nr_to_scan, gfp_t gfp_mask);
+static int mb_cache_shrink_fn(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask);
 
 static struct shrinker mb_cache_shrinker = {
        .shrink = mb_cache_shrink_fn,
@@ -191,13 +191,14 @@ forget:
  * This function is called by the kernel memory management when memory
  * gets low.
  *
+ * @shrink: (ignored)
  * @nr_to_scan: Number of objects to scan
  * @gfp_mask: (ignored)
  *
  * Returns the number of objects which are present in the cache.
  */
 static int
-mb_cache_shrink_fn(int nr_to_scan, gfp_t gfp_mask)
+mb_cache_shrink_fn(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask)
 {
        LIST_HEAD(free_list);
        struct list_head *l, *ltmp;
index 782b431ef91c9f521f18d5eeba5a33fbceb5b612..e60416d3f8188b548ec1d55e3438ea7e6f2c926f 100644 (file)
@@ -1710,7 +1710,7 @@ static void nfs_access_free_list(struct list_head *head)
        }
 }
 
-int nfs_access_cache_shrinker(int nr_to_scan, gfp_t gfp_mask)
+int nfs_access_cache_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask)
 {
        LIST_HEAD(head);
        struct nfs_inode *nfsi;
index d8bd619e386c29a47224463b9a30a156bd76c6a8..e70f44b9b3f43ff5a837435e886fd73f2372a20c 100644 (file)
@@ -205,7 +205,8 @@ extern struct rpc_procinfo nfs4_procedures[];
 void nfs_close_context(struct nfs_open_context *ctx, int is_sync);
 
 /* dir.c */
-extern int nfs_access_cache_shrinker(int nr_to_scan, gfp_t gfp_mask);
+extern int nfs_access_cache_shrinker(struct shrinker *shrink,
+                                       int nr_to_scan, gfp_t gfp_mask);
 
 /* inode.c */
 extern struct workqueue_struct *nfsiod_workqueue;
index 3623ca20cc186046cfbf840f03ce9705146b17ba..356e976772bf1adb112aaf3c8b28ddb71b639afb 100644 (file)
@@ -196,15 +196,14 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock,
                        dump_stack();
                        goto bail;
                }
-
-               past_eof = ocfs2_blocks_for_bytes(inode->i_sb, i_size_read(inode));
-               mlog(0, "Inode %lu, past_eof = %llu\n", inode->i_ino,
-                    (unsigned long long)past_eof);
-
-               if (create && (iblock >= past_eof))
-                       set_buffer_new(bh_result);
        }
 
+       past_eof = ocfs2_blocks_for_bytes(inode->i_sb, i_size_read(inode));
+       mlog(0, "Inode %lu, past_eof = %llu\n", inode->i_ino,
+            (unsigned long long)past_eof);
+       if (create && (iblock >= past_eof))
+               set_buffer_new(bh_result);
+
 bail:
        if (err < 0)
                err = -EIO;
@@ -459,36 +458,6 @@ int walk_page_buffers(     handle_t *handle,
        return ret;
 }
 
-handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
-                                                        struct page *page,
-                                                        unsigned from,
-                                                        unsigned to)
-{
-       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
-       handle_t *handle;
-       int ret = 0;
-
-       handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
-       if (IS_ERR(handle)) {
-               ret = -ENOMEM;
-               mlog_errno(ret);
-               goto out;
-       }
-
-       if (ocfs2_should_order_data(inode)) {
-               ret = ocfs2_jbd2_file_inode(handle, inode);
-               if (ret < 0)
-                       mlog_errno(ret);
-       }
-out:
-       if (ret) {
-               if (!IS_ERR(handle))
-                       ocfs2_commit_trans(osb, handle);
-               handle = ERR_PTR(ret);
-       }
-       return handle;
-}
-
 static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
 {
        sector_t status;
@@ -1131,23 +1100,37 @@ out:
  */
 static int ocfs2_grab_pages_for_write(struct address_space *mapping,
                                      struct ocfs2_write_ctxt *wc,
-                                     u32 cpos, loff_t user_pos, int new,
+                                     u32 cpos, loff_t user_pos,
+                                     unsigned user_len, int new,
                                      struct page *mmap_page)
 {
        int ret = 0, i;
-       unsigned long start, target_index, index;
+       unsigned long start, target_index, end_index, index;
        struct inode *inode = mapping->host;
+       loff_t last_byte;
 
        target_index = user_pos >> PAGE_CACHE_SHIFT;
 
        /*
         * Figure out how many pages we'll be manipulating here. For
         * non allocating write, we just change the one
-        * page. Otherwise, we'll need a whole clusters worth.
+        * page. Otherwise, we'll need a whole clusters worth.  If we're
+        * writing past i_size, we only need enough pages to cover the
+        * last page of the write.
         */
        if (new) {
                wc->w_num_pages = ocfs2_pages_per_cluster(inode->i_sb);
                start = ocfs2_align_clusters_to_page_index(inode->i_sb, cpos);
+               /*
+                * We need the index *past* the last page we could possibly
+                * touch.  This is the page past the end of the write or
+                * i_size, whichever is greater.
+                */
+               last_byte = max(user_pos + user_len, i_size_read(inode));
+               BUG_ON(last_byte < 1);
+               end_index = ((last_byte - 1) >> PAGE_CACHE_SHIFT) + 1;
+               if ((start + wc->w_num_pages) > end_index)
+                       wc->w_num_pages = end_index - start;
        } else {
                wc->w_num_pages = 1;
                start = target_index;
@@ -1620,21 +1603,20 @@ out:
  * write path can treat it as an non-allocating write, which has no
  * special case code for sparse/nonsparse files.
  */
-static int ocfs2_expand_nonsparse_inode(struct inode *inode, loff_t pos,
-                                       unsigned len,
+static int ocfs2_expand_nonsparse_inode(struct inode *inode,
+                                       struct buffer_head *di_bh,
+                                       loff_t pos, unsigned len,
                                        struct ocfs2_write_ctxt *wc)
 {
        int ret;
-       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
        loff_t newsize = pos + len;
 
-       if (ocfs2_sparse_alloc(osb))
-               return 0;
+       BUG_ON(ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)));
 
        if (newsize <= i_size_read(inode))
                return 0;
 
-       ret = ocfs2_extend_no_holes(inode, newsize, pos);
+       ret = ocfs2_extend_no_holes(inode, di_bh, newsize, pos);
        if (ret)
                mlog_errno(ret);
 
@@ -1644,6 +1626,18 @@ static int ocfs2_expand_nonsparse_inode(struct inode *inode, loff_t pos,
        return ret;
 }
 
+static int ocfs2_zero_tail(struct inode *inode, struct buffer_head *di_bh,
+                          loff_t pos)
+{
+       int ret = 0;
+
+       BUG_ON(!ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)));
+       if (pos > i_size_read(inode))
+               ret = ocfs2_zero_extend(inode, di_bh, pos);
+
+       return ret;
+}
+
 int ocfs2_write_begin_nolock(struct address_space *mapping,
                             loff_t pos, unsigned len, unsigned flags,
                             struct page **pagep, void **fsdata,
@@ -1679,7 +1673,11 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
                }
        }
 
-       ret = ocfs2_expand_nonsparse_inode(inode, pos, len, wc);
+       if (ocfs2_sparse_alloc(osb))
+               ret = ocfs2_zero_tail(inode, di_bh, pos);
+       else
+               ret = ocfs2_expand_nonsparse_inode(inode, di_bh, pos, len,
+                                                  wc);
        if (ret) {
                mlog_errno(ret);
                goto out;
@@ -1789,7 +1787,7 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
         * that we can zero and flush if we error after adding the
         * extent.
         */
-       ret = ocfs2_grab_pages_for_write(mapping, wc, wc->w_cpos, pos,
+       ret = ocfs2_grab_pages_for_write(mapping, wc, wc->w_cpos, pos, len,
                                         cluster_of_pages, mmap_page);
        if (ret) {
                mlog_errno(ret);
index 6b5a492e1749f8063097a1ebef4e3ef9ad53fdb5..153abb5abef024d2ca63f6d4a23ee1c126b89f13 100644 (file)
@@ -1671,7 +1671,7 @@ struct dlm_ctxt * dlm_register_domain(const char *domain,
        struct dlm_ctxt *dlm = NULL;
        struct dlm_ctxt *new_ctxt = NULL;
 
-       if (strlen(domain) > O2NM_MAX_NAME_LEN) {
+       if (strlen(domain) >= O2NM_MAX_NAME_LEN) {
                ret = -ENAMETOOLONG;
                mlog(ML_ERROR, "domain name length too long\n");
                goto leave;
@@ -1709,6 +1709,7 @@ retry:
                }
 
                if (dlm_protocol_compare(&dlm->fs_locking_proto, fs_proto)) {
+                       spin_unlock(&dlm_domain_lock);
                        mlog(ML_ERROR,
                             "Requested locking protocol version is not "
                             "compatible with already registered domain "
index 4a7506a4e314c34014fd58ab739e836f9babe4e3..94b97fc6a88e62522b1958ed6a89de5e6803525b 100644 (file)
@@ -2808,14 +2808,8 @@ again:
                mlog(0, "trying again...\n");
                goto again;
        }
-       /* now that we are sure the MIGRATING state is there, drop
-        * the unneded state which blocked threads trying to DIRTY */
-       spin_lock(&res->spinlock);
-       BUG_ON(!(res->state & DLM_LOCK_RES_BLOCK_DIRTY));
-       BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING));
-       res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY;
-       spin_unlock(&res->spinlock);
 
+       ret = 0;
        /* did the target go down or die? */
        spin_lock(&dlm->spinlock);
        if (!test_bit(target, dlm->domain_map)) {
@@ -2825,10 +2819,22 @@ again:
        }
        spin_unlock(&dlm->spinlock);
 
+       /*
+        * if target is down, we need to clear DLM_LOCK_RES_BLOCK_DIRTY for
+        * another try; otherwise, we are sure the MIGRATING state is there,
+        * drop the unneded state which blocked threads trying to DIRTY
+        */
+       spin_lock(&res->spinlock);
+       BUG_ON(!(res->state & DLM_LOCK_RES_BLOCK_DIRTY));
+       res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY;
+       if (!ret)
+               BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING));
+       spin_unlock(&res->spinlock);
+
        /*
         * at this point:
         *
-        *   o the DLM_LOCK_RES_MIGRATING flag is set
+        *   o the DLM_LOCK_RES_MIGRATING flag is set if target not down
         *   o there are no pending asts on this lockres
         *   o all processes trying to reserve an ast on this
         *     lockres must wait for the MIGRATING flag to clear
index f8b75ce4be7019ab20d9c5f40d1567a4e520b8fd..9dfaac73b36da4350cc5a2f2dc7a34918a21e11e 100644 (file)
@@ -463,7 +463,7 @@ static int dlm_do_recovery(struct dlm_ctxt *dlm)
        if (dlm->reco.dead_node == O2NM_INVALID_NODE_NUM) {
                int bit;
 
-               bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES+1, 0);
+               bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES, 0);
                if (bit >= O2NM_MAX_NODES || bit < 0)
                        dlm_set_reco_dead_node(dlm, O2NM_INVALID_NODE_NUM);
                else
index 6a13ea64c44773fc239ad55a5237422ddee18e94..2b10b36d15772efcae056a62b4df1a9fe8aa2c53 100644 (file)
@@ -724,28 +724,55 @@ leave:
        return status;
 }
 
+/*
+ * While a write will already be ordering the data, a truncate will not.
+ * Thus, we need to explicitly order the zeroed pages.
+ */
+static handle_t *ocfs2_zero_start_ordered_transaction(struct inode *inode)
+{
+       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
+       handle_t *handle = NULL;
+       int ret = 0;
+
+       if (!ocfs2_should_order_data(inode))
+               goto out;
+
+       handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
+       if (IS_ERR(handle)) {
+               ret = -ENOMEM;
+               mlog_errno(ret);
+               goto out;
+       }
+
+       ret = ocfs2_jbd2_file_inode(handle, inode);
+       if (ret < 0)
+               mlog_errno(ret);
+
+out:
+       if (ret) {
+               if (!IS_ERR(handle))
+                       ocfs2_commit_trans(osb, handle);
+               handle = ERR_PTR(ret);
+       }
+       return handle;
+}
+
 /* Some parts of this taken from generic_cont_expand, which turned out
  * to be too fragile to do exactly what we need without us having to
  * worry about recursive locking in ->write_begin() and ->write_end(). */
-static int ocfs2_write_zero_page(struct inode *inode,
-                                u64 size)
+static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from,
+                                u64 abs_to)
 {
        struct address_space *mapping = inode->i_mapping;
        struct page *page;
-       unsigned long index;
-       unsigned int offset;
+       unsigned long index = abs_from >> PAGE_CACHE_SHIFT;
        handle_t *handle = NULL;
-       int ret;
+       int ret = 0;
+       unsigned zero_from, zero_to, block_start, block_end;
 
-       offset = (size & (PAGE_CACHE_SIZE-1)); /* Within page */
-       /* ugh.  in prepare/commit_write, if from==to==start of block, we
-       ** skip the prepare.  make sure we never send an offset for the start
-       ** of a block
-       */
-       if ((offset & (inode->i_sb->s_blocksize - 1)) == 0) {
-               offset++;
-       }
-       index = size >> PAGE_CACHE_SHIFT;
+       BUG_ON(abs_from >= abs_to);
+       BUG_ON(abs_to > (((u64)index + 1) << PAGE_CACHE_SHIFT));
+       BUG_ON(abs_from & (inode->i_blkbits - 1));
 
        page = grab_cache_page(mapping, index);
        if (!page) {
@@ -754,31 +781,56 @@ static int ocfs2_write_zero_page(struct inode *inode,
                goto out;
        }
 
-       ret = ocfs2_prepare_write_nolock(inode, page, offset, offset);
-       if (ret < 0) {
-               mlog_errno(ret);
-               goto out_unlock;
-       }
+       /* Get the offsets within the page that we want to zero */
+       zero_from = abs_from & (PAGE_CACHE_SIZE - 1);
+       zero_to = abs_to & (PAGE_CACHE_SIZE - 1);
+       if (!zero_to)
+               zero_to = PAGE_CACHE_SIZE;
 
-       if (ocfs2_should_order_data(inode)) {
-               handle = ocfs2_start_walk_page_trans(inode, page, offset,
-                                                    offset);
-               if (IS_ERR(handle)) {
-                       ret = PTR_ERR(handle);
-                       handle = NULL;
+       mlog(0,
+            "abs_from = %llu, abs_to = %llu, index = %lu, zero_from = %u, zero_to = %u\n",
+            (unsigned long long)abs_from, (unsigned long long)abs_to,
+            index, zero_from, zero_to);
+
+       /* We know that zero_from is block aligned */
+       for (block_start = zero_from; block_start < zero_to;
+            block_start = block_end) {
+               block_end = block_start + (1 << inode->i_blkbits);
+
+               /*
+                * block_start is block-aligned.  Bump it by one to
+                * force ocfs2_{prepare,commit}_write() to zero the
+                * whole block.
+                */
+               ret = ocfs2_prepare_write_nolock(inode, page,
+                                                block_start + 1,
+                                                block_start + 1);
+               if (ret < 0) {
+                       mlog_errno(ret);
                        goto out_unlock;
                }
-       }
 
-       /* must not update i_size! */
-       ret = block_commit_write(page, offset, offset);
-       if (ret < 0)
-               mlog_errno(ret);
-       else
-               ret = 0;
+               if (!handle) {
+                       handle = ocfs2_zero_start_ordered_transaction(inode);
+                       if (IS_ERR(handle)) {
+                               ret = PTR_ERR(handle);
+                               handle = NULL;
+                               break;
+                       }
+               }
+
+               /* must not update i_size! */
+               ret = block_commit_write(page, block_start + 1,
+                                        block_start + 1);
+               if (ret < 0)
+                       mlog_errno(ret);
+               else
+                       ret = 0;
+       }
 
        if (handle)
                ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle);
+
 out_unlock:
        unlock_page(page);
        page_cache_release(page);
@@ -786,22 +838,114 @@ out:
        return ret;
 }
 
-static int ocfs2_zero_extend(struct inode *inode,
-                            u64 zero_to_size)
+/*
+ * Find the next range to zero.  We do this in terms of bytes because
+ * that's what ocfs2_zero_extend() wants, and it is dealing with the
+ * pagecache.  We may return multiple extents.
+ *
+ * zero_start and zero_end are ocfs2_zero_extend()s current idea of what
+ * needs to be zeroed.  range_start and range_end return the next zeroing
+ * range.  A subsequent call should pass the previous range_end as its
+ * zero_start.  If range_end is 0, there's nothing to do.
+ *
+ * Unwritten extents are skipped over.  Refcounted extents are CoWd.
+ */
+static int ocfs2_zero_extend_get_range(struct inode *inode,
+                                      struct buffer_head *di_bh,
+                                      u64 zero_start, u64 zero_end,
+                                      u64 *range_start, u64 *range_end)
 {
-       int ret = 0;
-       u64 start_off;
-       struct super_block *sb = inode->i_sb;
+       int rc = 0, needs_cow = 0;
+       u32 p_cpos, zero_clusters = 0;
+       u32 zero_cpos =
+               zero_start >> OCFS2_SB(inode->i_sb)->s_clustersize_bits;
+       u32 last_cpos = ocfs2_clusters_for_bytes(inode->i_sb, zero_end);
+       unsigned int num_clusters = 0;
+       unsigned int ext_flags = 0;
 
-       start_off = ocfs2_align_bytes_to_blocks(sb, i_size_read(inode));
-       while (start_off < zero_to_size) {
-               ret = ocfs2_write_zero_page(inode, start_off);
-               if (ret < 0) {
-                       mlog_errno(ret);
+       while (zero_cpos < last_cpos) {
+               rc = ocfs2_get_clusters(inode, zero_cpos, &p_cpos,
+                                       &num_clusters, &ext_flags);
+               if (rc) {
+                       mlog_errno(rc);
+                       goto out;
+               }
+
+               if (p_cpos && !(ext_flags & OCFS2_EXT_UNWRITTEN)) {
+                       zero_clusters = num_clusters;
+                       if (ext_flags & OCFS2_EXT_REFCOUNTED)
+                               needs_cow = 1;
+                       break;
+               }
+
+               zero_cpos += num_clusters;
+       }
+       if (!zero_clusters) {
+               *range_end = 0;
+               goto out;
+       }
+
+       while ((zero_cpos + zero_clusters) < last_cpos) {
+               rc = ocfs2_get_clusters(inode, zero_cpos + zero_clusters,
+                                       &p_cpos, &num_clusters,
+                                       &ext_flags);
+               if (rc) {
+                       mlog_errno(rc);
                        goto out;
                }
 
-               start_off += sb->s_blocksize;
+               if (!p_cpos || (ext_flags & OCFS2_EXT_UNWRITTEN))
+                       break;
+               if (ext_flags & OCFS2_EXT_REFCOUNTED)
+                       needs_cow = 1;
+               zero_clusters += num_clusters;
+       }
+       if ((zero_cpos + zero_clusters) > last_cpos)
+               zero_clusters = last_cpos - zero_cpos;
+
+       if (needs_cow) {
+               rc = ocfs2_refcount_cow(inode, di_bh, zero_cpos, zero_clusters,
+                                       UINT_MAX);
+               if (rc) {
+                       mlog_errno(rc);
+                       goto out;
+               }
+       }
+
+       *range_start = ocfs2_clusters_to_bytes(inode->i_sb, zero_cpos);
+       *range_end = ocfs2_clusters_to_bytes(inode->i_sb,
+                                            zero_cpos + zero_clusters);
+
+out:
+       return rc;
+}
+
+/*
+ * Zero one range returned from ocfs2_zero_extend_get_range().  The caller
+ * has made sure that the entire range needs zeroing.
+ */
+static int ocfs2_zero_extend_range(struct inode *inode, u64 range_start,
+                                  u64 range_end)
+{
+       int rc = 0;
+       u64 next_pos;
+       u64 zero_pos = range_start;
+
+       mlog(0, "range_start = %llu, range_end = %llu\n",
+            (unsigned long long)range_start,
+            (unsigned long long)range_end);
+       BUG_ON(range_start >= range_end);
+
+       while (zero_pos < range_end) {
+               next_pos = (zero_pos & PAGE_CACHE_MASK) + PAGE_CACHE_SIZE;
+               if (next_pos > range_end)
+                       next_pos = range_end;
+               rc = ocfs2_write_zero_page(inode, zero_pos, next_pos);
+               if (rc < 0) {
+                       mlog_errno(rc);
+                       break;
+               }
+               zero_pos = next_pos;
 
                /*
                 * Very large extends have the potential to lock up
@@ -810,16 +954,63 @@ static int ocfs2_zero_extend(struct inode *inode,
                cond_resched();
        }
 
-out:
+       return rc;
+}
+
+int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh,
+                     loff_t zero_to_size)
+{
+       int ret = 0;
+       u64 zero_start, range_start = 0, range_end = 0;
+       struct super_block *sb = inode->i_sb;
+
+       zero_start = ocfs2_align_bytes_to_blocks(sb, i_size_read(inode));
+       mlog(0, "zero_start %llu for i_size %llu\n",
+            (unsigned long long)zero_start,
+            (unsigned long long)i_size_read(inode));
+       while (zero_start < zero_to_size) {
+               ret = ocfs2_zero_extend_get_range(inode, di_bh, zero_start,
+                                                 zero_to_size,
+                                                 &range_start,
+                                                 &range_end);
+               if (ret) {
+                       mlog_errno(ret);
+                       break;
+               }
+               if (!range_end)
+                       break;
+               /* Trim the ends */
+               if (range_start < zero_start)
+                       range_start = zero_start;
+               if (range_end > zero_to_size)
+                       range_end = zero_to_size;
+
+               ret = ocfs2_zero_extend_range(inode, range_start,
+                                             range_end);
+               if (ret) {
+                       mlog_errno(ret);
+                       break;
+               }
+               zero_start = range_end;
+       }
+
        return ret;
 }
 
-int ocfs2_extend_no_holes(struct inode *inode, u64 new_i_size, u64 zero_to)
+int ocfs2_extend_no_holes(struct inode *inode, struct buffer_head *di_bh,
+                         u64 new_i_size, u64 zero_to)
 {
        int ret;
        u32 clusters_to_add;
        struct ocfs2_inode_info *oi = OCFS2_I(inode);
 
+       /*
+        * Only quota files call this without a bh, and they can't be
+        * refcounted.
+        */
+       BUG_ON(!di_bh && (oi->ip_dyn_features & OCFS2_HAS_REFCOUNT_FL));
+       BUG_ON(!di_bh && !(oi->ip_flags & OCFS2_INODE_SYSTEM_FILE));
+
        clusters_to_add = ocfs2_clusters_for_bytes(inode->i_sb, new_i_size);
        if (clusters_to_add < oi->ip_clusters)
                clusters_to_add = 0;
@@ -840,7 +1031,7 @@ int ocfs2_extend_no_holes(struct inode *inode, u64 new_i_size, u64 zero_to)
         * still need to zero the area between the old i_size and the
         * new i_size.
         */
-       ret = ocfs2_zero_extend(inode, zero_to);
+       ret = ocfs2_zero_extend(inode, di_bh, zero_to);
        if (ret < 0)
                mlog_errno(ret);
 
@@ -862,27 +1053,15 @@ static int ocfs2_extend_file(struct inode *inode,
                goto out;
 
        if (i_size_read(inode) == new_i_size)
-               goto out;
+               goto out;
        BUG_ON(new_i_size < i_size_read(inode));
 
-       /*
-        * Fall through for converting inline data, even if the fs
-        * supports sparse files.
-        *
-        * The check for inline data here is legal - nobody can add
-        * the feature since we have i_mutex. We must check it again
-        * after acquiring ip_alloc_sem though, as paths like mmap
-        * might have raced us to converting the inode to extents.
-        */
-       if (!(oi->ip_dyn_features & OCFS2_INLINE_DATA_FL)
-           && ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)))
-               goto out_update_size;
-
        /*
         * The alloc sem blocks people in read/write from reading our
         * allocation until we're done changing it. We depend on
         * i_mutex to block other extend/truncate calls while we're
-        * here.
+        * here.  We even have to hold it for sparse files because there
+        * might be some tail zeroing.
         */
        down_write(&oi->ip_alloc_sem);
 
@@ -899,14 +1078,16 @@ static int ocfs2_extend_file(struct inode *inode,
                ret = ocfs2_convert_inline_data_to_extents(inode, di_bh);
                if (ret) {
                        up_write(&oi->ip_alloc_sem);
-
                        mlog_errno(ret);
                        goto out;
                }
        }
 
-       if (!ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)))
-               ret = ocfs2_extend_no_holes(inode, new_i_size, new_i_size);
+       if (ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)))
+               ret = ocfs2_zero_extend(inode, di_bh, new_i_size);
+       else
+               ret = ocfs2_extend_no_holes(inode, di_bh, new_i_size,
+                                           new_i_size);
 
        up_write(&oi->ip_alloc_sem);
 
index d66cf4f7c70e34bbec1d63eccd25096eeac7e976..97bf761c9e7c7b8f1c1744bbada1d778095eb3d7 100644 (file)
@@ -54,8 +54,10 @@ int ocfs2_add_inode_data(struct ocfs2_super *osb,
 int ocfs2_simple_size_update(struct inode *inode,
                             struct buffer_head *di_bh,
                             u64 new_i_size);
-int ocfs2_extend_no_holes(struct inode *inode, u64 new_i_size,
-                         u64 zero_to);
+int ocfs2_extend_no_holes(struct inode *inode, struct buffer_head *di_bh,
+                         u64 new_i_size, u64 zero_to);
+int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh,
+                     loff_t zero_to);
 int ocfs2_setattr(struct dentry *dentry, struct iattr *attr);
 int ocfs2_getattr(struct vfsmount *mnt, struct dentry *dentry,
                  struct kstat *stat);
index 47878cf164184cf910bcbbebc10da133aa2e0c64..625de9d7088cdf2c82008b2e875094ec2b43f1d0 100644 (file)
@@ -472,7 +472,7 @@ static inline struct ocfs2_triggers *to_ocfs2_trigger(struct jbd2_buffer_trigger
        return container_of(triggers, struct ocfs2_triggers, ot_triggers);
 }
 
-static void ocfs2_commit_trigger(struct jbd2_buffer_trigger_type *triggers,
+static void ocfs2_frozen_trigger(struct jbd2_buffer_trigger_type *triggers,
                                 struct buffer_head *bh,
                                 void *data, size_t size)
 {
@@ -491,7 +491,7 @@ static void ocfs2_commit_trigger(struct jbd2_buffer_trigger_type *triggers,
  * Quota blocks have their own trigger because the struct ocfs2_block_check
  * offset depends on the blocksize.
  */
-static void ocfs2_dq_commit_trigger(struct jbd2_buffer_trigger_type *triggers,
+static void ocfs2_dq_frozen_trigger(struct jbd2_buffer_trigger_type *triggers,
                                 struct buffer_head *bh,
                                 void *data, size_t size)
 {
@@ -511,7 +511,7 @@ static void ocfs2_dq_commit_trigger(struct jbd2_buffer_trigger_type *triggers,
  * Directory blocks also have their own trigger because the
  * struct ocfs2_block_check offset depends on the blocksize.
  */
-static void ocfs2_db_commit_trigger(struct jbd2_buffer_trigger_type *triggers,
+static void ocfs2_db_frozen_trigger(struct jbd2_buffer_trigger_type *triggers,
                                 struct buffer_head *bh,
                                 void *data, size_t size)
 {
@@ -544,7 +544,7 @@ static void ocfs2_abort_trigger(struct jbd2_buffer_trigger_type *triggers,
 
 static struct ocfs2_triggers di_triggers = {
        .ot_triggers = {
-               .t_commit = ocfs2_commit_trigger,
+               .t_frozen = ocfs2_frozen_trigger,
                .t_abort = ocfs2_abort_trigger,
        },
        .ot_offset      = offsetof(struct ocfs2_dinode, i_check),
@@ -552,7 +552,7 @@ static struct ocfs2_triggers di_triggers = {
 
 static struct ocfs2_triggers eb_triggers = {
        .ot_triggers = {
-               .t_commit = ocfs2_commit_trigger,
+               .t_frozen = ocfs2_frozen_trigger,
                .t_abort = ocfs2_abort_trigger,
        },
        .ot_offset      = offsetof(struct ocfs2_extent_block, h_check),
@@ -560,7 +560,7 @@ static struct ocfs2_triggers eb_triggers = {
 
 static struct ocfs2_triggers rb_triggers = {
        .ot_triggers = {
-               .t_commit = ocfs2_commit_trigger,
+               .t_frozen = ocfs2_frozen_trigger,
                .t_abort = ocfs2_abort_trigger,
        },
        .ot_offset      = offsetof(struct ocfs2_refcount_block, rf_check),
@@ -568,7 +568,7 @@ static struct ocfs2_triggers rb_triggers = {
 
 static struct ocfs2_triggers gd_triggers = {
        .ot_triggers = {
-               .t_commit = ocfs2_commit_trigger,
+               .t_frozen = ocfs2_frozen_trigger,
                .t_abort = ocfs2_abort_trigger,
        },
        .ot_offset      = offsetof(struct ocfs2_group_desc, bg_check),
@@ -576,14 +576,14 @@ static struct ocfs2_triggers gd_triggers = {
 
 static struct ocfs2_triggers db_triggers = {
        .ot_triggers = {
-               .t_commit = ocfs2_db_commit_trigger,
+               .t_frozen = ocfs2_db_frozen_trigger,
                .t_abort = ocfs2_abort_trigger,
        },
 };
 
 static struct ocfs2_triggers xb_triggers = {
        .ot_triggers = {
-               .t_commit = ocfs2_commit_trigger,
+               .t_frozen = ocfs2_frozen_trigger,
                .t_abort = ocfs2_abort_trigger,
        },
        .ot_offset      = offsetof(struct ocfs2_xattr_block, xb_check),
@@ -591,14 +591,14 @@ static struct ocfs2_triggers xb_triggers = {
 
 static struct ocfs2_triggers dq_triggers = {
        .ot_triggers = {
-               .t_commit = ocfs2_dq_commit_trigger,
+               .t_frozen = ocfs2_dq_frozen_trigger,
                .t_abort = ocfs2_abort_trigger,
        },
 };
 
 static struct ocfs2_triggers dr_triggers = {
        .ot_triggers = {
-               .t_commit = ocfs2_commit_trigger,
+               .t_frozen = ocfs2_frozen_trigger,
                .t_abort = ocfs2_abort_trigger,
        },
        .ot_offset      = offsetof(struct ocfs2_dx_root_block, dr_check),
@@ -606,7 +606,7 @@ static struct ocfs2_triggers dr_triggers = {
 
 static struct ocfs2_triggers dl_triggers = {
        .ot_triggers = {
-               .t_commit = ocfs2_commit_trigger,
+               .t_frozen = ocfs2_frozen_trigger,
                .t_abort = ocfs2_abort_trigger,
        },
        .ot_offset      = offsetof(struct ocfs2_dx_leaf, dl_check),
@@ -1936,7 +1936,7 @@ void ocfs2_orphan_scan_work(struct work_struct *work)
        mutex_lock(&os->os_lock);
        ocfs2_queue_orphan_scan(osb);
        if (atomic_read(&os->os_state) == ORPHAN_SCAN_ACTIVE)
-               schedule_delayed_work(&os->os_orphan_scan_work,
+               queue_delayed_work(ocfs2_wq, &os->os_orphan_scan_work,
                                      ocfs2_orphan_scan_timeout());
        mutex_unlock(&os->os_lock);
 }
@@ -1976,8 +1976,8 @@ void ocfs2_orphan_scan_start(struct ocfs2_super *osb)
                atomic_set(&os->os_state, ORPHAN_SCAN_INACTIVE);
        else {
                atomic_set(&os->os_state, ORPHAN_SCAN_ACTIVE);
-               schedule_delayed_work(&os->os_orphan_scan_work,
-                                     ocfs2_orphan_scan_timeout());
+               queue_delayed_work(ocfs2_wq, &os->os_orphan_scan_work,
+                                  ocfs2_orphan_scan_timeout());
        }
 }
 
index 3d7419682dc069da151ae265367f214e15ae31af..ec6adbf8f5515afbaa7e8ffcb8a32b6a3c4e1ea8 100644 (file)
@@ -118,6 +118,7 @@ unsigned int ocfs2_la_default_mb(struct ocfs2_super *osb)
 {
        unsigned int la_mb;
        unsigned int gd_mb;
+       unsigned int la_max_mb;
        unsigned int megs_per_slot;
        struct super_block *sb = osb->sb;
 
@@ -182,6 +183,12 @@ unsigned int ocfs2_la_default_mb(struct ocfs2_super *osb)
        if (megs_per_slot < la_mb)
                la_mb = megs_per_slot;
 
+       /* We can't store more bits than we can in a block. */
+       la_max_mb = ocfs2_clusters_to_megabytes(osb->sb,
+                                               ocfs2_local_alloc_size(sb) * 8);
+       if (la_mb > la_max_mb)
+               la_mb = la_max_mb;
+
        return la_mb;
 }
 
index 2bb35fe00511e98f41f23fa9a93d752d3a82b4fe..4607923eb24c192ff3642042161684a158300908 100644 (file)
@@ -775,7 +775,7 @@ static int ocfs2_acquire_dquot(struct dquot *dquot)
                 * locking allocators ranks above a transaction start
                 */
                WARN_ON(journal_current_handle());
-               status = ocfs2_extend_no_holes(gqinode,
+               status = ocfs2_extend_no_holes(gqinode, NULL,
                        gqinode->i_size + (need_alloc << sb->s_blocksize_bits),
                        gqinode->i_size);
                if (status < 0)
index 8bd70d4d184d5827fdb861b7a565fc26d364f0a1..dc78764ccc4c6211bacee0a409f23606e24b3997 100644 (file)
@@ -971,7 +971,7 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk(
        u64 p_blkno;
 
        /* We are protected by dqio_sem so no locking needed */
-       status = ocfs2_extend_no_holes(lqinode,
+       status = ocfs2_extend_no_holes(lqinode, NULL,
                                       lqinode->i_size + 2 * sb->s_blocksize,
                                       lqinode->i_size);
        if (status < 0) {
@@ -1114,7 +1114,7 @@ static struct ocfs2_quota_chunk *ocfs2_extend_local_quota_file(
                return ocfs2_local_quota_add_chunk(sb, type, offset);
 
        /* We are protected by dqio_sem so no locking needed */
-       status = ocfs2_extend_no_holes(lqinode,
+       status = ocfs2_extend_no_holes(lqinode, NULL,
                                       lqinode->i_size + sb->s_blocksize,
                                       lqinode->i_size);
        if (status < 0) {
index 4793f36f6518b25f312274d2fcdc84492de26340..3ac5aa733e9c8018090bc2493d819937593760a0 100644 (file)
@@ -2931,6 +2931,12 @@ static int ocfs2_duplicate_clusters_by_page(handle_t *handle,
 
        offset = ((loff_t)cpos) << OCFS2_SB(sb)->s_clustersize_bits;
        end = offset + (new_len << OCFS2_SB(sb)->s_clustersize_bits);
+       /*
+        * We only duplicate pages until we reach the page contains i_size - 1.
+        * So trim 'end' to i_size.
+        */
+       if (end > i_size_read(context->inode))
+               end = i_size_read(context->inode);
 
        while (offset < end) {
                page_index = offset >> PAGE_CACHE_SHIFT;
@@ -4166,6 +4172,12 @@ static int __ocfs2_reflink(struct dentry *old_dentry,
        struct inode *inode = old_dentry->d_inode;
        struct buffer_head *new_bh = NULL;
 
+       if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SYSTEM_FILE) {
+               ret = -EINVAL;
+               mlog_errno(ret);
+               goto out;
+       }
+
        ret = filemap_fdatawrite(inode->i_mapping);
        if (ret) {
                mlog_errno(ret);
index f4c2a9eb8c4d75a6354fb52c37ba93edb81bebd5..a8e6a95a353f03dcb8a34cf928ded84ff7e6d127 100644 (file)
@@ -741,7 +741,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb,
                     le16_to_cpu(bg->bg_free_bits_count));
        le32_add_cpu(&cl->cl_recs[alloc_rec].c_total,
                     le16_to_cpu(bg->bg_bits));
-       cl->cl_recs[alloc_rec].c_blkno  = cpu_to_le64(bg->bg_blkno);
+       cl->cl_recs[alloc_rec].c_blkno = bg->bg_blkno;
        if (le16_to_cpu(cl->cl_next_free_rec) < le16_to_cpu(cl->cl_count))
                le16_add_cpu(&cl->cl_next_free_rec, 1);
 
index e97b34842cfea0d188f85476a56c4a0eb0af5ce0..d03469f618012ea4aff64b62f1f77e3e8b8ec47d 100644 (file)
@@ -709,7 +709,7 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode,
                                         struct ocfs2_xattr_value_buf *vb,
                                         struct ocfs2_xattr_set_ctxt *ctxt)
 {
-       int status = 0;
+       int status = 0, credits;
        handle_t *handle = ctxt->handle;
        enum ocfs2_alloc_restarted why;
        u32 prev_clusters, logical_start = le32_to_cpu(vb->vb_xv->xr_clusters);
@@ -719,38 +719,54 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode,
 
        ocfs2_init_xattr_value_extent_tree(&et, INODE_CACHE(inode), vb);
 
-       status = vb->vb_access(handle, INODE_CACHE(inode), vb->vb_bh,
-                             OCFS2_JOURNAL_ACCESS_WRITE);
-       if (status < 0) {
-               mlog_errno(status);
-               goto leave;
-       }
+       while (clusters_to_add) {
+               status = vb->vb_access(handle, INODE_CACHE(inode), vb->vb_bh,
+                                      OCFS2_JOURNAL_ACCESS_WRITE);
+               if (status < 0) {
+                       mlog_errno(status);
+                       break;
+               }
 
-       prev_clusters = le32_to_cpu(vb->vb_xv->xr_clusters);
-       status = ocfs2_add_clusters_in_btree(handle,
-                                            &et,
-                                            &logical_start,
-                                            clusters_to_add,
-                                            0,
-                                            ctxt->data_ac,
-                                            ctxt->meta_ac,
-                                            &why);
-       if (status < 0) {
-               mlog_errno(status);
-               goto leave;
-       }
+               prev_clusters = le32_to_cpu(vb->vb_xv->xr_clusters);
+               status = ocfs2_add_clusters_in_btree(handle,
+                                                    &et,
+                                                    &logical_start,
+                                                    clusters_to_add,
+                                                    0,
+                                                    ctxt->data_ac,
+                                                    ctxt->meta_ac,
+                                                    &why);
+               if ((status < 0) && (status != -EAGAIN)) {
+                       if (status != -ENOSPC)
+                               mlog_errno(status);
+                       break;
+               }
 
-       ocfs2_journal_dirty(handle, vb->vb_bh);
+               ocfs2_journal_dirty(handle, vb->vb_bh);
 
-       clusters_to_add -= le32_to_cpu(vb->vb_xv->xr_clusters) - prev_clusters;
+               clusters_to_add -= le32_to_cpu(vb->vb_xv->xr_clusters) -
+                                        prev_clusters;
 
-       /*
-        * We should have already allocated enough space before the transaction,
-        * so no need to restart.
-        */
-       BUG_ON(why != RESTART_NONE || clusters_to_add);
-
-leave:
+               if (why != RESTART_NONE && clusters_to_add) {
+                       /*
+                        * We can only fail in case the alloc file doesn't give
+                        * up enough clusters.
+                        */
+                       BUG_ON(why == RESTART_META);
+
+                       mlog(0, "restarting xattr value extension for %u"
+                            " clusters,.\n", clusters_to_add);
+                       credits = ocfs2_calc_extend_credits(inode->i_sb,
+                                                           &vb->vb_xv->xr_list,
+                                                           clusters_to_add);
+                       status = ocfs2_extend_trans(handle, credits);
+                       if (status < 0) {
+                               status = -ENOMEM;
+                               mlog_errno(status);
+                               break;
+                       }
+               }
+       }
 
        return status;
 }
@@ -6788,16 +6804,15 @@ out:
        return ret;
 }
 
-static int ocfs2_reflink_xattr_buckets(handle_t *handle,
+static int ocfs2_reflink_xattr_bucket(handle_t *handle,
                                u64 blkno, u64 new_blkno, u32 clusters,
+                               u32 *cpos, int num_buckets,
                                struct ocfs2_alloc_context *meta_ac,
                                struct ocfs2_alloc_context *data_ac,
                                struct ocfs2_reflink_xattr_tree_args *args)
 {
        int i, j, ret = 0;
        struct super_block *sb = args->reflink->old_inode->i_sb;
-       u32 bpc = ocfs2_xattr_buckets_per_cluster(OCFS2_SB(sb));
-       u32 num_buckets = clusters * bpc;
        int bpb = args->old_bucket->bu_blocks;
        struct ocfs2_xattr_value_buf vb = {
                .vb_access = ocfs2_journal_access,
@@ -6816,14 +6831,6 @@ static int ocfs2_reflink_xattr_buckets(handle_t *handle,
                        break;
                }
 
-               /*
-                * The real bucket num in this series of blocks is stored
-                * in the 1st bucket.
-                */
-               if (i == 0)
-                       num_buckets = le16_to_cpu(
-                               bucket_xh(args->old_bucket)->xh_num_buckets);
-
                ret = ocfs2_xattr_bucket_journal_access(handle,
                                                args->new_bucket,
                                                OCFS2_JOURNAL_ACCESS_CREATE);
@@ -6837,6 +6844,18 @@ static int ocfs2_reflink_xattr_buckets(handle_t *handle,
                               bucket_block(args->old_bucket, j),
                               sb->s_blocksize);
 
+               /*
+                * Record the start cpos so that we can use it to initialize
+                * our xattr tree we also set the xh_num_bucket for the new
+                * bucket.
+                */
+               if (i == 0) {
+                       *cpos = le32_to_cpu(bucket_xh(args->new_bucket)->
+                                           xh_entries[0].xe_name_hash);
+                       bucket_xh(args->new_bucket)->xh_num_buckets =
+                               cpu_to_le16(num_buckets);
+               }
+
                ocfs2_xattr_bucket_journal_dirty(handle, args->new_bucket);
 
                ret = ocfs2_reflink_xattr_header(handle, args->reflink,
@@ -6866,6 +6885,7 @@ static int ocfs2_reflink_xattr_buckets(handle_t *handle,
                }
 
                ocfs2_xattr_bucket_journal_dirty(handle, args->new_bucket);
+
                ocfs2_xattr_bucket_relse(args->old_bucket);
                ocfs2_xattr_bucket_relse(args->new_bucket);
        }
@@ -6874,6 +6894,75 @@ static int ocfs2_reflink_xattr_buckets(handle_t *handle,
        ocfs2_xattr_bucket_relse(args->new_bucket);
        return ret;
 }
+
+static int ocfs2_reflink_xattr_buckets(handle_t *handle,
+                               struct inode *inode,
+                               struct ocfs2_reflink_xattr_tree_args *args,
+                               struct ocfs2_extent_tree *et,
+                               struct ocfs2_alloc_context *meta_ac,
+                               struct ocfs2_alloc_context *data_ac,
+                               u64 blkno, u32 cpos, u32 len)
+{
+       int ret, first_inserted = 0;
+       u32 p_cluster, num_clusters, reflink_cpos = 0;
+       u64 new_blkno;
+       unsigned int num_buckets, reflink_buckets;
+       unsigned int bpc =
+               ocfs2_xattr_buckets_per_cluster(OCFS2_SB(inode->i_sb));
+
+       ret = ocfs2_read_xattr_bucket(args->old_bucket, blkno);
+       if (ret) {
+               mlog_errno(ret);
+               goto out;
+       }
+       num_buckets = le16_to_cpu(bucket_xh(args->old_bucket)->xh_num_buckets);
+       ocfs2_xattr_bucket_relse(args->old_bucket);
+
+       while (len && num_buckets) {
+               ret = ocfs2_claim_clusters(handle, data_ac,
+                                          1, &p_cluster, &num_clusters);
+               if (ret) {
+                       mlog_errno(ret);
+                       goto out;
+               }
+
+               new_blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
+               reflink_buckets = min(num_buckets, bpc * num_clusters);
+
+               ret = ocfs2_reflink_xattr_bucket(handle, blkno,
+                                                new_blkno, num_clusters,
+                                                &reflink_cpos, reflink_buckets,
+                                                meta_ac, data_ac, args);
+               if (ret) {
+                       mlog_errno(ret);
+                       goto out;
+               }
+
+               /*
+                * For the 1st allocated cluster, we make it use the same cpos
+                * so that the xattr tree looks the same as the original one
+                * in the most case.
+                */
+               if (!first_inserted) {
+                       reflink_cpos = cpos;
+                       first_inserted = 1;
+               }
+               ret = ocfs2_insert_extent(handle, et, reflink_cpos, new_blkno,
+                                         num_clusters, 0, meta_ac);
+               if (ret)
+                       mlog_errno(ret);
+
+               mlog(0, "insert new xattr extent rec start %llu len %u to %u\n",
+                    (unsigned long long)new_blkno, num_clusters, reflink_cpos);
+
+               len -= num_clusters;
+               blkno += ocfs2_clusters_to_blocks(inode->i_sb, num_clusters);
+               num_buckets -= reflink_buckets;
+       }
+out:
+       return ret;
+}
+
 /*
  * Create the same xattr extent record in the new inode's xattr tree.
  */
@@ -6885,8 +6974,6 @@ static int ocfs2_reflink_xattr_rec(struct inode *inode,
                                   void *para)
 {
        int ret, credits = 0;
-       u32 p_cluster, num_clusters;
-       u64 new_blkno;
        handle_t *handle;
        struct ocfs2_reflink_xattr_tree_args *args =
                        (struct ocfs2_reflink_xattr_tree_args *)para;
@@ -6895,6 +6982,9 @@ static int ocfs2_reflink_xattr_rec(struct inode *inode,
        struct ocfs2_alloc_context *data_ac = NULL;
        struct ocfs2_extent_tree et;
 
+       mlog(0, "reflink xattr buckets %llu len %u\n",
+            (unsigned long long)blkno, len);
+
        ocfs2_init_xattr_tree_extent_tree(&et,
                                          INODE_CACHE(args->reflink->new_inode),
                                          args->new_blk_bh);
@@ -6914,32 +7004,12 @@ static int ocfs2_reflink_xattr_rec(struct inode *inode,
                goto out;
        }
 
-       ret = ocfs2_claim_clusters(handle, data_ac,
-                                  len, &p_cluster, &num_clusters);
-       if (ret) {
-               mlog_errno(ret);
-               goto out_commit;
-       }
-
-       new_blkno = ocfs2_clusters_to_blocks(osb->sb, p_cluster);
-
-       mlog(0, "reflink xattr buckets %llu to %llu, len %u\n",
-            (unsigned long long)blkno, (unsigned long long)new_blkno, len);
-       ret = ocfs2_reflink_xattr_buckets(handle, blkno, new_blkno, len,
-                                         meta_ac, data_ac, args);
-       if (ret) {
-               mlog_errno(ret);
-               goto out_commit;
-       }
-
-       mlog(0, "insert new xattr extent rec start %llu len %u to %u\n",
-            (unsigned long long)new_blkno, len, cpos);
-       ret = ocfs2_insert_extent(handle, &et, cpos, new_blkno,
-                                 len, 0, meta_ac);
+       ret = ocfs2_reflink_xattr_buckets(handle, inode, args, &et,
+                                         meta_ac, data_ac,
+                                         blkno, cpos, len);
        if (ret)
                mlog_errno(ret);
 
-out_commit:
        ocfs2_commit_trans(osb, handle);
 
 out:
index 3e73de5967ff94c9e5896aaf84cd0c6a1c7a4b96..fc8497643fd08f42d48b1bad50c4c30e5f43a782 100644 (file)
@@ -74,6 +74,7 @@ int ibm_partition(struct parsed_partitions *state)
        } *label;
        unsigned char *data;
        Sector sect;
+       sector_t labelsect;
 
        res = 0;
        blocksize = bdev_logical_block_size(bdev);
@@ -97,11 +98,20 @@ int ibm_partition(struct parsed_partitions *state)
            ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0)
                goto out_freeall;
 
+       /*
+        * Special case for FBA disks: label sector does not depend on
+        * blocksize.
+        */
+       if ((info->cu_type == 0x6310 && info->dev_type == 0x9336) ||
+           (info->cu_type == 0x3880 && info->dev_type == 0x3370))
+               labelsect = info->label_block;
+       else
+               labelsect = info->label_block * (blocksize >> 9);
+
        /*
         * Get volume label, extract name and type.
         */
-       data = read_part_sector(state, info->label_block*(blocksize/512),
-                               &sect);
+       data = read_part_sector(state, labelsect, &sect);
        if (data == NULL)
                goto out_readerr;
 
index 12c233da1b6b77e6c06d80b1bd18dbca93b65c78..437d2ca2de973d1027109b038e895e31a68b3a63 100644 (file)
@@ -676,7 +676,7 @@ static void prune_dqcache(int count)
  * This is called from kswapd when we think we need some
  * more memory
  */
-static int shrink_dqcache_memory(int nr, gfp_t gfp_mask)
+static int shrink_dqcache_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
 {
        if (nr) {
                spin_lock(&dq_list_lock);
index f71246bebfe4f1a83d766bee24dc7ec11ad5df09..a7ac78f8e67a4b458793d13f67f3263e58328b6b 100644 (file)
@@ -28,6 +28,7 @@ static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target,
        struct sysfs_dirent *target_sd = NULL;
        struct sysfs_dirent *sd = NULL;
        struct sysfs_addrm_cxt acxt;
+       enum kobj_ns_type ns_type;
        int error;
 
        BUG_ON(!name);
@@ -58,16 +59,29 @@ static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target,
        if (!sd)
                goto out_put;
 
-       if (sysfs_ns_type(parent_sd))
+       ns_type = sysfs_ns_type(parent_sd);
+       if (ns_type)
                sd->s_ns = target->ktype->namespace(target);
        sd->s_symlink.target_sd = target_sd;
        target_sd = NULL;       /* reference is now owned by the symlink */
 
        sysfs_addrm_start(&acxt, parent_sd);
-       if (warn)
-               error = sysfs_add_one(&acxt, sd);
-       else
-               error = __sysfs_add_one(&acxt, sd);
+       /* Symlinks must be between directories with the same ns_type */
+       if (!ns_type ||
+           (ns_type == sysfs_ns_type(sd->s_symlink.target_sd->s_parent))) {
+               if (warn)
+                       error = sysfs_add_one(&acxt, sd);
+               else
+                       error = __sysfs_add_one(&acxt, sd);
+       } else {
+               error = -EINVAL;
+               WARN(1, KERN_WARNING
+                       "sysfs: symlink across ns_types %s/%s -> %s/%s\n",
+                       parent_sd->s_name,
+                       sd->s_name,
+                       sd->s_symlink.target_sd->s_parent->s_name,
+                       sd->s_symlink.target_sd->s_name);
+       }
        sysfs_addrm_finish(&acxt);
 
        if (error)
@@ -122,7 +136,7 @@ void sysfs_delete_link(struct kobject *kobj, struct kobject *targ,
 {
        const void *ns = NULL;
        spin_lock(&sysfs_assoc_lock);
-       if (targ->sd)
+       if (targ->sd && sysfs_ns_type(kobj->sd))
                ns = targ->sd->s_ns;
        spin_unlock(&sysfs_assoc_lock);
        sysfs_hash_and_remove(kobj->sd, ns, name);
index 02feb59cefcac356768d8efdf9e69c9c1ded811e..0b201114a5adf9cfc9c04b6730442748c079fa9d 100644 (file)
@@ -277,7 +277,7 @@ static int kick_a_thread(void)
        return 0;
 }
 
-int ubifs_shrinker(int nr, gfp_t gfp_mask)
+int ubifs_shrinker(struct shrinker *shrink, int nr, gfp_t gfp_mask)
 {
        int freed, contention = 0;
        long clean_zn_cnt = atomic_long_read(&ubifs_clean_zn_cnt);
index 2eef553d50c817e6276e994f4aee80971cdf2191..04310878f449ac44db40c89325dd0f745f2b5cdd 100644 (file)
@@ -1575,7 +1575,7 @@ int ubifs_tnc_start_commit(struct ubifs_info *c, struct ubifs_zbranch *zroot);
 int ubifs_tnc_end_commit(struct ubifs_info *c);
 
 /* shrinker.c */
-int ubifs_shrinker(int nr_to_scan, gfp_t gfp_mask);
+int ubifs_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask);
 
 /* commit.c */
 int ubifs_bg_thread(void *info);
index 649ade8ef598693e2e57ac66475c1993b57903e3..2ee3f7a60163e899e971700aba008a243049726a 100644 (file)
@@ -45,7 +45,7 @@
 
 static kmem_zone_t *xfs_buf_zone;
 STATIC int xfsbufd(void *);
-STATIC int xfsbufd_wakeup(int, gfp_t);
+STATIC int xfsbufd_wakeup(struct shrinker *, int, gfp_t);
 STATIC void xfs_buf_delwri_queue(xfs_buf_t *, int);
 static struct shrinker xfs_buf_shake = {
        .shrink = xfsbufd_wakeup,
@@ -340,7 +340,7 @@ _xfs_buf_lookup_pages(
                                        __func__, gfp_mask);
 
                        XFS_STATS_INC(xb_page_retries);
-                       xfsbufd_wakeup(0, gfp_mask);
+                       xfsbufd_wakeup(NULL, 0, gfp_mask);
                        congestion_wait(BLK_RW_ASYNC, HZ/50);
                        goto retry;
                }
@@ -1762,6 +1762,7 @@ xfs_buf_runall_queues(
 
 STATIC int
 xfsbufd_wakeup(
+       struct shrinker         *shrink,
        int                     priority,
        gfp_t                   mask)
 {
index f2d1718c9165f104befa17069c7b48cfd93a4b3a..80938c736c2769861327ea10368cd0c20d4ceb51 100644 (file)
@@ -1883,7 +1883,6 @@ init_xfs_fs(void)
                goto out_cleanup_procfs;
 
        vfs_initquota();
-       xfs_inode_shrinker_init();
 
        error = register_filesystem(&xfs_fs_type);
        if (error)
@@ -1911,7 +1910,6 @@ exit_xfs_fs(void)
 {
        vfs_exitquota();
        unregister_filesystem(&xfs_fs_type);
-       xfs_inode_shrinker_destroy();
        xfs_sysctl_unregister();
        xfs_cleanup_procfs();
        xfs_buf_terminate();
index ef7f0218bccb45779157128139ab552e8b423832..a51a07c3a70cfa8b5514add3dae137402bbc56b6 100644 (file)
@@ -144,6 +144,41 @@ restart:
        return last_error;
 }
 
+/*
+ * Select the next per-ag structure to iterate during the walk. The reclaim
+ * walk is optimised only to walk AGs with reclaimable inodes in them.
+ */
+static struct xfs_perag *
+xfs_inode_ag_iter_next_pag(
+       struct xfs_mount        *mp,
+       xfs_agnumber_t          *first,
+       int                     tag)
+{
+       struct xfs_perag        *pag = NULL;
+
+       if (tag == XFS_ICI_RECLAIM_TAG) {
+               int found;
+               int ref;
+
+               spin_lock(&mp->m_perag_lock);
+               found = radix_tree_gang_lookup_tag(&mp->m_perag_tree,
+                               (void **)&pag, *first, 1, tag);
+               if (found <= 0) {
+                       spin_unlock(&mp->m_perag_lock);
+                       return NULL;
+               }
+               *first = pag->pag_agno + 1;
+               /* open coded pag reference increment */
+               ref = atomic_inc_return(&pag->pag_ref);
+               spin_unlock(&mp->m_perag_lock);
+               trace_xfs_perag_get_reclaim(mp, pag->pag_agno, ref, _RET_IP_);
+       } else {
+               pag = xfs_perag_get(mp, *first);
+               (*first)++;
+       }
+       return pag;
+}
+
 int
 xfs_inode_ag_iterator(
        struct xfs_mount        *mp,
@@ -154,16 +189,15 @@ xfs_inode_ag_iterator(
        int                     exclusive,
        int                     *nr_to_scan)
 {
+       struct xfs_perag        *pag;
        int                     error = 0;
        int                     last_error = 0;
        xfs_agnumber_t          ag;
        int                     nr;
 
        nr = nr_to_scan ? *nr_to_scan : INT_MAX;
-       for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) {
-               struct xfs_perag        *pag;
-
-               pag = xfs_perag_get(mp, ag);
+       ag = 0;
+       while ((pag = xfs_inode_ag_iter_next_pag(mp, &ag, tag))) {
                error = xfs_inode_ag_walk(mp, pag, execute, flags, tag,
                                                exclusive, &nr);
                xfs_perag_put(pag);
@@ -640,6 +674,17 @@ __xfs_inode_set_reclaim_tag(
        radix_tree_tag_set(&pag->pag_ici_root,
                           XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino),
                           XFS_ICI_RECLAIM_TAG);
+
+       if (!pag->pag_ici_reclaimable) {
+               /* propagate the reclaim tag up into the perag radix tree */
+               spin_lock(&ip->i_mount->m_perag_lock);
+               radix_tree_tag_set(&ip->i_mount->m_perag_tree,
+                               XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino),
+                               XFS_ICI_RECLAIM_TAG);
+               spin_unlock(&ip->i_mount->m_perag_lock);
+               trace_xfs_perag_set_reclaim(ip->i_mount, pag->pag_agno,
+                                                       -1, _RET_IP_);
+       }
        pag->pag_ici_reclaimable++;
 }
 
@@ -674,6 +719,16 @@ __xfs_inode_clear_reclaim_tag(
        radix_tree_tag_clear(&pag->pag_ici_root,
                        XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG);
        pag->pag_ici_reclaimable--;
+       if (!pag->pag_ici_reclaimable) {
+               /* clear the reclaim tag from the perag radix tree */
+               spin_lock(&ip->i_mount->m_perag_lock);
+               radix_tree_tag_clear(&ip->i_mount->m_perag_tree,
+                               XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino),
+                               XFS_ICI_RECLAIM_TAG);
+               spin_unlock(&ip->i_mount->m_perag_lock);
+               trace_xfs_perag_clear_reclaim(ip->i_mount, pag->pag_agno,
+                                                       -1, _RET_IP_);
+       }
 }
 
 /*
@@ -828,83 +883,52 @@ xfs_reclaim_inodes(
 
 /*
  * Shrinker infrastructure.
- *
- * This is all far more complex than it needs to be. It adds a global list of
- * mounts because the shrinkers can only call a global context. We need to make
- * the shrinkers pass a context to avoid the need for global state.
  */
-static LIST_HEAD(xfs_mount_list);
-static struct rw_semaphore xfs_mount_list_lock;
-
 static int
 xfs_reclaim_inode_shrink(
+       struct shrinker *shrink,
        int             nr_to_scan,
        gfp_t           gfp_mask)
 {
        struct xfs_mount *mp;
        struct xfs_perag *pag;
        xfs_agnumber_t  ag;
-       int             reclaimable = 0;
+       int             reclaimable;
 
+       mp = container_of(shrink, struct xfs_mount, m_inode_shrink);
        if (nr_to_scan) {
                if (!(gfp_mask & __GFP_FS))
                        return -1;
 
-               down_read(&xfs_mount_list_lock);
-               list_for_each_entry(mp, &xfs_mount_list, m_mplist) {
-                       xfs_inode_ag_iterator(mp, xfs_reclaim_inode, 0,
+               xfs_inode_ag_iterator(mp, xfs_reclaim_inode, 0,
                                        XFS_ICI_RECLAIM_TAG, 1, &nr_to_scan);
-                       if (nr_to_scan <= 0)
-                               break;
-               }
-               up_read(&xfs_mount_list_lock);
-       }
+               /* if we don't exhaust the scan, don't bother coming back */
+               if (nr_to_scan > 0)
+                       return -1;
+       }
 
-       down_read(&xfs_mount_list_lock);
-       list_for_each_entry(mp, &xfs_mount_list, m_mplist) {
-               for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) {
-                       pag = xfs_perag_get(mp, ag);
-                       reclaimable += pag->pag_ici_reclaimable;
-                       xfs_perag_put(pag);
-               }
+       reclaimable = 0;
+       ag = 0;
+       while ((pag = xfs_inode_ag_iter_next_pag(mp, &ag,
+                                       XFS_ICI_RECLAIM_TAG))) {
+               reclaimable += pag->pag_ici_reclaimable;
+               xfs_perag_put(pag);
        }
-       up_read(&xfs_mount_list_lock);
        return reclaimable;
 }
 
-static struct shrinker xfs_inode_shrinker = {
-       .shrink = xfs_reclaim_inode_shrink,
-       .seeks = DEFAULT_SEEKS,
-};
-
-void __init
-xfs_inode_shrinker_init(void)
-{
-       init_rwsem(&xfs_mount_list_lock);
-       register_shrinker(&xfs_inode_shrinker);
-}
-
-void
-xfs_inode_shrinker_destroy(void)
-{
-       ASSERT(list_empty(&xfs_mount_list));
-       unregister_shrinker(&xfs_inode_shrinker);
-}
-
 void
 xfs_inode_shrinker_register(
        struct xfs_mount        *mp)
 {
-       down_write(&xfs_mount_list_lock);
-       list_add_tail(&mp->m_mplist, &xfs_mount_list);
-       up_write(&xfs_mount_list_lock);
+       mp->m_inode_shrink.shrink = xfs_reclaim_inode_shrink;
+       mp->m_inode_shrink.seeks = DEFAULT_SEEKS;
+       register_shrinker(&mp->m_inode_shrink);
 }
 
 void
 xfs_inode_shrinker_unregister(
        struct xfs_mount        *mp)
 {
-       down_write(&xfs_mount_list_lock);
-       list_del(&mp->m_mplist);
-       up_write(&xfs_mount_list_lock);
+       unregister_shrinker(&mp->m_inode_shrink);
 }
index cdcbaaca9880d04dfa8f2146580b0ef216ed178f..e28139aaa4aa42c6085100856345e0156a33eef3 100644 (file)
@@ -55,8 +55,6 @@ int xfs_inode_ag_iterator(struct xfs_mount *mp,
        int (*execute)(struct xfs_inode *ip, struct xfs_perag *pag, int flags),
        int flags, int tag, int write_lock, int *nr_to_scan);
 
-void xfs_inode_shrinker_init(void);
-void xfs_inode_shrinker_destroy(void);
 void xfs_inode_shrinker_register(struct xfs_mount *mp);
 void xfs_inode_shrinker_unregister(struct xfs_mount *mp);
 
index 73d5aa117384bc1e8c626012dba881e02a5deb57..302820690904d1eff4de201ca97ca97a5fad4c9d 100644 (file)
@@ -124,7 +124,10 @@ DEFINE_EVENT(xfs_perag_class, name,        \
                 unsigned long caller_ip),                                      \
        TP_ARGS(mp, agno, refcount, caller_ip))
 DEFINE_PERAG_REF_EVENT(xfs_perag_get);
+DEFINE_PERAG_REF_EVENT(xfs_perag_get_reclaim);
 DEFINE_PERAG_REF_EVENT(xfs_perag_put);
+DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
+DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
 
 TRACE_EVENT(xfs_attr_list_node_descend,
        TP_PROTO(struct xfs_attr_list_context *ctx,
index 8c117ff2e3ab00d8939f7ec596063988faae283f..67c018392d62a8ecef3c93f35c2b942b0b52137d 100644 (file)
@@ -69,7 +69,7 @@ STATIC void   xfs_qm_list_destroy(xfs_dqlist_t *);
 
 STATIC int     xfs_qm_init_quotainos(xfs_mount_t *);
 STATIC int     xfs_qm_init_quotainfo(xfs_mount_t *);
-STATIC int     xfs_qm_shake(int, gfp_t);
+STATIC int     xfs_qm_shake(struct shrinker *, int, gfp_t);
 
 static struct shrinker xfs_qm_shaker = {
        .shrink = xfs_qm_shake,
@@ -2117,7 +2117,10 @@ xfs_qm_shake_freelist(
  */
 /* ARGSUSED */
 STATIC int
-xfs_qm_shake(int nr_to_scan, gfp_t gfp_mask)
+xfs_qm_shake(
+       struct shrinker *shrink,
+       int             nr_to_scan,
+       gfp_t           gfp_mask)
 {
        int     ndqused, nfree, n;
 
index 1d2c7eed4eda6e3fb545f6b3dd4e0fb30515ea5f..5761087ee8ea31be3e4c571630ceca807485e5e3 100644 (file)
@@ -259,7 +259,7 @@ typedef struct xfs_mount {
        wait_queue_head_t       m_wait_single_sync_task;
        __int64_t               m_update_flags; /* sb flags we need to update
                                                   on the next remount,rw */
-       struct list_head        m_mplist;       /* inode shrinker mount list */
+       struct shrinker         m_inode_shrink; /* inode reclaim shrinker */
 } xfs_mount_t;
 
 /*
index da565a48240e5ad93df5233273bb58301e940752..a68ca8a11a53a6cc06ff32190c16d4f84279ac29 100644 (file)
@@ -48,7 +48,7 @@ struct acpi_power_register {
        u8 space_id;
        u8 bit_width;
        u8 bit_offset;
-       u8 reserved;
+       u8 access_size;
        u64 address;
 } __attribute__ ((packed));
 
@@ -63,6 +63,7 @@ struct acpi_processor_cx {
        u32 power;
        u32 usage;
        u64 time;
+       u8 bm_sts_skip;
        char desc[ACPI_CX_DESC_LEN];
 };
 
index 48c5299cbf26e796e3188f397faa96cd3889a112..030a954ed292a59feae0bbf8437f370127b22bd6 100644 (file)
 /* Align . to a 8 byte boundary equals to maximum function alignment. */
 #define ALIGN_FUNCTION()  . = ALIGN(8)
 
+/*
+ * Align to a 32 byte boundary equal to the
+ * alignment gcc 4.5 uses for a struct
+ */
+#define STRUCT_ALIGN() . = ALIGN(32)
+
 /* The actual configuration determine if the init/exit sections
  * are handled as text/data or they can be discarded (which
  * often happens at runtime)
        LIKELY_PROFILE()                                                \
        BRANCH_PROFILE()                                                \
        TRACE_PRINTKS()                                                 \
+                                                                       \
+       STRUCT_ALIGN();                                                 \
        FTRACE_EVENTS()                                                 \
+                                                                       \
+       STRUCT_ALIGN();                                                 \
        TRACE_SYSCALLS()
 
 /*
  */
 #define INIT_TASK_DATA_SECTION(align)                                  \
        . = ALIGN(align);                                               \
-       .data..init_task : {                                            \
+       .data..init_task :  AT(ADDR(.data..init_task) - LOAD_OFFSET) {  \
                INIT_TASK_DATA(align)                                   \
        }
 
index 224a38c960d4c01830eb96987325d88aee33a2bf..ccf94dc5acdf0ba8cc4f836968f103f542ff43b6 100644 (file)
@@ -253,7 +253,7 @@ int acpi_resources_are_enforced(void);
 #ifdef CONFIG_PM_SLEEP
 void __init acpi_no_s4_hw_signature(void);
 void __init acpi_old_suspend_ordering(void);
-void __init acpi_s4_no_nvs(void);
+void __init acpi_nvs_nosave(void);
 #endif /* CONFIG_PM_SLEEP */
 
 struct acpi_osc_context {
index 8b1038607831360ed621ddb5542c9f686338758e..b0c1740124365979f9e6e50a0671bf217206bdda 100644 (file)
 #ifndef ASMARM_AMBA_H
 #define ASMARM_AMBA_H
 
+#include <linux/clk.h>
 #include <linux/device.h>
+#include <linux/err.h>
 #include <linux/resource.h>
 
 #define AMBA_NR_IRQS   2
 
+struct clk;
+
 struct amba_device {
        struct device           dev;
        struct resource         res;
+       struct clk              *pclk;
        u64                     dma_mask;
        unsigned int            periphid;
        unsigned int            irq[AMBA_NR_IRQS];
@@ -59,6 +64,12 @@ struct amba_device *amba_find_device(const char *, struct device *, unsigned int
 int amba_request_regions(struct amba_device *, const char *);
 void amba_release_regions(struct amba_device *);
 
+#define amba_pclk_enable(d)    \
+       (IS_ERR((d)->pclk) ? 0 : clk_enable((d)->pclk))
+
+#define amba_pclk_disable(d)   \
+       do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0)
+
 #define amba_config(d) (((d)->periphid >> 24) & 0xff)
 #define amba_rev(d)    (((d)->periphid >> 20) & 0x0f)
 #define amba_manf(d)   (((d)->periphid >> 12) & 0xff)
index 8e5a9dfb76bf6425934a09427b8f16df82e937be..e7445df44d6c9324fd32a85ee1145415ecbd7960 100644 (file)
@@ -873,6 +873,8 @@ struct fb_info {
 static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
        struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct)
                        + max_num * sizeof(struct aperture), GFP_KERNEL);
+       if (!a)
+               return NULL;
        a->count = max_num;
        return a;
 }
index 013dc529e95ffc43121fbf8cfbac9d432fa29bc6..d147461bc2712b9c9fb7aae84d65e600d6c60fd4 100644 (file)
@@ -61,7 +61,8 @@ struct files_struct {
        (rcu_dereference_check((fdtfd), \
                               rcu_read_lock_held() || \
                               lockdep_is_held(&(files)->file_lock) || \
-                              atomic_read(&(files)->count) == 1))
+                              atomic_read(&(files)->count) == 1 || \
+                              rcu_my_thread_group_empty()))
 
 #define files_fdtable(files) \
                (rcu_dereference_check_fdtable((files), (files)->fdt))
index 9bf6870ee5f4cff00d8bd3dfea9ee374ebfb2e2b..a986ff588944ae0a5bb1ccc7017150324b488210 100644 (file)
@@ -46,31 +46,31 @@ int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
 
 #else
 
-void i8042_lock_chip(void)
+static inline void i8042_lock_chip(void)
 {
 }
 
-void i8042_unlock_chip(void)
+static inline void i8042_unlock_chip(void)
 {
 }
 
-int i8042_command(unsigned char *param, int command)
+static inline int i8042_command(unsigned char *param, int command)
 {
        return -ENODEV;
 }
 
-bool i8042_check_port_owner(const struct serio *serio)
+static inline bool i8042_check_port_owner(const struct serio *serio)
 {
        return false;
 }
 
-int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
+static inline int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
                                        struct serio *serio))
 {
        return -ENODEV;
 }
 
-int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
+static inline int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
                                       struct serio *serio))
 {
        return -ENODEV;
index 9ea047aca7955e7c654512b37648617d8c76c904..1ffaeffeff740f83e3e79b5d6e03b306410d6b3f 100644 (file)
@@ -67,6 +67,8 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
        }
 }
 
+extern void macvlan_common_setup(struct net_device *dev);
+
 extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
                                  struct nlattr *tb[], struct nlattr *data[],
                                  int (*receive)(struct sk_buff *skb),
index a4d2e9f7088ada70d8b1357f418c32cd09a5bf1a..adf832dec3f37dd639e8aa24fe3cc29c7504a6a7 100644 (file)
@@ -1026,11 +1026,12 @@ void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *);
 
 struct jbd2_buffer_trigger_type {
        /*
-        * Fired just before a buffer is written to the journal.
-        * mapped_data is a mapped buffer that is the frozen data for
-        * commit.
+        * Fired a the moment data to write to the journal are known to be
+        * stable - so either at the moment b_frozen_data is created or just
+        * before a buffer is written to the journal.  mapped_data is a mapped
+        * buffer that is the frozen data for commit.
         */
-       void (*t_commit)(struct jbd2_buffer_trigger_type *type,
+       void (*t_frozen)(struct jbd2_buffer_trigger_type *type,
                         struct buffer_head *bh, void *mapped_data,
                         size_t size);
 
@@ -1042,7 +1043,7 @@ struct jbd2_buffer_trigger_type {
                        struct buffer_head *bh);
 };
 
-extern void jbd2_buffer_commit_trigger(struct journal_head *jh,
+extern void jbd2_buffer_frozen_trigger(struct journal_head *jh,
                                       void *mapped_data,
                                       struct jbd2_buffer_trigger_type *triggers);
 extern void jbd2_buffer_abort_trigger(struct journal_head *jh,
index b969efb03787ee69546995ad378ac54b6bc37e3b..a2b48041b91084865a71c74b3f13342bf02fc6be 100644 (file)
@@ -999,7 +999,7 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm)
  * querying the cache size, so a fastpath for that case is appropriate.
  */
 struct shrinker {
-       int (*shrink)(int nr_to_scan, gfp_t gfp_mask);
+       int (*shrink)(struct shrinker *, int nr_to_scan, gfp_t gfp_mask);
        int seeks;      /* seeks to recreate an obj */
 
        /* These are for internal use */
index 9bdd91486b49d94c42e9ac00efd29e1b282a53b5..7e4cd616bcb57c0e51358073873502c9c417c3ef 100644 (file)
@@ -253,7 +253,7 @@ struct omapfb_platform_data {
 /* in arch/arm/plat-omap/fb.c */
 extern void omapfb_set_platform_data(struct omapfb_platform_data *data);
 extern void omapfb_set_ctrl_platform_data(void *pdata);
-extern void omapfb_reserve_sdram(void);
+extern void omapfb_reserve_sdram_memblock(void);
 
 #endif
 
index 7cb00845f150ca185b73a47931c6a1fbcd4c1cef..f26fda76b87fc66816f2fa286e97d760c545f165 100644 (file)
@@ -288,6 +288,7 @@ struct pci_dev {
         */
        unsigned int    irq;
        struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */
+       resource_size_t fw_addr[DEVICE_COUNT_RESOURCE]; /* FW-assigned addr */
 
        /* These fields are used by common fixups */
        unsigned int    transparent:1;  /* Transparent PCI bridge */
diff --git a/include/linux/regulator/tps6507x.h b/include/linux/regulator/tps6507x.h
new file mode 100644 (file)
index 0000000..4892f59
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * tps6507x.h  --  Voltage regulation for the Texas Instruments TPS6507X
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ *
+ * 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
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+#ifndef REGULATOR_TPS6507X
+#define REGULATOR_TPS6507X
+
+/**
+ * tps6507x_reg_platform_data - platform data for tps6507x
+ * @defdcdc_default: Defines whether DCDC high or the low register controls
+ *     output voltage by default. Valid for DCDC2 and DCDC3 outputs only.
+ */
+struct tps6507x_reg_platform_data {
+       bool defdcdc_default;
+};
+
+#endif
index 7f614ce274a9198e969d573834d8782f95b8e6a3..13ebb5413a7982c5fdd1153432794f39a708f362 100644 (file)
@@ -124,7 +124,8 @@ extern struct trace_event_functions enter_syscall_print_funcs;
 extern struct trace_event_functions exit_syscall_print_funcs;
 
 #define SYSCALL_TRACE_ENTER_EVENT(sname)                               \
-       static struct syscall_metadata __syscall_meta_##sname;          \
+       static struct syscall_metadata                                  \
+       __attribute__((__aligned__(4))) __syscall_meta_##sname;         \
        static struct ftrace_event_call                                 \
        __attribute__((__aligned__(4))) event_enter_##sname;            \
        static struct ftrace_event_call __used                          \
@@ -138,7 +139,8 @@ extern struct trace_event_functions exit_syscall_print_funcs;
        }
 
 #define SYSCALL_TRACE_EXIT_EVENT(sname)                                        \
-       static struct syscall_metadata __syscall_meta_##sname;          \
+       static struct syscall_metadata                                  \
+       __attribute__((__aligned__(4))) __syscall_meta_##sname;         \
        static struct ftrace_event_call                                 \
        __attribute__((__aligned__(4))) event_exit_##sname;             \
        static struct ftrace_event_call __used                          \
index 4496322e28dd95534a99ca28776cb77b91e966e6..609e8ca5f53429bddfc2c29aee5e0411cfe464af 100644 (file)
@@ -45,6 +45,7 @@ struct sysrq_key_op {
  */
 
 void handle_sysrq(int key, struct tty_struct *tty);
+void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
 int register_sysrq_key(int key, struct sysrq_key_op *op);
 int unregister_sysrq_key(int key, struct sysrq_key_op *op);
 struct sysrq_key_op *__sysrq_get_key_op(int key);
index c9a97597699522db33b2f309bd58368970eb9651..814f294d4cd07b0ccd5e26870f681e0733a2b671 100644 (file)
@@ -29,6 +29,7 @@
  */
 
 #ifndef LINUX_VGA_H
+#define LINUX_VGA_H
 
 #include <asm/vga.h>
 
index fd882261225e793c9c08718faf9467d15b3bfea8..9696a5e2c437f3e33dc8f4d2bd50f8ff8bff6a53 100644 (file)
@@ -799,7 +799,7 @@ do {                                                                        \
                X##_e -= (_FP_W_TYPE_SIZE - rsize);                     \
        X##_e = rsize - X##_e - 1;                                      \
                                                                        \
-       if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs < X##_e)    \
+       if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs <= X##_e)   \
          __FP_FRAC_SRS_1(ur_, (X##_e - _FP_WFRACBITS_##fs + 1), rsize);\
        _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize);                       \
        if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0)                       \
index 731150d52799ecc5492b3590c3b7b5b34de09072..0a691ea7654aefb403e25039f08641691d3de74c 100644 (file)
@@ -1224,12 +1224,7 @@ static inline void sk_tx_queue_clear(struct sock *sk)
 
 static inline int sk_tx_queue_get(const struct sock *sk)
 {
-       return sk->sk_tx_queue_mapping;
-}
-
-static inline bool sk_tx_queue_recorded(const struct sock *sk)
-{
-       return (sk && sk->sk_tx_queue_mapping >= 0);
+       return sk ? sk->sk_tx_queue_mapping : -1;
 }
 
 static inline void sk_set_socket(struct sock *sk, struct socket *sock)
index ceac661cdfd5fdddb29314389f1e3e4bbca320ba..cfe2943690ff298cd3e938ecef2ddb8d49dfc229 100644 (file)
@@ -9,6 +9,7 @@ struct tcf_mirred {
        int                     tcfm_ifindex;
        int                     tcfm_ok_push;
        struct net_device       *tcfm_dev;
+       struct list_head        tcfm_list;
 };
 #define to_mirred(pc) \
        container_of(pc, struct tcf_mirred, common)
index 506c8491a8d131761432aa306e51eef441863887..40a8f462a8224b298690cb07892f93afe8c15214 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -1256,6 +1256,33 @@ out:
        return un;
 }
 
+
+/**
+ * get_queue_result - Retrieve the result code from sem_queue
+ * @q: Pointer to queue structure
+ *
+ * Retrieve the return code from the pending queue. If IN_WAKEUP is found in
+ * q->status, then we must loop until the value is replaced with the final
+ * value: This may happen if a task is woken up by an unrelated event (e.g.
+ * signal) and in parallel the task is woken up by another task because it got
+ * the requested semaphores.
+ *
+ * The function can be called with or without holding the semaphore spinlock.
+ */
+static int get_queue_result(struct sem_queue *q)
+{
+       int error;
+
+       error = q->status;
+       while (unlikely(error == IN_WAKEUP)) {
+               cpu_relax();
+               error = q->status;
+       }
+
+       return error;
+}
+
+
 SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
                unsigned, nsops, const struct timespec __user *, timeout)
 {
@@ -1409,15 +1436,18 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
        else
                schedule();
 
-       error = queue.status;
-       while(unlikely(error == IN_WAKEUP)) {
-               cpu_relax();
-               error = queue.status;
-       }
+       error = get_queue_result(&queue);
 
        if (error != -EINTR) {
                /* fast path: update_queue already obtained all requested
-                * resources */
+                * resources.
+                * Perform a smp_mb(): User space could assume that semop()
+                * is a memory barrier: Without the mb(), the cpu could
+                * speculatively read in user space stale data that was
+                * overwritten by the previous owner of the semaphore.
+                */
+               smp_mb();
+
                goto out_free;
        }
 
@@ -1427,10 +1457,12 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
                goto out_free;
        }
 
+       error = get_queue_result(&queue);
+
        /*
         * If queue.status != -EINTR we are woken up by another process
         */
-       error = queue.status;
+
        if (error != -EINTR) {
                goto out_unlock_free;
        }
index 5cb7cd1de10c7dd5b3380f69d49854cb539a4011..8bc5eeffec8a953f844d853cc9abe30bbb4d77c4 100644 (file)
@@ -605,13 +605,13 @@ cpu_master_loop:
                if (dbg_kdb_mode) {
                        kgdb_connected = 1;
                        error = kdb_stub(ks);
+                       kgdb_connected = 0;
                } else {
                        error = gdb_serial_stub(ks);
                }
 
                if (error == DBG_PASS_EVENT) {
                        dbg_kdb_mode = !dbg_kdb_mode;
-                       kgdb_connected = 0;
                } else if (error == DBG_SWITCH_CPU_EVENT) {
                        dbg_cpu_switch(cpu, dbg_switch_cpu);
                        goto cpu_loop;
index 4b17b32695259060260f9748d2c51490397c4888..e8fd6868682d1c3f9d5736aa7a9f9148be49e75e 100644 (file)
@@ -621,10 +621,8 @@ static void gdb_cmd_query(struct kgdb_state *ks)
        switch (remcom_in_buffer[1]) {
        case 's':
        case 'f':
-               if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10)) {
-                       error_packet(remcom_out_buffer, -EINVAL);
+               if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10))
                        break;
-               }
 
                i = 0;
                remcom_out_buffer[0] = 'm';
@@ -665,10 +663,9 @@ static void gdb_cmd_query(struct kgdb_state *ks)
                pack_threadid(remcom_out_buffer + 2, thref);
                break;
        case 'T':
-               if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16)) {
-                       error_packet(remcom_out_buffer, -EINVAL);
+               if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16))
                        break;
-               }
+
                ks->threadid = 0;
                ptr = remcom_in_buffer + 17;
                kgdb_hex2long(&ptr, &ks->threadid);
index 184cd8209c365de082c70c354f25758d22339ed8..ebe4a287419e2788f4a08d263007350fa0e3eb86 100644 (file)
@@ -1820,9 +1820,8 @@ static int kdb_sr(int argc, const char **argv)
 {
        if (argc != 1)
                return KDB_ARGCOUNT;
-       sysrq_toggle_support(1);
        kdb_trap_printk++;
-       handle_sysrq(*argv[1], NULL);
+       __handle_sysrq(*argv[1], NULL, 0);
        kdb_trap_printk--;
 
        return 0;
@@ -1883,6 +1882,7 @@ static int kdb_lsmod(int argc, const char **argv)
                        kdb_printf(" (Loading)");
                else
                        kdb_printf(" (Live)");
+               kdb_printf(" 0x%p", mod->module_core);
 
 #ifdef CONFIG_MODULE_UNLOAD
                {
@@ -2291,6 +2291,9 @@ static int kdb_ll(int argc, const char **argv)
        while (va) {
                char buf[80];
 
+               if (KDB_FLAG(CMD_INTERRUPT))
+                       return 0;
+
                sprintf(buf, "%s " kdb_machreg_fmt "\n", command, va);
                diag = kdb_parse(buf);
                if (diag)
index 31aa9332ef3f8d4f5447f72a3989cbfd0dc7c6df..7bfae887f211556961515b5d057cdcf2880a71c9 100644 (file)
@@ -7,6 +7,8 @@
 #include <linux/bootmem.h>
 #include <linux/mm.h>
 #include <linux/early_res.h>
+#include <linux/slab.h>
+#include <linux/kmemleak.h>
 
 /*
  * Early reserved memory areas.
@@ -319,6 +321,8 @@ void __init free_early(u64 start, u64 end)
        struct early_res *r;
        int i;
 
+       kmemleak_free_part(__va(start), end - start);
+
        i = find_overlapped_early(start, end);
        r = &early_res[i];
        if (i >= max_early_res || r->end != end || r->start != start)
@@ -333,6 +337,8 @@ void __init free_early_partial(u64 start, u64 end)
        struct early_res *r;
        int i;
 
+       kmemleak_free_part(__va(start), end - start);
+
        if (start == end)
                return;
 
index 5d2d28197c827a840d98357c11c1e16b3dce92a2..6c562828c85c2d3d952c46be2de0b2cb0b3748a9 100644 (file)
@@ -787,7 +787,6 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
 
        /* Store the name of the last unloaded module for diagnostic purposes */
        strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
-       ddebug_remove_module(mod->name);
 
        free_module(mod);
        return 0;
@@ -1550,6 +1549,9 @@ static void free_module(struct module *mod)
        remove_sect_attrs(mod);
        mod_kobject_remove(mod);
 
+       /* Remove dynamic debug info */
+       ddebug_remove_module(mod->name);
+
        /* Arch-specific cleanup. */
        module_arch_cleanup(mod);
 
index 58c66cc5056a7073aabf880116548a9572c2894b..142c84a54993a75ca2fbd5346e3eb5b16552f390 100644 (file)
@@ -833,15 +833,24 @@ static void * __init ___alloc_bootmem_node(bootmem_data_t *bdata,
 void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,
                                   unsigned long align, unsigned long goal)
 {
+       void *ptr;
+
        if (WARN_ON_ONCE(slab_is_available()))
                return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id);
 
 #ifdef CONFIG_NO_BOOTMEM
-       return __alloc_memory_core_early(pgdat->node_id, size, align,
+       ptr = __alloc_memory_core_early(pgdat->node_id, size, align,
+                                        goal, -1ULL);
+       if (ptr)
+               return ptr;
+
+       ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align,
                                         goal, -1ULL);
 #else
-       return ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0);
+       ptr = ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0);
 #endif
+
+       return ptr;
 }
 
 void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
@@ -977,14 +986,21 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align,
 void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size,
                                       unsigned long align, unsigned long goal)
 {
+       void *ptr;
+
        if (WARN_ON_ONCE(slab_is_available()))
                return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id);
 
 #ifdef CONFIG_NO_BOOTMEM
-       return __alloc_memory_core_early(pgdat->node_id, size, align,
+       ptr = __alloc_memory_core_early(pgdat->node_id, size, align,
+                               goal, ARCH_LOW_ADDRESS_LIMIT);
+       if (ptr)
+               return ptr;
+       ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align,
                                goal, ARCH_LOW_ADDRESS_LIMIT);
 #else
-       return ___alloc_bootmem_node(pgdat->bdata, size, align,
+       ptr = ___alloc_bootmem_node(pgdat->bdata, size, align,
                                goal, ARCH_LOW_ADDRESS_LIMIT);
 #endif
+       return ptr;
 }
index 431214b941acec39f68e171e468a59f74b9b749e..9bd339eb04c6c84691232bc7e499947fe9d13942 100644 (file)
@@ -3634,6 +3634,9 @@ void * __init __alloc_memory_core_early(int nid, u64 size, u64 align,
        int i;
        void *ptr;
 
+       if (limit > get_max_mapped())
+               limit = get_max_mapped();
+
        /* need to go over early_node_map to find out good range for node */
        for_each_active_range_index_in_nid(i, nid) {
                u64 addr;
@@ -3659,6 +3662,11 @@ void * __init __alloc_memory_core_early(int nid, u64 size, u64 align,
                ptr = phys_to_virt(addr);
                memset(ptr, 0, size);
                reserve_early_without_check(addr, addr + size, "BOOTMEM");
+               /*
+                * The min_count is set to 0 so that bootmem allocated blocks
+                * are never reported as leaks.
+                */
+               kmemleak_alloc(ptr, size, 0, 0);
                return ptr;
        }
 
index 6c0081441a326a174f83ebd66485bd9cb961f88d..5bffada7cde17a383e5ba510c2cca4be23463042 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/vmalloc.h>
 #include <linux/cgroup.h>
 #include <linux/swapops.h>
+#include <linux/kmemleak.h>
 
 static void __meminit
 __init_page_cgroup(struct page_cgroup *pc, unsigned long pfn)
@@ -126,6 +127,12 @@ static int __init_refok init_section_page_cgroup(unsigned long pfn)
                        if (!base)
                                base = vmalloc(table_size);
                }
+               /*
+                * The value stored in section->page_cgroup is (base - pfn)
+                * and it does not point to the memory block allocated above,
+                * causing kmemleak false positives.
+                */
+               kmemleak_not_leak(base);
        } else {
                /*
                 * We don't have to allocate page_cgroup again, but
index 9c7e57cc63a34f7231b77a7d8b395d3157a34ba6..b94fe1b3da435f34f567e8a23358ec18ccd452ad 100644 (file)
@@ -213,8 +213,9 @@ unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
        list_for_each_entry(shrinker, &shrinker_list, list) {
                unsigned long long delta;
                unsigned long total_scan;
-               unsigned long max_pass = (*shrinker->shrink)(0, gfp_mask);
+               unsigned long max_pass;
 
+               max_pass = (*shrinker->shrink)(shrinker, 0, gfp_mask);
                delta = (4 * scanned) / shrinker->seeks;
                delta *= max_pass;
                do_div(delta, lru_pages + 1);
@@ -242,8 +243,9 @@ unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
                        int shrink_ret;
                        int nr_before;
 
-                       nr_before = (*shrinker->shrink)(0, gfp_mask);
-                       shrink_ret = (*shrinker->shrink)(this_scan, gfp_mask);
+                       nr_before = (*shrinker->shrink)(shrinker, 0, gfp_mask);
+                       shrink_ret = (*shrinker->shrink)(shrinker, this_scan,
+                                                               gfp_mask);
                        if (shrink_ret == -1)
                                break;
                        if (shrink_ret < nr_before)
@@ -296,7 +298,7 @@ static int may_write_to_queue(struct backing_dev_info *bdi)
 static void handle_write_error(struct address_space *mapping,
                                struct page *page, int error)
 {
-       lock_page(page);
+       lock_page_nosync(page);
        if (page_mapping(page) == mapping)
                mapping_set_error(mapping, error);
        unlock_page(page);
index b10e3cdb08f87358ca64d0db8cf83c27f5ad624a..800b6b9fbbaefe15c90406e7631acd4e25b172b3 100644 (file)
@@ -358,6 +358,11 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
                acl->sec_level = sec_level;
                acl->auth_type = auth_type;
                hci_acl_connect(acl);
+       } else {
+               if (acl->sec_level < sec_level)
+                       acl->sec_level = sec_level;
+               if (acl->auth_type < auth_type)
+                       acl->auth_type = auth_type;
        }
 
        if (type == ACL_LINK)
index 6c57fc71c7e2d0df7c75daf1054901cf7ed8eee6..786b5de0bac42819ae3e207c942840a69f2c13da 100644 (file)
@@ -1049,6 +1049,8 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
        if (conn) {
                if (!ev->status)
                        conn->link_mode |= HCI_LM_AUTH;
+               else
+                       conn->sec_level = BT_SECURITY_LOW;
 
                clear_bit(HCI_CONN_AUTH_PEND, &conn->pend);
 
index 1b682a5aa0616911c2861b5d836c015230922faf..cf3c4073a8a655d6e9d8936cb61d30254224962f 100644 (file)
@@ -401,6 +401,11 @@ static inline void l2cap_send_rr_or_rnr(struct l2cap_pinfo *pi, u16 control)
        l2cap_send_sframe(pi, control);
 }
 
+static inline int __l2cap_no_conn_pending(struct sock *sk)
+{
+       return !(l2cap_pi(sk)->conf_state & L2CAP_CONF_CONNECT_PEND);
+}
+
 static void l2cap_do_start(struct sock *sk)
 {
        struct l2cap_conn *conn = l2cap_pi(sk)->conn;
@@ -409,12 +414,13 @@ static void l2cap_do_start(struct sock *sk)
                if (!(conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE))
                        return;
 
-               if (l2cap_check_security(sk)) {
+               if (l2cap_check_security(sk) && __l2cap_no_conn_pending(sk)) {
                        struct l2cap_conn_req req;
                        req.scid = cpu_to_le16(l2cap_pi(sk)->scid);
                        req.psm  = l2cap_pi(sk)->psm;
 
                        l2cap_pi(sk)->ident = l2cap_get_ident(conn);
+                       l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
 
                        l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
                                        L2CAP_CONN_REQ, sizeof(req), &req);
@@ -464,12 +470,14 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
                }
 
                if (sk->sk_state == BT_CONNECT) {
-                       if (l2cap_check_security(sk)) {
+                       if (l2cap_check_security(sk) &&
+                                       __l2cap_no_conn_pending(sk)) {
                                struct l2cap_conn_req req;
                                req.scid = cpu_to_le16(l2cap_pi(sk)->scid);
                                req.psm  = l2cap_pi(sk)->psm;
 
                                l2cap_pi(sk)->ident = l2cap_get_ident(conn);
+                               l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
 
                                l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
                                        L2CAP_CONN_REQ, sizeof(req), &req);
@@ -2912,7 +2920,6 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd
                l2cap_pi(sk)->ident = 0;
                l2cap_pi(sk)->dcid = dcid;
                l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT;
-
                l2cap_pi(sk)->conf_state &= ~L2CAP_CONF_CONNECT_PEND;
 
                l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ,
@@ -4404,6 +4411,7 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
                                req.psm  = l2cap_pi(sk)->psm;
 
                                l2cap_pi(sk)->ident = l2cap_get_ident(conn);
+                               l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
 
                                l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
                                        L2CAP_CONN_REQ, sizeof(req), &req);
index eedf2c94820e26150d8823c2aa1652626c5f281d..753fc4221f3c3587e41dfd816fd6e2771578a243 100644 (file)
@@ -217,14 +217,6 @@ static bool br_devices_support_netpoll(struct net_bridge *br)
        return count != 0 && ret;
 }
 
-static void br_poll_controller(struct net_device *br_dev)
-{
-       struct netpoll *np = br_dev->npinfo->netpoll;
-
-       if (np->real_dev != br_dev)
-               netpoll_poll_dev(np->real_dev);
-}
-
 void br_netpoll_cleanup(struct net_device *dev)
 {
        struct net_bridge *br = netdev_priv(dev);
@@ -295,7 +287,6 @@ static const struct net_device_ops br_netdev_ops = {
        .ndo_do_ioctl            = br_dev_ioctl,
 #ifdef CONFIG_NET_POLL_CONTROLLER
        .ndo_netpoll_cleanup     = br_netpoll_cleanup,
-       .ndo_poll_controller     = br_poll_controller,
 #endif
 };
 
index a4e72a89e4ffc4eae7a2e7e09963bd0fb58e26a4..595da45f908854d0c9eef2e54ba94280de5afcfb 100644 (file)
@@ -50,14 +50,7 @@ int br_dev_queue_push_xmit(struct sk_buff *skb)
                        kfree_skb(skb);
                else {
                        skb_push(skb, ETH_HLEN);
-
-#ifdef CONFIG_NET_POLL_CONTROLLER
-                       if (unlikely(skb->dev->priv_flags & IFF_IN_NETPOLL)) {
-                               netpoll_send_skb(skb->dev->npinfo->netpoll, skb);
-                               skb->dev->priv_flags &= ~IFF_IN_NETPOLL;
-                       } else
-#endif
-                               dev_queue_xmit(skb);
+                       dev_queue_xmit(skb);
                }
        }
 
@@ -73,23 +66,9 @@ int br_forward_finish(struct sk_buff *skb)
 
 static void __br_deliver(const struct net_bridge_port *to, struct sk_buff *skb)
 {
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       struct net_bridge *br = to->br;
-       if (unlikely(br->dev->priv_flags & IFF_IN_NETPOLL)) {
-               struct netpoll *np;
-               to->dev->npinfo = skb->dev->npinfo;
-               np = skb->dev->npinfo->netpoll;
-               np->real_dev = np->dev = to->dev;
-               to->dev->priv_flags |= IFF_IN_NETPOLL;
-       }
-#endif
        skb->dev = to->dev;
        NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
                br_forward_finish);
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       if (skb->dev->npinfo)
-               skb->dev->npinfo->netpoll->dev = br->dev;
-#endif
 }
 
 static void __br_forward(const struct net_bridge_port *to, struct sk_buff *skb)
index 723a34710ad401ff24afd5b1be1af86505f7da33..1f466e82ac339359ffa0587f0e1e1f324c0f5dd7 100644 (file)
@@ -1488,6 +1488,7 @@ static inline void net_timestamp_check(struct sk_buff *skb)
 int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
 {
        skb_orphan(skb);
+       nf_reset(skb);
 
        if (!(dev->flags & IFF_UP) ||
            (skb->len > (dev->mtu + dev->hard_header_len))) {
@@ -1911,8 +1912,16 @@ static int dev_gso_segment(struct sk_buff *skb)
  */
 static inline void skb_orphan_try(struct sk_buff *skb)
 {
-       if (!skb_tx(skb)->flags)
+       struct sock *sk = skb->sk;
+
+       if (sk && !skb_tx(skb)->flags) {
+               /* skb_tx_hash() wont be able to get sk.
+                * We copy sk_hash into skb->rxhash
+                */
+               if (!skb->rxhash)
+                       skb->rxhash = sk->sk_hash;
                skb_orphan(skb);
+       }
 }
 
 int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
@@ -1998,8 +2007,7 @@ u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb)
        if (skb->sk && skb->sk->sk_hash)
                hash = skb->sk->sk_hash;
        else
-               hash = (__force u16) skb->protocol;
-
+               hash = (__force u16) skb->protocol ^ skb->rxhash;
        hash = jhash_1word(hash, hashrnd);
 
        return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32);
@@ -2022,12 +2030,11 @@ static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index)
 static struct netdev_queue *dev_pick_tx(struct net_device *dev,
                                        struct sk_buff *skb)
 {
-       u16 queue_index;
+       int queue_index;
        struct sock *sk = skb->sk;
 
-       if (sk_tx_queue_recorded(sk)) {
-               queue_index = sk_tx_queue_get(sk);
-       } else {
+       queue_index = sk_tx_queue_get(sk);
+       if (queue_index < 0) {
                const struct net_device_ops *ops = dev->netdev_ops;
 
                if (ops->ndo_select_queue) {
index 6ba1c0eece039f99f19c0451bf5a52b3b9090a71..a4e0a7482c2bc878bdd6e0986ac45e0dc6659b3d 100644 (file)
@@ -949,7 +949,10 @@ static void neigh_update_hhs(struct neighbour *neigh)
 {
        struct hh_cache *hh;
        void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *)
-               = neigh->dev->header_ops->cache_update;
+               = NULL;
+
+       if (neigh->dev->header_ops)
+               update = neigh->dev->header_ops->cache_update;
 
        if (update) {
                for (hh = neigh->hh; hh; hh = hh->hh_next) {
index 34432b4e96bb288931e8b6ebf2d8d78b5c6589c5..ce88293a34e263000dd93c0df5690885a857d797 100644 (file)
@@ -843,7 +843,9 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
        skb->network_header   += off;
        if (skb_mac_header_was_set(skb))
                skb->mac_header += off;
-       skb->csum_start       += nhead;
+       /* Only adjust this if it actually is csum_start rather than csum */
+       if (skb->ip_summed == CHECKSUM_PARTIAL)
+               skb->csum_start += nhead;
        skb->cloned   = 0;
        skb->hdr_len  = 0;
        skb->nohdr    = 0;
@@ -930,7 +932,8 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
        copy_skb_header(n, skb);
 
        off                  = newheadroom - oldheadroom;
-       n->csum_start       += off;
+       if (n->ip_summed == CHECKSUM_PARTIAL)
+               n->csum_start += off;
 #ifdef NET_SKBUFF_DATA_USES_OFFSET
        n->transport_header += off;
        n->network_header   += off;
index c51b55400dc56818a2f4e0cca68cb74be38048a3..11201784d29a32d6fdddd972a8348d3202de0ec9 100644 (file)
@@ -1,7 +1,7 @@
 menuconfig NET_DSA
        bool "Distributed Switch Architecture support"
        default n
-       depends on EXPERIMENTAL && !S390
+       depends on EXPERIMENTAL && NET_ETHERNET && !S390
        select PHYLIB
        ---help---
          This allows you to use hardware switch chips that use
index 757f25eb9b4b2404ebebc6c4422b4ad1693ea227..7f6273506eea46522a17ff85b9a451cb18fdc7d3 100644 (file)
@@ -442,8 +442,10 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb, struct net_device *dev)
        int err;
 
        err = ipmr_fib_lookup(net, &fl, &mrt);
-       if (err < 0)
+       if (err < 0) {
+               kfree_skb(skb);
                return err;
+       }
 
        read_lock(&mrt_lock);
        dev->stats.tx_bytes += skb->len;
@@ -1728,8 +1730,10 @@ int ip_mr_input(struct sk_buff *skb)
                goto dont_forward;
 
        err = ipmr_fib_lookup(net, &skb_rtable(skb)->fl, &mrt);
-       if (err < 0)
+       if (err < 0) {
+               kfree_skb(skb);
                return err;
+       }
 
        if (!local) {
                    if (IPCB(skb)->opt.router_alert) {
index 6596b4feeddc7879fc020606f53dabdc8608f3e8..65afeaec15b7ebb85610650353e881aacb3e90aa 100644 (file)
@@ -608,6 +608,7 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
        ssize_t spliced;
        int ret;
 
+       sock_rps_record_flow(sk);
        /*
         * We can't seek on a socket input
         */
index b4ed957f201a6f3f2ebf8d5564edec567b6435a6..7ed9dc1042d1930a7eb2107def30642cb367fa92 100644 (file)
@@ -2208,6 +2208,9 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
        int mib_idx;
        int fwd_rexmitting = 0;
 
+       if (!tp->packets_out)
+               return;
+
        if (!tp->lost_out)
                tp->retransmit_high = tp->snd_una;
 
index e1a698df5706a9bcff5889e4b734ad66d6dbfb55..784f34d11fdd2f5672949a8f31b302377e6e6fc7 100644 (file)
@@ -1760,7 +1760,10 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
 
        idev = ipv6_find_idev(dev);
        if (!idev)
-               return NULL;
+               return ERR_PTR(-ENOBUFS);
+
+       if (idev->cnf.disable_ipv6)
+               return ERR_PTR(-EACCES);
 
        /* Add default multicast route */
        addrconf_add_mroute(dev);
@@ -2129,8 +2132,9 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx,
        if (!dev)
                return -ENODEV;
 
-       if ((idev = addrconf_add_dev(dev)) == NULL)
-               return -ENOBUFS;
+       idev = addrconf_add_dev(dev);
+       if (IS_ERR(idev))
+               return PTR_ERR(idev);
 
        scope = ipv6_addr_scope(pfx);
 
@@ -2377,7 +2381,7 @@ static void addrconf_dev_config(struct net_device *dev)
        }
 
        idev = addrconf_add_dev(dev);
-       if (idev == NULL)
+       if (IS_ERR(idev))
                return;
 
        memset(&addr, 0, sizeof(struct in6_addr));
@@ -2468,7 +2472,7 @@ static void addrconf_ip6_tnl_config(struct net_device *dev)
        ASSERT_RTNL();
 
        idev = addrconf_add_dev(dev);
-       if (!idev) {
+       if (IS_ERR(idev)) {
                printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n");
                return;
        }
index 2794b6002836f446c4c6fb9835316d9ee61bba51..d6e9599d0705a5b79749a0566cbd97dfaa9993c0 100644 (file)
@@ -347,11 +347,12 @@ static const struct xfrm_type mip6_destopt_type =
 
 static int mip6_rthdr_input(struct xfrm_state *x, struct sk_buff *skb)
 {
+       struct ipv6hdr *iph = ipv6_hdr(skb);
        struct rt2_hdr *rt2 = (struct rt2_hdr *)skb->data;
        int err = rt2->rt_hdr.nexthdr;
 
        spin_lock(&x->lock);
-       if (!ipv6_addr_equal(&rt2->addr, (struct in6_addr *)x->coaddr) &&
+       if (!ipv6_addr_equal(&iph->daddr, (struct in6_addr *)x->coaddr) &&
            !ipv6_addr_any((struct in6_addr *)x->coaddr))
                err = -ENOENT;
        spin_unlock(&x->lock);
index c7000a6ca379a2e206be38292dd550a39b396a17..67ee34f57df7b02cb06e5d0d4e44944cc95feca7 100644 (file)
@@ -632,7 +632,7 @@ static void ieee80211_send_layer2_update(struct sta_info *sta)
        skb->dev = sta->sdata->dev;
        skb->protocol = eth_type_trans(skb, sta->sdata->dev);
        memset(skb->cb, 0, sizeof(skb->cb));
-       netif_rx(skb);
+       netif_rx_ni(skb);
 }
 
 static void sta_apply_parameters(struct ieee80211_local *local,
index 94d72e85a475ae094d14f8df5f4f54a936f0db15..b2a3ae6cad78e28324e23b857dc0a5773f569786 100644 (file)
@@ -698,6 +698,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp)
                newsk = NULL;
                goto out;
        }
+       kfree_skb(oskb);
 
        sock_hold(sk);
        pep_sk(newsk)->listener = sk;
index c0b6863e3b87dbe91679638b83a169f099ab887f..1980b71c283ffbe9e50ac4f6326f91d41a40a6cb 100644 (file)
@@ -33,6 +33,7 @@
 static struct tcf_common *tcf_mirred_ht[MIRRED_TAB_MASK + 1];
 static u32 mirred_idx_gen;
 static DEFINE_RWLOCK(mirred_lock);
+static LIST_HEAD(mirred_list);
 
 static struct tcf_hashinfo mirred_hash_info = {
        .htab   =       tcf_mirred_ht,
@@ -47,7 +48,9 @@ static inline int tcf_mirred_release(struct tcf_mirred *m, int bind)
                        m->tcf_bindcnt--;
                m->tcf_refcnt--;
                if(!m->tcf_bindcnt && m->tcf_refcnt <= 0) {
-                       dev_put(m->tcfm_dev);
+                       list_del(&m->tcfm_list);
+                       if (m->tcfm_dev)
+                               dev_put(m->tcfm_dev);
                        tcf_hash_destroy(&m->common, &mirred_hash_info);
                        return 1;
                }
@@ -134,8 +137,10 @@ static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est,
                m->tcfm_ok_push = ok_push;
        }
        spin_unlock_bh(&m->tcf_lock);
-       if (ret == ACT_P_CREATED)
+       if (ret == ACT_P_CREATED) {
+               list_add(&m->tcfm_list, &mirred_list);
                tcf_hash_insert(pc, &mirred_hash_info);
+       }
 
        return ret;
 }
@@ -162,9 +167,14 @@ static int tcf_mirred(struct sk_buff *skb, struct tc_action *a,
        m->tcf_tm.lastuse = jiffies;
 
        dev = m->tcfm_dev;
+       if (!dev) {
+               printk_once(KERN_NOTICE "tc mirred: target device is gone\n");
+               goto out;
+       }
+
        if (!(dev->flags & IFF_UP)) {
                if (net_ratelimit())
-                       pr_notice("tc mirred to Houston: device %s is gone!\n",
+                       pr_notice("tc mirred to Houston: device %s is down\n",
                                  dev->name);
                goto out;
        }
@@ -232,6 +242,28 @@ nla_put_failure:
        return -1;
 }
 
+static int mirred_device_event(struct notifier_block *unused,
+                              unsigned long event, void *ptr)
+{
+       struct net_device *dev = ptr;
+       struct tcf_mirred *m;
+
+       if (event == NETDEV_UNREGISTER)
+               list_for_each_entry(m, &mirred_list, tcfm_list) {
+                       if (m->tcfm_dev == dev) {
+                               dev_put(dev);
+                               m->tcfm_dev = NULL;
+                       }
+               }
+
+       return NOTIFY_DONE;
+}
+
+static struct notifier_block mirred_device_notifier = {
+       .notifier_call = mirred_device_event,
+};
+
+
 static struct tc_action_ops act_mirred_ops = {
        .kind           =       "mirred",
        .hinfo          =       &mirred_hash_info,
@@ -252,12 +284,17 @@ MODULE_LICENSE("GPL");
 
 static int __init mirred_init_module(void)
 {
+       int err = register_netdevice_notifier(&mirred_device_notifier);
+       if (err)
+               return err;
+
        pr_info("Mirror/redirect action on\n");
        return tcf_register_action(&act_mirred_ops);
 }
 
 static void __exit mirred_cleanup_module(void)
 {
+       unregister_netdevice_notifier(&mirred_device_notifier);
        tcf_unregister_action(&act_mirred_ops);
 }
 
index 570949417f388735e93bf887294326a8f24aa534..724553e8ed7bc9d8ecd668c71ab9373936a3d2d3 100644 (file)
@@ -205,7 +205,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a,
        {
                struct icmphdr *icmph;
 
-               if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph)))
+               if (!pskb_may_pull(skb, ihl + sizeof(*icmph)))
                        goto drop;
 
                icmph = (void *)(skb_network_header(skb) + ihl);
@@ -215,6 +215,9 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a,
                    (icmph->type != ICMP_PARAMETERPROB))
                        break;
 
+               if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph)))
+                       goto drop;
+
                iph = (void *)(icmph + 1);
                if (egress)
                        addr = iph->daddr;
index 73affb8624faa06ee95c6ce5bf5e7ea364908d02..8dc47f1d00019c4f4a91f252f70b5771d19a5956 100644 (file)
@@ -267,7 +267,7 @@ rpcauth_prune_expired(struct list_head *free, int nr_to_scan)
  * Run memory cache shrinker.
  */
 static int
-rpcauth_cache_shrinker(int nr_to_scan, gfp_t gfp_mask)
+rpcauth_cache_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask)
 {
        LIST_HEAD(free);
        int res;
index af1c173be4ad88906d55d7efa24fb47fcd0cf19d..a7ec5a8a2380e6277fa4a3755e01fb0aa58076fb 100644 (file)
@@ -1594,8 +1594,8 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols,
 
        /* Try to instantiate a bundle */
        err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family);
-       if (err < 0) {
-               if (err != -EAGAIN)
+       if (err <= 0) {
+               if (err != 0 && err != -EAGAIN)
                        XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTPOLERROR);
                return ERR_PTR(err);
        }
@@ -1678,6 +1678,13 @@ xfrm_bundle_lookup(struct net *net, struct flowi *fl, u16 family, u8 dir,
                        goto make_dummy_bundle;
                dst_hold(&xdst->u.dst);
                return oldflo;
+       } else if (new_xdst == NULL) {
+               num_xfrms = 0;
+               if (oldflo == NULL)
+                       goto make_dummy_bundle;
+               xdst->num_xfrms = 0;
+               dst_hold(&xdst->u.dst);
+               return oldflo;
        }
 
        /* Kill the previous bundle */
@@ -1760,6 +1767,10 @@ restart:
                                xfrm_pols_put(pols, num_pols);
                                err = PTR_ERR(xdst);
                                goto dropdst;
+                       } else if (xdst == NULL) {
+                               num_xfrms = 0;
+                               drop_pols = num_pols;
+                               goto no_transform;
                        }
 
                        spin_lock_bh(&xfrm_policy_sk_bundle_lock);
index 115edb437fb1eafaf30101e747b2a97a2e23a5b2..a9d9344e136504781c52b0e59361fea6b10be06b 100644 (file)
@@ -226,7 +226,7 @@ void fill_window(WINDOW *win, const char *text)
                int len = get_line_length(line);
                strncpy(tmp, line, min(len, x));
                tmp[len] = '\0';
-               mvwprintw(win, i, 0, tmp);
+               mvwprintw(win, i, 0, "%s", tmp);
        }
 }
 
index 3a681ef25306ba0a98cfaedf7412c24c9af11adb..d2c29b63addaa04dbd3df94d1adbfa9bc3ff8518 100644 (file)
@@ -44,7 +44,7 @@ rpm-pkg rpm: $(objtree)/kernel.spec FORCE
        fi
        $(MAKE) clean
        $(PREV) ln -sf $(srctree) $(KERNELPATH)
-       $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --scm-only > $(objtree)/.scmversion
+       $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion
        $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/.
        $(PREV) rm $(KERNELPATH)
        rm -f $(objtree)/.scmversion
index d6a866ed1835c8f1ee4524c6bb26df554c83c6e1..64a9cb5556cd0f90dab503c6b8cd96e2fa7bff1d 100755 (executable)
 #
 
 usage() {
-       echo "Usage: $0 [--scm-only] [srctree]" >&2
+       echo "Usage: $0 [--save-scmversion] [srctree]" >&2
        exit 1
 }
 
 scm_only=false
 srctree=.
-if test "$1" = "--scm-only"; then
+if test "$1" = "--save-scmversion"; then
        scm_only=true
        shift
 fi
@@ -30,11 +30,12 @@ fi
 
 scm_version()
 {
-       local short=false
+       local short
+       short=false
 
        cd "$srctree"
        if test -e .scmversion; then
-               cat "$_"
+               cat .scmversion
                return
        fi
        if test "$1" = "--short"; then
@@ -131,12 +132,15 @@ collect_files()
 }
 
 if $scm_only; then
-       scm_version
+       if test ! -e .scmversion; then
+               res=$(scm_version)
+               echo "$res" >.scmversion
+       fi
        exit
 fi
 
 if test -e include/config/auto.conf; then
-       source "$_"
+       . include/config/auto.conf
 else
        echo "Error: kernelrelease not valid - run 'make prepare' to update it"
        exit 1
index 495be6e7193169fcdf22400a682915d4966c3cc9..24454c98d0ee9f62faa5fd56b37bd64e04d598fd 100644 (file)
@@ -300,7 +300,7 @@ struct snd_soc_dai au1xpsc_i2s_dai = {
 };
 EXPORT_SYMBOL(au1xpsc_i2s_dai);
 
-static int __init au1xpsc_i2s_drvprobe(struct platform_device *pdev)
+static int __devinit au1xpsc_i2s_drvprobe(struct platform_device *pdev)
 {
        struct resource *r;
        unsigned long sel;
index 31ac5538fe7ef1261192d1bd345ac103023481b0..5da30eb6ad008021619ca57924462fadeaa1e800 100644 (file)
@@ -83,8 +83,8 @@ config SND_SOC_ALL_CODECS
 
 config SND_SOC_WM_HUBS
        tristate
-       default y if SND_SOC_WM8993=y
-       default m if SND_SOC_WM8993=m
+       default y if SND_SOC_WM8993=y || SND_SOC_WM8994=y
+       default m if SND_SOC_WM8993=m || SND_SOC_WM8994=m
 
 config SND_SOC_AC97_CODEC
        tristate
index 1072621e93fdee9de08476cfcd915fed2c792999..9d1df26281361ef9ed569e0b87a39d9a934f9254 100644 (file)
@@ -127,6 +127,8 @@ static __devinit int wm8727_platform_probe(struct platform_device *pdev)
                goto err_codec;
        }
 
+       return 0;
+
 err_codec:
        snd_soc_unregister_codec(codec);
 err:
index 7e4a627b4c7ee6bc5260e041f052b9e7b11edae2..4e212ed62ea609be9e1b3d45a5ac3fb6efea1a38 100644 (file)
@@ -94,7 +94,6 @@ SOC_DAPM_SINGLE("Bypass Switch", WM8776_OUTMUX, 2, 1, 0),
 
 static const struct snd_soc_dapm_widget wm8776_dapm_widgets[] = {
 SND_SOC_DAPM_INPUT("AUX"),
-SND_SOC_DAPM_INPUT("AUX"),
 
 SND_SOC_DAPM_INPUT("AIN1"),
 SND_SOC_DAPM_INPUT("AIN2"),
index 0417dae32e6f0e9de4d3b9f580519254a4e04404..19ad590ca0b390065850ce4ab8b0e4e2fd5d841a 100644 (file)
@@ -885,7 +885,6 @@ static int wm8988_register(struct wm8988_priv *wm8988,
        ret = snd_soc_register_dai(&wm8988_dai);
        if (ret != 0) {
                dev_err(codec->dev, "Failed to register DAI: %d\n", ret);
-               snd_soc_unregister_codec(codec);
                goto err_codec;
        }
 
index 3396a0db06ba08d795b942eed61ba42d81697e62..ec4acac49ebd527e0a1db89336e528566abf948c 100644 (file)
@@ -683,20 +683,15 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream,
 
        /* clock inversion (CKG2) */
        data = 0;
-       switch (SH_FSI_INVERSION_MASK & flags) {
-       case SH_FSI_LRM_INV:
-               data = 1 << 12;
-               break;
-       case SH_FSI_BRM_INV:
-               data = 1 << 8;
-               break;
-       case SH_FSI_LRS_INV:
-               data = 1 << 4;
-               break;
-       case SH_FSI_BRS_INV:
-               data = 1 << 0;
-               break;
-       }
+       if (SH_FSI_LRM_INV & flags)
+               data |= 1 << 12;
+       if (SH_FSI_BRM_INV & flags)
+               data |= 1 << 8;
+       if (SH_FSI_LRS_INV & flags)
+               data |= 1 << 4;
+       if (SH_FSI_BRS_INV & flags)
+               data |= 1 << 0;
+
        fsi_reg_write(fsi, CKG2, data);
 
        /* do fmt, di fmt */
@@ -726,15 +721,15 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream,
                break;
        case SH_FSI_FMT_TDM:
                msg = "TDM";
-               data = CR_FMT(CR_TDM) | (fsi->chan - 1);
                fsi->chan = is_play ?
                        SH_FSI_GET_CH_O(flags) : SH_FSI_GET_CH_I(flags);
+               data = CR_FMT(CR_TDM) | (fsi->chan - 1);
                break;
        case SH_FSI_FMT_TDM_DELAY:
                msg = "TDM Delay";
-               data = CR_FMT(CR_TDM_D) | (fsi->chan - 1);
                fsi->chan = is_play ?
                        SH_FSI_GET_CH_O(flags) : SH_FSI_GET_CH_I(flags);
+               data = CR_FMT(CR_TDM_D) | (fsi->chan - 1);
                break;
        default:
                dev_err(dai->dev, "unknown format.\n");
index 3d8f31ed771df18770b1e31361485d39400b5476..d75c28a825f5356d9b0dbe16459111d3b6c5e81a 100644 (file)
@@ -600,30 +600,32 @@ endif
 
 ifdef NO_DEMANGLE
        BASIC_CFLAGS += -DNO_DEMANGLE
-else ifdef HAVE_CPLUS_DEMANGLE
-       EXTLIBS += -liberty
-       BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
 else
-       has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y")
-
-       ifeq ($(has_bfd),y)
-               EXTLIBS += -lbfd
+       ifdef HAVE_CPLUS_DEMANGLE
+               EXTLIBS += -liberty
+               BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
        else
-               has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y")
-               ifeq ($(has_bfd_iberty),y)
-                       EXTLIBS += -lbfd -liberty
+               has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y")
+
+               ifeq ($(has_bfd),y)
+                       EXTLIBS += -lbfd
                else
-                       has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y")
-                       ifeq ($(has_bfd_iberty_z),y)
-                               EXTLIBS += -lbfd -liberty -lz
+                       has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y")
+                       ifeq ($(has_bfd_iberty),y)
+                               EXTLIBS += -lbfd -liberty
                        else
-                               has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y")
-                               ifeq ($(has_cplus_demangle),y)
-                                       EXTLIBS += -liberty
-                                       BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
+                               has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y")
+                               ifeq ($(has_bfd_iberty_z),y)
+                                       EXTLIBS += -lbfd -liberty -lz
                                else
-                                       msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
-                                       BASIC_CFLAGS += -DNO_DEMANGLE
+                                       has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y")
+                                       ifeq ($(has_cplus_demangle),y)
+                                               EXTLIBS += -liberty
+                                               BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
+                                       else
+                                               msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
+                                               BASIC_CFLAGS += -DNO_DEMANGLE
+                                       endif
                                endif
                        endif
                endif
diff --git a/tools/perf/arch/sparc/Makefile b/tools/perf/arch/sparc/Makefile
new file mode 100644 (file)
index 0000000..15130b5
--- /dev/null
@@ -0,0 +1,4 @@
+ifndef NO_DWARF
+PERF_HAVE_DWARF_REGS := 1
+LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
+endif
diff --git a/tools/perf/arch/sparc/util/dwarf-regs.c b/tools/perf/arch/sparc/util/dwarf-regs.c
new file mode 100644 (file)
index 0000000..0ab8848
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Mapping of DWARF debug register numbers into register names.
+ *
+ * Copyright (C) 2010 David S. Miller <davem@davemloft.net>
+ *
+ * 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 <libio.h>
+#include <dwarf-regs.h>
+
+#define SPARC_MAX_REGS 96
+
+const char *sparc_regs_table[SPARC_MAX_REGS] = {
+       "%g0", "%g1", "%g2", "%g3", "%g4", "%g5", "%g6", "%g7",
+       "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%sp", "%o7",
+       "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7",
+       "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%fp", "%i7",
+       "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7",
+       "%f8", "%f9", "%f10", "%f11", "%f12", "%f13", "%f14", "%f15",
+       "%f16", "%f17", "%f18", "%f19", "%f20", "%f21", "%f22", "%f23",
+       "%f24", "%f25", "%f26", "%f27", "%f28", "%f29", "%f30", "%f31",
+       "%f32", "%f33", "%f34", "%f35", "%f36", "%f37", "%f38", "%f39",
+       "%f40", "%f41", "%f42", "%f43", "%f44", "%f45", "%f46", "%f47",
+       "%f48", "%f49", "%f50", "%f51", "%f52", "%f53", "%f54", "%f55",
+       "%f56", "%f57", "%f58", "%f59", "%f60", "%f61", "%f62", "%f63",
+};
+
+/**
+ * get_arch_regstr() - lookup register name from it's DWARF register number
+ * @n: the DWARF register number
+ *
+ * get_arch_regstr() returns the name of the register in struct
+ * regdwarfnum_table from it's DWARF register number. If the register is not
+ * found in the table, this returns NULL;
+ */
+const char *get_arch_regstr(unsigned int n)
+{
+       return (n <= SPARC_MAX_REGS) ? sparc_regs_table[n] : NULL;
+}
index 3592057829648a8d3f8ac909f93a10a729640b68..fd7407c7205c7be809ce4c3b048e68ab9b7b9487 100644 (file)
@@ -107,7 +107,7 @@ static int perf_session__add_hist_entry(struct perf_session *self,
                goto out_free_syms;
        err = 0;
        if (symbol_conf.use_callchain) {
-               err = append_chain(he->callchain, data->callchain, syms);
+               err = append_chain(he->callchain, data->callchain, syms, data->period);
                if (err)
                        goto out_free_syms;
        }
index 49ece7921914a3fdc20ea02d56af193ab61a73f9..97d76562a1a093c8a4bfc6f4bca652fa410779e4 100755 (executable)
@@ -5,17 +5,13 @@ if [ $# -eq 1 ]  ; then
 fi
 
 GVF=${OUTPUT}PERF-VERSION-FILE
-DEF_VER=v0.0.2.PERF
 
 LF='
 '
 
-# First see if there is a version file (included in release tarballs),
-# then try git-describe, then default.
-if test -f version
-then
-       VN=$(cat version) || VN="$DEF_VER"
-elif test -d .git -o -f .git &&
+# First check if there is a .git to get the version from git describe
+# otherwise try to get the version from the kernel makefile
+if test -d ../../.git -o -f ../../.git &&
        VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
        case "$VN" in
        *$LF*) (exit 1) ;;
@@ -27,7 +23,12 @@ elif test -d .git -o -f .git &&
 then
        VN=$(echo "$VN" | sed -e 's/-/./g');
 else
-       VN="$DEF_VER"
+       eval `grep '^VERSION\s*=' ../../Makefile|tr -d ' '`
+       eval `grep '^PATCHLEVEL\s*=' ../../Makefile|tr -d ' '`
+       eval `grep '^SUBLEVEL\s*=' ../../Makefile|tr -d ' '`
+       eval `grep '^EXTRAVERSION\s*=' ../../Makefile|tr -d ' '`
+
+       VN="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}"
 fi
 
 VN=$(expr "$VN" : v*'\(.*\)')
index 62b69ad4aa735bc0ec146277661e30f9c0e3d4e9..52c777e451ed8ebc049f39edfb651bfe848d66cc 100644 (file)
@@ -230,7 +230,7 @@ fill_node(struct callchain_node *node, struct resolved_chain *chain, int start)
 
 static void
 add_child(struct callchain_node *parent, struct resolved_chain *chain,
-         int start)
+         int start, u64 period)
 {
        struct callchain_node *new;
 
@@ -238,7 +238,7 @@ add_child(struct callchain_node *parent, struct resolved_chain *chain,
        fill_node(new, chain, start);
 
        new->children_hit = 0;
-       new->hit = 1;
+       new->hit = period;
 }
 
 /*
@@ -248,7 +248,8 @@ add_child(struct callchain_node *parent, struct resolved_chain *chain,
  */
 static void
 split_add_child(struct callchain_node *parent, struct resolved_chain *chain,
-               struct callchain_list *to_split, int idx_parents, int idx_local)
+               struct callchain_list *to_split, int idx_parents, int idx_local,
+               u64 period)
 {
        struct callchain_node *new;
        struct list_head *old_tail;
@@ -275,41 +276,41 @@ split_add_child(struct callchain_node *parent, struct resolved_chain *chain,
        /* create a new child for the new branch if any */
        if (idx_total < chain->nr) {
                parent->hit = 0;
-               add_child(parent, chain, idx_total);
-               parent->children_hit++;
+               add_child(parent, chain, idx_total, period);
+               parent->children_hit += period;
        } else {
-               parent->hit = 1;
+               parent->hit = period;
        }
 }
 
 static int
 __append_chain(struct callchain_node *root, struct resolved_chain *chain,
-              unsigned int start);
+              unsigned int start, u64 period);
 
 static void
 __append_chain_children(struct callchain_node *root,
                        struct resolved_chain *chain,
-                       unsigned int start)
+                       unsigned int start, u64 period)
 {
        struct callchain_node *rnode;
 
        /* lookup in childrens */
        chain_for_each_child(rnode, root) {
-               unsigned int ret = __append_chain(rnode, chain, start);
+               unsigned int ret = __append_chain(rnode, chain, start, period);
 
                if (!ret)
                        goto inc_children_hit;
        }
        /* nothing in children, add to the current node */
-       add_child(root, chain, start);
+       add_child(root, chain, start, period);
 
 inc_children_hit:
-       root->children_hit++;
+       root->children_hit += period;
 }
 
 static int
 __append_chain(struct callchain_node *root, struct resolved_chain *chain,
-              unsigned int start)
+              unsigned int start, u64 period)
 {
        struct callchain_list *cnode;
        unsigned int i = start;
@@ -345,18 +346,18 @@ __append_chain(struct callchain_node *root, struct resolved_chain *chain,
 
        /* we match only a part of the node. Split it and add the new chain */
        if (i - start < root->val_nr) {
-               split_add_child(root, chain, cnode, start, i - start);
+               split_add_child(root, chain, cnode, start, i - start, period);
                return 0;
        }
 
        /* we match 100% of the path, increment the hit */
        if (i - start == root->val_nr && i == chain->nr) {
-               root->hit++;
+               root->hit += period;
                return 0;
        }
 
        /* We match the node and still have a part remaining */
-       __append_chain_children(root, chain, i);
+       __append_chain_children(root, chain, i, period);
 
        return 0;
 }
@@ -380,7 +381,7 @@ static void filter_context(struct ip_callchain *old, struct resolved_chain *new,
 
 
 int append_chain(struct callchain_node *root, struct ip_callchain *chain,
-                struct map_symbol *syms)
+                struct map_symbol *syms, u64 period)
 {
        struct resolved_chain *filtered;
 
@@ -397,7 +398,7 @@ int append_chain(struct callchain_node *root, struct ip_callchain *chain,
        if (!filtered->nr)
                goto end;
 
-       __append_chain_children(root, filtered, 0);
+       __append_chain_children(root, filtered, 0, period);
 end:
        free(filtered);
 
index 1ca73e4a2723997099973963f8477bdbbafcc909..f2e9ee164bd8ce7bcf2bb7c7af5901e6c78ebcc3 100644 (file)
@@ -49,6 +49,9 @@ static inline void callchain_init(struct callchain_node *node)
        INIT_LIST_HEAD(&node->brothers);
        INIT_LIST_HEAD(&node->children);
        INIT_LIST_HEAD(&node->val);
+
+       node->parent = NULL;
+       node->hit = 0;
 }
 
 static inline u64 cumul_hits(struct callchain_node *node)
@@ -58,7 +61,7 @@ static inline u64 cumul_hits(struct callchain_node *node)
 
 int register_callchain_param(struct callchain_param *param);
 int append_chain(struct callchain_node *root, struct ip_callchain *chain,
-                struct map_symbol *syms);
+                struct map_symbol *syms, u64 period);
 
 bool ip_callchain__valid(struct ip_callchain *chain, event_t *event);
 #endif /* __PERF_CALLCHAIN_H */
index 07f89b66b318e43748f666f495f87b75f6a34462..784ee0bdda7754f329428e40fa790a22dd331568 100644 (file)
@@ -631,9 +631,14 @@ int hist_entry__fprintf(struct hist_entry *self, struct hists *pair_hists,
                        u64 session_total)
 {
        char bf[512];
-       hist_entry__snprintf(self, bf, sizeof(bf), pair_hists,
-                            show_displacement, displacement,
-                            true, session_total);
+       int ret;
+
+       ret = hist_entry__snprintf(self, bf, sizeof(bf), pair_hists,
+                                  show_displacement, displacement,
+                                  true, session_total);
+       if (!ret)
+               return 0;
+
        return fprintf(fp, "%s\n", bf);
 }
 
@@ -762,6 +767,7 @@ size_t hists__fprintf(struct hists *self, struct hists *pair,
 print_entries:
        for (nd = rb_first(&self->entries); nd; nd = rb_next(nd)) {
                struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node);
+               int cnt;
 
                if (show_displacement) {
                        if (h->pair != NULL)
@@ -771,8 +777,13 @@ print_entries:
                                displacement = 0;
                        ++position;
                }
-               ret += hist_entry__fprintf(h, pair, show_displacement,
-                                          displacement, fp, self->stats.total_period);
+               cnt = hist_entry__fprintf(h, pair, show_displacement,
+                                         displacement, fp, self->stats.total_period);
+               /* Ignore those that didn't match the parent filter */
+               if (!cnt)
+                       continue;
+
+               ret += cnt;
 
                if (symbol_conf.use_callchain)
                        ret += hist_entry__fprintf_callchain(h, fp, self->stats.total_period);
@@ -965,13 +976,17 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file,
                 * Parse hexa addresses followed by ':'
                 */
                line_ip = strtoull(tmp, &tmp2, 16);
-               if (*tmp2 != ':' || tmp == tmp2)
+               if (*tmp2 != ':' || tmp == tmp2 || tmp2[1] == '\0')
                        line_ip = -1;
        }
 
        if (line_ip != -1) {
-               u64 start = map__rip_2objdump(self->ms.map, sym->start);
+               u64 start = map__rip_2objdump(self->ms.map, sym->start),
+                   end = map__rip_2objdump(self->ms.map, sym->end);
+
                offset = line_ip - start;
+               if (offset < 0 || (u64)line_ip > end)
+                       offset = -1;
        }
 
        objdump_line = objdump_line__new(offset, line);
index b63e5713849f3abfa25bf8160e8b458e7adf913e..5b276833e2bfea3bae9115f2555b32e3a3b8b628 100644 (file)
@@ -1443,6 +1443,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *self,
 {
        struct dirent *dent;
        DIR *dir = opendir(dir_name);
+       int ret = 0;
 
        if (!dir) {
                pr_debug("%s: cannot open %s dir\n", __func__, dir_name);
@@ -1465,8 +1466,9 @@ static int map_groups__set_modules_path_dir(struct map_groups *self,
 
                        snprintf(path, sizeof(path), "%s/%s",
                                 dir_name, dent->d_name);
-                       if (map_groups__set_modules_path_dir(self, path) < 0)
-                               goto failure;
+                       ret = map_groups__set_modules_path_dir(self, path);
+                       if (ret < 0)
+                               goto out;
                } else {
                        char *dot = strrchr(dent->d_name, '.'),
                             dso_name[PATH_MAX];
@@ -1487,17 +1489,18 @@ static int map_groups__set_modules_path_dir(struct map_groups *self,
                                 dir_name, dent->d_name);
 
                        long_name = strdup(path);
-                       if (long_name == NULL)
-                               goto failure;
+                       if (long_name == NULL) {
+                               ret = -1;
+                               goto out;
+                       }
                        dso__set_long_name(map->dso, long_name);
                        dso__kernel_module_get_build_id(map->dso, "");
                }
        }
 
-       return 0;
-failure:
+out:
        closedir(dir);
-       return -1;
+       return ret;
 }
 
 static char *get_kernel_version(const char *root_dir)