aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/Kconfig70
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/boot/compressed/Makefile4
-rw-r--r--arch/arm/boot/compressed/head-l7200.S29
-rw-r--r--arch/arm/common/gic.c46
-rw-r--r--arch/arm/common/sa1111.c5
-rw-r--r--arch/arm/configs/lusl7200_defconfig23
-rw-r--r--arch/arm/include/asm/hwcap.h1
-rw-r--r--arch/arm/include/asm/irq.h2
-rw-r--r--arch/arm/include/asm/kexec.h22
-rw-r--r--arch/arm/include/asm/mach/arch.h2
-rw-r--r--arch/arm/include/asm/mach/irq.h1
-rw-r--r--arch/arm/include/asm/memblock.h16
-rw-r--r--arch/arm/include/asm/memory.h67
-rw-r--r--arch/arm/include/asm/mmzone.h30
-rw-r--r--arch/arm/include/asm/ptrace.h36
-rw-r--r--arch/arm/include/asm/setup.h8
-rw-r--r--arch/arm/include/asm/tls.h46
-rw-r--r--arch/arm/include/asm/vfpmacros.h18
-rw-r--r--arch/arm/kernel/Makefile1
-rw-r--r--arch/arm/kernel/crash_dump.c60
-rw-r--r--arch/arm/kernel/entry-armv.S23
-rw-r--r--arch/arm/kernel/irq.c41
-rw-r--r--arch/arm/kernel/machine_kexec.c4
-rw-r--r--arch/arm/kernel/ptrace.c96
-rw-r--r--arch/arm/kernel/relocate_kernel.S6
-rw-r--r--arch/arm/kernel/setup.c100
-rw-r--r--arch/arm/kernel/traps.c41
-rw-r--r--arch/arm/lib/Makefile1
-rw-r--r--arch/arm/mach-aaec2000/include/mach/memory.h10
-rw-r--r--arch/arm/mach-at91/Kconfig11
-rw-r--r--arch/arm/mach-at91/Makefile3
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c11
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c45
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c45
-rw-r--r--arch/arm/mach-at91/board-snapper9260.c189
-rw-r--r--arch/arm/mach-at91/include/mach/at91cap9.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h22
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9260.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9261.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h130
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9_sdramc.h23
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9rl.h2
-rw-r--r--arch/arm/mach-at91/include/mach/board.h2
-rw-r--r--arch/arm/mach-at91/include/mach/cpu.h10
-rw-r--r--arch/arm/mach-at91/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-at91/pm.h49
-rw-r--r--arch/arm/mach-at91/pm_slowclock.S74
-rw-r--r--arch/arm/mach-clps711x/Kconfig1
-rw-r--r--arch/arm/mach-clps711x/clep7312.c1
-rw-r--r--arch/arm/mach-clps711x/edb7211-arch.c10
-rw-r--r--arch/arm/mach-clps711x/fortunet.c1
-rw-r--r--arch/arm/mach-clps711x/include/mach/debug-macro.S1
-rw-r--r--arch/arm/mach-clps711x/include/mach/memory.h2
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c8
-rw-r--r--arch/arm/mach-davinci/include/mach/memory.h9
-rw-r--r--arch/arm/mach-ep93xx/adssphere.c24
-rw-r--r--arch/arm/mach-ep93xx/core.c46
-rw-r--r--arch/arm/mach-ep93xx/edb93xx.c31
-rw-r--r--arch/arm/mach-ep93xx/gesbc9312.c24
-rw-r--r--arch/arm/mach-ep93xx/include/mach/platform.h3
-rw-r--r--arch/arm/mach-ep93xx/micro9.c37
-rw-r--r--arch/arm/mach-ep93xx/simone.c24
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c27
-rw-r--r--arch/arm/mach-footbridge/common.c2
-rw-r--r--arch/arm/mach-h720x/include/mach/debug-macro.S6
-rw-r--r--arch/arm/mach-integrator/common.h1
-rw-r--r--arch/arm/mach-integrator/core.c12
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c3
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c3
-rw-r--r--arch/arm/mach-iop13xx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c4
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/memory.h6
-rw-r--r--arch/arm/mach-kirkwood/tsx1x-common.c2
-rw-r--r--arch/arm/mach-kirkwood/tsx1x-common.h2
-rw-r--r--arch/arm/mach-l7200/Makefile11
-rw-r--r--arch/arm/mach-l7200/Makefile.boot2
-rw-r--r--arch/arm/mach-l7200/core.c100
-rw-r--r--arch/arm/mach-l7200/include/mach/aux_reg.h28
-rw-r--r--arch/arm/mach-l7200/include/mach/debug-macro.S40
-rw-r--r--arch/arm/mach-l7200/include/mach/entry-macro.S35
-rw-r--r--arch/arm/mach-l7200/include/mach/gp_timers.h42
-rw-r--r--arch/arm/mach-l7200/include/mach/gpio.h105
-rw-r--r--arch/arm/mach-l7200/include/mach/hardware.h57
-rw-r--r--arch/arm/mach-l7200/include/mach/io.h21
-rw-r--r--arch/arm/mach-l7200/include/mach/irqs.h56
-rw-r--r--arch/arm/mach-l7200/include/mach/memory.h26
-rw-r--r--arch/arm/mach-l7200/include/mach/pmpcon.h46
-rw-r--r--arch/arm/mach-l7200/include/mach/pmu.h125
-rw-r--r--arch/arm/mach-l7200/include/mach/serial.h37
-rw-r--r--arch/arm/mach-l7200/include/mach/serial_l7200.h101
-rw-r--r--arch/arm/mach-l7200/include/mach/sib.h119
-rw-r--r--arch/arm/mach-l7200/include/mach/sys-clock.h67
-rw-r--r--arch/arm/mach-l7200/include/mach/system.h29
-rw-r--r--arch/arm/mach-l7200/include/mach/time.h73
-rw-r--r--arch/arm/mach-l7200/include/mach/timex.h20
-rw-r--r--arch/arm/mach-l7200/include/mach/uncompress.h39
-rw-r--r--arch/arm/mach-l7200/include/mach/vmalloc.h4
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/memory.h44
-rw-r--r--arch/arm/mach-msm/board-trout.c1
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/debug-macro.S1
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/uncompress.h30
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c1
-rw-r--r--arch/arm/mach-omap1/board-fsample.c1
-rw-r--r--arch/arm/mach-omap1/board-generic.c1
-rw-r--r--arch/arm/mach-omap1/board-h2.c1
-rw-r--r--arch/arm/mach-omap1/board-h3.c1
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c1
-rw-r--r--arch/arm/mach-omap1/board-innovator.c1
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c1
-rw-r--r--arch/arm/mach-omap1/board-osk.c1
-rw-r--r--arch/arm/mach-omap1/board-palmte.c1
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c1
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c14
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c1
-rw-r--r--arch/arm/mach-omap1/board-sx1.c3
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c1
-rw-r--r--arch/arm/mach-omap1/io.c2
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c1
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c1
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c1
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c1
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c1
-rw-r--r--arch/arm/mach-omap2/board-apollon.c1
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c1
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c1
-rw-r--r--arch/arm/mach-omap2/board-generic.c1
-rw-r--r--arch/arm/mach-omap2/board-h4.c1
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c1
-rw-r--r--arch/arm/mach-omap2/board-ldp.c1
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c3
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c1
-rw-r--r--arch/arm/mach-omap2/board-overo.c1
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c17
-rw-r--r--arch/arm/mach-omap2/board-rx51.c1
-rw-r--r--arch/arm/mach-omap2/board-zoom2.c1
-rw-r--r--arch/arm/mach-omap2/board-zoom3.c1
-rw-r--r--arch/arm/mach-omap2/io.c3
-rw-r--r--arch/arm/mach-pxa/cm-x2xx-pci.c4
-rw-r--r--arch/arm/mach-pxa/colibri-pxa300.c3
-rw-r--r--arch/arm/mach-pxa/corgi.c3
-rw-r--r--arch/arm/mach-pxa/cpufreq-pxa2xx.c8
-rw-r--r--arch/arm/mach-pxa/eseries.c1
-rw-r--r--arch/arm/mach-pxa/generic.h3
-rw-r--r--arch/arm/mach-pxa/include/mach/memory.h19
-rw-r--r--arch/arm/mach-pxa/palmt5.c7
-rw-r--r--arch/arm/mach-pxa/palmtreo.c9
-rw-r--r--arch/arm/mach-pxa/poodle.c1
-rw-r--r--arch/arm/mach-pxa/pxa27x.c6
-rw-r--r--arch/arm/mach-pxa/spitz.c1
-rw-r--r--arch/arm/mach-pxa/tosa.c1
-rw-r--r--arch/arm/mach-realview/core.c31
-rw-r--r--arch/arm/mach-realview/include/mach/board-pb1176.h1
-rw-r--r--arch/arm/mach-realview/include/mach/irqs-pb1176.h2
-rw-r--r--arch/arm/mach-realview/include/mach/memory.h7
-rw-r--r--arch/arm/mach-realview/realview_eb.c30
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c46
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c9
-rw-r--r--arch/arm/mach-realview/realview_pba8.c9
-rw-r--r--arch/arm/mach-realview/realview_pbx.c9
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c9
-rw-r--r--arch/arm/mach-s3c2412/mach-smdk2413.c1
-rw-r--r--arch/arm/mach-s3c2412/mach-vstms.c1
-rw-r--r--arch/arm/mach-s3c2440/mach-rx1950.c9
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c9
-rw-r--r--arch/arm/mach-sa1100/generic.h3
-rw-r--r--arch/arm/mach-sa1100/include/mach/memory.h6
-rw-r--r--arch/arm/mach-shark/include/mach/debug-macro.S3
-rw-r--r--arch/arm/mach-shark/include/mach/memory.h7
-rw-r--r--arch/arm/mach-shmobile/Kconfig12
-rw-r--r--arch/arm/mach-shmobile/include/mach/irqs.h1
-rw-r--r--arch/arm/mach-u300/u300.c17
-rw-r--r--arch/arm/mach-ux500/board-mop500.c36
-rw-r--r--arch/arm/mach-ux500/devices-db8500.c14
-rw-r--r--arch/arm/mach-ux500/include/mach/irqs-board-mop500.h23
-rw-r--r--arch/arm/mach-ux500/include/mach/irqs-db5500.h85
-rw-r--r--arch/arm/mach-ux500/include/mach/irqs-db8500.h96
-rw-r--r--arch/arm/mach-ux500/include/mach/irqs.h22
-rw-r--r--arch/arm/mach-ux500/pins-db8500.h742
-rw-r--r--arch/arm/mach-versatile/core.c28
-rw-r--r--arch/arm/mach-versatile/pci.c2
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c2
-rw-r--r--arch/arm/mach-vexpress/include/mach/ct-ca9x4.h1
-rw-r--r--arch/arm/mach-w90x900/cpu.c2
-rw-r--r--arch/arm/mach-w90x900/dev.c96
-rw-r--r--arch/arm/mach-w90x900/include/mach/regs-gcr.h39
-rw-r--r--arch/arm/mach-w90x900/mach-nuc950evb.c44
-rw-r--r--arch/arm/mach-w90x900/nuc910.c2
-rw-r--r--arch/arm/mach-w90x900/nuc950.c2
-rw-r--r--arch/arm/mm/Kconfig11
-rw-r--r--arch/arm/mm/Makefile1
-rw-r--r--arch/arm/mm/discontig.c45
-rw-r--r--arch/arm/mm/init.c392
-rw-r--r--arch/arm/mm/ioremap.c6
-rw-r--r--arch/arm/mm/mm.h4
-rw-r--r--arch/arm/mm/mmu.c161
-rw-r--r--arch/arm/mm/nommu.c22
-rw-r--r--arch/arm/mm/proc-v6.S5
-rw-r--r--arch/arm/mm/proc-v7.S2
-rw-r--r--arch/arm/plat-iop/time.c53
-rw-r--r--arch/arm/plat-nomadik/gpio.c316
-rw-r--r--arch/arm/plat-nomadik/include/plat/gpio.h15
-rw-r--r--arch/arm/plat-nomadik/include/plat/mtu.h6
-rw-r--r--arch/arm/plat-nomadik/include/plat/pincfg.h72
-rw-r--r--arch/arm/plat-nomadik/timer.c14
-rw-r--r--arch/arm/plat-omap/common.c8
-rw-r--r--arch/arm/plat-omap/fb.c77
-rw-r--r--arch/arm/plat-omap/include/plat/common.h2
-rw-r--r--arch/arm/plat-omap/include/plat/vram.h4
-rw-r--r--arch/arm/plat-spear/include/plat/debug-macro.S4
-rw-r--r--arch/arm/plat-spear/time.c47
-rw-r--r--arch/arm/plat-versatile/Makefile4
-rw-r--r--arch/arm/plat-versatile/leds.c103
-rw-r--r--arch/arm/vfp/vfpmodule.c10
-rw-r--r--arch/avr32/include/asm/ioctls.h3
-rw-r--r--arch/avr32/mach-at32ap/include/mach/board.h2
-rw-r--r--arch/mips/alchemy/common/platform.c9
-rw-r--r--arch/mips/alchemy/mtx-1/board_setup.c8
-rw-r--r--arch/mips/bcm63xx/dev-enet.c3
-rw-r--r--arch/mips/include/asm/atomic.h24
-rw-r--r--arch/mips/include/asm/unistd.h5
-rw-r--r--arch/mips/kernel/scall64-n32.S1
-rw-r--r--arch/mips/kernel/vdso.c4
-rw-r--r--arch/mips/mti-malta/malta-pci.c2
-rw-r--r--arch/mips/nxp/pnx8550/common/pci.c1
-rw-r--r--arch/mips/nxp/pnx8550/common/setup.c2
-rw-r--r--arch/mips/pci/ops-pmcmsp.c1
-rw-r--r--arch/mips/pci/pci-yosemite.c1
-rw-r--r--arch/mips/powertv/asic/asic_devices.c5
-rw-r--r--arch/powerpc/include/asm/kexec.h6
-rw-r--r--arch/powerpc/include/asm/mmu-hash64.h4
-rw-r--r--arch/powerpc/kernel/perf_event_fsl_emb.c6
-rw-r--r--arch/powerpc/kernel/prom.c2
-rw-r--r--arch/powerpc/mm/hash_low_64.S9
-rw-r--r--arch/powerpc/mm/hash_utils_64.c53
-rw-r--r--arch/powerpc/mm/hugetlbpage-hash64.c40
-rw-r--r--arch/powerpc/mm/numa.c24
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-memory.c22
-rw-r--r--arch/sparc/configs/sparc64_defconfig49
-rw-r--r--arch/sparc/include/asm/cache.h1
-rw-r--r--arch/sparc/include/asm/pgtable_32.h5
-rw-r--r--arch/sparc/kernel/perf_event.c1
-rw-r--r--arch/sparc/kernel/sun4d_irq.c2
-rw-r--r--arch/sparc/kernel/ttable.S2
-rw-r--r--arch/sparc/mm/srmmu.c2
-rw-r--r--arch/sparc/mm/sun4c.c3
-rw-r--r--arch/x86/kernel/acpi/cstate.c9
-rw-r--r--arch/x86/kernel/acpi/sleep.c9
-rw-r--r--arch/x86/kernel/apic/apic.c2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c41
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c11
-rw-r--r--arch/x86/kernel/early-quirks.c18
-rw-r--r--arch/x86/kernel/entry_64.S4
-rw-r--r--arch/x86/kernel/hpet.c2
-rw-r--r--arch/x86/kernel/i8259.c25
-rw-r--r--arch/x86/kernel/kgdb.c9
-rw-r--r--arch/x86/kernel/kprobes.c2
-rw-r--r--arch/x86/kernel/quirks.c5
-rw-r--r--arch/x86/kernel/setup_percpu.c17
-rw-r--r--arch/x86/kvm/mmu.c2
-rw-r--r--arch/x86/kvm/paging_tmpl.h1
-rw-r--r--arch/x86/kvm/x86.c4
-rw-r--r--arch/x86/pci/i386.c1
-rw-r--r--arch/x86/pci/mrst.c7
267 files changed, 3743 insertions, 2695 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 98922f7d2d12..4047f5724da3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -10,6 +10,7 @@ config ARM
10 default y 10 default y
11 select HAVE_AOUT 11 select HAVE_AOUT
12 select HAVE_IDE 12 select HAVE_IDE
13 select HAVE_MEMBLOCK
13 select RTC_LIB 14 select RTC_LIB
14 select SYS_SUPPORTS_APM_EMULATION 15 select SYS_SUPPORTS_APM_EMULATION
15 select GENERIC_ATOMIC64 if (!CPU_32v6K) 16 select GENERIC_ATOMIC64 if (!CPU_32v6K)
@@ -24,6 +25,7 @@ config ARM
24 select HAVE_KERNEL_LZMA 25 select HAVE_KERNEL_LZMA
25 select HAVE_PERF_EVENTS 26 select HAVE_PERF_EVENTS
26 select PERF_USE_VMALLOC 27 select PERF_USE_VMALLOC
28 select HAVE_REGS_AND_STACK_ACCESS_API
27 help 29 help
28 The ARM series is a line of low-power-consumption RISC chip designs 30 The ARM series is a line of low-power-consumption RISC chip designs
29 licensed by ARM Ltd and targeted at embedded applications and 31 licensed by ARM Ltd and targeted at embedded applications and
@@ -439,21 +441,6 @@ config ARCH_IXP4XX
439 help 441 help
440 Support for Intel's IXP4XX (XScale) family of processors. 442 Support for Intel's IXP4XX (XScale) family of processors.
441 443
442config ARCH_L7200
443 bool "LinkUp-L7200"
444 select CPU_ARM720T
445 select FIQ
446 select ARCH_USES_GETTIMEOFFSET
447 help
448 Say Y here if you intend to run this kernel on a LinkUp Systems
449 L7200 Software Development Board which uses an ARM720T processor.
450 Information on this board can be obtained at:
451
452 <http://www.linkupsys.com/>
453
454 If you have any questions or comments about the Linux kernel port
455 to this board, send e-mail to <sjhill@cotw.com>.
456
457config ARCH_DOVE 444config ARCH_DOVE
458 bool "Marvell Dove" 445 bool "Marvell Dove"
459 select PCI 446 select PCI
@@ -719,7 +706,6 @@ config ARCH_SHARK
719config ARCH_LH7A40X 706config ARCH_LH7A40X
720 bool "Sharp LH7A40X" 707 bool "Sharp LH7A40X"
721 select CPU_ARM922T 708 select CPU_ARM922T
722 select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM
723 select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM 709 select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM
724 select ARCH_USES_GETTIMEOFFSET 710 select ARCH_USES_GETTIMEOFFSET
725 help 711 help
@@ -1031,11 +1017,6 @@ endmenu
1031 1017
1032source "arch/arm/common/Kconfig" 1018source "arch/arm/common/Kconfig"
1033 1019
1034config FORCE_MAX_ZONEORDER
1035 int
1036 depends on SA1111
1037 default "9"
1038
1039menu "Bus support" 1020menu "Bus support"
1040 1021
1041config ARM_AMBA 1022config ARM_AMBA
@@ -1172,9 +1153,10 @@ config HOTPLUG_CPU
1172config LOCAL_TIMERS 1153config LOCAL_TIMERS
1173 bool "Use local timer interrupts" 1154 bool "Use local timer interrupts"
1174 depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || \ 1155 depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || \
1175 REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500) 1156 REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
1157 ARCH_U8500 || ARCH_VEXPRESS_CA9X4)
1176 default y 1158 default y
1177 select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500) 1159 select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_VEXPRESS || ARCH_OMAP4 || ARCH_U8500)
1178 help 1160 help
1179 Enable support for local timers on SMP platforms, rather then the 1161 Enable support for local timers on SMP platforms, rather then the
1180 legacy IPI broadcast method. Local timers allows the system 1162 legacy IPI broadcast method. Local timers allows the system
@@ -1185,10 +1167,10 @@ source kernel/Kconfig.preempt
1185 1167
1186config HZ 1168config HZ
1187 int 1169 int
1188 default 128 if ARCH_L7200
1189 default 200 if ARCH_EBSA110 || ARCH_S3C2410 || ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PV210 1170 default 200 if ARCH_EBSA110 || ARCH_S3C2410 || ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PV210
1190 default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER 1171 default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
1191 default AT91_TIMER_HZ if ARCH_AT91 1172 default AT91_TIMER_HZ if ARCH_AT91
1173 default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
1192 default 100 1174 default 100
1193 1175
1194config THUMB2_KERNEL 1176config THUMB2_KERNEL
@@ -1241,10 +1223,6 @@ config OABI_COMPAT
1241config ARCH_HAS_HOLES_MEMORYMODEL 1223config ARCH_HAS_HOLES_MEMORYMODEL
1242 bool 1224 bool
1243 1225
1244# Discontigmem is deprecated
1245config ARCH_DISCONTIGMEM_ENABLE
1246 bool
1247
1248config ARCH_SPARSEMEM_ENABLE 1226config ARCH_SPARSEMEM_ENABLE
1249 bool 1227 bool
1250 1228
@@ -1252,13 +1230,7 @@ config ARCH_SPARSEMEM_DEFAULT
1252 def_bool ARCH_SPARSEMEM_ENABLE 1230 def_bool ARCH_SPARSEMEM_ENABLE
1253 1231
1254config ARCH_SELECT_MEMORY_MODEL 1232config ARCH_SELECT_MEMORY_MODEL
1255 def_bool ARCH_DISCONTIGMEM_ENABLE && ARCH_SPARSEMEM_ENABLE 1233 def_bool ARCH_SPARSEMEM_ENABLE
1256
1257config NODES_SHIFT
1258 int
1259 default "4" if ARCH_LH7A40X
1260 default "2"
1261 depends on NEED_MULTIPLE_NODES
1262 1234
1263config HIGHMEM 1235config HIGHMEM
1264 bool "High Memory Support (EXPERIMENTAL)" 1236 bool "High Memory Support (EXPERIMENTAL)"
@@ -1290,8 +1262,36 @@ config HW_PERF_EVENTS
1290 Enable hardware performance counter support for perf events. If 1262 Enable hardware performance counter support for perf events. If
1291 disabled, perf events will use software events only. 1263 disabled, perf events will use software events only.
1292 1264
1265config SPARSE_IRQ
1266 bool "Support sparse irq numbering"
1267 depends on EXPERIMENTAL
1268 help
1269 This enables support for sparse irqs. This is useful in general
1270 as most CPUs have a fairly sparse array of IRQ vectors, which
1271 the irq_desc then maps directly on to. Systems with a high
1272 number of off-chip IRQs will want to treat this as
1273 experimental until they have been independently verified.
1274
1275 If you don't know what to do here, say N.
1276
1293source "mm/Kconfig" 1277source "mm/Kconfig"
1294 1278
1279config FORCE_MAX_ZONEORDER
1280 int "Maximum zone order" if ARCH_SHMOBILE
1281 range 11 64 if ARCH_SHMOBILE
1282 default "9" if SA1111
1283 default "11"
1284 help
1285 The kernel memory allocator divides physically contiguous memory
1286 blocks into "zones", where each zone is a power of two number of
1287 pages. This option selects the largest power of two that the kernel
1288 keeps in the memory allocator. If you need to allocate very large
1289 blocks of physically contiguous memory, then you may need to
1290 increase this value.
1291
1292 This config option is actually maximum order plus one. For example,
1293 a value of 11 means that the largest free memory block is 2^10 pages.
1294
1295config LEDS 1295config LEDS
1296 bool "Timer and CPU usage LEDs" 1296 bool "Timer and CPU usage LEDs"
1297 depends on ARCH_CDB89712 || ARCH_EBSA110 || \ 1297 depends on ARCH_CDB89712 || ARCH_EBSA110 || \
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 64ba313724d2..bea37a2512e7 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -139,7 +139,6 @@ machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx
139machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx 139machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx
140machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood 140machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood
141machine-$(CONFIG_ARCH_KS8695) := ks8695 141machine-$(CONFIG_ARCH_KS8695) := ks8695
142machine-$(CONFIG_ARCH_L7200) := l7200
143machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x 142machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x
144machine-$(CONFIG_ARCH_LOKI) := loki 143machine-$(CONFIG_ARCH_LOKI) := loki
145machine-$(CONFIG_ARCH_MMP) := mmp 144machine-$(CONFIG_ARCH_MMP) := mmp
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 53faa9063a03..7a29301d516b 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -19,10 +19,6 @@ ifeq ($(CONFIG_ARCH_SHARK),y)
19OBJS += head-shark.o ofw-shark.o 19OBJS += head-shark.o ofw-shark.o
20endif 20endif
21 21
22ifeq ($(CONFIG_ARCH_L7200),y)
23OBJS += head-l7200.o
24endif
25
26ifeq ($(CONFIG_ARCH_P720T),y) 22ifeq ($(CONFIG_ARCH_P720T),y)
27# Borrow this code from SA1100 23# Borrow this code from SA1100
28OBJS += head-sa1100.o 24OBJS += 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
index d0e3b20856cd..000000000000
--- a/arch/arm/boot/compressed/head-l7200.S
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * linux/arch/arm/boot/compressed/head-l7200.S
3 *
4 * Copyright (C) 2000 Steve Hill <sjhill@cotw.com>
5 *
6 * Some code borrowed from Nicolas Pitre's 'head-sa1100.S' file. This
7 * is merged with head.S by the linker.
8 */
9
10#include <asm/mach-types.h>
11
12#ifndef CONFIG_ARCH_L7200
13#error What am I doing here...
14#endif
15
16 .section ".start", "ax"
17
18__L7200_start:
19 mov r0, #0x00100000 @ FLASH address of initrd
20 mov r2, #0xf1000000 @ RAM address of initrd
21 add r3, r2, #0x00700000 @ Size of initrd
221:
23 ldmia r0!, {r4, r5, r6, r7}
24 stmia r2!, {r4, r5, r6, r7}
25 cmp r2, r3
26 ble 1b
27
28 mov r8, #0 @ Zero it out
29 mov r7, #MACH_TYPE_L7200 @ Set architecture ID
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 337741f734ac..7dfa9a85bc0c 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -108,6 +108,51 @@ static void gic_unmask_irq(unsigned int irq)
108 spin_unlock(&irq_controller_lock); 108 spin_unlock(&irq_controller_lock);
109} 109}
110 110
111static int gic_set_type(unsigned int irq, unsigned int type)
112{
113 void __iomem *base = gic_dist_base(irq);
114 unsigned int gicirq = gic_irq(irq);
115 u32 enablemask = 1 << (gicirq % 32);
116 u32 enableoff = (gicirq / 32) * 4;
117 u32 confmask = 0x2 << ((gicirq % 16) * 2);
118 u32 confoff = (gicirq / 16) * 4;
119 bool enabled = false;
120 u32 val;
121
122 /* Interrupt configuration for SGIs can't be changed */
123 if (gicirq < 16)
124 return -EINVAL;
125
126 if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
127 return -EINVAL;
128
129 spin_lock(&irq_controller_lock);
130
131 val = readl(base + GIC_DIST_CONFIG + confoff);
132 if (type == IRQ_TYPE_LEVEL_HIGH)
133 val &= ~confmask;
134 else if (type == IRQ_TYPE_EDGE_RISING)
135 val |= confmask;
136
137 /*
138 * As recommended by the spec, disable the interrupt before changing
139 * the configuration
140 */
141 if (readl(base + GIC_DIST_ENABLE_SET + enableoff) & enablemask) {
142 writel(enablemask, base + GIC_DIST_ENABLE_CLEAR + enableoff);
143 enabled = true;
144 }
145
146 writel(val, base + GIC_DIST_CONFIG + confoff);
147
148 if (enabled)
149 writel(enablemask, base + GIC_DIST_ENABLE_SET + enableoff);
150
151 spin_unlock(&irq_controller_lock);
152
153 return 0;
154}
155
111#ifdef CONFIG_SMP 156#ifdef CONFIG_SMP
112static int gic_set_cpu(unsigned int irq, const struct cpumask *mask_val) 157static int gic_set_cpu(unsigned int irq, const struct cpumask *mask_val)
113{ 158{
@@ -161,6 +206,7 @@ static struct irq_chip gic_chip = {
161 .ack = gic_ack_irq, 206 .ack = gic_ack_irq,
162 .mask = gic_mask_irq, 207 .mask = gic_mask_irq,
163 .unmask = gic_unmask_irq, 208 .unmask = gic_unmask_irq,
209 .set_type = gic_set_type,
164#ifdef CONFIG_SMP 210#ifdef CONFIG_SMP
165 .set_affinity = gic_set_cpu, 211 .set_affinity = gic_set_cpu,
166#endif 212#endif
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 6f80665f477e..ac2fd440652e 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -185,13 +185,10 @@ static struct sa1111_dev_info sa1111_devices[] = {
185 }, 185 },
186}; 186};
187 187
188void __init sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes) 188void __init sa1111_adjust_zones(unsigned long *size, unsigned long *holes)
189{ 189{
190 unsigned int sz = SZ_1M >> PAGE_SHIFT; 190 unsigned int sz = SZ_1M >> PAGE_SHIFT;
191 191
192 if (node != 0)
193 sz = 0;
194
195 size[1] = size[0] - sz; 192 size[1] = size[0] - sz;
196 size[0] = sz; 193 size[0] = sz;
197} 194}
diff --git a/arch/arm/configs/lusl7200_defconfig b/arch/arm/configs/lusl7200_defconfig
deleted file mode 100644
index 816fc42884c9..000000000000
--- a/arch/arm/configs/lusl7200_defconfig
+++ /dev/null
@@ -1,23 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_BSD_PROCESS_ACCT=y
4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_BLK_DEV_INITRD=y
6CONFIG_EMBEDDED=y
7# CONFIG_HOTPLUG is not set
8CONFIG_MODULES=y
9CONFIG_ARCH_L7200=y
10# CONFIG_ARM_THUMB is not set
11CONFIG_ZBOOT_ROM_TEXT=0x00010000
12CONFIG_ZBOOT_ROM_BSS=0xf03e0000
13CONFIG_ZBOOT_ROM=y
14CONFIG_CMDLINE="console=tty0 console=ttyLU1,115200 root=/dev/ram initrd=0xf1000000,0x005dac7b mem=32M"
15CONFIG_BINFMT_AOUT=y
16CONFIG_BLK_DEV_RAM=y
17# CONFIG_INPUT is not set
18# CONFIG_SERIO_SERPORT is not set
19# CONFIG_VT is not set
20CONFIG_SERIAL_NONSTANDARD=y
21CONFIG_EXT2_FS=y
22CONFIG_DEBUG_USER=y
23# CONFIG_CRC32 is not set
diff --git a/arch/arm/include/asm/hwcap.h b/arch/arm/include/asm/hwcap.h
index f7bd52b1c365..c1062c317103 100644
--- a/arch/arm/include/asm/hwcap.h
+++ b/arch/arm/include/asm/hwcap.h
@@ -19,6 +19,7 @@
19#define HWCAP_NEON 4096 19#define HWCAP_NEON 4096
20#define HWCAP_VFPv3 8192 20#define HWCAP_VFPv3 8192
21#define HWCAP_VFPv3D16 16384 21#define HWCAP_VFPv3D16 16384
22#define HWCAP_TLS 32768
22 23
23#if defined(__KERNEL__) && !defined(__ASSEMBLY__) 24#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
24/* 25/*
diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
index 237282f7c762..2721a5814cb9 100644
--- a/arch/arm/include/asm/irq.h
+++ b/arch/arm/include/asm/irq.h
@@ -7,6 +7,8 @@
7#define irq_canonicalize(i) (i) 7#define irq_canonicalize(i) (i)
8#endif 8#endif
9 9
10#define NR_IRQS_LEGACY 16
11
10/* 12/*
11 * Use this value to indicate lack of interrupt 13 * Use this value to indicate lack of interrupt
12 * capability 14 * capability
diff --git a/arch/arm/include/asm/kexec.h b/arch/arm/include/asm/kexec.h
index df15a0dc228e..8ec9ef5c3c7b 100644
--- a/arch/arm/include/asm/kexec.h
+++ b/arch/arm/include/asm/kexec.h
@@ -19,10 +19,26 @@
19 19
20#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
21 21
22struct kimage; 22/**
23/* Provide a dummy definition to avoid build failures. */ 23 * crash_setup_regs() - save registers for the panic kernel
24 * @newregs: registers are saved here
25 * @oldregs: registers to be saved (may be %NULL)
26 *
27 * Function copies machine registers from @oldregs to @newregs. If @oldregs is
28 * %NULL then current registers are stored there.
29 */
24static inline void crash_setup_regs(struct pt_regs *newregs, 30static inline void crash_setup_regs(struct pt_regs *newregs,
25 struct pt_regs *oldregs) { } 31 struct pt_regs *oldregs)
32{
33 if (oldregs) {
34 memcpy(newregs, oldregs, sizeof(*newregs));
35 } else {
36 __asm__ __volatile__ ("stmia %0, {r0 - r15}"
37 : : "r" (&newregs->ARM_r0));
38 __asm__ __volatile__ ("mrs %0, cpsr"
39 : "=r" (newregs->ARM_cpsr));
40 }
41}
26 42
27#endif /* __ASSEMBLY__ */ 43#endif /* __ASSEMBLY__ */
28 44
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index c59842dc7cb8..8a0dd18ba642 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -20,6 +20,7 @@ struct machine_desc {
20 * by assembler code in head.S, head-common.S 20 * by assembler code in head.S, head-common.S
21 */ 21 */
22 unsigned int nr; /* architecture number */ 22 unsigned int nr; /* architecture number */
23 unsigned int nr_irqs; /* number of IRQs */
23 unsigned int phys_io; /* start of physical io */ 24 unsigned int phys_io; /* start of physical io */
24 unsigned int io_pg_offst; /* byte offset for io 25 unsigned int io_pg_offst; /* byte offset for io
25 * page tabe entry */ 26 * page tabe entry */
@@ -37,6 +38,7 @@ struct machine_desc {
37 void (*fixup)(struct machine_desc *, 38 void (*fixup)(struct machine_desc *,
38 struct tag *, char **, 39 struct tag *, char **,
39 struct meminfo *); 40 struct meminfo *);
41 void (*reserve)(void);/* reserve mem blocks */
40 void (*map_io)(void);/* IO mapping function */ 42 void (*map_io)(void);/* IO mapping function */
41 void (*init_irq)(void); 43 void (*init_irq)(void);
42 struct sys_timer *timer; /* system tick timer */ 44 struct sys_timer *timer; /* system tick timer */
diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h
index 8920b2d6e3b8..ce3eee9fe26c 100644
--- a/arch/arm/include/asm/mach/irq.h
+++ b/arch/arm/include/asm/mach/irq.h
@@ -17,6 +17,7 @@ struct seq_file;
17/* 17/*
18 * This is internal. Do not use it. 18 * This is internal. Do not use it.
19 */ 19 */
20extern unsigned int arch_nr_irqs;
20extern void (*init_arch_irq)(void); 21extern void (*init_arch_irq)(void);
21extern void init_FIQ(void); 22extern void init_FIQ(void);
22extern int show_fiq_list(struct seq_file *, void *); 23extern int show_fiq_list(struct seq_file *, void *);
diff --git a/arch/arm/include/asm/memblock.h b/arch/arm/include/asm/memblock.h
new file mode 100644
index 000000000000..fdbc43b2e6c0
--- /dev/null
+++ b/arch/arm/include/asm/memblock.h
@@ -0,0 +1,16 @@
1#ifndef _ASM_ARM_MEMBLOCK_H
2#define _ASM_ARM_MEMBLOCK_H
3
4#ifdef CONFIG_MMU
5extern phys_addr_t lowmem_end_addr;
6#define MEMBLOCK_REAL_LIMIT lowmem_end_addr
7#else
8#define MEMBLOCK_REAL_LIMIT 0
9#endif
10
11struct meminfo;
12struct machine_desc;
13
14extern void arm_memblock_init(struct meminfo *, struct machine_desc *);
15
16#endif
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 4312ee5e3d0b..82df0ae71bb4 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -158,7 +158,7 @@
158#endif 158#endif
159 159
160#ifndef arch_adjust_zones 160#ifndef arch_adjust_zones
161#define arch_adjust_zones(node,size,holes) do { } while (0) 161#define arch_adjust_zones(size,holes) do { } while (0)
162#elif !defined(CONFIG_ZONE_DMA) 162#elif !defined(CONFIG_ZONE_DMA)
163#error "custom arch_adjust_zones() requires CONFIG_ZONE_DMA" 163#error "custom arch_adjust_zones() requires CONFIG_ZONE_DMA"
164#endif 164#endif
@@ -234,76 +234,11 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
234 * virt_to_page(k) convert a _valid_ virtual address to struct page * 234 * virt_to_page(k) convert a _valid_ virtual address to struct page *
235 * virt_addr_valid(k) indicates whether a virtual address is valid 235 * virt_addr_valid(k) indicates whether a virtual address is valid
236 */ 236 */
237#ifndef CONFIG_DISCONTIGMEM
238
239#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET 237#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
240 238
241#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 239#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
242#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) 240#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
243 241
244#define PHYS_TO_NID(addr) (0)
245
246#else /* CONFIG_DISCONTIGMEM */
247
248/*
249 * This is more complex. We have a set of mem_map arrays spread
250 * around in memory.
251 */
252#include <linux/numa.h>
253
254#define arch_pfn_to_nid(pfn) PFN_TO_NID(pfn)
255#define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT)
256
257#define virt_to_page(kaddr) \
258 (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
259
260#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < MAX_NUMNODES)
261
262/*
263 * Common discontigmem stuff.
264 * PHYS_TO_NID is used by the ARM kernel/setup.c
265 */
266#define PHYS_TO_NID(addr) PFN_TO_NID((addr) >> PAGE_SHIFT)
267
268/*
269 * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
270 * and returns the mem_map of that node.
271 */
272#define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
273
274/*
275 * Given a page frame number, find the owning node of the memory
276 * and returns the mem_map of that node.
277 */
278#define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn))
279
280#ifdef NODE_MEM_SIZE_BITS
281#define NODE_MEM_SIZE_MASK ((1 << NODE_MEM_SIZE_BITS) - 1)
282
283/*
284 * Given a kernel address, find the home node of the underlying memory.
285 */
286#define KVADDR_TO_NID(addr) \
287 (((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MEM_SIZE_BITS)
288
289/*
290 * Given a page frame number, convert it to a node id.
291 */
292#define PFN_TO_NID(pfn) \
293 (((pfn) - PHYS_PFN_OFFSET) >> (NODE_MEM_SIZE_BITS - PAGE_SHIFT))
294
295/*
296 * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
297 * and returns the index corresponding to the appropriate page in the
298 * node's mem_map.
299 */
300#define LOCAL_MAP_NR(addr) \
301 (((unsigned long)(addr) & NODE_MEM_SIZE_MASK) >> PAGE_SHIFT)
302
303#endif /* NODE_MEM_SIZE_BITS */
304
305#endif /* !CONFIG_DISCONTIGMEM */
306
307/* 242/*
308 * Optional coherency support. Currently used only by selected 243 * Optional coherency support. Currently used only by selected
309 * Intel XSC3-based systems. 244 * Intel XSC3-based systems.
diff --git a/arch/arm/include/asm/mmzone.h b/arch/arm/include/asm/mmzone.h
deleted file mode 100644
index ae63a4fd28c8..000000000000
--- a/arch/arm/include/asm/mmzone.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * arch/arm/include/asm/mmzone.h
3 *
4 * 1999-12-29 Nicolas Pitre Created
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_MMZONE_H
11#define __ASM_MMZONE_H
12
13/*
14 * Currently defined in arch/arm/mm/discontig.c
15 */
16extern pg_data_t discontig_node_data[];
17
18/*
19 * Return a pointer to the node data for node n.
20 */
21#define NODE_DATA(nid) (&discontig_node_data[nid])
22
23/*
24 * NODE_MEM_MAP gives the kaddr for the mem_map of the node.
25 */
26#define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map)
27
28#include <mach/memory.h>
29
30#endif
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index 9dcb11e59026..c974be8913a7 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -184,6 +184,42 @@ extern unsigned long profile_pc(struct pt_regs *regs);
184#define predicate(x) ((x) & 0xf0000000) 184#define predicate(x) ((x) & 0xf0000000)
185#define PREDICATE_ALWAYS 0xe0000000 185#define PREDICATE_ALWAYS 0xe0000000
186 186
187/*
188 * kprobe-based event tracer support
189 */
190#include <linux/stddef.h>
191#include <linux/types.h>
192#define MAX_REG_OFFSET (offsetof(struct pt_regs, ARM_ORIG_r0))
193
194extern int regs_query_register_offset(const char *name);
195extern const char *regs_query_register_name(unsigned int offset);
196extern bool regs_within_kernel_stack(struct pt_regs *regs, unsigned long addr);
197extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
198 unsigned int n);
199
200/**
201 * regs_get_register() - get register value from its offset
202 * @regs: pt_regs from which register value is gotten
203 * @offset: offset number of the register.
204 *
205 * regs_get_register returns the value of a register whose offset from @regs.
206 * The @offset is the offset of the register in struct pt_regs.
207 * If @offset is bigger than MAX_REG_OFFSET, this returns 0.
208 */
209static inline unsigned long regs_get_register(struct pt_regs *regs,
210 unsigned int offset)
211{
212 if (unlikely(offset > MAX_REG_OFFSET))
213 return 0;
214 return *(unsigned long *)((unsigned long)regs + offset);
215}
216
217/* Valid only for Kernel mode traps. */
218static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
219{
220 return regs->ARM_sp;
221}
222
187#endif /* __KERNEL__ */ 223#endif /* __KERNEL__ */
188 224
189#endif /* __ASSEMBLY__ */ 225#endif /* __ASSEMBLY__ */
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index f392fb4437af..f1e5a9bca249 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -201,8 +201,7 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
201struct membank { 201struct membank {
202 unsigned long start; 202 unsigned long start;
203 unsigned long size; 203 unsigned long size;
204 unsigned short node; 204 unsigned int highmem;
205 unsigned short highmem;
206}; 205};
207 206
208struct meminfo { 207struct meminfo {
@@ -212,9 +211,8 @@ struct meminfo {
212 211
213extern struct meminfo meminfo; 212extern struct meminfo meminfo;
214 213
215#define for_each_nodebank(iter,mi,no) \ 214#define for_each_bank(iter,mi) \
216 for (iter = 0; iter < (mi)->nr_banks; iter++) \ 215 for (iter = 0; iter < (mi)->nr_banks; iter++)
217 if ((mi)->bank[iter].node == no)
218 216
219#define bank_pfn_start(bank) __phys_to_pfn((bank)->start) 217#define bank_pfn_start(bank) __phys_to_pfn((bank)->start)
220#define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size) 218#define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size)
diff --git a/arch/arm/include/asm/tls.h b/arch/arm/include/asm/tls.h
new file mode 100644
index 000000000000..e71d6ff8d104
--- /dev/null
+++ b/arch/arm/include/asm/tls.h
@@ -0,0 +1,46 @@
1#ifndef __ASMARM_TLS_H
2#define __ASMARM_TLS_H
3
4#ifdef __ASSEMBLY__
5 .macro set_tls_none, tp, tmp1, tmp2
6 .endm
7
8 .macro set_tls_v6k, tp, tmp1, tmp2
9 mcr p15, 0, \tp, c13, c0, 3 @ set TLS register
10 .endm
11
12 .macro set_tls_v6, tp, tmp1, tmp2
13 ldr \tmp1, =elf_hwcap
14 ldr \tmp1, [\tmp1, #0]
15 mov \tmp2, #0xffff0fff
16 tst \tmp1, #HWCAP_TLS @ hardware TLS available?
17 mcrne p15, 0, \tp, c13, c0, 3 @ yes, set TLS register
18 streq \tp, [\tmp2, #-15] @ set TLS value at 0xffff0ff0
19 .endm
20
21 .macro set_tls_software, tp, tmp1, tmp2
22 mov \tmp1, #0xffff0fff
23 str \tp, [\tmp1, #-15] @ set TLS value at 0xffff0ff0
24 .endm
25#endif
26
27#ifdef CONFIG_TLS_REG_EMUL
28#define tls_emu 1
29#define has_tls_reg 1
30#define set_tls set_tls_none
31#elif __LINUX_ARM_ARCH__ >= 7 || \
32 (__LINUX_ARM_ARCH__ == 6 && defined(CONFIG_CPU_32v6K))
33#define tls_emu 0
34#define has_tls_reg 1
35#define set_tls set_tls_v6k
36#elif __LINUX_ARM_ARCH__ == 6
37#define tls_emu 0
38#define has_tls_reg (elf_hwcap & HWCAP_TLS)
39#define set_tls set_tls_v6
40#else
41#define tls_emu 0
42#define has_tls_reg 0
43#define set_tls set_tls_software
44#endif
45
46#endif /* __ASMARM_TLS_H */
diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
index 422f3cc204a2..3d5fc41ae8d3 100644
--- a/arch/arm/include/asm/vfpmacros.h
+++ b/arch/arm/include/asm/vfpmacros.h
@@ -3,6 +3,8 @@
3 * 3 *
4 * Assembler-only file containing VFP macros and register definitions. 4 * Assembler-only file containing VFP macros and register definitions.
5 */ 5 */
6#include <asm/hwcap.h>
7
6#include "vfp.h" 8#include "vfp.h"
7 9
8@ Macros to allow building with old toolkits (with no VFP support) 10@ Macros to allow building with old toolkits (with no VFP support)
@@ -22,12 +24,20 @@
22 LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} 24 LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15}
23#endif 25#endif
24#ifdef CONFIG_VFPv3 26#ifdef CONFIG_VFPv3
27#if __LINUX_ARM_ARCH__ <= 6
28 ldr \tmp, =elf_hwcap @ may not have MVFR regs
29 ldr \tmp, [\tmp, #0]
30 tst \tmp, #HWCAP_VFPv3D16
31 ldceq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
32 addne \base, \base, #32*4 @ step over unused register space
33#else
25 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 34 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
26 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field 35 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
27 cmp \tmp, #2 @ 32 x 64bit registers? 36 cmp \tmp, #2 @ 32 x 64bit registers?
28 ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} 37 ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
29 addne \base, \base, #32*4 @ step over unused register space 38 addne \base, \base, #32*4 @ step over unused register space
30#endif 39#endif
40#endif
31 .endm 41 .endm
32 42
33 @ write all the working registers out of the VFP 43 @ write all the working registers out of the VFP
@@ -38,10 +48,18 @@
38 STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} 48 STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15}
39#endif 49#endif
40#ifdef CONFIG_VFPv3 50#ifdef CONFIG_VFPv3
51#if __LINUX_ARM_ARCH__ <= 6
52 ldr \tmp, =elf_hwcap @ may not have MVFR regs
53 ldr \tmp, [\tmp, #0]
54 tst \tmp, #HWCAP_VFPv3D16
55 stceq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
56 addne \base, \base, #32*4 @ step over unused register space
57#else
41 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 58 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
42 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field 59 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
43 cmp \tmp, #2 @ 32 x 64bit registers? 60 cmp \tmp, #2 @ 32 x 64bit registers?
44 stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} 61 stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
45 addne \base, \base, #32*4 @ step over unused register space 62 addne \base, \base, #32*4 @ step over unused register space
46#endif 63#endif
64#endif
47 .endm 65 .endm
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 26d302c28e13..ea023c6aa31e 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
39obj-$(CONFIG_KGDB) += kgdb.o 39obj-$(CONFIG_KGDB) += kgdb.o
40obj-$(CONFIG_ARM_UNWIND) += unwind.o 40obj-$(CONFIG_ARM_UNWIND) += unwind.o
41obj-$(CONFIG_HAVE_TCM) += tcm.o 41obj-$(CONFIG_HAVE_TCM) += tcm.o
42obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
42 43
43obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o 44obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o
44AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 45AFLAGS_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
index 000000000000..cd3b853a8a6d
--- /dev/null
+++ b/arch/arm/kernel/crash_dump.c
@@ -0,0 +1,60 @@
1/*
2 * arch/arm/kernel/crash_dump.c
3 *
4 * Copyright (C) 2010 Nokia Corporation.
5 * Author: Mika Westerberg
6 *
7 * This code is taken from arch/x86/kernel/crash_dump_64.c
8 * Created by: Hariprasad Nellitheertha (hari@in.ibm.com)
9 * Copyright (C) IBM Corporation, 2004. All rights reserved
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/errno.h>
17#include <linux/crash_dump.h>
18#include <linux/uaccess.h>
19#include <linux/io.h>
20
21/* stores the physical address of elf header of crash image */
22unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
23
24/**
25 * copy_oldmem_page() - copy one page from old kernel memory
26 * @pfn: page frame number to be copied
27 * @buf: buffer where the copied page is placed
28 * @csize: number of bytes to copy
29 * @offset: offset in bytes into the page
30 * @userbuf: if set, @buf is int he user address space
31 *
32 * This function copies one page from old kernel memory into buffer pointed by
33 * @buf. If @buf is in userspace, set @userbuf to %1. Returns number of bytes
34 * copied or negative error in case of failure.
35 */
36ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
37 size_t csize, unsigned long offset,
38 int userbuf)
39{
40 void *vaddr;
41
42 if (!csize)
43 return 0;
44
45 vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
46 if (!vaddr)
47 return -ENOMEM;
48
49 if (userbuf) {
50 if (copy_to_user(buf, vaddr + offset, csize)) {
51 iounmap(vaddr);
52 return -EFAULT;
53 }
54 } else {
55 memcpy(buf, vaddr + offset, csize);
56 }
57
58 iounmap(vaddr);
59 return csize;
60}
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 3fd7861de4d1..e864e482118a 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -22,6 +22,7 @@
22#include <asm/thread_notify.h> 22#include <asm/thread_notify.h>
23#include <asm/unwind.h> 23#include <asm/unwind.h>
24#include <asm/unistd.h> 24#include <asm/unistd.h>
25#include <asm/tls.h>
25 26
26#include "entry-header.S" 27#include "entry-header.S"
27 28
@@ -735,12 +736,7 @@ ENTRY(__switch_to)
735#ifdef CONFIG_MMU 736#ifdef CONFIG_MMU
736 ldr r6, [r2, #TI_CPU_DOMAIN] 737 ldr r6, [r2, #TI_CPU_DOMAIN]
737#endif 738#endif
738#if defined(CONFIG_HAS_TLS_REG) 739 set_tls r3, r4, r5
739 mcr p15, 0, r3, c13, c0, 3 @ set TLS register
740#elif !defined(CONFIG_TLS_REG_EMUL)
741 mov r4, #0xffff0fff
742 str r3, [r4, #-15] @ TLS val at 0xffff0ff0
743#endif
744#ifdef CONFIG_MMU 740#ifdef CONFIG_MMU
745 mcr p15, 0, r6, c3, c0, 0 @ Set domain register 741 mcr p15, 0, r6, c3, c0, 0 @ Set domain register
746#endif 742#endif
@@ -1005,17 +1001,12 @@ kuser_cmpxchg_fixup:
1005 */ 1001 */
1006 1002
1007__kuser_get_tls: @ 0xffff0fe0 1003__kuser_get_tls: @ 0xffff0fe0
1008 1004 ldr r0, [pc, #(16 - 8)] @ read TLS, set in kuser_get_tls_init
1009#if !defined(CONFIG_HAS_TLS_REG) && !defined(CONFIG_TLS_REG_EMUL)
1010 ldr r0, [pc, #(16 - 8)] @ TLS stored at 0xffff0ff0
1011#else
1012 mrc p15, 0, r0, c13, c0, 3 @ read TLS register
1013#endif
1014 usr_ret lr 1005 usr_ret lr
1015 1006 mrc p15, 0, r0, c13, c0, 3 @ 0xffff0fe8 hardware TLS code
1016 .rep 5 1007 .rep 4
1017 .word 0 @ pad up to __kuser_helper_version 1008 .word 0 @ 0xffff0ff0 software TLS value, then
1018 .endr 1009 .endr @ pad up to __kuser_helper_version
1019 1010
1020/* 1011/*
1021 * Reference declaration: 1012 * Reference declaration:
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 3b3d2c80509c..c0d5c3b3a760 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -47,12 +47,14 @@
47#define irq_finish(irq) do { } while (0) 47#define irq_finish(irq) do { } while (0)
48#endif 48#endif
49 49
50unsigned int arch_nr_irqs;
50void (*init_arch_irq)(void) __initdata = NULL; 51void (*init_arch_irq)(void) __initdata = NULL;
51unsigned long irq_err_count; 52unsigned long irq_err_count;
52 53
53int show_interrupts(struct seq_file *p, void *v) 54int show_interrupts(struct seq_file *p, void *v)
54{ 55{
55 int i = *(loff_t *) v, cpu; 56 int i = *(loff_t *) v, cpu;
57 struct irq_desc *desc;
56 struct irqaction * action; 58 struct irqaction * action;
57 unsigned long flags; 59 unsigned long flags;
58 60
@@ -67,24 +69,25 @@ int show_interrupts(struct seq_file *p, void *v)
67 seq_putc(p, '\n'); 69 seq_putc(p, '\n');
68 } 70 }
69 71
70 if (i < NR_IRQS) { 72 if (i < nr_irqs) {
71 raw_spin_lock_irqsave(&irq_desc[i].lock, flags); 73 desc = irq_to_desc(i);
72 action = irq_desc[i].action; 74 raw_spin_lock_irqsave(&desc->lock, flags);
75 action = desc->action;
73 if (!action) 76 if (!action)
74 goto unlock; 77 goto unlock;
75 78
76 seq_printf(p, "%3d: ", i); 79 seq_printf(p, "%3d: ", i);
77 for_each_present_cpu(cpu) 80 for_each_present_cpu(cpu)
78 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu)); 81 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
79 seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-"); 82 seq_printf(p, " %10s", desc->chip->name ? : "-");
80 seq_printf(p, " %s", action->name); 83 seq_printf(p, " %s", action->name);
81 for (action = action->next; action; action = action->next) 84 for (action = action->next; action; action = action->next)
82 seq_printf(p, ", %s", action->name); 85 seq_printf(p, ", %s", action->name);
83 86
84 seq_putc(p, '\n'); 87 seq_putc(p, '\n');
85unlock: 88unlock:
86 raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags); 89 raw_spin_unlock_irqrestore(&desc->lock, flags);
87 } else if (i == NR_IRQS) { 90 } else if (i == nr_irqs) {
88#ifdef CONFIG_FIQ 91#ifdef CONFIG_FIQ
89 show_fiq_list(p, v); 92 show_fiq_list(p, v);
90#endif 93#endif
@@ -112,7 +115,7 @@ asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
112 * Some hardware gives randomly wrong interrupts. Rather 115 * Some hardware gives randomly wrong interrupts. Rather
113 * than crashing, do something sensible. 116 * than crashing, do something sensible.
114 */ 117 */
115 if (unlikely(irq >= NR_IRQS)) { 118 if (unlikely(irq >= nr_irqs)) {
116 if (printk_ratelimit()) 119 if (printk_ratelimit())
117 printk(KERN_WARNING "Bad IRQ%u\n", irq); 120 printk(KERN_WARNING "Bad IRQ%u\n", irq);
118 ack_bad_irq(irq); 121 ack_bad_irq(irq);
@@ -132,12 +135,12 @@ void set_irq_flags(unsigned int irq, unsigned int iflags)
132 struct irq_desc *desc; 135 struct irq_desc *desc;
133 unsigned long flags; 136 unsigned long flags;
134 137
135 if (irq >= NR_IRQS) { 138 if (irq >= nr_irqs) {
136 printk(KERN_ERR "Trying to set irq flags for IRQ%d\n", irq); 139 printk(KERN_ERR "Trying to set irq flags for IRQ%d\n", irq);
137 return; 140 return;
138 } 141 }
139 142
140 desc = irq_desc + irq; 143 desc = irq_to_desc(irq);
141 raw_spin_lock_irqsave(&desc->lock, flags); 144 raw_spin_lock_irqsave(&desc->lock, flags);
142 desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; 145 desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
143 if (iflags & IRQF_VALID) 146 if (iflags & IRQF_VALID)
@@ -151,14 +154,25 @@ void set_irq_flags(unsigned int irq, unsigned int iflags)
151 154
152void __init init_IRQ(void) 155void __init init_IRQ(void)
153{ 156{
157 struct irq_desc *desc;
154 int irq; 158 int irq;
155 159
156 for (irq = 0; irq < NR_IRQS; irq++) 160 for (irq = 0; irq < nr_irqs; irq++) {
157 irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_NOPROBE; 161 desc = irq_to_desc_alloc_node(irq, 0);
162 desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE;
163 }
158 164
159 init_arch_irq(); 165 init_arch_irq();
160} 166}
161 167
168#ifdef CONFIG_SPARSE_IRQ
169int __init arch_probe_nr_irqs(void)
170{
171 nr_irqs = arch_nr_irqs ? arch_nr_irqs : NR_IRQS;
172 return 0;
173}
174#endif
175
162#ifdef CONFIG_HOTPLUG_CPU 176#ifdef CONFIG_HOTPLUG_CPU
163 177
164static void route_irq(struct irq_desc *desc, unsigned int irq, unsigned int cpu) 178static void route_irq(struct irq_desc *desc, unsigned int irq, unsigned int cpu)
@@ -178,10 +192,9 @@ static void route_irq(struct irq_desc *desc, unsigned int irq, unsigned int cpu)
178void migrate_irqs(void) 192void migrate_irqs(void)
179{ 193{
180 unsigned int i, cpu = smp_processor_id(); 194 unsigned int i, cpu = smp_processor_id();
195 struct irq_desc *desc;
181 196
182 for (i = 0; i < NR_IRQS; i++) { 197 for_each_irq_desc(i, desc) {
183 struct irq_desc *desc = irq_desc + i;
184
185 if (desc->node == cpu) { 198 if (desc->node == cpu) {
186 unsigned int newcpu = cpumask_any_and(desc->affinity, 199 unsigned int newcpu = cpumask_any_and(desc->affinity,
187 cpu_online_mask); 200 cpu_online_mask);
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 598ca61e7bca..81e989858d42 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -43,6 +43,10 @@ void machine_shutdown(void)
43 43
44void machine_crash_shutdown(struct pt_regs *regs) 44void machine_crash_shutdown(struct pt_regs *regs)
45{ 45{
46 local_irq_disable();
47 crash_save_cpu(regs, smp_processor_id());
48
49 printk(KERN_INFO "Loading crashdump kernel...\n");
46} 50}
47 51
48void machine_kexec(struct kimage *image) 52void machine_kexec(struct kimage *image)
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 3f562a7c0a99..f99d489822d5 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -52,6 +52,102 @@
52#define BREAKINST_THUMB 0xde01 52#define BREAKINST_THUMB 0xde01
53#endif 53#endif
54 54
55struct pt_regs_offset {
56 const char *name;
57 int offset;
58};
59
60#define REG_OFFSET_NAME(r) \
61 {.name = #r, .offset = offsetof(struct pt_regs, ARM_##r)}
62#define REG_OFFSET_END {.name = NULL, .offset = 0}
63
64static const struct pt_regs_offset regoffset_table[] = {
65 REG_OFFSET_NAME(r0),
66 REG_OFFSET_NAME(r1),
67 REG_OFFSET_NAME(r2),
68 REG_OFFSET_NAME(r3),
69 REG_OFFSET_NAME(r4),
70 REG_OFFSET_NAME(r5),
71 REG_OFFSET_NAME(r6),
72 REG_OFFSET_NAME(r7),
73 REG_OFFSET_NAME(r8),
74 REG_OFFSET_NAME(r9),
75 REG_OFFSET_NAME(r10),
76 REG_OFFSET_NAME(fp),
77 REG_OFFSET_NAME(ip),
78 REG_OFFSET_NAME(sp),
79 REG_OFFSET_NAME(lr),
80 REG_OFFSET_NAME(pc),
81 REG_OFFSET_NAME(cpsr),
82 REG_OFFSET_NAME(ORIG_r0),
83 REG_OFFSET_END,
84};
85
86/**
87 * regs_query_register_offset() - query register offset from its name
88 * @name: the name of a register
89 *
90 * regs_query_register_offset() returns the offset of a register in struct
91 * pt_regs from its name. If the name is invalid, this returns -EINVAL;
92 */
93int regs_query_register_offset(const char *name)
94{
95 const struct pt_regs_offset *roff;
96 for (roff = regoffset_table; roff->name != NULL; roff++)
97 if (!strcmp(roff->name, name))
98 return roff->offset;
99 return -EINVAL;
100}
101
102/**
103 * regs_query_register_name() - query register name from its offset
104 * @offset: the offset of a register in struct pt_regs.
105 *
106 * regs_query_register_name() returns the name of a register from its
107 * offset in struct pt_regs. If the @offset is invalid, this returns NULL;
108 */
109const char *regs_query_register_name(unsigned int offset)
110{
111 const struct pt_regs_offset *roff;
112 for (roff = regoffset_table; roff->name != NULL; roff++)
113 if (roff->offset == offset)
114 return roff->name;
115 return NULL;
116}
117
118/**
119 * regs_within_kernel_stack() - check the address in the stack
120 * @regs: pt_regs which contains kernel stack pointer.
121 * @addr: address which is checked.
122 *
123 * regs_within_kernel_stack() checks @addr is within the kernel stack page(s).
124 * If @addr is within the kernel stack, it returns true. If not, returns false.
125 */
126bool regs_within_kernel_stack(struct pt_regs *regs, unsigned long addr)
127{
128 return ((addr & ~(THREAD_SIZE - 1)) ==
129 (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1)));
130}
131
132/**
133 * regs_get_kernel_stack_nth() - get Nth entry of the stack
134 * @regs: pt_regs which contains kernel stack pointer.
135 * @n: stack entry number.
136 *
137 * regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which
138 * is specified by @regs. If the @n th entry is NOT in the kernel stack,
139 * this returns 0.
140 */
141unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n)
142{
143 unsigned long *addr = (unsigned long *)kernel_stack_pointer(regs);
144 addr += n;
145 if (regs_within_kernel_stack(regs, (unsigned long)addr))
146 return *addr;
147 else
148 return 0;
149}
150
55/* 151/*
56 * this routine will get a word off of the processes privileged stack. 152 * this routine will get a word off of the processes privileged stack.
57 * the offset is how far from the base addr as stored in the THREAD. 153 * the offset is how far from the base addr as stored in the THREAD.
diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S
index 61930eb09029..fd26f8d65151 100644
--- a/arch/arm/kernel/relocate_kernel.S
+++ b/arch/arm/kernel/relocate_kernel.S
@@ -10,6 +10,12 @@ relocate_new_kernel:
10 ldr r0,kexec_indirection_page 10 ldr r0,kexec_indirection_page
11 ldr r1,kexec_start_address 11 ldr r1,kexec_start_address
12 12
13 /*
14 * If there is no indirection page (we are doing crashdumps)
15 * skip any relocation.
16 */
17 cmp r0, #0
18 beq 2f
13 19
140: /* top, read another word for the indirection page */ 200: /* top, read another word for the indirection page */
15 ldr r3, [r0],#4 21 ldr r3, [r0],#4
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 122d999bdc7c..776ea1aa974b 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -19,12 +19,15 @@
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <linux/screen_info.h> 20#include <linux/screen_info.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/kexec.h>
23#include <linux/crash_dump.h>
22#include <linux/root_dev.h> 24#include <linux/root_dev.h>
23#include <linux/cpu.h> 25#include <linux/cpu.h>
24#include <linux/interrupt.h> 26#include <linux/interrupt.h>
25#include <linux/smp.h> 27#include <linux/smp.h>
26#include <linux/fs.h> 28#include <linux/fs.h>
27#include <linux/proc_fs.h> 29#include <linux/proc_fs.h>
30#include <linux/memblock.h>
28 31
29#include <asm/unified.h> 32#include <asm/unified.h>
30#include <asm/cpu.h> 33#include <asm/cpu.h>
@@ -269,6 +272,21 @@ static void __init cacheid_init(void)
269extern struct proc_info_list *lookup_processor_type(unsigned int); 272extern struct proc_info_list *lookup_processor_type(unsigned int);
270extern struct machine_desc *lookup_machine_type(unsigned int); 273extern struct machine_desc *lookup_machine_type(unsigned int);
271 274
275static void __init feat_v6_fixup(void)
276{
277 int id = read_cpuid_id();
278
279 if ((id & 0xff0f0000) != 0x41070000)
280 return;
281
282 /*
283 * HWCAP_TLS is available only on 1136 r1p0 and later,
284 * see also kuser_get_tls_init.
285 */
286 if ((((id >> 4) & 0xfff) == 0xb36) && (((id >> 20) & 3) == 0))
287 elf_hwcap &= ~HWCAP_TLS;
288}
289
272static void __init setup_processor(void) 290static void __init setup_processor(void)
273{ 291{
274 struct proc_info_list *list; 292 struct proc_info_list *list;
@@ -311,6 +329,8 @@ static void __init setup_processor(void)
311 elf_hwcap &= ~HWCAP_THUMB; 329 elf_hwcap &= ~HWCAP_THUMB;
312#endif 330#endif
313 331
332 feat_v6_fixup();
333
314 cacheid_init(); 334 cacheid_init();
315 cpu_proc_init(); 335 cpu_proc_init();
316} 336}
@@ -402,13 +422,12 @@ static int __init arm_add_memory(unsigned long start, unsigned long size)
402 size -= start & ~PAGE_MASK; 422 size -= start & ~PAGE_MASK;
403 bank->start = PAGE_ALIGN(start); 423 bank->start = PAGE_ALIGN(start);
404 bank->size = size & PAGE_MASK; 424 bank->size = size & PAGE_MASK;
405 bank->node = PHYS_TO_NID(start);
406 425
407 /* 426 /*
408 * Check whether this memory region has non-zero size or 427 * Check whether this memory region has non-zero size or
409 * invalid node number. 428 * invalid node number.
410 */ 429 */
411 if (bank->size == 0 || bank->node >= MAX_NUMNODES) 430 if (bank->size == 0)
412 return -EINVAL; 431 return -EINVAL;
413 432
414 meminfo.nr_banks++; 433 meminfo.nr_banks++;
@@ -663,6 +682,79 @@ static int __init customize_machine(void)
663} 682}
664arch_initcall(customize_machine); 683arch_initcall(customize_machine);
665 684
685#ifdef CONFIG_KEXEC
686static inline unsigned long long get_total_mem(void)
687{
688 unsigned long total;
689
690 total = max_low_pfn - min_low_pfn;
691 return total << PAGE_SHIFT;
692}
693
694/**
695 * reserve_crashkernel() - reserves memory are for crash kernel
696 *
697 * This function reserves memory area given in "crashkernel=" kernel command
698 * line parameter. The memory reserved is used by a dump capture kernel when
699 * primary kernel is crashing.
700 */
701static void __init reserve_crashkernel(void)
702{
703 unsigned long long crash_size, crash_base;
704 unsigned long long total_mem;
705 int ret;
706
707 total_mem = get_total_mem();
708 ret = parse_crashkernel(boot_command_line, total_mem,
709 &crash_size, &crash_base);
710 if (ret)
711 return;
712
713 ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE);
714 if (ret < 0) {
715 printk(KERN_WARNING "crashkernel reservation failed - "
716 "memory is in use (0x%lx)\n", (unsigned long)crash_base);
717 return;
718 }
719
720 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
721 "for crashkernel (System RAM: %ldMB)\n",
722 (unsigned long)(crash_size >> 20),
723 (unsigned long)(crash_base >> 20),
724 (unsigned long)(total_mem >> 20));
725
726 crashk_res.start = crash_base;
727 crashk_res.end = crash_base + crash_size - 1;
728 insert_resource(&iomem_resource, &crashk_res);
729}
730#else
731static inline void reserve_crashkernel(void) {}
732#endif /* CONFIG_KEXEC */
733
734/*
735 * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
736 * is_kdump_kernel() to determine if we are booting after a panic. Hence
737 * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
738 */
739
740#ifdef CONFIG_CRASH_DUMP
741/*
742 * elfcorehdr= specifies the location of elf core header stored by the crashed
743 * kernel. This option will be passed by kexec loader to the capture kernel.
744 */
745static int __init setup_elfcorehdr(char *arg)
746{
747 char *end;
748
749 if (!arg)
750 return -EINVAL;
751
752 elfcorehdr_addr = memparse(arg, &end);
753 return end > arg ? 0 : -EINVAL;
754}
755early_param("elfcorehdr", setup_elfcorehdr);
756#endif /* CONFIG_CRASH_DUMP */
757
666void __init setup_arch(char **cmdline_p) 758void __init setup_arch(char **cmdline_p)
667{ 759{
668 struct tag *tags = (struct tag *)&init_tags; 760 struct tag *tags = (struct tag *)&init_tags;
@@ -716,12 +808,15 @@ void __init setup_arch(char **cmdline_p)
716 808
717 parse_early_param(); 809 parse_early_param();
718 810
811 arm_memblock_init(&meminfo, mdesc);
812
719 paging_init(mdesc); 813 paging_init(mdesc);
720 request_standard_resources(&meminfo, mdesc); 814 request_standard_resources(&meminfo, mdesc);
721 815
722#ifdef CONFIG_SMP 816#ifdef CONFIG_SMP
723 smp_init_cpus(); 817 smp_init_cpus();
724#endif 818#endif
819 reserve_crashkernel();
725 820
726 cpu_init(); 821 cpu_init();
727 tcm_init(); 822 tcm_init();
@@ -729,6 +824,7 @@ void __init setup_arch(char **cmdline_p)
729 /* 824 /*
730 * Set up various architecture-specific pointers 825 * Set up various architecture-specific pointers
731 */ 826 */
827 arch_nr_irqs = mdesc->nr_irqs;
732 init_arch_irq = mdesc->init_irq; 828 init_arch_irq = mdesc->init_irq;
733 system_timer = mdesc->timer; 829 system_timer = mdesc->timer;
734 init_machine = mdesc->init_machine; 830 init_machine = mdesc->init_machine;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 1621e5327b2a..cda78d59aa31 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -30,6 +30,7 @@
30#include <asm/unistd.h> 30#include <asm/unistd.h>
31#include <asm/traps.h> 31#include <asm/traps.h>
32#include <asm/unwind.h> 32#include <asm/unwind.h>
33#include <asm/tls.h>
33 34
34#include "ptrace.h" 35#include "ptrace.h"
35#include "signal.h" 36#include "signal.h"
@@ -518,17 +519,20 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
518 519
519 case NR(set_tls): 520 case NR(set_tls):
520 thread->tp_value = regs->ARM_r0; 521 thread->tp_value = regs->ARM_r0;
521#if defined(CONFIG_HAS_TLS_REG) 522 if (tls_emu)
522 asm ("mcr p15, 0, %0, c13, c0, 3" : : "r" (regs->ARM_r0) ); 523 return 0;
523#elif !defined(CONFIG_TLS_REG_EMUL) 524 if (has_tls_reg) {
524 /* 525 asm ("mcr p15, 0, %0, c13, c0, 3"
525 * User space must never try to access this directly. 526 : : "r" (regs->ARM_r0));
526 * Expect your app to break eventually if you do so. 527 } else {
527 * The user helper at 0xffff0fe0 must be used instead. 528 /*
528 * (see entry-armv.S for details) 529 * User space must never try to access this directly.
529 */ 530 * Expect your app to break eventually if you do so.
530 *((unsigned int *)0xffff0ff0) = regs->ARM_r0; 531 * The user helper at 0xffff0fe0 must be used instead.
531#endif 532 * (see entry-armv.S for details)
533 */
534 *((unsigned int *)0xffff0ff0) = regs->ARM_r0;
535 }
532 return 0; 536 return 0;
533 537
534#ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG 538#ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG
@@ -743,6 +747,16 @@ void __init trap_init(void)
743 return; 747 return;
744} 748}
745 749
750static void __init kuser_get_tls_init(unsigned long vectors)
751{
752 /*
753 * vectors + 0xfe0 = __kuser_get_tls
754 * vectors + 0xfe8 = hardware TLS instruction at 0xffff0fe8
755 */
756 if (tls_emu || has_tls_reg)
757 memcpy((void *)vectors + 0xfe0, (void *)vectors + 0xfe8, 4);
758}
759
746void __init early_trap_init(void) 760void __init early_trap_init(void)
747{ 761{
748 unsigned long vectors = CONFIG_VECTORS_BASE; 762 unsigned long vectors = CONFIG_VECTORS_BASE;
@@ -761,6 +775,11 @@ void __init early_trap_init(void)
761 memcpy((void *)vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz); 775 memcpy((void *)vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz);
762 776
763 /* 777 /*
778 * Do processor specific fixups for the kuser helpers
779 */
780 kuser_get_tls_init(vectors);
781
782 /*
764 * Copy signal return handlers into the vector page, and 783 * Copy signal return handlers into the vector page, and
765 * set sigreturn to be a pointer to these. 784 * set sigreturn to be a pointer to these.
766 */ 785 */
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 030ba7219f48..59ff42ddf0ae 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -41,7 +41,6 @@ else
41endif 41endif
42 42
43lib-$(CONFIG_ARCH_RPC) += ecard.o io-acorn.o floppydma.o 43lib-$(CONFIG_ARCH_RPC) += ecard.o io-acorn.o floppydma.o
44lib-$(CONFIG_ARCH_L7200) += io-acorn.o
45lib-$(CONFIG_ARCH_SHARK) += io-shark.o 44lib-$(CONFIG_ARCH_SHARK) += io-shark.o
46 45
47$(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S 46$(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S
diff --git a/arch/arm/mach-aaec2000/include/mach/memory.h b/arch/arm/mach-aaec2000/include/mach/memory.h
index c00822543d9f..4f93c567a35a 100644
--- a/arch/arm/mach-aaec2000/include/mach/memory.h
+++ b/arch/arm/mach-aaec2000/include/mach/memory.h
@@ -14,14 +14,4 @@
14 14
15#define PHYS_OFFSET UL(0xf0000000) 15#define PHYS_OFFSET UL(0xf0000000)
16 16
17/*
18 * The nodes are the followings:
19 *
20 * node 0: 0xf000.0000 - 0xf3ff.ffff
21 * node 1: 0xf400.0000 - 0xf7ff.ffff
22 * node 2: 0xf800.0000 - 0xfbff.ffff
23 * node 3: 0xfc00.0000 - 0xffff.ffff
24 */
25#define NODE_MEM_SIZE_BITS 26
26
27#endif /* __ASM_ARCH_MEMORY_H */ 17#endif /* __ASM_ARCH_MEMORY_H */
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 841eaf8f27e2..939bccd70569 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -366,6 +366,17 @@ config MACH_STAMP9G20
366 366
367endif 367endif
368 368
369if (ARCH_AT91SAM9260 || ARCH_AT91SAM9G20)
370comment "AT91SAM9260/AT91SAM9G20 boards"
371
372config MACH_SNAPPER_9260
373 bool "Bluewater Systems Snapper 9260/9G20 module"
374 help
375 Select this if you are using the Bluewater Systems Snapper 9260 or
376 Snapper 9G20 modules.
377 <http://www.bluewatersys.com/>
378endif
379
369# ---------------------------------------------------------- 380# ----------------------------------------------------------
370 381
371if ARCH_AT91SAM9G45 382if ARCH_AT91SAM9G45
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index c1f821e58222..ca2ac003f41f 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -66,6 +66,9 @@ obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o
66obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o 66obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o
67obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o 67obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o
68 68
69# AT91SAM9260/AT91SAM9G20 board-specific support
70obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o
71
69# AT91SAM9G45 board-specific support 72# AT91SAM9G45 board-specific support
70obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o 73obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o
71 74
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 85166b7e69a1..753c0d31a3d3 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -20,6 +20,7 @@
20#include <mach/at91_pmc.h> 20#include <mach/at91_pmc.h>
21#include <mach/at91_rstc.h> 21#include <mach/at91_rstc.h>
22#include <mach/at91_shdwc.h> 22#include <mach/at91_shdwc.h>
23#include <mach/cpu.h>
23 24
24#include "generic.h" 25#include "generic.h"
25#include "clock.h" 26#include "clock.h"
@@ -176,6 +177,13 @@ static struct clk mmc1_clk = {
176 .type = CLK_TYPE_PERIPHERAL, 177 .type = CLK_TYPE_PERIPHERAL,
177}; 178};
178 179
180/* Video decoder clock - Only for sam9m10/sam9m11 */
181static struct clk vdec_clk = {
182 .name = "vdec_clk",
183 .pmc_mask = 1 << AT91SAM9G45_ID_VDEC,
184 .type = CLK_TYPE_PERIPHERAL,
185};
186
179/* One additional fake clock for ohci */ 187/* One additional fake clock for ohci */
180static struct clk ohci_clk = { 188static struct clk ohci_clk = {
181 .name = "ohci_clk", 189 .name = "ohci_clk",
@@ -239,6 +247,9 @@ static void __init at91sam9g45_register_clocks(void)
239 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 247 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
240 clk_register(periph_clocks[i]); 248 clk_register(periph_clocks[i]);
241 249
250 if (cpu_is_at91sam9m10() || cpu_is_at91sam9m11())
251 clk_register(&vdec_clk);
252
242 clk_register(&pck0); 253 clk_register(&pck0);
243 clk_register(&pck1); 254 clk_register(&pck1);
244} 255}
diff --git a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
index a4102d72cc9b..c49f5c003ee1 100644
--- a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
+++ b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
@@ -26,6 +26,9 @@
26#include <linux/spi/spi.h> 26#include <linux/spi/spi.h>
27#include <linux/spi/at73c213.h> 27#include <linux/spi/at73c213.h>
28#include <linux/clk.h> 28#include <linux/clk.h>
29#include <linux/regulator/machine.h>
30#include <linux/regulator/fixed.h>
31#include <linux/regulator/consumer.h>
29 32
30#include <mach/hardware.h> 33#include <mach/hardware.h>
31#include <asm/setup.h> 34#include <asm/setup.h>
@@ -235,6 +238,46 @@ static struct gpio_led ek_leds[] = {
235 } 238 }
236}; 239};
237 240
241#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
242static struct regulator_consumer_supply ek_audio_consumer_supplies[] = {
243 REGULATOR_SUPPLY("AVDD", "0-001b"),
244 REGULATOR_SUPPLY("HPVDD", "0-001b"),
245 REGULATOR_SUPPLY("DBVDD", "0-001b"),
246 REGULATOR_SUPPLY("DCVDD", "0-001b"),
247};
248
249static struct regulator_init_data ek_avdd_reg_init_data = {
250 .constraints = {
251 .name = "3V3",
252 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
253 },
254 .consumer_supplies = ek_audio_consumer_supplies,
255 .num_consumer_supplies = ARRAY_SIZE(ek_audio_consumer_supplies),
256};
257
258static struct fixed_voltage_config ek_vdd_pdata = {
259 .supply_name = "board-3V3",
260 .microvolts = 3300000,
261 .gpio = -EINVAL,
262 .enabled_at_boot = 0,
263 .init_data = &ek_avdd_reg_init_data,
264};
265static struct platform_device ek_voltage_regulator = {
266 .name = "reg-fixed-voltage",
267 .id = -1,
268 .num_resources = 0,
269 .dev = {
270 .platform_data = &ek_vdd_pdata,
271 },
272};
273static void __init ek_add_regulators(void)
274{
275 platform_device_register(&ek_voltage_regulator);
276}
277#else
278static void __init ek_add_regulators(void) {}
279#endif
280
238static struct i2c_board_info __initdata ek_i2c_devices[] = { 281static struct i2c_board_info __initdata ek_i2c_devices[] = {
239 { 282 {
240 I2C_BOARD_INFO("24c512", 0x50), 283 I2C_BOARD_INFO("24c512", 0x50),
@@ -256,6 +299,8 @@ static void __init ek_board_init(void)
256 ek_add_device_nand(); 299 ek_add_device_nand();
257 /* Ethernet */ 300 /* Ethernet */
258 at91_add_device_eth(&ek_macb_data); 301 at91_add_device_eth(&ek_macb_data);
302 /* Regulators */
303 ek_add_regulators();
259 /* MMC */ 304 /* MMC */
260#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) 305#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
261 at91_add_device_mci(0, &ek_mmc_data); 306 at91_add_device_mci(0, &ek_mmc_data);
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index c11fd47aec5d..6ea9808b8868 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -27,6 +27,9 @@
27#include <linux/gpio_keys.h> 27#include <linux/gpio_keys.h>
28#include <linux/input.h> 28#include <linux/input.h>
29#include <linux/clk.h> 29#include <linux/clk.h>
30#include <linux/regulator/machine.h>
31#include <linux/regulator/fixed.h>
32#include <linux/regulator/consumer.h>
30 33
31#include <mach/hardware.h> 34#include <mach/hardware.h>
32#include <asm/setup.h> 35#include <asm/setup.h>
@@ -269,6 +272,46 @@ static void __init ek_add_device_buttons(void)
269static void __init ek_add_device_buttons(void) {} 272static void __init ek_add_device_buttons(void) {}
270#endif 273#endif
271 274
275#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
276static struct regulator_consumer_supply ek_audio_consumer_supplies[] = {
277 REGULATOR_SUPPLY("AVDD", "0-001b"),
278 REGULATOR_SUPPLY("HPVDD", "0-001b"),
279 REGULATOR_SUPPLY("DBVDD", "0-001b"),
280 REGULATOR_SUPPLY("DCVDD", "0-001b"),
281};
282
283static struct regulator_init_data ek_avdd_reg_init_data = {
284 .constraints = {
285 .name = "3V3",
286 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
287 },
288 .consumer_supplies = ek_audio_consumer_supplies,
289 .num_consumer_supplies = ARRAY_SIZE(ek_audio_consumer_supplies),
290};
291
292static struct fixed_voltage_config ek_vdd_pdata = {
293 .supply_name = "board-3V3",
294 .microvolts = 3300000,
295 .gpio = -EINVAL,
296 .enabled_at_boot = 0,
297 .init_data = &ek_avdd_reg_init_data,
298};
299static struct platform_device ek_voltage_regulator = {
300 .name = "reg-fixed-voltage",
301 .id = -1,
302 .num_resources = 0,
303 .dev = {
304 .platform_data = &ek_vdd_pdata,
305 },
306};
307static void __init ek_add_regulators(void)
308{
309 platform_device_register(&ek_voltage_regulator);
310}
311#else
312static void __init ek_add_regulators(void) {}
313#endif
314
272 315
273static struct i2c_board_info __initdata ek_i2c_devices[] = { 316static struct i2c_board_info __initdata ek_i2c_devices[] = {
274 { 317 {
@@ -294,6 +337,8 @@ static void __init ek_board_init(void)
294 ek_add_device_nand(); 337 ek_add_device_nand();
295 /* Ethernet */ 338 /* Ethernet */
296 at91_add_device_eth(&ek_macb_data); 339 at91_add_device_eth(&ek_macb_data);
340 /* Regulators */
341 ek_add_regulators();
297 /* MMC */ 342 /* MMC */
298 at91_add_device_mmc(0, &ek_mmc_data); 343 at91_add_device_mmc(0, &ek_mmc_data);
299 /* I2C */ 344 /* I2C */
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c
new file mode 100644
index 000000000000..2c08ae4ad3a1
--- /dev/null
+++ b/arch/arm/mach-at91/board-snapper9260.c
@@ -0,0 +1,189 @@
1/*
2 * linux/arch/arm/mach-at91/board-snapper9260.c
3 *
4 * Copyright (C) 2010 Bluewater System Ltd
5 *
6 * Author: Andre Renaud <andre@bluewatersys.com>
7 * Author: Ryan Mallon <ryan@bluewatersys.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25#include <linux/init.h>
26#include <linux/gpio.h>
27#include <linux/platform_device.h>
28#include <linux/spi/spi.h>
29#include <linux/i2c/pca953x.h>
30
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33
34#include <mach/hardware.h>
35#include <mach/board.h>
36#include <mach/at91sam9_smc.h>
37
38#include "sam9_smc.h"
39#include "generic.h"
40
41#define SNAPPER9260_IO_EXP_GPIO(x) (NR_BUILTIN_GPIO + (x))
42
43static void __init snapper9260_map_io(void)
44{
45 at91sam9260_initialize(18432000);
46
47 /* Debug on ttyS0 */
48 at91_register_uart(0, 0, 0);
49 at91_set_serial_console(0);
50
51 at91_register_uart(AT91SAM9260_ID_US0, 1,
52 ATMEL_UART_CTS | ATMEL_UART_RTS);
53 at91_register_uart(AT91SAM9260_ID_US1, 2,
54 ATMEL_UART_CTS | ATMEL_UART_RTS);
55 at91_register_uart(AT91SAM9260_ID_US2, 3, 0);
56}
57
58static void __init snapper9260_init_irq(void)
59{
60 at91sam9260_init_interrupts(NULL);
61}
62
63static struct at91_usbh_data __initdata snapper9260_usbh_data = {
64 .ports = 2,
65};
66
67static struct at91_udc_data __initdata snapper9260_udc_data = {
68 .vbus_pin = SNAPPER9260_IO_EXP_GPIO(5),
69 .vbus_active_low = 1,
70 .vbus_polled = 1,
71};
72
73static struct at91_eth_data snapper9260_macb_data = {
74 .is_rmii = 1,
75};
76
77static struct mtd_partition __initdata snapper9260_nand_partitions[] = {
78 {
79 .name = "Preboot",
80 .offset = 0,
81 .size = SZ_128K,
82 },
83 {
84 .name = "Bootloader",
85 .offset = MTDPART_OFS_APPEND,
86 .size = SZ_256K,
87 },
88 {
89 .name = "Environment",
90 .offset = MTDPART_OFS_APPEND,
91 .size = SZ_128K,
92 },
93 {
94 .name = "Kernel",
95 .offset = MTDPART_OFS_APPEND,
96 .size = SZ_4M,
97 },
98 {
99 .name = "Filesystem",
100 .offset = MTDPART_OFS_APPEND,
101 .size = MTDPART_SIZ_FULL,
102 },
103};
104
105static struct mtd_partition * __init
106snapper9260_nand_partition_info(int size, int *num_partitions)
107{
108 *num_partitions = ARRAY_SIZE(snapper9260_nand_partitions);
109 return snapper9260_nand_partitions;
110}
111
112static struct atmel_nand_data __initdata snapper9260_nand_data = {
113 .ale = 21,
114 .cle = 22,
115 .rdy_pin = AT91_PIN_PC13,
116 .partition_info = snapper9260_nand_partition_info,
117 .bus_width_16 = 0,
118};
119
120static struct sam9_smc_config __initdata snapper9260_nand_smc_config = {
121 .ncs_read_setup = 0,
122 .nrd_setup = 0,
123 .ncs_write_setup = 0,
124 .nwe_setup = 0,
125
126 .ncs_read_pulse = 5,
127 .nrd_pulse = 2,
128 .ncs_write_pulse = 5,
129 .nwe_pulse = 2,
130
131 .read_cycle = 7,
132 .write_cycle = 7,
133
134 .mode = (AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
135 AT91_SMC_EXNWMODE_DISABLE),
136 .tdf_cycles = 1,
137};
138
139static struct pca953x_platform_data snapper9260_io_expander_data = {
140 .gpio_base = SNAPPER9260_IO_EXP_GPIO(0),
141};
142
143static struct i2c_board_info __initdata snapper9260_i2c_devices[] = {
144 {
145 /* IO expander */
146 I2C_BOARD_INFO("max7312", 0x28),
147 .platform_data = &snapper9260_io_expander_data,
148 },
149 {
150 /* Audio codec */
151 I2C_BOARD_INFO("tlv320aic23", 0x1a),
152 },
153 {
154 /* RTC */
155 I2C_BOARD_INFO("isl1208", 0x6f),
156 },
157};
158
159static void __init snapper9260_add_device_nand(void)
160{
161 at91_set_A_periph(AT91_PIN_PC14, 0);
162 sam9_smc_configure(3, &snapper9260_nand_smc_config);
163 at91_add_device_nand(&snapper9260_nand_data);
164}
165
166static void __init snapper9260_board_init(void)
167{
168 at91_add_device_i2c(snapper9260_i2c_devices,
169 ARRAY_SIZE(snapper9260_i2c_devices));
170 at91_add_device_serial();
171 at91_add_device_usbh(&snapper9260_usbh_data);
172 at91_add_device_udc(&snapper9260_udc_data);
173 at91_add_device_eth(&snapper9260_macb_data);
174 at91_add_device_ssc(AT91SAM9260_ID_SSC, (ATMEL_SSC_TF | ATMEL_SSC_TK |
175 ATMEL_SSC_TD | ATMEL_SSC_RD));
176 snapper9260_add_device_nand();
177}
178
179MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module")
180 .phys_io = AT91_BASE_SYS,
181 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
182 .boot_params = AT91_SDRAM_BASE + 0x100,
183 .timer = &at91sam926x_timer,
184 .map_io = snapper9260_map_io,
185 .init_irq = snapper9260_init_irq,
186 .init_machine = snapper9260_board_init,
187MACHINE_END
188
189
diff --git a/arch/arm/mach-at91/include/mach/at91cap9.h b/arch/arm/mach-at91/include/mach/at91cap9.h
index d8c1ededaa75..9c6af9737485 100644
--- a/arch/arm/mach-at91/include/mach/at91cap9.h
+++ b/arch/arm/mach-at91/include/mach/at91cap9.h
@@ -84,7 +84,7 @@
84 */ 84 */
85#define AT91_ECC (0xffffe200 - AT91_BASE_SYS) 85#define AT91_ECC (0xffffe200 - AT91_BASE_SYS)
86#define AT91_BCRAMC (0xffffe400 - AT91_BASE_SYS) 86#define AT91_BCRAMC (0xffffe400 - AT91_BASE_SYS)
87#define AT91_DDRSDRC (0xffffe600 - AT91_BASE_SYS) 87#define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS)
88#define AT91_SMC (0xffffe800 - AT91_BASE_SYS) 88#define AT91_SMC (0xffffe800 - AT91_BASE_SYS)
89#define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS) 89#define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS)
90#define AT91_CCFG (0xffffeb10 - AT91_BASE_SYS) 90#define AT91_CCFG (0xffffeb10 - AT91_BASE_SYS)
diff --git a/arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h
index 1499b1cbffdd..976f4a6c3353 100644
--- a/arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h
+++ b/arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h
@@ -15,7 +15,7 @@
15#ifndef AT91CAP9_DDRSDR_H 15#ifndef AT91CAP9_DDRSDR_H
16#define AT91CAP9_DDRSDR_H 16#define AT91CAP9_DDRSDR_H
17 17
18#define AT91_DDRSDRC_MR (AT91_DDRSDRC + 0x00) /* Mode Register */ 18#define AT91_DDRSDRC_MR 0x00 /* Mode Register */
19#define AT91_DDRSDRC_MODE (0xf << 0) /* Command Mode */ 19#define AT91_DDRSDRC_MODE (0xf << 0) /* Command Mode */
20#define AT91_DDRSDRC_MODE_NORMAL 0 20#define AT91_DDRSDRC_MODE_NORMAL 0
21#define AT91_DDRSDRC_MODE_NOP 1 21#define AT91_DDRSDRC_MODE_NOP 1
@@ -25,10 +25,10 @@
25#define AT91_DDRSDRC_MODE_EXT_LMR 5 25#define AT91_DDRSDRC_MODE_EXT_LMR 5
26#define AT91_DDRSDRC_MODE_DEEP 6 26#define AT91_DDRSDRC_MODE_DEEP 6
27 27
28#define AT91_DDRSDRC_RTR (AT91_DDRSDRC + 0x04) /* Refresh Timer Register */ 28#define AT91_DDRSDRC_RTR 0x04 /* Refresh Timer Register */
29#define AT91_DDRSDRC_COUNT (0xfff << 0) /* Refresh Timer Counter */ 29#define AT91_DDRSDRC_COUNT (0xfff << 0) /* Refresh Timer Counter */
30 30
31#define AT91_DDRSDRC_CR (AT91_DDRSDRC + 0x08) /* Configuration Register */ 31#define AT91_DDRSDRC_CR 0x08 /* Configuration Register */
32#define AT91_DDRSDRC_NC (3 << 0) /* Number of Column Bits */ 32#define AT91_DDRSDRC_NC (3 << 0) /* Number of Column Bits */
33#define AT91_DDRSDRC_NC_SDR8 (0 << 0) 33#define AT91_DDRSDRC_NC_SDR8 (0 << 0)
34#define AT91_DDRSDRC_NC_SDR9 (1 << 0) 34#define AT91_DDRSDRC_NC_SDR9 (1 << 0)
@@ -49,7 +49,7 @@
49#define AT91_DDRSDRC_DLL (1 << 7) /* Reset DLL */ 49#define AT91_DDRSDRC_DLL (1 << 7) /* Reset DLL */
50#define AT91_DDRSDRC_DICDS (1 << 8) /* Output impedance control */ 50#define AT91_DDRSDRC_DICDS (1 << 8) /* Output impedance control */
51 51
52#define AT91_DDRSDRC_T0PR (AT91_DDRSDRC + 0x0C) /* Timing 0 Register */ 52#define AT91_DDRSDRC_T0PR 0x0C /* Timing 0 Register */
53#define AT91_DDRSDRC_TRAS (0xf << 0) /* Active to Precharge delay */ 53#define AT91_DDRSDRC_TRAS (0xf << 0) /* Active to Precharge delay */
54#define AT91_DDRSDRC_TRCD (0xf << 4) /* Row to Column delay */ 54#define AT91_DDRSDRC_TRCD (0xf << 4) /* Row to Column delay */
55#define AT91_DDRSDRC_TWR (0xf << 8) /* Write recovery delay */ 55#define AT91_DDRSDRC_TWR (0xf << 8) /* Write recovery delay */
@@ -59,13 +59,13 @@
59#define AT91_DDRSDRC_TWTR (1 << 24) /* Internal Write to Read delay */ 59#define AT91_DDRSDRC_TWTR (1 << 24) /* Internal Write to Read delay */
60#define AT91_DDRSDRC_TMRD (0xf << 28) /* Load mode to active/refresh delay */ 60#define AT91_DDRSDRC_TMRD (0xf << 28) /* Load mode to active/refresh delay */
61 61
62#define AT91_DDRSDRC_T1PR (AT91_DDRSDRC + 0x10) /* Timing 1 Register */ 62#define AT91_DDRSDRC_T1PR 0x10 /* Timing 1 Register */
63#define AT91_DDRSDRC_TRFC (0x1f << 0) /* Row Cycle Delay */ 63#define AT91_DDRSDRC_TRFC (0x1f << 0) /* Row Cycle Delay */
64#define AT91_DDRSDRC_TXSNR (0xff << 8) /* Exit self-refresh to non-read */ 64#define AT91_DDRSDRC_TXSNR (0xff << 8) /* Exit self-refresh to non-read */
65#define AT91_DDRSDRC_TXSRD (0xff << 16) /* Exit self-refresh to read */ 65#define AT91_DDRSDRC_TXSRD (0xff << 16) /* Exit self-refresh to read */
66#define AT91_DDRSDRC_TXP (0xf << 24) /* Exit power-down delay */ 66#define AT91_DDRSDRC_TXP (0xf << 24) /* Exit power-down delay */
67 67
68#define AT91_DDRSDRC_LPR (AT91_DDRSDRC + 0x18) /* Low Power Register */ 68#define AT91_DDRSDRC_LPR 0x18 /* Low Power Register */
69#define AT91_DDRSDRC_LPCB (3 << 0) /* Low-power Configurations */ 69#define AT91_DDRSDRC_LPCB (3 << 0) /* Low-power Configurations */
70#define AT91_DDRSDRC_LPCB_DISABLE 0 70#define AT91_DDRSDRC_LPCB_DISABLE 0
71#define AT91_DDRSDRC_LPCB_SELF_REFRESH 1 71#define AT91_DDRSDRC_LPCB_SELF_REFRESH 1
@@ -80,14 +80,14 @@
80#define AT91_DDRSDRC_TIMEOUT_64_CLK_CYCLES (1 << 12) 80#define AT91_DDRSDRC_TIMEOUT_64_CLK_CYCLES (1 << 12)
81#define AT91_DDRSDRC_TIMEOUT_128_CLK_CYCLES (2 << 12) 81#define AT91_DDRSDRC_TIMEOUT_128_CLK_CYCLES (2 << 12)
82 82
83#define AT91_DDRSDRC_MDR (AT91_DDRSDRC + 0x1C) /* Memory Device Register */ 83#define AT91_DDRSDRC_MDR 0x1C /* Memory Device Register */
84#define AT91_DDRSDRC_MD (3 << 0) /* Memory Device Type */ 84#define AT91_DDRSDRC_MD (3 << 0) /* Memory Device Type */
85#define AT91_DDRSDRC_MD_SDR 0 85#define AT91_DDRSDRC_MD_SDR 0
86#define AT91_DDRSDRC_MD_LOW_POWER_SDR 1 86#define AT91_DDRSDRC_MD_LOW_POWER_SDR 1
87#define AT91_DDRSDRC_MD_DDR 2 87#define AT91_DDRSDRC_MD_DDR 2
88#define AT91_DDRSDRC_MD_LOW_POWER_DDR 3 88#define AT91_DDRSDRC_MD_LOW_POWER_DDR 3
89 89
90#define AT91_DDRSDRC_DLLR (AT91_DDRSDRC + 0x20) /* DLL Information Register */ 90#define AT91_DDRSDRC_DLLR 0x20 /* DLL Information Register */
91#define AT91_DDRSDRC_MDINC (1 << 0) /* Master Delay increment */ 91#define AT91_DDRSDRC_MDINC (1 << 0) /* Master Delay increment */
92#define AT91_DDRSDRC_MDDEC (1 << 1) /* Master Delay decrement */ 92#define AT91_DDRSDRC_MDDEC (1 << 1) /* Master Delay decrement */
93#define AT91_DDRSDRC_MDOVF (1 << 2) /* Master Delay Overflow */ 93#define AT91_DDRSDRC_MDOVF (1 << 2) /* Master Delay Overflow */
@@ -98,5 +98,11 @@
98#define AT91_DDRSDRC_SDVAL (0xff << 16) /* Slave Delay value */ 98#define AT91_DDRSDRC_SDVAL (0xff << 16) /* Slave Delay value */
99#define AT91_DDRSDRC_SDCVAL (0xff << 24) /* Slave Delay Correction value */ 99#define AT91_DDRSDRC_SDCVAL (0xff << 24) /* Slave Delay Correction value */
100 100
101/* Register access macros */
102#define at91_ramc_read(num, reg) \
103 at91_sys_read(AT91_DDRSDRC##num + reg)
104#define at91_ramc_write(num, reg, value) \
105 at91_sys_write(AT91_DDRSDRC##num + reg, value)
106
101 107
102#endif 108#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9260.h b/arch/arm/mach-at91/include/mach/at91sam9260.h
index 43c396b9b4cb..4e79036d3b80 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9260.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9260.h
@@ -84,7 +84,7 @@
84 * System Peripherals (offset from AT91_BASE_SYS) 84 * System Peripherals (offset from AT91_BASE_SYS)
85 */ 85 */
86#define AT91_ECC (0xffffe800 - AT91_BASE_SYS) 86#define AT91_ECC (0xffffe800 - AT91_BASE_SYS)
87#define AT91_SDRAMC (0xffffea00 - AT91_BASE_SYS) 87#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS)
88#define AT91_SMC (0xffffec00 - AT91_BASE_SYS) 88#define AT91_SMC (0xffffec00 - AT91_BASE_SYS)
89#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 89#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)
90#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS) 90#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS)
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261.h b/arch/arm/mach-at91/include/mach/at91sam9261.h
index 87de8be17484..2b5618518129 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9261.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9261.h
@@ -68,7 +68,7 @@
68/* 68/*
69 * System Peripherals (offset from AT91_BASE_SYS) 69 * System Peripherals (offset from AT91_BASE_SYS)
70 */ 70 */
71#define AT91_SDRAMC (0xffffea00 - AT91_BASE_SYS) 71#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS)
72#define AT91_SMC (0xffffec00 - AT91_BASE_SYS) 72#define AT91_SMC (0xffffec00 - AT91_BASE_SYS)
73#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 73#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)
74#define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 74#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
index 000000000000..d27b15ba8ebf
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
@@ -0,0 +1,130 @@
1/*
2 * Header file for the Atmel DDR/SDR SDRAM Controller
3 *
4 * Copyright (C) 2010 Atmel Corporation
5 * Nicolas Ferre <nicolas.ferre@atmel.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12#ifndef AT91SAM9_DDRSDR_H
13#define AT91SAM9_DDRSDR_H
14
15#define AT91_DDRSDRC_MR 0x00 /* Mode Register */
16#define AT91_DDRSDRC_MODE (0x7 << 0) /* Command Mode */
17#define AT91_DDRSDRC_MODE_NORMAL 0
18#define AT91_DDRSDRC_MODE_NOP 1
19#define AT91_DDRSDRC_MODE_PRECHARGE 2
20#define AT91_DDRSDRC_MODE_LMR 3
21#define AT91_DDRSDRC_MODE_REFRESH 4
22#define AT91_DDRSDRC_MODE_EXT_LMR 5
23#define AT91_DDRSDRC_MODE_DEEP 6
24
25#define AT91_DDRSDRC_RTR 0x04 /* Refresh Timer Register */
26#define AT91_DDRSDRC_COUNT (0xfff << 0) /* Refresh Timer Counter */
27
28#define AT91_DDRSDRC_CR 0x08 /* Configuration Register */
29#define AT91_DDRSDRC_NC (3 << 0) /* Number of Column Bits */
30#define AT91_DDRSDRC_NC_SDR8 (0 << 0)
31#define AT91_DDRSDRC_NC_SDR9 (1 << 0)
32#define AT91_DDRSDRC_NC_SDR10 (2 << 0)
33#define AT91_DDRSDRC_NC_SDR11 (3 << 0)
34#define AT91_DDRSDRC_NC_DDR9 (0 << 0)
35#define AT91_DDRSDRC_NC_DDR10 (1 << 0)
36#define AT91_DDRSDRC_NC_DDR11 (2 << 0)
37#define AT91_DDRSDRC_NC_DDR12 (3 << 0)
38#define AT91_DDRSDRC_NR (3 << 2) /* Number of Row Bits */
39#define AT91_DDRSDRC_NR_11 (0 << 2)
40#define AT91_DDRSDRC_NR_12 (1 << 2)
41#define AT91_DDRSDRC_NR_13 (2 << 2)
42#define AT91_DDRSDRC_NR_14 (3 << 2)
43#define AT91_DDRSDRC_CAS (7 << 4) /* CAS Latency */
44#define AT91_DDRSDRC_CAS_2 (2 << 4)
45#define AT91_DDRSDRC_CAS_3 (3 << 4)
46#define AT91_DDRSDRC_CAS_25 (6 << 4)
47#define AT91_DDRSDRC_RST_DLL (1 << 7) /* Reset DLL */
48#define AT91_DDRSDRC_DICDS (1 << 8) /* Output impedance control */
49#define AT91_DDRSDRC_DIS_DLL (1 << 9) /* Disable DLL */
50#define AT91_DDRSDRC_OCD (1 << 12) /* Off-Chip Driver */
51#define AT91_DDRSDRC_DQMS (1 << 16) /* Mask Data is Shared */
52#define AT91_DDRSDRC_ACTBST (1 << 18) /* Active Bank X to Burst Stop Read Access Bank Y */
53
54#define AT91_DDRSDRC_T0PR 0x0C /* Timing 0 Register */
55#define AT91_DDRSDRC_TRAS (0xf << 0) /* Active to Precharge delay */
56#define AT91_DDRSDRC_TRCD (0xf << 4) /* Row to Column delay */
57#define AT91_DDRSDRC_TWR (0xf << 8) /* Write recovery delay */
58#define AT91_DDRSDRC_TRC (0xf << 12) /* Row cycle delay */
59#define AT91_DDRSDRC_TRP (0xf << 16) /* Row precharge delay */
60#define AT91_DDRSDRC_TRRD (0xf << 20) /* Active BankA to BankB */
61#define AT91_DDRSDRC_TWTR (0x7 << 24) /* Internal Write to Read delay */
62#define AT91_DDRSDRC_RED_WRRD (0x1 << 27) /* Reduce Write to Read Delay */
63#define AT91_DDRSDRC_TMRD (0xf << 28) /* Load mode to active/refresh delay */
64
65#define AT91_DDRSDRC_T1PR 0x10 /* Timing 1 Register */
66#define AT91_DDRSDRC_TRFC (0x1f << 0) /* Row Cycle Delay */
67#define AT91_DDRSDRC_TXSNR (0xff << 8) /* Exit self-refresh to non-read */
68#define AT91_DDRSDRC_TXSRD (0xff << 16) /* Exit self-refresh to read */
69#define AT91_DDRSDRC_TXP (0xf << 24) /* Exit power-down delay */
70
71#define AT91_DDRSDRC_T2PR 0x14 /* Timing 2 Register */
72#define AT91_DDRSDRC_TXARD (0xf << 0) /* Exit active power down delay to read command in mode "Fast Exit" */
73#define AT91_DDRSDRC_TXARDS (0xf << 4) /* Exit active power down delay to read command in mode "Slow Exit" */
74#define AT91_DDRSDRC_TRPA (0xf << 8) /* Row Precharge All delay */
75#define AT91_DDRSDRC_TRTP (0x7 << 12) /* Read to Precharge delay */
76
77#define AT91_DDRSDRC_LPR 0x1C /* Low Power Register */
78#define AT91_DDRSDRC_LPCB (3 << 0) /* Low-power Configurations */
79#define AT91_DDRSDRC_LPCB_DISABLE 0
80#define AT91_DDRSDRC_LPCB_SELF_REFRESH 1
81#define AT91_DDRSDRC_LPCB_POWER_DOWN 2
82#define AT91_DDRSDRC_LPCB_DEEP_POWER_DOWN 3
83#define AT91_DDRSDRC_CLKFR (1 << 2) /* Clock Frozen */
84#define AT91_DDRSDRC_PASR (7 << 4) /* Partial Array Self Refresh */
85#define AT91_DDRSDRC_TCSR (3 << 8) /* Temperature Compensated Self Refresh */
86#define AT91_DDRSDRC_DS (3 << 10) /* Drive Strength */
87#define AT91_DDRSDRC_TIMEOUT (3 << 12) /* Time to define when Low Power Mode is enabled */
88#define AT91_DDRSDRC_TIMEOUT_0_CLK_CYCLES (0 << 12)
89#define AT91_DDRSDRC_TIMEOUT_64_CLK_CYCLES (1 << 12)
90#define AT91_DDRSDRC_TIMEOUT_128_CLK_CYCLES (2 << 12)
91#define AT91_DDRSDRC_APDE (1 << 16) /* Active power down exit time */
92#define AT91_DDRSDRC_UPD_MR (3 << 20) /* Update load mode register and extended mode register */
93
94#define AT91_DDRSDRC_MDR 0x20 /* Memory Device Register */
95#define AT91_DDRSDRC_MD (3 << 0) /* Memory Device Type */
96#define AT91_DDRSDRC_MD_SDR 0
97#define AT91_DDRSDRC_MD_LOW_POWER_SDR 1
98#define AT91_DDRSDRC_MD_LOW_POWER_DDR 3
99#define AT91_DDRSDRC_MD_DDR2 6
100#define AT91_DDRSDRC_DBW (1 << 4) /* Data Bus Width */
101#define AT91_DDRSDRC_DBW_32BITS (0 << 4)
102#define AT91_DDRSDRC_DBW_16BITS (1 << 4)
103
104#define AT91_DDRSDRC_DLL 0x24 /* DLL Information Register */
105#define AT91_DDRSDRC_MDINC (1 << 0) /* Master Delay increment */
106#define AT91_DDRSDRC_MDDEC (1 << 1) /* Master Delay decrement */
107#define AT91_DDRSDRC_MDOVF (1 << 2) /* Master Delay Overflow */
108#define AT91_DDRSDRC_MDVAL (0xff << 8) /* Master Delay value */
109
110#define AT91_DDRSDRC_HS 0x2C /* High Speed Register */
111#define AT91_DDRSDRC_DIS_ATCP_RD (1 << 2) /* Anticip read access is disabled */
112
113#define AT91_DDRSDRC_DELAY(n) (0x30 + (0x4 * (n))) /* Delay I/O Register n */
114
115#define AT91_DDRSDRC_WPMR 0xE4 /* Write Protect Mode Register */
116#define AT91_DDRSDRC_WP (1 << 0) /* Write protect enable */
117#define AT91_DDRSDRC_WPKEY (0xffffff << 8) /* Write protect key */
118#define AT91_DDRSDRC_KEY (0x444452 << 8) /* Write protect key = "DDR" */
119
120#define AT91_DDRSDRC_WPSR 0xE8 /* Write Protect Status Register */
121#define AT91_DDRSDRC_WPVS (1 << 0) /* Write protect violation status */
122#define AT91_DDRSDRC_WPVSRC (0xffff << 8) /* Write protect violation source */
123
124/* Register access macros */
125#define at91_ramc_read(num, reg) \
126 at91_sys_read(AT91_DDRSDRC##num + reg)
127#define at91_ramc_write(num, reg, value) \
128 at91_sys_write(AT91_DDRSDRC##num + reg, value)
129
130#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h b/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
index b7260389f7ca..100f5a592926 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
@@ -17,7 +17,7 @@
17#define AT91SAM9_SDRAMC_H 17#define AT91SAM9_SDRAMC_H
18 18
19/* SDRAM Controller (SDRAMC) registers */ 19/* SDRAM Controller (SDRAMC) registers */
20#define AT91_SDRAMC_MR (AT91_SDRAMC + 0x00) /* SDRAM Controller Mode Register */ 20#define AT91_SDRAMC_MR 0x00 /* SDRAM Controller Mode Register */
21#define AT91_SDRAMC_MODE (0xf << 0) /* Command Mode */ 21#define AT91_SDRAMC_MODE (0xf << 0) /* Command Mode */
22#define AT91_SDRAMC_MODE_NORMAL 0 22#define AT91_SDRAMC_MODE_NORMAL 0
23#define AT91_SDRAMC_MODE_NOP 1 23#define AT91_SDRAMC_MODE_NOP 1
@@ -27,10 +27,10 @@
27#define AT91_SDRAMC_MODE_EXT_LMR 5 27#define AT91_SDRAMC_MODE_EXT_LMR 5
28#define AT91_SDRAMC_MODE_DEEP 6 28#define AT91_SDRAMC_MODE_DEEP 6
29 29
30#define AT91_SDRAMC_TR (AT91_SDRAMC + 0x04) /* SDRAM Controller Refresh Timer Register */ 30#define AT91_SDRAMC_TR 0x04 /* SDRAM Controller Refresh Timer Register */
31#define AT91_SDRAMC_COUNT (0xfff << 0) /* Refresh Timer Counter */ 31#define AT91_SDRAMC_COUNT (0xfff << 0) /* Refresh Timer Counter */
32 32
33#define AT91_SDRAMC_CR (AT91_SDRAMC + 0x08) /* SDRAM Controller Configuration Register */ 33#define AT91_SDRAMC_CR 0x08 /* SDRAM Controller Configuration Register */
34#define AT91_SDRAMC_NC (3 << 0) /* Number of Column Bits */ 34#define AT91_SDRAMC_NC (3 << 0) /* Number of Column Bits */
35#define AT91_SDRAMC_NC_8 (0 << 0) 35#define AT91_SDRAMC_NC_8 (0 << 0)
36#define AT91_SDRAMC_NC_9 (1 << 0) 36#define AT91_SDRAMC_NC_9 (1 << 0)
@@ -57,7 +57,7 @@
57#define AT91_SDRAMC_TRAS (0xf << 24) /* Active to Precharge Delay */ 57#define AT91_SDRAMC_TRAS (0xf << 24) /* Active to Precharge Delay */
58#define AT91_SDRAMC_TXSR (0xf << 28) /* Exit Self Refresh to Active Delay */ 58#define AT91_SDRAMC_TXSR (0xf << 28) /* Exit Self Refresh to Active Delay */
59 59
60#define AT91_SDRAMC_LPR (AT91_SDRAMC + 0x10) /* SDRAM Controller Low Power Register */ 60#define AT91_SDRAMC_LPR 0x10 /* SDRAM Controller Low Power Register */
61#define AT91_SDRAMC_LPCB (3 << 0) /* Low-power Configurations */ 61#define AT91_SDRAMC_LPCB (3 << 0) /* Low-power Configurations */
62#define AT91_SDRAMC_LPCB_DISABLE 0 62#define AT91_SDRAMC_LPCB_DISABLE 0
63#define AT91_SDRAMC_LPCB_SELF_REFRESH 1 63#define AT91_SDRAMC_LPCB_SELF_REFRESH 1
@@ -71,16 +71,21 @@
71#define AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES (1 << 12) 71#define AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES (1 << 12)
72#define AT91_SDRAMC_TIMEOUT_128_CLK_CYCLES (2 << 12) 72#define AT91_SDRAMC_TIMEOUT_128_CLK_CYCLES (2 << 12)
73 73
74#define AT91_SDRAMC_IER (AT91_SDRAMC + 0x14) /* SDRAM Controller Interrupt Enable Register */ 74#define AT91_SDRAMC_IER 0x14 /* SDRAM Controller Interrupt Enable Register */
75#define AT91_SDRAMC_IDR (AT91_SDRAMC + 0x18) /* SDRAM Controller Interrupt Disable Register */ 75#define AT91_SDRAMC_IDR 0x18 /* SDRAM Controller Interrupt Disable Register */
76#define AT91_SDRAMC_IMR (AT91_SDRAMC + 0x1C) /* SDRAM Controller Interrupt Mask Register */ 76#define AT91_SDRAMC_IMR 0x1C /* SDRAM Controller Interrupt Mask Register */
77#define AT91_SDRAMC_ISR (AT91_SDRAMC + 0x20) /* SDRAM Controller Interrupt Status Register */ 77#define AT91_SDRAMC_ISR 0x20 /* SDRAM Controller Interrupt Status Register */
78#define AT91_SDRAMC_RES (1 << 0) /* Refresh Error Status */ 78#define AT91_SDRAMC_RES (1 << 0) /* Refresh Error Status */
79 79
80#define AT91_SDRAMC_MDR (AT91_SDRAMC + 0x24) /* SDRAM Memory Device Register */ 80#define AT91_SDRAMC_MDR 0x24 /* SDRAM Memory Device Register */
81#define AT91_SDRAMC_MD (3 << 0) /* Memory Device Type */ 81#define AT91_SDRAMC_MD (3 << 0) /* Memory Device Type */
82#define AT91_SDRAMC_MD_SDRAM 0 82#define AT91_SDRAMC_MD_SDRAM 0
83#define AT91_SDRAMC_MD_LOW_POWER_SDRAM 1 83#define AT91_SDRAMC_MD_LOW_POWER_SDRAM 1
84 84
85/* Register access macros */
86#define at91_ramc_read(num, reg) \
87 at91_sys_read(AT91_SDRAMC##num + reg)
88#define at91_ramc_write(num, reg, value) \
89 at91_sys_write(AT91_SDRAMC##num + reg, value)
85 90
86#endif 91#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9rl.h b/arch/arm/mach-at91/include/mach/at91sam9rl.h
index fc2de6c09c86..87ba8517ad98 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9rl.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9rl.h
@@ -74,7 +74,7 @@
74 */ 74 */
75#define AT91_DMA (0xffffe600 - AT91_BASE_SYS) 75#define AT91_DMA (0xffffe600 - AT91_BASE_SYS)
76#define AT91_ECC (0xffffe800 - AT91_BASE_SYS) 76#define AT91_ECC (0xffffe800 - AT91_BASE_SYS)
77#define AT91_SDRAMC (0xffffea00 - AT91_BASE_SYS) 77#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS)
78#define AT91_SMC (0xffffec00 - AT91_BASE_SYS) 78#define AT91_SMC (0xffffec00 - AT91_BASE_SYS)
79#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 79#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)
80#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS) 80#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS)
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index df2ed848c9f8..58528aa9c8a8 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -44,6 +44,8 @@
44 /* USB Device */ 44 /* USB Device */
45struct at91_udc_data { 45struct at91_udc_data {
46 u8 vbus_pin; /* high == host powering us */ 46 u8 vbus_pin; /* high == host powering us */
47 u8 vbus_active_low; /* vbus polarity */
48 u8 vbus_polled; /* Use polling, not interrupt */
47 u8 pullup_pin; /* active == D+ pulled up */ 49 u8 pullup_pin; /* active == D+ pulled up */
48 u8 pullup_active_low; /* true == pullup_pin is active low */ 50 u8 pullup_active_low; /* true == pullup_pin is active low */
49}; 51};
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 833659d1200a..3bef931d0b1c 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -52,6 +52,7 @@ static inline unsigned long at91_cpu_fully_identify(void)
52 52
53#define ARCH_EXID_AT91SAM9M11 0x00000001 53#define ARCH_EXID_AT91SAM9M11 0x00000001
54#define ARCH_EXID_AT91SAM9M10 0x00000002 54#define ARCH_EXID_AT91SAM9M10 0x00000002
55#define ARCH_EXID_AT91SAM9G46 0x00000003
55#define ARCH_EXID_AT91SAM9G45 0x00000004 56#define ARCH_EXID_AT91SAM9G45 0x00000004
56 57
57static inline unsigned long at91_exid_identify(void) 58static inline unsigned long at91_exid_identify(void)
@@ -128,9 +129,18 @@ static inline unsigned long at91cap9_rev_identify(void)
128#ifdef CONFIG_ARCH_AT91SAM9G45 129#ifdef CONFIG_ARCH_AT91SAM9G45
129#define cpu_is_at91sam9g45() (at91_cpu_identify() == ARCH_ID_AT91SAM9G45) 130#define cpu_is_at91sam9g45() (at91_cpu_identify() == ARCH_ID_AT91SAM9G45)
130#define cpu_is_at91sam9g45es() (at91_cpu_fully_identify() == ARCH_ID_AT91SAM9G45ES) 131#define cpu_is_at91sam9g45es() (at91_cpu_fully_identify() == ARCH_ID_AT91SAM9G45ES)
132#define cpu_is_at91sam9m10() (cpu_is_at91sam9g45() && \
133 (at91_exid_identify() == ARCH_EXID_AT91SAM9M10))
134#define cpu_is_at91sam9m46() (cpu_is_at91sam9g45() && \
135 (at91_exid_identify() == ARCH_EXID_AT91SAM9G46))
136#define cpu_is_at91sam9m11() (cpu_is_at91sam9g45() && \
137 (at91_exid_identify() == ARCH_EXID_AT91SAM9M11))
131#else 138#else
132#define cpu_is_at91sam9g45() (0) 139#define cpu_is_at91sam9g45() (0)
133#define cpu_is_at91sam9g45es() (0) 140#define cpu_is_at91sam9g45es() (0)
141#define cpu_is_at91sam9m10() (0)
142#define cpu_is_at91sam9g46() (0)
143#define cpu_is_at91sam9m11() (0)
134#endif 144#endif
135 145
136#ifdef CONFIG_ARCH_AT91CAP9 146#ifdef CONFIG_ARCH_AT91CAP9
diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h
index 04c91e31c9c5..bfdd8ab26dc8 100644
--- a/arch/arm/mach-at91/include/mach/gpio.h
+++ b/arch/arm/mach-at91/include/mach/gpio.h
@@ -19,6 +19,7 @@
19#define PIN_BASE NR_AIC_IRQS 19#define PIN_BASE NR_AIC_IRQS
20 20
21#define MAX_GPIO_BANKS 5 21#define MAX_GPIO_BANKS 5
22#define NR_BUILTIN_GPIO (PIN_BASE + (MAX_GPIO_BANKS * 32))
22 23
23/* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */ 24/* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */
24 25
diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h
index 08322c44df1a..8c87d0c1b8f8 100644
--- a/arch/arm/mach-at91/pm.h
+++ b/arch/arm/mach-at91/pm.h
@@ -30,14 +30,50 @@ static inline u32 sdram_selfrefresh_enable(void)
30{ 30{
31 u32 saved_lpr, lpr; 31 u32 saved_lpr, lpr;
32 32
33 saved_lpr = at91_sys_read(AT91_DDRSDRC_LPR); 33 saved_lpr = at91_ramc_read(0, AT91_DDRSDRC_LPR);
34 34
35 lpr = saved_lpr & ~AT91_DDRSDRC_LPCB; 35 lpr = saved_lpr & ~AT91_DDRSDRC_LPCB;
36 at91_sys_write(AT91_DDRSDRC_LPR, lpr | AT91_DDRSDRC_LPCB_SELF_REFRESH); 36 at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr | AT91_DDRSDRC_LPCB_SELF_REFRESH);
37 return saved_lpr; 37 return saved_lpr;
38} 38}
39 39
40#define sdram_selfrefresh_disable(saved_lpr) at91_sys_write(AT91_DDRSDRC_LPR, saved_lpr) 40#define sdram_selfrefresh_disable(saved_lpr) at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr)
41
42#elif defined(CONFIG_ARCH_AT91SAM9G45)
43#include <mach/at91sam9_ddrsdr.h>
44
45/* We manage both DDRAM/SDRAM controllers, we need more than one value to
46 * remember.
47 */
48static u32 saved_lpr1;
49
50static inline u32 sdram_selfrefresh_enable(void)
51{
52 /* Those tow values allow us to delay self-refresh activation
53 * to the maximum. */
54 u32 lpr0, lpr1;
55 u32 saved_lpr0;
56
57 saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR);
58 lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB;
59 lpr1 |= AT91_DDRSDRC_LPCB_SELF_REFRESH;
60
61 saved_lpr0 = at91_ramc_read(0, AT91_DDRSDRC_LPR);
62 lpr0 = saved_lpr0 & ~AT91_DDRSDRC_LPCB;
63 lpr0 |= AT91_DDRSDRC_LPCB_SELF_REFRESH;
64
65 /* self-refresh mode now */
66 at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0);
67 at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1);
68
69 return saved_lpr0;
70}
71
72#define sdram_selfrefresh_disable(saved_lpr0) \
73 do { \
74 at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); \
75 at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); \
76 } while (0)
41 77
42#else 78#else
43#include <mach/at91sam9_sdramc.h> 79#include <mach/at91sam9_sdramc.h>
@@ -47,7 +83,6 @@ static inline u32 sdram_selfrefresh_enable(void)
47 * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use; 83 * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
48 * handle those cases both here and in the Suspend-To-RAM support. 84 * handle those cases both here and in the Suspend-To-RAM support.
49 */ 85 */
50#define AT91_SDRAMC AT91_SDRAMC0
51#warning Assuming EB1 SDRAM controller is *NOT* used 86#warning Assuming EB1 SDRAM controller is *NOT* used
52#endif 87#endif
53 88
@@ -55,13 +90,13 @@ static inline u32 sdram_selfrefresh_enable(void)
55{ 90{
56 u32 saved_lpr, lpr; 91 u32 saved_lpr, lpr;
57 92
58 saved_lpr = at91_sys_read(AT91_SDRAMC_LPR); 93 saved_lpr = at91_ramc_read(0, AT91_SDRAMC_LPR);
59 94
60 lpr = saved_lpr & ~AT91_SDRAMC_LPCB; 95 lpr = saved_lpr & ~AT91_SDRAMC_LPCB;
61 at91_sys_write(AT91_SDRAMC_LPR, lpr | AT91_SDRAMC_LPCB_SELF_REFRESH); 96 at91_ramc_write(0, AT91_SDRAMC_LPR, lpr | AT91_SDRAMC_LPCB_SELF_REFRESH);
62 return saved_lpr; 97 return saved_lpr;
63} 98}
64 99
65#define sdram_selfrefresh_disable(saved_lpr) at91_sys_write(AT91_SDRAMC_LPR, saved_lpr) 100#define sdram_selfrefresh_disable(saved_lpr) at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr)
66 101
67#endif 102#endif
diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S
index 9c5b48e68a71..b6b00a1f6125 100644
--- a/arch/arm/mach-at91/pm_slowclock.S
+++ b/arch/arm/mach-at91/pm_slowclock.S
@@ -16,10 +16,12 @@
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17#include <mach/at91_pmc.h> 17#include <mach/at91_pmc.h>
18 18
19#ifdef CONFIG_ARCH_AT91RM9200 19#if defined(CONFIG_ARCH_AT91RM9200)
20#include <mach/at91rm9200_mc.h> 20#include <mach/at91rm9200_mc.h>
21#elif defined(CONFIG_ARCH_AT91CAP9) 21#elif defined(CONFIG_ARCH_AT91CAP9)
22#include <mach/at91cap9_ddrsdr.h> 22#include <mach/at91cap9_ddrsdr.h>
23#elif defined(CONFIG_ARCH_AT91SAM9G45)
24#include <mach/at91sam9_ddrsdr.h>
23#else 25#else
24#include <mach/at91sam9_sdramc.h> 26#include <mach/at91sam9_sdramc.h>
25#endif 27#endif
@@ -30,7 +32,6 @@
30 * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use; 32 * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
31 * handle those cases both here and in the Suspend-To-RAM support. 33 * handle those cases both here and in the Suspend-To-RAM support.
32 */ 34 */
33#define AT91_SDRAMC AT91_SDRAMC0
34#warning Assuming EB1 SDRAM controller is *NOT* used 35#warning Assuming EB1 SDRAM controller is *NOT* used
35#endif 36#endif
36 37
@@ -113,12 +114,14 @@ ENTRY(at91_slow_clock)
113 /* 114 /*
114 * Register usage: 115 * Register usage:
115 * R1 = Base address of AT91_PMC 116 * R1 = Base address of AT91_PMC
116 * R2 = Base address of AT91_SDRAMC (or AT91_SYS on AT91RM9200) 117 * R2 = Base address of RAM Controller (SDRAM, DDRSDR, or AT91_SYS)
117 * R3 = temporary register 118 * R3 = temporary register
118 * R4 = temporary register 119 * R4 = temporary register
120 * R5 = Base address of second RAM Controller or 0 if not present
119 */ 121 */
120 ldr r1, .at91_va_base_pmc 122 ldr r1, .at91_va_base_pmc
121 ldr r2, .at91_va_base_sdramc 123 ldr r2, .at91_va_base_sdramc
124 ldr r5, .at91_va_base_ramc1
122 125
123 /* Drain write buffer */ 126 /* Drain write buffer */
124 mcr p15, 0, r0, c7, c10, 4 127 mcr p15, 0, r0, c7, c10, 4
@@ -127,20 +130,33 @@ ENTRY(at91_slow_clock)
127 /* Put SDRAM in self-refresh mode */ 130 /* Put SDRAM in self-refresh mode */
128 mov r3, #1 131 mov r3, #1
129 str r3, [r2, #AT91_SDRAMC_SRR] 132 str r3, [r2, #AT91_SDRAMC_SRR]
130#elif defined(CONFIG_ARCH_AT91CAP9) 133#elif defined(CONFIG_ARCH_AT91CAP9) \
131 /* Enable SDRAM self-refresh mode */ 134 || defined(CONFIG_ARCH_AT91SAM9G45)
132 ldr r3, [r2, #AT91_DDRSDRC_LPR - AT91_DDRSDRC]
133 str r3, .saved_sam9_lpr
134 135
135 mov r3, #AT91_DDRSDRC_LPCB_SELF_REFRESH 136 /* prepare for DDRAM self-refresh mode */
136 str r3, [r2, #AT91_DDRSDRC_LPR - AT91_DDRSDRC] 137 ldr r3, [r2, #AT91_DDRSDRC_LPR]
138 str r3, .saved_sam9_lpr
139 bic r3, #AT91_DDRSDRC_LPCB
140 orr r3, #AT91_DDRSDRC_LPCB_SELF_REFRESH
141
142 /* figure out if we use the second ram controller */
143 cmp r5, #0
144 ldrne r4, [r5, #AT91_DDRSDRC_LPR]
145 strne r4, .saved_sam9_lpr1
146 bicne r4, #AT91_DDRSDRC_LPCB
147 orrne r4, #AT91_DDRSDRC_LPCB_SELF_REFRESH
148
149 /* Enable DDRAM self-refresh mode */
150 str r3, [r2, #AT91_DDRSDRC_LPR]
151 strne r4, [r5, #AT91_DDRSDRC_LPR]
137#else 152#else
138 /* Enable SDRAM self-refresh mode */ 153 /* Enable SDRAM self-refresh mode */
139 ldr r3, [r2, #AT91_SDRAMC_LPR - AT91_SDRAMC] 154 ldr r3, [r2, #AT91_SDRAMC_LPR]
140 str r3, .saved_sam9_lpr 155 str r3, .saved_sam9_lpr
141 156
142 mov r3, #AT91_SDRAMC_LPCB_SELF_REFRESH 157 bic r3, #AT91_SDRAMC_LPCB
143 str r3, [r2, #AT91_SDRAMC_LPR - AT91_SDRAMC] 158 orr r3, #AT91_SDRAMC_LPCB_SELF_REFRESH
159 str r3, [r2, #AT91_SDRAMC_LPR]
144#endif 160#endif
145 161
146 /* Save Master clock setting */ 162 /* Save Master clock setting */
@@ -247,14 +263,21 @@ ENTRY(at91_slow_clock)
247 263
248#ifdef CONFIG_ARCH_AT91RM9200 264#ifdef CONFIG_ARCH_AT91RM9200
249 /* Do nothing - self-refresh is automatically disabled. */ 265 /* Do nothing - self-refresh is automatically disabled. */
250#elif defined(CONFIG_ARCH_AT91CAP9) 266#elif defined(CONFIG_ARCH_AT91CAP9) \
251 /* Restore LPR on AT91CAP9 */ 267 || defined(CONFIG_ARCH_AT91SAM9G45)
268 /* Restore LPR on AT91 with DDRAM */
252 ldr r3, .saved_sam9_lpr 269 ldr r3, .saved_sam9_lpr
253 str r3, [r2, #AT91_DDRSDRC_LPR - AT91_DDRSDRC] 270 str r3, [r2, #AT91_DDRSDRC_LPR]
271
272 /* if we use the second ram controller */
273 cmp r5, #0
274 ldrne r4, .saved_sam9_lpr1
275 strne r4, [r5, #AT91_DDRSDRC_LPR]
276
254#else 277#else
255 /* Restore LPR on AT91SAM9 */ 278 /* Restore LPR on AT91 with SDRAM */
256 ldr r3, .saved_sam9_lpr 279 ldr r3, .saved_sam9_lpr
257 str r3, [r2, #AT91_SDRAMC_LPR - AT91_SDRAMC] 280 str r3, [r2, #AT91_SDRAMC_LPR]
258#endif 281#endif
259 282
260 /* Restore registers, and return */ 283 /* Restore registers, and return */
@@ -273,18 +296,29 @@ ENTRY(at91_slow_clock)
273.saved_sam9_lpr: 296.saved_sam9_lpr:
274 .word 0 297 .word 0
275 298
299.saved_sam9_lpr1:
300 .word 0
301
276.at91_va_base_pmc: 302.at91_va_base_pmc:
277 .word AT91_VA_BASE_SYS + AT91_PMC 303 .word AT91_VA_BASE_SYS + AT91_PMC
278 304
279#ifdef CONFIG_ARCH_AT91RM9200 305#ifdef CONFIG_ARCH_AT91RM9200
280.at91_va_base_sdramc: 306.at91_va_base_sdramc:
281 .word AT91_VA_BASE_SYS 307 .word AT91_VA_BASE_SYS
282#elif defined(CONFIG_ARCH_AT91CAP9) 308#elif defined(CONFIG_ARCH_AT91CAP9) \
309 || defined(CONFIG_ARCH_AT91SAM9G45)
283.at91_va_base_sdramc: 310.at91_va_base_sdramc:
284 .word AT91_VA_BASE_SYS + AT91_DDRSDRC 311 .word AT91_VA_BASE_SYS + AT91_DDRSDRC0
285#else 312#else
286.at91_va_base_sdramc: 313.at91_va_base_sdramc:
287 .word AT91_VA_BASE_SYS + AT91_SDRAMC 314 .word AT91_VA_BASE_SYS + AT91_SDRAMC0
315#endif
316
317.at91_va_base_ramc1:
318#if defined(CONFIG_ARCH_AT91SAM9G45)
319 .word AT91_VA_BASE_SYS + AT91_DDRSDRC1
320#else
321 .word 0
288#endif 322#endif
289 323
290ENTRY(at91_slow_clock_sz) 324ENTRY(at91_slow_clock_sz)
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index dbaae5f746a1..eb34bd1251d4 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -30,7 +30,6 @@ config ARCH_CLEP7312
30config ARCH_EDB7211 30config ARCH_EDB7211
31 bool "EDB7211" 31 bool "EDB7211"
32 select ISA 32 select ISA
33 select ARCH_DISCONTIGMEM_ENABLE
34 select ARCH_SPARSEMEM_ENABLE 33 select ARCH_SPARSEMEM_ENABLE
35 select ARCH_SELECT_MEMORY_MODEL 34 select ARCH_SELECT_MEMORY_MODEL
36 help 35 help
diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c
index 09fb57e45213..3c3bf45039ff 100644
--- a/arch/arm/mach-clps711x/clep7312.c
+++ b/arch/arm/mach-clps711x/clep7312.c
@@ -32,7 +32,6 @@ fixup_clep7312(struct machine_desc *desc, struct tag *tags,
32 mi->nr_banks=1; 32 mi->nr_banks=1;
33 mi->bank[0].start = 0xc0000000; 33 mi->bank[0].start = 0xc0000000;
34 mi->bank[0].size = 0x01000000; 34 mi->bank[0].size = 0x01000000;
35 mi->bank[0].node = 0;
36} 35}
37 36
38 37
diff --git a/arch/arm/mach-clps711x/edb7211-arch.c b/arch/arm/mach-clps711x/edb7211-arch.c
index dc81cc68595d..4a7a2322979a 100644
--- a/arch/arm/mach-clps711x/edb7211-arch.c
+++ b/arch/arm/mach-clps711x/edb7211-arch.c
@@ -18,6 +18,7 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/memblock.h>
21#include <linux/types.h> 22#include <linux/types.h>
22#include <linux/string.h> 23#include <linux/string.h>
23 24
@@ -29,6 +30,12 @@
29 30
30extern void edb7211_map_io(void); 31extern void edb7211_map_io(void);
31 32
33/* Reserve screen memory region at the start of main system memory. */
34static void __init edb7211_reserve(void)
35{
36 memblock_reserve(PHYS_OFFSET, 0x00020000);
37}
38
32static void __init 39static void __init
33fixup_edb7211(struct machine_desc *desc, struct tag *tags, 40fixup_edb7211(struct machine_desc *desc, struct tag *tags,
34 char **cmdline, struct meminfo *mi) 41 char **cmdline, struct meminfo *mi)
@@ -43,10 +50,8 @@ fixup_edb7211(struct machine_desc *desc, struct tag *tags,
43 */ 50 */
44 mi->bank[0].start = 0xc0000000; 51 mi->bank[0].start = 0xc0000000;
45 mi->bank[0].size = 8*1024*1024; 52 mi->bank[0].size = 8*1024*1024;
46 mi->bank[0].node = 0;
47 mi->bank[1].start = 0xc1000000; 53 mi->bank[1].start = 0xc1000000;
48 mi->bank[1].size = 8*1024*1024; 54 mi->bank[1].size = 8*1024*1024;
49 mi->bank[1].node = 1;
50 mi->nr_banks = 2; 55 mi->nr_banks = 2;
51} 56}
52 57
@@ -57,6 +62,7 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
57 .boot_params = 0xc0020100, /* 0xc0000000 - 0xc001ffff can be video RAM */ 62 .boot_params = 0xc0020100, /* 0xc0000000 - 0xc001ffff can be video RAM */
58 .fixup = fixup_edb7211, 63 .fixup = fixup_edb7211,
59 .map_io = edb7211_map_io, 64 .map_io = edb7211_map_io,
65 .reserve = edb7211_reserve,
60 .init_irq = clps711x_init_irq, 66 .init_irq = clps711x_init_irq,
61 .timer = &clps711x_timer, 67 .timer = &clps711x_timer,
62MACHINE_END 68MACHINE_END
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
index 7430e4049d87..a696099aa4f8 100644
--- a/arch/arm/mach-clps711x/fortunet.c
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -39,7 +39,6 @@ struct meminfo memmap = {
39 { 39 {
40 .start = 0xC0000000, 40 .start = 0xC0000000,
41 .size = 0x01000000, 41 .size = 0x01000000,
42 .node = 0
43 }, 42 },
44 }, 43 },
45}; 44};
diff --git a/arch/arm/mach-clps711x/include/mach/debug-macro.S b/arch/arm/mach-clps711x/include/mach/debug-macro.S
index fedd8076a689..072cc6b61ba3 100644
--- a/arch/arm/mach-clps711x/include/mach/debug-macro.S
+++ b/arch/arm/mach-clps711x/include/mach/debug-macro.S
@@ -11,6 +11,7 @@
11 * 11 *
12*/ 12*/
13 13
14#include <mach/hardware.h>
14#include <asm/hardware/clps7111.h> 15#include <asm/hardware/clps7111.h>
15 16
16 .macro addruart, rx, tmp 17 .macro addruart, rx, tmp
diff --git a/arch/arm/mach-clps711x/include/mach/memory.h b/arch/arm/mach-clps711x/include/mach/memory.h
index f70d52be48a2..f45c8e892cb5 100644
--- a/arch/arm/mach-clps711x/include/mach/memory.h
+++ b/arch/arm/mach-clps711x/include/mach/memory.h
@@ -20,7 +20,6 @@
20#ifndef __ASM_ARCH_MEMORY_H 20#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H 21#define __ASM_ARCH_MEMORY_H
22 22
23
24/* 23/*
25 * Physical DRAM offset. 24 * Physical DRAM offset.
26 */ 25 */
@@ -72,7 +71,6 @@
72 * node 2: 0xd0000000 - 0xd7ffffff 71 * node 2: 0xd0000000 - 0xd7ffffff
73 * node 3: 0xd8000000 - 0xdfffffff 72 * node 3: 0xd8000000 - 0xdfffffff
74 */ 73 */
75#define NODE_MEM_SIZE_BITS 24
76#define SECTION_SIZE_BITS 24 74#define SECTION_SIZE_BITS 24
77#define MAX_PHYSMEM_BITS 32 75#define MAX_PHYSMEM_BITS 32
78 76
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 2ec3095ffb7b..b280efb1fa12 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -25,6 +25,7 @@
25#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
26#include <linux/mtd/physmap.h> 26#include <linux/mtd/physmap.h>
27#include <linux/regulator/machine.h> 27#include <linux/regulator/machine.h>
28#include <linux/regulator/tps6507x.h>
28#include <linux/mfd/tps6507x.h> 29#include <linux/mfd/tps6507x.h>
29#include <linux/input/tps6507x-ts.h> 30#include <linux/input/tps6507x-ts.h>
30 31
@@ -469,6 +470,11 @@ struct regulator_consumer_supply tps65070_ldo2_consumers[] = {
469 }, 470 },
470}; 471};
471 472
473/* We take advantage of the fact that both defdcdc{2,3} are tied high */
474static struct tps6507x_reg_platform_data tps6507x_platform_data = {
475 .defdcdc_default = true,
476};
477
472struct regulator_init_data tps65070_regulator_data[] = { 478struct regulator_init_data tps65070_regulator_data[] = {
473 /* dcdc1 */ 479 /* dcdc1 */
474 { 480 {
@@ -494,6 +500,7 @@ struct regulator_init_data tps65070_regulator_data[] = {
494 }, 500 },
495 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers), 501 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers),
496 .consumer_supplies = tps65070_dcdc2_consumers, 502 .consumer_supplies = tps65070_dcdc2_consumers,
503 .driver_data = &tps6507x_platform_data,
497 }, 504 },
498 505
499 /* dcdc3 */ 506 /* dcdc3 */
@@ -507,6 +514,7 @@ struct regulator_init_data tps65070_regulator_data[] = {
507 }, 514 },
508 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers), 515 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers),
509 .consumer_supplies = tps65070_dcdc3_consumers, 516 .consumer_supplies = tps65070_dcdc3_consumers,
517 .driver_data = &tps6507x_platform_data,
510 }, 518 },
511 519
512 /* ldo1 */ 520 /* ldo1 */
diff --git a/arch/arm/mach-davinci/include/mach/memory.h b/arch/arm/mach-davinci/include/mach/memory.h
index a91edfb8beea..22eb97c1c30b 100644
--- a/arch/arm/mach-davinci/include/mach/memory.h
+++ b/arch/arm/mach-davinci/include/mach/memory.h
@@ -48,19 +48,16 @@
48 * below 128M 48 * below 128M
49 */ 49 */
50static inline void 50static inline void
51__arch_adjust_zones(int node, unsigned long *size, unsigned long *holes) 51__arch_adjust_zones(unsigned long *size, unsigned long *holes)
52{ 52{
53 unsigned int sz = (128<<20) >> PAGE_SHIFT; 53 unsigned int sz = (128<<20) >> PAGE_SHIFT;
54 54
55 if (node != 0)
56 sz = 0;
57
58 size[1] = size[0] - sz; 55 size[1] = size[0] - sz;
59 size[0] = sz; 56 size[0] = sz;
60} 57}
61 58
62#define arch_adjust_zones(node, zone_size, holes) \ 59#define arch_adjust_zones(zone_size, holes) \
63 if ((meminfo.bank[0].size >> 20) > 128) __arch_adjust_zones(node, zone_size, holes) 60 if ((meminfo.bank[0].size >> 20) > 128) __arch_adjust_zones(zone_size, holes)
64 61
65#define ISA_DMA_THRESHOLD (PHYS_OFFSET + (128<<20) - 1) 62#define ISA_DMA_THRESHOLD (PHYS_OFFSET + (128<<20) - 1)
66#define MAX_DMA_ADDRESS (PAGE_OFFSET + (128<<20)) 63#define MAX_DMA_ADDRESS (PAGE_OFFSET + (128<<20))
diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c
index 3a1a855bfdca..f744f676783f 100644
--- a/arch/arm/mach-ep93xx/adssphere.c
+++ b/arch/arm/mach-ep93xx/adssphere.c
@@ -13,7 +13,6 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/mtd/physmap.h>
17 16
18#include <mach/hardware.h> 17#include <mach/hardware.h>
19 18
@@ -21,26 +20,6 @@
21#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
22 21
23 22
24static struct physmap_flash_data adssphere_flash_data = {
25 .width = 4,
26};
27
28static struct resource adssphere_flash_resource = {
29 .start = EP93XX_CS6_PHYS_BASE,
30 .end = EP93XX_CS6_PHYS_BASE + SZ_32M - 1,
31 .flags = IORESOURCE_MEM,
32};
33
34static struct platform_device adssphere_flash = {
35 .name = "physmap-flash",
36 .id = 0,
37 .dev = {
38 .platform_data = &adssphere_flash_data,
39 },
40 .num_resources = 1,
41 .resource = &adssphere_flash_resource,
42};
43
44static struct ep93xx_eth_data __initdata adssphere_eth_data = { 23static struct ep93xx_eth_data __initdata adssphere_eth_data = {
45 .phy_id = 1, 24 .phy_id = 1,
46}; 25};
@@ -48,8 +27,7 @@ static struct ep93xx_eth_data __initdata adssphere_eth_data = {
48static void __init adssphere_init_machine(void) 27static void __init adssphere_init_machine(void)
49{ 28{
50 ep93xx_init_devices(); 29 ep93xx_init_devices();
51 platform_device_register(&adssphere_flash); 30 ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M);
52
53 ep93xx_register_eth(&adssphere_eth_data, 1); 31 ep93xx_register_eth(&adssphere_eth_data, 1);
54} 32}
55 33
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 9092677f63eb..8e37a045188c 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -29,6 +29,7 @@
29#include <linux/termios.h> 29#include <linux/termios.h>
30#include <linux/amba/bus.h> 30#include <linux/amba/bus.h>
31#include <linux/amba/serial.h> 31#include <linux/amba/serial.h>
32#include <linux/mtd/physmap.h>
32#include <linux/i2c.h> 33#include <linux/i2c.h>
33#include <linux/i2c-gpio.h> 34#include <linux/i2c-gpio.h>
34#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
@@ -215,8 +216,8 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits)
215 spin_lock_irqsave(&syscon_swlock, flags); 216 spin_lock_irqsave(&syscon_swlock, flags);
216 217
217 val = __raw_readl(EP93XX_SYSCON_DEVCFG); 218 val = __raw_readl(EP93XX_SYSCON_DEVCFG);
218 val |= set_bits;
219 val &= ~clear_bits; 219 val &= ~clear_bits;
220 val |= set_bits;
220 __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK); 221 __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
221 __raw_writel(val, EP93XX_SYSCON_DEVCFG); 222 __raw_writel(val, EP93XX_SYSCON_DEVCFG);
222 223
@@ -348,6 +349,43 @@ static struct platform_device ep93xx_ohci_device = {
348 349
349 350
350/************************************************************************* 351/*************************************************************************
352 * EP93xx physmap'ed flash
353 *************************************************************************/
354static struct physmap_flash_data ep93xx_flash_data;
355
356static struct resource ep93xx_flash_resource = {
357 .flags = IORESOURCE_MEM,
358};
359
360static struct platform_device ep93xx_flash = {
361 .name = "physmap-flash",
362 .id = 0,
363 .dev = {
364 .platform_data = &ep93xx_flash_data,
365 },
366 .num_resources = 1,
367 .resource = &ep93xx_flash_resource,
368};
369
370/**
371 * ep93xx_register_flash() - Register the external flash device.
372 * @width: bank width in octets
373 * @start: resource start address
374 * @size: resource size
375 */
376void __init ep93xx_register_flash(unsigned int width,
377 resource_size_t start, resource_size_t size)
378{
379 ep93xx_flash_data.width = width;
380
381 ep93xx_flash_resource.start = start;
382 ep93xx_flash_resource.end = start + size - 1;
383
384 platform_device_register(&ep93xx_flash);
385}
386
387
388/*************************************************************************
351 * EP93xx ethernet peripheral handling 389 * EP93xx ethernet peripheral handling
352 *************************************************************************/ 390 *************************************************************************/
353static struct ep93xx_eth_data ep93xx_eth_data; 391static struct ep93xx_eth_data ep93xx_eth_data;
@@ -620,6 +658,11 @@ static struct platform_device ep93xx_fb_device = {
620 .resource = ep93xx_fb_resource, 658 .resource = ep93xx_fb_resource,
621}; 659};
622 660
661static struct platform_device ep93xx_bl_device = {
662 .name = "ep93xx-bl",
663 .id = -1,
664};
665
623/** 666/**
624 * ep93xx_register_fb - Register the framebuffer platform device. 667 * ep93xx_register_fb - Register the framebuffer platform device.
625 * @data: platform specific framebuffer configuration (__initdata) 668 * @data: platform specific framebuffer configuration (__initdata)
@@ -628,6 +671,7 @@ void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data)
628{ 671{
629 ep93xxfb_data = *data; 672 ep93xxfb_data = *data;
630 platform_device_register(&ep93xx_fb_device); 673 platform_device_register(&ep93xx_fb_device);
674 platform_device_register(&ep93xx_bl_device);
631} 675}
632 676
633 677
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index 3884182cd362..c2ce9034ba87 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -27,7 +27,6 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#include <linux/mtd/physmap.h>
31#include <linux/gpio.h> 30#include <linux/gpio.h>
32#include <linux/i2c.h> 31#include <linux/i2c.h>
33#include <linux/i2c-gpio.h> 32#include <linux/i2c-gpio.h>
@@ -38,39 +37,13 @@
38#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
39 38
40 39
41static struct physmap_flash_data edb93xx_flash_data;
42
43static struct resource edb93xx_flash_resource = {
44 .flags = IORESOURCE_MEM,
45};
46
47static struct platform_device edb93xx_flash = {
48 .name = "physmap-flash",
49 .id = 0,
50 .dev = {
51 .platform_data = &edb93xx_flash_data,
52 },
53 .num_resources = 1,
54 .resource = &edb93xx_flash_resource,
55};
56
57static void __init __edb93xx_register_flash(unsigned int width,
58 resource_size_t start, resource_size_t size)
59{
60 edb93xx_flash_data.width = width;
61 edb93xx_flash_resource.start = start;
62 edb93xx_flash_resource.end = start + size - 1;
63
64 platform_device_register(&edb93xx_flash);
65}
66
67static void __init edb93xx_register_flash(void) 40static void __init edb93xx_register_flash(void)
68{ 41{
69 if (machine_is_edb9307() || machine_is_edb9312() || 42 if (machine_is_edb9307() || machine_is_edb9312() ||
70 machine_is_edb9315()) { 43 machine_is_edb9315()) {
71 __edb93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M); 44 ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M);
72 } else { 45 } else {
73 __edb93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M); 46 ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
74 } 47 }
75} 48}
76 49
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c
index a809618e9f05..d97168c0ba33 100644
--- a/arch/arm/mach-ep93xx/gesbc9312.c
+++ b/arch/arm/mach-ep93xx/gesbc9312.c
@@ -13,7 +13,6 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/mtd/physmap.h>
17 16
18#include <mach/hardware.h> 17#include <mach/hardware.h>
19 18
@@ -21,26 +20,6 @@
21#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
22 21
23 22
24static struct physmap_flash_data gesbc9312_flash_data = {
25 .width = 4,
26};
27
28static struct resource gesbc9312_flash_resource = {
29 .start = EP93XX_CS6_PHYS_BASE,
30 .end = EP93XX_CS6_PHYS_BASE + SZ_8M - 1,
31 .flags = IORESOURCE_MEM,
32};
33
34static struct platform_device gesbc9312_flash = {
35 .name = "physmap-flash",
36 .id = 0,
37 .dev = {
38 .platform_data = &gesbc9312_flash_data,
39 },
40 .num_resources = 1,
41 .resource = &gesbc9312_flash_resource,
42};
43
44static struct ep93xx_eth_data __initdata gesbc9312_eth_data = { 23static struct ep93xx_eth_data __initdata gesbc9312_eth_data = {
45 .phy_id = 1, 24 .phy_id = 1,
46}; 25};
@@ -48,8 +27,7 @@ static struct ep93xx_eth_data __initdata gesbc9312_eth_data = {
48static void __init gesbc9312_init_machine(void) 27static void __init gesbc9312_init_machine(void)
49{ 28{
50 ep93xx_init_devices(); 29 ep93xx_init_devices();
51 platform_device_register(&gesbc9312_flash); 30 ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_8M);
52
53 ep93xx_register_eth(&gesbc9312_eth_data, 0); 31 ep93xx_register_eth(&gesbc9312_eth_data, 0);
54} 32}
55 33
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h
index 9a4413dd44bb..a6c09176334c 100644
--- a/arch/arm/mach-ep93xx/include/mach/platform.h
+++ b/arch/arm/mach-ep93xx/include/mach/platform.h
@@ -43,6 +43,9 @@ static inline void ep93xx_devcfg_clear_bits(unsigned int bits)
43 43
44unsigned int ep93xx_chip_revision(void); 44unsigned int ep93xx_chip_revision(void);
45 45
46void ep93xx_register_flash(unsigned int width,
47 resource_size_t start, resource_size_t size);
48
46void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); 49void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr);
47void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, 50void ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
48 struct i2c_board_info *devices, int num); 51 struct i2c_board_info *devices, int num);
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c
index 1cc911b4efa6..2ba776320a82 100644
--- a/arch/arm/mach-ep93xx/micro9.c
+++ b/arch/arm/mach-ep93xx/micro9.c
@@ -14,7 +14,6 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/mtd/physmap.h>
18#include <linux/io.h> 17#include <linux/io.h>
19 18
20#include <mach/hardware.h> 19#include <mach/hardware.h>
@@ -31,31 +30,6 @@
31 * Micro9-Lite uses a separate MTD map driver for flash support 30 * Micro9-Lite uses a separate MTD map driver for flash support
32 * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1 31 * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1
33 *************************************************************************/ 32 *************************************************************************/
34static struct physmap_flash_data micro9_flash_data;
35
36static struct resource micro9_flash_resource = {
37 .start = EP93XX_CS1_PHYS_BASE,
38 .end = EP93XX_CS1_PHYS_BASE + SZ_64M - 1,
39 .flags = IORESOURCE_MEM,
40};
41
42static struct platform_device micro9_flash = {
43 .name = "physmap-flash",
44 .id = 0,
45 .dev = {
46 .platform_data = &micro9_flash_data,
47 },
48 .num_resources = 1,
49 .resource = &micro9_flash_resource,
50};
51
52static void __init __micro9_register_flash(unsigned int width)
53{
54 micro9_flash_data.width = width;
55
56 platform_device_register(&micro9_flash);
57}
58
59static unsigned int __init micro9_detect_bootwidth(void) 33static unsigned int __init micro9_detect_bootwidth(void)
60{ 34{
61 u32 v; 35 u32 v;
@@ -70,10 +44,17 @@ static unsigned int __init micro9_detect_bootwidth(void)
70 44
71static void __init micro9_register_flash(void) 45static void __init micro9_register_flash(void)
72{ 46{
47 unsigned int width;
48
73 if (machine_is_micro9()) 49 if (machine_is_micro9())
74 __micro9_register_flash(4); 50 width = 4;
75 else if (machine_is_micro9m() || machine_is_micro9s()) 51 else if (machine_is_micro9m() || machine_is_micro9s())
76 __micro9_register_flash(micro9_detect_bootwidth()); 52 width = micro9_detect_bootwidth();
53 else
54 width = 0;
55
56 if (width)
57 ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M);
77} 58}
78 59
79 60
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index 388aec95f60e..5dded5884133 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -18,7 +18,6 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/mtd/physmap.h>
22#include <linux/gpio.h> 21#include <linux/gpio.h>
23#include <linux/i2c.h> 22#include <linux/i2c.h>
24#include <linux/i2c-gpio.h> 23#include <linux/i2c-gpio.h>
@@ -29,26 +28,6 @@
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
31 30
32static struct physmap_flash_data simone_flash_data = {
33 .width = 2,
34};
35
36static struct resource simone_flash_resource = {
37 .start = EP93XX_CS6_PHYS_BASE,
38 .end = EP93XX_CS6_PHYS_BASE + SZ_8M - 1,
39 .flags = IORESOURCE_MEM,
40};
41
42static struct platform_device simone_flash = {
43 .name = "physmap-flash",
44 .id = 0,
45 .num_resources = 1,
46 .resource = &simone_flash_resource,
47 .dev = {
48 .platform_data = &simone_flash_data,
49 },
50};
51
52static struct ep93xx_eth_data __initdata simone_eth_data = { 31static struct ep93xx_eth_data __initdata simone_eth_data = {
53 .phy_id = 1, 32 .phy_id = 1,
54}; 33};
@@ -77,8 +56,7 @@ static struct i2c_board_info __initdata simone_i2c_board_info[] = {
77static void __init simone_init_machine(void) 56static void __init simone_init_machine(void)
78{ 57{
79 ep93xx_init_devices(); 58 ep93xx_init_devices();
80 59 ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_8M);
81 platform_device_register(&simone_flash);
82 ep93xx_register_eth(&simone_eth_data, 1); 60 ep93xx_register_eth(&simone_eth_data, 1);
83 ep93xx_register_fb(&simone_fb_info); 61 ep93xx_register_fb(&simone_fb_info);
84 ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info, 62 ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info,
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index ae7319e588c7..93aeab8af705 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -17,7 +17,6 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/m48t86.h> 19#include <linux/m48t86.h>
20#include <linux/mtd/physmap.h>
21#include <linux/mtd/nand.h> 20#include <linux/mtd/nand.h>
22#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
23 22
@@ -173,31 +172,13 @@ static struct platform_device ts72xx_nand_flash = {
173}; 172};
174 173
175 174
176/*************************************************************************
177 * NOR flash (TS-7200 only)
178 *************************************************************************/
179static struct physmap_flash_data ts72xx_nor_data = {
180 .width = 2,
181};
182
183static struct resource ts72xx_nor_resource = {
184 .start = EP93XX_CS6_PHYS_BASE,
185 .end = EP93XX_CS6_PHYS_BASE + SZ_16M - 1,
186 .flags = IORESOURCE_MEM,
187};
188
189static struct platform_device ts72xx_nor_flash = {
190 .name = "physmap-flash",
191 .id = 0,
192 .dev.platform_data = &ts72xx_nor_data,
193 .resource = &ts72xx_nor_resource,
194 .num_resources = 1,
195};
196
197static void __init ts72xx_register_flash(void) 175static void __init ts72xx_register_flash(void)
198{ 176{
177 /*
178 * TS7200 has NOR flash all other TS72xx board have NAND flash.
179 */
199 if (board_is_ts7200()) { 180 if (board_is_ts7200()) {
200 platform_device_register(&ts72xx_nor_flash); 181 ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
201 } else { 182 } else {
202 resource_size_t start; 183 resource_size_t start;
203 184
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c
index e3bc3f6f6b10..88b3dd89be89 100644
--- a/arch/arm/mach-footbridge/common.c
+++ b/arch/arm/mach-footbridge/common.c
@@ -232,7 +232,7 @@ EXPORT_SYMBOL(__bus_to_virt);
232 232
233unsigned long __pfn_to_bus(unsigned long pfn) 233unsigned long __pfn_to_bus(unsigned long pfn)
234{ 234{
235 return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET)); 235 return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET);
236} 236}
237EXPORT_SYMBOL(__pfn_to_bus); 237EXPORT_SYMBOL(__pfn_to_bus);
238 238
diff --git a/arch/arm/mach-h720x/include/mach/debug-macro.S b/arch/arm/mach-h720x/include/mach/debug-macro.S
index a9ee8f0d48b7..27cafd12f033 100644
--- a/arch/arm/mach-h720x/include/mach/debug-macro.S
+++ b/arch/arm/mach-h720x/include/mach/debug-macro.S
@@ -11,8 +11,10 @@
11 * 11 *
12*/ 12*/
13 13
14 .equ io_virt, IO_BASE 14#include <mach/hardware.h>
15 .equ io_phys, IO_START 15
16 .equ io_virt, IO_VIRT
17 .equ io_phys, IO_PHYS
16 18
17 .macro addruart, rx, tmp 19 .macro addruart, rx, tmp
18 mrc p15, 0, \rx, c1, c0 20 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
index 000000000000..5f96e1518aa9
--- /dev/null
+++ b/arch/arm/mach-integrator/common.h
@@ -0,0 +1 @@
void integrator_reserve(void);
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index a04d38609839..8f4fb6d638f7 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -14,6 +14,7 @@
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/memblock.h>
17#include <linux/sched.h> 18#include <linux/sched.h>
18#include <linux/smp.h> 19#include <linux/smp.h>
19#include <linux/termios.h> 20#include <linux/termios.h>
@@ -30,6 +31,7 @@
30#include <asm/system.h> 31#include <asm/system.h>
31#include <asm/leds.h> 32#include <asm/leds.h>
32#include <asm/mach/time.h> 33#include <asm/mach/time.h>
34#include <asm/pgtable.h>
33 35
34static struct amba_pl010_data integrator_uart_data; 36static struct amba_pl010_data integrator_uart_data;
35 37
@@ -220,3 +222,13 @@ void cm_control(u32 mask, u32 set)
220} 222}
221 223
222EXPORT_SYMBOL(cm_control); 224EXPORT_SYMBOL(cm_control);
225
226/*
227 * We need to stop things allocating the low memory; ideally we need a
228 * better implementation of GFP_DMA which does not assume that DMA-able
229 * memory starts at zero.
230 */
231void __init integrator_reserve(void)
232{
233 memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET);
234}
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 227cf4d05088..6ab5a03ab9d8 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -48,6 +48,8 @@
48#include <asm/mach/map.h> 48#include <asm/mach/map.h>
49#include <asm/mach/time.h> 49#include <asm/mach/time.h>
50 50
51#include "common.h"
52
51/* 53/*
52 * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx 54 * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx
53 * is the (PA >> 12). 55 * is the (PA >> 12).
@@ -502,6 +504,7 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
502 .io_pg_offst = ((0xf1600000) >> 18) & 0xfffc, 504 .io_pg_offst = ((0xf1600000) >> 18) & 0xfffc,
503 .boot_params = 0x00000100, 505 .boot_params = 0x00000100,
504 .map_io = ap_map_io, 506 .map_io = ap_map_io,
507 .reserve = integrator_reserve,
505 .init_irq = ap_init_irq, 508 .init_irq = ap_init_irq,
506 .timer = &ap_timer, 509 .timer = &ap_timer,
507 .init_machine = ap_init, 510 .init_machine = ap_init,
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index cde57b2b83b5..05db40e3c4f7 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -43,6 +43,8 @@
43 43
44#include <plat/timer-sp.h> 44#include <plat/timer-sp.h>
45 45
46#include "common.h"
47
46#define INTCP_PA_FLASH_BASE 0x24000000 48#define INTCP_PA_FLASH_BASE 0x24000000
47#define INTCP_FLASH_SIZE SZ_32M 49#define INTCP_FLASH_SIZE SZ_32M
48 50
@@ -601,6 +603,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
601 .io_pg_offst = ((0xf1600000) >> 18) & 0xfffc, 603 .io_pg_offst = ((0xf1600000) >> 18) & 0xfffc,
602 .boot_params = 0x00000100, 604 .boot_params = 0x00000100,
603 .map_io = intcp_map_io, 605 .map_io = intcp_map_io,
606 .reserve = integrator_reserve,
604 .init_irq = intcp_init_irq, 607 .init_irq = intcp_init_irq,
605 .timer = &cp_timer, 608 .timer = &cp_timer,
606 .init_machine = intcp_init, 609 .init_machine = intcp_init,
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h
index 25b1da9a5035..7415e4338651 100644
--- a/arch/arm/mach-iop13xx/include/mach/memory.h
+++ b/arch/arm/mach-iop13xx/include/mach/memory.h
@@ -69,6 +69,4 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
69#endif /* CONFIG_ARCH_IOP13XX */ 69#endif /* CONFIG_ARCH_IOP13XX */
70#endif /* !ASSEMBLY */ 70#endif /* !ASSEMBLY */
71 71
72#define PFN_TO_NID(addr) (0)
73
74#endif 72#endif
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index e3181534c7f9..333d04c53650 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -348,7 +348,7 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
348 * This is really ugly and we need a better way of specifying 348 * This is really ugly and we need a better way of specifying
349 * DMA-capable regions of memory. 349 * DMA-capable regions of memory.
350 */ 350 */
351void __init ixp4xx_adjust_zones(int node, unsigned long *zone_size, 351void __init ixp4xx_adjust_zones(unsigned long *zone_size,
352 unsigned long *zhole_size) 352 unsigned long *zhole_size)
353{ 353{
354 unsigned int sz = SZ_64M >> PAGE_SHIFT; 354 unsigned int sz = SZ_64M >> PAGE_SHIFT;
@@ -356,7 +356,7 @@ void __init ixp4xx_adjust_zones(int node, unsigned long *zone_size,
356 /* 356 /*
357 * Only adjust if > 64M on current system 357 * Only adjust if > 64M on current system
358 */ 358 */
359 if (node || (zone_size[0] <= sz)) 359 if (zone_size[0] <= sz)
360 return; 360 return;
361 361
362 zone_size[1] = zone_size[0] - sz; 362 zone_size[1] = zone_size[0] - sz;
diff --git a/arch/arm/mach-ixp4xx/include/mach/memory.h b/arch/arm/mach-ixp4xx/include/mach/memory.h
index 98f5e5e20980..0136eaa29224 100644
--- a/arch/arm/mach-ixp4xx/include/mach/memory.h
+++ b/arch/arm/mach-ixp4xx/include/mach/memory.h
@@ -16,10 +16,10 @@
16 16
17#if !defined(__ASSEMBLY__) && defined(CONFIG_PCI) 17#if !defined(__ASSEMBLY__) && defined(CONFIG_PCI)
18 18
19void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes); 19void ixp4xx_adjust_zones(unsigned long *size, unsigned long *holes);
20 20
21#define arch_adjust_zones(node, size, holes) \ 21#define arch_adjust_zones(size, holes) \
22 ixp4xx_adjust_zones(node, size, holes) 22 ixp4xx_adjust_zones(size, holes)
23 23
24#define ISA_DMA_THRESHOLD (SZ_64M - 1) 24#define ISA_DMA_THRESHOLD (SZ_64M - 1)
25#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M) 25#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M)
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.c b/arch/arm/mach-kirkwood/tsx1x-common.c
index 7221c20b2afa..f781164e623f 100644
--- a/arch/arm/mach-kirkwood/tsx1x-common.c
+++ b/arch/arm/mach-kirkwood/tsx1x-common.c
@@ -77,7 +77,7 @@ struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = {
77 }, 77 },
78}; 78};
79 79
80void qnap_tsx1x_register_flash(void) 80void __init qnap_tsx1x_register_flash(void)
81{ 81{
82 spi_register_board_info(qnap_tsx1x_spi_slave_info, 82 spi_register_board_info(qnap_tsx1x_spi_slave_info,
83 ARRAY_SIZE(qnap_tsx1x_spi_slave_info)); 83 ARRAY_SIZE(qnap_tsx1x_spi_slave_info));
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.h b/arch/arm/mach-kirkwood/tsx1x-common.h
index 9a592962a6ea..7fa037361b55 100644
--- a/arch/arm/mach-kirkwood/tsx1x-common.h
+++ b/arch/arm/mach-kirkwood/tsx1x-common.h
@@ -1,7 +1,7 @@
1#ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H 1#ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H
2#define __ARCH_KIRKWOOD_TSX1X_COMMON_H 2#define __ARCH_KIRKWOOD_TSX1X_COMMON_H
3 3
4extern void qnap_tsx1x_register_flash(void); 4extern void __init qnap_tsx1x_register_flash(void);
5extern void qnap_tsx1x_power_off(void); 5extern void qnap_tsx1x_power_off(void);
6 6
7#endif 7#endif
diff --git a/arch/arm/mach-l7200/Makefile b/arch/arm/mach-l7200/Makefile
deleted file mode 100644
index 4bd8ebd70e7b..000000000000
--- a/arch/arm/mach-l7200/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := core.o
8obj-m :=
9obj-n :=
10obj- :=
11
diff --git a/arch/arm/mach-l7200/Makefile.boot b/arch/arm/mach-l7200/Makefile.boot
deleted file mode 100644
index 6c72ecbe6b64..000000000000
--- a/arch/arm/mach-l7200/Makefile.boot
+++ /dev/null
@@ -1,2 +0,0 @@
1 zreladdr-y := 0xf0008000
2
diff --git a/arch/arm/mach-l7200/core.c b/arch/arm/mach-l7200/core.c
deleted file mode 100644
index 50d23246d4f0..000000000000
--- a/arch/arm/mach-l7200/core.c
+++ /dev/null
@@ -1,100 +0,0 @@
1/*
2 * linux/arch/arm/mm/mm-lusl7200.c
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Extra MM routines for L7200 architecture
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/irq.h>
11#include <linux/device.h>
12
13#include <asm/types.h>
14#include <asm/irq.h>
15#include <asm/mach-types.h>
16#include <mach/hardware.h>
17#include <asm/page.h>
18
19#include <asm/mach/arch.h>
20#include <asm/mach/map.h>
21#include <asm/mach/irq.h>
22
23/*
24 * IRQ base register
25 */
26#define IRQ_BASE (IO_BASE_2 + 0x1000)
27
28/*
29 * Normal IRQ registers
30 */
31#define IRQ_STATUS (*(volatile unsigned long *) (IRQ_BASE + 0x000))
32#define IRQ_RAWSTATUS (*(volatile unsigned long *) (IRQ_BASE + 0x004))
33#define IRQ_ENABLE (*(volatile unsigned long *) (IRQ_BASE + 0x008))
34#define IRQ_ENABLECLEAR (*(volatile unsigned long *) (IRQ_BASE + 0x00c))
35#define IRQ_SOFT (*(volatile unsigned long *) (IRQ_BASE + 0x010))
36#define IRQ_SOURCESEL (*(volatile unsigned long *) (IRQ_BASE + 0x018))
37
38/*
39 * Fast IRQ registers
40 */
41#define FIQ_STATUS (*(volatile unsigned long *) (IRQ_BASE + 0x100))
42#define FIQ_RAWSTATUS (*(volatile unsigned long *) (IRQ_BASE + 0x104))
43#define FIQ_ENABLE (*(volatile unsigned long *) (IRQ_BASE + 0x108))
44#define FIQ_ENABLECLEAR (*(volatile unsigned long *) (IRQ_BASE + 0x10c))
45#define FIQ_SOFT (*(volatile unsigned long *) (IRQ_BASE + 0x110))
46#define FIQ_SOURCESEL (*(volatile unsigned long *) (IRQ_BASE + 0x118))
47
48static void l7200_mask_irq(unsigned int irq)
49{
50 IRQ_ENABLECLEAR = 1 << irq;
51}
52
53static void l7200_unmask_irq(unsigned int irq)
54{
55 IRQ_ENABLE = 1 << irq;
56}
57
58static struct irq_chip l7200_irq_chip = {
59 .ack = l7200_mask_irq,
60 .mask = l7200_mask_irq,
61 .unmask = l7200_unmask_irq
62};
63
64static void __init l7200_init_irq(void)
65{
66 int irq;
67
68 IRQ_ENABLECLEAR = 0xffffffff; /* clear all interrupt enables */
69 FIQ_ENABLECLEAR = 0xffffffff; /* clear all fast interrupt enables */
70
71 for (irq = 0; irq < NR_IRQS; irq++) {
72 set_irq_chip(irq, &l7200_irq_chip);
73 set_irq_flags(irq, IRQF_VALID);
74 set_irq_handler(irq, handle_level_irq);
75 }
76
77 init_FIQ();
78}
79
80static struct map_desc l7200_io_desc[] __initdata = {
81 { IO_BASE, IO_START, IO_SIZE, MT_DEVICE },
82 { IO_BASE_2, IO_START_2, IO_SIZE_2, MT_DEVICE },
83 { AUX_BASE, AUX_START, AUX_SIZE, MT_DEVICE },
84 { FLASH1_BASE, FLASH1_START, FLASH1_SIZE, MT_DEVICE },
85 { FLASH2_BASE, FLASH2_START, FLASH2_SIZE, MT_DEVICE }
86};
87
88static void __init l7200_map_io(void)
89{
90 iotable_init(l7200_io_desc, ARRAY_SIZE(l7200_io_desc));
91}
92
93MACHINE_START(L7200, "LinkUp Systems L7200")
94 /* Maintainer: Steve Hill / Scott McConnell */
95 .phys_io = 0x80040000,
96 .io_pg_offst = ((0xd0000000) >> 18) & 0xfffc,
97 .map_io = l7200_map_io,
98 .init_irq = l7200_init_irq,
99MACHINE_END
100
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
index 4671558cdd51..000000000000
--- a/arch/arm/mach-l7200/include/mach/aux_reg.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/aux_reg.h
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 08-02-2000 SJH Created file
8 */
9#ifndef _ASM_ARCH_AUXREG_H
10#define _ASM_ARCH_AUXREG_H
11
12#include <mach/hardware.h>
13
14#define l7200aux_reg *((volatile unsigned int *) (AUX_BASE))
15
16/*
17 * Auxillary register values
18 */
19#define AUX_CLEAR 0x00000000
20#define AUX_DIAG_LED_ON 0x00000002
21#define AUX_RTS_UART1 0x00000004
22#define AUX_DTR_UART1 0x00000008
23#define AUX_KBD_COLUMN_12_HIGH 0x00000010
24#define AUX_KBD_COLUMN_12_OFF 0x00000020
25#define AUX_KBD_COLUMN_13_HIGH 0x00000040
26#define AUX_KBD_COLUMN_13_OFF 0x00000080
27
28#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
index b69ed344c7c9..000000000000
--- a/arch/arm/mach-l7200/include/mach/debug-macro.S
+++ /dev/null
@@ -1,40 +0,0 @@
1/* arch/arm/mach-l7200/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14 .equ io_virt, IO_BASE
15 .equ io_phys, IO_START
16
17 .macro addruart, rx, tmp
18 mrc p15, 0, \rx, c1, c0
19 tst \rx, #1 @ MMU enabled?
20 moveq \rx, #io_phys @ physical base address
21 movne \rx, #io_virt @ virtual address
22 add \rx, \rx, #0x00044000 @ UART1
23@ add \rx, \rx, #0x00045000 @ UART2
24 .endm
25
26 .macro senduart,rd,rx
27 str \rd, [\rx, #0x0] @ UARTDR
28 .endm
29
30 .macro waituart,rd,rx
311001: ldr \rd, [\rx, #0x18] @ UARTFLG
32 tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full
33 bne 1001b
34 .endm
35
36 .macro busyuart,rd,rx
371001: ldr \rd, [\rx, #0x18] @ UARTFLG
38 tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy
39 bne 1001b
40 .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
index 1726d91fc1d3..000000000000
--- a/arch/arm/mach-l7200/include/mach/entry-macro.S
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for L7200-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <mach/hardware.h>
11
12 .equ irq_base_addr, IO_BASE_2
13
14 .macro disable_fiq
15 .endm
16
17 .macro get_irqnr_preamble, base, tmp
18 .endm
19
20 .macro arch_ret_to_user, tmp1, tmp2
21 .endm
22
23 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
24 mov \irqstat, #irq_base_addr @ Virt addr IRQ regs
25 add \irqstat, \irqstat, #0x00001000 @ Status reg
26 ldr \irqstat, [\irqstat, #0] @ get interrupts
27 mov \irqnr, #0
281001: tst \irqstat, #1
29 addeq \irqnr, \irqnr, #1
30 moveq \irqstat, \irqstat, lsr #1
31 tsteq \irqnr, #32
32 beq 1001b
33 teq \irqnr, #32
34 .endm
35
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
index 2b7086a26b81..000000000000
--- a/arch/arm/mach-l7200/include/mach/gp_timers.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/gp_timers.h
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 07-28-2000 SJH Created file
8 * 08-02-2000 SJH Used structure for registers
9 */
10#ifndef _ASM_ARCH_GPTIMERS_H
11#define _ASM_ARCH_GPTIMERS_H
12
13#include <mach/hardware.h>
14
15/*
16 * Layout of L7200 general purpose timer registers
17 */
18struct GPT_Regs {
19 unsigned int TIMERLOAD;
20 unsigned int TIMERVALUE;
21 unsigned int TIMERCONTROL;
22 unsigned int TIMERCLEAR;
23};
24
25#define GPT_BASE (IO_BASE_2 + 0x3000)
26#define l7200_timer1_regs ((volatile struct GPT_Regs *) (GPT_BASE))
27#define l7200_timer2_regs ((volatile struct GPT_Regs *) (GPT_BASE + 0x20))
28
29/*
30 * General register values
31 */
32#define GPT_PRESCALE_1 0x00000000
33#define GPT_PRESCALE_16 0x00000004
34#define GPT_PRESCALE_256 0x00000008
35#define GPT_MODE_FREERUN 0x00000000
36#define GPT_MODE_PERIODIC 0x00000040
37#define GPT_ENABLE 0x00000080
38#define GPT_BZTOG 0x00000100
39#define GPT_BZMOD 0x00000200
40#define GPT_LOAD_MASK 0x0000ffff
41
42#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
index c7b0a5d7b8bb..000000000000
--- a/arch/arm/mach-l7200/include/mach/gpio.h
+++ /dev/null
@@ -1,105 +0,0 @@
1/****************************************************************************/
2/*
3 * arch/arm/mach-l7200/include/mach/gpio.h
4 *
5 * Registers and helper functions for the L7200 Link-Up Systems
6 * GPIO.
7 *
8 * (C) Copyright 2000, S A McConnell (samcconn@cotw.com)
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive for
12 * more details.
13 */
14
15/****************************************************************************/
16
17#define GPIO_OFF 0x00005000 /* Offset from IO_START to the GPIO reg's. */
18
19/* IO_START and IO_BASE are defined in hardware.h */
20
21#define GPIO_START (IO_START_2 + GPIO_OFF) /* Physical addr of the GPIO reg. */
22#define GPIO_BASE (IO_BASE_2 + GPIO_OFF) /* Virtual addr of the GPIO reg. */
23
24/* Offsets from the start of the GPIO for all the registers. */
25#define PADR_OFF 0x000
26#define PADDR_OFF 0x004
27#define PASBSR_OFF 0x008
28#define PAEENR_OFF 0x00c
29#define PAESNR_OFF 0x010
30#define PAESTR_OFF 0x014
31#define PAIMR_OFF 0x018
32#define PAINT_OFF 0x01c
33
34#define PBDR_OFF 0x020
35#define PBDDR_OFF 0x024
36#define PBSBSR_OFF 0x028
37#define PBIMR_OFF 0x038
38#define PBINT_OFF 0x03c
39
40#define PCDR_OFF 0x040
41#define PCDDR_OFF 0x044
42#define PCSBSR_OFF 0x048
43#define PCIMR_OFF 0x058
44#define PCINT_OFF 0x05c
45
46#define PDDR_OFF 0x060
47#define PDDDR_OFF 0x064
48#define PDSBSR_OFF 0x068
49#define PDEENR_OFF 0x06c
50#define PDESNR_OFF 0x070
51#define PDESTR_OFF 0x074
52#define PDIMR_OFF 0x078
53#define PDINT_OFF 0x07c
54
55#define PEDR_OFF 0x080
56#define PEDDR_OFF 0x084
57#define PESBSR_OFF 0x088
58#define PEEENR_OFF 0x08c
59#define PEESNR_OFF 0x090
60#define PEESTR_OFF 0x094
61#define PEIMR_OFF 0x098
62#define PEINT_OFF 0x09c
63
64/* Define the GPIO registers for use by device drivers and the kernel. */
65#define PADR (*(volatile unsigned long *)(GPIO_BASE+PADR_OFF))
66#define PADDR (*(volatile unsigned long *)(GPIO_BASE+PADDR_OFF))
67#define PASBSR (*(volatile unsigned long *)(GPIO_BASE+PASBSR_OFF))
68#define PAEENR (*(volatile unsigned long *)(GPIO_BASE+PAEENR_OFF))
69#define PAESNR (*(volatile unsigned long *)(GPIO_BASE+PAESNR_OFF))
70#define PAESTR (*(volatile unsigned long *)(GPIO_BASE+PAESTR_OFF))
71#define PAIMR (*(volatile unsigned long *)(GPIO_BASE+PAIMR_OFF))
72#define PAINT (*(volatile unsigned long *)(GPIO_BASE+PAINT_OFF))
73
74#define PBDR (*(volatile unsigned long *)(GPIO_BASE+PBDR_OFF))
75#define PBDDR (*(volatile unsigned long *)(GPIO_BASE+PBDDR_OFF))
76#define PBSBSR (*(volatile unsigned long *)(GPIO_BASE+PBSBSR_OFF))
77#define PBIMR (*(volatile unsigned long *)(GPIO_BASE+PBIMR_OFF))
78#define PBINT (*(volatile unsigned long *)(GPIO_BASE+PBINT_OFF))
79
80#define PCDR (*(volatile unsigned long *)(GPIO_BASE+PCDR_OFF))
81#define PCDDR (*(volatile unsigned long *)(GPIO_BASE+PCDDR_OFF))
82#define PCSBSR (*(volatile unsigned long *)(GPIO_BASE+PCSBSR_OFF))
83#define PCIMR (*(volatile unsigned long *)(GPIO_BASE+PCIMR_OFF))
84#define PCINT (*(volatile unsigned long *)(GPIO_BASE+PCINT_OFF))
85
86#define PDDR (*(volatile unsigned long *)(GPIO_BASE+PDDR_OFF))
87#define PDDDR (*(volatile unsigned long *)(GPIO_BASE+PDDDR_OFF))
88#define PDSBSR (*(volatile unsigned long *)(GPIO_BASE+PDSBSR_OFF))
89#define PDEENR (*(volatile unsigned long *)(GPIO_BASE+PDEENR_OFF))
90#define PDESNR (*(volatile unsigned long *)(GPIO_BASE+PDESNR_OFF))
91#define PDESTR (*(volatile unsigned long *)(GPIO_BASE+PDESTR_OFF))
92#define PDIMR (*(volatile unsigned long *)(GPIO_BASE+PDIMR_OFF))
93#define PDINT (*(volatile unsigned long *)(GPIO_BASE+PDINT_OFF))
94
95#define PEDR (*(volatile unsigned long *)(GPIO_BASE+PEDR_OFF))
96#define PEDDR (*(volatile unsigned long *)(GPIO_BASE+PEDDR_OFF))
97#define PESBSR (*(volatile unsigned long *)(GPIO_BASE+PESBSR_OFF))
98#define PEEENR (*(volatile unsigned long *)(GPIO_BASE+PEEENR_OFF))
99#define PEESNR (*(volatile unsigned long *)(GPIO_BASE+PEESNR_OFF))
100#define PEESTR (*(volatile unsigned long *)(GPIO_BASE+PEESTR_OFF))
101#define PEIMR (*(volatile unsigned long *)(GPIO_BASE+PEIMR_OFF))
102#define PEINT (*(volatile unsigned long *)(GPIO_BASE+PEINT_OFF))
103
104#define VEE_EN 0x02
105#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
index c31909cfc254..000000000000
--- a/arch/arm/mach-l7200/include/mach/hardware.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/hardware.h
3 *
4 * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * This file contains the hardware definitions for the
8 * LinkUp Systems L7200 SOC development board.
9 *
10 * Changelog:
11 * 02-01-2000 RS Created L7200 version, derived from rpc code
12 * 03-21-2000 SJH Cleaned up file
13 * 04-21-2000 RS Changed mapping of I/O in virtual space
14 * 04-25-2000 SJH Removed unused symbols and such
15 * 05-05-2000 SJH Complete rewrite
16 * 07-31-2000 SJH Added undocumented debug auxillary port to
17 * get at last two columns for keyboard driver
18 */
19#ifndef __ASM_ARCH_HARDWARE_H
20#define __ASM_ARCH_HARDWARE_H
21
22/* Hardware addresses of major areas.
23 * *_START is the physical address
24 * *_SIZE is the size of the region
25 * *_BASE is the virtual address
26 */
27#define RAM_START 0xf0000000
28#define RAM_SIZE 0x02000000
29#define RAM_BASE 0xc0000000
30
31#define IO_START 0x80000000 /* I/O */
32#define IO_SIZE 0x01000000
33#define IO_BASE 0xd0000000
34
35#define IO_START_2 0x90000000 /* I/O */
36#define IO_SIZE_2 0x01000000
37#define IO_BASE_2 0xd1000000
38
39#define AUX_START 0x1a000000 /* AUX PORT */
40#define AUX_SIZE 0x01000000
41#define AUX_BASE 0xd2000000
42
43#define FLASH1_START 0x00000000 /* FLASH BANK 1 */
44#define FLASH1_SIZE 0x01000000
45#define FLASH1_BASE 0xd3000000
46
47#define FLASH2_START 0x10000000 /* FLASH BANK 2 */
48#define FLASH2_SIZE 0x01000000
49#define FLASH2_BASE 0xd4000000
50
51#define ISA_START 0x20000000 /* ISA */
52#define ISA_SIZE 0x20000000
53#define ISA_BASE 0xe0000000
54
55#define PCIO_BASE IO_BASE
56
57#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
index a770a89fb708..000000000000
--- a/arch/arm/mach-l7200/include/mach/io.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/io.h
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 03-21-2000 SJH Created from arch/arm/mach-nexuspci/include/mach/io.h
8 * 08-31-2000 SJH Added in IO functions necessary for new drivers
9 */
10#ifndef __ASM_ARM_ARCH_IO_H
11#define __ASM_ARM_ARCH_IO_H
12
13#define IO_SPACE_LIMIT 0xffffffff
14
15/*
16 * There are not real ISA nor PCI buses, so we fake it.
17 */
18#define __io(a) __typesafe_io(a)
19#define __mem_pci(a) (a)
20
21#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
index 7edffd713c5b..000000000000
--- a/arch/arm/mach-l7200/include/mach/irqs.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/irqs.h
3 *
4 * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * Changelog:
8 * 01-02-2000 RS Create l7200 version
9 * 03-28-2000 SJH Removed unused interrupt
10 * 07-28-2000 SJH Added pseudo-keyboard interrupt
11 */
12
13/*
14 * NOTE: The second timer (Timer 2) is used as the keyboard
15 * interrupt when the keyboard driver is enabled.
16 */
17
18#define NR_IRQS 32
19
20#define IRQ_STWDOG 0 /* Watchdog timer */
21#define IRQ_PROG 1 /* Programmable interrupt */
22#define IRQ_DEBUG_RX 2 /* Comm Rx debug */
23#define IRQ_DEBUG_TX 3 /* Comm Tx debug */
24#define IRQ_GCTC1 4 /* Timer 1 */
25#define IRQ_GCTC2 5 /* Timer 2 / Keyboard */
26#define IRQ_DMA 6 /* DMA controller */
27#define IRQ_CLCD 7 /* Color LCD controller */
28#define IRQ_SM_RX 8 /* Smart card */
29#define IRQ_SM_TX 9 /* Smart cart */
30#define IRQ_SM_RST 10 /* Smart card */
31#define IRQ_SIB 11 /* Serial Interface Bus */
32#define IRQ_MMC 12 /* MultiMediaCard */
33#define IRQ_SSP1 13 /* Synchronous Serial Port 1 */
34#define IRQ_SSP2 14 /* Synchronous Serial Port 1 */
35#define IRQ_SPI 15 /* SPI slave */
36#define IRQ_UART_1 16 /* UART 1 */
37#define IRQ_UART_2 17 /* UART 2 */
38#define IRQ_IRDA 18 /* IRDA */
39#define IRQ_RTC_TICK 19 /* Real Time Clock tick */
40#define IRQ_RTC_ALARM 20 /* Real Time Clock alarm */
41#define IRQ_GPIO 21 /* General Purpose IO */
42#define IRQ_GPIO_DMA 22 /* General Purpose IO, DMA */
43#define IRQ_M2M 23 /* Memory to memory DMA */
44#define IRQ_RESERVED 24 /* RESERVED, don't use */
45#define IRQ_INTF 25 /* External active low interrupt */
46#define IRQ_INT0 26 /* External active low interrupt */
47#define IRQ_INT1 27 /* External active low interrupt */
48#define IRQ_INT2 28 /* External active low interrupt */
49#define IRQ_UCB1200 29 /* Interrupt generated by UCB1200*/
50#define IRQ_BAT_LO 30 /* Low batery or external power */
51#define IRQ_MEDIA_CHG 31 /* Media change interrupt */
52
53/*
54 * This is the offset of the FIQ "IRQ" numbers
55 */
56#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
index 9fb40ed2f03b..000000000000
--- a/arch/arm/mach-l7200/include/mach/memory.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/memory.h
3 *
4 * Copyright (c) 2000 Steve Hill (sjhill@cotw.com)
5 * Copyright (c) 2000 Rob Scott (rscott@mtrob.fdns.net)
6 *
7 * Changelog:
8 * 03-13-2000 SJH Created
9 * 04-13-2000 RS Changed bus macros for new addr
10 * 05-03-2000 SJH Removed bus macros and fixed virt_to_phys macro
11 */
12#ifndef __ASM_ARCH_MEMORY_H
13#define __ASM_ARCH_MEMORY_H
14
15/*
16 * Physical DRAM offset on the L7200 SDB.
17 */
18#define PHYS_OFFSET UL(0xf0000000)
19
20/*
21 * Cache flushing area - ROM
22 */
23#define FLUSH_BASE_PHYS 0x40000000
24#define FLUSH_BASE 0xdf000000
25
26#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
index 3959871e8361..000000000000
--- a/arch/arm/mach-l7200/include/mach/pmpcon.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/****************************************************************************/
2/*
3 * arch/arm/mach-l7200/include/mach/pmpcon.h
4 *
5 * Registers and helper functions for the L7200 Link-Up Systems
6 * DC/DC converter register.
7 *
8 * (C) Copyright 2000, S A McConnell (samcconn@cotw.com)
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive for
12 * more details.
13 */
14
15/****************************************************************************/
16
17#define PMPCON_OFF 0x00006000 /* Offset from IO_START_2. */
18
19/* IO_START_2 and IO_BASE_2 are defined in hardware.h */
20
21#define PMPCON_START (IO_START_2 + PMPCON_OFF) /* Physical address of reg. */
22#define PMPCON_BASE (IO_BASE_2 + PMPCON_OFF) /* Virtual address of reg. */
23
24
25#define PMPCON (*(volatile unsigned int *)(PMPCON_BASE))
26
27#define PWM2_50CYCLE 0x800
28#define CONTRAST 0x9
29
30#define PWM1H (CONTRAST)
31#define PWM1L (CONTRAST << 4)
32
33#define PMPCON_VALUE (PWM2_50CYCLE | PWM1L | PWM1H)
34
35/* PMPCON = 0x811; // too light and fuzzy
36 * PMPCON = 0x844;
37 * PMPCON = 0x866; // better color poor depth
38 * PMPCON = 0x888; // Darker but better depth
39 * PMPCON = 0x899; // Darker even better depth
40 * PMPCON = 0x8aa; // too dark even better depth
41 * PMPCON = 0X8cc; // Way too dark
42 */
43
44/* As CONTRAST value increases the greater the depth perception and
45 * the darker the colors.
46 */
diff --git a/arch/arm/mach-l7200/include/mach/pmu.h b/arch/arm/mach-l7200/include/mach/pmu.h
deleted file mode 100644
index a2da7aedf208..000000000000
--- a/arch/arm/mach-l7200/include/mach/pmu.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/****************************************************************************/
2/*
3 * arch/arm/mach-l7200/include/mach/pmu.h
4 *
5 * Registers and helper functions for the L7200 Link-Up Systems
6 * Power Management Unit (PMU).
7 *
8 * (C) Copyright 2000, S A McConnell (samcconn@cotw.com)
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive for
12 * more details.
13 */
14
15/****************************************************************************/
16
17#define PMU_OFF 0x00050000 /* Offset from IO_START to the PMU registers. */
18
19/* IO_START and IO_BASE are defined in hardware.h */
20
21#define PMU_START (IO_START + PMU_OFF) /* Physical addr. of the PMU reg. */
22#define PMU_BASE (IO_BASE + PMU_OFF) /* Virtual addr. of the PMU reg. */
23
24
25/* Define the PMU registers for use by device drivers and the kernel. */
26
27typedef struct {
28 unsigned int CURRENT; /* Current configuration register */
29 unsigned int NEXT; /* Next configuration register */
30 unsigned int reserved;
31 unsigned int RUN; /* Run configuration register */
32 unsigned int COMM; /* Configuration command register */
33 unsigned int SDRAM; /* SDRAM configuration bypass register */
34} pmu_interface;
35
36#define PMU ((volatile pmu_interface *)(PMU_BASE))
37
38
39/* Macro's for reading the common register fields. */
40
41#define GET_TRANSOP(reg) ((reg >> 25) & 0x03) /* Bits 26-25 */
42#define GET_OSCEN(reg) ((reg >> 16) & 0x01)
43#define GET_OSCMUX(reg) ((reg >> 15) & 0x01)
44#define GET_PLLMUL(reg) ((reg >> 9) & 0x3f) /* Bits 14-9 */
45#define GET_PLLEN(reg) ((reg >> 8) & 0x01)
46#define GET_PLLMUX(reg) ((reg >> 7) & 0x01)
47#define GET_BCLK_DIV(reg) ((reg >> 3) & 0x03) /* Bits 4-3 */
48#define GET_SDRB_SEL(reg) ((reg >> 2) & 0x01)
49#define GET_SDRF_SEL(reg) ((reg >> 1) & 0x01)
50#define GET_FASTBUS(reg) (reg & 0x1)
51
52/* CFG_NEXT register */
53
54#define CFG_NEXT_CLOCKRECOVERY ((PMU->NEXT >> 18) & 0x7f) /* Bits 24-18 */
55#define CFG_NEXT_INTRET ((PMU->NEXT >> 17) & 0x01)
56#define CFG_NEXT_SDR_STOP ((PMU->NEXT >> 6) & 0x01)
57#define CFG_NEXT_SYSCLKEN ((PMU->NEXT >> 5) & 0x01)
58
59/* Useful field values that can be used to construct the
60 * CFG_NEXT and CFG_RUN registers.
61 */
62
63#define TRANSOP_NOP 0<<25 /* NOCHANGE_NOSTALL */
64#define NOCHANGE_STALL 1<<25
65#define CHANGE_NOSTALL 2<<25
66#define CHANGE_STALL 3<<25
67
68#define INTRET 1<<17
69#define OSCEN 1<<16
70#define OSCMUX 1<<15
71
72/* PLL frequencies */
73
74#define PLLMUL_0 0<<9 /* 3.6864 MHz */
75#define PLLMUL_1 1<<9 /* ?????? MHz */
76#define PLLMUL_5 5<<9 /* 18.432 MHz */
77#define PLLMUL_10 10<<9 /* 36.864 MHz */
78#define PLLMUL_18 18<<9 /* ?????? MHz */
79#define PLLMUL_20 20<<9 /* 73.728 MHz */
80#define PLLMUL_32 32<<9 /* ?????? MHz */
81#define PLLMUL_35 35<<9 /* 129.024 MHz */
82#define PLLMUL_36 36<<9 /* ?????? MHz */
83#define PLLMUL_39 39<<9 /* ?????? MHz */
84#define PLLMUL_40 40<<9 /* 147.456 MHz */
85
86/* Clock recovery times */
87
88#define CRCLOCK_1 1<<18
89#define CRCLOCK_2 2<<18
90#define CRCLOCK_4 4<<18
91#define CRCLOCK_8 8<<18
92#define CRCLOCK_16 16<<18
93#define CRCLOCK_32 32<<18
94#define CRCLOCK_63 63<<18
95#define CRCLOCK_127 127<<18
96
97#define PLLEN 1<<8
98#define PLLMUX 1<<7
99#define SDR_STOP 1<<6
100#define SYSCLKEN 1<<5
101
102#define BCLK_DIV_4 2<<3
103#define BCLK_DIV_2 1<<3
104#define BCLK_DIV_1 0<<3
105
106#define SDRB_SEL 1<<2
107#define SDRF_SEL 1<<1
108#define FASTBUS 1<<0
109
110
111/* CFG_SDRAM */
112
113#define SDRREFFQ 1<<0 /* Only if SDRSTOPRQ is not set. */
114#define SDRREFACK 1<<1 /* Read-only */
115#define SDRSTOPRQ 1<<2 /* Only if SDRREFFQ is not set. */
116#define SDRSTOPACK 1<<3 /* Read-only */
117#define PICEN 1<<4 /* Enable Co-procesor */
118#define PICTEST 1<<5
119
120#define GET_SDRREFFQ ((PMU->SDRAM >> 0) & 0x01)
121#define GET_SDRREFACK ((PMU->SDRAM >> 1) & 0x01) /* Read-only */
122#define GET_SDRSTOPRQ ((PMU->SDRAM >> 2) & 0x01)
123#define GET_SDRSTOPACK ((PMU->SDRAM >> 3) & 0x01) /* Read-only */
124#define GET_PICEN ((PMU->SDRAM >> 4) & 0x01)
125#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
index adc05e5f8378..000000000000
--- a/arch/arm/mach-l7200/include/mach/serial.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/serial.h
3 *
4 * Copyright (c) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * Changelog:
8 * 03-20-2000 SJH Created
9 * 03-26-2000 SJH Added flags for serial ports
10 * 03-27-2000 SJH Corrected BASE_BAUD value
11 * 04-14-2000 RS Made register addr dependent on IO_BASE
12 * 05-03-2000 SJH Complete rewrite
13 * 05-09-2000 SJH Stripped out architecture specific serial stuff
14 * and placed it in a separate file
15 * 07-28-2000 SJH Moved base baud rate variable
16 */
17#ifndef __ASM_ARCH_SERIAL_H
18#define __ASM_ARCH_SERIAL_H
19
20/*
21 * This assumes you have a 3.6864 MHz clock for your UART.
22 */
23#define BASE_BAUD 3686400
24
25/*
26 * Standard COM flags
27 */
28#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
29
30#define STD_SERIAL_PORT_DEFNS \
31 /* MAGIC UART CLK PORT IRQ FLAGS */ \
32 { 0, BASE_BAUD, UART1_BASE, IRQ_UART_1, STD_COM_FLAGS }, /* ttyLU0 */ \
33 { 0, BASE_BAUD, UART2_BASE, IRQ_UART_2, STD_COM_FLAGS }, /* ttyLU1 */ \
34
35#define EXTRA_SERIAL_PORT_DEFNS
36
37#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
index 645f1c5e568d..000000000000
--- a/arch/arm/mach-l7200/include/mach/serial_l7200.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/serial_l7200.h
3 *
4 * Copyright (c) 2000 Steven Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 05-09-2000 SJH Created
8 */
9#ifndef __ASM_ARCH_SERIAL_L7200_H
10#define __ASM_ARCH_SERIAL_L7200_H
11
12#include <mach/memory.h>
13
14/*
15 * This assumes you have a 3.6864 MHz clock for your UART.
16 */
17#define BASE_BAUD 3686400
18
19/*
20 * UART base register addresses
21 */
22#define UART1_BASE (IO_BASE + 0x00044000)
23#define UART2_BASE (IO_BASE + 0x00045000)
24
25/*
26 * UART register offsets
27 */
28#define UARTDR 0x00 /* Tx/Rx data */
29#define RXSTAT 0x04 /* Rx status */
30#define H_UBRLCR 0x08 /* mode register high */
31#define M_UBRLCR 0x0C /* mode reg mid (MSB of baud)*/
32#define L_UBRLCR 0x10 /* mode reg low (LSB of baud)*/
33#define UARTCON 0x14 /* control register */
34#define UARTFLG 0x18 /* flag register */
35#define UARTINTSTAT 0x1C /* FIFO IRQ status register */
36#define UARTINTMASK 0x20 /* FIFO IRQ mask register */
37
38/*
39 * UART baud rate register values
40 */
41#define BR_110 0x827
42#define BR_1200 0x06e
43#define BR_2400 0x05f
44#define BR_4800 0x02f
45#define BR_9600 0x017
46#define BR_14400 0x00f
47#define BR_19200 0x00b
48#define BR_38400 0x005
49#define BR_57600 0x003
50#define BR_76800 0x002
51#define BR_115200 0x001
52
53/*
54 * Receiver status register (RXSTAT) mask values
55 */
56#define RXSTAT_NO_ERR 0x00 /* No error */
57#define RXSTAT_FRM_ERR 0x01 /* Framing error */
58#define RXSTAT_PAR_ERR 0x02 /* Parity error */
59#define RXSTAT_OVR_ERR 0x04 /* Overrun error */
60
61/*
62 * High byte of UART bit rate and line control register (H_UBRLCR) values
63 */
64#define UBRLCR_BRK 0x01 /* generate break on tx */
65#define UBRLCR_PEN 0x02 /* enable parity */
66#define UBRLCR_PDIS 0x00 /* disable parity */
67#define UBRLCR_EVEN 0x04 /* 1= even parity,0 = odd parity */
68#define UBRLCR_STP2 0x08 /* transmit 2 stop bits */
69#define UBRLCR_FIFO 0x10 /* enable FIFO */
70#define UBRLCR_LEN5 0x60 /* word length5 */
71#define UBRLCR_LEN6 0x40 /* word length6 */
72#define UBRLCR_LEN7 0x20 /* word length7 */
73#define UBRLCR_LEN8 0x00 /* word length8 */
74
75/*
76 * UART control register (UARTCON) values
77 */
78#define UARTCON_UARTEN 0x01 /* Enable UART */
79#define UARTCON_DMAONERR 0x08 /* Mask RxDmaRq when errors occur */
80
81/*
82 * UART flag register (UARTFLG) mask values
83 */
84#define UARTFLG_UTXFF 0x20 /* Transmit FIFO full */
85#define UARTFLG_URXFE 0x10 /* Receiver FIFO empty */
86#define UARTFLG_UBUSY 0x08 /* Transmitter busy */
87#define UARTFLG_DCD 0x04 /* Data carrier detect */
88#define UARTFLG_DSR 0x02 /* Data set ready */
89#define UARTFLG_CTS 0x01 /* Clear to send */
90
91/*
92 * UART interrupt status/clear registers (UARTINTSTAT/CLR) values
93 */
94#define UART_TXINT 0x01 /* TX interrupt */
95#define UART_RXINT 0x02 /* RX interrupt */
96#define UART_RXERRINT 0x04 /* RX error interrupt */
97#define UART_MSINT 0x08 /* Modem Status interrupt */
98#define UART_UDINT 0x10 /* UART Disabled interrupt */
99#define UART_ALLIRQS 0x1f /* All interrupts */
100
101#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
index 965728712cf3..000000000000
--- a/arch/arm/mach-l7200/include/mach/sib.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/****************************************************************************/
2/*
3 * arch/arm/mach-l7200/include/mach/sib.h
4 *
5 * Registers and helper functions for the Serial Interface Bus.
6 *
7 * (C) Copyright 2000, S A McConnell (samcconn@cotw.com)
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file COPYING in the main directory of this archive for
11 * more details.
12 */
13
14/****************************************************************************/
15
16#define SIB_OFF 0x00040000 /* Offset from IO_START to the SIB reg's. */
17
18/* IO_START and IO_BASE are defined in hardware.h */
19
20#define SIB_START (IO_START + SIB_OFF) /* Physical addr of the SIB reg. */
21#define SIB_BASE (IO_BASE + SIB_OFF) /* Virtual addr of the SIB reg. */
22
23/* Offsets from the start of the SIB for all the registers. */
24
25/* Define the SIB registers for use by device drivers and the kernel. */
26
27typedef struct
28{
29 unsigned int MCCR; /* SIB Control Register Offset: 0x00 */
30 unsigned int RES1; /* Reserved Offset: 0x04 */
31 unsigned int MCDR0; /* SIB Data Register 0 Offset: 0x08 */
32 unsigned int MCDR1; /* SIB Data Register 1 Offset: 0x0c */
33 unsigned int MCDR2; /* SIB Data Register 2 (UCB1x00) Offset: 0x10 */
34 unsigned int RES2; /* Reserved Offset: 0x14 */
35 unsigned int MCSR; /* SIB Status Register Offset: 0x18 */
36} SIB_Interface;
37
38#define SIB ((volatile SIB_Interface *) (SIB_BASE))
39
40/* MCCR */
41
42#define INTERNAL_FREQ 9216000 /* Hertz */
43#define AUDIO_FREQ 5000 /* Hertz */
44#define TELECOM_FREQ 5000 /* Hertz */
45
46#define AUDIO_DIVIDE (INTERNAL_FREQ / (32 * AUDIO_FREQ))
47#define TELECOM_DIVIDE (INTERNAL_FREQ / (32 * TELECOM_FREQ))
48
49#define MCCR_ASD57 AUDIO_DIVIDE
50#define MCCR_TSD57 (TELECOM_DIVIDE << 8)
51#define MCCR_MCE (1 << 16) /* SIB enable */
52#define MCCR_ECS (1 << 17) /* External Clock Select */
53#define MCCR_ADM (1 << 18) /* A/D Data Sampling */
54#define MCCR_PMC (1 << 26) /* PIN Multiplexer Control */
55
56
57#define GET_ASD ((SIB->MCCR >> 0) & 0x3f) /* Audio Sample Rate Div. */
58#define GET_TSD ((SIB->MCCR >> 8) & 0x3f) /* Telcom Sample Rate Div. */
59#define GET_MCE ((SIB->MCCR >> 16) & 0x01) /* SIB Enable */
60#define GET_ECS ((SIB->MCCR >> 17) & 0x01) /* External Clock Select */
61#define GET_ADM ((SIB->MCCR >> 18) & 0x01) /* A/D Data Sampling Mode */
62#define GET_TTM ((SIB->MCCR >> 19) & 0x01) /* Telco Trans. FIFO I mask */
63#define GET_TRM ((SIB->MCCR >> 20) & 0x01) /* Telco Recv. FIFO I mask */
64#define GET_ATM ((SIB->MCCR >> 21) & 0x01) /* Audio Trans. FIFO I mask */
65#define GET_ARM ((SIB->MCCR >> 22) & 0x01) /* Audio Recv. FIFO I mask */
66#define GET_LBM ((SIB->MCCR >> 23) & 0x01) /* Loop Back Mode */
67#define GET_ECP ((SIB->MCCR >> 24) & 0x03) /* Extern. Clck Prescale sel */
68#define GET_PMC ((SIB->MCCR >> 26) & 0x01) /* PIN Multiplexer Control */
69#define GET_ERI ((SIB->MCCR >> 27) & 0x01) /* External Read Interrupt */
70#define GET_EWI ((SIB->MCCR >> 28) & 0x01) /* External Write Interrupt */
71
72/* MCDR0 */
73
74#define AUDIO_RECV ((SIB->MCDR0 >> 4) & 0xfff)
75#define AUDIO_WRITE(v) ((SIB->MCDR0 = (v & 0xfff) << 4))
76
77/* MCDR1 */
78
79#define TELECOM_RECV ((SIB->MCDR1 >> 2) & 032fff)
80#define TELECOM_WRITE(v) ((SIB->MCDR1 = (v & 0x3fff) << 2))
81
82
83/* MCSR */
84
85#define MCSR_ATU (1 << 4) /* Audio Transmit FIFO Underrun */
86#define MCSR_ARO (1 << 5) /* Audio Receive FIFO Underrun */
87#define MCSR_TTU (1 << 6) /* TELECOM Transmit FIFO Underrun */
88#define MCSR_TRO (1 << 7) /* TELECOM Receive FIFO Underrun */
89
90#define MCSR_CLEAR_UNDERUN_BITS (MCSR_ATU | MCSR_ARO | MCSR_TTU | MCSR_TRO)
91
92
93#define GET_ATS ((SIB->MCSR >> 0) & 0x01) /* Audio Transmit FIFO Service Req*/
94#define GET_ARS ((SIB->MCSR >> 1) & 0x01) /* Audio Recv FIFO Service Request*/
95#define GET_TTS ((SIB->MCSR >> 2) & 0x01) /* TELECOM Transmit FIFO Flag */
96#define GET_TRS ((SIB->MCSR >> 3) & 0x01) /* TELECOM Recv FIFO Service Req. */
97#define GET_ATU ((SIB->MCSR >> 4) & 0x01) /* Audio Transmit FIFO Underrun */
98#define GET_ARO ((SIB->MCSR >> 5) & 0x01) /* Audio Receive FIFO Underrun */
99#define GET_TTU ((SIB->MCSR >> 6) & 0x01) /* TELECOM Transmit FIFO Underrun */
100#define GET_TRO ((SIB->MCSR >> 7) & 0x01) /* TELECOM Receive FIFO Underrun */
101#define GET_ANF ((SIB->MCSR >> 8) & 0x01) /* Audio Transmit FIFO not full */
102#define GET_ANE ((SIB->MCSR >> 9) & 0x01) /* Audio Receive FIFO not empty */
103#define GET_TNF ((SIB->MCSR >> 10) & 0x01) /* Telecom Transmit FIFO not full */
104#define GET_TNE ((SIB->MCSR >> 11) & 0x01) /* Telecom Receive FIFO not empty */
105#define GET_CWC ((SIB->MCSR >> 12) & 0x01) /* Codec Write Complete */
106#define GET_CRC ((SIB->MCSR >> 13) & 0x01) /* Codec Read Complete */
107#define GET_ACE ((SIB->MCSR >> 14) & 0x01) /* Audio Codec Enabled */
108#define GET_TCE ((SIB->MCSR >> 15) & 0x01) /* Telecom Codec Enabled */
109
110/* MCDR2 */
111
112#define MCDR2_rW (1 << 16)
113
114#define WRITE_MCDR2(reg, data) (SIB->MCDR2 =((reg<<17)|MCDR2_rW|(data&0xffff)))
115#define MCDR2_WRITE_COMPLETE GET_CWC
116
117#define INITIATE_MCDR2_READ(reg) (SIB->MCDR2 = (reg << 17))
118#define MCDR2_READ_COMPLETE GET_CRC
119#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
index e9729a35751d..000000000000
--- a/arch/arm/mach-l7200/include/mach/sys-clock.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/****************************************************************************/
2/*
3 * arch/arm/mach-l7200/include/mach/sys-clock.h
4 *
5 * Registers and helper functions for the L7200 Link-Up Systems
6 * System clocks.
7 *
8 * (C) Copyright 2000, S A McConnell (samcconn@cotw.com)
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file COPYING in the main directory of this archive for
12 * more details.
13 */
14
15/****************************************************************************/
16
17#define SYS_CLOCK_OFF 0x00050030 /* Offset from IO_START. */
18
19/* IO_START and IO_BASE are defined in hardware.h */
20
21#define SYS_CLOCK_START (IO_START + SYS_CLOCK_OFF) /* Physical address */
22#define SYS_CLOCK_BASE (IO_BASE + SYS_CLOCK_OFF) /* Virtual address */
23
24/* Define the interface to the SYS_CLOCK */
25
26typedef struct
27{
28 unsigned int ENABLE;
29 unsigned int ESYNC;
30 unsigned int SELECT;
31} sys_clock_interface;
32
33#define SYS_CLOCK ((volatile sys_clock_interface *)(SYS_CLOCK_BASE))
34
35//#define CLOCK_EN (*(volatile unsigned long *)(PMU_BASE+CLOCK_EN_OFF))
36//#define CLOCK_ESYNC (*(volatile unsigned long *)(PMU_BASE+CLOCK_ESYNC_OFF))
37//#define CLOCK_SEL (*(volatile unsigned long *)(PMU_BASE+CLOCK_SEL_OFF))
38
39/* SYS_CLOCK -> ENABLE */
40
41#define SYN_EN 1<<0
42#define B18M_EN 1<<1
43#define CLK3M6_EN 1<<2
44#define BUART_EN 1<<3
45#define CLK18MU_EN 1<<4
46#define FIR_EN 1<<5
47#define MIRN_EN 1<<6
48#define UARTM_EN 1<<7
49#define SIBADC_EN 1<<8
50#define ALTD_EN 1<<9
51#define CLCLK_EN 1<<10
52
53/* SYS_CLOCK -> SELECT */
54
55#define CLK18M_DIV 1<<0
56#define MIR_SEL 1<<1
57#define SSP_SEL 1<<4
58#define MM_DIV 1<<5
59#define MM_SEL 1<<6
60#define ADC_SEL_2 0<<7
61#define ADC_SEL_4 1<<7
62#define ADC_SEL_8 3<<7
63#define ADC_SEL_16 7<<7
64#define ADC_SEL_32 0x0f<<7
65#define ADC_SEL_64 0x1f<<7
66#define ADC_SEL_128 0x3f<<7
67#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
index e0dd3b6ae4aa..000000000000
--- a/arch/arm/mach-l7200/include/mach/system.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/system.h
3 *
4 * Copyright (c) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog
7 * 03-21-2000 SJH Created
8 * 04-26-2000 SJH Fixed functions
9 * 05-03-2000 SJH Removed usage of obsolete 'iomd.h'
10 * 05-31-2000 SJH Properly implemented 'arch_idle'
11 */
12#ifndef __ASM_ARCH_SYSTEM_H
13#define __ASM_ARCH_SYSTEM_H
14
15#include <mach/hardware.h>
16
17static inline void arch_idle(void)
18{
19 *(unsigned long *)(IO_BASE + 0x50004) = 1; /* idle mode */
20}
21
22static inline void arch_reset(char mode, const char *cmd)
23{
24 if (mode == 's') {
25 cpu_reset(0);
26 }
27}
28
29#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
index 061771c2c2bd..000000000000
--- a/arch/arm/mach-l7200/include/mach/time.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/time.h
3 *
4 * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * Changelog:
8 * 01-02-2000 RS Created l7200 version, derived from rpc code
9 * 05-03-2000 SJH Complete rewrite
10 */
11#ifndef _ASM_ARCH_TIME_H
12#define _ASM_ARCH_TIME_H
13
14#include <mach/irqs.h>
15
16/*
17 * RTC base register address
18 */
19#define RTC_BASE (IO_BASE_2 + 0x2000)
20
21/*
22 * RTC registers
23 */
24#define RTC_RTCDR (*(volatile unsigned char *) (RTC_BASE + 0x000))
25#define RTC_RTCMR (*(volatile unsigned char *) (RTC_BASE + 0x004))
26#define RTC_RTCS (*(volatile unsigned char *) (RTC_BASE + 0x008))
27#define RTC_RTCC (*(volatile unsigned char *) (RTC_BASE + 0x008))
28#define RTC_RTCDV (*(volatile unsigned char *) (RTC_BASE + 0x00c))
29#define RTC_RTCCR (*(volatile unsigned char *) (RTC_BASE + 0x010))
30
31/*
32 * RTCCR register values
33 */
34#define RTC_RATE_32 0x00 /* 32 Hz tick */
35#define RTC_RATE_64 0x10 /* 64 Hz tick */
36#define RTC_RATE_128 0x20 /* 128 Hz tick */
37#define RTC_RATE_256 0x30 /* 256 Hz tick */
38#define RTC_EN_ALARM 0x01 /* Enable alarm */
39#define RTC_EN_TIC 0x04 /* Enable counter */
40#define RTC_EN_STWDOG 0x08 /* Enable watchdog */
41
42/*
43 * Handler for RTC timer interrupt
44 */
45static irqreturn_t
46timer_interrupt(int irq, void *dev_id)
47{
48 struct pt_regs *regs = get_irq_regs();
49 do_timer(1);
50#ifndef CONFIG_SMP
51 update_process_times(user_mode(regs));
52#endif
53 do_profile(regs);
54 RTC_RTCC = 0; /* Clear interrupt */
55
56 return IRQ_HANDLED;
57}
58
59/*
60 * Set up RTC timer interrupt, and return the current time in seconds.
61 */
62void __init time_init(void)
63{
64 RTC_RTCC = 0; /* Clear interrupt */
65
66 timer_irq.handler = timer_interrupt;
67
68 setup_irq(IRQ_RTC_TICK, &timer_irq);
69
70 RTC_RTCCR = RTC_RATE_128 | RTC_EN_TIC; /* Set rate and enable timer */
71}
72
73#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
index ffc96a63b5a2..000000000000
--- a/arch/arm/mach-l7200/include/mach/timex.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/timex.h
3 *
4 * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.net)
5 * Steve Hill (sjhill@cotw.com)
6 *
7 * 04-21-2000 RS Created file
8 * 05-03-2000 SJH Tick rate was wrong
9 *
10 */
11
12/*
13 * On the ARM720T, clock ticks are set to 128 Hz.
14 *
15 * NOTE: The actual RTC value is set in 'time.h' which
16 * must be changed when choosing a different tick
17 * rate. The value of HZ in 'param.h' must also
18 * be changed to match below.
19 */
20#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
index 591c962bb315..000000000000
--- a/arch/arm/mach-l7200/include/mach/uncompress.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/uncompress.h
3 *
4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
5 *
6 * Changelog:
7 * 05-01-2000 SJH Created
8 * 05-13-2000 SJH Filled in function bodies
9 * 07-26-2000 SJH Removed hard coded baud rate
10 */
11
12#include <mach/hardware.h>
13
14#define IO_UART IO_START + 0x00044000
15
16#define __raw_writeb(v,p) (*(volatile unsigned char *)(p) = (v))
17#define __raw_readb(p) (*(volatile unsigned char *)(p))
18
19static inline void putc(int c)
20{
21 while(__raw_readb(IO_UART + 0x18) & 0x20 ||
22 __raw_readb(IO_UART + 0x18) & 0x08)
23 barrier();
24
25 __raw_writeb(c, IO_UART + 0x00);
26}
27
28static inline void flush(void)
29{
30}
31
32static __inline__ void arch_decomp_setup(void)
33{
34 __raw_writeb(0x00, IO_UART + 0x08); /* Set HSB */
35 __raw_writeb(0x00, IO_UART + 0x20); /* Disable IRQs */
36 __raw_writeb(0x01, IO_UART + 0x14); /* Enable UART */
37}
38
39#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
index 85f0abbf15f1..000000000000
--- a/arch/arm/mach-l7200/include/mach/vmalloc.h
+++ /dev/null
@@ -1,4 +0,0 @@
1/*
2 * arch/arm/mach-l7200/include/mach/vmalloc.h
3 */
4#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/arch/arm/mach-lh7a40x/include/mach/memory.h b/arch/arm/mach-lh7a40x/include/mach/memory.h
index 189d20e543e7..edb8f5faf5d5 100644
--- a/arch/arm/mach-lh7a40x/include/mach/memory.h
+++ b/arch/arm/mach-lh7a40x/include/mach/memory.h
@@ -19,50 +19,6 @@
19 */ 19 */
20#define PHYS_OFFSET UL(0xc0000000) 20#define PHYS_OFFSET UL(0xc0000000)
21 21
22#ifdef CONFIG_DISCONTIGMEM
23
24/*
25 * Given a kernel address, find the home node of the underlying memory.
26 */
27
28# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
29# define KVADDR_TO_NID(addr) \
30 ( ((((unsigned long) (addr) - PAGE_OFFSET) >> 24) & 1)\
31 | ((((unsigned long) (addr) - PAGE_OFFSET) >> 25) & ~1))
32# else /* 2 banks per node */
33# define KVADDR_TO_NID(addr) \
34 (((unsigned long) (addr) - PAGE_OFFSET) >> 26)
35# endif
36
37/*
38 * Given a page frame number, convert it to a node id.
39 */
40
41# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
42# define PFN_TO_NID(pfn) \
43 (((((pfn) - PHYS_PFN_OFFSET) >> (24 - PAGE_SHIFT)) & 1)\
44 | ((((pfn) - PHYS_PFN_OFFSET) >> (25 - PAGE_SHIFT)) & ~1))
45# else /* 2 banks per node */
46# define PFN_TO_NID(pfn) \
47 (((pfn) - PHYS_PFN_OFFSET) >> (26 - PAGE_SHIFT))
48#endif
49
50/*
51 * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
52 * and returns the index corresponding to the appropriate page in the
53 * node's mem_map.
54 */
55
56# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
57# define LOCAL_MAP_NR(addr) \
58 (((unsigned long)(addr) & 0x003fffff) >> PAGE_SHIFT)
59# else /* 2 banks per node */
60# define LOCAL_MAP_NR(addr) \
61 (((unsigned long)(addr) & 0x01ffffff) >> PAGE_SHIFT)
62# endif
63
64#endif
65
66/* 22/*
67 * Sparsemem version of the above 23 * Sparsemem version of the above
68 */ 24 */
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c
index dca5a5f062dc..e69a1502e4e8 100644
--- a/arch/arm/mach-msm/board-trout.c
+++ b/arch/arm/mach-msm/board-trout.c
@@ -50,7 +50,6 @@ static void __init trout_fixup(struct machine_desc *desc, struct tag *tags,
50{ 50{
51 mi->nr_banks = 1; 51 mi->nr_banks = 1;
52 mi->bank[0].start = PHYS_OFFSET; 52 mi->bank[0].start = PHYS_OFFSET;
53 mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
54 mi->bank[0].size = (101*1024*1024); 53 mi->bank[0].size = (101*1024*1024);
55} 54}
56 55
diff --git a/arch/arm/mach-ns9xxx/include/mach/debug-macro.S b/arch/arm/mach-ns9xxx/include/mach/debug-macro.S
index 0859336a8e6d..5c934bdb7158 100644
--- a/arch/arm/mach-ns9xxx/include/mach/debug-macro.S
+++ b/arch/arm/mach-ns9xxx/include/mach/debug-macro.S
@@ -8,6 +8,7 @@
8 * the Free Software Foundation. 8 * the Free Software Foundation.
9 */ 9 */
10#include <mach/hardware.h> 10#include <mach/hardware.h>
11#include <asm/memory.h>
11 12
12#include <mach/regs-board-a9m9750dev.h> 13#include <mach/regs-board-a9m9750dev.h>
13 14
diff --git a/arch/arm/mach-ns9xxx/include/mach/uncompress.h b/arch/arm/mach-ns9xxx/include/mach/uncompress.h
index 1b12d324b087..770a68c46e81 100644
--- a/arch/arm/mach-ns9xxx/include/mach/uncompress.h
+++ b/arch/arm/mach-ns9xxx/include/mach/uncompress.h
@@ -20,50 +20,49 @@ static void putc_dummy(char c, void __iomem *base)
20 /* nothing */ 20 /* nothing */
21} 21}
22 22
23static int timeout;
24
23static void putc_ns9360(char c, void __iomem *base) 25static void putc_ns9360(char c, void __iomem *base)
24{ 26{
25 static int t = 0x10000;
26 do { 27 do {
27 if (t) 28 if (timeout)
28 --t; 29 --timeout;
29 30
30 if (__raw_readl(base + 8) & (1 << 3)) { 31 if (__raw_readl(base + 8) & (1 << 3)) {
31 __raw_writeb(c, base + 16); 32 __raw_writeb(c, base + 16);
32 t = 0x10000; 33 timeout = 0x10000;
33 break; 34 break;
34 } 35 }
35 } while (t); 36 } while (timeout);
36} 37}
37 38
38static void putc_a9m9750dev(char c, void __iomem *base) 39static void putc_a9m9750dev(char c, void __iomem *base)
39{ 40{
40 static int t = 0x10000;
41 do { 41 do {
42 if (t) 42 if (timeout)
43 --t; 43 --timeout;
44 44
45 if (__raw_readb(base + 5) & (1 << 5)) { 45 if (__raw_readb(base + 5) & (1 << 5)) {
46 __raw_writeb(c, base); 46 __raw_writeb(c, base);
47 t = 0x10000; 47 timeout = 0x10000;
48 break; 48 break;
49 } 49 }
50 } while (t); 50 } while (timeout);
51 51
52} 52}
53 53
54static void putc_ns921x(char c, void __iomem *base) 54static void putc_ns921x(char c, void __iomem *base)
55{ 55{
56 static int t = 0x10000;
57 do { 56 do {
58 if (t) 57 if (timeout)
59 --t; 58 --timeout;
60 59
61 if (!(__raw_readl(base) & (1 << 11))) { 60 if (!(__raw_readl(base) & (1 << 11))) {
62 __raw_writeb(c, base + 0x0028); 61 __raw_writeb(c, base + 0x0028);
63 t = 0x10000; 62 timeout = 0x10000;
64 break; 63 break;
65 } 64 }
66 } while (t); 65 } while (timeout);
67} 66}
68 67
69#define MSCS __REG(0xA0900184) 68#define MSCS __REG(0xA0900184)
@@ -89,6 +88,7 @@ static void putc_ns921x(char c, void __iomem *base)
89 88
90static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base) 89static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base)
91{ 90{
91 timeout = 0x10000;
92 if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) { 92 if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) {
93 /* ns9360 or ns9750 */ 93 /* ns9360 or ns9750 */
94 if (NS9360_UART_ENABLED(NS9360_UARTA)) { 94 if (NS9360_UART_ENABLED(NS9360_UARTA)) {
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index fdd1dd53fa9c..0a9d61d2d229 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -301,6 +301,7 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
301 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 301 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
302 .boot_params = 0x10000100, 302 .boot_params = 0x10000100,
303 .map_io = ams_delta_map_io, 303 .map_io = ams_delta_map_io,
304 .reserve = omap_reserve,
304 .init_irq = ams_delta_init_irq, 305 .init_irq = ams_delta_init_irq,
305 .init_machine = ams_delta_init, 306 .init_machine = ams_delta_init,
306 .timer = &omap_timer, 307 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 096f2ed102cb..059bac60b35a 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -378,6 +378,7 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
378 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 378 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
379 .boot_params = 0x10000100, 379 .boot_params = 0x10000100,
380 .map_io = omap_fsample_map_io, 380 .map_io = omap_fsample_map_io,
381 .reserve = omap_reserve,
381 .init_irq = omap_fsample_init_irq, 382 .init_irq = omap_fsample_init_irq,
382 .init_machine = omap_fsample_init, 383 .init_machine = omap_fsample_init,
383 .timer = &omap_timer, 384 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index e1195a3467b8..7a65684d2a15 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -98,6 +98,7 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
98 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 98 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
99 .boot_params = 0x10000100, 99 .boot_params = 0x10000100,
100 .map_io = omap_generic_map_io, 100 .map_io = omap_generic_map_io,
101 .reserve = omap_reserve,
101 .init_irq = omap_generic_init_irq, 102 .init_irq = omap_generic_init_irq,
102 .init_machine = omap_generic_init, 103 .init_machine = omap_generic_init,
103 .timer = &omap_timer, 104 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index d1100e4f65ac..68b2beda8b99 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -467,6 +467,7 @@ MACHINE_START(OMAP_H2, "TI-H2")
467 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 467 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
468 .boot_params = 0x10000100, 468 .boot_params = 0x10000100,
469 .map_io = h2_map_io, 469 .map_io = h2_map_io,
470 .reserve = omap_reserve,
470 .init_irq = h2_init_irq, 471 .init_irq = h2_init_irq,
471 .init_machine = h2_init, 472 .init_machine = h2_init,
472 .timer = &omap_timer, 473 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index a53ab8297d25..0b0825fe6751 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -437,6 +437,7 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
437 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 437 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
438 .boot_params = 0x10000100, 438 .boot_params = 0x10000100,
439 .map_io = h3_map_io, 439 .map_io = h3_map_io,
440 .reserve = omap_reserve,
440 .init_irq = h3_init_irq, 441 .init_irq = h3_init_irq,
441 .init_machine = h3_init, 442 .init_machine = h3_init,
442 .timer = &omap_timer, 443 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 8e313b4b99a9..d70a4f0923f5 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -304,6 +304,7 @@ MACHINE_START(HERALD, "HTC Herald")
304 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 304 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
305 .boot_params = 0x10000100, 305 .boot_params = 0x10000100,
306 .map_io = htcherald_map_io, 306 .map_io = htcherald_map_io,
307 .reserve = omap_reserve,
307 .init_irq = htcherald_init_irq, 308 .init_irq = htcherald_init_irq,
308 .init_machine = htcherald_init, 309 .init_machine = htcherald_init,
309 .timer = &omap_timer, 310 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 5d12fd35681b..91064b37859a 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -463,6 +463,7 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
463 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 463 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
464 .boot_params = 0x10000100, 464 .boot_params = 0x10000100,
465 .map_io = innovator_map_io, 465 .map_io = innovator_map_io,
466 .reserve = omap_reserve,
466 .init_irq = innovator_init_irq, 467 .init_irq = innovator_init_irq,
467 .init_machine = innovator_init, 468 .init_machine = innovator_init,
468 .timer = &omap_timer, 469 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 71e1a3fad0ea..8c28b10f3dae 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -400,6 +400,7 @@ MACHINE_START(NOKIA770, "Nokia 770")
400 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 400 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
401 .boot_params = 0x10000100, 401 .boot_params = 0x10000100,
402 .map_io = omap_nokia770_map_io, 402 .map_io = omap_nokia770_map_io,
403 .reserve = omap_reserve,
403 .init_irq = omap_nokia770_init_irq, 404 .init_irq = omap_nokia770_init_irq,
404 .init_machine = omap_nokia770_init, 405 .init_machine = omap_nokia770_init,
405 .timer = &omap_timer, 406 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 80d862001def..e2a72af30890 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -584,6 +584,7 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
584 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 584 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
585 .boot_params = 0x10000100, 585 .boot_params = 0x10000100,
586 .map_io = osk_map_io, 586 .map_io = osk_map_io,
587 .reserve = omap_reserve,
587 .init_irq = osk_init_irq, 588 .init_irq = osk_init_irq,
588 .init_machine = osk_init, 589 .init_machine = osk_init,
589 .timer = &omap_timer, 590 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 569b4c9085cd..61a2321b9732 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -373,6 +373,7 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
373 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 373 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
374 .boot_params = 0x10000100, 374 .boot_params = 0x10000100,
375 .map_io = omap_palmte_map_io, 375 .map_io = omap_palmte_map_io,
376 .reserve = omap_reserve,
376 .init_irq = omap_palmte_init_irq, 377 .init_irq = omap_palmte_init_irq,
377 .init_machine = omap_palmte_init, 378 .init_machine = omap_palmte_init,
378 .timer = &omap_timer, 379 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index 6ad49a2cc1a0..21c01c6afcc1 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -321,6 +321,7 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
321 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 321 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
322 .boot_params = 0x10000100, 322 .boot_params = 0x10000100,
323 .map_io = omap_palmtt_map_io, 323 .map_io = omap_palmtt_map_io,
324 .reserve = omap_reserve,
324 .init_irq = omap_palmtt_init_irq, 325 .init_irq = omap_palmtt_init_irq,
325 .init_machine = omap_palmtt_init, 326 .init_machine = omap_palmtt_init,
326 .timer = &omap_timer, 327 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 6641de9257ef..f32492451533 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -338,10 +338,12 @@ omap_palmz71_map_io(void)
338} 338}
339 339
340MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71") 340MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
341 .phys_io = 0xfff00000, 341 .phys_io = 0xfff00000,
342 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 342 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
343 .boot_params = 0x10000100,.map_io = omap_palmz71_map_io, 343 .boot_params = 0x10000100,
344 .init_irq = omap_palmz71_init_irq, 344 .map_io = omap_palmz71_map_io,
345 .init_machine = omap_palmz71_init, 345 .reserve = omap_reserve,
346 .timer = &omap_timer, 346 .init_irq = omap_palmz71_init_irq,
347 .init_machine = omap_palmz71_init,
348 .timer = &omap_timer,
347MACHINE_END 349MACHINE_END
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index e854d5741c88..8b5ab1fcc405 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -339,6 +339,7 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
339 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 339 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
340 .boot_params = 0x10000100, 340 .boot_params = 0x10000100,
341 .map_io = omap_perseus2_map_io, 341 .map_io = omap_perseus2_map_io,
342 .reserve = omap_reserve,
342 .init_irq = omap_perseus2_init_irq, 343 .init_irq = omap_perseus2_init_irq,
343 .init_machine = omap_perseus2_init, 344 .init_machine = omap_perseus2_init,
344 .timer = &omap_timer, 345 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 2fb1e5f8e2ec..995566b862bb 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -423,7 +423,8 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
423 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 423 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
424 .boot_params = 0x10000100, 424 .boot_params = 0x10000100,
425 .map_io = omap_sx1_map_io, 425 .map_io = omap_sx1_map_io,
426 .init_irq = omap_sx1_init_irq, 426 .reserve = omap_reserve,
427 .init_irq = omap_sx1_init_irq,
427 .init_machine = omap_sx1_init, 428 .init_machine = omap_sx1_init,
428 .timer = &omap_timer, 429 .timer = &omap_timer,
429MACHINE_END 430MACHINE_END
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 87b9436fe7c0..4c483dc1de5c 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -287,6 +287,7 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
287 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc, 287 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
288 .boot_params = 0x10000100, 288 .boot_params = 0x10000100,
289 .map_io = voiceblue_map_io, 289 .map_io = voiceblue_map_io,
290 .reserve = omap_reserve,
290 .init_irq = voiceblue_init_irq, 291 .init_irq = voiceblue_init_irq,
291 .init_machine = voiceblue_init, 292 .init_machine = voiceblue_init,
292 .timer = &omap_timer, 293 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index d9b8d82530ae..0ce3fec2d257 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -22,7 +22,6 @@
22 22
23extern void omap_check_revision(void); 23extern void omap_check_revision(void);
24extern void omap_sram_init(void); 24extern void omap_sram_init(void);
25extern void omapfb_reserve_sdram(void);
26 25
27/* 26/*
28 * The machine specific code may provide the extra mapping besides the 27 * The machine specific code may provide the extra mapping besides the
@@ -122,7 +121,6 @@ void __init omap1_map_common_io(void)
122#endif 121#endif
123 122
124 omap_sram_init(); 123 omap_sram_init();
125 omapfb_reserve_sdram();
126} 124}
127 125
128/* 126/*
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index a11a575745e4..42f49f785c93 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -248,6 +248,7 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
248 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 248 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
249 .boot_params = 0x80000100, 249 .boot_params = 0x80000100,
250 .map_io = omap_2430sdp_map_io, 250 .map_io = omap_2430sdp_map_io,
251 .reserve = omap_reserve,
251 .init_irq = omap_2430sdp_init_irq, 252 .init_irq = omap_2430sdp_init_irq,
252 .init_machine = omap_2430sdp_init, 253 .init_machine = omap_2430sdp_init,
253 .timer = &omap_timer, 254 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index f474a80b8867..dd9c03171a19 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -815,6 +815,7 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
815 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 815 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
816 .boot_params = 0x80000100, 816 .boot_params = 0x80000100,
817 .map_io = omap_3430sdp_map_io, 817 .map_io = omap_3430sdp_map_io,
818 .reserve = omap_reserve,
818 .init_irq = omap_3430sdp_init_irq, 819 .init_irq = omap_3430sdp_init_irq,
819 .init_machine = omap_3430sdp_init, 820 .init_machine = omap_3430sdp_init,
820 .timer = &omap_timer, 821 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 504d2bd222fe..57290fb3fcd7 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -108,6 +108,7 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
108 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 108 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
109 .boot_params = 0x80000100, 109 .boot_params = 0x80000100,
110 .map_io = omap_sdp_map_io, 110 .map_io = omap_sdp_map_io,
111 .reserve = omap_reserve,
111 .init_irq = omap_sdp_init_irq, 112 .init_irq = omap_sdp_init_irq,
112 .init_machine = omap_sdp_init, 113 .init_machine = omap_sdp_init,
113 .timer = &omap_timer, 114 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index e4a5d66b83b8..4bb2c5d151ec 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -402,6 +402,7 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
402 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 402 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
403 .boot_params = 0x80000100, 403 .boot_params = 0x80000100,
404 .map_io = omap_4430sdp_map_io, 404 .map_io = omap_4430sdp_map_io,
405 .reserve = omap_reserve,
405 .init_irq = omap_4430sdp_init_irq, 406 .init_irq = omap_4430sdp_init_irq,
406 .init_machine = omap_4430sdp_init, 407 .init_machine = omap_4430sdp_init,
407 .timer = &omap_timer, 408 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index af383a876943..7da92defcde0 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -472,6 +472,7 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
472 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 472 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
473 .boot_params = 0x80000100, 473 .boot_params = 0x80000100,
474 .map_io = am3517_evm_map_io, 474 .map_io = am3517_evm_map_io,
475 .reserve = omap_reserve,
475 .init_irq = am3517_evm_init_irq, 476 .init_irq = am3517_evm_init_irq,
476 .init_machine = am3517_evm_init, 477 .init_machine = am3517_evm_init,
477 .timer = &omap_timer, 478 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index aa69fb999748..bd75642aee65 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -346,6 +346,7 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
346 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 346 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
347 .boot_params = 0x80000100, 347 .boot_params = 0x80000100,
348 .map_io = omap_apollon_map_io, 348 .map_io = omap_apollon_map_io,
349 .reserve = omap_reserve,
349 .init_irq = omap_apollon_init_irq, 350 .init_irq = omap_apollon_init_irq,
350 .init_machine = omap_apollon_init, 351 .init_machine = omap_apollon_init,
351 .timer = &omap_timer, 352 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index e679a2cc86c3..bc4c3f807068 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -837,6 +837,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
837 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 837 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
838 .boot_params = 0x80000100, 838 .boot_params = 0x80000100,
839 .map_io = cm_t35_map_io, 839 .map_io = cm_t35_map_io,
840 .reserve = omap_reserve,
840 .init_irq = cm_t35_init_irq, 841 .init_irq = cm_t35_init_irq,
841 .init_machine = cm_t35_init, 842 .init_machine = cm_t35_init,
842 .timer = &omap_timer, 843 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 77022b588816..922b7464807f 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -825,6 +825,7 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
825 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 825 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
826 .boot_params = 0x80000100, 826 .boot_params = 0x80000100,
827 .map_io = devkit8000_map_io, 827 .map_io = devkit8000_map_io,
828 .reserve = omap_reserve,
828 .init_irq = devkit8000_init_irq, 829 .init_irq = devkit8000_init_irq,
829 .init_machine = devkit8000_init, 830 .init_machine = devkit8000_init,
830 .timer = &omap_timer, 831 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 16cc06860670..9242902d3a43 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -59,6 +59,7 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
59 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 59 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
60 .boot_params = 0x80000100, 60 .boot_params = 0x80000100,
61 .map_io = omap_generic_map_io, 61 .map_io = omap_generic_map_io,
62 .reserve = omap_reserve,
62 .init_irq = omap_generic_init_irq, 63 .init_irq = omap_generic_init_irq,
63 .init_machine = omap_generic_init, 64 .init_machine = omap_generic_init,
64 .timer = &omap_timer, 65 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 0665f2c8dc8e..16703fdb3515 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -378,6 +378,7 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
378 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 378 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
379 .boot_params = 0x80000100, 379 .boot_params = 0x80000100,
380 .map_io = omap_h4_map_io, 380 .map_io = omap_h4_map_io,
381 .reserve = omap_reserve,
381 .init_irq = omap_h4_init_irq, 382 .init_irq = omap_h4_init_irq,
382 .init_machine = omap_h4_init, 383 .init_machine = omap_h4_init,
383 .timer = &omap_timer, 384 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index d55c57b761a9..759e39d1a702 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -543,6 +543,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
543 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 543 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
544 .boot_params = 0x80000100, 544 .boot_params = 0x80000100,
545 .map_io = igep2_map_io, 545 .map_io = igep2_map_io,
546 .reserve = omap_reserve,
546 .init_irq = igep2_init_irq, 547 .init_irq = igep2_init_irq,
547 .init_machine = igep2_init, 548 .init_machine = igep2_init,
548 .timer = &omap_timer, 549 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index fefd7e6e9779..9cd2669113e4 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -417,6 +417,7 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
417 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 417 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
418 .boot_params = 0x80000100, 418 .boot_params = 0x80000100,
419 .map_io = omap_ldp_map_io, 419 .map_io = omap_ldp_map_io,
420 .reserve = omap_reserve,
420 .init_irq = omap_ldp_init_irq, 421 .init_irq = omap_ldp_init_irq,
421 .init_machine = omap_ldp_init, 422 .init_machine = omap_ldp_init,
422 .timer = &omap_timer, 423 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 3ccc34ebdcc7..2565ff08a221 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -667,6 +667,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
667 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 667 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
668 .boot_params = 0x80000100, 668 .boot_params = 0x80000100,
669 .map_io = n8x0_map_io, 669 .map_io = n8x0_map_io,
670 .reserve = omap_reserve,
670 .init_irq = n8x0_init_irq, 671 .init_irq = n8x0_init_irq,
671 .init_machine = n8x0_init_machine, 672 .init_machine = n8x0_init_machine,
672 .timer = &omap_timer, 673 .timer = &omap_timer,
@@ -677,6 +678,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
677 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 678 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
678 .boot_params = 0x80000100, 679 .boot_params = 0x80000100,
679 .map_io = n8x0_map_io, 680 .map_io = n8x0_map_io,
681 .reserve = omap_reserve,
680 .init_irq = n8x0_init_irq, 682 .init_irq = n8x0_init_irq,
681 .init_machine = n8x0_init_machine, 683 .init_machine = n8x0_init_machine,
682 .timer = &omap_timer, 684 .timer = &omap_timer,
@@ -687,6 +689,7 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
687 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 689 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
688 .boot_params = 0x80000100, 690 .boot_params = 0x80000100,
689 .map_io = n8x0_map_io, 691 .map_io = n8x0_map_io,
692 .reserve = omap_reserve,
690 .init_irq = n8x0_init_irq, 693 .init_irq = n8x0_init_irq,
691 .init_machine = n8x0_init_machine, 694 .init_machine = n8x0_init_machine,
692 .timer = &omap_timer, 695 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 69b154cdc75d..0ab0c26db4dd 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -519,6 +519,7 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
519 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 519 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
520 .boot_params = 0x80000100, 520 .boot_params = 0x80000100,
521 .map_io = omap3_beagle_map_io, 521 .map_io = omap3_beagle_map_io,
522 .reserve = omap_reserve,
522 .init_irq = omap3_beagle_init_irq, 523 .init_irq = omap3_beagle_init_irq,
523 .init_machine = omap3_beagle_init, 524 .init_machine = omap3_beagle_init,
524 .timer = &omap_timer, 525 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index b95261013812..a3d2e285e116 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -727,6 +727,7 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
727 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 727 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
728 .boot_params = 0x80000100, 728 .boot_params = 0x80000100,
729 .map_io = omap3_evm_map_io, 729 .map_io = omap3_evm_map_io,
730 .reserve = omap_reserve,
730 .init_irq = omap3_evm_init_irq, 731 .init_irq = omap3_evm_init_irq,
731 .init_machine = omap3_evm_init, 732 .init_machine = omap3_evm_init,
732 .timer = &omap_timer, 733 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index db06dc910ba7..c0f4f12eba54 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -601,6 +601,7 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
601 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 601 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
602 .boot_params = 0x80000100, 602 .boot_params = 0x80000100,
603 .map_io = omap3pandora_map_io, 603 .map_io = omap3pandora_map_io,
604 .reserve = omap_reserve,
604 .init_irq = omap3pandora_init_irq, 605 .init_irq = omap3pandora_init_irq,
605 .init_machine = omap3pandora_init, 606 .init_machine = omap3pandora_init,
606 .timer = &omap_timer, 607 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 2f5f8233dd5b..f05b867c5851 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -571,6 +571,7 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
571 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 571 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
572 .boot_params = 0x80000100, 572 .boot_params = 0x80000100,
573 .map_io = omap3_touchbook_map_io, 573 .map_io = omap3_touchbook_map_io,
574 .reserve = omap_reserve,
574 .init_irq = omap3_touchbook_init_irq, 575 .init_irq = omap3_touchbook_init_irq,
575 .init_machine = omap3_touchbook_init, 576 .init_machine = omap3_touchbook_init,
576 .timer = &omap_timer, 577 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 79ac41400c21..87acb2f198ec 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -495,6 +495,7 @@ MACHINE_START(OVERO, "Gumstix Overo")
495 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 495 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
496 .boot_params = 0x80000100, 496 .boot_params = 0x80000100,
497 .map_io = overo_map_io, 497 .map_io = overo_map_io,
498 .reserve = omap_reserve,
498 .init_irq = overo_init_irq, 499 .init_irq = overo_init_irq,
499 .init_machine = overo_init, 500 .init_machine = overo_init,
500 .timer = &omap_timer, 501 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index abdf321c2d41..03483920ed6e 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -175,6 +175,10 @@ static void __init rx51_add_gpio_keys(void)
175#endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */ 175#endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */
176 176
177static int board_keymap[] = { 177static int board_keymap[] = {
178 /*
179 * Note that KEY(x, 8, KEY_XXX) entries represent "entrire row
180 * connected to the ground" matrix state.
181 */
178 KEY(0, 0, KEY_Q), 182 KEY(0, 0, KEY_Q),
179 KEY(0, 1, KEY_O), 183 KEY(0, 1, KEY_O),
180 KEY(0, 2, KEY_P), 184 KEY(0, 2, KEY_P),
@@ -182,6 +186,7 @@ static int board_keymap[] = {
182 KEY(0, 4, KEY_BACKSPACE), 186 KEY(0, 4, KEY_BACKSPACE),
183 KEY(0, 6, KEY_A), 187 KEY(0, 6, KEY_A),
184 KEY(0, 7, KEY_S), 188 KEY(0, 7, KEY_S),
189
185 KEY(1, 0, KEY_W), 190 KEY(1, 0, KEY_W),
186 KEY(1, 1, KEY_D), 191 KEY(1, 1, KEY_D),
187 KEY(1, 2, KEY_F), 192 KEY(1, 2, KEY_F),
@@ -190,6 +195,7 @@ static int board_keymap[] = {
190 KEY(1, 5, KEY_J), 195 KEY(1, 5, KEY_J),
191 KEY(1, 6, KEY_K), 196 KEY(1, 6, KEY_K),
192 KEY(1, 7, KEY_L), 197 KEY(1, 7, KEY_L),
198
193 KEY(2, 0, KEY_E), 199 KEY(2, 0, KEY_E),
194 KEY(2, 1, KEY_DOT), 200 KEY(2, 1, KEY_DOT),
195 KEY(2, 2, KEY_UP), 201 KEY(2, 2, KEY_UP),
@@ -197,6 +203,8 @@ static int board_keymap[] = {
197 KEY(2, 5, KEY_Z), 203 KEY(2, 5, KEY_Z),
198 KEY(2, 6, KEY_X), 204 KEY(2, 6, KEY_X),
199 KEY(2, 7, KEY_C), 205 KEY(2, 7, KEY_C),
206 KEY(2, 8, KEY_F9),
207
200 KEY(3, 0, KEY_R), 208 KEY(3, 0, KEY_R),
201 KEY(3, 1, KEY_V), 209 KEY(3, 1, KEY_V),
202 KEY(3, 2, KEY_B), 210 KEY(3, 2, KEY_B),
@@ -205,20 +213,23 @@ static int board_keymap[] = {
205 KEY(3, 5, KEY_SPACE), 213 KEY(3, 5, KEY_SPACE),
206 KEY(3, 6, KEY_SPACE), 214 KEY(3, 6, KEY_SPACE),
207 KEY(3, 7, KEY_LEFT), 215 KEY(3, 7, KEY_LEFT),
216
208 KEY(4, 0, KEY_T), 217 KEY(4, 0, KEY_T),
209 KEY(4, 1, KEY_DOWN), 218 KEY(4, 1, KEY_DOWN),
210 KEY(4, 2, KEY_RIGHT), 219 KEY(4, 2, KEY_RIGHT),
211 KEY(4, 4, KEY_LEFTCTRL), 220 KEY(4, 4, KEY_LEFTCTRL),
212 KEY(4, 5, KEY_RIGHTALT), 221 KEY(4, 5, KEY_RIGHTALT),
213 KEY(4, 6, KEY_LEFTSHIFT), 222 KEY(4, 6, KEY_LEFTSHIFT),
223 KEY(4, 8, KEY_F10),
224
214 KEY(5, 0, KEY_Y), 225 KEY(5, 0, KEY_Y),
226 KEY(5, 8, KEY_F11),
227
215 KEY(6, 0, KEY_U), 228 KEY(6, 0, KEY_U),
229
216 KEY(7, 0, KEY_I), 230 KEY(7, 0, KEY_I),
217 KEY(7, 1, KEY_F7), 231 KEY(7, 1, KEY_F7),
218 KEY(7, 2, KEY_F8), 232 KEY(7, 2, KEY_F8),
219 KEY(0xff, 2, KEY_F9),
220 KEY(0xff, 4, KEY_F10),
221 KEY(0xff, 5, KEY_F11),
222}; 233};
223 234
224static struct matrix_keymap_data board_map_data = { 235static struct matrix_keymap_data board_map_data = {
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 1b86b5bb87a2..3bd956f9e19f 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -154,6 +154,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
154 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, 154 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
155 .boot_params = 0x80000100, 155 .boot_params = 0x80000100,
156 .map_io = rx51_map_io, 156 .map_io = rx51_map_io,
157 .reserve = omap_reserve,
157 .init_irq = rx51_init_irq, 158 .init_irq = rx51_init_irq,
158 .init_machine = rx51_init, 159 .init_machine = rx51_init,
159 .timer = &omap_timer, 160 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
index 803ef14cbf2d..ffe188cb18e9 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -95,6 +95,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
95 .io_pg_offst = (ZOOM_UART_VIRT >> 18) & 0xfffc, 95 .io_pg_offst = (ZOOM_UART_VIRT >> 18) & 0xfffc,
96 .boot_params = 0x80000100, 96 .boot_params = 0x80000100,
97 .map_io = omap_zoom2_map_io, 97 .map_io = omap_zoom2_map_io,
98 .reserve = omap_reserve,
98 .init_irq = omap_zoom2_init_irq, 99 .init_irq = omap_zoom2_init_irq,
99 .init_machine = omap_zoom2_init, 100 .init_machine = omap_zoom2_init,
100 .timer = &omap_timer, 101 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-zoom3.c b/arch/arm/mach-omap2/board-zoom3.c
index 33147042485f..5b605eba3e7b 100644
--- a/arch/arm/mach-omap2/board-zoom3.c
+++ b/arch/arm/mach-omap2/board-zoom3.c
@@ -77,6 +77,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
77 .io_pg_offst = (ZOOM_UART_VIRT >> 18) & 0xfffc, 77 .io_pg_offst = (ZOOM_UART_VIRT >> 18) & 0xfffc,
78 .boot_params = 0x80000100, 78 .boot_params = 0x80000100,
79 .map_io = omap_zoom_map_io, 79 .map_io = omap_zoom_map_io,
80 .reserve = omap_reserve,
80 .init_irq = omap_zoom_init_irq, 81 .init_irq = omap_zoom_init_irq,
81 .init_machine = omap_zoom_init, 82 .init_machine = omap_zoom_init,
82 .timer = &omap_timer, 83 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 3cfb425ea67e..4e1f53d0b880 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -33,7 +33,6 @@
33#include <plat/sdrc.h> 33#include <plat/sdrc.h>
34#include <plat/gpmc.h> 34#include <plat/gpmc.h>
35#include <plat/serial.h> 35#include <plat/serial.h>
36#include <plat/vram.h>
37 36
38#include "clock2xxx.h" 37#include "clock2xxx.h"
39#include "clock3xxx.h" 38#include "clock3xxx.h"
@@ -241,8 +240,6 @@ static void __init _omap2_map_common_io(void)
241 240
242 omap2_check_revision(); 241 omap2_check_revision();
243 omap_sram_init(); 242 omap_sram_init();
244 omapfb_reserve_sdram();
245 omap_vram_reserve_sdram();
246} 243}
247 244
248#ifdef CONFIG_ARCH_OMAP2420 245#ifdef CONFIG_ARCH_OMAP2420
diff --git a/arch/arm/mach-pxa/cm-x2xx-pci.c b/arch/arm/mach-pxa/cm-x2xx-pci.c
index 161fc2d61207..0f3130599770 100644
--- a/arch/arm/mach-pxa/cm-x2xx-pci.c
+++ b/arch/arm/mach-pxa/cm-x2xx-pci.c
@@ -35,7 +35,7 @@ static int cmx2xx_it8152_irq_gpio;
35 * This is really ugly and we need a better way of specifying 35 * This is really ugly and we need a better way of specifying
36 * DMA-capable regions of memory. 36 * DMA-capable regions of memory.
37 */ 37 */
38void __init cmx2xx_pci_adjust_zones(int node, unsigned long *zone_size, 38void __init cmx2xx_pci_adjust_zones(unsigned long *zone_size,
39 unsigned long *zhole_size) 39 unsigned long *zhole_size)
40{ 40{
41 unsigned int sz = SZ_64M >> PAGE_SHIFT; 41 unsigned int sz = SZ_64M >> PAGE_SHIFT;
@@ -46,7 +46,7 @@ void __init cmx2xx_pci_adjust_zones(int node, unsigned long *zone_size,
46 /* 46 /*
47 * Only adjust if > 64M on current system 47 * Only adjust if > 64M on current system
48 */ 48 */
49 if (node || (zone_size[0] <= sz)) 49 if (zone_size[0] <= sz)
50 return; 50 return;
51 51
52 zone_size[1] = zone_size[0] - sz; 52 zone_size[1] = zone_size[0] - sz;
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index 45c23fd6df31..40b6ac2de876 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -26,6 +26,7 @@
26#include <mach/colibri.h> 26#include <mach/colibri.h>
27#include <mach/ohci.h> 27#include <mach/ohci.h>
28#include <mach/pxafb.h> 28#include <mach/pxafb.h>
29#include <mach/audio.h>
29 30
30#include "generic.h" 31#include "generic.h"
31#include "devices.h" 32#include "devices.h"
@@ -145,7 +146,7 @@ static void __init colibri_pxa300_init_lcd(void)
145static inline void colibri_pxa300_init_lcd(void) {} 146static inline void colibri_pxa300_init_lcd(void) {}
146#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ 147#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
147 148
148#if defined(SND_AC97_CODEC) || defined(SND_AC97_CODEC_MODULE) 149#if defined(CONFIG_SND_AC97_CODEC) || defined(CONFIG_SND_AC97_CODEC_MODULE)
149static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = { 150static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = {
150 GPIO24_AC97_SYSCLK, 151 GPIO24_AC97_SYSCLK,
151 GPIO23_AC97_nACRESET, 152 GPIO23_AC97_nACRESET,
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 3d1dcb9ac08f..461ba4080155 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -446,7 +446,7 @@ static struct platform_device corgiled_device = {
446static struct pxamci_platform_data corgi_mci_platform_data = { 446static struct pxamci_platform_data corgi_mci_platform_data = {
447 .detect_delay_ms = 250, 447 .detect_delay_ms = 250,
448 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, 448 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
449 .gpio_card_detect = -1, 449 .gpio_card_detect = CORGI_GPIO_nSD_DETECT,
450 .gpio_card_ro = CORGI_GPIO_nSD_WP, 450 .gpio_card_ro = CORGI_GPIO_nSD_WP,
451 .gpio_power = CORGI_GPIO_SD_PWR, 451 .gpio_power = CORGI_GPIO_SD_PWR,
452}; 452};
@@ -715,7 +715,6 @@ static void __init fixup_corgi(struct machine_desc *desc,
715 sharpsl_save_param(); 715 sharpsl_save_param();
716 mi->nr_banks=1; 716 mi->nr_banks=1;
717 mi->bank[0].start = 0xa0000000; 717 mi->bank[0].start = 0xa0000000;
718 mi->bank[0].node = 0;
719 if (machine_is_corgi()) 718 if (machine_is_corgi())
720 mi->bank[0].size = (32*1024*1024); 719 mi->bank[0].size = (32*1024*1024);
721 else 720 else
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 9e4d9816726a..268a9bc6be8a 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
@@ -256,13 +256,9 @@ static void init_sdram_rows(void)
256 256
257static u32 mdrefr_dri(unsigned int freq) 257static u32 mdrefr_dri(unsigned int freq)
258{ 258{
259 u32 dri = 0; 259 u32 interval = freq * SDRAM_TREF / sdram_rows;
260 260
261 if (cpu_is_pxa25x()) 261 return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32;
262 dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
263 if (cpu_is_pxa27x())
264 dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
265 return dri;
266} 262}
267 263
268/* find a valid frequency point */ 264/* find a valid frequency point */
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index 96ed13081639..a0ab3082a000 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -34,7 +34,6 @@ void __init eseries_fixup(struct machine_desc *desc,
34{ 34{
35 mi->nr_banks=1; 35 mi->nr_banks=1;
36 mi->bank[0].start = 0xa0000000; 36 mi->bank[0].start = 0xa0000000;
37 mi->bank[0].node = 0;
38 if (machine_is_e800()) 37 if (machine_is_e800())
39 mi->bank[0].size = (128*1024*1024); 38 mi->bank[0].size = (128*1024*1024);
40 else 39 else
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index 890fb90a672f..c6305c5b8a72 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -26,8 +26,7 @@ extern unsigned int get_clk_frequency_khz(int info);
26 26
27#define SET_BANK(__nr,__start,__size) \ 27#define SET_BANK(__nr,__start,__size) \
28 mi->bank[__nr].start = (__start), \ 28 mi->bank[__nr].start = (__start), \
29 mi->bank[__nr].size = (__size), \ 29 mi->bank[__nr].size = (__size)
30 mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
31 30
32#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) 31#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
33 32
diff --git a/arch/arm/mach-pxa/include/mach/memory.h b/arch/arm/mach-pxa/include/mach/memory.h
index f626730ee42e..92361a66b223 100644
--- a/arch/arm/mach-pxa/include/mach/memory.h
+++ b/arch/arm/mach-pxa/include/mach/memory.h
@@ -17,24 +17,11 @@
17 */ 17 */
18#define PHYS_OFFSET UL(0xa0000000) 18#define PHYS_OFFSET UL(0xa0000000)
19 19
20/*
21 * The nodes are matched with the physical SDRAM banks as follows:
22 *
23 * node 0: 0xa0000000-0xa3ffffff --> 0xc0000000-0xc3ffffff
24 * node 1: 0xa4000000-0xa7ffffff --> 0xc4000000-0xc7ffffff
25 * node 2: 0xa8000000-0xabffffff --> 0xc8000000-0xcbffffff
26 * node 3: 0xac000000-0xafffffff --> 0xcc000000-0xcfffffff
27 *
28 * This needs a node mem size of 26 bits.
29 */
30#define NODE_MEM_SIZE_BITS 26
31
32#if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI) 20#if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
33void cmx2xx_pci_adjust_zones(int node, unsigned long *size, 21void cmx2xx_pci_adjust_zones(unsigned long *size, unsigned long *holes);
34 unsigned long *holes);
35 22
36#define arch_adjust_zones(node, size, holes) \ 23#define arch_adjust_zones(size, holes) \
37 cmx2xx_pci_adjust_zones(node, size, holes) 24 cmx2xx_pci_adjust_zones(size, holes)
38 25
39#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_64M - 1) 26#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_64M - 1)
40#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M) 27#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M)
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 5305a3993e69..5e92d84fe50d 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -21,6 +21,7 @@
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/gpio_keys.h> 22#include <linux/gpio_keys.h>
23#include <linux/input.h> 23#include <linux/input.h>
24#include <linux/memblock.h>
24#include <linux/pda_power.h> 25#include <linux/pda_power.h>
25#include <linux/pwm_backlight.h> 26#include <linux/pwm_backlight.h>
26#include <linux/gpio.h> 27#include <linux/gpio.h>
@@ -396,6 +397,11 @@ static void __init palmt5_udc_init(void)
396 } 397 }
397} 398}
398 399
400static void __init palmt5_reserve(void)
401{
402 memblock_reserve(0xa0200000, 0x1000);
403}
404
399static void __init palmt5_init(void) 405static void __init palmt5_init(void)
400{ 406{
401 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config)); 407 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config));
@@ -421,6 +427,7 @@ MACHINE_START(PALMT5, "Palm Tungsten|T5")
421 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 427 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
422 .boot_params = 0xa0000100, 428 .boot_params = 0xa0000100,
423 .map_io = pxa_map_io, 429 .map_io = pxa_map_io,
430 .reserve = palmt5_reserve,
424 .init_irq = pxa27x_init_irq, 431 .init_irq = pxa27x_init_irq,
425 .timer = &pxa_timer, 432 .timer = &pxa_timer,
426 .init_machine = palmt5_init 433 .init_machine = palmt5_init
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index d8b4469607a1..3d0c9cc2a406 100644
--- a/arch/arm/mach-pxa/palmtreo.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -20,6 +20,7 @@
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/gpio_keys.h> 21#include <linux/gpio_keys.h>
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/memblock.h>
23#include <linux/pda_power.h> 24#include <linux/pda_power.h>
24#include <linux/pwm_backlight.h> 25#include <linux/pwm_backlight.h>
25#include <linux/gpio.h> 26#include <linux/gpio.h>
@@ -633,6 +634,12 @@ static void __init treo_lcd_power_init(void)
633 treo_lcd_screen.pxafb_lcd_power = treo_lcd_power; 634 treo_lcd_screen.pxafb_lcd_power = treo_lcd_power;
634} 635}
635 636
637static void __init treo_reserve(void)
638{
639 memblock_reserve(0xa0000000, 0x1000);
640 memblock_reserve(0xa2000000, 0x1000);
641}
642
636static void __init treo_init(void) 643static void __init treo_init(void)
637{ 644{
638 pxa_set_ffuart_info(NULL); 645 pxa_set_ffuart_info(NULL);
@@ -668,6 +675,7 @@ MACHINE_START(TREO680, "Palm Treo 680")
668 .io_pg_offst = io_p2v(0x40000000), 675 .io_pg_offst = io_p2v(0x40000000),
669 .boot_params = 0xa0000100, 676 .boot_params = 0xa0000100,
670 .map_io = pxa_map_io, 677 .map_io = pxa_map_io,
678 .reserve = treo_reserve,
671 .init_irq = pxa27x_init_irq, 679 .init_irq = pxa27x_init_irq,
672 .timer = &pxa_timer, 680 .timer = &pxa_timer,
673 .init_machine = treo680_init, 681 .init_machine = treo680_init,
@@ -691,6 +699,7 @@ MACHINE_START(CENTRO, "Palm Centro 685")
691 .io_pg_offst = io_p2v(0x40000000), 699 .io_pg_offst = io_p2v(0x40000000),
692 .boot_params = 0xa0000100, 700 .boot_params = 0xa0000100,
693 .map_io = pxa_map_io, 701 .map_io = pxa_map_io,
702 .reserve = treo_reserve,
694 .init_irq = pxa27x_init_irq, 703 .init_irq = pxa27x_init_irq,
695 .timer = &pxa_timer, 704 .timer = &pxa_timer,
696 .init_machine = centro_init, 705 .init_machine = centro_init,
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index f4abdaafdac4..bc2758b54446 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -463,7 +463,6 @@ static void __init fixup_poodle(struct machine_desc *desc,
463 sharpsl_save_param(); 463 sharpsl_save_param();
464 mi->nr_banks=1; 464 mi->nr_banks=1;
465 mi->bank[0].start = 0xa0000000; 465 mi->bank[0].start = 0xa0000000;
466 mi->bank[0].node = 0;
467 mi->bank[0].size = (32*1024*1024); 466 mi->bank[0].size = (32*1024*1024);
468} 467}
469 468
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 0af36177ff08..c059dac02b61 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -41,10 +41,10 @@ void pxa27x_clear_otgph(void)
41EXPORT_SYMBOL(pxa27x_clear_otgph); 41EXPORT_SYMBOL(pxa27x_clear_otgph);
42 42
43static unsigned long ac97_reset_config[] = { 43static unsigned long ac97_reset_config[] = {
44 GPIO95_AC97_nRESET,
45 GPIO95_GPIO,
46 GPIO113_AC97_nRESET,
47 GPIO113_GPIO, 44 GPIO113_GPIO,
45 GPIO113_AC97_nRESET,
46 GPIO95_GPIO,
47 GPIO95_AC97_nRESET,
48}; 48};
49 49
50void pxa27x_assert_ac97reset(int reset_gpio, int on) 50void pxa27x_assert_ac97reset(int reset_gpio, int on)
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index c1048a35f187..51756c723557 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -847,7 +847,6 @@ static void __init fixup_spitz(struct machine_desc *desc,
847 sharpsl_save_param(); 847 sharpsl_save_param();
848 mi->nr_banks = 1; 848 mi->nr_banks = 1;
849 mi->bank[0].start = 0xa0000000; 849 mi->bank[0].start = 0xa0000000;
850 mi->bank[0].node = 0;
851 mi->bank[0].size = (64*1024*1024); 850 mi->bank[0].size = (64*1024*1024);
852} 851}
853 852
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 7512b822c6ca..83cc3a18c2e9 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -948,7 +948,6 @@ static void __init fixup_tosa(struct machine_desc *desc,
948 sharpsl_save_param(); 948 sharpsl_save_param();
949 mi->nr_banks=1; 949 mi->nr_banks=1;
950 mi->bank[0].start = 0xa0000000; 950 mi->bank[0].start = 0xa0000000;
951 mi->bank[0].node = 0;
952 mi->bank[0].size = (64*1024*1024); 951 mi->bank[0].size = (64*1024*1024);
953} 952}
954 953
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index f78be14f17cb..a54fbda77e45 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -61,12 +61,11 @@ void __iomem *gic_cpu_base_addr;
61/* 61/*
62 * Adjust the zones if there are restrictions for DMA access. 62 * Adjust the zones if there are restrictions for DMA access.
63 */ 63 */
64void __init realview_adjust_zones(int node, unsigned long *size, 64void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)
65 unsigned long *hole)
66{ 65{
67 unsigned long dma_size = SZ_256M >> PAGE_SHIFT; 66 unsigned long dma_size = SZ_256M >> PAGE_SHIFT;
68 67
69 if (!machine_is_realview_pbx() || node || (size[0] <= dma_size)) 68 if (!machine_is_realview_pbx() || size[0] <= dma_size)
70 return; 69 return;
71 70
72 size[ZONE_NORMAL] = size[0] - dma_size; 71 size[ZONE_NORMAL] = size[0] - dma_size;
@@ -232,6 +231,21 @@ static unsigned int realview_mmc_status(struct device *dev)
232 struct amba_device *adev = container_of(dev, struct amba_device, dev); 231 struct amba_device *adev = container_of(dev, struct amba_device, dev);
233 u32 mask; 232 u32 mask;
234 233
234 if (machine_is_realview_pb1176()) {
235 static bool inserted = false;
236
237 /*
238 * The PB1176 does not have the status register,
239 * assume it is inserted at startup, then invert
240 * for each call so card insertion/removal will
241 * be detected anyway. This will not be called if
242 * GPIO on PL061 is active, which is the proper
243 * way to do this on the PB1176.
244 */
245 inserted = !inserted;
246 return inserted ? 0 : 1;
247 }
248
235 if (adev->res.start == REALVIEW_MMCI0_BASE) 249 if (adev->res.start == REALVIEW_MMCI0_BASE)
236 mask = 1; 250 mask = 1;
237 else 251 else
@@ -318,6 +332,12 @@ static struct clk_lookup lookups[] = {
318 }, { /* UART3 */ 332 }, { /* UART3 */
319 .dev_id = "fpga:uart3", 333 .dev_id = "fpga:uart3",
320 .clk = &ref24_clk, 334 .clk = &ref24_clk,
335 }, { /* UART3 is on the dev chip in PB1176 */
336 .dev_id = "dev:uart3",
337 .clk = &ref24_clk,
338 }, { /* UART4 only exists in PB1176 */
339 .dev_id = "fpga:uart4",
340 .clk = &ref24_clk,
321 }, { /* KMI0 */ 341 }, { /* KMI0 */
322 .dev_id = "fpga:kmi0", 342 .dev_id = "fpga:kmi0",
323 .clk = &ref24_clk, 343 .clk = &ref24_clk,
@@ -327,12 +347,15 @@ static struct clk_lookup lookups[] = {
327 }, { /* MMC0 */ 347 }, { /* MMC0 */
328 .dev_id = "fpga:mmc0", 348 .dev_id = "fpga:mmc0",
329 .clk = &ref24_clk, 349 .clk = &ref24_clk,
330 }, { /* EB:CLCD */ 350 }, { /* CLCD is in the PB1176 and EB DevChip */
331 .dev_id = "dev:clcd", 351 .dev_id = "dev:clcd",
332 .clk = &oscvco_clk, 352 .clk = &oscvco_clk,
333 }, { /* PB:CLCD */ 353 }, { /* PB:CLCD */
334 .dev_id = "issp:clcd", 354 .dev_id = "issp:clcd",
335 .clk = &oscvco_clk, 355 .clk = &oscvco_clk,
356 }, { /* SSP */
357 .dev_id = "dev:ssp0",
358 .clk = &ref24_clk,
336 } 359 }
337}; 360};
338 361
diff --git a/arch/arm/mach-realview/include/mach/board-pb1176.h b/arch/arm/mach-realview/include/mach/board-pb1176.h
index 2f5ccb298858..002ab5d8c11c 100644
--- a/arch/arm/mach-realview/include/mach/board-pb1176.h
+++ b/arch/arm/mach-realview/include/mach/board-pb1176.h
@@ -26,6 +26,7 @@
26/* 26/*
27 * Peripheral addresses 27 * Peripheral addresses
28 */ 28 */
29#define REALVIEW_PB1176_UART4_BASE 0x10009000 /* UART 4 */
29#define REALVIEW_PB1176_SCTL_BASE 0x10100000 /* System controller */ 30#define REALVIEW_PB1176_SCTL_BASE 0x10100000 /* System controller */
30#define REALVIEW_PB1176_SMC_BASE 0x10111000 /* SMC */ 31#define REALVIEW_PB1176_SMC_BASE 0x10111000 /* SMC */
31#define REALVIEW_PB1176_DMC_BASE 0x10109000 /* DMC configuration */ 32#define REALVIEW_PB1176_DMC_BASE 0x10109000 /* DMC configuration */
diff --git a/arch/arm/mach-realview/include/mach/irqs-pb1176.h b/arch/arm/mach-realview/include/mach/irqs-pb1176.h
index 830055bb8628..5c3c625e3e04 100644
--- a/arch/arm/mach-realview/include/mach/irqs-pb1176.h
+++ b/arch/arm/mach-realview/include/mach/irqs-pb1176.h
@@ -40,6 +40,7 @@
40#define IRQ_DC1176_L2CC (IRQ_DC1176_GIC_START + 13) 40#define IRQ_DC1176_L2CC (IRQ_DC1176_GIC_START + 13)
41#define IRQ_DC1176_RTC (IRQ_DC1176_GIC_START + 14) 41#define IRQ_DC1176_RTC (IRQ_DC1176_GIC_START + 14)
42#define IRQ_DC1176_CLCD (IRQ_DC1176_GIC_START + 15) /* CLCD controller */ 42#define IRQ_DC1176_CLCD (IRQ_DC1176_GIC_START + 15) /* CLCD controller */
43#define IRQ_DC1176_SSP (IRQ_DC1176_GIC_START + 17) /* SSP port */
43#define IRQ_DC1176_UART0 (IRQ_DC1176_GIC_START + 18) /* UART 0 on development chip */ 44#define IRQ_DC1176_UART0 (IRQ_DC1176_GIC_START + 18) /* UART 0 on development chip */
44#define IRQ_DC1176_UART1 (IRQ_DC1176_GIC_START + 19) /* UART 1 on development chip */ 45#define IRQ_DC1176_UART1 (IRQ_DC1176_GIC_START + 19) /* UART 1 on development chip */
45#define IRQ_DC1176_UART2 (IRQ_DC1176_GIC_START + 20) /* UART 2 on development chip */ 46#define IRQ_DC1176_UART2 (IRQ_DC1176_GIC_START + 20) /* UART 2 on development chip */
@@ -73,7 +74,6 @@
73#define IRQ_PB1176_RTC (IRQ_PB1176_GIC_START + 25) /* Real Time Clock */ 74#define IRQ_PB1176_RTC (IRQ_PB1176_GIC_START + 25) /* Real Time Clock */
74 75
75#define IRQ_PB1176_GPIO0 -1 76#define IRQ_PB1176_GPIO0 -1
76#define IRQ_PB1176_SSP -1
77#define IRQ_PB1176_SCTL -1 77#define IRQ_PB1176_SCTL -1
78 78
79#define NR_GIC_PB1176 2 79#define NR_GIC_PB1176 2
diff --git a/arch/arm/mach-realview/include/mach/memory.h b/arch/arm/mach-realview/include/mach/memory.h
index 2417bbcf97fd..5dafc157b276 100644
--- a/arch/arm/mach-realview/include/mach/memory.h
+++ b/arch/arm/mach-realview/include/mach/memory.h
@@ -30,10 +30,9 @@
30#endif 30#endif
31 31
32#if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA) 32#if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA)
33extern void realview_adjust_zones(int node, unsigned long *size, 33extern void realview_adjust_zones(unsigned long *size, unsigned long *hole);
34 unsigned long *hole); 34#define arch_adjust_zones(size, hole) \
35#define arch_adjust_zones(node, size, hole) \ 35 realview_adjust_zones(size, hole)
36 realview_adjust_zones(node, size, hole)
37 36
38#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1) 37#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1)
39#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M) 38#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M)
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 4425018fab82..991c1f8390e2 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -25,6 +25,7 @@
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
28#include <linux/amba/pl022.h>
28#include <linux/io.h> 29#include <linux/io.h>
29 30
30#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -129,6 +130,12 @@ static struct pl061_platform_data gpio2_plat_data = {
129 .irq_base = -1, 130 .irq_base = -1,
130}; 131};
131 132
133static struct pl022_ssp_controller ssp0_plat_data = {
134 .bus_id = 0,
135 .enable_dma = 0,
136 .num_chipselect = 1,
137};
138
132/* 139/*
133 * RealView EB AMBA devices 140 * RealView EB AMBA devices
134 */ 141 */
@@ -213,7 +220,7 @@ AMBA_DEVICE(sci0, "dev:sci0", SCI, NULL);
213AMBA_DEVICE(uart0, "dev:uart0", EB_UART0, NULL); 220AMBA_DEVICE(uart0, "dev:uart0", EB_UART0, NULL);
214AMBA_DEVICE(uart1, "dev:uart1", EB_UART1, NULL); 221AMBA_DEVICE(uart1, "dev:uart1", EB_UART1, NULL);
215AMBA_DEVICE(uart2, "dev:uart2", EB_UART2, NULL); 222AMBA_DEVICE(uart2, "dev:uart2", EB_UART2, NULL);
216AMBA_DEVICE(ssp0, "dev:ssp0", EB_SSP, NULL); 223AMBA_DEVICE(ssp0, "dev:ssp0", EB_SSP, &ssp0_plat_data);
217 224
218static struct amba_device *amba_devs[] __initdata = { 225static struct amba_device *amba_devs[] __initdata = {
219 &dmac_device, 226 &dmac_device,
@@ -324,6 +331,26 @@ static struct platform_device pmu_device = {
324 .resource = pmu_resources, 331 .resource = pmu_resources,
325}; 332};
326 333
334static struct resource char_lcd_resources[] = {
335 {
336 .start = REALVIEW_CHAR_LCD_BASE,
337 .end = (REALVIEW_CHAR_LCD_BASE + SZ_4K - 1),
338 .flags = IORESOURCE_MEM,
339 },
340 {
341 .start = IRQ_EB_CHARLCD,
342 .end = IRQ_EB_CHARLCD,
343 .flags = IORESOURCE_IRQ,
344 },
345};
346
347static struct platform_device char_lcd_device = {
348 .name = "arm-charlcd",
349 .id = -1,
350 .num_resources = ARRAY_SIZE(char_lcd_resources),
351 .resource = char_lcd_resources,
352};
353
327static void __init gic_init_irq(void) 354static void __init gic_init_irq(void)
328{ 355{
329 if (core_tile_eb11mp() || core_tile_a9mp()) { 356 if (core_tile_eb11mp() || core_tile_a9mp()) {
@@ -442,6 +469,7 @@ static void __init realview_eb_init(void)
442 469
443 realview_flash_register(&realview_eb_flash_resource, 1); 470 realview_flash_register(&realview_eb_flash_resource, 1);
444 platform_device_register(&realview_i2c_device); 471 platform_device_register(&realview_i2c_device);
472 platform_device_register(&char_lcd_device);
445 eth_device_register(); 473 eth_device_register();
446 realview_usb_register(realview_eb_isp1761_resources); 474 realview_usb_register(realview_eb_isp1761_resources);
447 475
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index 099a1f125cf8..d2be12eb829e 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -25,6 +25,7 @@
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
28#include <linux/amba/pl022.h>
28#include <linux/io.h> 29#include <linux/io.h>
29 30
30#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -123,6 +124,12 @@ static struct pl061_platform_data gpio2_plat_data = {
123 .irq_base = -1, 124 .irq_base = -1,
124}; 125};
125 126
127static struct pl022_ssp_controller ssp0_plat_data = {
128 .bus_id = 0,
129 .enable_dma = 0,
130 .num_chipselect = 1,
131};
132
126/* 133/*
127 * RealView PB1176 AMBA devices 134 * RealView PB1176 AMBA devices
128 */ 135 */
@@ -144,8 +151,6 @@ static struct pl061_platform_data gpio2_plat_data = {
144#define MPMC_DMA { 0, 0 } 151#define MPMC_DMA { 0, 0 }
145#define PB1176_CLCD_IRQ { IRQ_DC1176_CLCD, NO_IRQ } 152#define PB1176_CLCD_IRQ { IRQ_DC1176_CLCD, NO_IRQ }
146#define PB1176_CLCD_DMA { 0, 0 } 153#define PB1176_CLCD_DMA { 0, 0 }
147#define DMAC_IRQ { IRQ_PB1176_DMAC, NO_IRQ }
148#define DMAC_DMA { 0, 0 }
149#define SCTL_IRQ { NO_IRQ, NO_IRQ } 154#define SCTL_IRQ { NO_IRQ, NO_IRQ }
150#define SCTL_DMA { 0, 0 } 155#define SCTL_DMA { 0, 0 }
151#define PB1176_WATCHDOG_IRQ { IRQ_DC1176_WATCHDOG, NO_IRQ } 156#define PB1176_WATCHDOG_IRQ { IRQ_DC1176_WATCHDOG, NO_IRQ }
@@ -166,7 +171,9 @@ static struct pl061_platform_data gpio2_plat_data = {
166#define PB1176_UART2_DMA { 11, 10 } 171#define PB1176_UART2_DMA { 11, 10 }
167#define PB1176_UART3_IRQ { IRQ_DC1176_UART3, NO_IRQ } 172#define PB1176_UART3_IRQ { IRQ_DC1176_UART3, NO_IRQ }
168#define PB1176_UART3_DMA { 0x86, 0x87 } 173#define PB1176_UART3_DMA { 0x86, 0x87 }
169#define PB1176_SSP_IRQ { IRQ_PB1176_SSP, NO_IRQ } 174#define PB1176_UART4_IRQ { IRQ_PB1176_UART4, NO_IRQ }
175#define PB1176_UART4_DMA { 0, 0 }
176#define PB1176_SSP_IRQ { IRQ_DC1176_SSP, NO_IRQ }
170#define PB1176_SSP_DMA { 9, 8 } 177#define PB1176_SSP_DMA { 9, 8 }
171 178
172/* FPGA Primecells */ 179/* FPGA Primecells */
@@ -174,7 +181,7 @@ AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL);
174AMBA_DEVICE(mmc0, "fpga:mmc0", MMCI0, &realview_mmc0_plat_data); 181AMBA_DEVICE(mmc0, "fpga:mmc0", MMCI0, &realview_mmc0_plat_data);
175AMBA_DEVICE(kmi0, "fpga:kmi0", KMI0, NULL); 182AMBA_DEVICE(kmi0, "fpga:kmi0", KMI0, NULL);
176AMBA_DEVICE(kmi1, "fpga:kmi1", KMI1, NULL); 183AMBA_DEVICE(kmi1, "fpga:kmi1", KMI1, NULL);
177AMBA_DEVICE(uart3, "fpga:uart3", PB1176_UART3, NULL); 184AMBA_DEVICE(uart4, "fpga:uart4", PB1176_UART4, NULL);
178 185
179/* DevChip Primecells */ 186/* DevChip Primecells */
180AMBA_DEVICE(smc, "dev:smc", PB1176_SMC, NULL); 187AMBA_DEVICE(smc, "dev:smc", PB1176_SMC, NULL);
@@ -188,18 +195,16 @@ AMBA_DEVICE(sci0, "dev:sci0", SCI, NULL);
188AMBA_DEVICE(uart0, "dev:uart0", PB1176_UART0, NULL); 195AMBA_DEVICE(uart0, "dev:uart0", PB1176_UART0, NULL);
189AMBA_DEVICE(uart1, "dev:uart1", PB1176_UART1, NULL); 196AMBA_DEVICE(uart1, "dev:uart1", PB1176_UART1, NULL);
190AMBA_DEVICE(uart2, "dev:uart2", PB1176_UART2, NULL); 197AMBA_DEVICE(uart2, "dev:uart2", PB1176_UART2, NULL);
191AMBA_DEVICE(ssp0, "dev:ssp0", PB1176_SSP, NULL); 198AMBA_DEVICE(uart3, "dev:uart3", PB1176_UART3, NULL);
192 199AMBA_DEVICE(ssp0, "dev:ssp0", PB1176_SSP, &ssp0_plat_data);
193/* Primecells on the NEC ISSP chip */ 200AMBA_DEVICE(clcd, "dev:clcd", PB1176_CLCD, &clcd_plat_data);
194AMBA_DEVICE(clcd, "issp:clcd", PB1176_CLCD, &clcd_plat_data);
195//AMBA_DEVICE(dmac, "issp:dmac", PB1176_DMAC, NULL);
196 201
197static struct amba_device *amba_devs[] __initdata = { 202static struct amba_device *amba_devs[] __initdata = {
198// &dmac_device,
199 &uart0_device, 203 &uart0_device,
200 &uart1_device, 204 &uart1_device,
201 &uart2_device, 205 &uart2_device,
202 &uart3_device, 206 &uart3_device,
207 &uart4_device,
203 &smc_device, 208 &smc_device,
204 &clcd_device, 209 &clcd_device,
205 &sctl_device, 210 &sctl_device,
@@ -276,6 +281,26 @@ static struct platform_device pmu_device = {
276 .resource = &pmu_resource, 281 .resource = &pmu_resource,
277}; 282};
278 283
284static struct resource char_lcd_resources[] = {
285 {
286 .start = REALVIEW_CHAR_LCD_BASE,
287 .end = (REALVIEW_CHAR_LCD_BASE + SZ_4K - 1),
288 .flags = IORESOURCE_MEM,
289 },
290 {
291 .start = IRQ_PB1176_CHARLCD,
292 .end = IRQ_PB1176_CHARLCD,
293 .flags = IORESOURCE_IRQ,
294 },
295};
296
297static struct platform_device char_lcd_device = {
298 .name = "arm-charlcd",
299 .id = -1,
300 .num_resources = ARRAY_SIZE(char_lcd_resources),
301 .resource = char_lcd_resources,
302};
303
279static void __init gic_init_irq(void) 304static void __init gic_init_irq(void)
280{ 305{
281 /* ARM1176 DevChip GIC, primary */ 306 /* ARM1176 DevChip GIC, primary */
@@ -338,6 +363,7 @@ static void __init realview_pb1176_init(void)
338 platform_device_register(&realview_i2c_device); 363 platform_device_register(&realview_i2c_device);
339 realview_usb_register(realview_pb1176_isp1761_resources); 364 realview_usb_register(realview_pb1176_isp1761_resources);
340 platform_device_register(&pmu_device); 365 platform_device_register(&pmu_device);
366 platform_device_register(&char_lcd_device);
341 367
342 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 368 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
343 struct amba_device *d = amba_devs[i]; 369 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 0e07a5ccb75f..d591bc00b86e 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -25,6 +25,7 @@
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
28#include <linux/amba/pl022.h>
28#include <linux/io.h> 29#include <linux/io.h>
29 30
30#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -124,6 +125,12 @@ static struct pl061_platform_data gpio2_plat_data = {
124 .irq_base = -1, 125 .irq_base = -1,
125}; 126};
126 127
128static struct pl022_ssp_controller ssp0_plat_data = {
129 .bus_id = 0,
130 .enable_dma = 0,
131 .num_chipselect = 1,
132};
133
127/* 134/*
128 * RealView PB11MPCore AMBA devices 135 * RealView PB11MPCore AMBA devices
129 */ 136 */
@@ -190,7 +197,7 @@ AMBA_DEVICE(sci0, "dev:sci0", SCI, NULL);
190AMBA_DEVICE(uart0, "dev:uart0", PB11MP_UART0, NULL); 197AMBA_DEVICE(uart0, "dev:uart0", PB11MP_UART0, NULL);
191AMBA_DEVICE(uart1, "dev:uart1", PB11MP_UART1, NULL); 198AMBA_DEVICE(uart1, "dev:uart1", PB11MP_UART1, NULL);
192AMBA_DEVICE(uart2, "dev:uart2", PB11MP_UART2, NULL); 199AMBA_DEVICE(uart2, "dev:uart2", PB11MP_UART2, NULL);
193AMBA_DEVICE(ssp0, "dev:ssp0", PB11MP_SSP, NULL); 200AMBA_DEVICE(ssp0, "dev:ssp0", PB11MP_SSP, &ssp0_plat_data);
194 201
195/* Primecells on the NEC ISSP chip */ 202/* Primecells on the NEC ISSP chip */
196AMBA_DEVICE(clcd, "issp:clcd", PB11MP_CLCD, &clcd_plat_data); 203AMBA_DEVICE(clcd, "issp:clcd", PB11MP_CLCD, &clcd_plat_data);
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index ac2f06f1ca50..6c37621217bc 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -25,6 +25,7 @@
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
28#include <linux/amba/pl022.h>
28#include <linux/io.h> 29#include <linux/io.h>
29 30
30#include <asm/irq.h> 31#include <asm/irq.h>
@@ -114,6 +115,12 @@ static struct pl061_platform_data gpio2_plat_data = {
114 .irq_base = -1, 115 .irq_base = -1,
115}; 116};
116 117
118static struct pl022_ssp_controller ssp0_plat_data = {
119 .bus_id = 0,
120 .enable_dma = 0,
121 .num_chipselect = 1,
122};
123
117/* 124/*
118 * RealView PBA8Core AMBA devices 125 * RealView PBA8Core AMBA devices
119 */ 126 */
@@ -180,7 +187,7 @@ AMBA_DEVICE(sci0, "dev:sci0", SCI, NULL);
180AMBA_DEVICE(uart0, "dev:uart0", PBA8_UART0, NULL); 187AMBA_DEVICE(uart0, "dev:uart0", PBA8_UART0, NULL);
181AMBA_DEVICE(uart1, "dev:uart1", PBA8_UART1, NULL); 188AMBA_DEVICE(uart1, "dev:uart1", PBA8_UART1, NULL);
182AMBA_DEVICE(uart2, "dev:uart2", PBA8_UART2, NULL); 189AMBA_DEVICE(uart2, "dev:uart2", PBA8_UART2, NULL);
183AMBA_DEVICE(ssp0, "dev:ssp0", PBA8_SSP, NULL); 190AMBA_DEVICE(ssp0, "dev:ssp0", PBA8_SSP, &ssp0_plat_data);
184 191
185/* Primecells on the NEC ISSP chip */ 192/* Primecells on the NEC ISSP chip */
186AMBA_DEVICE(clcd, "issp:clcd", PBA8_CLCD, &clcd_plat_data); 193AMBA_DEVICE(clcd, "issp:clcd", PBA8_CLCD, &clcd_plat_data);
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 08fd683adc4c..9428eff0b116 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -24,6 +24,7 @@
24#include <linux/amba/bus.h> 24#include <linux/amba/bus.h>
25#include <linux/amba/pl061.h> 25#include <linux/amba/pl061.h>
26#include <linux/amba/mmci.h> 26#include <linux/amba/mmci.h>
27#include <linux/amba/pl022.h>
27#include <linux/io.h> 28#include <linux/io.h>
28 29
29#include <asm/irq.h> 30#include <asm/irq.h>
@@ -136,6 +137,12 @@ static struct pl061_platform_data gpio2_plat_data = {
136 .irq_base = -1, 137 .irq_base = -1,
137}; 138};
138 139
140static struct pl022_ssp_controller ssp0_plat_data = {
141 .bus_id = 0,
142 .enable_dma = 0,
143 .num_chipselect = 1,
144};
145
139/* 146/*
140 * RealView PBXCore AMBA devices 147 * RealView PBXCore AMBA devices
141 */ 148 */
@@ -202,7 +209,7 @@ AMBA_DEVICE(sci0, "dev:sci0", SCI, NULL);
202AMBA_DEVICE(uart0, "dev:uart0", PBX_UART0, NULL); 209AMBA_DEVICE(uart0, "dev:uart0", PBX_UART0, NULL);
203AMBA_DEVICE(uart1, "dev:uart1", PBX_UART1, NULL); 210AMBA_DEVICE(uart1, "dev:uart1", PBX_UART1, NULL);
204AMBA_DEVICE(uart2, "dev:uart2", PBX_UART2, NULL); 211AMBA_DEVICE(uart2, "dev:uart2", PBX_UART2, NULL);
205AMBA_DEVICE(ssp0, "dev:ssp0", PBX_SSP, NULL); 212AMBA_DEVICE(ssp0, "dev:ssp0", PBX_SSP, &ssp0_plat_data);
206 213
207/* Primecells on the NEC ISSP chip */ 214/* Primecells on the NEC ISSP chip */
208AMBA_DEVICE(clcd, "issp:clcd", PBX_CLCD, &clcd_plat_data); 215AMBA_DEVICE(clcd, "issp:clcd", PBX_CLCD, &clcd_plat_data);
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 779b45b3f80f..3ba3bab139d0 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -15,6 +15,7 @@
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/memblock.h>
18#include <linux/timer.h> 19#include <linux/timer.h>
19#include <linux/init.h> 20#include <linux/init.h>
20#include <linux/sysdev.h> 21#include <linux/sysdev.h>
@@ -304,6 +305,13 @@ static void __init h1940_map_io(void)
304 s3c_pm_init(); 305 s3c_pm_init();
305} 306}
306 307
308/* H1940 and RX3715 need to reserve this for suspend */
309static void __init h1940_reserve(void)
310{
311 memblock_reserve(0x30003000, 0x1000);
312 memblock_reserve(0x30081000, 0x1000);
313}
314
307static void __init h1940_init_irq(void) 315static void __init h1940_init_irq(void)
308{ 316{
309 s3c24xx_init_irq(); 317 s3c24xx_init_irq();
@@ -346,6 +354,7 @@ MACHINE_START(H1940, "IPAQ-H1940")
346 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, 354 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
347 .boot_params = S3C2410_SDRAM_PA + 0x100, 355 .boot_params = S3C2410_SDRAM_PA + 0x100,
348 .map_io = h1940_map_io, 356 .map_io = h1940_map_io,
357 .reserve = h1940_reserve,
349 .init_irq = h1940_init_irq, 358 .init_irq = h1940_init_irq,
350 .init_machine = h1940_init, 359 .init_machine = h1940_init,
351 .timer = &s3c24xx_timer, 360 .timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index ba93a356a839..054c9f92232a 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -119,7 +119,6 @@ static void __init smdk2413_fixup(struct machine_desc *desc,
119 mi->nr_banks=1; 119 mi->nr_banks=1;
120 mi->bank[0].start = 0x30000000; 120 mi->bank[0].start = 0x30000000;
121 mi->bank[0].size = SZ_64M; 121 mi->bank[0].size = SZ_64M;
122 mi->bank[0].node = 0;
123 } 122 }
124} 123}
125 124
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index 3ca9265b6997..f291ac25d312 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -137,7 +137,6 @@ static void __init vstms_fixup(struct machine_desc *desc,
137 mi->nr_banks=1; 137 mi->nr_banks=1;
138 mi->bank[0].start = 0x30000000; 138 mi->bank[0].start = 0x30000000;
139 mi->bank[0].size = SZ_64M; 139 mi->bank[0].size = SZ_64M;
140 mi->bank[0].node = 0;
141 } 140 }
142} 141}
143 142
diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c b/arch/arm/mach-s3c2440/mach-rx1950.c
index 8603b577a24b..142d1f921176 100644
--- a/arch/arm/mach-s3c2440/mach-rx1950.c
+++ b/arch/arm/mach-s3c2440/mach-rx1950.c
@@ -15,6 +15,7 @@
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/memblock.h>
18#include <linux/delay.h> 19#include <linux/delay.h>
19#include <linux/timer.h> 20#include <linux/timer.h>
20#include <linux/init.h> 21#include <linux/init.h>
@@ -570,12 +571,20 @@ static void __init rx1950_init_machine(void)
570 platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices)); 571 platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices));
571} 572}
572 573
574/* H1940 and RX3715 need to reserve this for suspend */
575static void __init rx1950_reserve(void)
576{
577 memblock_reserve(0x30003000, 0x1000);
578 memblock_reserve(0x30081000, 0x1000);
579}
580
573MACHINE_START(RX1950, "HP iPAQ RX1950") 581MACHINE_START(RX1950, "HP iPAQ RX1950")
574 /* Maintainers: Vasily Khoruzhick */ 582 /* Maintainers: Vasily Khoruzhick */
575 .phys_io = S3C2410_PA_UART, 583 .phys_io = S3C2410_PA_UART,
576 .io_pg_offst = (((u32) S3C24XX_VA_UART) >> 18) & 0xfffc, 584 .io_pg_offst = (((u32) S3C24XX_VA_UART) >> 18) & 0xfffc,
577 .boot_params = S3C2410_SDRAM_PA + 0x100, 585 .boot_params = S3C2410_SDRAM_PA + 0x100,
578 .map_io = rx1950_map_io, 586 .map_io = rx1950_map_io,
587 .reserve = rx1950_reserve,
579 .init_irq = s3c24xx_init_irq, 588 .init_irq = s3c24xx_init_irq,
580 .init_machine = rx1950_init_machine, 589 .init_machine = rx1950_init_machine,
581 .timer = &s3c24xx_timer, 590 .timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index d2946de3f365..6bb44f75a9ce 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -15,6 +15,7 @@
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/memblock.h>
18#include <linux/timer.h> 19#include <linux/timer.h>
19#include <linux/init.h> 20#include <linux/init.h>
20#include <linux/tty.h> 21#include <linux/tty.h>
@@ -191,6 +192,13 @@ static void __init rx3715_map_io(void)
191 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs)); 192 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
192} 193}
193 194
195/* H1940 and RX3715 need to reserve this for suspend */
196static void __init rx3715_reserve(void)
197{
198 memblock_reserve(0x30003000, 0x1000);
199 memblock_reserve(0x30081000, 0x1000);
200}
201
194static void __init rx3715_init_irq(void) 202static void __init rx3715_init_irq(void)
195{ 203{
196 s3c24xx_init_irq(); 204 s3c24xx_init_irq();
@@ -214,6 +222,7 @@ MACHINE_START(RX3715, "IPAQ-RX3715")
214 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, 222 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
215 .boot_params = S3C2410_SDRAM_PA + 0x100, 223 .boot_params = S3C2410_SDRAM_PA + 0x100,
216 .map_io = rx3715_map_io, 224 .map_io = rx3715_map_io,
225 .reserve = rx3715_reserve,
217 .init_irq = rx3715_init_irq, 226 .init_irq = rx3715_init_irq,
218 .init_machine = rx3715_init_machine, 227 .init_machine = rx3715_init_machine,
219 .timer = &s3c24xx_timer, 228 .timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index ec03f187c52b..b7a9a601c2d1 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -13,8 +13,7 @@ extern void __init sa1100_init_gpio(void);
13 13
14#define SET_BANK(__nr,__start,__size) \ 14#define SET_BANK(__nr,__start,__size) \
15 mi->bank[__nr].start = (__start), \ 15 mi->bank[__nr].start = (__start), \
16 mi->bank[__nr].size = (__size), \ 16 mi->bank[__nr].size = (__size)
17 mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
18 17
19extern void (*sa1100fb_backlight_power)(int on); 18extern void (*sa1100fb_backlight_power)(int on);
20extern void (*sa1100fb_lcd_power)(int on); 19extern void (*sa1100fb_lcd_power)(int on);
diff --git a/arch/arm/mach-sa1100/include/mach/memory.h b/arch/arm/mach-sa1100/include/mach/memory.h
index d5277f9bee77..128a1dfa96b9 100644
--- a/arch/arm/mach-sa1100/include/mach/memory.h
+++ b/arch/arm/mach-sa1100/include/mach/memory.h
@@ -17,10 +17,10 @@
17#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
18 18
19#ifdef CONFIG_SA1111 19#ifdef CONFIG_SA1111
20void sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes); 20void sa1111_adjust_zones(unsigned long *size, unsigned long *holes);
21 21
22#define arch_adjust_zones(node, size, holes) \ 22#define arch_adjust_zones(size, holes) \
23 sa1111_adjust_zones(node, size, holes) 23 sa1111_adjust_zones(size, holes)
24 24
25#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_1M - 1) 25#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_1M - 1)
26#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_1M) 26#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_1M)
diff --git a/arch/arm/mach-shark/include/mach/debug-macro.S b/arch/arm/mach-shark/include/mach/debug-macro.S
index 50f071c5bf4d..5ea24d4d1ba6 100644
--- a/arch/arm/mach-shark/include/mach/debug-macro.S
+++ b/arch/arm/mach-shark/include/mach/debug-macro.S
@@ -20,6 +20,9 @@
20 strb \rd, [\rx] 20 strb \rd, [\rx]
21 .endm 21 .endm
22 22
23 .macro waituart,rd,rx
24 .endm
25
23 .macro busyuart,rd,rx 26 .macro busyuart,rd,rx
24 mov \rd, #0 27 mov \rd, #0
251001: add \rd, \rd, #1 281001: add \rd, \rd, #1
diff --git a/arch/arm/mach-shark/include/mach/memory.h b/arch/arm/mach-shark/include/mach/memory.h
index 3053e5b7f168..d9c4812f1c31 100644
--- a/arch/arm/mach-shark/include/mach/memory.h
+++ b/arch/arm/mach-shark/include/mach/memory.h
@@ -19,9 +19,8 @@
19 19
20#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
21 21
22static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsigned long *zhole_size) 22static inline void __arch_adjust_zones(unsigned long *zone_size, unsigned long *zhole_size)
23{ 23{
24 if (node != 0) return;
25 /* Only the first 4 MB (=1024 Pages) are usable for DMA */ 24 /* Only the first 4 MB (=1024 Pages) are usable for DMA */
26 /* See dev / -> .properties in OpenFirmware. */ 25 /* See dev / -> .properties in OpenFirmware. */
27 zone_size[1] = zone_size[0] - 1024; 26 zone_size[1] = zone_size[0] - 1024;
@@ -30,8 +29,8 @@ static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsig
30 zhole_size[0] = 0; 29 zhole_size[0] = 0;
31} 30}
32 31
33#define arch_adjust_zones(node, size, holes) \ 32#define arch_adjust_zones(size, holes) \
34 __arch_adjust_zones(node, size, holes) 33 __arch_adjust_zones(size, holes)
35 34
36#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_4M - 1) 35#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_4M - 1)
37#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_4M) 36#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_4M)
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index f2b88c5fe142..4c704b4e8b34 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -70,6 +70,18 @@ endmenu
70 70
71menu "Timer and clock configuration" 71menu "Timer and clock configuration"
72 72
73config SHMOBILE_TIMER_HZ
74 int "Kernel HZ (jiffies per second)"
75 range 32 1024
76 default "128"
77 help
78 Allows the configuration of the timer frequency. It is customary
79 to have the timer interrupt run at 1000 Hz or 100 Hz, but in the
80 case of low timer frequencies other values may be more suitable.
81 SH-Mobile systems using a 32768 Hz RCLK for clock events may want
82 to select a HZ value such as 128 that can evenly divide RCLK.
83 A HZ value that does not divide evenly may cause timer drift.
84
73config SH_TIMER_CMT 85config SH_TIMER_CMT
74 bool "CMT timer driver" 86 bool "CMT timer driver"
75 default y 87 default y
diff --git a/arch/arm/mach-shmobile/include/mach/irqs.h b/arch/arm/mach-shmobile/include/mach/irqs.h
index 5179b72e1ee3..132256bb8c81 100644
--- a/arch/arm/mach-shmobile/include/mach/irqs.h
+++ b/arch/arm/mach-shmobile/include/mach/irqs.h
@@ -2,7 +2,6 @@
2#define __ASM_MACH_IRQS_H 2#define __ASM_MACH_IRQS_H
3 3
4#define NR_IRQS 512 4#define NR_IRQS 512
5#define NR_IRQS_LEGACY 8
6 5
7#define evt2irq(evt) (((evt) >> 5) - 16) 6#define evt2irq(evt) (((evt) >> 5) - 16)
8#define irq2evt(irq) (((irq) + 16) << 5) 7#define irq2evt(irq) (((irq) + 16) << 5)
diff --git a/arch/arm/mach-u300/u300.c b/arch/arm/mach-u300/u300.c
index d2a0b8847a18..bfcda9820888 100644
--- a/arch/arm/mach-u300/u300.c
+++ b/arch/arm/mach-u300/u300.c
@@ -14,6 +14,7 @@
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/ioport.h> 16#include <linux/ioport.h>
17#include <linux/memblock.h>
17#include <linux/platform_device.h> 18#include <linux/platform_device.h>
18#include <linux/io.h> 19#include <linux/io.h>
19#include <mach/hardware.h> 20#include <mach/hardware.h>
@@ -22,6 +23,21 @@
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
24 25
26static void __init u300_reserve(void)
27{
28 /*
29 * U300 - This platform family can share physical memory
30 * between two ARM cpus, one running Linux and the other
31 * running another OS.
32 */
33#ifdef CONFIG_MACH_U300_SINGLE_RAM
34#if ((CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1) == 1) && \
35 CONFIG_MACH_U300_2MB_ALIGNMENT_FIX
36 memblock_reserve(PHYS_OFFSET, 0x00100000);
37#endif
38#endif
39}
40
25static void __init u300_init_machine(void) 41static void __init u300_init_machine(void)
26{ 42{
27 u300_init_devices(); 43 u300_init_devices();
@@ -49,6 +65,7 @@ MACHINE_START(U300, MACH_U300_STRING)
49 .io_pg_offst = ((U300_AHB_PER_VIRT_BASE) >> 18) & 0xfffc, 65 .io_pg_offst = ((U300_AHB_PER_VIRT_BASE) >> 18) & 0xfffc,
50 .boot_params = BOOT_PARAMS_OFFSET, 66 .boot_params = BOOT_PARAMS_OFFSET,
51 .map_io = u300_map_io, 67 .map_io = u300_map_io,
68 .reserve = u300_reserve,
52 .init_irq = u300_init_irq, 69 .init_irq = u300_init_irq,
53 .timer = &u300_timer, 70 .timer = &u300_timer,
54 .init_machine = u300_init_machine, 71 .init_machine = u300_init_machine,
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index bb8d7b771817..0e8fd135a57d 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -13,19 +13,42 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/gpio.h>
16#include <linux/amba/bus.h> 17#include <linux/amba/bus.h>
17#include <linux/amba/pl022.h> 18#include <linux/amba/pl022.h>
18#include <linux/spi/spi.h> 19#include <linux/spi/spi.h>
20#include <linux/mfd/ab8500.h>
19 21
20#include <asm/mach-types.h> 22#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
22 24
25#include <plat/pincfg.h>
23#include <plat/i2c.h> 26#include <plat/i2c.h>
24 27
25#include <mach/hardware.h> 28#include <mach/hardware.h>
26#include <mach/setup.h> 29#include <mach/setup.h>
27#include <mach/devices.h> 30#include <mach/devices.h>
28 31
32#include "pins-db8500.h"
33
34static pin_cfg_t mop500_pins[] = {
35 /* SSP0 */
36 GPIO143_SSP0_CLK,
37 GPIO144_SSP0_FRM,
38 GPIO145_SSP0_RXD,
39 GPIO146_SSP0_TXD,
40
41 /* I2C */
42 GPIO147_I2C0_SCL,
43 GPIO148_I2C0_SDA,
44 GPIO16_I2C1_SCL,
45 GPIO17_I2C1_SDA,
46 GPIO10_I2C2_SDA,
47 GPIO11_I2C2_SCL,
48 GPIO229_I2C3_SDA,
49 GPIO230_I2C3_SCL,
50};
51
29static void ab4500_spi_cs_control(u32 command) 52static void ab4500_spi_cs_control(u32 command)
30{ 53{
31 /* set the FRM signal, which is CS - TODO */ 54 /* set the FRM signal, which is CS - TODO */
@@ -48,15 +71,20 @@ struct pl022_config_chip ab4500_chip_info = {
48 .cs_control = ab4500_spi_cs_control, 71 .cs_control = ab4500_spi_cs_control,
49}; 72};
50 73
74static struct ab8500_platform_data ab8500_platdata = {
75 .irq_base = MOP500_AB8500_IRQ_BASE,
76};
77
51static struct spi_board_info u8500_spi_devices[] = { 78static struct spi_board_info u8500_spi_devices[] = {
52 { 79 {
53 .modalias = "ab8500", 80 .modalias = "ab8500",
54 .controller_data = &ab4500_chip_info, 81 .controller_data = &ab4500_chip_info,
82 .platform_data = &ab8500_platdata,
55 .max_speed_hz = 12000000, 83 .max_speed_hz = 12000000,
56 .bus_num = 0, 84 .bus_num = 0,
57 .chip_select = 0, 85 .chip_select = 0,
58 .mode = SPI_MODE_0, 86 .mode = SPI_MODE_0,
59 .irq = IRQ_AB4500, 87 .irq = IRQ_DB8500_AB8500,
60 }, 88 },
61}; 89};
62 90
@@ -118,6 +146,10 @@ static void __init u8500_init_machine(void)
118{ 146{
119 int i; 147 int i;
120 148
149 u8500_init_devices();
150
151 nmk_config_pins(mop500_pins, ARRAY_SIZE(mop500_pins));
152
121 u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data; 153 u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data;
122 ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data; 154 ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data;
123 ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data; 155 ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data;
@@ -133,8 +165,6 @@ static void __init u8500_init_machine(void)
133 165
134 spi_register_board_info(u8500_spi_devices, 166 spi_register_board_info(u8500_spi_devices,
135 ARRAY_SIZE(u8500_spi_devices)); 167 ARRAY_SIZE(u8500_spi_devices));
136
137 u8500_init_devices();
138} 168}
139 169
140MACHINE_START(U8500, "ST-Ericsson MOP500 platform") 170MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c
index 822903421943..654fca944e65 100644
--- a/arch/arm/mach-ux500/devices-db8500.c
+++ b/arch/arm/mach-ux500/devices-db8500.c
@@ -65,7 +65,7 @@ struct amba_device u8500_ssp0_device = {
65 .end = U8500_SSP0_BASE + SZ_4K - 1, 65 .end = U8500_SSP0_BASE + SZ_4K - 1,
66 .flags = IORESOURCE_MEM, 66 .flags = IORESOURCE_MEM,
67 }, 67 },
68 .irq = {IRQ_SSP0, NO_IRQ }, 68 .irq = {IRQ_DB8500_SSP0, NO_IRQ },
69 /* ST-Ericsson modified id */ 69 /* ST-Ericsson modified id */
70 .periphid = SSP_PER_ID, 70 .periphid = SSP_PER_ID,
71}; 71};
@@ -77,8 +77,8 @@ static struct resource u8500_i2c0_resources[] = {
77 .flags = IORESOURCE_MEM, 77 .flags = IORESOURCE_MEM,
78 }, 78 },
79 [1] = { 79 [1] = {
80 .start = IRQ_I2C0, 80 .start = IRQ_DB8500_I2C0,
81 .end = IRQ_I2C0, 81 .end = IRQ_DB8500_I2C0,
82 .flags = IORESOURCE_IRQ, 82 .flags = IORESOURCE_IRQ,
83 } 83 }
84}; 84};
@@ -97,8 +97,8 @@ static struct resource u8500_i2c4_resources[] = {
97 .flags = IORESOURCE_MEM, 97 .flags = IORESOURCE_MEM,
98 }, 98 },
99 [1] = { 99 [1] = {
100 .start = IRQ_I2C4, 100 .start = IRQ_DB8500_I2C4,
101 .end = IRQ_I2C4, 101 .end = IRQ_DB8500_I2C4,
102 .flags = IORESOURCE_IRQ, 102 .flags = IORESOURCE_IRQ,
103 } 103 }
104}; 104};
@@ -130,8 +130,8 @@ static struct resource dma40_resources[] = {
130 .name = "lcla", 130 .name = "lcla",
131 }, 131 },
132 [3] = { 132 [3] = {
133 .start = IRQ_DMA, 133 .start = IRQ_DB8500_DMA,
134 .end = IRQ_DMA, 134 .end = IRQ_DB8500_DMA,
135 .flags = IORESOURCE_IRQ} 135 .flags = IORESOURCE_IRQ}
136}; 136};
137 137
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
index 000000000000..cca4f705601e
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef __MACH_IRQS_BOARD_MOP500_H
9#define __MACH_IRQS_BOARD_MOP500_H
10
11#define AB8500_NR_IRQS 104
12
13#define MOP500_AB8500_IRQ_BASE IRQ_BOARD_START
14#define MOP500_AB8500_IRQ_END (MOP500_AB8500_IRQ_BASE \
15 + AB8500_NR_IRQS)
16#define MOP500_IRQ_END MOP500_AB8500_IRQ_END
17
18#if MOP500_IRQ_END > IRQ_BOARD_END
19#undef IRQ_BOARD_END
20#define IRQ_BOARD_END MOP500_IRQ_END
21#endif
22
23#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
index 000000000000..6fbfe5e2065a
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/irqs-db5500.h
@@ -0,0 +1,85 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef __MACH_IRQS_DB5500_H
9#define __MACH_IRQS_DB5500_H
10
11#define IRQ_DB5500_MTU0 (IRQ_SHPI_START + 4)
12#define IRQ_DB5500_SPI2 (IRQ_SHPI_START + 6)
13#define IRQ_DB5500_PMU0 (IRQ_SHPI_START + 7)
14#define IRQ_DB5500_SPI0 (IRQ_SHPI_START + 8)
15#define IRQ_DB5500_RTT (IRQ_SHPI_START + 9)
16#define IRQ_DB5500_PKA (IRQ_SHPI_START + 10)
17#define IRQ_DB5500_UART0 (IRQ_SHPI_START + 11)
18#define IRQ_DB5500_I2C3 (IRQ_SHPI_START + 12)
19#define IRQ_DB5500_L2CC (IRQ_SHPI_START + 13)
20#define IRQ_DB5500_MSP0 (IRQ_SHPI_START + 14)
21#define IRQ_DB5500_CRYP1 (IRQ_SHPI_START + 15)
22#define IRQ_DB5500_PMU1 (IRQ_SHPI_START + 16)
23#define IRQ_DB5500_MTU1 (IRQ_SHPI_START + 17)
24#define IRQ_DB5500_RTC (IRQ_SHPI_START + 18)
25#define IRQ_DB5500_UART1 (IRQ_SHPI_START + 19)
26#define IRQ_DB5500_USB_WAKEUP (IRQ_SHPI_START + 20)
27#define IRQ_DB5500_I2C0 (IRQ_SHPI_START + 21)
28#define IRQ_DB5500_I2C1 (IRQ_SHPI_START + 22)
29#define IRQ_DB5500_USBOTG (IRQ_SHPI_START + 23)
30#define IRQ_DB5500_DMA_SECURE (IRQ_SHPI_START + 24)
31#define IRQ_DB5500_DMA (IRQ_SHPI_START + 25)
32#define IRQ_DB5500_UART2 (IRQ_SHPI_START + 26)
33#define IRQ_DB5500_ICN_PMU1 (IRQ_SHPI_START + 27)
34#define IRQ_DB5500_ICN_PMU2 (IRQ_SHPI_START + 28)
35#define IRQ_DB5500_UART3 (IRQ_SHPI_START + 29)
36#define IRQ_DB5500_SPI3 (IRQ_SHPI_START + 30)
37#define IRQ_DB5500_SDMMC4 (IRQ_SHPI_START + 31)
38#define IRQ_DB5500_IRRC (IRQ_SHPI_START + 33)
39#define IRQ_DB5500_IRDA_FT (IRQ_SHPI_START + 34)
40#define IRQ_DB5500_IRDA_SD (IRQ_SHPI_START + 35)
41#define IRQ_DB5500_IRDA_FI (IRQ_SHPI_START + 36)
42#define IRQ_DB5500_IRDA_FD (IRQ_SHPI_START + 37)
43#define IRQ_DB5500_FSMC_CODEREADY (IRQ_SHPI_START + 38)
44#define IRQ_DB5500_FSMC_NANDWAIT (IRQ_SHPI_START + 39)
45#define IRQ_DB5500_AB5500 (IRQ_SHPI_START + 40)
46#define IRQ_DB5500_SDMMC2 (IRQ_SHPI_START + 41)
47#define IRQ_DB5500_SIA (IRQ_SHPI_START + 42)
48#define IRQ_DB5500_SIA2 (IRQ_SHPI_START + 43)
49#define IRQ_DB5500_HVA (IRQ_SHPI_START + 44)
50#define IRQ_DB5500_HVA2 (IRQ_SHPI_START + 45)
51#define IRQ_DB5500_PRCMU0 (IRQ_SHPI_START + 46)
52#define IRQ_DB5500_PRCMU1 (IRQ_SHPI_START + 47)
53#define IRQ_DB5500_DISP (IRQ_SHPI_START + 48)
54#define IRQ_DB5500_SDMMC1 (IRQ_SHPI_START + 50)
55#define IRQ_DB5500_MSP1 (IRQ_SHPI_START + 52)
56#define IRQ_DB5500_KBD (IRQ_SHPI_START + 53)
57#define IRQ_DB5500_I2C2 (IRQ_SHPI_START + 55)
58#define IRQ_DB5500_B2R2 (IRQ_SHPI_START + 56)
59#define IRQ_DB5500_CRYP0 (IRQ_SHPI_START + 57)
60#define IRQ_DB5500_SDMMC3 (IRQ_SHPI_START + 59)
61#define IRQ_DB5500_SDMMC0 (IRQ_SHPI_START + 60)
62#define IRQ_DB5500_HSEM (IRQ_SHPI_START + 61)
63#define IRQ_DB5500_SBAG (IRQ_SHPI_START + 63)
64#define IRQ_DB5500_SPI1 (IRQ_SHPI_START + 96)
65#define IRQ_DB5500_MSP2 (IRQ_SHPI_START + 98)
66#define IRQ_DB5500_SRPTIMER (IRQ_SHPI_START + 101)
67#define IRQ_DB5500_CTI0 (IRQ_SHPI_START + 108)
68#define IRQ_DB5500_CTI1 (IRQ_SHPI_START + 109)
69#define IRQ_DB5500_ICN_ERR (IRQ_SHPI_START + 110)
70#define IRQ_DB5500_MALI_PPMMU (IRQ_SHPI_START + 112)
71#define IRQ_DB5500_MALI_PP (IRQ_SHPI_START + 113)
72#define IRQ_DB5500_MALI_GPMMU (IRQ_SHPI_START + 114)
73#define IRQ_DB5500_MALI_GP (IRQ_SHPI_START + 115)
74#define IRQ_DB5500_MALI (IRQ_SHPI_START + 116)
75#define IRQ_DB5500_PRCMU_SEM (IRQ_SHPI_START + 118)
76#define IRQ_DB5500_GPIO0 (IRQ_SHPI_START + 119)
77#define IRQ_DB5500_GPIO1 (IRQ_SHPI_START + 120)
78#define IRQ_DB5500_GPIO2 (IRQ_SHPI_START + 121)
79#define IRQ_DB5500_GPIO3 (IRQ_SHPI_START + 122)
80#define IRQ_DB5500_GPIO4 (IRQ_SHPI_START + 123)
81#define IRQ_DB5500_GPIO5 (IRQ_SHPI_START + 124)
82#define IRQ_DB5500_GPIO6 (IRQ_SHPI_START + 125)
83#define IRQ_DB5500_GPIO7 (IRQ_SHPI_START + 126)
84
85#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
index 000000000000..8b5d9f0a1633
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/irqs-db8500.h
@@ -0,0 +1,96 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef __MACH_IRQS_DB8500_H
9#define __MACH_IRQS_DB8500_H
10
11#define IRQ_DB8500_MTU0 (IRQ_SHPI_START + 4)
12#define IRQ_DB8500_SPI2 (IRQ_SHPI_START + 6)
13#define IRQ_DB8500_PMU (IRQ_SHPI_START + 7)
14#define IRQ_DB8500_SPI0 (IRQ_SHPI_START + 8)
15#define IRQ_DB8500_RTT (IRQ_SHPI_START + 9)
16#define IRQ_DB8500_PKA (IRQ_SHPI_START + 10)
17#define IRQ_DB8500_UART0 (IRQ_SHPI_START + 11)
18#define IRQ_DB8500_I2C3 (IRQ_SHPI_START + 12)
19#define IRQ_DB8500_L2CC (IRQ_SHPI_START + 13)
20#define IRQ_DB8500_SSP0 (IRQ_SHPI_START + 14)
21#define IRQ_DB8500_CRYP1 (IRQ_SHPI_START + 15)
22#define IRQ_DB8500_MSP1_RX (IRQ_SHPI_START + 16)
23#define IRQ_DB8500_MTU1 (IRQ_SHPI_START + 17)
24#define IRQ_DB8500_RTC (IRQ_SHPI_START + 18)
25#define IRQ_DB8500_UART1 (IRQ_SHPI_START + 19)
26#define IRQ_DB8500_USB_WAKEUP (IRQ_SHPI_START + 20)
27#define IRQ_DB8500_I2C0 (IRQ_SHPI_START + 21)
28#define IRQ_DB8500_I2C1 (IRQ_SHPI_START + 22)
29#define IRQ_DB8500_USBOTG (IRQ_SHPI_START + 23)
30#define IRQ_DB8500_DMA_SECURE (IRQ_SHPI_START + 24)
31#define IRQ_DB8500_DMA (IRQ_SHPI_START + 25)
32#define IRQ_DB8500_UART2 (IRQ_SHPI_START + 26)
33#define IRQ_DB8500_ICN_PMU1 (IRQ_SHPI_START + 27)
34#define IRQ_DB8500_ICN_PMU2 (IRQ_SHPI_START + 28)
35#define IRQ_DB8500_HSIR_EXCEP (IRQ_SHPI_START + 29)
36#define IRQ_DB8500_MSP0 (IRQ_SHPI_START + 31)
37#define IRQ_DB8500_HSIR_CH0_OVRRUN (IRQ_SHPI_START + 32)
38#define IRQ_DB8500_HSIR_CH1_OVRRUN (IRQ_SHPI_START + 33)
39#define IRQ_DB8500_HSIR_CH2_OVRRUN (IRQ_SHPI_START + 34)
40#define IRQ_DB8500_HSIR_CH3_OVRRUN (IRQ_SHPI_START + 35)
41#define IRQ_DB8500_HSIR_CH4_OVRRUN (IRQ_SHPI_START + 36)
42#define IRQ_DB8500_HSIR_CH5_OVRRUN (IRQ_SHPI_START + 37)
43#define IRQ_DB8500_HSIR_CH6_OVRRUN (IRQ_SHPI_START + 38)
44#define IRQ_DB8500_HSIR_CH7_OVRRUN (IRQ_SHPI_START + 39)
45#define IRQ_DB8500_AB8500 (IRQ_SHPI_START + 40)
46#define IRQ_DB8500_SDMMC2 (IRQ_SHPI_START + 41)
47#define IRQ_DB8500_SIA (IRQ_SHPI_START + 42)
48#define IRQ_DB8500_SIA2 (IRQ_SHPI_START + 43)
49#define IRQ_DB8500_SVA (IRQ_SHPI_START + 44)
50#define IRQ_DB8500_SVA2 (IRQ_SHPI_START + 45)
51#define IRQ_DB8500_PRCMU0 (IRQ_SHPI_START + 46)
52#define IRQ_DB8500_PRCMU1 (IRQ_SHPI_START + 47)
53#define IRQ_DB8500_DISP (IRQ_SHPI_START + 48)
54#define IRQ_DB8500_SPI3 (IRQ_SHPI_START + 49)
55#define IRQ_DB8500_SDMMC1 (IRQ_SHPI_START + 50)
56#define IRQ_DB8500_I2C4 (IRQ_SHPI_START + 51)
57#define IRQ_DB8500_SSP1 (IRQ_SHPI_START + 52)
58#define IRQ_DB8500_SKE (IRQ_SHPI_START + 53)
59#define IRQ_DB8500_KB (IRQ_SHPI_START + 54)
60#define IRQ_DB8500_I2C2 (IRQ_SHPI_START + 55)
61#define IRQ_DB8500_B2R2 (IRQ_SHPI_START + 56)
62#define IRQ_DB8500_CRYP0 (IRQ_SHPI_START + 57)
63#define IRQ_DB8500_SDMMC3 (IRQ_SHPI_START + 59)
64#define IRQ_DB8500_SDMMC0 (IRQ_SHPI_START + 60)
65#define IRQ_DB8500_HSEM (IRQ_SHPI_START + 61)
66#define IRQ_DB8500_MSP1 (IRQ_SHPI_START + 62)
67#define IRQ_DB8500_SBAG (IRQ_SHPI_START + 63)
68#define IRQ_DB8500_SPI1 (IRQ_SHPI_START + 96)
69#define IRQ_DB8500_SRPTIMER (IRQ_SHPI_START + 97)
70#define IRQ_DB8500_MSP2 (IRQ_SHPI_START + 98)
71#define IRQ_DB8500_SDMMC4 (IRQ_SHPI_START + 99)
72#define IRQ_DB8500_SDMMC5 (IRQ_SHPI_START + 100)
73#define IRQ_DB8500_HSIRD0 (IRQ_SHPI_START + 104)
74#define IRQ_DB8500_HSIRD1 (IRQ_SHPI_START + 105)
75#define IRQ_DB8500_HSITD0 (IRQ_SHPI_START + 106)
76#define IRQ_DB8500_HSITD1 (IRQ_SHPI_START + 107)
77#define IRQ_DB8500_CTI0 (IRQ_SHPI_START + 108)
78#define IRQ_DB8500_CTI1 (IRQ_SHPI_START + 109)
79#define IRQ_DB8500_ICN_ERR (IRQ_SHPI_START + 110)
80#define IRQ_DB8500_MALI_PPMMU (IRQ_SHPI_START + 112)
81#define IRQ_DB8500_MALI_PP (IRQ_SHPI_START + 113)
82#define IRQ_DB8500_MALI_GPMMU (IRQ_SHPI_START + 114)
83#define IRQ_DB8500_MALI_GP (IRQ_SHPI_START + 115)
84#define IRQ_DB8500_MALI (IRQ_SHPI_START + 116)
85#define IRQ_DB8500_PRCMU_SEM (IRQ_SHPI_START + 118)
86#define IRQ_DB8500_GPIO0 (IRQ_SHPI_START + 119)
87#define IRQ_DB8500_GPIO1 (IRQ_SHPI_START + 120)
88#define IRQ_DB8500_GPIO2 (IRQ_SHPI_START + 121)
89#define IRQ_DB8500_GPIO3 (IRQ_SHPI_START + 122)
90#define IRQ_DB8500_GPIO4 (IRQ_SHPI_START + 123)
91#define IRQ_DB8500_GPIO5 (IRQ_SHPI_START + 124)
92#define IRQ_DB8500_GPIO6 (IRQ_SHPI_START + 125)
93#define IRQ_DB8500_GPIO7 (IRQ_SHPI_START + 126)
94#define IRQ_DB8500_GPIO8 (IRQ_SHPI_START + 127)
95
96#endif
diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/include/mach/irqs.h
index 7970684b1d09..10385bdc2b77 100644
--- a/arch/arm/mach-ux500/include/mach/irqs.h
+++ b/arch/arm/mach-ux500/include/mach/irqs.h
@@ -10,7 +10,8 @@
10#ifndef ASM_ARCH_IRQS_H 10#ifndef ASM_ARCH_IRQS_H
11#define ASM_ARCH_IRQS_H 11#define ASM_ARCH_IRQS_H
12 12
13#include <mach/hardware.h> 13#include <mach/irqs-db5500.h>
14#include <mach/irqs-db8500.h>
14 15
15#define IRQ_LOCALTIMER 29 16#define IRQ_LOCALTIMER 29
16#define IRQ_LOCALWDOG 30 17#define IRQ_LOCALWDOG 30
@@ -67,12 +68,21 @@
67/* There are 128 shared peripheral interrupts assigned to 68/* There are 128 shared peripheral interrupts assigned to
68 * INTID[160:32]. The first 32 interrupts are reserved. 69 * INTID[160:32]. The first 32 interrupts are reserved.
69 */ 70 */
70#define U8500_SOC_NR_IRQS 161 71#define DBX500_NR_INTERNAL_IRQS 161
71 72
72/* After chip-specific IRQ numbers we have the GPIO ones */ 73/* After chip-specific IRQ numbers we have the GPIO ones */
73#define NOMADIK_NR_GPIO 288 74#define NOMADIK_NR_GPIO 288
74#define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + U8500_SOC_NR_IRQS) 75#define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + DBX500_NR_INTERNAL_IRQS)
75#define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - U8500_SOC_NR_IRQS) 76#define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - DBX500_NR_INTERNAL_IRQS)
76#define NR_IRQS NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO) 77#define IRQ_BOARD_START NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO)
77 78
78#endif /*ASM_ARCH_IRQS_H*/ 79/* This will be overridden by board-specific irq headers */
80#define IRQ_BOARD_END IRQ_BOARD_START
81
82#ifdef CONFIG_MACH_U8500_MOP
83#include <mach/irqs-board-mop500.h>
84#endif
85
86#define NR_IRQS IRQ_BOARD_END
87
88#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
index 000000000000..9055d5d3233c
--- /dev/null
+++ b/arch/arm/mach-ux500/pins-db8500.h
@@ -0,0 +1,742 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License terms: GNU General Public License, version 2
5 * Author: Rabin Vincent <rabin.vincent@stericsson.com>
6 */
7
8#ifndef __MACH_PINS_DB8500_H
9#define __MACH_PINS_DB8500_H
10
11/*
12 * TODO: Eventually encode all non-board specific pull up/down configuration
13 * here.
14 */
15
16#define GPIO0_GPIO PIN_CFG(0, GPIO)
17#define GPIO0_U0_CTSn PIN_CFG(0, ALT_A)
18#define GPIO0_TRIG_OUT PIN_CFG(0, ALT_B)
19#define GPIO0_IP_TDO PIN_CFG(0, ALT_C)
20
21#define GPIO1_GPIO PIN_CFG(1, GPIO)
22#define GPIO1_U0_RTSn PIN_CFG(1, ALT_A)
23#define GPIO1_TRIG_IN PIN_CFG(1, ALT_B)
24#define GPIO1_IP_TDI PIN_CFG(1, ALT_C)
25
26#define GPIO2_GPIO PIN_CFG(2, GPIO)
27#define GPIO2_U0_RXD PIN_CFG(2, ALT_A)
28#define GPIO2_NONE PIN_CFG(2, ALT_B)
29#define GPIO2_IP_TMS PIN_CFG(2, ALT_C)
30
31#define GPIO3_GPIO PIN_CFG(3, GPIO)
32#define GPIO3_U0_TXD PIN_CFG(3, ALT_A)
33#define GPIO3_NONE PIN_CFG(3, ALT_B)
34#define GPIO3_IP_TCK PIN_CFG(3, ALT_C)
35
36#define GPIO4_GPIO PIN_CFG(4, GPIO)
37#define GPIO4_U1_RXD PIN_CFG(4, ALT_A)
38#define GPIO4_I2C4_SCL PIN_CFG_PULL(4, ALT_B, UP)
39#define GPIO4_IP_TRSTn PIN_CFG(4, ALT_C)
40
41#define GPIO5_GPIO PIN_CFG(5, GPIO)
42#define GPIO5_U1_TXD PIN_CFG(5, ALT_A)
43#define GPIO5_I2C4_SDA PIN_CFG_PULL(5, ALT_B, UP)
44#define GPIO5_IP_GPIO6 PIN_CFG(5, ALT_C)
45
46#define GPIO6_GPIO PIN_CFG(6, GPIO)
47#define GPIO6_U1_CTSn PIN_CFG(6, ALT_A)
48#define GPIO6_I2C1_SCL PIN_CFG_PULL(6, ALT_B, UP)
49#define GPIO6_IP_GPIO0 PIN_CFG(6, ALT_C)
50
51#define GPIO7_GPIO PIN_CFG(7, GPIO)
52#define GPIO7_U1_RTSn PIN_CFG(7, ALT_A)
53#define GPIO7_I2C1_SDA PIN_CFG_PULL(7, ALT_B, UP)
54#define GPIO7_IP_GPIO1 PIN_CFG(7, ALT_C)
55
56#define GPIO8_GPIO PIN_CFG(8, GPIO)
57#define GPIO8_IPI2C_SDA PIN_CFG_PULL(8, ALT_A, UP)
58#define GPIO8_I2C2_SDA PIN_CFG_PULL(8, ALT_B, UP)
59
60#define GPIO9_GPIO PIN_CFG(9, GPIO)
61#define GPIO9_IPI2C_SCL PIN_CFG_PULL(9, ALT_A, UP)
62#define GPIO9_I2C2_SCL PIN_CFG_PULL(9, ALT_B, UP)
63
64#define GPIO10_GPIO PIN_CFG(10, GPIO)
65#define GPIO10_IPI2C_SDA PIN_CFG_PULL(10, ALT_A, UP)
66#define GPIO10_I2C2_SDA PIN_CFG_PULL(10, ALT_B, UP)
67#define GPIO10_IP_GPIO3 PIN_CFG(10, ALT_C)
68
69#define GPIO11_GPIO PIN_CFG(11, GPIO)
70#define GPIO11_IPI2C_SCL PIN_CFG_PULL(11, ALT_A, UP)
71#define GPIO11_I2C2_SCL PIN_CFG_PULL(11, ALT_B, UP)
72#define GPIO11_IP_GPIO2 PIN_CFG(11, ALT_C)
73
74#define GPIO12_GPIO PIN_CFG(12, GPIO)
75#define GPIO12_MSP0_TXD PIN_CFG(12, ALT_A)
76#define GPIO12_MSP0_RXD PIN_CFG(12, ALT_B)
77
78#define GPIO13_GPIO PIN_CFG(13, GPIO)
79#define GPIO13_MSP0_TFS PIN_CFG(13, ALT_A)
80
81#define GPIO14_GPIO PIN_CFG(14, GPIO)
82#define GPIO14_MSP0_TCK PIN_CFG(14, ALT_A)
83
84#define GPIO15_GPIO PIN_CFG(15, GPIO)
85#define GPIO15_MSP0_RXD PIN_CFG(15, ALT_A)
86#define GPIO15_MSP0_TXD PIN_CFG(15, ALT_B)
87
88#define GPIO16_GPIO PIN_CFG(16, GPIO)
89#define GPIO16_MSP0_RFS PIN_CFG(16, ALT_A)
90#define GPIO16_I2C1_SCL PIN_CFG_PULL(16, ALT_B, UP)
91#define GPIO16_SLIM0_DAT PIN_CFG(16, ALT_C)
92
93#define GPIO17_GPIO PIN_CFG(17, GPIO)
94#define GPIO17_MSP0_RCK PIN_CFG(17, ALT_A)
95#define GPIO17_I2C1_SDA PIN_CFG_PULL(17, ALT_B, UP)
96#define GPIO17_SLIM0_CLK PIN_CFG(17, ALT_C)
97
98#define GPIO18_GPIO PIN_CFG(18, GPIO)
99#define GPIO18_MC0_CMDDIR PIN_CFG(18, ALT_A)
100#define GPIO18_U2_RXD PIN_CFG(18, ALT_B)
101#define GPIO18_MS_IEP PIN_CFG(18, ALT_C)
102
103#define GPIO19_GPIO PIN_CFG(19, GPIO)
104#define GPIO19_MC0_DAT0DIR PIN_CFG(19, ALT_A)
105#define GPIO19_U2_TXD PIN_CFG(19, ALT_B)
106#define GPIO19_MS_DAT0DIR PIN_CFG(19, ALT_C)
107
108#define GPIO20_GPIO PIN_CFG(20, GPIO)
109#define GPIO20_MC0_DAT2DIR PIN_CFG(20, ALT_A)
110#define GPIO20_UARTMOD_TXD PIN_CFG(20, ALT_B)
111#define GPIO20_IP_TRIGOUT PIN_CFG(20, ALT_C)
112
113#define GPIO21_GPIO PIN_CFG(21, GPIO)
114#define GPIO21_MC0_DAT31DIR PIN_CFG(21, ALT_A)
115#define GPIO21_MSP0_SCK PIN_CFG(21, ALT_B)
116#define GPIO21_MS_DAT31DIR PIN_CFG(21, ALT_C)
117
118#define GPIO22_GPIO PIN_CFG(22, GPIO)
119#define GPIO22_MC0_FBCLK PIN_CFG(22, ALT_A)
120#define GPIO22_UARTMOD_RXD PIN_CFG(22, ALT_B)
121#define GPIO22_MS_FBCLK PIN_CFG(22, ALT_C)
122
123#define GPIO23_GPIO PIN_CFG(23, GPIO)
124#define GPIO23_MC0_CLK PIN_CFG(23, ALT_A)
125#define GPIO23_STMMOD_CLK PIN_CFG(23, ALT_B)
126#define GPIO23_MS_CLK PIN_CFG(23, ALT_C)
127
128#define GPIO24_GPIO PIN_CFG(24, GPIO)
129#define GPIO24_MC0_CMD PIN_CFG(24, ALT_A)
130#define GPIO24_UARTMOD_RXD PIN_CFG(24, ALT_B)
131#define GPIO24_MS_BS PIN_CFG(24, ALT_C)
132
133#define GPIO25_GPIO PIN_CFG(25, GPIO)
134#define GPIO25_MC0_DAT0 PIN_CFG(25, ALT_A)
135#define GPIO25_STMMOD_DAT0 PIN_CFG(25, ALT_B)
136#define GPIO25_MS_DAT0 PIN_CFG(25, ALT_C)
137
138#define GPIO26_GPIO PIN_CFG(26, GPIO)
139#define GPIO26_MC0_DAT1 PIN_CFG(26, ALT_A)
140#define GPIO26_STMMOD_DAT1 PIN_CFG(26, ALT_B)
141#define GPIO26_MS_DAT1 PIN_CFG(26, ALT_C)
142
143#define GPIO27_GPIO PIN_CFG(27, GPIO)
144#define GPIO27_MC0_DAT2 PIN_CFG(27, ALT_A)
145#define GPIO27_STMMOD_DAT2 PIN_CFG(27, ALT_B)
146#define GPIO27_MS_DAT2 PIN_CFG(27, ALT_C)
147
148#define GPIO28_GPIO PIN_CFG(28, GPIO)
149#define GPIO28_MC0_DAT3 PIN_CFG(28, ALT_A)
150#define GPIO28_STMMOD_DAT3 PIN_CFG(28, ALT_B)
151#define GPIO28_MS_DAT3 PIN_CFG(28, ALT_C)
152
153#define GPIO29_GPIO PIN_CFG(29, GPIO)
154#define GPIO29_MC0_DAT4 PIN_CFG(29, ALT_A)
155#define GPIO29_SPI3_CLK PIN_CFG(29, ALT_B)
156#define GPIO29_U2_RXD PIN_CFG(29, ALT_C)
157
158#define GPIO30_GPIO PIN_CFG(30, GPIO)
159#define GPIO30_MC0_DAT5 PIN_CFG(30, ALT_A)
160#define GPIO30_SPI3_RXD PIN_CFG(30, ALT_B)
161#define GPIO30_U2_TXD PIN_CFG(30, ALT_C)
162
163#define GPIO31_GPIO PIN_CFG(31, GPIO)
164#define GPIO31_MC0_DAT6 PIN_CFG(31, ALT_A)
165#define GPIO31_SPI3_FRM PIN_CFG(31, ALT_B)
166#define GPIO31_U2_CTSn PIN_CFG(31, ALT_C)
167
168#define GPIO32_GPIO PIN_CFG(32, GPIO)
169#define GPIO32_MC0_DAT7 PIN_CFG(32, ALT_A)
170#define GPIO32_SPI3_TXD PIN_CFG(32, ALT_B)
171#define GPIO32_U2_RTSn PIN_CFG(32, ALT_C)
172
173#define GPIO33_GPIO PIN_CFG(33, GPIO)
174#define GPIO33_MSP1_TXD PIN_CFG(33, ALT_A)
175#define GPIO33_MSP1_RXD PIN_CFG(33, ALT_B)
176#define GPIO33_U0_DTRn PIN_CFG(33, ALT_C)
177
178#define GPIO34_GPIO PIN_CFG(34, GPIO)
179#define GPIO34_MSP1_TFS PIN_CFG(34, ALT_A)
180#define GPIO34_NONE PIN_CFG(34, ALT_B)
181#define GPIO34_U0_DCDn PIN_CFG(34, ALT_C)
182
183#define GPIO35_GPIO PIN_CFG(35, GPIO)
184#define GPIO35_MSP1_TCK PIN_CFG(35, ALT_A)
185#define GPIO35_NONE PIN_CFG(35, ALT_B)
186#define GPIO35_U0_DSRn PIN_CFG(35, ALT_C)
187
188#define GPIO36_GPIO PIN_CFG(36, GPIO)
189#define GPIO36_MSP1_RXD PIN_CFG(36, ALT_A)
190#define GPIO36_MSP1_TXD PIN_CFG(36, ALT_B)
191#define GPIO36_U0_RIn PIN_CFG(36, ALT_C)
192
193#define GPIO64_GPIO PIN_CFG(64, GPIO)
194#define GPIO64_LCDB_DE PIN_CFG(64, ALT_A)
195#define GPIO64_KP_O1 PIN_CFG(64, ALT_B)
196#define GPIO64_IP_GPIO4 PIN_CFG(64, ALT_C)
197
198#define GPIO65_GPIO PIN_CFG(65, GPIO)
199#define GPIO65_LCDB_HSO PIN_CFG(65, ALT_A)
200#define GPIO65_KP_O0 PIN_CFG(65, ALT_B)
201#define GPIO65_IP_GPIO5 PIN_CFG(65, ALT_C)
202
203#define GPIO66_GPIO PIN_CFG(66, GPIO)
204#define GPIO66_LCDB_VSO PIN_CFG(66, ALT_A)
205#define GPIO66_KP_I1 PIN_CFG(66, ALT_B)
206#define GPIO66_IP_GPIO6 PIN_CFG(66, ALT_C)
207
208#define GPIO67_GPIO PIN_CFG(67, GPIO)
209#define GPIO67_LCDB_CLK PIN_CFG(67, ALT_A)
210#define GPIO67_KP_I0 PIN_CFG(67, ALT_B)
211#define GPIO67_IP_GPIO7 PIN_CFG(67, ALT_C)
212
213#define GPIO68_GPIO PIN_CFG(68, GPIO)
214#define GPIO68_LCD_VSI0 PIN_CFG(68, ALT_A)
215#define GPIO68_KP_O7 PIN_CFG(68, ALT_B)
216#define GPIO68_SM_CLE PIN_CFG(68, ALT_C)
217
218#define GPIO69_GPIO PIN_CFG(69, GPIO)
219#define GPIO69_LCD_VSI1 PIN_CFG(69, ALT_A)
220#define GPIO69_KP_I7 PIN_CFG(69, ALT_B)
221#define GPIO69_SM_ALE PIN_CFG(69, ALT_C)
222
223#define GPIO70_GPIO PIN_CFG(70, GPIO)
224#define GPIO70_LCD_D0 PIN_CFG(70, ALT_A)
225#define GPIO70_KP_O5 PIN_CFG(70, ALT_B)
226#define GPIO70_STMAPE_CLK PIN_CFG(70, ALT_C)
227
228#define GPIO71_GPIO PIN_CFG(71, GPIO)
229#define GPIO71_LCD_D1 PIN_CFG(71, ALT_A)
230#define GPIO71_KP_O4 PIN_CFG(71, ALT_B)
231#define GPIO71_STMAPE_DAT3 PIN_CFG(71, ALT_C)
232
233#define GPIO72_GPIO PIN_CFG(72, GPIO)
234#define GPIO72_LCD_D2 PIN_CFG(72, ALT_A)
235#define GPIO72_KP_O3 PIN_CFG(72, ALT_B)
236#define GPIO72_STMAPE_DAT2 PIN_CFG(72, ALT_C)
237
238#define GPIO73_GPIO PIN_CFG(73, GPIO)
239#define GPIO73_LCD_D3 PIN_CFG(73, ALT_A)
240#define GPIO73_KP_O2 PIN_CFG(73, ALT_B)
241#define GPIO73_STMAPE_DAT1 PIN_CFG(73, ALT_C)
242
243#define GPIO74_GPIO PIN_CFG(74, GPIO)
244#define GPIO74_LCD_D4 PIN_CFG(74, ALT_A)
245#define GPIO74_KP_I5 PIN_CFG(74, ALT_B)
246#define GPIO74_STMAPE_DAT0 PIN_CFG(74, ALT_C)
247
248#define GPIO75_GPIO PIN_CFG(75, GPIO)
249#define GPIO75_LCD_D5 PIN_CFG(75, ALT_A)
250#define GPIO75_KP_I4 PIN_CFG(75, ALT_B)
251#define GPIO75_U2_RXD PIN_CFG(75, ALT_C)
252
253#define GPIO76_GPIO PIN_CFG(76, GPIO)
254#define GPIO76_LCD_D6 PIN_CFG(76, ALT_A)
255#define GPIO76_KP_I3 PIN_CFG(76, ALT_B)
256#define GPIO76_U2_TXD PIN_CFG(76, ALT_C)
257
258#define GPIO77_GPIO PIN_CFG(77, GPIO)
259#define GPIO77_LCD_D7 PIN_CFG(77, ALT_A)
260#define GPIO77_KP_I2 PIN_CFG(77, ALT_B)
261#define GPIO77_NONE PIN_CFG(77, ALT_C)
262
263#define GPIO78_GPIO PIN_CFG(78, GPIO)
264#define GPIO78_LCD_D8 PIN_CFG(78, ALT_A)
265#define GPIO78_KP_O6 PIN_CFG(78, ALT_B)
266#define GPIO78_IP_GPIO2 PIN_CFG(78, ALT_C)
267
268#define GPIO79_GPIO PIN_CFG(79, GPIO)
269#define GPIO79_LCD_D9 PIN_CFG(79, ALT_A)
270#define GPIO79_KP_I6 PIN_CFG(79, ALT_B)
271#define GPIO79_IP_GPIO3 PIN_CFG(79, ALT_C)
272
273#define GPIO80_GPIO PIN_CFG(80, GPIO)
274#define GPIO80_LCD_D10 PIN_CFG(80, ALT_A)
275#define GPIO80_KP_SKA0 PIN_CFG(80, ALT_B)
276#define GPIO80_IP_GPIO4 PIN_CFG(80, ALT_C)
277
278#define GPIO81_GPIO PIN_CFG(81, GPIO)
279#define GPIO81_LCD_D11 PIN_CFG(81, ALT_A)
280#define GPIO81_KP_SKB0 PIN_CFG(81, ALT_B)
281#define GPIO81_IP_GPIO5 PIN_CFG(81, ALT_C)
282
283#define GPIO82_GPIO PIN_CFG(82, GPIO)
284#define GPIO82_LCD_D12 PIN_CFG(82, ALT_A)
285#define GPIO82_KP_O5 PIN_CFG(82, ALT_B)
286
287#define GPIO83_GPIO PIN_CFG(83, GPIO)
288#define GPIO83_LCD_D13 PIN_CFG(83, ALT_A)
289#define GPIO83_KP_O4 PIN_CFG(83, ALT_B)
290
291#define GPIO84_GPIO PIN_CFG(84, GPIO)
292#define GPIO84_LCD_D14 PIN_CFG(84, ALT_A)
293#define GPIO84_KP_I5 PIN_CFG(84, ALT_B)
294
295#define GPIO85_GPIO PIN_CFG(85, GPIO)
296#define GPIO85_LCD_D15 PIN_CFG(85, ALT_A)
297#define GPIO85_KP_I4 PIN_CFG(85, ALT_B)
298
299#define GPIO86_GPIO PIN_CFG(86, GPIO)
300#define GPIO86_LCD_D16 PIN_CFG(86, ALT_A)
301#define GPIO86_SM_ADQ0 PIN_CFG(86, ALT_B)
302#define GPIO86_MC5_DAT0 PIN_CFG(86, ALT_C)
303
304#define GPIO87_GPIO PIN_CFG(87, GPIO)
305#define GPIO87_LCD_D17 PIN_CFG(87, ALT_A)
306#define GPIO87_SM_ADQ1 PIN_CFG(87, ALT_B)
307#define GPIO87_MC5_DAT1 PIN_CFG(87, ALT_C)
308
309#define GPIO88_GPIO PIN_CFG(88, GPIO)
310#define GPIO88_LCD_D18 PIN_CFG(88, ALT_A)
311#define GPIO88_SM_ADQ2 PIN_CFG(88, ALT_B)
312#define GPIO88_MC5_DAT2 PIN_CFG(88, ALT_C)
313
314#define GPIO89_GPIO PIN_CFG(89, GPIO)
315#define GPIO89_LCD_D19 PIN_CFG(89, ALT_A)
316#define GPIO89_SM_ADQ3 PIN_CFG(89, ALT_B)
317#define GPIO89_MC5_DAT3 PIN_CFG(89, ALT_C)
318
319#define GPIO90_GPIO PIN_CFG(90, GPIO)
320#define GPIO90_LCD_D20 PIN_CFG(90, ALT_A)
321#define GPIO90_SM_ADQ4 PIN_CFG(90, ALT_B)
322#define GPIO90_MC5_CMD PIN_CFG(90, ALT_C)
323
324#define GPIO91_GPIO PIN_CFG(91, GPIO)
325#define GPIO91_LCD_D21 PIN_CFG(91, ALT_A)
326#define GPIO91_SM_ADQ5 PIN_CFG(91, ALT_B)
327#define GPIO91_MC5_FBCLK PIN_CFG(91, ALT_C)
328
329#define GPIO92_GPIO PIN_CFG(92, GPIO)
330#define GPIO92_LCD_D22 PIN_CFG(92, ALT_A)
331#define GPIO92_SM_ADQ6 PIN_CFG(92, ALT_B)
332#define GPIO92_MC5_CLK PIN_CFG(92, ALT_C)
333
334#define GPIO93_GPIO PIN_CFG(93, GPIO)
335#define GPIO93_LCD_D23 PIN_CFG(93, ALT_A)
336#define GPIO93_SM_ADQ7 PIN_CFG(93, ALT_B)
337#define GPIO93_MC5_DAT4 PIN_CFG(93, ALT_C)
338
339#define GPIO94_GPIO PIN_CFG(94, GPIO)
340#define GPIO94_KP_O7 PIN_CFG(94, ALT_A)
341#define GPIO94_SM_ADVn PIN_CFG(94, ALT_B)
342#define GPIO94_MC5_DAT5 PIN_CFG(94, ALT_C)
343
344#define GPIO95_GPIO PIN_CFG(95, GPIO)
345#define GPIO95_KP_I7 PIN_CFG(95, ALT_A)
346#define GPIO95_SM_CS0n PIN_CFG(95, ALT_B)
347#define GPIO95_SM_PS0n PIN_CFG(95, ALT_C)
348
349#define GPIO96_GPIO PIN_CFG(96, GPIO)
350#define GPIO96_KP_O6 PIN_CFG(96, ALT_A)
351#define GPIO96_SM_OEn PIN_CFG(96, ALT_B)
352#define GPIO96_MC5_DAT6 PIN_CFG(96, ALT_C)
353
354#define GPIO97_GPIO PIN_CFG(97, GPIO)
355#define GPIO97_KP_I6 PIN_CFG(97, ALT_A)
356#define GPIO97_SM_WEn PIN_CFG(97, ALT_B)
357#define GPIO97_MC5_DAT7 PIN_CFG(97, ALT_C)
358
359#define GPIO128_GPIO PIN_CFG(128, GPIO)
360#define GPIO128_MC2_CLK PIN_CFG(128, ALT_A)
361#define GPIO128_SM_CKO PIN_CFG(128, ALT_B)
362
363#define GPIO129_GPIO PIN_CFG(129, GPIO)
364#define GPIO129_MC2_CMD PIN_CFG(129, ALT_A)
365#define GPIO129_SM_WAIT0n PIN_CFG(129, ALT_B)
366
367#define GPIO130_GPIO PIN_CFG(130, GPIO)
368#define GPIO130_MC2_FBCLK PIN_CFG(130, ALT_A)
369#define GPIO130_SM_FBCLK PIN_CFG(130, ALT_B)
370#define GPIO130_MC2_RSTN PIN_CFG(130, ALT_C)
371
372#define GPIO131_GPIO PIN_CFG(131, GPIO)
373#define GPIO131_MC2_DAT0 PIN_CFG(131, ALT_A)
374#define GPIO131_SM_ADQ8 PIN_CFG(131, ALT_B)
375
376#define GPIO132_GPIO PIN_CFG(132, GPIO)
377#define GPIO132_MC2_DAT1 PIN_CFG(132, ALT_A)
378#define GPIO132_SM_ADQ9 PIN_CFG(132, ALT_B)
379
380#define GPIO133_GPIO PIN_CFG(133, GPIO)
381#define GPIO133_MC2_DAT2 PIN_CFG(133, ALT_A)
382#define GPIO133_SM_ADQ10 PIN_CFG(133, ALT_B)
383
384#define GPIO134_GPIO PIN_CFG(134, GPIO)
385#define GPIO134_MC2_DAT3 PIN_CFG(134, ALT_A)
386#define GPIO134_SM_ADQ11 PIN_CFG(134, ALT_B)
387
388#define GPIO135_GPIO PIN_CFG(135, GPIO)
389#define GPIO135_MC2_DAT4 PIN_CFG(135, ALT_A)
390#define GPIO135_SM_ADQ12 PIN_CFG(135, ALT_B)
391
392#define GPIO136_GPIO PIN_CFG(136, GPIO)
393#define GPIO136_MC2_DAT5 PIN_CFG(136, ALT_A)
394#define GPIO136_SM_ADQ13 PIN_CFG(136, ALT_B)
395
396#define GPIO137_GPIO PIN_CFG(137, GPIO)
397#define GPIO137_MC2_DAT6 PIN_CFG(137, ALT_A)
398#define GPIO137_SM_ADQ14 PIN_CFG(137, ALT_B)
399
400#define GPIO138_GPIO PIN_CFG(138, GPIO)
401#define GPIO138_MC2_DAT7 PIN_CFG(138, ALT_A)
402#define GPIO138_SM_ADQ15 PIN_CFG(138, ALT_B)
403
404#define GPIO139_GPIO PIN_CFG(139, GPIO)
405#define GPIO139_SSP1_RXD PIN_CFG(139, ALT_A)
406#define GPIO139_SM_WAIT1n PIN_CFG(139, ALT_B)
407#define GPIO139_KP_O8 PIN_CFG(139, ALT_C)
408
409#define GPIO140_GPIO PIN_CFG(140, GPIO)
410#define GPIO140_SSP1_TXD PIN_CFG(140, ALT_A)
411#define GPIO140_IP_GPIO7 PIN_CFG(140, ALT_B)
412#define GPIO140_KP_SKA1 PIN_CFG(140, ALT_C)
413
414#define GPIO141_GPIO PIN_CFG(141, GPIO)
415#define GPIO141_SSP1_CLK PIN_CFG(141, ALT_A)
416#define GPIO141_IP_GPIO2 PIN_CFG(141, ALT_B)
417#define GPIO141_KP_O9 PIN_CFG(141, ALT_C)
418
419#define GPIO142_GPIO PIN_CFG(142, GPIO)
420#define GPIO142_SSP1_FRM PIN_CFG(142, ALT_A)
421#define GPIO142_IP_GPIO3 PIN_CFG(142, ALT_B)
422#define GPIO142_KP_SKB1 PIN_CFG(142, ALT_C)
423
424#define GPIO143_GPIO PIN_CFG(143, GPIO)
425#define GPIO143_SSP0_CLK PIN_CFG(143, ALT_A)
426
427#define GPIO144_GPIO PIN_CFG(144, GPIO)
428#define GPIO144_SSP0_FRM PIN_CFG(144, ALT_A)
429
430#define GPIO145_GPIO PIN_CFG(145, GPIO)
431#define GPIO145_SSP0_RXD PIN_CFG(145, ALT_A)
432
433#define GPIO146_GPIO PIN_CFG(146, GPIO)
434#define GPIO146_SSP0_TXD PIN_CFG(146, ALT_A)
435
436#define GPIO147_GPIO PIN_CFG(147, GPIO)
437#define GPIO147_I2C0_SCL PIN_CFG_PULL(147, ALT_A, UP)
438
439#define GPIO148_GPIO PIN_CFG(148, GPIO)
440#define GPIO148_I2C0_SDA PIN_CFG_PULL(148, ALT_A, UP)
441
442#define GPIO149_GPIO PIN_CFG(149, GPIO)
443#define GPIO149_IP_GPIO0 PIN_CFG(149, ALT_A)
444#define GPIO149_SM_CS1n PIN_CFG(149, ALT_B)
445#define GPIO149_SM_PS1n PIN_CFG(149, ALT_C)
446
447#define GPIO150_GPIO PIN_CFG(150, GPIO)
448#define GPIO150_IP_GPIO1 PIN_CFG(150, ALT_A)
449#define GPIO150_LCDA_CLK PIN_CFG(150, ALT_B)
450
451#define GPIO151_GPIO PIN_CFG(151, GPIO)
452#define GPIO151_KP_SKA0 PIN_CFG(151, ALT_A)
453#define GPIO151_LCD_VSI0 PIN_CFG(151, ALT_B)
454#define GPIO151_KP_O8 PIN_CFG(151, ALT_C)
455
456#define GPIO152_GPIO PIN_CFG(152, GPIO)
457#define GPIO152_KP_SKB0 PIN_CFG(152, ALT_A)
458#define GPIO152_LCD_VSI1 PIN_CFG(152, ALT_B)
459#define GPIO152_KP_O9 PIN_CFG(152, ALT_C)
460
461#define GPIO153_GPIO PIN_CFG(153, GPIO)
462#define GPIO153_KP_I7 PIN_CFG(153, ALT_A)
463#define GPIO153_LCD_D24 PIN_CFG(153, ALT_B)
464#define GPIO153_U2_RXD PIN_CFG(153, ALT_C)
465
466#define GPIO154_GPIO PIN_CFG(154, GPIO)
467#define GPIO154_KP_I6 PIN_CFG(154, ALT_A)
468#define GPIO154_LCD_D25 PIN_CFG(154, ALT_B)
469#define GPIO154_U2_TXD PIN_CFG(154, ALT_C)
470
471#define GPIO155_GPIO PIN_CFG(155, GPIO)
472#define GPIO155_KP_I5 PIN_CFG(155, ALT_A)
473#define GPIO155_LCD_D26 PIN_CFG(155, ALT_B)
474#define GPIO155_STMAPE_CLK PIN_CFG(155, ALT_C)
475
476#define GPIO156_GPIO PIN_CFG(156, GPIO)
477#define GPIO156_KP_I4 PIN_CFG(156, ALT_A)
478#define GPIO156_LCD_D27 PIN_CFG(156, ALT_B)
479#define GPIO156_STMAPE_DAT3 PIN_CFG(156, ALT_C)
480
481#define GPIO157_GPIO PIN_CFG(157, GPIO)
482#define GPIO157_KP_O7 PIN_CFG(157, ALT_A)
483#define GPIO157_LCD_D28 PIN_CFG(157, ALT_B)
484#define GPIO157_STMAPE_DAT2 PIN_CFG(157, ALT_C)
485
486#define GPIO158_GPIO PIN_CFG(158, GPIO)
487#define GPIO158_KP_O6 PIN_CFG(158, ALT_A)
488#define GPIO158_LCD_D29 PIN_CFG(158, ALT_B)
489#define GPIO158_STMAPE_DAT1 PIN_CFG(158, ALT_C)
490
491#define GPIO159_GPIO PIN_CFG(159, GPIO)
492#define GPIO159_KP_O5 PIN_CFG(159, ALT_A)
493#define GPIO159_LCD_D30 PIN_CFG(159, ALT_B)
494#define GPIO159_STMAPE_DAT0 PIN_CFG(159, ALT_C)
495
496#define GPIO160_GPIO PIN_CFG(160, GPIO)
497#define GPIO160_KP_O4 PIN_CFG(160, ALT_A)
498#define GPIO160_LCD_D31 PIN_CFG(160, ALT_B)
499#define GPIO160_NONE PIN_CFG(160, ALT_C)
500
501#define GPIO161_GPIO PIN_CFG(161, GPIO)
502#define GPIO161_KP_I3 PIN_CFG(161, ALT_A)
503#define GPIO161_LCD_D32 PIN_CFG(161, ALT_B)
504#define GPIO161_UARTMOD_RXD PIN_CFG(161, ALT_C)
505
506#define GPIO162_GPIO PIN_CFG(162, GPIO)
507#define GPIO162_KP_I2 PIN_CFG(162, ALT_A)
508#define GPIO162_LCD_D33 PIN_CFG(162, ALT_B)
509#define GPIO162_UARTMOD_TXD PIN_CFG(162, ALT_C)
510
511#define GPIO163_GPIO PIN_CFG(163, GPIO)
512#define GPIO163_KP_I1 PIN_CFG(163, ALT_A)
513#define GPIO163_LCD_D34 PIN_CFG(163, ALT_B)
514#define GPIO163_STMMOD_CLK PIN_CFG(163, ALT_C)
515
516#define GPIO164_GPIO PIN_CFG(164, GPIO)
517#define GPIO164_KP_I0 PIN_CFG(164, ALT_A)
518#define GPIO164_LCD_D35 PIN_CFG(164, ALT_B)
519#define GPIO164_STMMOD_DAT3 PIN_CFG(164, ALT_C)
520
521#define GPIO165_GPIO PIN_CFG(165, GPIO)
522#define GPIO165_KP_O3 PIN_CFG(165, ALT_A)
523#define GPIO165_LCD_D36 PIN_CFG(165, ALT_B)
524#define GPIO165_STMMOD_DAT2 PIN_CFG(165, ALT_C)
525
526#define GPIO166_GPIO PIN_CFG(166, GPIO)
527#define GPIO166_KP_O2 PIN_CFG(166, ALT_A)
528#define GPIO166_LCD_D37 PIN_CFG(166, ALT_B)
529#define GPIO166_STMMOD_DAT1 PIN_CFG(166, ALT_C)
530
531#define GPIO167_GPIO PIN_CFG(167, GPIO)
532#define GPIO167_KP_O1 PIN_CFG(167, ALT_A)
533#define GPIO167_LCD_D38 PIN_CFG(167, ALT_B)
534#define GPIO167_STMMOD_DAT0 PIN_CFG(167, ALT_C)
535
536#define GPIO168_GPIO PIN_CFG(168, GPIO)
537#define GPIO168_KP_O0 PIN_CFG(168, ALT_A)
538#define GPIO168_LCD_D39 PIN_CFG(168, ALT_B)
539#define GPIO168_NONE PIN_CFG(168, ALT_C)
540
541#define GPIO169_GPIO PIN_CFG(169, GPIO)
542#define GPIO169_RF_PURn PIN_CFG(169, ALT_A)
543#define GPIO169_LCDA_DE PIN_CFG(169, ALT_B)
544#define GPIO169_USBSIM_PDC PIN_CFG(169, ALT_C)
545
546#define GPIO170_GPIO PIN_CFG(170, GPIO)
547#define GPIO170_MODEM_STATE PIN_CFG(170, ALT_A)
548#define GPIO170_LCDA_VSO PIN_CFG(170, ALT_B)
549#define GPIO170_KP_SKA1 PIN_CFG(170, ALT_C)
550
551#define GPIO171_GPIO PIN_CFG(171, GPIO)
552#define GPIO171_MODEM_PWREN PIN_CFG(171, ALT_A)
553#define GPIO171_LCDA_HSO PIN_CFG(171, ALT_B)
554#define GPIO171_KP_SKB1 PIN_CFG(171, ALT_C)
555
556#define GPIO192_GPIO PIN_CFG(192, GPIO)
557#define GPIO192_MSP2_SCK PIN_CFG(192, ALT_A)
558
559#define GPIO193_GPIO PIN_CFG(193, GPIO)
560#define GPIO193_MSP2_TXD PIN_CFG(193, ALT_A)
561
562#define GPIO194_GPIO PIN_CFG(194, GPIO)
563#define GPIO194_MSP2_TCK PIN_CFG(194, ALT_A)
564
565#define GPIO195_GPIO PIN_CFG(195, GPIO)
566#define GPIO195_MSP2_TFS PIN_CFG(195, ALT_A)
567
568#define GPIO196_GPIO PIN_CFG(196, GPIO)
569#define GPIO196_MSP2_RXD PIN_CFG(196, ALT_A)
570
571#define GPIO197_GPIO PIN_CFG(197, GPIO)
572#define GPIO197_MC4_DAT3 PIN_CFG(197, ALT_A)
573
574#define GPIO198_GPIO PIN_CFG(198, GPIO)
575#define GPIO198_MC4_DAT2 PIN_CFG(198, ALT_A)
576
577#define GPIO199_GPIO PIN_CFG(199, GPIO)
578#define GPIO199_MC4_DAT1 PIN_CFG(199, ALT_A)
579
580#define GPIO200_GPIO PIN_CFG(200, GPIO)
581#define GPIO200_MC4_DAT0 PIN_CFG(200, ALT_A)
582
583#define GPIO201_GPIO PIN_CFG(201, GPIO)
584#define GPIO201_MC4_CMD PIN_CFG(201, ALT_A)
585
586#define GPIO202_GPIO PIN_CFG(202, GPIO)
587#define GPIO202_MC4_FBCLK PIN_CFG(202, ALT_A)
588#define GPIO202_PWL PIN_CFG(202, ALT_B)
589#define GPIO202_MC4_RSTN PIN_CFG(202, ALT_C)
590
591#define GPIO203_GPIO PIN_CFG(203, GPIO)
592#define GPIO203_MC4_CLK PIN_CFG(203, ALT_A)
593
594#define GPIO204_GPIO PIN_CFG(204, GPIO)
595#define GPIO204_MC4_DAT7 PIN_CFG(204, ALT_A)
596
597#define GPIO205_GPIO PIN_CFG(205, GPIO)
598#define GPIO205_MC4_DAT6 PIN_CFG(205, ALT_A)
599
600#define GPIO206_GPIO PIN_CFG(206, GPIO)
601#define GPIO206_MC4_DAT5 PIN_CFG(206, ALT_A)
602
603#define GPIO207_GPIO PIN_CFG(207, GPIO)
604#define GPIO207_MC4_DAT4 PIN_CFG(207, ALT_A)
605
606#define GPIO208_GPIO PIN_CFG(208, GPIO)
607#define GPIO208_MC1_CLK PIN_CFG(208, ALT_A)
608
609#define GPIO209_GPIO PIN_CFG(209, GPIO)
610#define GPIO209_MC1_FBCLK PIN_CFG(209, ALT_A)
611#define GPIO209_SPI1_CLK PIN_CFG(209, ALT_B)
612
613#define GPIO210_GPIO PIN_CFG(210, GPIO)
614#define GPIO210_MC1_CMD PIN_CFG(210, ALT_A)
615
616#define GPIO211_GPIO PIN_CFG(211, GPIO)
617#define GPIO211_MC1_DAT0 PIN_CFG(211, ALT_A)
618
619#define GPIO212_GPIO PIN_CFG(212, GPIO)
620#define GPIO212_MC1_DAT1 PIN_CFG(212, ALT_A)
621#define GPIO212_SPI1_FRM PIN_CFG(212, ALT_B)
622
623#define GPIO213_GPIO PIN_CFG(213, GPIO)
624#define GPIO213_MC1_DAT2 PIN_CFG(213, ALT_A)
625#define GPIO213_SPI1_TXD PIN_CFG(213, ALT_B)
626
627#define GPIO214_GPIO PIN_CFG(214, GPIO)
628#define GPIO214_MC1_DAT3 PIN_CFG(214, ALT_A)
629#define GPIO214_SPI1_RXD PIN_CFG(214, ALT_B)
630
631#define GPIO215_GPIO PIN_CFG(215, GPIO)
632#define GPIO215_MC1_CMDDIR PIN_CFG(215, ALT_A)
633#define GPIO215_MC3_DAT2DIR PIN_CFG(215, ALT_B)
634#define GPIO215_CLKOUT1 PIN_CFG(215, ALT_C)
635
636#define GPIO216_GPIO PIN_CFG(216, GPIO)
637#define GPIO216_MC1_DAT2DIR PIN_CFG(216, ALT_A)
638#define GPIO216_MC3_CMDDIR PIN_CFG(216, ALT_B)
639#define GPIO216_I2C3_SDA PIN_CFG_PULL(216, ALT_C, UP)
640
641#define GPIO217_GPIO PIN_CFG(217, GPIO)
642#define GPIO217_MC1_DAT0DIR PIN_CFG(217, ALT_A)
643#define GPIO217_MC3_DAT31DIR PIN_CFG(217, ALT_B)
644#define GPIO217_CLKOUT2 PIN_CFG(217, ALT_C)
645
646#define GPIO218_GPIO PIN_CFG(218, GPIO)
647#define GPIO218_MC1_DAT31DIR PIN_CFG(218, ALT_A)
648#define GPIO218_MC3_DAT0DIR PIN_CFG(218, ALT_B)
649#define GPIO218_I2C3_SCL PIN_CFG_PULL(218, ALT_C, UP)
650
651#define GPIO219_GPIO PIN_CFG(219, GPIO)
652#define GPIO219_HSIR_FLA0 PIN_CFG(219, ALT_A)
653#define GPIO219_MC3_CLK PIN_CFG(219, ALT_B)
654
655#define GPIO220_GPIO PIN_CFG(220, GPIO)
656#define GPIO220_HSIR_DAT0 PIN_CFG(220, ALT_A)
657#define GPIO220_MC3_FBCLK PIN_CFG(220, ALT_B)
658#define GPIO220_SPI0_CLK PIN_CFG(220, ALT_C)
659
660#define GPIO221_GPIO PIN_CFG(221, GPIO)
661#define GPIO221_HSIR_RDY0 PIN_CFG(221, ALT_A)
662#define GPIO221_MC3_CMD PIN_CFG(221, ALT_B)
663
664#define GPIO222_GPIO PIN_CFG(222, GPIO)
665#define GPIO222_HSIT_FLA0 PIN_CFG(222, ALT_A)
666#define GPIO222_MC3_DAT0 PIN_CFG(222, ALT_B)
667
668#define GPIO223_GPIO PIN_CFG(223, GPIO)
669#define GPIO223_HSIT_DAT0 PIN_CFG(223, ALT_A)
670#define GPIO223_MC3_DAT1 PIN_CFG(223, ALT_B)
671#define GPIO223_SPI0_FRM PIN_CFG(223, ALT_C)
672
673#define GPIO224_GPIO PIN_CFG(224, GPIO)
674#define GPIO224_HSIT_RDY0 PIN_CFG(224, ALT_A)
675#define GPIO224_MC3_DAT2 PIN_CFG(224, ALT_B)
676#define GPIO224_SPI0_TXD PIN_CFG(224, ALT_C)
677
678#define GPIO225_GPIO PIN_CFG(225, GPIO)
679#define GPIO225_HSIT_CAWAKE0 PIN_CFG(225, ALT_A)
680#define GPIO225_MC3_DAT3 PIN_CFG(225, ALT_B)
681#define GPIO225_SPI0_RXD PIN_CFG(225, ALT_C)
682
683#define GPIO226_GPIO PIN_CFG(226, GPIO)
684#define GPIO226_HSIT_ACWAKE0 PIN_CFG(226, ALT_A)
685#define GPIO226_PWL PIN_CFG(226, ALT_B)
686#define GPIO226_USBSIM_PDC PIN_CFG(226, ALT_C)
687
688#define GPIO227_GPIO PIN_CFG(227, GPIO)
689#define GPIO227_CLKOUT1 PIN_CFG(227, ALT_A)
690
691#define GPIO228_GPIO PIN_CFG(228, GPIO)
692#define GPIO228_CLKOUT2 PIN_CFG(228, ALT_A)
693
694#define GPIO229_GPIO PIN_CFG(229, GPIO)
695#define GPIO229_CLKOUT1 PIN_CFG(229, ALT_A)
696#define GPIO229_PWL PIN_CFG(229, ALT_B)
697#define GPIO229_I2C3_SDA PIN_CFG_PULL(229, ALT_C, UP)
698
699#define GPIO230_GPIO PIN_CFG(230, GPIO)
700#define GPIO230_CLKOUT2 PIN_CFG(230, ALT_A)
701#define GPIO230_PWL PIN_CFG(230, ALT_B)
702#define GPIO230_I2C3_SCL PIN_CFG_PULL(230, ALT_C, UP)
703
704#define GPIO256_GPIO PIN_CFG(256, GPIO)
705#define GPIO256_USB_NXT PIN_CFG(256, ALT_A)
706
707#define GPIO257_GPIO PIN_CFG(257, GPIO)
708#define GPIO257_USB_STP PIN_CFG(257, ALT_A)
709
710#define GPIO258_GPIO PIN_CFG(258, GPIO)
711#define GPIO258_USB_XCLK PIN_CFG(258, ALT_A)
712#define GPIO258_NONE PIN_CFG(258, ALT_B)
713#define GPIO258_DDR_TRIG PIN_CFG(258, ALT_C)
714
715#define GPIO259_GPIO PIN_CFG(259, GPIO)
716#define GPIO259_USB_DIR PIN_CFG(259, ALT_A)
717
718#define GPIO260_GPIO PIN_CFG(260, GPIO)
719#define GPIO260_USB_DAT7 PIN_CFG(260, ALT_A)
720
721#define GPIO261_GPIO PIN_CFG(261, GPIO)
722#define GPIO261_USB_DAT6 PIN_CFG(261, ALT_A)
723
724#define GPIO262_GPIO PIN_CFG(262, GPIO)
725#define GPIO262_USB_DAT5 PIN_CFG(262, ALT_A)
726
727#define GPIO263_GPIO PIN_CFG(263, GPIO)
728#define GPIO263_USB_DAT4 PIN_CFG(263, ALT_A)
729
730#define GPIO264_GPIO PIN_CFG(264, GPIO)
731#define GPIO264_USB_DAT3 PIN_CFG(264, ALT_A)
732
733#define GPIO265_GPIO PIN_CFG(265, GPIO)
734#define GPIO265_USB_DAT2 PIN_CFG(265, ALT_A)
735
736#define GPIO266_GPIO PIN_CFG(266, GPIO)
737#define GPIO266_USB_DAT1 PIN_CFG(266, ALT_A)
738
739#define GPIO267_GPIO PIN_CFG(267, GPIO)
740#define GPIO267_USB_DAT0 PIN_CFG(267, ALT_A)
741
742#endif
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 145803c006b4..e38acb0f89c8 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -28,6 +28,7 @@
28#include <linux/amba/clcd.h> 28#include <linux/amba/clcd.h>
29#include <linux/amba/pl061.h> 29#include <linux/amba/pl061.h>
30#include <linux/amba/mmci.h> 30#include <linux/amba/mmci.h>
31#include <linux/amba/pl022.h>
31#include <linux/io.h> 32#include <linux/io.h>
32#include <linux/gfp.h> 33#include <linux/gfp.h>
33 34
@@ -354,6 +355,21 @@ static struct mmci_platform_data mmc0_plat_data = {
354 .gpio_cd = -1, 355 .gpio_cd = -1,
355}; 356};
356 357
358static struct resource char_lcd_resources[] = {
359 {
360 .start = VERSATILE_CHAR_LCD_BASE,
361 .end = (VERSATILE_CHAR_LCD_BASE + SZ_4K - 1),
362 .flags = IORESOURCE_MEM,
363 },
364};
365
366static struct platform_device char_lcd_device = {
367 .name = "arm-charlcd",
368 .id = -1,
369 .num_resources = ARRAY_SIZE(char_lcd_resources),
370 .resource = char_lcd_resources,
371};
372
357/* 373/*
358 * Clock handling 374 * Clock handling
359 */ 375 */
@@ -430,6 +446,9 @@ static struct clk_lookup lookups[] = {
430 }, { /* MMC1 */ 446 }, { /* MMC1 */
431 .dev_id = "fpga:0b", 447 .dev_id = "fpga:0b",
432 .clk = &ref24_clk, 448 .clk = &ref24_clk,
449 }, { /* SSP */
450 .dev_id = "dev:f4",
451 .clk = &ref24_clk,
433 }, { /* CLCD */ 452 }, { /* CLCD */
434 .dev_id = "dev:20", 453 .dev_id = "dev:20",
435 .clk = &osc4_clk, 454 .clk = &osc4_clk,
@@ -708,6 +727,12 @@ static struct pl061_platform_data gpio1_plat_data = {
708 .irq_base = IRQ_GPIO1_START, 727 .irq_base = IRQ_GPIO1_START,
709}; 728};
710 729
730static struct pl022_ssp_controller ssp0_plat_data = {
731 .bus_id = 0,
732 .enable_dma = 0,
733 .num_chipselect = 1,
734};
735
711#define AACI_IRQ { IRQ_AACI, NO_IRQ } 736#define AACI_IRQ { IRQ_AACI, NO_IRQ }
712#define AACI_DMA { 0x80, 0x81 } 737#define AACI_DMA { 0x80, 0x81 }
713#define MMCI0_IRQ { IRQ_MMCI0A,IRQ_SIC_MMCI0B } 738#define MMCI0_IRQ { IRQ_MMCI0A,IRQ_SIC_MMCI0B }
@@ -777,7 +802,7 @@ AMBA_DEVICE(sci0, "dev:f0", SCI, NULL);
777AMBA_DEVICE(uart0, "dev:f1", UART0, NULL); 802AMBA_DEVICE(uart0, "dev:f1", UART0, NULL);
778AMBA_DEVICE(uart1, "dev:f2", UART1, NULL); 803AMBA_DEVICE(uart1, "dev:f2", UART1, NULL);
779AMBA_DEVICE(uart2, "dev:f3", UART2, NULL); 804AMBA_DEVICE(uart2, "dev:f3", UART2, NULL);
780AMBA_DEVICE(ssp0, "dev:f4", SSP, NULL); 805AMBA_DEVICE(ssp0, "dev:f4", SSP, &ssp0_plat_data);
781 806
782static struct amba_device *amba_devs[] __initdata = { 807static struct amba_device *amba_devs[] __initdata = {
783 &dmac_device, 808 &dmac_device,
@@ -848,6 +873,7 @@ void __init versatile_init(void)
848 platform_device_register(&versatile_flash_device); 873 platform_device_register(&versatile_flash_device);
849 platform_device_register(&versatile_i2c_device); 874 platform_device_register(&versatile_i2c_device);
850 platform_device_register(&smc91x_device); 875 platform_device_register(&smc91x_device);
876 platform_device_register(&char_lcd_device);
851 877
852 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 878 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
853 struct amba_device *d = amba_devs[i]; 879 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
index 334f0df4e948..13c7e5f90a82 100644
--- a/arch/arm/mach-versatile/pci.c
+++ b/arch/arm/mach-versatile/pci.c
@@ -304,7 +304,7 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
304} 304}
305 305
306 306
307struct pci_bus *pci_versatile_scan_bus(int nr, struct pci_sys_data *sys) 307struct pci_bus * __init pci_versatile_scan_bus(int nr, struct pci_sys_data *sys)
308{ 308{
309 return pci_scan_bus(sys->busnr, &pci_versatile_ops, sys); 309 return pci_scan_bus(sys->busnr, &pci_versatile_ops, sys);
310} 310}
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index 6353459bb567..577df6cccb08 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -16,6 +16,7 @@
16#include <asm/hardware/gic.h> 16#include <asm/hardware/gic.h>
17#include <asm/mach-types.h> 17#include <asm/mach-types.h>
18#include <asm/pmu.h> 18#include <asm/pmu.h>
19#include <asm/smp_twd.h>
19 20
20#include <mach/clkdev.h> 21#include <mach/clkdev.h>
21#include <mach/ct-ca9x4.h> 22#include <mach/ct-ca9x4.h>
@@ -53,6 +54,7 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = {
53 54
54static void __init ct_ca9x4_map_io(void) 55static void __init ct_ca9x4_map_io(void)
55{ 56{
57 twd_base = MMIO_P2V(A9_MPCORE_TWD);
56 v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); 58 v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
57} 59}
58 60
diff --git a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
index 8650f04136ef..f9e2f8d22962 100644
--- a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
+++ b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
@@ -28,6 +28,7 @@
28#define A9_MPCORE_SCU (CT_CA9X4_MPIC + 0x0000) 28#define A9_MPCORE_SCU (CT_CA9X4_MPIC + 0x0000)
29#define A9_MPCORE_GIC_CPU (CT_CA9X4_MPIC + 0x0100) 29#define A9_MPCORE_GIC_CPU (CT_CA9X4_MPIC + 0x0100)
30#define A9_MPCORE_GIT (CT_CA9X4_MPIC + 0x0200) 30#define A9_MPCORE_GIT (CT_CA9X4_MPIC + 0x0200)
31#define A9_MPCORE_TWD (CT_CA9X4_MPIC + 0x0600)
31#define A9_MPCORE_GIC_DIST (CT_CA9X4_MPIC + 0x1000) 32#define A9_MPCORE_GIC_DIST (CT_CA9X4_MPIC + 0x1000)
32 33
33/* 34/*
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c
index 642207e18198..83c56324a472 100644
--- a/arch/arm/mach-w90x900/cpu.c
+++ b/arch/arm/mach-w90x900/cpu.c
@@ -93,7 +93,7 @@ static struct clk_lookup nuc900_clkregs[] = {
93 DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL), 93 DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL),
94 DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL), 94 DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL),
95 DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL), 95 DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL),
96 DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL), 96 DEF_CLKLOOK(&clk_adc, "nuc900-ts", NULL),
97 DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), 97 DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL),
98 DEF_CLKLOOK(&clk_ext, NULL, "ext"), 98 DEF_CLKLOOK(&clk_ext, NULL, "ext"),
99 DEF_CLKLOOK(&clk_timer0, NULL, "timer0"), 99 DEF_CLKLOOK(&clk_timer0, NULL, "timer0"),
diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c
index b2eda4dc1c34..7a1fa6adb7c3 100644
--- a/arch/arm/mach-w90x900/dev.c
+++ b/arch/arm/mach-w90x900/dev.c
@@ -36,6 +36,8 @@
36#include <mach/nuc900_spi.h> 36#include <mach/nuc900_spi.h>
37#include <mach/map.h> 37#include <mach/map.h>
38#include <mach/fb.h> 38#include <mach/fb.h>
39#include <mach/regs-ldm.h>
40#include <mach/w90p910_keypad.h>
39 41
40#include "cpu.h" 42#include "cpu.h"
41 43
@@ -207,7 +209,7 @@ static struct nuc900_spi_info nuc900_spiflash_data = {
207 .divider = 24, 209 .divider = 24,
208 .sleep = 0, 210 .sleep = 0,
209 .txnum = 0, 211 .txnum = 0,
210 .txbitlen = 1, 212 .txbitlen = 8,
211 .bus_num = 0, 213 .bus_num = 0,
212}; 214};
213 215
@@ -256,7 +258,7 @@ static struct spi_board_info nuc900_spi_board_info[] __initdata = {
256 .modalias = "m25p80", 258 .modalias = "m25p80",
257 .max_speed_hz = 20000000, 259 .max_speed_hz = 20000000,
258 .bus_num = 0, 260 .bus_num = 0,
259 .chip_select = 1, 261 .chip_select = 0,
260 .platform_data = &nuc900_spi_flash_data, 262 .platform_data = &nuc900_spi_flash_data,
261 .mode = SPI_MODE_0, 263 .mode = SPI_MODE_0,
262 }, 264 },
@@ -361,6 +363,39 @@ struct platform_device nuc900_device_fmi = {
361 363
362/* KPI controller*/ 364/* KPI controller*/
363 365
366static int nuc900_keymap[] = {
367 KEY(0, 0, KEY_A),
368 KEY(0, 1, KEY_B),
369 KEY(0, 2, KEY_C),
370 KEY(0, 3, KEY_D),
371
372 KEY(1, 0, KEY_E),
373 KEY(1, 1, KEY_F),
374 KEY(1, 2, KEY_G),
375 KEY(1, 3, KEY_H),
376
377 KEY(2, 0, KEY_I),
378 KEY(2, 1, KEY_J),
379 KEY(2, 2, KEY_K),
380 KEY(2, 3, KEY_L),
381
382 KEY(3, 0, KEY_M),
383 KEY(3, 1, KEY_N),
384 KEY(3, 2, KEY_O),
385 KEY(3, 3, KEY_P),
386};
387
388static struct matrix_keymap_data nuc900_map_data = {
389 .keymap = nuc900_keymap,
390 .keymap_size = ARRAY_SIZE(nuc900_keymap),
391};
392
393struct w90p910_keypad_platform_data nuc900_keypad_info = {
394 .keymap_data = &nuc900_map_data,
395 .prescale = 0xfa,
396 .debounce = 0x50,
397};
398
364static struct resource nuc900_kpi_resource[] = { 399static struct resource nuc900_kpi_resource[] = {
365 [0] = { 400 [0] = {
366 .start = W90X900_PA_KPI, 401 .start = W90X900_PA_KPI,
@@ -380,9 +415,49 @@ struct platform_device nuc900_device_kpi = {
380 .id = -1, 415 .id = -1,
381 .num_resources = ARRAY_SIZE(nuc900_kpi_resource), 416 .num_resources = ARRAY_SIZE(nuc900_kpi_resource),
382 .resource = nuc900_kpi_resource, 417 .resource = nuc900_kpi_resource,
418 .dev = {
419 .platform_data = &nuc900_keypad_info,
420 }
383}; 421};
384 422
385#ifdef CONFIG_FB_NUC900 423/* LCD controller*/
424
425static struct nuc900fb_display __initdata nuc900_lcd_info[] = {
426 /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */
427 [0] = {
428 .type = LCM_DCCS_VA_SRC_RGB565,
429 .width = 320,
430 .height = 240,
431 .xres = 320,
432 .yres = 240,
433 .bpp = 16,
434 .pixclock = 200000,
435 .left_margin = 34,
436 .right_margin = 54,
437 .hsync_len = 10,
438 .upper_margin = 18,
439 .lower_margin = 4,
440 .vsync_len = 1,
441 .dccs = 0x8e00041a,
442 .devctl = 0x060800c0,
443 .fbctrl = 0x00a000a0,
444 .scale = 0x04000400,
445 },
446};
447
448static struct nuc900fb_mach_info nuc900_fb_info __initdata = {
449#if defined(CONFIG_GPM1040A0_320X240)
450 .displays = &nuc900_lcd_info[0],
451#else
452 .displays = nuc900_lcd_info,
453#endif
454 .num_displays = ARRAY_SIZE(nuc900_lcd_info),
455 .default_display = 0,
456 .gpio_dir = 0x00000004,
457 .gpio_dir_mask = 0xFFFFFFFD,
458 .gpio_data = 0x00000004,
459 .gpio_data_mask = 0xFFFFFFFD,
460};
386 461
387static struct resource nuc900_lcd_resource[] = { 462static struct resource nuc900_lcd_resource[] = {
388 [0] = { 463 [0] = {
@@ -406,23 +481,10 @@ struct platform_device nuc900_device_lcd = {
406 .dev = { 481 .dev = {
407 .dma_mask = &nuc900_device_lcd_dmamask, 482 .dma_mask = &nuc900_device_lcd_dmamask,
408 .coherent_dma_mask = -1, 483 .coherent_dma_mask = -1,
484 .platform_data = &nuc900_fb_info,
409 } 485 }
410}; 486};
411 487
412void nuc900_fb_set_platdata(struct nuc900fb_mach_info *pd)
413{
414 struct nuc900fb_mach_info *npd;
415
416 npd = kmalloc(sizeof(*npd), GFP_KERNEL);
417 if (npd) {
418 memcpy(npd, pd, sizeof(*npd));
419 nuc900_device_lcd.dev.platform_data = npd;
420 } else {
421 printk(KERN_ERR "no memory for LCD platform data\n");
422 }
423}
424#endif
425
426/* AUDIO controller*/ 488/* AUDIO controller*/
427static u64 nuc900_device_audio_dmamask = -1; 489static u64 nuc900_device_audio_dmamask = -1;
428static struct resource nuc900_ac97_resource[] = { 490static 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
index 000000000000..6087abd93ef5
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/regs-gcr.h
@@ -0,0 +1,39 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/regs-gcr.h
3 *
4 * Copyright (c) 2010 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 */
15
16#ifndef __ASM_ARCH_REGS_GCR_H
17#define __ASM_ARCH_REGS_GCR_H
18
19/* Global control registers */
20
21#define GCR_BA W90X900_VA_GCR
22#define REG_PDID (GCR_BA+0x000)
23#define REG_PWRON (GCR_BA+0x004)
24#define REG_ARBCON (GCR_BA+0x008)
25#define REG_MFSEL (GCR_BA+0x00C)
26#define REG_EBIDPE (GCR_BA+0x010)
27#define REG_LCDDPE (GCR_BA+0x014)
28#define REG_GPIOCPE (GCR_BA+0x018)
29#define REG_GPIODPE (GCR_BA+0x01C)
30#define REG_GPIOEPE (GCR_BA+0x020)
31#define REG_GPIOFPE (GCR_BA+0x024)
32#define REG_GPIOGPE (GCR_BA+0x028)
33#define REG_GPIOHPE (GCR_BA+0x02C)
34#define REG_GPIOIPE (GCR_BA+0x030)
35#define REG_GTMP1 (GCR_BA+0x034)
36#define REG_GTMP2 (GCR_BA+0x038)
37#define REG_GTMP3 (GCR_BA+0x03C)
38
39#endif /* __ASM_ARCH_REGS_GCR_H */
diff --git a/arch/arm/mach-w90x900/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c
index b3edc3cccf52..04d295f89eb0 100644
--- a/arch/arm/mach-w90x900/mach-nuc950evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc950evb.c
@@ -20,51 +20,10 @@
20#include <asm/mach/map.h> 20#include <asm/mach/map.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include <mach/map.h> 22#include <mach/map.h>
23#include <mach/regs-ldm.h>
24#include <mach/fb.h> 23#include <mach/fb.h>
25 24
26#include "nuc950.h" 25#include "nuc950.h"
27 26
28#ifdef CONFIG_FB_NUC900
29/* LCD Controller */
30static struct nuc900fb_display __initdata nuc950_lcd_info[] = {
31 /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */
32 [0] = {
33 .type = LCM_DCCS_VA_SRC_RGB565,
34 .width = 320,
35 .height = 240,
36 .xres = 320,
37 .yres = 240,
38 .bpp = 16,
39 .pixclock = 200000,
40 .left_margin = 34,
41 .right_margin = 54,
42 .hsync_len = 10,
43 .upper_margin = 18,
44 .lower_margin = 4,
45 .vsync_len = 1,
46 .dccs = 0x8e00041a,
47 .devctl = 0x060800c0,
48 .fbctrl = 0x00a000a0,
49 .scale = 0x04000400,
50 },
51};
52
53static struct nuc900fb_mach_info nuc950_fb_info __initdata = {
54#if defined(CONFIG_GPM1040A0_320X240)
55 .displays = &nuc950_lcd_info[0],
56#else
57 .displays = nuc950_lcd_info,
58#endif
59 .num_displays = ARRAY_SIZE(nuc950_lcd_info),
60 .default_display = 0,
61 .gpio_dir = 0x00000004,
62 .gpio_dir_mask = 0xFFFFFFFD,
63 .gpio_data = 0x00000004,
64 .gpio_data_mask = 0xFFFFFFFD,
65};
66#endif
67
68static void __init nuc950evb_map_io(void) 27static void __init nuc950evb_map_io(void)
69{ 28{
70 nuc950_map_io(); 29 nuc950_map_io();
@@ -74,9 +33,6 @@ static void __init nuc950evb_map_io(void)
74static void __init nuc950evb_init(void) 33static void __init nuc950evb_init(void)
75{ 34{
76 nuc950_board_init(); 35 nuc950_board_init();
77#ifdef CONFIG_FB_NUC900
78 nuc900_fb_set_platdata(&nuc950_fb_info);
79#endif
80} 36}
81 37
82MACHINE_START(W90P950EVB, "W90P950EVB") 38MACHINE_START(W90P950EVB, "W90P950EVB")
diff --git a/arch/arm/mach-w90x900/nuc910.c b/arch/arm/mach-w90x900/nuc910.c
index 656f03b3b629..1523f4136985 100644
--- a/arch/arm/mach-w90x900/nuc910.c
+++ b/arch/arm/mach-w90x900/nuc910.c
@@ -26,6 +26,8 @@
26static struct platform_device *nuc910_dev[] __initdata = { 26static struct platform_device *nuc910_dev[] __initdata = {
27 &nuc900_device_ts, 27 &nuc900_device_ts,
28 &nuc900_device_rtc, 28 &nuc900_device_rtc,
29 &nuc900_device_lcd,
30 &nuc900_device_kpi,
29}; 31};
30 32
31/* define specific CPU platform io map */ 33/* define specific CPU platform io map */
diff --git a/arch/arm/mach-w90x900/nuc950.c b/arch/arm/mach-w90x900/nuc950.c
index 4d1f1ab044c4..5704f74a50ee 100644
--- a/arch/arm/mach-w90x900/nuc950.c
+++ b/arch/arm/mach-w90x900/nuc950.c
@@ -26,9 +26,7 @@
26static struct platform_device *nuc950_dev[] __initdata = { 26static struct platform_device *nuc950_dev[] __initdata = {
27 &nuc900_device_kpi, 27 &nuc900_device_kpi,
28 &nuc900_device_fmi, 28 &nuc900_device_fmi,
29#ifdef CONFIG_FB_NUC900
30 &nuc900_device_lcd, 29 &nuc900_device_lcd,
31#endif
32}; 30};
33 31
34/* define specific CPU platform io map */ 32/* define specific CPU platform io map */
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 101105e52610..87ec141fcaa6 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -717,17 +717,6 @@ config TLS_REG_EMUL
717 a few prototypes like that in existence) and therefore access to 717 a few prototypes like that in existence) and therefore access to
718 that required register must be emulated. 718 that required register must be emulated.
719 719
720config HAS_TLS_REG
721 bool
722 depends on !TLS_REG_EMUL
723 default y if SMP || CPU_32v7
724 help
725 This selects support for the CP15 thread register.
726 It is defined to be available on some ARMv6 processors (including
727 all SMP capable ARMv6's) or later processors. User space may
728 assume directly accessing that register and always obtain the
729 expected value only on ARMv7 and above.
730
731config NEEDS_SYSCALL_FOR_CMPXCHG 720config NEEDS_SYSCALL_FOR_CMPXCHG
732 bool 721 bool
733 help 722 help
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index e8d34a80851c..d63b6c413758 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -15,7 +15,6 @@ endif
15obj-$(CONFIG_MODULES) += proc-syms.o 15obj-$(CONFIG_MODULES) += proc-syms.o
16 16
17obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o 17obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o
18obj-$(CONFIG_DISCONTIGMEM) += discontig.o
19obj-$(CONFIG_HIGHMEM) += highmem.o 18obj-$(CONFIG_HIGHMEM) += highmem.o
20 19
21obj-$(CONFIG_CPU_ABRT_NOMMU) += abort-nommu.o 20obj-$(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
index c8c0c4b0f0a3..000000000000
--- a/arch/arm/mm/discontig.c
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * linux/arch/arm/mm/discontig.c
3 *
4 * Discontiguous memory support.
5 *
6 * Initial code: Copyright (C) 1999-2000 Nicolas Pitre
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/module.h>
13#include <linux/mmzone.h>
14#include <linux/bootmem.h>
15
16#if MAX_NUMNODES != 4 && MAX_NUMNODES != 16
17# error Fix Me Please
18#endif
19
20/*
21 * Our node_data structure for discontiguous memory.
22 */
23
24pg_data_t discontig_node_data[MAX_NUMNODES] = {
25 { .bdata = &bootmem_node_data[0] },
26 { .bdata = &bootmem_node_data[1] },
27 { .bdata = &bootmem_node_data[2] },
28 { .bdata = &bootmem_node_data[3] },
29#if MAX_NUMNODES == 16
30 { .bdata = &bootmem_node_data[4] },
31 { .bdata = &bootmem_node_data[5] },
32 { .bdata = &bootmem_node_data[6] },
33 { .bdata = &bootmem_node_data[7] },
34 { .bdata = &bootmem_node_data[8] },
35 { .bdata = &bootmem_node_data[9] },
36 { .bdata = &bootmem_node_data[10] },
37 { .bdata = &bootmem_node_data[11] },
38 { .bdata = &bootmem_node_data[12] },
39 { .bdata = &bootmem_node_data[13] },
40 { .bdata = &bootmem_node_data[14] },
41 { .bdata = &bootmem_node_data[15] },
42#endif
43};
44
45EXPORT_SYMBOL(discontig_node_data);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index f6a999465323..599d121c81e7 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -17,6 +17,7 @@
17#include <linux/initrd.h> 17#include <linux/initrd.h>
18#include <linux/highmem.h> 18#include <linux/highmem.h>
19#include <linux/gfp.h> 19#include <linux/gfp.h>
20#include <linux/memblock.h>
20 21
21#include <asm/mach-types.h> 22#include <asm/mach-types.h>
22#include <asm/sections.h> 23#include <asm/sections.h>
@@ -79,38 +80,37 @@ struct meminfo meminfo;
79void show_mem(void) 80void show_mem(void)
80{ 81{
81 int free = 0, total = 0, reserved = 0; 82 int free = 0, total = 0, reserved = 0;
82 int shared = 0, cached = 0, slab = 0, node, i; 83 int shared = 0, cached = 0, slab = 0, i;
83 struct meminfo * mi = &meminfo; 84 struct meminfo * mi = &meminfo;
84 85
85 printk("Mem-info:\n"); 86 printk("Mem-info:\n");
86 show_free_areas(); 87 show_free_areas();
87 for_each_online_node(node) { 88
88 for_each_nodebank (i,mi,node) { 89 for_each_bank (i, mi) {
89 struct membank *bank = &mi->bank[i]; 90 struct membank *bank = &mi->bank[i];
90 unsigned int pfn1, pfn2; 91 unsigned int pfn1, pfn2;
91 struct page *page, *end; 92 struct page *page, *end;
92 93
93 pfn1 = bank_pfn_start(bank); 94 pfn1 = bank_pfn_start(bank);
94 pfn2 = bank_pfn_end(bank); 95 pfn2 = bank_pfn_end(bank);
95 96
96 page = pfn_to_page(pfn1); 97 page = pfn_to_page(pfn1);
97 end = pfn_to_page(pfn2 - 1) + 1; 98 end = pfn_to_page(pfn2 - 1) + 1;
98 99
99 do { 100 do {
100 total++; 101 total++;
101 if (PageReserved(page)) 102 if (PageReserved(page))
102 reserved++; 103 reserved++;
103 else if (PageSwapCache(page)) 104 else if (PageSwapCache(page))
104 cached++; 105 cached++;
105 else if (PageSlab(page)) 106 else if (PageSlab(page))
106 slab++; 107 slab++;
107 else if (!page_count(page)) 108 else if (!page_count(page))
108 free++; 109 free++;
109 else 110 else
110 shared += page_count(page) - 1; 111 shared += page_count(page) - 1;
111 page++; 112 page++;
112 } while (page < end); 113 } while (page < end);
113 }
114 } 114 }
115 115
116 printk("%d pages of RAM\n", total); 116 printk("%d pages of RAM\n", total);
@@ -121,7 +121,7 @@ void show_mem(void)
121 printk("%d pages swap cached\n", cached); 121 printk("%d pages swap cached\n", cached);
122} 122}
123 123
124static void __init find_node_limits(int node, struct meminfo *mi, 124static void __init find_limits(struct meminfo *mi,
125 unsigned long *min, unsigned long *max_low, unsigned long *max_high) 125 unsigned long *min, unsigned long *max_low, unsigned long *max_high)
126{ 126{
127 int i; 127 int i;
@@ -129,7 +129,7 @@ static void __init find_node_limits(int node, struct meminfo *mi,
129 *min = -1UL; 129 *min = -1UL;
130 *max_low = *max_high = 0; 130 *max_low = *max_high = 0;
131 131
132 for_each_nodebank(i, mi, node) { 132 for_each_bank (i, mi) {
133 struct membank *bank = &mi->bank[i]; 133 struct membank *bank = &mi->bank[i];
134 unsigned long start, end; 134 unsigned long start, end;
135 135
@@ -147,155 +147,64 @@ static void __init find_node_limits(int node, struct meminfo *mi,
147 } 147 }
148} 148}
149 149
150/* 150static void __init arm_bootmem_init(struct meminfo *mi,
151 * FIXME: We really want to avoid allocating the bootmap bitmap
152 * over the top of the initrd. Hopefully, this is located towards
153 * the start of a bank, so if we allocate the bootmap bitmap at
154 * the end, we won't clash.
155 */
156static unsigned int __init
157find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages)
158{
159 unsigned int start_pfn, i, bootmap_pfn;
160
161 start_pfn = PAGE_ALIGN(__pa(_end)) >> PAGE_SHIFT;
162 bootmap_pfn = 0;
163
164 for_each_nodebank(i, mi, node) {
165 struct membank *bank = &mi->bank[i];
166 unsigned int start, end;
167
168 start = bank_pfn_start(bank);
169 end = bank_pfn_end(bank);
170
171 if (end < start_pfn)
172 continue;
173
174 if (start < start_pfn)
175 start = start_pfn;
176
177 if (end <= start)
178 continue;
179
180 if (end - start >= bootmap_pages) {
181 bootmap_pfn = start;
182 break;
183 }
184 }
185
186 if (bootmap_pfn == 0)
187 BUG();
188
189 return bootmap_pfn;
190}
191
192static int __init check_initrd(struct meminfo *mi)
193{
194 int initrd_node = -2;
195#ifdef CONFIG_BLK_DEV_INITRD
196 unsigned long end = phys_initrd_start + phys_initrd_size;
197
198 /*
199 * Make sure that the initrd is within a valid area of
200 * memory.
201 */
202 if (phys_initrd_size) {
203 unsigned int i;
204
205 initrd_node = -1;
206
207 for (i = 0; i < mi->nr_banks; i++) {
208 struct membank *bank = &mi->bank[i];
209 if (bank_phys_start(bank) <= phys_initrd_start &&
210 end <= bank_phys_end(bank))
211 initrd_node = bank->node;
212 }
213 }
214
215 if (initrd_node == -1) {
216 printk(KERN_ERR "INITRD: 0x%08lx+0x%08lx extends beyond "
217 "physical memory - disabling initrd\n",
218 phys_initrd_start, phys_initrd_size);
219 phys_initrd_start = phys_initrd_size = 0;
220 }
221#endif
222
223 return initrd_node;
224}
225
226static void __init bootmem_init_node(int node, struct meminfo *mi,
227 unsigned long start_pfn, unsigned long end_pfn) 151 unsigned long start_pfn, unsigned long end_pfn)
228{ 152{
229 unsigned long boot_pfn;
230 unsigned int boot_pages; 153 unsigned int boot_pages;
154 phys_addr_t bitmap;
231 pg_data_t *pgdat; 155 pg_data_t *pgdat;
232 int i; 156 int i;
233 157
234 /* 158 /*
235 * Allocate the bootmem bitmap page. 159 * Allocate the bootmem bitmap page. This must be in a region
160 * of memory which has already been mapped.
236 */ 161 */
237 boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn); 162 boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
238 boot_pfn = find_bootmap_pfn(node, mi, boot_pages); 163 bitmap = memblock_alloc_base(boot_pages << PAGE_SHIFT, L1_CACHE_BYTES,
164 __pfn_to_phys(end_pfn));
239 165
240 /* 166 /*
241 * Initialise the bootmem allocator for this node, handing the 167 * Initialise the bootmem allocator, handing the
242 * memory banks over to bootmem. 168 * memory banks over to bootmem.
243 */ 169 */
244 node_set_online(node); 170 node_set_online(0);
245 pgdat = NODE_DATA(node); 171 pgdat = NODE_DATA(0);
246 init_bootmem_node(pgdat, boot_pfn, start_pfn, end_pfn); 172 init_bootmem_node(pgdat, __phys_to_pfn(bitmap), start_pfn, end_pfn);
247 173
248 for_each_nodebank(i, mi, node) { 174 for_each_bank(i, mi) {
249 struct membank *bank = &mi->bank[i]; 175 struct membank *bank = &mi->bank[i];
250 if (!bank->highmem) 176 if (!bank->highmem)
251 free_bootmem_node(pgdat, bank_phys_start(bank), bank_phys_size(bank)); 177 free_bootmem(bank_phys_start(bank), bank_phys_size(bank));
252 } 178 }
253 179
254 /* 180 /*
255 * Reserve the bootmem bitmap for this node. 181 * Reserve the memblock reserved regions in bootmem.
256 */ 182 */
257 reserve_bootmem_node(pgdat, boot_pfn << PAGE_SHIFT, 183 for (i = 0; i < memblock.reserved.cnt; i++) {
258 boot_pages << PAGE_SHIFT, BOOTMEM_DEFAULT); 184 phys_addr_t start = memblock_start_pfn(&memblock.reserved, i);
259} 185 if (start >= start_pfn &&
260 186 memblock_end_pfn(&memblock.reserved, i) <= end_pfn)
261static void __init bootmem_reserve_initrd(int node) 187 reserve_bootmem_node(pgdat, __pfn_to_phys(start),
262{ 188 memblock_size_bytes(&memblock.reserved, i),
263#ifdef CONFIG_BLK_DEV_INITRD 189 BOOTMEM_DEFAULT);
264 pg_data_t *pgdat = NODE_DATA(node);
265 int res;
266
267 res = reserve_bootmem_node(pgdat, phys_initrd_start,
268 phys_initrd_size, BOOTMEM_EXCLUSIVE);
269
270 if (res == 0) {
271 initrd_start = __phys_to_virt(phys_initrd_start);
272 initrd_end = initrd_start + phys_initrd_size;
273 } else {
274 printk(KERN_ERR
275 "INITRD: 0x%08lx+0x%08lx overlaps in-use "
276 "memory region - disabling initrd\n",
277 phys_initrd_start, phys_initrd_size);
278 } 190 }
279#endif
280} 191}
281 192
282static void __init bootmem_free_node(int node, struct meminfo *mi) 193static void __init arm_bootmem_free(struct meminfo *mi, unsigned long min,
194 unsigned long max_low, unsigned long max_high)
283{ 195{
284 unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES]; 196 unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
285 unsigned long min, max_low, max_high;
286 int i; 197 int i;
287 198
288 find_node_limits(node, mi, &min, &max_low, &max_high);
289
290 /* 199 /*
291 * initialise the zones within this node. 200 * initialise the zones.
292 */ 201 */
293 memset(zone_size, 0, sizeof(zone_size)); 202 memset(zone_size, 0, sizeof(zone_size));
294 203
295 /* 204 /*
296 * The size of this node has already been determined. If we need 205 * The memory size has already been determined. If we need
297 * to do anything fancy with the allocation of this memory to the 206 * to do anything fancy with the allocation of this memory
298 * zones, now is the time to do it. 207 * to the zones, now is the time to do it.
299 */ 208 */
300 zone_size[0] = max_low - min; 209 zone_size[0] = max_low - min;
301#ifdef CONFIG_HIGHMEM 210#ifdef CONFIG_HIGHMEM
@@ -303,11 +212,11 @@ static void __init bootmem_free_node(int node, struct meminfo *mi)
303#endif 212#endif
304 213
305 /* 214 /*
306 * For each bank in this node, calculate the size of the holes. 215 * Calculate the size of the holes.
307 * holes = node_size - sum(bank_sizes_in_node) 216 * holes = node_size - sum(bank_sizes)
308 */ 217 */
309 memcpy(zhole_size, zone_size, sizeof(zhole_size)); 218 memcpy(zhole_size, zone_size, sizeof(zhole_size));
310 for_each_nodebank(i, mi, node) { 219 for_each_bank(i, mi) {
311 int idx = 0; 220 int idx = 0;
312#ifdef CONFIG_HIGHMEM 221#ifdef CONFIG_HIGHMEM
313 if (mi->bank[i].highmem) 222 if (mi->bank[i].highmem)
@@ -320,24 +229,23 @@ static void __init bootmem_free_node(int node, struct meminfo *mi)
320 * Adjust the sizes according to any special requirements for 229 * Adjust the sizes according to any special requirements for
321 * this machine type. 230 * this machine type.
322 */ 231 */
323 arch_adjust_zones(node, zone_size, zhole_size); 232 arch_adjust_zones(zone_size, zhole_size);
324 233
325 free_area_init_node(node, zone_size, min, zhole_size); 234 free_area_init_node(0, zone_size, min, zhole_size);
326} 235}
327 236
328#ifndef CONFIG_SPARSEMEM 237#ifndef CONFIG_SPARSEMEM
329int pfn_valid(unsigned long pfn) 238int pfn_valid(unsigned long pfn)
330{ 239{
331 struct meminfo *mi = &meminfo; 240 struct memblock_region *mem = &memblock.memory;
332 unsigned int left = 0, right = mi->nr_banks; 241 unsigned int left = 0, right = mem->cnt;
333 242
334 do { 243 do {
335 unsigned int mid = (right + left) / 2; 244 unsigned int mid = (right + left) / 2;
336 struct membank *bank = &mi->bank[mid];
337 245
338 if (pfn < bank_pfn_start(bank)) 246 if (pfn < memblock_start_pfn(mem, mid))
339 right = mid; 247 right = mid;
340 else if (pfn >= bank_pfn_end(bank)) 248 else if (pfn >= memblock_end_pfn(mem, mid))
341 left = mid + 1; 249 left = mid + 1;
342 else 250 else
343 return 1; 251 return 1;
@@ -346,73 +254,69 @@ int pfn_valid(unsigned long pfn)
346} 254}
347EXPORT_SYMBOL(pfn_valid); 255EXPORT_SYMBOL(pfn_valid);
348 256
349static void arm_memory_present(struct meminfo *mi, int node) 257static void arm_memory_present(void)
350{ 258{
351} 259}
352#else 260#else
353static void arm_memory_present(struct meminfo *mi, int node) 261static void arm_memory_present(void)
354{ 262{
355 int i; 263 int i;
356 for_each_nodebank(i, mi, node) { 264 for (i = 0; i < memblock.memory.cnt; i++)
357 struct membank *bank = &mi->bank[i]; 265 memory_present(0, memblock_start_pfn(&memblock.memory, i),
358 memory_present(node, bank_pfn_start(bank), bank_pfn_end(bank)); 266 memblock_end_pfn(&memblock.memory, i));
359 }
360} 267}
361#endif 268#endif
362 269
363void __init bootmem_init(void) 270void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
364{ 271{
365 struct meminfo *mi = &meminfo; 272 int i;
366 unsigned long min, max_low, max_high;
367 int node, initrd_node;
368 273
369 /* 274 memblock_init();
370 * Locate which node contains the ramdisk image, if any. 275 for (i = 0; i < mi->nr_banks; i++)
371 */ 276 memblock_add(mi->bank[i].start, mi->bank[i].size);
372 initrd_node = check_initrd(mi);
373 277
374 max_low = max_high = 0; 278 /* Register the kernel text, kernel data and initrd with memblock. */
279#ifdef CONFIG_XIP_KERNEL
280 memblock_reserve(__pa(_data), _end - _data);
281#else
282 memblock_reserve(__pa(_stext), _end - _stext);
283#endif
284#ifdef CONFIG_BLK_DEV_INITRD
285 if (phys_initrd_size) {
286 memblock_reserve(phys_initrd_start, phys_initrd_size);
375 287
376 /* 288 /* Now convert initrd to virtual addresses */
377 * Run through each node initialising the bootmem allocator. 289 initrd_start = __phys_to_virt(phys_initrd_start);
378 */ 290 initrd_end = initrd_start + phys_initrd_size;
379 for_each_node(node) { 291 }
380 unsigned long node_low, node_high; 292#endif
381 293
382 find_node_limits(node, mi, &min, &node_low, &node_high); 294 arm_mm_memblock_reserve();
383 295
384 if (node_low > max_low) 296 /* reserve any platform specific memblock areas */
385 max_low = node_low; 297 if (mdesc->reserve)
386 if (node_high > max_high) 298 mdesc->reserve();
387 max_high = node_high;
388 299
389 /* 300 memblock_analyze();
390 * If there is no memory in this node, ignore it. 301 memblock_dump_all();
391 * (We can't have nodes which have no lowmem) 302}
392 */
393 if (node_low == 0)
394 continue;
395 303
396 bootmem_init_node(node, mi, min, node_low); 304void __init bootmem_init(void)
305{
306 struct meminfo *mi = &meminfo;
307 unsigned long min, max_low, max_high;
397 308
398 /* 309 max_low = max_high = 0;
399 * Reserve any special node zero regions.
400 */
401 if (node == 0)
402 reserve_node_zero(NODE_DATA(node));
403 310
404 /* 311 find_limits(mi, &min, &max_low, &max_high);
405 * If the initrd is in this node, reserve its memory.
406 */
407 if (node == initrd_node)
408 bootmem_reserve_initrd(node);
409 312
410 /* 313 arm_bootmem_init(mi, min, max_low);
411 * Sparsemem tries to allocate bootmem in memory_present(), 314
412 * so must be done after the fixed reservations 315 /*
413 */ 316 * Sparsemem tries to allocate bootmem in memory_present(),
414 arm_memory_present(mi, node); 317 * so must be done after the fixed reservations
415 } 318 */
319 arm_memory_present();
416 320
417 /* 321 /*
418 * sparse_init() needs the bootmem allocator up and running. 322 * sparse_init() needs the bootmem allocator up and running.
@@ -420,12 +324,11 @@ void __init bootmem_init(void)
420 sparse_init(); 324 sparse_init();
421 325
422 /* 326 /*
423 * Now free memory in each node - free_area_init_node needs 327 * Now free the memory - free_area_init_node needs
424 * the sparse mem_map arrays initialized by sparse_init() 328 * the sparse mem_map arrays initialized by sparse_init()
425 * for memmap_init_zone(), otherwise all PFNs are invalid. 329 * for memmap_init_zone(), otherwise all PFNs are invalid.
426 */ 330 */
427 for_each_node(node) 331 arm_bootmem_free(mi, min, max_low, max_high);
428 bootmem_free_node(node, mi);
429 332
430 high_memory = __va((max_low << PAGE_SHIFT) - 1) + 1; 333 high_memory = __va((max_low << PAGE_SHIFT) - 1) + 1;
431 334
@@ -460,7 +363,7 @@ static inline int free_area(unsigned long pfn, unsigned long end, char *s)
460} 363}
461 364
462static inline void 365static inline void
463free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn) 366free_memmap(unsigned long start_pfn, unsigned long end_pfn)
464{ 367{
465 struct page *start_pg, *end_pg; 368 struct page *start_pg, *end_pg;
466 unsigned long pg, pgend; 369 unsigned long pg, pgend;
@@ -483,13 +386,13 @@ free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn)
483 * free the section of the memmap array. 386 * free the section of the memmap array.
484 */ 387 */
485 if (pg < pgend) 388 if (pg < pgend)
486 free_bootmem_node(NODE_DATA(node), pg, pgend - pg); 389 free_bootmem(pg, pgend - pg);
487} 390}
488 391
489/* 392/*
490 * The mem_map array can get very big. Free the unused area of the memory map. 393 * The mem_map array can get very big. Free the unused area of the memory map.
491 */ 394 */
492static void __init free_unused_memmap_node(int node, struct meminfo *mi) 395static void __init free_unused_memmap(struct meminfo *mi)
493{ 396{
494 unsigned long bank_start, prev_bank_end = 0; 397 unsigned long bank_start, prev_bank_end = 0;
495 unsigned int i; 398 unsigned int i;
@@ -499,7 +402,7 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi)
499 * may not be the case, especially if the user has provided the 402 * may not be the case, especially if the user has provided the
500 * information on the command line. 403 * information on the command line.
501 */ 404 */
502 for_each_nodebank(i, mi, node) { 405 for_each_bank(i, mi) {
503 struct membank *bank = &mi->bank[i]; 406 struct membank *bank = &mi->bank[i];
504 407
505 bank_start = bank_pfn_start(bank); 408 bank_start = bank_pfn_start(bank);
@@ -514,7 +417,7 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi)
514 * between the current bank and the previous, free it. 417 * between the current bank and the previous, free it.
515 */ 418 */
516 if (prev_bank_end && prev_bank_end != bank_start) 419 if (prev_bank_end && prev_bank_end != bank_start)
517 free_memmap(node, prev_bank_end, bank_start); 420 free_memmap(prev_bank_end, bank_start);
518 421
519 prev_bank_end = bank_pfn_end(bank); 422 prev_bank_end = bank_pfn_end(bank);
520 } 423 }
@@ -528,21 +431,14 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi)
528void __init mem_init(void) 431void __init mem_init(void)
529{ 432{
530 unsigned long reserved_pages, free_pages; 433 unsigned long reserved_pages, free_pages;
531 int i, node; 434 int i;
532 435
533#ifndef CONFIG_DISCONTIGMEM
534 max_mapnr = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map; 436 max_mapnr = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
535#endif
536 437
537 /* this will put all unused low memory onto the freelists */ 438 /* this will put all unused low memory onto the freelists */
538 for_each_online_node(node) { 439 free_unused_memmap(&meminfo);
539 pg_data_t *pgdat = NODE_DATA(node);
540
541 free_unused_memmap_node(node, &meminfo);
542 440
543 if (pgdat->node_spanned_pages != 0) 441 totalram_pages += free_all_bootmem();
544 totalram_pages += free_all_bootmem_node(pgdat);
545 }
546 442
547#ifdef CONFIG_SA1111 443#ifdef CONFIG_SA1111
548 /* now that our DMA memory is actually so designated, we can free it */ 444 /* now that our DMA memory is actually so designated, we can free it */
@@ -552,39 +448,35 @@ void __init mem_init(void)
552 448
553#ifdef CONFIG_HIGHMEM 449#ifdef CONFIG_HIGHMEM
554 /* set highmem page free */ 450 /* set highmem page free */
555 for_each_online_node(node) { 451 for_each_bank (i, &meminfo) {
556 for_each_nodebank (i, &meminfo, node) { 452 unsigned long start = bank_pfn_start(&meminfo.bank[i]);
557 unsigned long start = bank_pfn_start(&meminfo.bank[i]); 453 unsigned long end = bank_pfn_end(&meminfo.bank[i]);
558 unsigned long end = bank_pfn_end(&meminfo.bank[i]); 454 if (start >= max_low_pfn + PHYS_PFN_OFFSET)
559 if (start >= max_low_pfn + PHYS_PFN_OFFSET) 455 totalhigh_pages += free_area(start, end, NULL);
560 totalhigh_pages += free_area(start, end, NULL);
561 }
562 } 456 }
563 totalram_pages += totalhigh_pages; 457 totalram_pages += totalhigh_pages;
564#endif 458#endif
565 459
566 reserved_pages = free_pages = 0; 460 reserved_pages = free_pages = 0;
567 461
568 for_each_online_node(node) { 462 for_each_bank(i, &meminfo) {
569 for_each_nodebank(i, &meminfo, node) { 463 struct membank *bank = &meminfo.bank[i];
570 struct membank *bank = &meminfo.bank[i]; 464 unsigned int pfn1, pfn2;
571 unsigned int pfn1, pfn2; 465 struct page *page, *end;
572 struct page *page, *end; 466
573 467 pfn1 = bank_pfn_start(bank);
574 pfn1 = bank_pfn_start(bank); 468 pfn2 = bank_pfn_end(bank);
575 pfn2 = bank_pfn_end(bank); 469
576 470 page = pfn_to_page(pfn1);
577 page = pfn_to_page(pfn1); 471 end = pfn_to_page(pfn2 - 1) + 1;
578 end = pfn_to_page(pfn2 - 1) + 1; 472
579 473 do {
580 do { 474 if (PageReserved(page))
581 if (PageReserved(page)) 475 reserved_pages++;
582 reserved_pages++; 476 else if (!page_count(page))
583 else if (!page_count(page)) 477 free_pages++;
584 free_pages++; 478 page++;
585 page++; 479 } while (page < end);
586 } while (page < end);
587 }
588 } 480 }
589 481
590 /* 482 /*
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 28c8b950ef04..03f11935ed08 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -268,6 +268,12 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
268 if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK)) 268 if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
269 return NULL; 269 return NULL;
270 270
271 /*
272 * Don't allow RAM to be mapped - this causes problems with ARMv6+
273 */
274 if (WARN_ON(pfn_valid(pfn)))
275 return NULL;
276
271 type = get_mem_type(mtype); 277 type = get_mem_type(mtype);
272 if (!type) 278 if (!type)
273 return NULL; 279 return NULL;
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index 815d08eecbb0..6630620380a4 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -28,7 +28,5 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
28 28
29#endif 29#endif
30 30
31struct pglist_data;
32
33void __init bootmem_init(void); 31void __init bootmem_init(void);
34void reserve_node_zero(struct pglist_data *pgdat); 32void arm_mm_memblock_reserve(void);
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 285894171186..d5541adc3520 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -11,13 +11,12 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/bootmem.h>
15#include <linux/mman.h> 14#include <linux/mman.h>
16#include <linux/nodemask.h> 15#include <linux/nodemask.h>
16#include <linux/memblock.h>
17#include <linux/sort.h> 17#include <linux/sort.h>
18 18
19#include <asm/cputype.h> 19#include <asm/cputype.h>
20#include <asm/mach-types.h>
21#include <asm/sections.h> 20#include <asm/sections.h>
22#include <asm/cachetype.h> 21#include <asm/cachetype.h>
23#include <asm/setup.h> 22#include <asm/setup.h>
@@ -488,18 +487,28 @@ static void __init build_mem_type_table(void)
488 487
489#define vectors_base() (vectors_high() ? 0xffff0000 : 0) 488#define vectors_base() (vectors_high() ? 0xffff0000 : 0)
490 489
491static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr, 490static void __init *early_alloc(unsigned long sz)
492 unsigned long end, unsigned long pfn,
493 const struct mem_type *type)
494{ 491{
495 pte_t *pte; 492 void *ptr = __va(memblock_alloc(sz, sz));
493 memset(ptr, 0, sz);
494 return ptr;
495}
496 496
497static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot)
498{
497 if (pmd_none(*pmd)) { 499 if (pmd_none(*pmd)) {
498 pte = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * sizeof(pte_t)); 500 pte_t *pte = early_alloc(2 * PTRS_PER_PTE * sizeof(pte_t));
499 __pmd_populate(pmd, __pa(pte) | type->prot_l1); 501 __pmd_populate(pmd, __pa(pte) | prot);
500 } 502 }
503 BUG_ON(pmd_bad(*pmd));
504 return pte_offset_kernel(pmd, addr);
505}
501 506
502 pte = pte_offset_kernel(pmd, addr); 507static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
508 unsigned long end, unsigned long pfn,
509 const struct mem_type *type)
510{
511 pte_t *pte = early_pte_alloc(pmd, addr, type->prot_l1);
503 do { 512 do {
504 set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)), 0); 513 set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)), 0);
505 pfn++; 514 pfn++;
@@ -668,7 +677,7 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
668 create_mapping(io_desc + i); 677 create_mapping(io_desc + i);
669} 678}
670 679
671static unsigned long __initdata vmalloc_reserve = SZ_128M; 680static void * __initdata vmalloc_min = (void *)(VMALLOC_END - SZ_128M);
672 681
673/* 682/*
674 * vmalloc=size forces the vmalloc area to be exactly 'size' 683 * vmalloc=size forces the vmalloc area to be exactly 'size'
@@ -677,7 +686,7 @@ static unsigned long __initdata vmalloc_reserve = SZ_128M;
677 */ 686 */
678static int __init early_vmalloc(char *arg) 687static int __init early_vmalloc(char *arg)
679{ 688{
680 vmalloc_reserve = memparse(arg, NULL); 689 unsigned long vmalloc_reserve = memparse(arg, NULL);
681 690
682 if (vmalloc_reserve < SZ_16M) { 691 if (vmalloc_reserve < SZ_16M) {
683 vmalloc_reserve = SZ_16M; 692 vmalloc_reserve = SZ_16M;
@@ -692,22 +701,26 @@ static int __init early_vmalloc(char *arg)
692 "vmalloc area is too big, limiting to %luMB\n", 701 "vmalloc area is too big, limiting to %luMB\n",
693 vmalloc_reserve >> 20); 702 vmalloc_reserve >> 20);
694 } 703 }
704
705 vmalloc_min = (void *)(VMALLOC_END - vmalloc_reserve);
695 return 0; 706 return 0;
696} 707}
697early_param("vmalloc", early_vmalloc); 708early_param("vmalloc", early_vmalloc);
698 709
699#define VMALLOC_MIN (void *)(VMALLOC_END - vmalloc_reserve) 710phys_addr_t lowmem_end_addr;
700 711
701static void __init sanity_check_meminfo(void) 712static void __init sanity_check_meminfo(void)
702{ 713{
703 int i, j, highmem = 0; 714 int i, j, highmem = 0;
704 715
716 lowmem_end_addr = __pa(vmalloc_min - 1) + 1;
717
705 for (i = 0, j = 0; i < meminfo.nr_banks; i++) { 718 for (i = 0, j = 0; i < meminfo.nr_banks; i++) {
706 struct membank *bank = &meminfo.bank[j]; 719 struct membank *bank = &meminfo.bank[j];
707 *bank = meminfo.bank[i]; 720 *bank = meminfo.bank[i];
708 721
709#ifdef CONFIG_HIGHMEM 722#ifdef CONFIG_HIGHMEM
710 if (__va(bank->start) > VMALLOC_MIN || 723 if (__va(bank->start) > vmalloc_min ||
711 __va(bank->start) < (void *)PAGE_OFFSET) 724 __va(bank->start) < (void *)PAGE_OFFSET)
712 highmem = 1; 725 highmem = 1;
713 726
@@ -717,8 +730,8 @@ static void __init sanity_check_meminfo(void)
717 * Split those memory banks which are partially overlapping 730 * Split those memory banks which are partially overlapping
718 * the vmalloc area greatly simplifying things later. 731 * the vmalloc area greatly simplifying things later.
719 */ 732 */
720 if (__va(bank->start) < VMALLOC_MIN && 733 if (__va(bank->start) < vmalloc_min &&
721 bank->size > VMALLOC_MIN - __va(bank->start)) { 734 bank->size > vmalloc_min - __va(bank->start)) {
722 if (meminfo.nr_banks >= NR_BANKS) { 735 if (meminfo.nr_banks >= NR_BANKS) {
723 printk(KERN_CRIT "NR_BANKS too low, " 736 printk(KERN_CRIT "NR_BANKS too low, "
724 "ignoring high memory\n"); 737 "ignoring high memory\n");
@@ -727,12 +740,12 @@ static void __init sanity_check_meminfo(void)
727 (meminfo.nr_banks - i) * sizeof(*bank)); 740 (meminfo.nr_banks - i) * sizeof(*bank));
728 meminfo.nr_banks++; 741 meminfo.nr_banks++;
729 i++; 742 i++;
730 bank[1].size -= VMALLOC_MIN - __va(bank->start); 743 bank[1].size -= vmalloc_min - __va(bank->start);
731 bank[1].start = __pa(VMALLOC_MIN - 1) + 1; 744 bank[1].start = __pa(vmalloc_min - 1) + 1;
732 bank[1].highmem = highmem = 1; 745 bank[1].highmem = highmem = 1;
733 j++; 746 j++;
734 } 747 }
735 bank->size = VMALLOC_MIN - __va(bank->start); 748 bank->size = vmalloc_min - __va(bank->start);
736 } 749 }
737#else 750#else
738 bank->highmem = highmem; 751 bank->highmem = highmem;
@@ -741,7 +754,7 @@ static void __init sanity_check_meminfo(void)
741 * Check whether this memory bank would entirely overlap 754 * Check whether this memory bank would entirely overlap
742 * the vmalloc area. 755 * the vmalloc area.
743 */ 756 */
744 if (__va(bank->start) >= VMALLOC_MIN || 757 if (__va(bank->start) >= vmalloc_min ||
745 __va(bank->start) < (void *)PAGE_OFFSET) { 758 __va(bank->start) < (void *)PAGE_OFFSET) {
746 printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx " 759 printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx "
747 "(vmalloc region overlap).\n", 760 "(vmalloc region overlap).\n",
@@ -753,9 +766,9 @@ static void __init sanity_check_meminfo(void)
753 * Check whether this memory bank would partially overlap 766 * Check whether this memory bank would partially overlap
754 * the vmalloc area. 767 * the vmalloc area.
755 */ 768 */
756 if (__va(bank->start + bank->size) > VMALLOC_MIN || 769 if (__va(bank->start + bank->size) > vmalloc_min ||
757 __va(bank->start + bank->size) < __va(bank->start)) { 770 __va(bank->start + bank->size) < __va(bank->start)) {
758 unsigned long newsize = VMALLOC_MIN - __va(bank->start); 771 unsigned long newsize = vmalloc_min - __va(bank->start);
759 printk(KERN_NOTICE "Truncating RAM at %.8lx-%.8lx " 772 printk(KERN_NOTICE "Truncating RAM at %.8lx-%.8lx "
760 "to -%.8lx (vmalloc region overlap).\n", 773 "to -%.8lx (vmalloc region overlap).\n",
761 bank->start, bank->start + bank->size - 1, 774 bank->start, bank->start + bank->size - 1,
@@ -827,101 +840,23 @@ static inline void prepare_page_table(void)
827} 840}
828 841
829/* 842/*
830 * Reserve the various regions of node 0 843 * Reserve the special regions of memory
831 */ 844 */
832void __init reserve_node_zero(pg_data_t *pgdat) 845void __init arm_mm_memblock_reserve(void)
833{ 846{
834 unsigned long res_size = 0;
835
836 /*
837 * Register the kernel text and data with bootmem.
838 * Note that this can only be in node 0.
839 */
840#ifdef CONFIG_XIP_KERNEL
841 reserve_bootmem_node(pgdat, __pa(_data), _end - _data,
842 BOOTMEM_DEFAULT);
843#else
844 reserve_bootmem_node(pgdat, __pa(_stext), _end - _stext,
845 BOOTMEM_DEFAULT);
846#endif
847
848 /* 847 /*
849 * Reserve the page tables. These are already in use, 848 * Reserve the page tables. These are already in use,
850 * and can only be in node 0. 849 * and can only be in node 0.
851 */ 850 */
852 reserve_bootmem_node(pgdat, __pa(swapper_pg_dir), 851 memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t));
853 PTRS_PER_PGD * sizeof(pgd_t), BOOTMEM_DEFAULT);
854
855 /*
856 * Hmm... This should go elsewhere, but we really really need to
857 * stop things allocating the low memory; ideally we need a better
858 * implementation of GFP_DMA which does not assume that DMA-able
859 * memory starts at zero.
860 */
861 if (machine_is_integrator() || machine_is_cintegrator())
862 res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
863
864 /*
865 * These should likewise go elsewhere. They pre-reserve the
866 * screen memory region at the start of main system memory.
867 */
868 if (machine_is_edb7211())
869 res_size = 0x00020000;
870 if (machine_is_p720t())
871 res_size = 0x00014000;
872
873 /* H1940, RX3715 and RX1950 need to reserve this for suspend */
874
875 if (machine_is_h1940() || machine_is_rx3715()
876 || machine_is_rx1950()) {
877 reserve_bootmem_node(pgdat, 0x30003000, 0x1000,
878 BOOTMEM_DEFAULT);
879 reserve_bootmem_node(pgdat, 0x30081000, 0x1000,
880 BOOTMEM_DEFAULT);
881 }
882
883 if (machine_is_palmld() || machine_is_palmtx()) {
884 reserve_bootmem_node(pgdat, 0xa0000000, 0x1000,
885 BOOTMEM_EXCLUSIVE);
886 reserve_bootmem_node(pgdat, 0xa0200000, 0x1000,
887 BOOTMEM_EXCLUSIVE);
888 }
889
890 if (machine_is_treo680() || machine_is_centro()) {
891 reserve_bootmem_node(pgdat, 0xa0000000, 0x1000,
892 BOOTMEM_EXCLUSIVE);
893 reserve_bootmem_node(pgdat, 0xa2000000, 0x1000,
894 BOOTMEM_EXCLUSIVE);
895 }
896
897 if (machine_is_palmt5())
898 reserve_bootmem_node(pgdat, 0xa0200000, 0x1000,
899 BOOTMEM_EXCLUSIVE);
900
901 /*
902 * U300 - This platform family can share physical memory
903 * between two ARM cpus, one running Linux and the other
904 * running another OS.
905 */
906 if (machine_is_u300()) {
907#ifdef CONFIG_MACH_U300_SINGLE_RAM
908#if ((CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1) == 1) && \
909 CONFIG_MACH_U300_2MB_ALIGNMENT_FIX
910 res_size = 0x00100000;
911#endif
912#endif
913 }
914 852
915#ifdef CONFIG_SA1111 853#ifdef CONFIG_SA1111
916 /* 854 /*
917 * Because of the SA1111 DMA bug, we want to preserve our 855 * Because of the SA1111 DMA bug, we want to preserve our
918 * precious DMA-able memory... 856 * precious DMA-able memory...
919 */ 857 */
920 res_size = __pa(swapper_pg_dir) - PHYS_OFFSET; 858 memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET);
921#endif 859#endif
922 if (res_size)
923 reserve_bootmem_node(pgdat, PHYS_OFFSET, res_size,
924 BOOTMEM_DEFAULT);
925} 860}
926 861
927/* 862/*
@@ -940,7 +875,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
940 /* 875 /*
941 * Allocate the vector page early. 876 * Allocate the vector page early.
942 */ 877 */
943 vectors = alloc_bootmem_low_pages(PAGE_SIZE); 878 vectors = early_alloc(PAGE_SIZE);
944 879
945 for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE) 880 for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE)
946 pmd_clear(pmd_off_k(addr)); 881 pmd_clear(pmd_off_k(addr));
@@ -1011,11 +946,8 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
1011static void __init kmap_init(void) 946static void __init kmap_init(void)
1012{ 947{
1013#ifdef CONFIG_HIGHMEM 948#ifdef CONFIG_HIGHMEM
1014 pmd_t *pmd = pmd_off_k(PKMAP_BASE); 949 pkmap_page_table = early_pte_alloc(pmd_off_k(PKMAP_BASE),
1015 pte_t *pte = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * sizeof(pte_t)); 950 PKMAP_BASE, _PAGE_KERNEL_TABLE);
1016 BUG_ON(!pmd_none(*pmd) || !pte);
1017 __pmd_populate(pmd, __pa(pte) | _PAGE_KERNEL_TABLE);
1018 pkmap_page_table = pte + PTRS_PER_PTE;
1019#endif 951#endif
1020} 952}
1021 953
@@ -1066,17 +998,16 @@ void __init paging_init(struct machine_desc *mdesc)
1066 sanity_check_meminfo(); 998 sanity_check_meminfo();
1067 prepare_page_table(); 999 prepare_page_table();
1068 map_lowmem(); 1000 map_lowmem();
1069 bootmem_init();
1070 devicemaps_init(mdesc); 1001 devicemaps_init(mdesc);
1071 kmap_init(); 1002 kmap_init();
1072 1003
1073 top_pmd = pmd_off_k(0xffff0000); 1004 top_pmd = pmd_off_k(0xffff0000);
1074 1005
1075 /* 1006 /* allocate the zero page. */
1076 * allocate the zero page. Note that this always succeeds and 1007 zero_page = early_alloc(PAGE_SIZE);
1077 * returns a zeroed result. 1008
1078 */ 1009 bootmem_init();
1079 zero_page = alloc_bootmem_low_pages(PAGE_SIZE); 1010
1080 empty_zero_page = virt_to_page(zero_page); 1011 empty_zero_page = virt_to_page(zero_page);
1081 __flush_dcache_page(NULL, empty_zero_page); 1012 __flush_dcache_page(NULL, empty_zero_page);
1082} 1013}
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 33b327379f07..687d02319a41 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -6,8 +6,8 @@
6#include <linux/module.h> 6#include <linux/module.h>
7#include <linux/mm.h> 7#include <linux/mm.h>
8#include <linux/pagemap.h> 8#include <linux/pagemap.h>
9#include <linux/bootmem.h>
10#include <linux/io.h> 9#include <linux/io.h>
10#include <linux/memblock.h>
11 11
12#include <asm/cacheflush.h> 12#include <asm/cacheflush.h>
13#include <asm/sections.h> 13#include <asm/sections.h>
@@ -17,30 +17,14 @@
17 17
18#include "mm.h" 18#include "mm.h"
19 19
20/* 20void __init arm_mm_memblock_reserve(void)
21 * Reserve the various regions of node 0
22 */
23void __init reserve_node_zero(pg_data_t *pgdat)
24{ 21{
25 /* 22 /*
26 * Register the kernel text and data with bootmem.
27 * Note that this can only be in node 0.
28 */
29#ifdef CONFIG_XIP_KERNEL
30 reserve_bootmem_node(pgdat, __pa(_data), _end - _data,
31 BOOTMEM_DEFAULT);
32#else
33 reserve_bootmem_node(pgdat, __pa(_stext), _end - _stext,
34 BOOTMEM_DEFAULT);
35#endif
36
37 /*
38 * Register the exception vector page. 23 * Register the exception vector page.
39 * some architectures which the DRAM is the exception vector to trap, 24 * some architectures which the DRAM is the exception vector to trap,
40 * alloc_page breaks with error, although it is not NULL, but "0." 25 * alloc_page breaks with error, although it is not NULL, but "0."
41 */ 26 */
42 reserve_bootmem_node(pgdat, CONFIG_VECTORS_BASE, PAGE_SIZE, 27 memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);
43 BOOTMEM_DEFAULT);
44} 28}
45 29
46/* 30/*
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 7a5337ed7d68..2f5a3c23a0fe 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -239,7 +239,8 @@ __v6_proc_info:
239 b __v6_setup 239 b __v6_setup
240 .long cpu_arch_name 240 .long cpu_arch_name
241 .long cpu_elf_name 241 .long cpu_elf_name
242 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_JAVA 242 /* See also feat_v6_fixup() for HWCAP_TLS */
243 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_JAVA|HWCAP_TLS
243 .long cpu_v6_name 244 .long cpu_v6_name
244 .long v6_processor_functions 245 .long v6_processor_functions
245 .long v6wbi_tlb_fns 246 .long v6wbi_tlb_fns
@@ -262,7 +263,7 @@ __pj4_v6_proc_info:
262 b __v6_setup 263 b __v6_setup
263 .long cpu_arch_name 264 .long cpu_arch_name
264 .long cpu_elf_name 265 .long cpu_elf_name
265 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP 266 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_TLS
266 .long cpu_pj4_name 267 .long cpu_pj4_name
267 .long v6_processor_functions 268 .long v6_processor_functions
268 .long v6wbi_tlb_fns 269 .long v6wbi_tlb_fns
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 7aaf88a3b7aa..8071bcd4c995 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -344,7 +344,7 @@ __v7_proc_info:
344 b __v7_setup 344 b __v7_setup
345 .long cpu_arch_name 345 .long cpu_arch_name
346 .long cpu_elf_name 346 .long cpu_elf_name
347 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP 347 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_TLS
348 .long cpu_v7_name 348 .long cpu_v7_name
349 .long v7_processor_functions 349 .long v7_processor_functions
350 .long v7wbi_tlb_fns 350 .long v7wbi_tlb_fns
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 6c8a02ad98e3..85d3e55ca4a9 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -29,6 +29,11 @@
29#include <mach/time.h> 29#include <mach/time.h>
30 30
31/* 31/*
32 * Minimum clocksource/clockevent timer range in seconds
33 */
34#define IOP_MIN_RANGE 4
35
36/*
32 * IOP clocksource (free-running timer 1). 37 * IOP clocksource (free-running timer 1).
33 */ 38 */
34static cycle_t iop_clocksource_read(struct clocksource *unused) 39static cycle_t iop_clocksource_read(struct clocksource *unused)
@@ -44,27 +49,6 @@ static struct clocksource iop_clocksource = {
44 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 49 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
45}; 50};
46 51
47static void __init iop_clocksource_set_hz(struct clocksource *cs, unsigned int hz)
48{
49 u64 temp;
50 u32 shift;
51
52 /* Find shift and mult values for hz. */
53 shift = 32;
54 do {
55 temp = (u64) NSEC_PER_SEC << shift;
56 do_div(temp, hz);
57 if ((temp >> 32) == 0)
58 break;
59 } while (--shift != 0);
60
61 cs->shift = shift;
62 cs->mult = (u32) temp;
63
64 printk(KERN_INFO "clocksource: %s uses shift %u mult %#x\n",
65 cs->name, cs->shift, cs->mult);
66}
67
68/* 52/*
69 * IOP sched_clock() implementation via its clocksource. 53 * IOP sched_clock() implementation via its clocksource.
70 */ 54 */
@@ -130,27 +114,6 @@ static struct clock_event_device iop_clockevent = {
130 .set_mode = iop_set_mode, 114 .set_mode = iop_set_mode,
131}; 115};
132 116
133static void __init iop_clockevent_set_hz(struct clock_event_device *ce, unsigned int hz)
134{
135 u64 temp;
136 u32 shift;
137
138 /* Find shift and mult values for hz. */
139 shift = 32;
140 do {
141 temp = (u64) hz << shift;
142 do_div(temp, NSEC_PER_SEC);
143 if ((temp >> 32) == 0)
144 break;
145 } while (--shift != 0);
146
147 ce->shift = shift;
148 ce->mult = (u32) temp;
149
150 printk(KERN_INFO "clockevent: %s uses shift %u mult %#lx\n",
151 ce->name, ce->shift, ce->mult);
152}
153
154static irqreturn_t 117static irqreturn_t
155iop_timer_interrupt(int irq, void *dev_id) 118iop_timer_interrupt(int irq, void *dev_id)
156{ 119{
@@ -190,7 +153,8 @@ void __init iop_init_time(unsigned long tick_rate)
190 */ 153 */
191 write_tmr0(timer_ctl & ~IOP_TMR_EN); 154 write_tmr0(timer_ctl & ~IOP_TMR_EN);
192 setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); 155 setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq);
193 iop_clockevent_set_hz(&iop_clockevent, tick_rate); 156 clockevents_calc_mult_shift(&iop_clockevent,
157 tick_rate, IOP_MIN_RANGE);
194 iop_clockevent.max_delta_ns = 158 iop_clockevent.max_delta_ns =
195 clockevent_delta2ns(0xfffffffe, &iop_clockevent); 159 clockevent_delta2ns(0xfffffffe, &iop_clockevent);
196 iop_clockevent.min_delta_ns = 160 iop_clockevent.min_delta_ns =
@@ -207,6 +171,7 @@ void __init iop_init_time(unsigned long tick_rate)
207 write_trr1(0xffffffff); 171 write_trr1(0xffffffff);
208 write_tcr1(0xffffffff); 172 write_tcr1(0xffffffff);
209 write_tmr1(timer_ctl); 173 write_tmr1(timer_ctl);
210 iop_clocksource_set_hz(&iop_clocksource, tick_rate); 174 clocksource_calc_mult_shift(&iop_clocksource, tick_rate,
175 IOP_MIN_RANGE);
211 clocksource_register(&iop_clocksource); 176 clocksource_register(&iop_clocksource);
212} 177}
diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c
index 5a6ef252c38b..977c8f9a07a2 100644
--- a/arch/arm/plat-nomadik/gpio.c
+++ b/arch/arm/plat-nomadik/gpio.c
@@ -23,6 +23,7 @@
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25 25
26#include <plat/pincfg.h>
26#include <mach/hardware.h> 27#include <mach/hardware.h>
27#include <mach/gpio.h> 28#include <mach/gpio.h>
28 29
@@ -46,28 +47,217 @@ struct nmk_gpio_chip {
46 u32 edge_falling; 47 u32 edge_falling;
47}; 48};
48 49
50static void __nmk_gpio_set_mode(struct nmk_gpio_chip *nmk_chip,
51 unsigned offset, int gpio_mode)
52{
53 u32 bit = 1 << offset;
54 u32 afunc, bfunc;
55
56 afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & ~bit;
57 bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & ~bit;
58 if (gpio_mode & NMK_GPIO_ALT_A)
59 afunc |= bit;
60 if (gpio_mode & NMK_GPIO_ALT_B)
61 bfunc |= bit;
62 writel(afunc, nmk_chip->addr + NMK_GPIO_AFSLA);
63 writel(bfunc, nmk_chip->addr + NMK_GPIO_AFSLB);
64}
65
66static void __nmk_gpio_set_slpm(struct nmk_gpio_chip *nmk_chip,
67 unsigned offset, enum nmk_gpio_slpm mode)
68{
69 u32 bit = 1 << offset;
70 u32 slpm;
71
72 slpm = readl(nmk_chip->addr + NMK_GPIO_SLPC);
73 if (mode == NMK_GPIO_SLPM_NOCHANGE)
74 slpm |= bit;
75 else
76 slpm &= ~bit;
77 writel(slpm, nmk_chip->addr + NMK_GPIO_SLPC);
78}
79
80static void __nmk_gpio_set_pull(struct nmk_gpio_chip *nmk_chip,
81 unsigned offset, enum nmk_gpio_pull pull)
82{
83 u32 bit = 1 << offset;
84 u32 pdis;
85
86 pdis = readl(nmk_chip->addr + NMK_GPIO_PDIS);
87 if (pull == NMK_GPIO_PULL_NONE)
88 pdis |= bit;
89 else
90 pdis &= ~bit;
91 writel(pdis, nmk_chip->addr + NMK_GPIO_PDIS);
92
93 if (pull == NMK_GPIO_PULL_UP)
94 writel(bit, nmk_chip->addr + NMK_GPIO_DATS);
95 else if (pull == NMK_GPIO_PULL_DOWN)
96 writel(bit, nmk_chip->addr + NMK_GPIO_DATC);
97}
98
99static void __nmk_gpio_make_input(struct nmk_gpio_chip *nmk_chip,
100 unsigned offset)
101{
102 writel(1 << offset, nmk_chip->addr + NMK_GPIO_DIRC);
103}
104
105static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset,
106 pin_cfg_t cfg)
107{
108 static const char *afnames[] = {
109 [NMK_GPIO_ALT_GPIO] = "GPIO",
110 [NMK_GPIO_ALT_A] = "A",
111 [NMK_GPIO_ALT_B] = "B",
112 [NMK_GPIO_ALT_C] = "C"
113 };
114 static const char *pullnames[] = {
115 [NMK_GPIO_PULL_NONE] = "none",
116 [NMK_GPIO_PULL_UP] = "up",
117 [NMK_GPIO_PULL_DOWN] = "down",
118 [3] /* illegal */ = "??"
119 };
120 static const char *slpmnames[] = {
121 [NMK_GPIO_SLPM_INPUT] = "input",
122 [NMK_GPIO_SLPM_NOCHANGE] = "no-change",
123 };
124
125 int pin = PIN_NUM(cfg);
126 int pull = PIN_PULL(cfg);
127 int af = PIN_ALT(cfg);
128 int slpm = PIN_SLPM(cfg);
129
130 dev_dbg(nmk_chip->chip.dev, "pin %d: af %s, pull %s, slpm %s\n",
131 pin, afnames[af], pullnames[pull], slpmnames[slpm]);
132
133 __nmk_gpio_make_input(nmk_chip, offset);
134 __nmk_gpio_set_pull(nmk_chip, offset, pull);
135 __nmk_gpio_set_slpm(nmk_chip, offset, slpm);
136 __nmk_gpio_set_mode(nmk_chip, offset, af);
137}
138
139/**
140 * nmk_config_pin - configure a pin's mux attributes
141 * @cfg: pin confguration
142 *
143 * Configures a pin's mode (alternate function or GPIO), its pull up status,
144 * and its sleep mode based on the specified configuration. The @cfg is
145 * usually one of the SoC specific macros defined in mach/<soc>-pins.h. These
146 * are constructed using, and can be further enhanced with, the macros in
147 * plat/pincfg.h.
148 *
149 * If a pin's mode is set to GPIO, it is configured as an input to avoid
150 * side-effects. The gpio can be manipulated later using standard GPIO API
151 * calls.
152 */
153int nmk_config_pin(pin_cfg_t cfg)
154{
155 struct nmk_gpio_chip *nmk_chip;
156 int gpio = PIN_NUM(cfg);
157 unsigned long flags;
158
159 nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
160 if (!nmk_chip)
161 return -EINVAL;
162
163 spin_lock_irqsave(&nmk_chip->lock, flags);
164 __nmk_config_pin(nmk_chip, gpio - nmk_chip->chip.base, cfg);
165 spin_unlock_irqrestore(&nmk_chip->lock, flags);
166
167 return 0;
168}
169EXPORT_SYMBOL(nmk_config_pin);
170
171/**
172 * nmk_config_pins - configure several pins at once
173 * @cfgs: array of pin configurations
174 * @num: number of elments in the array
175 *
176 * Configures several pins using nmk_config_pin(). Refer to that function for
177 * further information.
178 */
179int nmk_config_pins(pin_cfg_t *cfgs, int num)
180{
181 int ret = 0;
182 int i;
183
184 for (i = 0; i < num; i++) {
185 int ret = nmk_config_pin(cfgs[i]);
186 if (ret)
187 break;
188 }
189
190 return ret;
191}
192EXPORT_SYMBOL(nmk_config_pins);
193
194/**
195 * nmk_gpio_set_slpm() - configure the sleep mode of a pin
196 * @gpio: pin number
197 * @mode: NMK_GPIO_SLPM_INPUT or NMK_GPIO_SLPM_NOCHANGE,
198 *
199 * Sets the sleep mode of a pin. If @mode is NMK_GPIO_SLPM_INPUT, the pin is
200 * changed to an input (with pullup/down enabled) in sleep and deep sleep. If
201 * @mode is NMK_GPIO_SLPM_NOCHANGE, the pin remains in the state it was
202 * configured even when in sleep and deep sleep.
203 */
204int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode)
205{
206 struct nmk_gpio_chip *nmk_chip;
207 unsigned long flags;
208
209 nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
210 if (!nmk_chip)
211 return -EINVAL;
212
213 spin_lock_irqsave(&nmk_chip->lock, flags);
214 __nmk_gpio_set_slpm(nmk_chip, gpio - nmk_chip->chip.base, mode);
215 spin_unlock_irqrestore(&nmk_chip->lock, flags);
216
217 return 0;
218}
219
220/**
221 * nmk_gpio_set_pull() - enable/disable pull up/down on a gpio
222 * @gpio: pin number
223 * @pull: one of NMK_GPIO_PULL_DOWN, NMK_GPIO_PULL_UP, and NMK_GPIO_PULL_NONE
224 *
225 * Enables/disables pull up/down on a specified pin. This only takes effect if
226 * the pin is configured as an input (either explicitly or by the alternate
227 * function).
228 *
229 * NOTE: If enabling the pull up/down, the caller must ensure that the GPIO is
230 * configured as an input. Otherwise, due to the way the controller registers
231 * work, this function will change the value output on the pin.
232 */
233int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull)
234{
235 struct nmk_gpio_chip *nmk_chip;
236 unsigned long flags;
237
238 nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
239 if (!nmk_chip)
240 return -EINVAL;
241
242 spin_lock_irqsave(&nmk_chip->lock, flags);
243 __nmk_gpio_set_pull(nmk_chip, gpio - nmk_chip->chip.base, pull);
244 spin_unlock_irqrestore(&nmk_chip->lock, flags);
245
246 return 0;
247}
248
49/* Mode functions */ 249/* Mode functions */
50int nmk_gpio_set_mode(int gpio, int gpio_mode) 250int nmk_gpio_set_mode(int gpio, int gpio_mode)
51{ 251{
52 struct nmk_gpio_chip *nmk_chip; 252 struct nmk_gpio_chip *nmk_chip;
53 unsigned long flags; 253 unsigned long flags;
54 u32 afunc, bfunc, bit;
55 254
56 nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio)); 255 nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
57 if (!nmk_chip) 256 if (!nmk_chip)
58 return -EINVAL; 257 return -EINVAL;
59 258
60 bit = 1 << (gpio - nmk_chip->chip.base);
61
62 spin_lock_irqsave(&nmk_chip->lock, flags); 259 spin_lock_irqsave(&nmk_chip->lock, flags);
63 afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & ~bit; 260 __nmk_gpio_set_mode(nmk_chip, gpio - nmk_chip->chip.base, gpio_mode);
64 bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & ~bit;
65 if (gpio_mode & NMK_GPIO_ALT_A)
66 afunc |= bit;
67 if (gpio_mode & NMK_GPIO_ALT_B)
68 bfunc |= bit;
69 writel(afunc, nmk_chip->addr + NMK_GPIO_AFSLA);
70 writel(bfunc, nmk_chip->addr + NMK_GPIO_AFSLB);
71 spin_unlock_irqrestore(&nmk_chip->lock, flags); 261 spin_unlock_irqrestore(&nmk_chip->lock, flags);
72 262
73 return 0; 263 return 0;
@@ -111,32 +301,41 @@ static void nmk_gpio_irq_ack(unsigned int irq)
111 writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); 301 writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC);
112} 302}
113 303
304enum nmk_gpio_irq_type {
305 NORMAL,
306 WAKE,
307};
308
114static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip, 309static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip,
115 int gpio, bool enable) 310 int gpio, enum nmk_gpio_irq_type which,
311 bool enable)
116{ 312{
313 u32 rimsc = which == WAKE ? NMK_GPIO_RWIMSC : NMK_GPIO_RIMSC;
314 u32 fimsc = which == WAKE ? NMK_GPIO_FWIMSC : NMK_GPIO_FIMSC;
117 u32 bitmask = nmk_gpio_get_bitmask(gpio); 315 u32 bitmask = nmk_gpio_get_bitmask(gpio);
118 u32 reg; 316 u32 reg;
119 317
120 /* we must individually set/clear the two edges */ 318 /* we must individually set/clear the two edges */
121 if (nmk_chip->edge_rising & bitmask) { 319 if (nmk_chip->edge_rising & bitmask) {
122 reg = readl(nmk_chip->addr + NMK_GPIO_RIMSC); 320 reg = readl(nmk_chip->addr + rimsc);
123 if (enable) 321 if (enable)
124 reg |= bitmask; 322 reg |= bitmask;
125 else 323 else
126 reg &= ~bitmask; 324 reg &= ~bitmask;
127 writel(reg, nmk_chip->addr + NMK_GPIO_RIMSC); 325 writel(reg, nmk_chip->addr + rimsc);
128 } 326 }
129 if (nmk_chip->edge_falling & bitmask) { 327 if (nmk_chip->edge_falling & bitmask) {
130 reg = readl(nmk_chip->addr + NMK_GPIO_FIMSC); 328 reg = readl(nmk_chip->addr + fimsc);
131 if (enable) 329 if (enable)
132 reg |= bitmask; 330 reg |= bitmask;
133 else 331 else
134 reg &= ~bitmask; 332 reg &= ~bitmask;
135 writel(reg, nmk_chip->addr + NMK_GPIO_FIMSC); 333 writel(reg, nmk_chip->addr + fimsc);
136 } 334 }
137} 335}
138 336
139static void nmk_gpio_irq_modify(unsigned int irq, bool enable) 337static int nmk_gpio_irq_modify(unsigned int irq, enum nmk_gpio_irq_type which,
338 bool enable)
140{ 339{
141 int gpio; 340 int gpio;
142 struct nmk_gpio_chip *nmk_chip; 341 struct nmk_gpio_chip *nmk_chip;
@@ -147,26 +346,35 @@ static void nmk_gpio_irq_modify(unsigned int irq, bool enable)
147 nmk_chip = get_irq_chip_data(irq); 346 nmk_chip = get_irq_chip_data(irq);
148 bitmask = nmk_gpio_get_bitmask(gpio); 347 bitmask = nmk_gpio_get_bitmask(gpio);
149 if (!nmk_chip) 348 if (!nmk_chip)
150 return; 349 return -EINVAL;
151 350
152 spin_lock_irqsave(&nmk_chip->lock, flags); 351 spin_lock_irqsave(&nmk_chip->lock, flags);
153 __nmk_gpio_irq_modify(nmk_chip, gpio, enable); 352 __nmk_gpio_irq_modify(nmk_chip, gpio, which, enable);
154 spin_unlock_irqrestore(&nmk_chip->lock, flags); 353 spin_unlock_irqrestore(&nmk_chip->lock, flags);
354
355 return 0;
155} 356}
156 357
157static void nmk_gpio_irq_mask(unsigned int irq) 358static void nmk_gpio_irq_mask(unsigned int irq)
158{ 359{
159 nmk_gpio_irq_modify(irq, false); 360 nmk_gpio_irq_modify(irq, NORMAL, false);
160}; 361}
161 362
162static void nmk_gpio_irq_unmask(unsigned int irq) 363static void nmk_gpio_irq_unmask(unsigned int irq)
163{ 364{
164 nmk_gpio_irq_modify(irq, true); 365 nmk_gpio_irq_modify(irq, NORMAL, true);
366}
367
368static int nmk_gpio_irq_set_wake(unsigned int irq, unsigned int on)
369{
370 return nmk_gpio_irq_modify(irq, WAKE, on);
165} 371}
166 372
167static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) 373static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
168{ 374{
169 bool enabled = !(irq_to_desc(irq)->status & IRQ_DISABLED); 375 struct irq_desc *desc = irq_to_desc(irq);
376 bool enabled = !(desc->status & IRQ_DISABLED);
377 bool wake = desc->wake_depth;
170 int gpio; 378 int gpio;
171 struct nmk_gpio_chip *nmk_chip; 379 struct nmk_gpio_chip *nmk_chip;
172 unsigned long flags; 380 unsigned long flags;
@@ -186,7 +394,10 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
186 spin_lock_irqsave(&nmk_chip->lock, flags); 394 spin_lock_irqsave(&nmk_chip->lock, flags);
187 395
188 if (enabled) 396 if (enabled)
189 __nmk_gpio_irq_modify(nmk_chip, gpio, false); 397 __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, false);
398
399 if (wake)
400 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, false);
190 401
191 nmk_chip->edge_rising &= ~bitmask; 402 nmk_chip->edge_rising &= ~bitmask;
192 if (type & IRQ_TYPE_EDGE_RISING) 403 if (type & IRQ_TYPE_EDGE_RISING)
@@ -197,7 +408,10 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
197 nmk_chip->edge_falling |= bitmask; 408 nmk_chip->edge_falling |= bitmask;
198 409
199 if (enabled) 410 if (enabled)
200 __nmk_gpio_irq_modify(nmk_chip, gpio, true); 411 __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, true);
412
413 if (wake)
414 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, true);
201 415
202 spin_unlock_irqrestore(&nmk_chip->lock, flags); 416 spin_unlock_irqrestore(&nmk_chip->lock, flags);
203 417
@@ -210,6 +424,7 @@ static struct irq_chip nmk_gpio_irq_chip = {
210 .mask = nmk_gpio_irq_mask, 424 .mask = nmk_gpio_irq_mask,
211 .unmask = nmk_gpio_irq_unmask, 425 .unmask = nmk_gpio_irq_unmask,
212 .set_type = nmk_gpio_irq_set_type, 426 .set_type = nmk_gpio_irq_set_type,
427 .set_wake = nmk_gpio_irq_set_wake,
213}; 428};
214 429
215static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) 430static 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)
266 return 0; 481 return 0;
267} 482}
268 483
269static int nmk_gpio_make_output(struct gpio_chip *chip, unsigned offset,
270 int val)
271{
272 struct nmk_gpio_chip *nmk_chip =
273 container_of(chip, struct nmk_gpio_chip, chip);
274
275 writel(1 << offset, nmk_chip->addr + NMK_GPIO_DIRS);
276 return 0;
277}
278
279static int nmk_gpio_get_input(struct gpio_chip *chip, unsigned offset) 484static int nmk_gpio_get_input(struct gpio_chip *chip, unsigned offset)
280{ 485{
281 struct nmk_gpio_chip *nmk_chip = 486 struct nmk_gpio_chip *nmk_chip =
@@ -298,12 +503,33 @@ static void nmk_gpio_set_output(struct gpio_chip *chip, unsigned offset,
298 writel(bit, nmk_chip->addr + NMK_GPIO_DATC); 503 writel(bit, nmk_chip->addr + NMK_GPIO_DATC);
299} 504}
300 505
506static int nmk_gpio_make_output(struct gpio_chip *chip, unsigned offset,
507 int val)
508{
509 struct nmk_gpio_chip *nmk_chip =
510 container_of(chip, struct nmk_gpio_chip, chip);
511
512 writel(1 << offset, nmk_chip->addr + NMK_GPIO_DIRS);
513 nmk_gpio_set_output(chip, offset, val);
514
515 return 0;
516}
517
518static int nmk_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
519{
520 struct nmk_gpio_chip *nmk_chip =
521 container_of(chip, struct nmk_gpio_chip, chip);
522
523 return NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base) + offset;
524}
525
301/* This structure is replicated for each GPIO block allocated at probe time */ 526/* This structure is replicated for each GPIO block allocated at probe time */
302static struct gpio_chip nmk_gpio_template = { 527static struct gpio_chip nmk_gpio_template = {
303 .direction_input = nmk_gpio_make_input, 528 .direction_input = nmk_gpio_make_input,
304 .get = nmk_gpio_get_input, 529 .get = nmk_gpio_get_input,
305 .direction_output = nmk_gpio_make_output, 530 .direction_output = nmk_gpio_make_output,
306 .set = nmk_gpio_set_output, 531 .set = nmk_gpio_set_output,
532 .to_irq = nmk_gpio_to_irq,
307 .ngpio = NMK_GPIO_PER_CHIP, 533 .ngpio = NMK_GPIO_PER_CHIP,
308 .can_sleep = 0, 534 .can_sleep = 0,
309}; 535};
@@ -393,30 +619,12 @@ out:
393 return ret; 619 return ret;
394} 620}
395 621
396static int __exit nmk_gpio_remove(struct platform_device *dev)
397{
398 struct nmk_gpio_chip *nmk_chip;
399 struct resource *res;
400
401 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
402
403 nmk_chip = platform_get_drvdata(dev);
404 gpiochip_remove(&nmk_chip->chip);
405 clk_disable(nmk_chip->clk);
406 clk_put(nmk_chip->clk);
407 kfree(nmk_chip);
408 release_mem_region(res->start, resource_size(res));
409 return 0;
410}
411
412
413static struct platform_driver nmk_gpio_driver = { 622static struct platform_driver nmk_gpio_driver = {
414 .driver = { 623 .driver = {
415 .owner = THIS_MODULE, 624 .owner = THIS_MODULE,
416 .name = "gpio", 625 .name = "gpio",
417 }, 626 },
418 .probe = nmk_gpio_probe, 627 .probe = nmk_gpio_probe,
419 .remove = __exit_p(nmk_gpio_remove),
420 .suspend = NULL, /* to be done */ 628 .suspend = NULL, /* to be done */
421 .resume = NULL, 629 .resume = NULL,
422}; 630};
@@ -426,7 +634,7 @@ static int __init nmk_gpio_init(void)
426 return platform_driver_register(&nmk_gpio_driver); 634 return platform_driver_register(&nmk_gpio_driver);
427} 635}
428 636
429arch_initcall(nmk_gpio_init); 637core_initcall(nmk_gpio_init);
430 638
431MODULE_AUTHOR("Prafulla WADASKAR and Alessandro Rubini"); 639MODULE_AUTHOR("Prafulla WADASKAR and Alessandro Rubini");
432MODULE_DESCRIPTION("Nomadik GPIO Driver"); 640MODULE_DESCRIPTION("Nomadik GPIO Driver");
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h
index 4200811249ca..aba355101f49 100644
--- a/arch/arm/plat-nomadik/include/plat/gpio.h
+++ b/arch/arm/plat-nomadik/include/plat/gpio.h
@@ -55,6 +55,21 @@
55#define NMK_GPIO_ALT_B 2 55#define NMK_GPIO_ALT_B 2
56#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B) 56#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
57 57
58/* Pull up/down values */
59enum nmk_gpio_pull {
60 NMK_GPIO_PULL_NONE,
61 NMK_GPIO_PULL_UP,
62 NMK_GPIO_PULL_DOWN,
63};
64
65/* Sleep mode */
66enum nmk_gpio_slpm {
67 NMK_GPIO_SLPM_INPUT,
68 NMK_GPIO_SLPM_NOCHANGE,
69};
70
71extern int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode);
72extern int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull);
58extern int nmk_gpio_set_mode(int gpio, int gpio_mode); 73extern int nmk_gpio_set_mode(int gpio, int gpio_mode);
59extern int nmk_gpio_get_mode(int gpio); 74extern int nmk_gpio_get_mode(int gpio);
60 75
diff --git a/arch/arm/plat-nomadik/include/plat/mtu.h b/arch/arm/plat-nomadik/include/plat/mtu.h
index 42c907258b14..65704a3d4241 100644
--- a/arch/arm/plat-nomadik/include/plat/mtu.h
+++ b/arch/arm/plat-nomadik/include/plat/mtu.h
@@ -1,6 +1,12 @@
1#ifndef __PLAT_MTU_H 1#ifndef __PLAT_MTU_H
2#define __PLAT_MTU_H 2#define __PLAT_MTU_H
3 3
4/*
5 * Guaranteed runtime conversion range in seconds for
6 * the clocksource and clockevent.
7 */
8#define MTU_MIN_RANGE 4
9
4/* should be set by the platform code */ 10/* should be set by the platform code */
5extern void __iomem *mtu_base; 11extern void __iomem *mtu_base;
6 12
diff --git a/arch/arm/plat-nomadik/include/plat/pincfg.h b/arch/arm/plat-nomadik/include/plat/pincfg.h
new file mode 100644
index 000000000000..7eed11c1038d
--- /dev/null
+++ b/arch/arm/plat-nomadik/include/plat/pincfg.h
@@ -0,0 +1,72 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License terms: GNU General Public License, version 2
5 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
6 *
7 * Based on arch/arm/mach-pxa/include/mach/mfp.h:
8 * Copyright (C) 2007 Marvell International Ltd.
9 * eric miao <eric.miao@marvell.com>
10 */
11
12#ifndef __PLAT_PINCFG_H
13#define __PLAT_PINCFG_H
14
15/*
16 * pin configurations are represented by 32-bit integers:
17 *
18 * bit 0.. 8 - Pin Number (512 Pins Maximum)
19 * bit 9..10 - Alternate Function Selection
20 * bit 11..12 - Pull up/down state
21 * bit 13 - Sleep mode behaviour
22 *
23 * to facilitate the definition, the following macros are provided
24 *
25 * PIN_CFG_DEFAULT - default config (0):
26 * pull up/down = disabled
27 * sleep mode = input
28 *
29 * PIN_CFG - default config with alternate function
30 * PIN_CFG_PULL - default config with alternate function and pull up/down
31 */
32
33typedef unsigned long pin_cfg_t;
34
35#define PIN_NUM_MASK 0x1ff
36#define PIN_NUM(x) ((x) & PIN_NUM_MASK)
37
38#define PIN_ALT_SHIFT 9
39#define PIN_ALT_MASK (0x3 << PIN_ALT_SHIFT)
40#define PIN_ALT(x) (((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT)
41#define PIN_GPIO (NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT)
42#define PIN_ALT_A (NMK_GPIO_ALT_A << PIN_ALT_SHIFT)
43#define PIN_ALT_B (NMK_GPIO_ALT_B << PIN_ALT_SHIFT)
44#define PIN_ALT_C (NMK_GPIO_ALT_C << PIN_ALT_SHIFT)
45
46#define PIN_PULL_SHIFT 11
47#define PIN_PULL_MASK (0x3 << PIN_PULL_SHIFT)
48#define PIN_PULL(x) (((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT)
49#define PIN_PULL_NONE (NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT)
50#define PIN_PULL_UP (NMK_GPIO_PULL_UP << PIN_PULL_SHIFT)
51#define PIN_PULL_DOWN (NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT)
52
53#define PIN_SLPM_SHIFT 13
54#define PIN_SLPM_MASK (0x1 << PIN_SLPM_SHIFT)
55#define PIN_SLPM(x) (((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT)
56#define PIN_SLPM_INPUT (NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT)
57#define PIN_SLPM_NOCHANGE (NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT)
58
59#define PIN_CFG_DEFAULT (PIN_PULL_NONE | PIN_SLPM_INPUT)
60
61#define PIN_CFG(num, alt) \
62 (PIN_CFG_DEFAULT |\
63 (PIN_NUM(num) | PIN_##alt))
64
65#define PIN_CFG_PULL(num, alt, pull) \
66 ((PIN_CFG_DEFAULT & ~PIN_PULL_MASK) |\
67 (PIN_NUM(num) | PIN_##alt | PIN_PULL_##pull))
68
69extern int nmk_config_pin(pin_cfg_t cfg);
70extern int nmk_config_pins(pin_cfg_t *cfgs, int num);
71
72#endif
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index 08aaa4a7f65f..ea3ca86c5283 100644
--- a/arch/arm/plat-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -42,7 +42,6 @@ static struct clocksource nmdk_clksrc = {
42 .rating = 200, 42 .rating = 200,
43 .read = nmdk_read_timer_dummy, 43 .read = nmdk_read_timer_dummy,
44 .mask = CLOCKSOURCE_MASK(32), 44 .mask = CLOCKSOURCE_MASK(32),
45 .shift = 20,
46 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 45 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
47}; 46};
48 47
@@ -82,6 +81,12 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode,
82 case CLOCK_EVT_MODE_UNUSED: 81 case CLOCK_EVT_MODE_UNUSED:
83 /* disable irq */ 82 /* disable irq */
84 writel(0, mtu_base + MTU_IMSC); 83 writel(0, mtu_base + MTU_IMSC);
84 /* disable timer */
85 cr = readl(mtu_base + MTU_CR(1));
86 cr &= ~MTU_CRn_ENA;
87 writel(cr, mtu_base + MTU_CR(1));
88 /* load some high default value */
89 writel(0xffffffff, mtu_base + MTU_LR(1));
85 break; 90 break;
86 case CLOCK_EVT_MODE_RESUME: 91 case CLOCK_EVT_MODE_RESUME:
87 break; 92 break;
@@ -98,7 +103,6 @@ static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev)
98static struct clock_event_device nmdk_clkevt = { 103static struct clock_event_device nmdk_clkevt = {
99 .name = "mtu_1", 104 .name = "mtu_1",
100 .features = CLOCK_EVT_FEAT_ONESHOT, 105 .features = CLOCK_EVT_FEAT_ONESHOT,
101 .shift = 32,
102 .rating = 200, 106 .rating = 200,
103 .set_mode = nmdk_clkevt_mode, 107 .set_mode = nmdk_clkevt_mode,
104 .set_next_event = nmdk_clkevt_next, 108 .set_next_event = nmdk_clkevt_next,
@@ -151,6 +155,7 @@ void __init nmdk_timer_init(void)
151 } else { 155 } else {
152 cr |= MTU_CRn_PRESCALE_1; 156 cr |= MTU_CRn_PRESCALE_1;
153 } 157 }
158 clocksource_calc_mult_shift(&nmdk_clksrc, rate, MTU_MIN_RANGE);
154 159
155 /* Timer 0 is the free running clocksource */ 160 /* Timer 0 is the free running clocksource */
156 writel(cr, mtu_base + MTU_CR(0)); 161 writel(cr, mtu_base + MTU_CR(0));
@@ -158,7 +163,6 @@ void __init nmdk_timer_init(void)
158 writel(0, mtu_base + MTU_BGLR(0)); 163 writel(0, mtu_base + MTU_BGLR(0));
159 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0)); 164 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0));
160 165
161 nmdk_clksrc.mult = clocksource_hz2mult(rate, nmdk_clksrc.shift);
162 /* Now the scheduling clock is ready */ 166 /* Now the scheduling clock is ready */
163 nmdk_clksrc.read = nmdk_read_timer; 167 nmdk_clksrc.read = nmdk_read_timer;
164 168
@@ -175,8 +179,10 @@ void __init nmdk_timer_init(void)
175 } else { 179 } else {
176 cr |= MTU_CRn_PRESCALE_1; 180 cr |= MTU_CRn_PRESCALE_1;
177 } 181 }
182 clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);
183
178 writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */ 184 writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */
179 nmdk_clkevt.mult = div_sc(rate, NSEC_PER_SEC, nmdk_clkevt.shift); 185
180 nmdk_clkevt.max_delta_ns = 186 nmdk_clkevt.max_delta_ns =
181 clockevent_delta2ns(0xffffffff, &nmdk_clkevt); 187 clockevent_delta2ns(0xffffffff, &nmdk_clkevt);
182 nmdk_clkevt.min_delta_ns = 188 nmdk_clkevt.min_delta_ns =
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 219c01e82bc5..ebed82699eb2 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -22,6 +22,7 @@
22#include <linux/serial_reg.h> 22#include <linux/serial_reg.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/omapfb.h>
25 26
26#include <mach/hardware.h> 27#include <mach/hardware.h>
27#include <asm/system.h> 28#include <asm/system.h>
@@ -35,6 +36,7 @@
35#include <plat/mux.h> 36#include <plat/mux.h>
36#include <plat/fpga.h> 37#include <plat/fpga.h>
37#include <plat/serial.h> 38#include <plat/serial.h>
39#include <plat/vram.h>
38 40
39#include <plat/clock.h> 41#include <plat/clock.h>
40 42
@@ -81,6 +83,12 @@ const void *omap_get_var_config(u16 tag, size_t *len)
81} 83}
82EXPORT_SYMBOL(omap_get_var_config); 84EXPORT_SYMBOL(omap_get_var_config);
83 85
86void __init omap_reserve(void)
87{
88 omapfb_reserve_sdram_memblock();
89 omap_vram_reserve_sdram_memblock();
90}
91
84/* 92/*
85 * 32KHz clocksource ... always available, on pretty most chips except 93 * 32KHz clocksource ... always available, on pretty most chips except
86 * OMAP 730 and 1510. Other timers could be used as clocksources, with 94 * OMAP 730 and 1510. Other timers could be used as clocksources, with
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index d3eea4f47533..0054b9501a53 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -26,7 +26,7 @@
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/bootmem.h> 29#include <linux/memblock.h>
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/omapfb.h> 31#include <linux/omapfb.h>
32 32
@@ -171,49 +171,78 @@ static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg,
171 return 0; 171 return 0;
172} 172}
173 173
174static int valid_sdram(unsigned long addr, unsigned long size)
175{
176 struct memblock_property res;
177
178 res.base = addr;
179 res.size = size;
180 return !memblock_find(&res) && res.base == addr && res.size == size;
181}
182
183static int reserve_sdram(unsigned long addr, unsigned long size)
184{
185 if (memblock_is_region_reserved(addr, size))
186 return -EBUSY;
187 if (memblock_reserve(addr, size))
188 return -ENOMEM;
189 return 0;
190}
191
174/* 192/*
175 * Called from map_io. We need to call to this early enough so that we 193 * Called from map_io. We need to call to this early enough so that we
176 * can reserve the fixed SDRAM regions before VM could get hold of them. 194 * can reserve the fixed SDRAM regions before VM could get hold of them.
177 */ 195 */
178void __init omapfb_reserve_sdram(void) 196void __init omapfb_reserve_sdram_memblock(void)
179{ 197{
180 struct bootmem_data *bdata; 198 unsigned long reserved = 0;
181 unsigned long sdram_start, sdram_size; 199 int i;
182 unsigned long reserved;
183 int i;
184 200
185 if (config_invalid) 201 if (config_invalid)
186 return; 202 return;
187 203
188 bdata = NODE_DATA(0)->bdata;
189 sdram_start = bdata->node_min_pfn << PAGE_SHIFT;
190 sdram_size = (bdata->node_low_pfn << PAGE_SHIFT) - sdram_start;
191 reserved = 0;
192 for (i = 0; ; i++) { 204 for (i = 0; ; i++) {
193 struct omapfb_mem_region rg; 205 struct omapfb_mem_region rg;
194 206
195 if (get_fbmem_region(i, &rg) < 0) 207 if (get_fbmem_region(i, &rg) < 0)
196 break; 208 break;
209
197 if (i == OMAPFB_PLANE_NUM) { 210 if (i == OMAPFB_PLANE_NUM) {
198 printk(KERN_ERR 211 pr_err("Extraneous FB mem configuration entries\n");
199 "Extraneous FB mem configuration entries\n");
200 config_invalid = 1; 212 config_invalid = 1;
201 return; 213 return;
202 } 214 }
215
203 /* Check if it's our memory type. */ 216 /* Check if it's our memory type. */
204 if (set_fbmem_region_type(&rg, OMAPFB_MEMTYPE_SDRAM, 217 if (rg.type != OMAPFB_MEMTYPE_SDRAM)
205 sdram_start, sdram_size) < 0 ||
206 (rg.type != OMAPFB_MEMTYPE_SDRAM))
207 continue; 218 continue;
208 BUG_ON(omapfb_config.mem_desc.region[i].size); 219
209 if (check_fbmem_region(i, &rg, sdram_start, sdram_size) < 0) { 220 /* Check if the region falls within SDRAM */
221 if (rg.paddr && !valid_sdram(rg.paddr, rg.size))
222 continue;
223
224 if (rg.size == 0) {
225 pr_err("Zero size for FB region %d\n", i);
210 config_invalid = 1; 226 config_invalid = 1;
211 return; 227 return;
212 } 228 }
229
213 if (rg.paddr) { 230 if (rg.paddr) {
214 reserve_bootmem(rg.paddr, rg.size, BOOTMEM_DEFAULT); 231 if (reserve_sdram(rg.paddr, rg.size)) {
232 pr_err("Trying to use reserved memory for FB region %d\n",
233 i);
234 config_invalid = 1;
235 return;
236 }
215 reserved += rg.size; 237 reserved += rg.size;
216 } 238 }
239
240 if (omapfb_config.mem_desc.region[i].size) {
241 pr_err("FB region %d already set\n", i);
242 config_invalid = 1;
243 return;
244 }
245
217 omapfb_config.mem_desc.region[i] = rg; 246 omapfb_config.mem_desc.region[i] = rg;
218 configured_regions++; 247 configured_regions++;
219 } 248 }
@@ -359,7 +388,10 @@ static inline int omap_init_fb(void)
359 388
360arch_initcall(omap_init_fb); 389arch_initcall(omap_init_fb);
361 390
362void omapfb_reserve_sdram(void) {} 391void omapfb_reserve_sdram_memblock(void)
392{
393}
394
363unsigned long omapfb_reserve_sram(unsigned long sram_pstart, 395unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
364 unsigned long sram_vstart, 396 unsigned long sram_vstart,
365 unsigned long sram_size, 397 unsigned long sram_size,
@@ -375,7 +407,10 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
375{ 407{
376} 408}
377 409
378void omapfb_reserve_sdram(void) {} 410void omapfb_reserve_sdram_memblock(void)
411{
412}
413
379unsigned long omapfb_reserve_sram(unsigned long sram_pstart, 414unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
380 unsigned long sram_vstart, 415 unsigned long sram_vstart,
381 unsigned long sram_size, 416 unsigned long sram_size,
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index d265018f5e6b..5e4afbee0fd7 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -34,6 +34,8 @@ struct sys_timer;
34extern void omap_map_common_io(void); 34extern void omap_map_common_io(void);
35extern struct sys_timer omap_timer; 35extern struct sys_timer omap_timer;
36 36
37extern void omap_reserve(void);
38
37/* 39/*
38 * IO bases for various OMAP processors 40 * IO bases for various OMAP processors
39 * Except the tap base, rest all the io bases 41 * Except the tap base, rest all the io bases
diff --git a/arch/arm/plat-omap/include/plat/vram.h b/arch/arm/plat-omap/include/plat/vram.h
index edd4987758a6..0aa4ecd12c7d 100644
--- a/arch/arm/plat-omap/include/plat/vram.h
+++ b/arch/arm/plat-omap/include/plat/vram.h
@@ -38,7 +38,7 @@ extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
38extern void omap_vram_set_sdram_vram(u32 size, u32 start); 38extern void omap_vram_set_sdram_vram(u32 size, u32 start);
39extern void omap_vram_set_sram_vram(u32 size, u32 start); 39extern void omap_vram_set_sram_vram(u32 size, u32 start);
40 40
41extern void omap_vram_reserve_sdram(void); 41extern void omap_vram_reserve_sdram_memblock(void);
42extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart, 42extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
43 unsigned long sram_vstart, 43 unsigned long sram_vstart,
44 unsigned long sram_size, 44 unsigned long sram_size,
@@ -48,7 +48,7 @@ extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
48static inline void omap_vram_set_sdram_vram(u32 size, u32 start) { } 48static inline void omap_vram_set_sdram_vram(u32 size, u32 start) { }
49static inline void omap_vram_set_sram_vram(u32 size, u32 start) { } 49static inline void omap_vram_set_sram_vram(u32 size, u32 start) { }
50 50
51static inline void omap_vram_reserve_sdram(void) { } 51static inline void omap_vram_reserve_sdram_memblock(void) { }
52static inline unsigned long omap_vram_reserve_sram(unsigned long sram_pstart, 52static inline unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
53 unsigned long sram_vstart, 53 unsigned long sram_vstart,
54 unsigned long sram_size, 54 unsigned long sram_size,
diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S
index 1670734b7e51..37fa593884ee 100644
--- a/arch/arm/plat-spear/include/plat/debug-macro.S
+++ b/arch/arm/plat-spear/include/plat/debug-macro.S
@@ -17,8 +17,8 @@
17 .macro addruart, rx 17 .macro addruart, rx
18 mrc p15, 0, \rx, c1, c0 18 mrc p15, 0, \rx, c1, c0
19 tst \rx, #1 @ MMU enabled? 19 tst \rx, #1 @ MMU enabled?
20 moveq \rx, =SPEAR_DBG_UART_BASE @ Physical base 20 moveq \rx, #SPEAR_DBG_UART_BASE @ Physical base
21 movne \rx, =VA_SPEAR_DBG_UART_BASE @ Virtual base 21 movne \rx, #VA_SPEAR_DBG_UART_BASE @ Virtual base
22 .endm 22 .endm
23 23
24 .macro senduart, rd, rx 24 .macro senduart, rd, rx
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c
index a1025d38f383..ab211652e4ca 100644
--- a/arch/arm/plat-spear/time.c
+++ b/arch/arm/plat-spear/time.c
@@ -58,6 +58,11 @@
58 58
59#define INT_STATUS 0x1 59#define INT_STATUS 0x1
60 60
61/*
62 * Minimum clocksource/clockevent timer range in seconds
63 */
64#define SPEAR_MIN_RANGE 4
65
61static __iomem void *gpt_base; 66static __iomem void *gpt_base;
62static struct clk *gpt_clk; 67static struct clk *gpt_clk;
63 68
@@ -66,44 +71,6 @@ static void clockevent_set_mode(enum clock_event_mode mode,
66static int clockevent_next_event(unsigned long evt, 71static int clockevent_next_event(unsigned long evt,
67 struct clock_event_device *clk_event_dev); 72 struct clock_event_device *clk_event_dev);
68 73
69/*
70 * Following clocksource_set_clock and clockevent_set_clock picked
71 * from arch/mips/kernel/time.c
72 */
73
74void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock)
75{
76 u64 temp;
77 u32 shift;
78
79 /* Find a shift value */
80 for (shift = 32; shift > 0; shift--) {
81 temp = (u64) NSEC_PER_SEC << shift;
82 do_div(temp, clock);
83 if ((temp >> 32) == 0)
84 break;
85 }
86 cs->shift = shift;
87 cs->mult = (u32) temp;
88}
89
90void __init clockevent_set_clock(struct clock_event_device *cd,
91 unsigned int clock)
92{
93 u64 temp;
94 u32 shift;
95
96 /* Find a shift value */
97 for (shift = 32; shift > 0; shift--) {
98 temp = (u64) clock << shift;
99 do_div(temp, NSEC_PER_SEC);
100 if ((temp >> 32) == 0)
101 break;
102 }
103 cd->shift = shift;
104 cd->mult = (u32) temp;
105}
106
107static cycle_t clocksource_read_cycles(struct clocksource *cs) 74static cycle_t clocksource_read_cycles(struct clocksource *cs)
108{ 75{
109 return (cycle_t) readw(gpt_base + COUNT(CLKSRC)); 76 return (cycle_t) readw(gpt_base + COUNT(CLKSRC));
@@ -138,7 +105,7 @@ static void spear_clocksource_init(void)
138 val |= CTRL_ENABLE ; 105 val |= CTRL_ENABLE ;
139 writew(val, gpt_base + CR(CLKSRC)); 106 writew(val, gpt_base + CR(CLKSRC));
140 107
141 clocksource_set_clock(&clksrc, tick_rate); 108 clocksource_calc_mult_shift(&clksrc, tick_rate, SPEAR_MIN_RANGE);
142 109
143 /* register the clocksource */ 110 /* register the clocksource */
144 clocksource_register(&clksrc); 111 clocksource_register(&clksrc);
@@ -233,7 +200,7 @@ static void __init spear_clockevent_init(void)
233 tick_rate = clk_get_rate(gpt_clk); 200 tick_rate = clk_get_rate(gpt_clk);
234 tick_rate >>= CTRL_PRESCALER16; 201 tick_rate >>= CTRL_PRESCALER16;
235 202
236 clockevent_set_clock(&clkevt, tick_rate); 203 clockevents_calc_mult_shift(&clkevt, tick_rate, SPEAR_MIN_RANGE);
237 204
238 clkevt.max_delta_ns = clockevent_delta2ns(0xfff0, 205 clkevt.max_delta_ns = clockevent_delta2ns(0xfff0,
239 &clkevt); 206 &clkevt);
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile
index 9b1a66816aa6..5cf88e8427b1 100644
--- a/arch/arm/plat-versatile/Makefile
+++ b/arch/arm/plat-versatile/Makefile
@@ -2,3 +2,7 @@ obj-y := clock.o
2obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o 2obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
3obj-$(CONFIG_ARCH_REALVIEW) += sched-clock.o 3obj-$(CONFIG_ARCH_REALVIEW) += sched-clock.o
4obj-$(CONFIG_ARCH_VERSATILE) += sched-clock.o 4obj-$(CONFIG_ARCH_VERSATILE) += sched-clock.o
5ifeq ($(CONFIG_LEDS_CLASS),y)
6obj-$(CONFIG_ARCH_REALVIEW) += leds.o
7obj-$(CONFIG_ARCH_VERSATILE) += leds.o
8endif
diff --git a/arch/arm/plat-versatile/leds.c b/arch/arm/plat-versatile/leds.c
new file mode 100644
index 000000000000..3169fa555ea6
--- /dev/null
+++ b/arch/arm/plat-versatile/leds.c
@@ -0,0 +1,103 @@
1/*
2 * Driver for the 8 user LEDs found on the RealViews and Versatiles
3 * Based on DaVinci's DM365 board code
4 *
5 * License terms: GNU General Public License (GPL) version 2
6 * Author: Linus Walleij <triad@df.lth.se>
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/io.h>
11#include <linux/slab.h>
12#include <linux/leds.h>
13
14#include <mach/hardware.h>
15#include <mach/platform.h>
16
17#ifdef VERSATILE_SYS_BASE
18#define LEDREG (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LED_OFFSET)
19#endif
20
21#ifdef REALVIEW_SYS_BASE
22#define LEDREG (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET)
23#endif
24
25struct versatile_led {
26 struct led_classdev cdev;
27 u8 mask;
28};
29
30/*
31 * The triggers lines up below will only be used if the
32 * LED triggers are compiled in.
33 */
34static const struct {
35 const char *name;
36 const char *trigger;
37} versatile_leds[] = {
38 { "versatile:0", "heartbeat", },
39 { "versatile:1", "mmc0", },
40 { "versatile:2", },
41 { "versatile:3", },
42 { "versatile:4", },
43 { "versatile:5", },
44 { "versatile:6", },
45 { "versatile:7", },
46};
47
48static void versatile_led_set(struct led_classdev *cdev,
49 enum led_brightness b)
50{
51 struct versatile_led *led = container_of(cdev,
52 struct versatile_led, cdev);
53 u32 reg = readl(LEDREG);
54
55 if (b != LED_OFF)
56 reg |= led->mask;
57 else
58 reg &= ~led->mask;
59 writel(reg, LEDREG);
60}
61
62static enum led_brightness versatile_led_get(struct led_classdev *cdev)
63{
64 struct versatile_led *led = container_of(cdev,
65 struct versatile_led, cdev);
66 u32 reg = readl(LEDREG);
67
68 return (reg & led->mask) ? LED_FULL : LED_OFF;
69}
70
71static int __init versatile_leds_init(void)
72{
73 int i;
74
75 /* All ON */
76 writel(0xff, LEDREG);
77 for (i = 0; i < ARRAY_SIZE(versatile_leds); i++) {
78 struct versatile_led *led;
79
80 led = kzalloc(sizeof(*led), GFP_KERNEL);
81 if (!led)
82 break;
83
84 led->cdev.name = versatile_leds[i].name;
85 led->cdev.brightness_set = versatile_led_set;
86 led->cdev.brightness_get = versatile_led_get;
87 led->cdev.default_trigger = versatile_leds[i].trigger;
88 led->mask = BIT(i);
89
90 if (led_classdev_register(NULL, &led->cdev) < 0) {
91 kfree(led);
92 break;
93 }
94 }
95
96 return 0;
97}
98
99/*
100 * Since we may have triggers on any subsystem, defer registration
101 * until after subsystem_init.
102 */
103fs_initcall(versatile_leds_init);
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 315a540c7ce5..8063a322c790 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -15,6 +15,7 @@
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/init.h> 16#include <linux/init.h>
17 17
18#include <asm/cputype.h>
18#include <asm/thread_notify.h> 19#include <asm/thread_notify.h>
19#include <asm/vfp.h> 20#include <asm/vfp.h>
20 21
@@ -549,10 +550,13 @@ static int __init vfp_init(void)
549 /* 550 /*
550 * Check for the presence of the Advanced SIMD 551 * Check for the presence of the Advanced SIMD
551 * load/store instructions, integer and single 552 * load/store instructions, integer and single
552 * precision floating point operations. 553 * precision floating point operations. Only check
554 * for NEON if the hardware has the MVFR registers.
553 */ 555 */
554 if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100) 556 if ((read_cpuid_id() & 0x000f0000) == 0x000f0000) {
555 elf_hwcap |= HWCAP_NEON; 557 if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100)
558 elf_hwcap |= HWCAP_NEON;
559 }
556#endif 560#endif
557 } 561 }
558 return 0; 562 return 0;
diff --git a/arch/avr32/include/asm/ioctls.h b/arch/avr32/include/asm/ioctls.h
index 0cf2c0a4502b..e6ac0b661076 100644
--- a/arch/avr32/include/asm/ioctls.h
+++ b/arch/avr32/include/asm/ioctls.h
@@ -54,6 +54,9 @@
54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
56 56
57#define TIOCGRS485 0x542E
58#define TIOCSRS485 0x542F
59
57#define FIONCLEX 0x5450 60#define FIONCLEX 0x5450
58#define FIOCLEX 0x5451 61#define FIOCLEX 0x5451
59#define FIOASYNC 0x5452 62#define FIOASYNC 0x5452
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h
index c7f25bb1d068..61740201b311 100644
--- a/arch/avr32/mach-at32ap/include/mach/board.h
+++ b/arch/avr32/mach-at32ap/include/mach/board.h
@@ -5,6 +5,7 @@
5#define __ASM_ARCH_BOARD_H 5#define __ASM_ARCH_BOARD_H
6 6
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/serial.h>
8 9
9#define GPIO_PIN_NONE (-1) 10#define GPIO_PIN_NONE (-1)
10 11
@@ -35,6 +36,7 @@ struct atmel_uart_data {
35 short use_dma_tx; /* use transmit DMA? */ 36 short use_dma_tx; /* use transmit DMA? */
36 short use_dma_rx; /* use receive DMA? */ 37 short use_dma_rx; /* use receive DMA? */
37 void __iomem *regs; /* virtual base address, if any */ 38 void __iomem *regs; /* virtual base address, if any */
39 struct serial_rs485 rs485; /* rs485 settings */
38}; 40};
39void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); 41void at32_map_usart(unsigned int hw_id, unsigned int line, int flags);
40struct platform_device *at32_add_device_usart(unsigned int id); 42struct platform_device *at32_add_device_usart(unsigned int id);
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
index 2580e77624d2..f9e5622ebc95 100644
--- a/arch/mips/alchemy/common/platform.c
+++ b/arch/mips/alchemy/common/platform.c
@@ -435,20 +435,21 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = {
435static int __init au1xxx_platform_init(void) 435static int __init au1xxx_platform_init(void)
436{ 436{
437 unsigned int uartclk = get_au1x00_uart_baud_base() * 16; 437 unsigned int uartclk = get_au1x00_uart_baud_base() * 16;
438 int i; 438 int err, i;
439 439
440 /* Fill up uartclk. */ 440 /* Fill up uartclk. */
441 for (i = 0; au1x00_uart_data[i].flags; i++) 441 for (i = 0; au1x00_uart_data[i].flags; i++)
442 au1x00_uart_data[i].uartclk = uartclk; 442 au1x00_uart_data[i].uartclk = uartclk;
443 443
444 err = platform_add_devices(au1xxx_platform_devices,
445 ARRAY_SIZE(au1xxx_platform_devices));
444#ifndef CONFIG_SOC_AU1100 446#ifndef CONFIG_SOC_AU1100
445 /* Register second MAC if enabled in pinfunc */ 447 /* Register second MAC if enabled in pinfunc */
446 if (!(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2)) 448 if (!err && !(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2))
447 platform_device_register(&au1xxx_eth1_device); 449 platform_device_register(&au1xxx_eth1_device);
448#endif 450#endif
449 451
450 return platform_add_devices(au1xxx_platform_devices, 452 return err;
451 ARRAY_SIZE(au1xxx_platform_devices));
452} 453}
453 454
454arch_initcall(au1xxx_platform_init); 455arch_initcall(au1xxx_platform_init);
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c
index a9f0336e1f1f..52d883d37dd7 100644
--- a/arch/mips/alchemy/mtx-1/board_setup.c
+++ b/arch/mips/alchemy/mtx-1/board_setup.c
@@ -67,8 +67,6 @@ static void mtx1_power_off(void)
67 67
68void __init board_setup(void) 68void __init board_setup(void)
69{ 69{
70 alchemy_gpio2_enable();
71
72#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 70#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
73 /* Enable USB power switch */ 71 /* Enable USB power switch */
74 alchemy_gpio_direction_output(204, 0); 72 alchemy_gpio_direction_output(204, 0);
@@ -117,11 +115,11 @@ mtx1_pci_idsel(unsigned int devsel, int assert)
117 115
118 if (assert && devsel != 0) 116 if (assert && devsel != 0)
119 /* Suppress signal to Cardbus */ 117 /* Suppress signal to Cardbus */
120 gpio_set_value(1, 0); /* set EXT_IO3 OFF */ 118 alchemy_gpio_set_value(1, 0); /* set EXT_IO3 OFF */
121 else 119 else
122 gpio_set_value(1, 1); /* set EXT_IO3 ON */ 120 alchemy_gpio_set_value(1, 1); /* set EXT_IO3 ON */
123 121
124 au_sync_udelay(1); 122 udelay(1);
125 return 1; 123 return 1;
126} 124}
127 125
diff --git a/arch/mips/bcm63xx/dev-enet.c b/arch/mips/bcm63xx/dev-enet.c
index 9f544badd0b4..39c23366c5c7 100644
--- a/arch/mips/bcm63xx/dev-enet.c
+++ b/arch/mips/bcm63xx/dev-enet.c
@@ -104,6 +104,9 @@ int __init bcm63xx_enet_register(int unit,
104 if (unit > 1) 104 if (unit > 1)
105 return -ENODEV; 105 return -ENODEV;
106 106
107 if (unit == 1 && BCMCPU_IS_6338())
108 return -ENODEV;
109
107 if (!shared_device_registered) { 110 if (!shared_device_registered) {
108 shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA); 111 shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA);
109 shared_res[0].end = shared_res[0].start; 112 shared_res[0].end = shared_res[0].start;
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
index 59dc0c7ef733..c63c56bfd184 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
@@ -434,7 +434,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
434 __asm__ __volatile__( 434 __asm__ __volatile__(
435 " .set mips3 \n" 435 " .set mips3 \n"
436 "1: lld %0, %1 # atomic64_add \n" 436 "1: lld %0, %1 # atomic64_add \n"
437 " addu %0, %2 \n" 437 " daddu %0, %2 \n"
438 " scd %0, %1 \n" 438 " scd %0, %1 \n"
439 " beqzl %0, 1b \n" 439 " beqzl %0, 1b \n"
440 " .set mips0 \n" 440 " .set mips0 \n"
@@ -446,7 +446,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
446 __asm__ __volatile__( 446 __asm__ __volatile__(
447 " .set mips3 \n" 447 " .set mips3 \n"
448 "1: lld %0, %1 # atomic64_add \n" 448 "1: lld %0, %1 # atomic64_add \n"
449 " addu %0, %2 \n" 449 " daddu %0, %2 \n"
450 " scd %0, %1 \n" 450 " scd %0, %1 \n"
451 " beqz %0, 2f \n" 451 " beqz %0, 2f \n"
452 " .subsection 2 \n" 452 " .subsection 2 \n"
@@ -479,7 +479,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
479 __asm__ __volatile__( 479 __asm__ __volatile__(
480 " .set mips3 \n" 480 " .set mips3 \n"
481 "1: lld %0, %1 # atomic64_sub \n" 481 "1: lld %0, %1 # atomic64_sub \n"
482 " subu %0, %2 \n" 482 " dsubu %0, %2 \n"
483 " scd %0, %1 \n" 483 " scd %0, %1 \n"
484 " beqzl %0, 1b \n" 484 " beqzl %0, 1b \n"
485 " .set mips0 \n" 485 " .set mips0 \n"
@@ -491,7 +491,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
491 __asm__ __volatile__( 491 __asm__ __volatile__(
492 " .set mips3 \n" 492 " .set mips3 \n"
493 "1: lld %0, %1 # atomic64_sub \n" 493 "1: lld %0, %1 # atomic64_sub \n"
494 " subu %0, %2 \n" 494 " dsubu %0, %2 \n"
495 " scd %0, %1 \n" 495 " scd %0, %1 \n"
496 " beqz %0, 2f \n" 496 " beqz %0, 2f \n"
497 " .subsection 2 \n" 497 " .subsection 2 \n"
@@ -524,10 +524,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
524 __asm__ __volatile__( 524 __asm__ __volatile__(
525 " .set mips3 \n" 525 " .set mips3 \n"
526 "1: lld %1, %2 # atomic64_add_return \n" 526 "1: lld %1, %2 # atomic64_add_return \n"
527 " addu %0, %1, %3 \n" 527 " daddu %0, %1, %3 \n"
528 " scd %0, %2 \n" 528 " scd %0, %2 \n"
529 " beqzl %0, 1b \n" 529 " beqzl %0, 1b \n"
530 " addu %0, %1, %3 \n" 530 " daddu %0, %1, %3 \n"
531 " .set mips0 \n" 531 " .set mips0 \n"
532 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 532 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
533 : "Ir" (i), "m" (v->counter) 533 : "Ir" (i), "m" (v->counter)
@@ -538,10 +538,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
538 __asm__ __volatile__( 538 __asm__ __volatile__(
539 " .set mips3 \n" 539 " .set mips3 \n"
540 "1: lld %1, %2 # atomic64_add_return \n" 540 "1: lld %1, %2 # atomic64_add_return \n"
541 " addu %0, %1, %3 \n" 541 " daddu %0, %1, %3 \n"
542 " scd %0, %2 \n" 542 " scd %0, %2 \n"
543 " beqz %0, 2f \n" 543 " beqz %0, 2f \n"
544 " addu %0, %1, %3 \n" 544 " daddu %0, %1, %3 \n"
545 " .subsection 2 \n" 545 " .subsection 2 \n"
546 "2: b 1b \n" 546 "2: b 1b \n"
547 " .previous \n" 547 " .previous \n"
@@ -576,10 +576,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
576 __asm__ __volatile__( 576 __asm__ __volatile__(
577 " .set mips3 \n" 577 " .set mips3 \n"
578 "1: lld %1, %2 # atomic64_sub_return \n" 578 "1: lld %1, %2 # atomic64_sub_return \n"
579 " subu %0, %1, %3 \n" 579 " dsubu %0, %1, %3 \n"
580 " scd %0, %2 \n" 580 " scd %0, %2 \n"
581 " beqzl %0, 1b \n" 581 " beqzl %0, 1b \n"
582 " subu %0, %1, %3 \n" 582 " dsubu %0, %1, %3 \n"
583 " .set mips0 \n" 583 " .set mips0 \n"
584 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 584 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
585 : "Ir" (i), "m" (v->counter) 585 : "Ir" (i), "m" (v->counter)
@@ -590,10 +590,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
590 __asm__ __volatile__( 590 __asm__ __volatile__(
591 " .set mips3 \n" 591 " .set mips3 \n"
592 "1: lld %1, %2 # atomic64_sub_return \n" 592 "1: lld %1, %2 # atomic64_sub_return \n"
593 " subu %0, %1, %3 \n" 593 " dsubu %0, %1, %3 \n"
594 " scd %0, %2 \n" 594 " scd %0, %2 \n"
595 " beqz %0, 2f \n" 595 " beqz %0, 2f \n"
596 " subu %0, %1, %3 \n" 596 " dsubu %0, %1, %3 \n"
597 " .subsection 2 \n" 597 " .subsection 2 \n"
598 "2: b 1b \n" 598 "2: b 1b \n"
599 " .previous \n" 599 " .previous \n"
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index 1b5a6648eb86..baa318a59c97 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -984,16 +984,17 @@
984#define __NR_perf_event_open (__NR_Linux + 296) 984#define __NR_perf_event_open (__NR_Linux + 296)
985#define __NR_accept4 (__NR_Linux + 297) 985#define __NR_accept4 (__NR_Linux + 297)
986#define __NR_recvmmsg (__NR_Linux + 298) 986#define __NR_recvmmsg (__NR_Linux + 298)
987#define __NR_getdents64 (__NR_Linux + 299)
987 988
988/* 989/*
989 * Offset of the last N32 flavoured syscall 990 * Offset of the last N32 flavoured syscall
990 */ 991 */
991#define __NR_Linux_syscalls 298 992#define __NR_Linux_syscalls 299
992 993
993#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 994#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
994 995
995#define __NR_N32_Linux 6000 996#define __NR_N32_Linux 6000
996#define __NR_N32_Linux_syscalls 298 997#define __NR_N32_Linux_syscalls 299
997 998
998#ifdef __KERNEL__ 999#ifdef __KERNEL__
999 1000
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index a5297e2a353a..a4faceea9d88 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -419,4 +419,5 @@ EXPORT(sysn32_call_table)
419 PTR sys_perf_event_open 419 PTR sys_perf_event_open
420 PTR sys_accept4 420 PTR sys_accept4
421 PTR compat_sys_recvmmsg 421 PTR compat_sys_recvmmsg
422 PTR sys_getdents
422 .size sysn32_call_table,.-sysn32_call_table 423 .size sysn32_call_table,.-sysn32_call_table
diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c
index b773c1112b14..e5cdfd603f8f 100644
--- a/arch/mips/kernel/vdso.c
+++ b/arch/mips/kernel/vdso.c
@@ -61,11 +61,9 @@ static int __init init_vdso(void)
61 61
62 vunmap(vdso); 62 vunmap(vdso);
63 63
64 pr_notice("init_vdso successfull\n");
65
66 return 0; 64 return 0;
67} 65}
68device_initcall(init_vdso); 66subsys_initcall(init_vdso);
69 67
70static unsigned long vdso_addr(unsigned long start) 68static unsigned long vdso_addr(unsigned long start)
71{ 69{
diff --git a/arch/mips/mti-malta/malta-pci.c b/arch/mips/mti-malta/malta-pci.c
index 2fbfa1a8c3a9..bf80921f2f56 100644
--- a/arch/mips/mti-malta/malta-pci.c
+++ b/arch/mips/mti-malta/malta-pci.c
@@ -247,6 +247,8 @@ void __init mips_pcibios_init(void)
247 iomem_resource.end &= 0xfffffffffULL; /* 64 GB */ 247 iomem_resource.end &= 0xfffffffffULL; /* 64 GB */
248 ioport_resource.end = controller->io_resource->end; 248 ioport_resource.end = controller->io_resource->end;
249 249
250 controller->io_map_base = mips_io_port_base;
251
250 register_pci_controller(controller); 252 register_pci_controller(controller);
251} 253}
252 254
diff --git a/arch/mips/nxp/pnx8550/common/pci.c b/arch/mips/nxp/pnx8550/common/pci.c
index eee4f3dfc410..98e86ddb86cc 100644
--- a/arch/mips/nxp/pnx8550/common/pci.c
+++ b/arch/mips/nxp/pnx8550/common/pci.c
@@ -44,6 +44,7 @@ extern struct pci_ops pnx8550_pci_ops;
44 44
45static struct pci_controller pnx8550_controller = { 45static struct pci_controller pnx8550_controller = {
46 .pci_ops = &pnx8550_pci_ops, 46 .pci_ops = &pnx8550_pci_ops,
47 .io_map_base = PNX8550_PORT_BASE,
47 .io_resource = &pci_io_resource, 48 .io_resource = &pci_io_resource,
48 .mem_resource = &pci_mem_resource, 49 .mem_resource = &pci_mem_resource,
49}; 50};
diff --git a/arch/mips/nxp/pnx8550/common/setup.c b/arch/mips/nxp/pnx8550/common/setup.c
index 2aed50fef10f..64246c9c875c 100644
--- a/arch/mips/nxp/pnx8550/common/setup.c
+++ b/arch/mips/nxp/pnx8550/common/setup.c
@@ -113,7 +113,7 @@ void __init plat_mem_setup(void)
113 PNX8550_GLB2_ENAB_INTA_O = 0; 113 PNX8550_GLB2_ENAB_INTA_O = 0;
114 114
115 /* IO/MEM resources. */ 115 /* IO/MEM resources. */
116 set_io_port_base(KSEG1); 116 set_io_port_base(PNX8550_PORT_BASE);
117 ioport_resource.start = 0; 117 ioport_resource.start = 0;
118 ioport_resource.end = ~0; 118 ioport_resource.end = ~0;
119 iomem_resource.start = 0; 119 iomem_resource.start = 0;
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c
index 04b31478a6d7..b7c03d80c88c 100644
--- a/arch/mips/pci/ops-pmcmsp.c
+++ b/arch/mips/pci/ops-pmcmsp.c
@@ -944,6 +944,7 @@ static struct pci_controller msp_pci_controller = {
944 .pci_ops = &msp_pci_ops, 944 .pci_ops = &msp_pci_ops,
945 .mem_resource = &pci_mem_resource, 945 .mem_resource = &pci_mem_resource,
946 .mem_offset = 0, 946 .mem_offset = 0,
947 .io_map_base = MSP_PCI_IOSPACE_BASE,
947 .io_resource = &pci_io_resource, 948 .io_resource = &pci_io_resource,
948 .io_offset = 0 949 .io_offset = 0
949}; 950};
diff --git a/arch/mips/pci/pci-yosemite.c b/arch/mips/pci/pci-yosemite.c
index 0357946f30e6..cf5e1a25cb7d 100644
--- a/arch/mips/pci/pci-yosemite.c
+++ b/arch/mips/pci/pci-yosemite.c
@@ -54,6 +54,7 @@ static int __init pmc_yosemite_setup(void)
54 panic(ioremap_failed); 54 panic(ioremap_failed);
55 55
56 set_io_port_base(io_v_base); 56 set_io_port_base(io_v_base);
57 py_controller.io_map_base = io_v_base;
57 TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1); 58 TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1);
58 59
59 ioport_resource.end = TITAN_IO_SIZE - 1; 60 ioport_resource.end = TITAN_IO_SIZE - 1;
diff --git a/arch/mips/powertv/asic/asic_devices.c b/arch/mips/powertv/asic/asic_devices.c
index 8ee77887306a..9ec523e4dd06 100644
--- a/arch/mips/powertv/asic/asic_devices.c
+++ b/arch/mips/powertv/asic/asic_devices.c
@@ -472,6 +472,9 @@ void __init configure_platform(void)
472 * it*/ 472 * it*/
473 platform_features = FFS_CAPABLE | DISPLAY_CAPABLE; 473 platform_features = FFS_CAPABLE | DISPLAY_CAPABLE;
474 474
475 /* Cronus and Cronus Lite have the same register map */
476 set_register_map(CRONUS_IO_BASE, &cronus_register_map);
477
475 /* ASIC version will determine if this is a real CronusLite or 478 /* ASIC version will determine if this is a real CronusLite or
476 * Castrati(Cronus) */ 479 * Castrati(Cronus) */
477 chipversion = asic_read(chipver3) << 24; 480 chipversion = asic_read(chipver3) << 24;
@@ -484,8 +487,6 @@ void __init configure_platform(void)
484 else 487 else
485 asic = ASIC_CRONUSLITE; 488 asic = ASIC_CRONUSLITE;
486 489
487 /* Cronus and Cronus Lite have the same register map */
488 set_register_map(CRONUS_IO_BASE, &cronus_register_map);
489 gp_resources = non_dvr_cronuslite_resources; 490 gp_resources = non_dvr_cronuslite_resources;
490 pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, " 491 pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, "
491 "chipversion=0x%08X\n", 492 "chipversion=0x%08X\n",
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
index 2a9cd74a841e..076327f2eff7 100644
--- a/arch/powerpc/include/asm/kexec.h
+++ b/arch/powerpc/include/asm/kexec.h
@@ -8,9 +8,9 @@
8 * On FSL-BookE we setup a 1:1 mapping which covers the first 2GiB of memory 8 * On FSL-BookE we setup a 1:1 mapping which covers the first 2GiB of memory
9 * and therefore we can only deal with memory within this range 9 * and therefore we can only deal with memory within this range
10 */ 10 */
11#define KEXEC_SOURCE_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) 11#define KEXEC_SOURCE_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1)
12#define KEXEC_DESTINATION_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) 12#define KEXEC_DESTINATION_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1)
13#define KEXEC_CONTROL_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) 13#define KEXEC_CONTROL_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1)
14 14
15#else 15#else
16 16
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
index 2102b214a87c..0e398cfee2c8 100644
--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -250,7 +250,9 @@ extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
250int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, 250int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
251 pte_t *ptep, unsigned long trap, int local, int ssize, 251 pte_t *ptep, unsigned long trap, int local, int ssize,
252 unsigned int shift, unsigned int mmu_psize); 252 unsigned int shift, unsigned int mmu_psize);
253 253extern void hash_failure_debug(unsigned long ea, unsigned long access,
254 unsigned long vsid, unsigned long trap,
255 int ssize, int psize, unsigned long pte);
254extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, 256extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
255 unsigned long pstart, unsigned long prot, 257 unsigned long pstart, unsigned long prot,
256 int psize, int ssize); 258 int psize, int ssize);
diff --git a/arch/powerpc/kernel/perf_event_fsl_emb.c b/arch/powerpc/kernel/perf_event_fsl_emb.c
index 369872f6cf78..babcceecd2ea 100644
--- a/arch/powerpc/kernel/perf_event_fsl_emb.c
+++ b/arch/powerpc/kernel/perf_event_fsl_emb.c
@@ -566,9 +566,9 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
566 * Finally record data if requested. 566 * Finally record data if requested.
567 */ 567 */
568 if (record) { 568 if (record) {
569 struct perf_sample_data data = { 569 struct perf_sample_data data;
570 .period = event->hw.last_period, 570
571 }; 571 perf_sample_data_init(&data, 0);
572 572
573 if (perf_event_overflow(event, nmi, &data, regs)) { 573 if (perf_event_overflow(event, nmi, &data, regs)) {
574 /* 574 /*
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 9d3953983fb7..fed9bf6187d1 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -414,7 +414,7 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
414 u64 base, size, memblock_size; 414 u64 base, size, memblock_size;
415 unsigned int is_kexec_kdump = 0, rngs; 415 unsigned int is_kexec_kdump = 0, rngs;
416 416
417 ls = of_get_flat_dt_prop(node, "ibm,memblock-size", &l); 417 ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l);
418 if (ls == NULL || l < dt_root_size_cells * sizeof(__be32)) 418 if (ls == NULL || l < dt_root_size_cells * sizeof(__be32))
419 return 0; 419 return 0;
420 memblock_size = dt_mem_next_cell(dt_root_size_cells, &ls); 420 memblock_size = dt_mem_next_cell(dt_root_size_cells, &ls);
diff --git a/arch/powerpc/mm/hash_low_64.S b/arch/powerpc/mm/hash_low_64.S
index a719f53921a5..3079f6b44cf5 100644
--- a/arch/powerpc/mm/hash_low_64.S
+++ b/arch/powerpc/mm/hash_low_64.S
@@ -68,9 +68,6 @@ _GLOBAL(__hash_page_4K)
68 std r8,STK_PARM(r8)(r1) 68 std r8,STK_PARM(r8)(r1)
69 std r9,STK_PARM(r9)(r1) 69 std r9,STK_PARM(r9)(r1)
70 70
71 /* Add _PAGE_PRESENT to access */
72 ori r4,r4,_PAGE_PRESENT
73
74 /* Save non-volatile registers. 71 /* Save non-volatile registers.
75 * r31 will hold "old PTE" 72 * r31 will hold "old PTE"
76 * r30 is "new PTE" 73 * r30 is "new PTE"
@@ -347,9 +344,6 @@ _GLOBAL(__hash_page_4K)
347 std r8,STK_PARM(r8)(r1) 344 std r8,STK_PARM(r8)(r1)
348 std r9,STK_PARM(r9)(r1) 345 std r9,STK_PARM(r9)(r1)
349 346
350 /* Add _PAGE_PRESENT to access */
351 ori r4,r4,_PAGE_PRESENT
352
353 /* Save non-volatile registers. 347 /* Save non-volatile registers.
354 * r31 will hold "old PTE" 348 * r31 will hold "old PTE"
355 * r30 is "new PTE" 349 * r30 is "new PTE"
@@ -687,9 +681,6 @@ _GLOBAL(__hash_page_64K)
687 std r8,STK_PARM(r8)(r1) 681 std r8,STK_PARM(r8)(r1)
688 std r9,STK_PARM(r9)(r1) 682 std r9,STK_PARM(r9)(r1)
689 683
690 /* Add _PAGE_PRESENT to access */
691 ori r4,r4,_PAGE_PRESENT
692
693 /* Save non-volatile registers. 684 /* Save non-volatile registers.
694 * r31 will hold "old PTE" 685 * r31 will hold "old PTE"
695 * r30 is "new PTE" 686 * r30 is "new PTE"
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 98f262de5585..09dffe6efa46 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -871,6 +871,18 @@ static inline int subpage_protection(struct mm_struct *mm, unsigned long ea)
871} 871}
872#endif 872#endif
873 873
874void hash_failure_debug(unsigned long ea, unsigned long access,
875 unsigned long vsid, unsigned long trap,
876 int ssize, int psize, unsigned long pte)
877{
878 if (!printk_ratelimit())
879 return;
880 pr_info("mm: Hashing failure ! EA=0x%lx access=0x%lx current=%s\n",
881 ea, access, current->comm);
882 pr_info(" trap=0x%lx vsid=0x%lx ssize=%d psize=%d pte=0x%lx\n",
883 trap, vsid, ssize, psize, pte);
884}
885
874/* Result code is: 886/* Result code is:
875 * 0 - handled 887 * 0 - handled
876 * 1 - normal page fault 888 * 1 - normal page fault
@@ -955,6 +967,17 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
955 return 1; 967 return 1;
956 } 968 }
957 969
970 /* Add _PAGE_PRESENT to the required access perm */
971 access |= _PAGE_PRESENT;
972
973 /* Pre-check access permissions (will be re-checked atomically
974 * in __hash_page_XX but this pre-check is a fast path
975 */
976 if (access & ~pte_val(*ptep)) {
977 DBG_LOW(" no access !\n");
978 return 1;
979 }
980
958#ifdef CONFIG_HUGETLB_PAGE 981#ifdef CONFIG_HUGETLB_PAGE
959 if (hugeshift) 982 if (hugeshift)
960 return __hash_page_huge(ea, access, vsid, ptep, trap, local, 983 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)
967 DBG_LOW(" i-pte: %016lx %016lx\n", pte_val(*ptep), 990 DBG_LOW(" i-pte: %016lx %016lx\n", pte_val(*ptep),
968 pte_val(*(ptep + PTRS_PER_PTE))); 991 pte_val(*(ptep + PTRS_PER_PTE)));
969#endif 992#endif
970 /* Pre-check access permissions (will be re-checked atomically
971 * in __hash_page_XX but this pre-check is a fast path
972 */
973 if (access & ~pte_val(*ptep)) {
974 DBG_LOW(" no access !\n");
975 return 1;
976 }
977
978 /* Do actual hashing */ 993 /* Do actual hashing */
979#ifdef CONFIG_PPC_64K_PAGES 994#ifdef CONFIG_PPC_64K_PAGES
980 /* If _PAGE_4K_PFN is set, make sure this is a 4k segment */ 995 /* 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)
1033 local, ssize, spp); 1048 local, ssize, spp);
1034 } 1049 }
1035 1050
1051 /* Dump some info in case of hash insertion failure, they should
1052 * never happen so it is really useful to know if/when they do
1053 */
1054 if (rc == -1)
1055 hash_failure_debug(ea, access, vsid, trap, ssize, psize,
1056 pte_val(*ptep));
1036#ifndef CONFIG_PPC_64K_PAGES 1057#ifndef CONFIG_PPC_64K_PAGES
1037 DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep)); 1058 DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep));
1038#else 1059#else
@@ -1051,8 +1072,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
1051 void *pgdir; 1072 void *pgdir;
1052 pte_t *ptep; 1073 pte_t *ptep;
1053 unsigned long flags; 1074 unsigned long flags;
1054 int local = 0; 1075 int rc, ssize, local = 0;
1055 int ssize;
1056 1076
1057 BUG_ON(REGION_ID(ea) != USER_REGION_ID); 1077 BUG_ON(REGION_ID(ea) != USER_REGION_ID);
1058 1078
@@ -1098,11 +1118,18 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
1098 /* Hash it in */ 1118 /* Hash it in */
1099#ifdef CONFIG_PPC_HAS_HASH_64K 1119#ifdef CONFIG_PPC_HAS_HASH_64K
1100 if (mm->context.user_psize == MMU_PAGE_64K) 1120 if (mm->context.user_psize == MMU_PAGE_64K)
1101 __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize); 1121 rc = __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize);
1102 else 1122 else
1103#endif /* CONFIG_PPC_HAS_HASH_64K */ 1123#endif /* CONFIG_PPC_HAS_HASH_64K */
1104 __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize, 1124 rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize,
1105 subpage_protection(pgdir, ea)); 1125 subpage_protection(pgdir, ea));
1126
1127 /* Dump some info in case of hash insertion failure, they should
1128 * never happen so it is really useful to know if/when they do
1129 */
1130 if (rc == -1)
1131 hash_failure_debug(ea, access, vsid, trap, ssize,
1132 mm->context.user_psize, pte_val(*ptep));
1106 1133
1107 local_irq_restore(flags); 1134 local_irq_restore(flags);
1108} 1135}
diff --git a/arch/powerpc/mm/hugetlbpage-hash64.c b/arch/powerpc/mm/hugetlbpage-hash64.c
index 199539882f92..cc5c273086cf 100644
--- a/arch/powerpc/mm/hugetlbpage-hash64.c
+++ b/arch/powerpc/mm/hugetlbpage-hash64.c
@@ -21,21 +21,13 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
21 unsigned long old_pte, new_pte; 21 unsigned long old_pte, new_pte;
22 unsigned long va, rflags, pa, sz; 22 unsigned long va, rflags, pa, sz;
23 long slot; 23 long slot;
24 int err = 1;
25 24
26 BUG_ON(shift != mmu_psize_defs[mmu_psize].shift); 25 BUG_ON(shift != mmu_psize_defs[mmu_psize].shift);
27 26
28 /* Search the Linux page table for a match with va */ 27 /* Search the Linux page table for a match with va */
29 va = hpt_va(ea, vsid, ssize); 28 va = hpt_va(ea, vsid, ssize);
30 29
31 /* 30 /* At this point, we have a pte (old_pte) which can be used to build
32 * Check the user's access rights to the page. If access should be
33 * prevented then send the problem up to do_page_fault.
34 */
35 if (unlikely(access & ~pte_val(*ptep)))
36 goto out;
37 /*
38 * At this point, we have a pte (old_pte) which can be used to build
39 * or update an HPTE. There are 2 cases: 31 * or update an HPTE. There are 2 cases:
40 * 32 *
41 * 1. There is a valid (present) pte with no associated HPTE (this is 33 * 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,
49 41
50 do { 42 do {
51 old_pte = pte_val(*ptep); 43 old_pte = pte_val(*ptep);
52 if (old_pte & _PAGE_BUSY) 44 /* If PTE busy, retry the access */
53 goto out; 45 if (unlikely(old_pte & _PAGE_BUSY))
46 return 0;
47 /* If PTE permissions don't match, take page fault */
48 if (unlikely(access & ~old_pte))
49 return 1;
50 /* Try to lock the PTE, add ACCESSED and DIRTY if it was
51 * a write access */
54 new_pte = old_pte | _PAGE_BUSY | _PAGE_ACCESSED; 52 new_pte = old_pte | _PAGE_BUSY | _PAGE_ACCESSED;
53 if (access & _PAGE_RW)
54 new_pte |= _PAGE_DIRTY;
55 } while(old_pte != __cmpxchg_u64((unsigned long *)ptep, 55 } while(old_pte != __cmpxchg_u64((unsigned long *)ptep,
56 old_pte, new_pte)); 56 old_pte, new_pte));
57 57
@@ -121,8 +121,16 @@ repeat:
121 } 121 }
122 } 122 }
123 123
124 if (unlikely(slot == -2)) 124 /*
125 panic("hash_huge_page: pte_insert failed\n"); 125 * Hypervisor failure. Restore old pte and return -1
126 * similar to __hash_page_*
127 */
128 if (unlikely(slot == -2)) {
129 *ptep = __pte(old_pte);
130 hash_failure_debug(ea, access, vsid, trap, ssize,
131 mmu_psize, old_pte);
132 return -1;
133 }
126 134
127 new_pte |= (slot << 12) & (_PAGE_F_SECOND | _PAGE_F_GIX); 135 new_pte |= (slot << 12) & (_PAGE_F_SECOND | _PAGE_F_GIX);
128 } 136 }
@@ -131,9 +139,5 @@ repeat:
131 * No need to use ldarx/stdcx here 139 * No need to use ldarx/stdcx here
132 */ 140 */
133 *ptep = __pte(new_pte & ~_PAGE_BUSY); 141 *ptep = __pte(new_pte & ~_PAGE_BUSY);
134 142 return 0;
135 err = 0;
136
137 out:
138 return err;
139} 143}
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index f47364585ecd..aa731af720c0 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -398,15 +398,15 @@ static int of_get_drconf_memory(struct device_node *memory, const u32 **dm)
398} 398}
399 399
400/* 400/*
401 * Retreive and validate the ibm,memblock-size property for drconf memory 401 * Retreive and validate the ibm,lmb-size property for drconf memory
402 * from the device tree. 402 * from the device tree.
403 */ 403 */
404static u64 of_get_memblock_size(struct device_node *memory) 404static u64 of_get_lmb_size(struct device_node *memory)
405{ 405{
406 const u32 *prop; 406 const u32 *prop;
407 u32 len; 407 u32 len;
408 408
409 prop = of_get_property(memory, "ibm,memblock-size", &len); 409 prop = of_get_property(memory, "ibm,lmb-size", &len);
410 if (!prop || len < sizeof(unsigned int)) 410 if (!prop || len < sizeof(unsigned int))
411 return 0; 411 return 0;
412 412
@@ -562,7 +562,7 @@ static unsigned long __init numa_enforce_memory_limit(unsigned long start,
562static inline int __init read_usm_ranges(const u32 **usm) 562static inline int __init read_usm_ranges(const u32 **usm)
563{ 563{
564 /* 564 /*
565 * For each memblock in ibm,dynamic-memory a corresponding 565 * For each lmb in ibm,dynamic-memory a corresponding
566 * entry in linux,drconf-usable-memory property contains 566 * entry in linux,drconf-usable-memory property contains
567 * a counter followed by that many (base, size) duple. 567 * a counter followed by that many (base, size) duple.
568 * read the counter from linux,drconf-usable-memory 568 * read the counter from linux,drconf-usable-memory
@@ -578,7 +578,7 @@ static void __init parse_drconf_memory(struct device_node *memory)
578{ 578{
579 const u32 *dm, *usm; 579 const u32 *dm, *usm;
580 unsigned int n, rc, ranges, is_kexec_kdump = 0; 580 unsigned int n, rc, ranges, is_kexec_kdump = 0;
581 unsigned long memblock_size, base, size, sz; 581 unsigned long lmb_size, base, size, sz;
582 int nid; 582 int nid;
583 struct assoc_arrays aa; 583 struct assoc_arrays aa;
584 584
@@ -586,8 +586,8 @@ static void __init parse_drconf_memory(struct device_node *memory)
586 if (!n) 586 if (!n)
587 return; 587 return;
588 588
589 memblock_size = of_get_memblock_size(memory); 589 lmb_size = of_get_lmb_size(memory);
590 if (!memblock_size) 590 if (!lmb_size)
591 return; 591 return;
592 592
593 rc = of_get_assoc_arrays(memory, &aa); 593 rc = of_get_assoc_arrays(memory, &aa);
@@ -611,7 +611,7 @@ static void __init parse_drconf_memory(struct device_node *memory)
611 continue; 611 continue;
612 612
613 base = drmem.base_addr; 613 base = drmem.base_addr;
614 size = memblock_size; 614 size = lmb_size;
615 ranges = 1; 615 ranges = 1;
616 616
617 if (is_kexec_kdump) { 617 if (is_kexec_kdump) {
@@ -1072,7 +1072,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
1072{ 1072{
1073 const u32 *dm; 1073 const u32 *dm;
1074 unsigned int drconf_cell_cnt, rc; 1074 unsigned int drconf_cell_cnt, rc;
1075 unsigned long memblock_size; 1075 unsigned long lmb_size;
1076 struct assoc_arrays aa; 1076 struct assoc_arrays aa;
1077 int nid = -1; 1077 int nid = -1;
1078 1078
@@ -1080,8 +1080,8 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
1080 if (!drconf_cell_cnt) 1080 if (!drconf_cell_cnt)
1081 return -1; 1081 return -1;
1082 1082
1083 memblock_size = of_get_memblock_size(memory); 1083 lmb_size = of_get_lmb_size(memory);
1084 if (!memblock_size) 1084 if (!lmb_size)
1085 return -1; 1085 return -1;
1086 1086
1087 rc = of_get_assoc_arrays(memory, &aa); 1087 rc = of_get_assoc_arrays(memory, &aa);
@@ -1100,7 +1100,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
1100 continue; 1100 continue;
1101 1101
1102 if ((scn_addr < drmem.base_addr) 1102 if ((scn_addr < drmem.base_addr)
1103 || (scn_addr >= (drmem.base_addr + memblock_size))) 1103 || (scn_addr >= (drmem.base_addr + lmb_size)))
1104 continue; 1104 continue;
1105 1105
1106 nid = of_drconf_to_nid_single(&drmem, &aa); 1106 nid = of_drconf_to_nid_single(&drmem, &aa);
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index deab5f946090..bc8803664140 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -69,7 +69,7 @@ static int pseries_remove_memory(struct device_node *np)
69 const char *type; 69 const char *type;
70 const unsigned int *regs; 70 const unsigned int *regs;
71 unsigned long base; 71 unsigned long base;
72 unsigned int memblock_size; 72 unsigned int lmb_size;
73 int ret = -EINVAL; 73 int ret = -EINVAL;
74 74
75 /* 75 /*
@@ -87,9 +87,9 @@ static int pseries_remove_memory(struct device_node *np)
87 return ret; 87 return ret;
88 88
89 base = *(unsigned long *)regs; 89 base = *(unsigned long *)regs;
90 memblock_size = regs[3]; 90 lmb_size = regs[3];
91 91
92 ret = pseries_remove_memblock(base, memblock_size); 92 ret = pseries_remove_memblock(base, lmb_size);
93 return ret; 93 return ret;
94} 94}
95 95
@@ -98,7 +98,7 @@ static int pseries_add_memory(struct device_node *np)
98 const char *type; 98 const char *type;
99 const unsigned int *regs; 99 const unsigned int *regs;
100 unsigned long base; 100 unsigned long base;
101 unsigned int memblock_size; 101 unsigned int lmb_size;
102 int ret = -EINVAL; 102 int ret = -EINVAL;
103 103
104 /* 104 /*
@@ -116,36 +116,36 @@ static int pseries_add_memory(struct device_node *np)
116 return ret; 116 return ret;
117 117
118 base = *(unsigned long *)regs; 118 base = *(unsigned long *)regs;
119 memblock_size = regs[3]; 119 lmb_size = regs[3];
120 120
121 /* 121 /*
122 * Update memory region to represent the memory add 122 * Update memory region to represent the memory add
123 */ 123 */
124 ret = memblock_add(base, memblock_size); 124 ret = memblock_add(base, lmb_size);
125 return (ret < 0) ? -EINVAL : 0; 125 return (ret < 0) ? -EINVAL : 0;
126} 126}
127 127
128static int pseries_drconf_memory(unsigned long *base, unsigned int action) 128static int pseries_drconf_memory(unsigned long *base, unsigned int action)
129{ 129{
130 struct device_node *np; 130 struct device_node *np;
131 const unsigned long *memblock_size; 131 const unsigned long *lmb_size;
132 int rc; 132 int rc;
133 133
134 np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); 134 np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
135 if (!np) 135 if (!np)
136 return -EINVAL; 136 return -EINVAL;
137 137
138 memblock_size = of_get_property(np, "ibm,memblock-size", NULL); 138 lmb_size = of_get_property(np, "ibm,lmb-size", NULL);
139 if (!memblock_size) { 139 if (!lmb_size) {
140 of_node_put(np); 140 of_node_put(np);
141 return -EINVAL; 141 return -EINVAL;
142 } 142 }
143 143
144 if (action == PSERIES_DRCONF_MEM_ADD) { 144 if (action == PSERIES_DRCONF_MEM_ADD) {
145 rc = memblock_add(*base, *memblock_size); 145 rc = memblock_add(*base, *lmb_size);
146 rc = (rc < 0) ? -EINVAL : 0; 146 rc = (rc < 0) ? -EINVAL : 0;
147 } else if (action == PSERIES_DRCONF_MEM_REMOVE) { 147 } else if (action == PSERIES_DRCONF_MEM_REMOVE) {
148 rc = pseries_remove_memblock(*base, *memblock_size); 148 rc = pseries_remove_memblock(*base, *lmb_size);
149 } else { 149 } else {
150 rc = -EINVAL; 150 rc = -EINVAL;
151 } 151 }
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig
index 259e3fd50993..1dc07a0014c1 100644
--- a/arch/sparc/configs/sparc64_defconfig
+++ b/arch/sparc/configs/sparc64_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.34-rc3 3# Linux kernel version: 2.6.34
4# Sat Apr 3 15:49:56 2010 4# Wed May 26 21:14:01 2010
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_SPARC=y 7CONFIG_SPARC=y
@@ -107,10 +107,9 @@ CONFIG_PERF_COUNTERS=y
107# CONFIG_DEBUG_PERF_USE_VMALLOC is not set 107# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
108CONFIG_VM_EVENT_COUNTERS=y 108CONFIG_VM_EVENT_COUNTERS=y
109CONFIG_PCI_QUIRKS=y 109CONFIG_PCI_QUIRKS=y
110CONFIG_SLUB_DEBUG=y
111# CONFIG_COMPAT_BRK is not set 110# CONFIG_COMPAT_BRK is not set
112# CONFIG_SLAB is not set 111CONFIG_SLAB=y
113CONFIG_SLUB=y 112# CONFIG_SLUB is not set
114# CONFIG_SLOB is not set 113# CONFIG_SLOB is not set
115CONFIG_PROFILING=y 114CONFIG_PROFILING=y
116CONFIG_TRACEPOINTS=y 115CONFIG_TRACEPOINTS=y
@@ -239,6 +238,7 @@ CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
239CONFIG_SPARSEMEM_VMEMMAP=y 238CONFIG_SPARSEMEM_VMEMMAP=y
240CONFIG_PAGEFLAGS_EXTENDED=y 239CONFIG_PAGEFLAGS_EXTENDED=y
241CONFIG_SPLIT_PTLOCK_CPUS=4 240CONFIG_SPLIT_PTLOCK_CPUS=4
241# CONFIG_COMPACTION is not set
242CONFIG_MIGRATION=y 242CONFIG_MIGRATION=y
243CONFIG_PHYS_ADDR_T_64BIT=y 243CONFIG_PHYS_ADDR_T_64BIT=y
244CONFIG_ZONE_DMA_FLAG=0 244CONFIG_ZONE_DMA_FLAG=0
@@ -351,6 +351,7 @@ CONFIG_IPV6_TUNNEL=m
351# CONFIG_RDS is not set 351# CONFIG_RDS is not set
352# CONFIG_TIPC is not set 352# CONFIG_TIPC is not set
353# CONFIG_ATM is not set 353# CONFIG_ATM is not set
354# CONFIG_L2TP is not set
354# CONFIG_BRIDGE is not set 355# CONFIG_BRIDGE is not set
355# CONFIG_NET_DSA is not set 356# CONFIG_NET_DSA is not set
356CONFIG_VLAN_8021Q=m 357CONFIG_VLAN_8021Q=m
@@ -367,6 +368,7 @@ CONFIG_VLAN_8021Q=m
367# CONFIG_IEEE802154 is not set 368# CONFIG_IEEE802154 is not set
368# CONFIG_NET_SCHED is not set 369# CONFIG_NET_SCHED is not set
369# CONFIG_DCB is not set 370# CONFIG_DCB is not set
371CONFIG_RPS=y
370 372
371# 373#
372# Network testing 374# Network testing
@@ -386,9 +388,14 @@ CONFIG_WIRELESS=y
386# 388#
387# CFG80211 needs to be enabled for MAC80211 389# CFG80211 needs to be enabled for MAC80211
388# 390#
391
392#
393# Some wireless drivers require a rate control algorithm
394#
389# CONFIG_WIMAX is not set 395# CONFIG_WIMAX is not set
390# CONFIG_RFKILL is not set 396# CONFIG_RFKILL is not set
391# CONFIG_NET_9P is not set 397# CONFIG_NET_9P is not set
398# CONFIG_CAIF is not set
392 399
393# 400#
394# Device Drivers 401# Device Drivers
@@ -658,6 +665,7 @@ CONFIG_PHYLIB=m
658# CONFIG_NATIONAL_PHY is not set 665# CONFIG_NATIONAL_PHY is not set
659# CONFIG_STE10XP is not set 666# CONFIG_STE10XP is not set
660# CONFIG_LSI_ET1011C_PHY is not set 667# CONFIG_LSI_ET1011C_PHY is not set
668# CONFIG_MICREL_PHY is not set
661# CONFIG_MDIO_BITBANG is not set 669# CONFIG_MDIO_BITBANG is not set
662CONFIG_NET_ETHERNET=y 670CONFIG_NET_ETHERNET=y
663CONFIG_MII=m 671CONFIG_MII=m
@@ -734,6 +742,8 @@ CONFIG_NETDEV_10000=y
734# CONFIG_CHELSIO_T1 is not set 742# CONFIG_CHELSIO_T1 is not set
735CONFIG_CHELSIO_T3_DEPENDS=y 743CONFIG_CHELSIO_T3_DEPENDS=y
736# CONFIG_CHELSIO_T3 is not set 744# CONFIG_CHELSIO_T3 is not set
745CONFIG_CHELSIO_T4_DEPENDS=y
746# CONFIG_CHELSIO_T4 is not set
737# CONFIG_ENIC is not set 747# CONFIG_ENIC is not set
738# CONFIG_IXGBE is not set 748# CONFIG_IXGBE is not set
739# CONFIG_IXGBEVF is not set 749# CONFIG_IXGBEVF is not set
@@ -766,6 +776,7 @@ CONFIG_NIU=m
766# CONFIG_USB_PEGASUS is not set 776# CONFIG_USB_PEGASUS is not set
767# CONFIG_USB_RTL8150 is not set 777# CONFIG_USB_RTL8150 is not set
768# CONFIG_USB_USBNET is not set 778# CONFIG_USB_USBNET is not set
779# CONFIG_USB_IPHETH is not set
769# CONFIG_WAN is not set 780# CONFIG_WAN is not set
770# CONFIG_FDDI is not set 781# CONFIG_FDDI is not set
771# CONFIG_HIPPI is not set 782# CONFIG_HIPPI is not set
@@ -778,7 +789,6 @@ CONFIG_PPP_DEFLATE=m
778CONFIG_PPP_BSDCOMP=m 789CONFIG_PPP_BSDCOMP=m
779CONFIG_PPP_MPPE=m 790CONFIG_PPP_MPPE=m
780CONFIG_PPPOE=m 791CONFIG_PPPOE=m
781# CONFIG_PPPOL2TP is not set
782# CONFIG_SLIP is not set 792# CONFIG_SLIP is not set
783CONFIG_SLHC=m 793CONFIG_SLHC=m
784# CONFIG_NET_FC is not set 794# CONFIG_NET_FC is not set
@@ -816,6 +826,7 @@ CONFIG_INPUT_KEYBOARD=y
816CONFIG_KEYBOARD_ATKBD=y 826CONFIG_KEYBOARD_ATKBD=y
817# CONFIG_QT2160 is not set 827# CONFIG_QT2160 is not set
818CONFIG_KEYBOARD_LKKBD=m 828CONFIG_KEYBOARD_LKKBD=m
829# CONFIG_KEYBOARD_TCA6416 is not set
819# CONFIG_KEYBOARD_MAX7359 is not set 830# CONFIG_KEYBOARD_MAX7359 is not set
820# CONFIG_KEYBOARD_NEWTON is not set 831# CONFIG_KEYBOARD_NEWTON is not set
821# CONFIG_KEYBOARD_OPENCORES is not set 832# CONFIG_KEYBOARD_OPENCORES is not set
@@ -840,6 +851,7 @@ CONFIG_MOUSE_SERIAL=y
840# CONFIG_INPUT_TABLET is not set 851# CONFIG_INPUT_TABLET is not set
841# CONFIG_INPUT_TOUCHSCREEN is not set 852# CONFIG_INPUT_TOUCHSCREEN is not set
842CONFIG_INPUT_MISC=y 853CONFIG_INPUT_MISC=y
854# CONFIG_INPUT_AD714X is not set
843CONFIG_INPUT_SPARCSPKR=y 855CONFIG_INPUT_SPARCSPKR=y
844# CONFIG_INPUT_ATI_REMOTE is not set 856# CONFIG_INPUT_ATI_REMOTE is not set
845# CONFIG_INPUT_ATI_REMOTE2 is not set 857# CONFIG_INPUT_ATI_REMOTE2 is not set
@@ -848,6 +860,7 @@ CONFIG_INPUT_SPARCSPKR=y
848# CONFIG_INPUT_YEALINK is not set 860# CONFIG_INPUT_YEALINK is not set
849# CONFIG_INPUT_CM109 is not set 861# CONFIG_INPUT_CM109 is not set
850# CONFIG_INPUT_UINPUT is not set 862# CONFIG_INPUT_UINPUT is not set
863# CONFIG_INPUT_PCF8574 is not set
851 864
852# 865#
853# Hardware I/O ports 866# Hardware I/O ports
@@ -871,6 +884,7 @@ CONFIG_HW_CONSOLE=y
871# CONFIG_VT_HW_CONSOLE_BINDING is not set 884# CONFIG_VT_HW_CONSOLE_BINDING is not set
872# CONFIG_DEVKMEM is not set 885# CONFIG_DEVKMEM is not set
873# CONFIG_SERIAL_NONSTANDARD is not set 886# CONFIG_SERIAL_NONSTANDARD is not set
887# CONFIG_N_GSM is not set
874# CONFIG_NOZOMI is not set 888# CONFIG_NOZOMI is not set
875 889
876# 890#
@@ -893,6 +907,8 @@ CONFIG_SERIAL_CORE_CONSOLE=y
893# CONFIG_SERIAL_JSM is not set 907# CONFIG_SERIAL_JSM is not set
894# CONFIG_SERIAL_TIMBERDALE is not set 908# CONFIG_SERIAL_TIMBERDALE is not set
895# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set 909# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set
910# CONFIG_SERIAL_ALTERA_JTAGUART is not set
911# CONFIG_SERIAL_ALTERA_UART is not set
896CONFIG_UNIX98_PTYS=y 912CONFIG_UNIX98_PTYS=y
897# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set 913# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
898# CONFIG_LEGACY_PTYS is not set 914# CONFIG_LEGACY_PTYS is not set
@@ -1306,11 +1322,14 @@ CONFIG_USB_HIDDEV=y
1306CONFIG_HID_A4TECH=y 1322CONFIG_HID_A4TECH=y
1307CONFIG_HID_APPLE=y 1323CONFIG_HID_APPLE=y
1308CONFIG_HID_BELKIN=y 1324CONFIG_HID_BELKIN=y
1325# CONFIG_HID_CANDO is not set
1309CONFIG_HID_CHERRY=y 1326CONFIG_HID_CHERRY=y
1310CONFIG_HID_CHICONY=y 1327CONFIG_HID_CHICONY=y
1328# CONFIG_HID_PRODIKEYS is not set
1311CONFIG_HID_CYPRESS=y 1329CONFIG_HID_CYPRESS=y
1312CONFIG_HID_DRAGONRISE=y 1330CONFIG_HID_DRAGONRISE=y
1313# CONFIG_DRAGONRISE_FF is not set 1331# CONFIG_DRAGONRISE_FF is not set
1332# CONFIG_HID_EGALAX is not set
1314CONFIG_HID_EZKEY=y 1333CONFIG_HID_EZKEY=y
1315CONFIG_HID_KYE=y 1334CONFIG_HID_KYE=y
1316CONFIG_HID_GYRATION=y 1335CONFIG_HID_GYRATION=y
@@ -1328,7 +1347,9 @@ CONFIG_HID_ORTEK=y
1328CONFIG_HID_PANTHERLORD=y 1347CONFIG_HID_PANTHERLORD=y
1329# CONFIG_PANTHERLORD_FF is not set 1348# CONFIG_PANTHERLORD_FF is not set
1330CONFIG_HID_PETALYNX=y 1349CONFIG_HID_PETALYNX=y
1350# CONFIG_HID_PICOLCD is not set
1331# CONFIG_HID_QUANTA is not set 1351# CONFIG_HID_QUANTA is not set
1352# CONFIG_HID_ROCCAT_KONE is not set
1332CONFIG_HID_SAMSUNG=y 1353CONFIG_HID_SAMSUNG=y
1333CONFIG_HID_SONY=y 1354CONFIG_HID_SONY=y
1334# CONFIG_HID_STANTUM is not set 1355# CONFIG_HID_STANTUM is not set
@@ -1342,6 +1363,7 @@ CONFIG_HID_THRUSTMASTER=y
1342# CONFIG_THRUSTMASTER_FF is not set 1363# CONFIG_THRUSTMASTER_FF is not set
1343CONFIG_HID_ZEROPLUS=y 1364CONFIG_HID_ZEROPLUS=y
1344# CONFIG_ZEROPLUS_FF is not set 1365# CONFIG_ZEROPLUS_FF is not set
1366# CONFIG_HID_ZYDACRON is not set
1345CONFIG_USB_SUPPORT=y 1367CONFIG_USB_SUPPORT=y
1346CONFIG_USB_ARCH_HAS_HCD=y 1368CONFIG_USB_ARCH_HAS_HCD=y
1347CONFIG_USB_ARCH_HAS_OHCI=y 1369CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1356,7 +1378,6 @@ CONFIG_USB=y
1356# CONFIG_USB_DEVICEFS is not set 1378# CONFIG_USB_DEVICEFS is not set
1357# CONFIG_USB_DEVICE_CLASS is not set 1379# CONFIG_USB_DEVICE_CLASS is not set
1358# CONFIG_USB_DYNAMIC_MINORS is not set 1380# CONFIG_USB_DYNAMIC_MINORS is not set
1359# CONFIG_USB_OTG is not set
1360# CONFIG_USB_MON is not set 1381# CONFIG_USB_MON is not set
1361# CONFIG_USB_WUSB is not set 1382# CONFIG_USB_WUSB is not set
1362# CONFIG_USB_WUSB_CBAF is not set 1383# CONFIG_USB_WUSB_CBAF is not set
@@ -1521,10 +1542,6 @@ CONFIG_RTC_DRV_STARFIRE=y
1521# CONFIG_DMADEVICES is not set 1542# CONFIG_DMADEVICES is not set
1522# CONFIG_AUXDISPLAY is not set 1543# CONFIG_AUXDISPLAY is not set
1523# CONFIG_UIO is not set 1544# CONFIG_UIO is not set
1524
1525#
1526# TI VLYNQ
1527#
1528# CONFIG_STAGING is not set 1545# CONFIG_STAGING is not set
1529 1546
1530# 1547#
@@ -1706,8 +1723,8 @@ CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1706CONFIG_SCHEDSTATS=y 1723CONFIG_SCHEDSTATS=y
1707# CONFIG_TIMER_STATS is not set 1724# CONFIG_TIMER_STATS is not set
1708# CONFIG_DEBUG_OBJECTS is not set 1725# CONFIG_DEBUG_OBJECTS is not set
1709# CONFIG_SLUB_DEBUG_ON is not set 1726# CONFIG_DEBUG_SLAB is not set
1710# CONFIG_SLUB_STATS is not set 1727# CONFIG_DEBUG_KMEMLEAK is not set
1711# CONFIG_DEBUG_RT_MUTEXES is not set 1728# CONFIG_DEBUG_RT_MUTEXES is not set
1712# CONFIG_RT_MUTEX_TESTER is not set 1729# CONFIG_RT_MUTEX_TESTER is not set
1713# CONFIG_DEBUG_SPINLOCK is not set 1730# CONFIG_DEBUG_SPINLOCK is not set
@@ -1742,6 +1759,9 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
1742# CONFIG_DEBUG_PAGEALLOC is not set 1759# CONFIG_DEBUG_PAGEALLOC is not set
1743CONFIG_NOP_TRACER=y 1760CONFIG_NOP_TRACER=y
1744CONFIG_HAVE_FUNCTION_TRACER=y 1761CONFIG_HAVE_FUNCTION_TRACER=y
1762CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1763CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
1764CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
1745CONFIG_HAVE_DYNAMIC_FTRACE=y 1765CONFIG_HAVE_DYNAMIC_FTRACE=y
1746CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1766CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1747CONFIG_HAVE_SYSCALL_TRACEPOINTS=y 1767CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
@@ -1769,12 +1789,12 @@ CONFIG_BLK_DEV_IO_TRACE=y
1769# CONFIG_RING_BUFFER_BENCHMARK is not set 1789# CONFIG_RING_BUFFER_BENCHMARK is not set
1770# CONFIG_DYNAMIC_DEBUG is not set 1790# CONFIG_DYNAMIC_DEBUG is not set
1771# CONFIG_DMA_API_DEBUG is not set 1791# CONFIG_DMA_API_DEBUG is not set
1792# CONFIG_ATOMIC64_SELFTEST is not set
1772# CONFIG_SAMPLES is not set 1793# CONFIG_SAMPLES is not set
1773CONFIG_HAVE_ARCH_KGDB=y 1794CONFIG_HAVE_ARCH_KGDB=y
1774# CONFIG_KGDB is not set 1795# CONFIG_KGDB is not set
1775# CONFIG_DEBUG_STACK_USAGE is not set 1796# CONFIG_DEBUG_STACK_USAGE is not set
1776# CONFIG_DEBUG_DCFLUSH is not set 1797# CONFIG_DEBUG_DCFLUSH is not set
1777# CONFIG_STACK_DEBUG is not set
1778# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set 1798# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
1779 1799
1780# 1800#
@@ -1895,6 +1915,7 @@ CONFIG_CRYPTO_DEFLATE=y
1895# 1915#
1896# CONFIG_CRYPTO_ANSI_CPRNG is not set 1916# CONFIG_CRYPTO_ANSI_CPRNG is not set
1897CONFIG_CRYPTO_HW=y 1917CONFIG_CRYPTO_HW=y
1918# CONFIG_CRYPTO_DEV_NIAGARA2 is not set
1898# CONFIG_CRYPTO_DEV_HIFN_795X is not set 1919# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1899CONFIG_BINARY_PRINTF=y 1920CONFIG_BINARY_PRINTF=y
1900 1921
diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h
index 0588b8c7faa2..69358b590c91 100644
--- a/arch/sparc/include/asm/cache.h
+++ b/arch/sparc/include/asm/cache.h
@@ -11,7 +11,6 @@
11 11
12#define L1_CACHE_SHIFT 5 12#define L1_CACHE_SHIFT 5
13#define L1_CACHE_BYTES 32 13#define L1_CACHE_BYTES 32
14#define L1_CACHE_ALIGN(x) ((((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)))
15 14
16#ifdef CONFIG_SPARC32 15#ifdef CONFIG_SPARC32
17#define SMP_CACHE_BYTES_SHIFT 5 16#define SMP_CACHE_BYTES_SHIFT 5
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
index 77f906d8cc21..0ece77f47753 100644
--- a/arch/sparc/include/asm/pgtable_32.h
+++ b/arch/sparc/include/asm/pgtable_32.h
@@ -142,13 +142,12 @@ BTFIXUPDEF_CALL_CONST(unsigned long, pgd_page_vaddr, pgd_t)
142#define pmd_page(pmd) BTFIXUP_CALL(pmd_page)(pmd) 142#define pmd_page(pmd) BTFIXUP_CALL(pmd_page)(pmd)
143#define pgd_page_vaddr(pgd) BTFIXUP_CALL(pgd_page_vaddr)(pgd) 143#define pgd_page_vaddr(pgd) BTFIXUP_CALL(pgd_page_vaddr)(pgd)
144 144
145BTFIXUPDEF_SETHI(none_mask)
146BTFIXUPDEF_CALL_CONST(int, pte_present, pte_t) 145BTFIXUPDEF_CALL_CONST(int, pte_present, pte_t)
147BTFIXUPDEF_CALL(void, pte_clear, pte_t *) 146BTFIXUPDEF_CALL(void, pte_clear, pte_t *)
148 147
149static inline int pte_none(pte_t pte) 148static inline int pte_none(pte_t pte)
150{ 149{
151 return !(pte_val(pte) & ~BTFIXUP_SETHI(none_mask)); 150 return !pte_val(pte);
152} 151}
153 152
154#define pte_present(pte) BTFIXUP_CALL(pte_present)(pte) 153#define pte_present(pte) BTFIXUP_CALL(pte_present)(pte)
@@ -160,7 +159,7 @@ BTFIXUPDEF_CALL(void, pmd_clear, pmd_t *)
160 159
161static inline int pmd_none(pmd_t pmd) 160static inline int pmd_none(pmd_t pmd)
162{ 161{
163 return !(pmd_val(pmd) & ~BTFIXUP_SETHI(none_mask)); 162 return !pmd_val(pmd);
164} 163}
165 164
166#define pmd_bad(pmd) BTFIXUP_CALL(pmd_bad)(pmd) 165#define pmd_bad(pmd) BTFIXUP_CALL(pmd_bad)(pmd)
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index 0ec92c8861dd..44faabc3c02c 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -657,6 +657,7 @@ static u64 maybe_change_configuration(struct cpu_hw_events *cpuc, u64 pcr)
657 cpuc->current_idx[i] = idx; 657 cpuc->current_idx[i] = idx;
658 658
659 enc = perf_event_get_enc(cpuc->events[i]); 659 enc = perf_event_get_enc(cpuc->events[i]);
660 pcr &= ~mask_for_index(idx);
660 pcr |= event_encoding(enc, idx); 661 pcr |= event_encoding(enc, idx);
661 } 662 }
662out: 663out:
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c
index ab036a72de5a..e11b4612dabb 100644
--- a/arch/sparc/kernel/sun4d_irq.c
+++ b/arch/sparc/kernel/sun4d_irq.c
@@ -183,7 +183,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id)
183 goto out_unlock; 183 goto out_unlock;
184 } 184 }
185 185
186 if (action && tmp) 186 if (tmp)
187 tmp->next = action->next; 187 tmp->next = action->next;
188 else 188 else
189 *actionp = action->next; 189 *actionp = action->next;
diff --git a/arch/sparc/kernel/ttable.S b/arch/sparc/kernel/ttable.S
index 76d837fc47d3..c6dfdaa29e20 100644
--- a/arch/sparc/kernel/ttable.S
+++ b/arch/sparc/kernel/ttable.S
@@ -64,7 +64,7 @@ tl0_irq6: TRAP_IRQ(smp_call_function_single_client, 6)
64tl0_irq6: BTRAP(0x46) 64tl0_irq6: BTRAP(0x46)
65#endif 65#endif
66tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7) 66tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7)
67#ifdef CONFIG_KGDB 67#if defined(CONFIG_KGDB) && defined(CONFIG_SMP)
68tl0_irq8: TRAP_IRQ(smp_kgdb_capture_client, 8) 68tl0_irq8: TRAP_IRQ(smp_kgdb_capture_client, 8)
69#else 69#else
70tl0_irq8: BTRAP(0x48) 70tl0_irq8: BTRAP(0x48)
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index f5f75a58e0b3..b0b43aa5e45a 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -2215,8 +2215,6 @@ void __init ld_mmu_srmmu(void)
2215 BTFIXUPSET_CALL(pmd_page, srmmu_pmd_page, BTFIXUPCALL_NORM); 2215 BTFIXUPSET_CALL(pmd_page, srmmu_pmd_page, BTFIXUPCALL_NORM);
2216 BTFIXUPSET_CALL(pgd_page_vaddr, srmmu_pgd_page, BTFIXUPCALL_NORM); 2216 BTFIXUPSET_CALL(pgd_page_vaddr, srmmu_pgd_page, BTFIXUPCALL_NORM);
2217 2217
2218 BTFIXUPSET_SETHI(none_mask, 0xF0000000);
2219
2220 BTFIXUPSET_CALL(pte_present, srmmu_pte_present, BTFIXUPCALL_NORM); 2218 BTFIXUPSET_CALL(pte_present, srmmu_pte_present, BTFIXUPCALL_NORM);
2221 BTFIXUPSET_CALL(pte_clear, srmmu_pte_clear, BTFIXUPCALL_SWAPO0G0); 2219 BTFIXUPSET_CALL(pte_clear, srmmu_pte_clear, BTFIXUPCALL_SWAPO0G0);
2222 2220
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index cf38846753dd..4289f90f8697 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -2087,9 +2087,6 @@ void __init ld_mmu_sun4c(void)
2087 2087
2088 BTFIXUPSET_CALL(set_pte, sun4c_set_pte, BTFIXUPCALL_STO1O0); 2088 BTFIXUPSET_CALL(set_pte, sun4c_set_pte, BTFIXUPCALL_STO1O0);
2089 2089
2090 /* The 2.4.18 code does not set this on sun4c, how does it work? XXX */
2091 /* BTFIXUPSET_SETHI(none_mask, 0x00000000); */ /* Defaults to zero? */
2092
2093 BTFIXUPSET_CALL(pte_pfn, sun4c_pte_pfn, BTFIXUPCALL_NORM); 2090 BTFIXUPSET_CALL(pte_pfn, sun4c_pte_pfn, BTFIXUPCALL_NORM);
2094#if 0 /* PAGE_SHIFT <= 12 */ /* Eek. Investigate. XXX */ 2091#if 0 /* PAGE_SHIFT <= 12 */ /* Eek. Investigate. XXX */
2095 BTFIXUPSET_CALL(pmd_page, sun4c_pmd_page, BTFIXUPCALL_ANDNINT(PAGE_SIZE - 1)); 2092 BTFIXUPSET_CALL(pmd_page, sun4c_pmd_page, BTFIXUPCALL_ANDNINT(PAGE_SIZE - 1));
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index 2e837f5080fe..fb7a5f052e2b 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
145 percpu_entry->states[cx->index].eax = cx->address; 145 percpu_entry->states[cx->index].eax = cx->address;
146 percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK; 146 percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK;
147 } 147 }
148
149 /*
150 * For _CST FFH on Intel, if GAS.access_size bit 1 is cleared,
151 * then we should skip checking BM_STS for this C-state.
152 * ref: "Intel Processor Vendor-Specific ACPI Interface Specification"
153 */
154 if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2))
155 cx->bm_sts_skip = 1;
156
148 return retval; 157 return retval;
149} 158}
150EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); 159EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe);
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 82e508677b91..fcc3c61fdecc 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -157,9 +157,14 @@ static int __init acpi_sleep_setup(char *str)
157#ifdef CONFIG_HIBERNATION 157#ifdef CONFIG_HIBERNATION
158 if (strncmp(str, "s4_nohwsig", 10) == 0) 158 if (strncmp(str, "s4_nohwsig", 10) == 0)
159 acpi_no_s4_hw_signature(); 159 acpi_no_s4_hw_signature();
160 if (strncmp(str, "s4_nonvs", 8) == 0) 160 if (strncmp(str, "s4_nonvs", 8) == 0) {
161 acpi_s4_no_nvs(); 161 pr_warning("ACPI: acpi_sleep=s4_nonvs is deprecated, "
162 "please use acpi_sleep=nonvs instead");
163 acpi_nvs_nosave();
164 }
162#endif 165#endif
166 if (strncmp(str, "nonvs", 5) == 0)
167 acpi_nvs_nosave();
163 if (strncmp(str, "old_ordering", 12) == 0) 168 if (strncmp(str, "old_ordering", 12) == 0)
164 acpi_old_suspend_ordering(); 169 acpi_old_suspend_ordering();
165 str = strchr(str, ','); 170 str = strchr(str, ',');
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index c02cc692985c..a96489ee6cab 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -921,7 +921,7 @@ void disable_local_APIC(void)
921 unsigned int value; 921 unsigned int value;
922 922
923 /* APIC hasn't been mapped yet */ 923 /* APIC hasn't been mapped yet */
924 if (!apic_phys) 924 if (!x2apic_mode && !apic_phys)
925 return; 925 return;
926 926
927 clear_local_APIC(); 927 clear_local_APIC();
diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
index ce7cde713e71..a36de5bbb622 100644
--- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
@@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle)
368 return -ENODEV; 368 return -ENODEV;
369 369
370 out_obj = output.pointer; 370 out_obj = output.pointer;
371 if (out_obj->type != ACPI_TYPE_BUFFER) { 371 if (out_obj->type != ACPI_TYPE_BUFFER)
372 ret = -ENODEV; 372 return -ENODEV;
373 goto out_free;
374 }
375 373
376 errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); 374 errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
377 if (errors) { 375 if (errors)
378 ret = -ENODEV; 376 return -ENODEV;
379 goto out_free;
380 }
381 377
382 supported = *((u32 *)(out_obj->buffer.pointer + 4)); 378 supported = *((u32 *)(out_obj->buffer.pointer + 4));
383 if (!(supported & 0x1)) { 379 if (!(supported & 0x1))
384 ret = -ENODEV; 380 return -ENODEV;
385 goto out_free;
386 }
387 381
388out_free: 382out_free:
389 kfree(output.pointer); 383 kfree(output.pointer);
@@ -397,13 +391,17 @@ static int __init pcc_cpufreq_probe(void)
397 struct pcc_memory_resource *mem_resource; 391 struct pcc_memory_resource *mem_resource;
398 struct pcc_register_resource *reg_resource; 392 struct pcc_register_resource *reg_resource;
399 union acpi_object *out_obj, *member; 393 union acpi_object *out_obj, *member;
400 acpi_handle handle, osc_handle; 394 acpi_handle handle, osc_handle, pcch_handle;
401 int ret = 0; 395 int ret = 0;
402 396
403 status = acpi_get_handle(NULL, "\\_SB", &handle); 397 status = acpi_get_handle(NULL, "\\_SB", &handle);
404 if (ACPI_FAILURE(status)) 398 if (ACPI_FAILURE(status))
405 return -ENODEV; 399 return -ENODEV;
406 400
401 status = acpi_get_handle(handle, "PCCH", &pcch_handle);
402 if (ACPI_FAILURE(status))
403 return -ENODEV;
404
407 status = acpi_get_handle(handle, "_OSC", &osc_handle); 405 status = acpi_get_handle(handle, "_OSC", &osc_handle);
408 if (ACPI_SUCCESS(status)) { 406 if (ACPI_SUCCESS(status)) {
409 ret = pcc_cpufreq_do_osc(&osc_handle); 407 ret = pcc_cpufreq_do_osc(&osc_handle);
@@ -543,13 +541,13 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
543 541
544 if (!pcch_virt_addr) { 542 if (!pcch_virt_addr) {
545 result = -1; 543 result = -1;
546 goto pcch_null; 544 goto out;
547 } 545 }
548 546
549 result = pcc_get_offset(cpu); 547 result = pcc_get_offset(cpu);
550 if (result) { 548 if (result) {
551 dprintk("init: PCCP evaluation failed\n"); 549 dprintk("init: PCCP evaluation failed\n");
552 goto free; 550 goto out;
553 } 551 }
554 552
555 policy->max = policy->cpuinfo.max_freq = 553 policy->max = policy->cpuinfo.max_freq =
@@ -558,14 +556,15 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
558 ioread32(&pcch_hdr->minimum_frequency) * 1000; 556 ioread32(&pcch_hdr->minimum_frequency) * 1000;
559 policy->cur = pcc_get_freq(cpu); 557 policy->cur = pcc_get_freq(cpu);
560 558
559 if (!policy->cur) {
560 dprintk("init: Unable to get current CPU frequency\n");
561 result = -EINVAL;
562 goto out;
563 }
564
561 dprintk("init: policy->max is %d, policy->min is %d\n", 565 dprintk("init: policy->max is %d, policy->min is %d\n",
562 policy->max, policy->min); 566 policy->max, policy->min);
563 567out:
564 return 0;
565free:
566 pcc_clear_mapping();
567 free_percpu(pcc_cpu_info);
568pcch_null:
569 return result; 568 return result;
570} 569}
571 570
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 7ec2123838e6..3e90cce3dc8b 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -1023,13 +1023,12 @@ static int get_transition_latency(struct powernow_k8_data *data)
1023 } 1023 }
1024 if (max_latency == 0) { 1024 if (max_latency == 0) {
1025 /* 1025 /*
1026 * Fam 11h always returns 0 as transition latency. 1026 * Fam 11h and later may return 0 as transition latency. This
1027 * This is intended and means "very fast". While cpufreq core 1027 * is intended and means "very fast". While cpufreq core and
1028 * and governors currently can handle that gracefully, better 1028 * governors currently can handle that gracefully, better set it
1029 * set it to 1 to avoid problems in the future. 1029 * to 1 to avoid problems in the future.
1030 * For all others it's a BIOS bug.
1031 */ 1030 */
1032 if (boot_cpu_data.x86 != 0x11) 1031 if (boot_cpu_data.x86 < 0x11)
1033 printk(KERN_ERR FW_WARN PFX "Invalid zero transition " 1032 printk(KERN_ERR FW_WARN PFX "Invalid zero transition "
1034 "latency\n"); 1033 "latency\n");
1035 max_latency = 1; 1034 max_latency = 1;
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index ebdb85cf2686..e5cc7e82e60d 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -18,6 +18,7 @@
18#include <asm/apic.h> 18#include <asm/apic.h>
19#include <asm/iommu.h> 19#include <asm/iommu.h>
20#include <asm/gart.h> 20#include <asm/gart.h>
21#include <asm/hpet.h>
21 22
22static void __init fix_hypertransport_config(int num, int slot, int func) 23static void __init fix_hypertransport_config(int num, int slot, int func)
23{ 24{
@@ -191,6 +192,21 @@ static void __init ati_bugs_contd(int num, int slot, int func)
191} 192}
192#endif 193#endif
193 194
195/*
196 * Force the read back of the CMP register in hpet_next_event()
197 * to work around the problem that the CMP register write seems to be
198 * delayed. See hpet_next_event() for details.
199 *
200 * We do this on all SMBUS incarnations for now until we have more
201 * information about the affected chipsets.
202 */
203static void __init ati_hpet_bugs(int num, int slot, int func)
204{
205#ifdef CONFIG_HPET_TIMER
206 hpet_readback_cmp = 1;
207#endif
208}
209
194#define QFLAG_APPLY_ONCE 0x1 210#define QFLAG_APPLY_ONCE 0x1
195#define QFLAG_APPLIED 0x2 211#define QFLAG_APPLIED 0x2
196#define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) 212#define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED)
@@ -220,6 +236,8 @@ static struct chipset early_qrk[] __initdata = {
220 PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, 236 PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs },
221 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, 237 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS,
222 PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd }, 238 PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd },
239 { PCI_VENDOR_ID_ATI, PCI_ANY_ID,
240 PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_hpet_bugs },
223 {} 241 {}
224}; 242};
225 243
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 0697ff139837..4db7c4d12ffa 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -571,8 +571,8 @@ auditsys:
571 * masked off. 571 * masked off.
572 */ 572 */
573sysret_audit: 573sysret_audit:
574 movq %rax,%rsi /* second arg, syscall return value */ 574 movq RAX-ARGOFFSET(%rsp),%rsi /* second arg, syscall return value */
575 cmpq $0,%rax /* is it < 0? */ 575 cmpq $0,%rsi /* is it < 0? */
576 setl %al /* 1 if so, 0 if not */ 576 setl %al /* 1 if so, 0 if not */
577 movzbl %al,%edi /* zero-extend that into %edi */ 577 movzbl %al,%edi /* zero-extend that into %edi */
578 inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */ 578 inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index a198b7c87a12..ba390d731175 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -964,7 +964,7 @@ fs_initcall(hpet_late_init);
964 964
965void hpet_disable(void) 965void hpet_disable(void)
966{ 966{
967 if (is_hpet_capable()) { 967 if (is_hpet_capable() && hpet_virt_address) {
968 unsigned int cfg = hpet_readl(HPET_CFG); 968 unsigned int cfg = hpet_readl(HPET_CFG);
969 969
970 if (hpet_legacy_int_enabled) { 970 if (hpet_legacy_int_enabled) {
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
index 7c9f02c130f3..cafa7c80ac95 100644
--- a/arch/x86/kernel/i8259.c
+++ b/arch/x86/kernel/i8259.c
@@ -276,16 +276,6 @@ static struct sys_device device_i8259A = {
276 .cls = &i8259_sysdev_class, 276 .cls = &i8259_sysdev_class,
277}; 277};
278 278
279static int __init i8259A_init_sysfs(void)
280{
281 int error = sysdev_class_register(&i8259_sysdev_class);
282 if (!error)
283 error = sysdev_register(&device_i8259A);
284 return error;
285}
286
287device_initcall(i8259A_init_sysfs);
288
289static void mask_8259A(void) 279static void mask_8259A(void)
290{ 280{
291 unsigned long flags; 281 unsigned long flags;
@@ -407,3 +397,18 @@ struct legacy_pic default_legacy_pic = {
407}; 397};
408 398
409struct legacy_pic *legacy_pic = &default_legacy_pic; 399struct legacy_pic *legacy_pic = &default_legacy_pic;
400
401static int __init i8259A_init_sysfs(void)
402{
403 int error;
404
405 if (legacy_pic != &default_legacy_pic)
406 return 0;
407
408 error = sysdev_class_register(&i8259_sysdev_class);
409 if (!error)
410 error = sysdev_register(&device_i8259A);
411 return error;
412}
413
414device_initcall(i8259A_init_sysfs);
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 4f4af75b9482..01ab17ae2ae7 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -572,7 +572,6 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd)
572 return NOTIFY_STOP; 572 return NOTIFY_STOP;
573} 573}
574 574
575#ifdef CONFIG_KGDB_LOW_LEVEL_TRAP
576int kgdb_ll_trap(int cmd, const char *str, 575int kgdb_ll_trap(int cmd, const char *str,
577 struct pt_regs *regs, long err, int trap, int sig) 576 struct pt_regs *regs, long err, int trap, int sig)
578{ 577{
@@ -590,7 +589,6 @@ int kgdb_ll_trap(int cmd, const char *str,
590 589
591 return __kgdb_notify(&args, cmd); 590 return __kgdb_notify(&args, cmd);
592} 591}
593#endif /* CONFIG_KGDB_LOW_LEVEL_TRAP */
594 592
595static int 593static int
596kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr) 594kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr)
@@ -625,6 +623,12 @@ int kgdb_arch_init(void)
625 return register_die_notifier(&kgdb_notifier); 623 return register_die_notifier(&kgdb_notifier);
626} 624}
627 625
626static void kgdb_hw_overflow_handler(struct perf_event *event, int nmi,
627 struct perf_sample_data *data, struct pt_regs *regs)
628{
629 kgdb_ll_trap(DIE_DEBUG, "debug", regs, 0, 0, SIGTRAP);
630}
631
628void kgdb_arch_late(void) 632void kgdb_arch_late(void)
629{ 633{
630 int i, cpu; 634 int i, cpu;
@@ -655,6 +659,7 @@ void kgdb_arch_late(void)
655 for_each_online_cpu(cpu) { 659 for_each_online_cpu(cpu) {
656 pevent = per_cpu_ptr(breakinfo[i].pev, cpu); 660 pevent = per_cpu_ptr(breakinfo[i].pev, cpu);
657 pevent[0]->hw.sample_period = 1; 661 pevent[0]->hw.sample_period = 1;
662 pevent[0]->overflow_handler = kgdb_hw_overflow_handler;
658 if (pevent[0]->destroy != NULL) { 663 if (pevent[0]->destroy != NULL) {
659 pevent[0]->destroy = NULL; 664 pevent[0]->destroy = NULL;
660 release_bp_slot(*pevent); 665 release_bp_slot(*pevent);
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 345a4b1fe144..675879b65ce6 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -640,8 +640,8 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
640 /* Skip cs, ip, orig_ax and gs. */ \ 640 /* Skip cs, ip, orig_ax and gs. */ \
641 " subl $16, %esp\n" \ 641 " subl $16, %esp\n" \
642 " pushl %fs\n" \ 642 " pushl %fs\n" \
643 " pushl %ds\n" \
644 " pushl %es\n" \ 643 " pushl %es\n" \
644 " pushl %ds\n" \
645 " pushl %eax\n" \ 645 " pushl %eax\n" \
646 " pushl %ebp\n" \ 646 " pushl %ebp\n" \
647 " pushl %edi\n" \ 647 " pushl %edi\n" \
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index e72d3fc6547d..939b9e98245f 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -498,15 +498,10 @@ void force_hpet_resume(void)
498 * See erratum #27 (Misinterpreted MSI Requests May Result in 498 * See erratum #27 (Misinterpreted MSI Requests May Result in
499 * Corrupted LPC DMA Data) in AMD Publication #46837, 499 * Corrupted LPC DMA Data) in AMD Publication #46837,
500 * "SB700 Family Product Errata", Rev. 1.0, March 2010. 500 * "SB700 Family Product Errata", Rev. 1.0, March 2010.
501 *
502 * Also force the read back of the CMP register in hpet_next_event()
503 * to work around the problem that the CMP register write seems to be
504 * delayed. See hpet_next_event() for details.
505 */ 501 */
506static void force_disable_hpet_msi(struct pci_dev *unused) 502static void force_disable_hpet_msi(struct pci_dev *unused)
507{ 503{
508 hpet_msi_disable = 1; 504 hpet_msi_disable = 1;
509 hpet_readback_cmp = 1;
510} 505}
511 506
512DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, 507DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS,
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index de3b63ae3da2..a60df9ae6454 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -238,6 +238,15 @@ void __init setup_per_cpu_areas(void)
238#ifdef CONFIG_NUMA 238#ifdef CONFIG_NUMA
239 per_cpu(x86_cpu_to_node_map, cpu) = 239 per_cpu(x86_cpu_to_node_map, cpu) =
240 early_per_cpu_map(x86_cpu_to_node_map, cpu); 240 early_per_cpu_map(x86_cpu_to_node_map, cpu);
241 /*
242 * Ensure that the boot cpu numa_node is correct when the boot
243 * cpu is on a node that doesn't have memory installed.
244 * Also cpu_up() will call cpu_to_node() for APs when
245 * MEMORY_HOTPLUG is defined, before per_cpu(numa_node) is set
246 * up later with c_init aka intel_init/amd_init.
247 * So set them all (boot cpu and all APs).
248 */
249 set_cpu_numa_node(cpu, early_cpu_to_node(cpu));
241#endif 250#endif
242#endif 251#endif
243 /* 252 /*
@@ -257,14 +266,6 @@ void __init setup_per_cpu_areas(void)
257 early_per_cpu_ptr(x86_cpu_to_node_map) = NULL; 266 early_per_cpu_ptr(x86_cpu_to_node_map) = NULL;
258#endif 267#endif
259 268
260#if defined(CONFIG_X86_64) && defined(CONFIG_NUMA)
261 /*
262 * make sure boot cpu numa_node is right, when boot cpu is on the
263 * node that doesn't have mem installed
264 */
265 set_cpu_numa_node(boot_cpu_id, early_cpu_to_node(boot_cpu_id));
266#endif
267
268 /* Setup node to cpumask map */ 269 /* Setup node to cpumask map */
269 setup_node_to_cpumask_map(); 270 setup_node_to_cpumask_map();
270 271
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 3699613e8830..b1ed0a1a5913 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2926,7 +2926,7 @@ static int kvm_mmu_remove_some_alloc_mmu_pages(struct kvm *kvm)
2926 return kvm_mmu_zap_page(kvm, page) + 1; 2926 return kvm_mmu_zap_page(kvm, page) + 1;
2927} 2927}
2928 2928
2929static int mmu_shrink(int nr_to_scan, gfp_t gfp_mask) 2929static int mmu_shrink(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask)
2930{ 2930{
2931 struct kvm *kvm; 2931 struct kvm *kvm;
2932 struct kvm *kvm_freed = NULL; 2932 struct kvm *kvm_freed = NULL;
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 89d66ca4d87c..2331bdc2b549 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -342,6 +342,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
342 /* advance table_gfn when emulating 1gb pages with 4k */ 342 /* advance table_gfn when emulating 1gb pages with 4k */
343 if (delta == 0) 343 if (delta == 0)
344 table_gfn += PT_INDEX(addr, level); 344 table_gfn += PT_INDEX(addr, level);
345 access &= gw->pte_access;
345 } else { 346 } else {
346 direct = 0; 347 direct = 0;
347 table_gfn = gw->table_gfn[level - 2]; 348 table_gfn = gw->table_gfn[level - 2];
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 05d571f6f196..7fa89c39c64f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1562,7 +1562,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
1562 1562
1563 r = -ENOMEM; 1563 r = -ENOMEM;
1564 size = sizeof(struct kvm_msr_entry) * msrs.nmsrs; 1564 size = sizeof(struct kvm_msr_entry) * msrs.nmsrs;
1565 entries = vmalloc(size); 1565 entries = kmalloc(size, GFP_KERNEL);
1566 if (!entries) 1566 if (!entries)
1567 goto out; 1567 goto out;
1568 1568
@@ -1581,7 +1581,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
1581 r = n; 1581 r = n;
1582 1582
1583out_free: 1583out_free:
1584 vfree(entries); 1584 kfree(entries);
1585out: 1585out:
1586 return r; 1586 return r;
1587} 1587}
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 6fdb3ec30c31..55253095be84 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -184,6 +184,7 @@ static void __init pcibios_allocate_resources(int pass)
184 idx, r, disabled, pass); 184 idx, r, disabled, pass);
185 if (pci_claim_resource(dev, idx) < 0) { 185 if (pci_claim_resource(dev, idx) < 0) {
186 /* We'll assign a new address later */ 186 /* We'll assign a new address later */
187 dev->fw_addr[idx] = r->start;
187 r->end -= r->start; 188 r->end -= r->start;
188 r->start = 0; 189 r->start = 0;
189 } 190 }
diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c
index 7ef3a2735df3..cb29191cee58 100644
--- a/arch/x86/pci/mrst.c
+++ b/arch/x86/pci/mrst.c
@@ -66,8 +66,9 @@ static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn)
66 devfn, pos, 4, &pcie_cap)) 66 devfn, pos, 4, &pcie_cap))
67 return 0; 67 return 0;
68 68
69 if (pcie_cap == 0xffffffff) 69 if (PCI_EXT_CAP_ID(pcie_cap) == 0x0000 ||
70 return 0; 70 PCI_EXT_CAP_ID(pcie_cap) == 0xffff)
71 break;
71 72
72 if (PCI_EXT_CAP_ID(pcie_cap) == PCI_EXT_CAP_ID_VNDR) { 73 if (PCI_EXT_CAP_ID(pcie_cap) == PCI_EXT_CAP_ID_VNDR) {
73 raw_pci_ext_ops->read(pci_domain_nr(bus), bus->number, 74 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)
76 return pos; 77 return pos;
77 } 78 }
78 79
79 pos = pcie_cap >> 20; 80 pos = PCI_EXT_CAP_NEXT(pcie_cap);
80 } 81 }
81 82
82 return 0; 83 return 0;